summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-04-12 10:25:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:50:01 -0500
commitf1b2b43ba5bfcfca8d4868fec19e9f3789e40a46 (patch)
tree5e07591f82395c69036f85b9ce543f936e6fe39b
parentca1e672c6b7ae6ba235720e70253054486da29dd (diff)
downloadsamba-f1b2b43ba5bfcfca8d4868fec19e9f3789e40a46.tar.gz
samba-f1b2b43ba5bfcfca8d4868fec19e9f3789e40a46.tar.bz2
samba-f1b2b43ba5bfcfca8d4868fec19e9f3789e40a46.zip
r22187: Test kerberos logins in the smbclient blackbox tests, including with a
machine account. Andrew Bartlett (This used to be commit 16a2bb87a80ffb921f267492f453eb3457666315)
-rw-r--r--source4/auth/credentials/credentials_krb5.c4
-rwxr-xr-xsource4/script/tests/mktestdc.sh5
-rwxr-xr-xsource4/script/tests/test_blackbox.sh4
-rwxr-xr-xtestprogs/blackbox/test_smbclient.sh4
4 files changed, 14 insertions, 3 deletions
diff --git a/source4/auth/credentials/credentials_krb5.c b/source4/auth/credentials/credentials_krb5.c
index f0305fd360..7ba23ad9b6 100644
--- a/source4/auth/credentials/credentials_krb5.c
+++ b/source4/auth/credentials/credentials_krb5.c
@@ -248,6 +248,10 @@ int cli_credentials_get_ccache(struct cli_credentials *cred,
{
krb5_error_code ret;
+ if (cred->machine_account_pending) {
+ cli_credentials_set_machine_account(cred);
+ }
+
if (cred->ccache_obtained >= (MAX(cred->principal_obtained,
cred->username_obtained))) {
*ccc = cred->ccache;
diff --git a/source4/script/tests/mktestdc.sh b/source4/script/tests/mktestdc.sh
index bbf2e2b395..4b92fe3a3c 100755
--- a/source4/script/tests/mktestdc.sh
+++ b/source4/script/tests/mktestdc.sh
@@ -210,6 +210,11 @@ cat >$KRB5_CONFIG<<EOF
admin_server = 127.0.0.1:88
default_domain = $DNSNAME
}
+ $DNSNAME = {
+ kdc = 127.0.0.1:88
+ admin_server = 127.0.0.1:88
+ default_domain = $DNSNAME
+ }
$DOMAIN = {
kdc = 127.0.0.1:88
admin_server = 127.0.0.1:88
diff --git a/source4/script/tests/test_blackbox.sh b/source4/script/tests/test_blackbox.sh
index ea50761d9a..9adafcb332 100755
--- a/source4/script/tests/test_blackbox.sh
+++ b/source4/script/tests/test_blackbox.sh
@@ -16,5 +16,5 @@ ADDARGS="$*"
incdir=`dirname $0`
. $incdir/test_functions.sh
-plantest "blackbox.smbclient" dc $incdir/../../../testprogs/blackbox/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" "$ADDARGS"
-plantest "blackbox.cifsdd" dc $incdir/../../../testprogs/blackbox/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$ADDARGS"
+plantest "blackbox.smbclient" dc $incdir/../../../testprogs/blackbox/test_smbclient.sh "\$NETBIOSNAME" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" "$ADDARGS"
+plantest "blackbox.cifsdd" dc $incdir/../../../testprogs/blackbox/test_cifsdd.sh "\$NETBIOSNAME" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$ADDARGS"
diff --git a/testprogs/blackbox/test_smbclient.sh b/testprogs/blackbox/test_smbclient.sh
index a3bd958cc8..413b680a52 100755
--- a/testprogs/blackbox/test_smbclient.sh
+++ b/testprogs/blackbox/test_smbclient.sh
@@ -96,7 +96,9 @@ echo rm tmpfilex | runcmd "Removing file" || failed=`expr $failed + 1`
echo ls | runcmd "List directory with LANMAN1" -m LANMAN1 || failed=`expr $failed + 1`
echo ls | runcmd "List directory with LANMAN2" -m LANMAN2 || failed=`expr $failed + 1`
-echo ls | testit "Test login with --machine-pass" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass || failed=`expr $failed + 1`
+echo ls | testit "Test login with --machine-pass without kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k no || failed=`expr $failed + 1`
+
+echo ls | testit "Test login with --machine-pass and kerberos" $VALGRIND bin/smbclient $CONFIGURATION //$SERVER/tmp --machine-pass -k yes || failed=`expr $failed + 1`
(
echo "password=$PASSWORD"