diff options
author | Andrew Tridgell <tridge@samba.org> | 2001-12-20 23:35:14 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2001-12-20 23:35:14 +0000 |
commit | 401c7495ea0286a46c97a18273419f122d1168a7 (patch) | |
tree | f8188b6ecd748cb155eee7b39354ca3791f2ae12 /source3/nsswitch | |
parent | 9ed10f83d76eba1c4d4ac19842314f24db1c7a65 (diff) | |
download | samba-401c7495ea0286a46c97a18273419f122d1168a7.tar.gz samba-401c7495ea0286a46c97a18273419f122d1168a7.tar.bz2 samba-401c7495ea0286a46c97a18273419f122d1168a7.zip |
added ads_domain_sid() function
(This used to be commit ff002a458afa6ca378f0c6d2ec9fb74233c839a7)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/winbindd_ads.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c index 8d0c78b2d5..a0d35030bf 100644 --- a/source3/nsswitch/winbindd_ads.c +++ b/source3/nsswitch/winbindd_ads.c @@ -706,7 +706,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, char ***names, DOM_SID **dom_sids) { - ADS_STRUCT *ads = NULL; + ADS_STRUCT *ads; ADS_STATUS rc; *num_domains = 0; @@ -723,25 +723,15 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain, /* find the domain sid for a domain */ static NTSTATUS domain_sid(struct winbindd_domain *domain, DOM_SID *sid) { - NTSTATUS status = NT_STATUS_UNSUCCESSFUL; - const char *attrs[] = {"objectSid", NULL}; - ADS_STRUCT *ads = NULL; - void *res; + ADS_STRUCT *ads; ADS_STATUS rc; ads = ads_cached_connection(domain); - if (!ads) goto done; + if (!ads) return NT_STATUS_UNSUCCESSFUL; - rc = ads_do_search(ads, ads->bind_path, LDAP_SCOPE_BASE, "(objectclass=*)", - attrs, &res); - if (!ADS_ERR_OK(rc)) goto done; - if (ads_pull_sid(ads, res, "objectSid", sid)) { - status = NT_STATUS_OK; - } - ads_msgfree(ads, res); + rc = ads_domain_sid(ads, sid); -done: - return status; + return ads_ntstatus(rc); } /* the ADS backend methods are exposed via this structure */ |