summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-05-24 13:36:20 +1000
committerAlexander Bokovoy <ab@samba.org>2012-05-24 16:21:26 +0200
commitca2b6259b7f0787eb372b56076e63413f530ec12 (patch)
treedb81b0662f2caea94a6b48b8b76d4a715f064c42
parentdc3f74a953de0fcf9b3f693efe2ba8dea7b93da9 (diff)
downloadsamba-ca2b6259b7f0787eb372b56076e63413f530ec12.tar.gz
samba-ca2b6259b7f0787eb372b56076e63413f530ec12.tar.bz2
samba-ca2b6259b7f0787eb372b56076e63413f530ec12.zip
s4-selftest: Demonstrate the correct behaviour between specified usernames and kerberos ccache
This shows that a username/password on the command line must always override any credentials cache in the environment. Andrew Bartlett
-rwxr-xr-xtestprogs/blackbox/test_passwords.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/testprogs/blackbox/test_passwords.sh b/testprogs/blackbox/test_passwords.sh
index fe8386dd34..822f0fbee6 100755
--- a/testprogs/blackbox/test_passwords.sh
+++ b/testprogs/blackbox/test_passwords.sh
@@ -72,6 +72,14 @@ testit "kinit with user password" $samba4kinit --password-file=./tmpuserpassfile
test_smbclient "Test login with user kerberos ccache" 'ls' -k yes || failed=`expr $failed + 1`
+#
+# These tests demonstrate that a credential cache in the environment does not
+# override a username/password, even an incorrect one, on the command line
+#
+
+testit_expect_failure "Test login with user kerberos ccache, but wrong password specified" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k yes -Unettestuser@$REALM%wrongpass && failed=`expr $failed + 1`
+testit_expect_failure "Test login with user kerberos ccache, but old password specified" $VALGRIND $smbclient //$SERVER/tmp -c 'ls' -k yes -Unettestuser@$REALM%$USERPASS && failed=`expr $failed + 1`
+
USERPASS=$NEWUSERPASS
WEAKPASS=testpass1