Commit dd451777 authored by Simon McVittie's avatar Simon McVittie

test: Add a test-case for EXTERNAL auth rejecting usernames

Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104588
parent 8a4928af
......@@ -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 \
......
# 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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment