diff options
author | Andrew Bartlett <abartlet@samba.org> | 2004-01-05 01:06:56 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2004-01-05 01:06:56 +0000 |
commit | 11bd06198b3ed4682229956fdec260a1e109ea21 (patch) | |
tree | a0ce48099769afa4c028da066dc6806abbf5156e /source3/libads | |
parent | b0682de7091f13a3493a5bb98ada8347a0350d45 (diff) | |
download | samba-11bd06198b3ed4682229956fdec260a1e109ea21.tar.gz samba-11bd06198b3ed4682229956fdec260a1e109ea21.tar.bz2 samba-11bd06198b3ed4682229956fdec260a1e109ea21.zip |
I'm not quite sure what happened here - but replace the ads_sid_to_dn
function with one that compiles.
Andrew Bartlett
(This used to be commit 0d5b0345a60741ae50f6770d9cecf698864cd209)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/ads_ldap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/libads/ads_ldap.c b/source3/libads/ads_ldap.c index 177e8632f6..776bdd2359 100644 --- a/source3/libads/ads_ldap.c +++ b/source3/libads/ads_ldap.c @@ -162,7 +162,7 @@ NTSTATUS ads_sid_to_dn(ADS_STRUCT *ads, ADS_STATUS rc; LDAPMessage *msg = NULL; LDAPMessage *entry = NULL; - char *ldap_exp = NULL; + char *ldap_exp; char *sidstr = NULL; int count; char *dn2; @@ -174,27 +174,28 @@ NTSTATUS ads_sid_to_dn(ADS_STRUCT *ads, goto done; } - if (asprintf(&ldap_exp, "(objectSid=%s)", sidstr) == -1) { - DEBUG(1,("ads_sid_to_dn: asprintf failed!\n")); + if(!(ldap_exp = talloc_asprintf(mem_ctx, "(objectSid=%s)", sidstr))) { + DEBUG(1,("ads_sid_to_dn: talloc_asprintf failed!\n")); status = NT_STATUS_NO_MEMORY; goto done; } - rc = ads_search_retry(ads, &msg, ldap_exp, NULL); + rc = ads_search_retry(ads, (void **)&msg, ldap_exp, NULL); if (!ADS_ERR_OK(rc)) { status = ads_ntstatus(rc); DEBUG(1,("ads_sid_to_dn ads_search: %s\n", ads_errstr(rc))); goto done; } - if ((count = ads_count_replies(msg)) != 1) { + if ((count = ads_count_replies(ads, msg)) != 1) { + fstring sid_string; DEBUG(1,("ads_sid_to_dn (sid=%s): Not found (count=%d)\n", - sid_to_string(sid_string, sid)), count); + sid_to_string(sid_string, sid), count)); status = NT_STATUS_UNSUCCESSFUL; goto done; } - entry = ads_first_entry(msg); + entry = ads_first_entry(ads, msg); dn2 = ads_get_dn(ads, entry); @@ -213,13 +214,12 @@ NTSTATUS ads_sid_to_dn(ADS_STRUCT *ads, status = NT_STATUS_OK; - DEBUG(3,("ads sid_to_dn mapped %s\n", *dn2)); + DEBUG(3,("ads sid_to_dn mapped %s\n", dn2)); SAFE_FREE(dn2); done: if (msg) ads_msgfree(ads, msg); - SAFE_FREE(ldap_exp); SAFE_FREE(sidstr); return status; |