summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-09-26 12:34:58 +1000
committerAndrew Bartlett <abartlet@sn-devel-104.sn.samba.org>2010-09-26 03:29:34 +0000
commit0b5a556b76f0d05457c1c370b0f81fba124190a3 (patch)
treee226ff0e782a2ad1a908b1878c381a29b32ff95a /source4
parentc680a42504f8a3924a594c0b8363665ab6b1f2f4 (diff)
downloadsamba-0b5a556b76f0d05457c1c370b0f81fba124190a3.tar.gz
samba-0b5a556b76f0d05457c1c370b0f81fba124190a3.tar.bz2
samba-0b5a556b76f0d05457c1c370b0f81fba124190a3.zip
s4-kerberos Don't segfault if the password isn't specified in keytab generation
Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Sep 26 03:29:34 UTC 2010 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r--source4/auth/kerberos/kerberos_util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/auth/kerberos/kerberos_util.c b/source4/auth/kerberos/kerberos_util.c
index 37a5ae6f39..76edf0d05a 100644
--- a/source4/auth/kerberos/kerberos_util.c
+++ b/source4/auth/kerberos/kerberos_util.c
@@ -597,6 +597,13 @@ static krb5_error_code create_keytab(TALLOC_CTX *parent_ctx,
/* Finally, do the dance to get the password to put in the entry */
password_s = ldb_msg_find_attr_as_string(msg, "secret", NULL);
+
+ if (!password_s) {
+ /* There is no password here, so nothing to do */
+ talloc_free(mem_ctx);
+ return 0;
+ }
+
if (add_old && kvno != 0) {
old_secret = ldb_msg_find_attr_as_string(msg, "priorSecret", NULL);
} else {