From 19c99976dad0c4d005811cb7c17336f5a1645acd Mon Sep 17 00:00:00 2001 From: Noel Power Date: Thu, 23 Nov 2017 15:55:21 +0000 Subject: [PATCH] s3:libads: net ads keytab list fails with "Key table name malformed" 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 Reviewed-by: Andreas Schneider Reviewed-by: Ralph Boehme (cherry picked from commit 3048ae318fc8b4d1b7663826972306372430a463) --- source3/libads/kerberos_keytab.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c index ff12ec04af6..ffd100c5636 100644 --- a/source3/libads/kerberos_keytab.c +++ b/source3/libads/kerberos_keytab.c @@ -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)));