diff options
author | Gerald Carter <jerry@samba.org> | 2003-01-21 01:20:48 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-01-21 01:20:48 +0000 |
commit | 3b3551985755392970d6bf518ca739b6774915bd (patch) | |
tree | b8110b00a63b574e407cb36256d7bcc860921c37 /source3/libads/ldap.c | |
parent | ebe53e592a1e7ad855774786efae253bd226c656 (diff) | |
download | samba-3b3551985755392970d6bf518ca739b6774915bd.tar.gz samba-3b3551985755392970d6bf518ca739b6774915bd.tar.bz2 samba-3b3551985755392970d6bf518ca739b6774915bd.zip |
sanity checks from Ken Cross
(This used to be commit ec26877f0b4fbe2c651a6069d22b9ac0637aa2d1)
Diffstat (limited to 'source3/libads/ldap.c')
-rw-r--r-- | source3/libads/ldap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 1743bc2dd6..0a95e019bf 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -1429,7 +1429,11 @@ ADS_STATUS ads_set_machine_sd(ADS_STRUCT *ads, const char *hostname, char *dn) if (!ADS_ERR_OK(ret)) return ret; - msg = ads_first_entry(ads, res); + if ( !(msg = ads_first_entry(ads, res) )) { + ret = ADS_ERROR(LDAP_NO_RESULTS_RETURNED); + goto ads_set_sd_error; + } + ads_pull_sid(ads, msg, attrs[1], &sid); if (!(ctx = talloc_init("sec_io_desc"))) { ret = ADS_ERROR(LDAP_NO_MEMORY); |