r22187: Test kerberos logins in the smbclient blackbox tests, including with a
authorAndrew Bartlett <abartlet@samba.org>
Thu, 12 Apr 2007 10:25:01 +0000 (10:25 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:50:01 +0000 (14:50 -0500)
machine account.

Andrew Bartlett
(This used to be commit 16a2bb87a80ffb921f267492f453eb3457666315)

source4/auth/credentials/credentials_krb5.c
source4/script/tests/mktestdc.sh
source4/script/tests/test_blackbox.sh
testprogs/blackbox/test_smbclient.sh

index f0305fd3605c0daa9df5d155532786bcdb0e10d1..7ba23ad9b6221af3b33560d2b52bd5d4d4ae184d 100644 (file)
@@ -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;
index bbf2e2b395b927a41567a05c19ff8271975a11e3..4b92fe3a3cbfe69ada712c783a2f6c35798ca424 100755 (executable)
@@ -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
index ea50761d9aee22891c14cb938b76c59205c28d9e..9adafcb332c8d5a298ad82bda40ed273c2d97195 100755 (executable)
@@ -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"
index a3bd958cc81ad303843bfc003e51bbb8b37b9317..413b680a529604a5d906f1e16525905349d48fee 100755 (executable)
@@ -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"