mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-06-19 09:38:27 +02:00
test: Add a test-case for EXTERNAL auth rejecting usernames
Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104588
This commit is contained in:
parent
8a4928af76
commit
dd451777e3
2 changed files with 25 additions and 0 deletions
|
|
@ -477,6 +477,7 @@ static_data = \
|
|||
data/auth/external-root.auth-script \
|
||||
data/auth/external-silly.auth-script \
|
||||
data/auth/external-successful.auth-script \
|
||||
data/auth/external-username.auth-script \
|
||||
data/auth/extra-bytes.auth-script \
|
||||
data/auth/fail-after-n-attempts.auth-script \
|
||||
data/auth/fallback.auth-script \
|
||||
|
|
|
|||
24
test/data/auth/external-username.auth-script
Normal file
24
test/data/auth/external-username.auth-script
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
# Assert that EXTERNAL authentication accepts numeric uids, but not
|
||||
# login names.
|
||||
|
||||
# This only works on Unix because USERNAME_HEX is unimplemented on Windows
|
||||
# (but no authentication mechanism uses usernames there anyway).
|
||||
UNIX_ONLY
|
||||
SERVER
|
||||
EXPECT_HAVE_NO_CREDENTIALS
|
||||
|
||||
# C: "I claim that I am smcv"
|
||||
SEND 'AUTH EXTERNAL USERNAME_HEX'
|
||||
# S: (doesn't want to look up smcv in NSS or /etc/passwd)
|
||||
EXPECT_COMMAND REJECTED
|
||||
EXPECT_STATE WAITING_FOR_INPUT
|
||||
EXPECT_HAVE_NO_CREDENTIALS
|
||||
|
||||
# C: "OK, how about I claim that I am uid 1000?"
|
||||
SEND 'AUTH EXTERNAL USERID_HEX'
|
||||
# S: (is happier)
|
||||
EXPECT_COMMAND OK
|
||||
EXPECT_STATE WAITING_FOR_INPUT
|
||||
SEND 'BEGIN'
|
||||
EXPECT_STATE AUTHENTICATED
|
||||
EXPECT_HAVE_SOME_CREDENTIALS
|
||||
Loading…
Add table
Reference in a new issue