From 3194ad2838bedee3eff60c767552d8a801b5eb70 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 28 May 2009 01:02:40 +0200 Subject: Add smbldap_pull_sid --- source3/libads/ldap.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 588c0a131c..3e5764a598 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -2619,19 +2619,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res) bool ads_pull_sid(ADS_STRUCT *ads, LDAPMessage *msg, const char *field, DOM_SID *sid) { - struct berval **values; - bool ret = False; - - values = ldap_get_values_len(ads->ldap.ld, msg, field); - - if (!values) - return False; - - if (values[0]) - ret = sid_parse(values[0]->bv_val, values[0]->bv_len, sid); - - ldap_value_free_len(values); - return ret; + return smbldap_pull_sid(ads->ldap.ld, msg, field, sid); } /** -- cgit From 0dbecbbee5018108131869b13db649a058f4359d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 28 May 2009 11:18:22 +0200 Subject: Make sid_binstring & friends take a talloc context --- source3/libads/ldap_schema.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c index b5d2d35889..a841fbdca8 100644 --- a/source3/libads/ldap_schema.c +++ b/source3/libads/ldap_schema.c @@ -122,7 +122,7 @@ const char *ads_get_attrname_by_guid(ADS_STRUCT *ads, goto done; } - guid_bin = guid_binstring(schema_guid); + guid_bin = guid_binstring(mem_ctx, schema_guid); if (!guid_bin) { goto done; } @@ -145,7 +145,7 @@ const char *ads_get_attrname_by_guid(ADS_STRUCT *ads, result = ads_pull_string(ads, mem_ctx, res, "lDAPDisplayName"); done: - SAFE_FREE(guid_bin); + TALLOC_FREE(guid_bin); ads_msgfree(ads, res); return result; -- cgit