summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorUri Simchoni <urisimchoni@gmail.com>2015-09-23 14:45:47 +0300
committerKarolin Seeger <kseeger@samba.org>2015-10-05 09:41:29 +0200
commit3cea564cd98959098144d1f77a617076b203bece (patch)
tree1178542c64d31db19b44923d522ae56647b64cf2 /source3
parent374769986a0b35e10816c1777691de37ae32c52e (diff)
downloadsamba-3cea564cd98959098144d1f77a617076b203bece.tar.gz
net: fix a crash with net ads keytab create
Fix a crash that happens when executing "net ads keytab create" and the machine account in AD does not have setvice principal names attached to it. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11528 Signed-off-by: Uri Simchoni <urisimchoni@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> (cherry picked from commit e224e622971853bddbe24df717ea5dcddef71b89)
Diffstat (limited to 'source3')
-rw-r--r--source3/libads/ldap.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 87631641ff1..2e38df180e5 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2076,6 +2076,13 @@ ADS_STATUS ads_get_service_principal_names(TALLOC_CTX *mem_ctx,
res,
"servicePrincipalName",
num_spns);
+ if (*spn_array == NULL) {
+ DEBUG(1, ("Host account for %s does not have service principal "
+ "names.\n",
+ machine_name));
+ status = ADS_ERROR(LDAP_NO_SUCH_OBJECT);
+ goto done;
+ }
done:
ads_msgfree(ads, res);