s3:libads: net ads keytab list fails with "Key table name malformed"
authorNoel Power <noel.power@suse.com>
Thu, 23 Nov 2017 15:55:21 +0000 (15:55 +0000)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 29 Nov 2017 20:48:17 +0000 (21:48 +0100)
When keytab_name is NULL don't call smb_krb5_kt_open use ads_keytab_open
instead, this function will determine the correct keytab to use.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13166

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libads/kerberos_keytab.c

index ff12ec04af689b3f27de563138045824a64ca0f4..ffd100c5636b273b0a76e059dc76f1d93133f290 100644 (file)
@@ -639,7 +639,11 @@ int ads_keytab_list(const char *keytab_name)
                return ret;
        }
 
-       ret = smb_krb5_kt_open(context, keytab_name, False, &keytab);
+       if (keytab_name == NULL) {
+               ret = ads_keytab_open(context, &keytab);
+       } else {
+               ret = smb_krb5_kt_open(context, keytab_name, False, &keytab);
+       }
        if (ret) {
                DEBUG(1, ("smb_krb5_kt_open failed (%s)\n",
                          error_message(ret)));