diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-12-19 21:47:45 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-12-19 21:47:45 +0100 |
commit | 5076c64d43c68a028ac944c336715b4cb277365f (patch) | |
tree | e88fc16979b75b5b30377e84b76ebb1b87e01591 /source4/libcli/ldap/ldap.c | |
parent | 6998ef4fe021ebf40f63c2191d3259888a8ad7f4 (diff) | |
parent | 13eefa7c435cb5ac656f662c78260a82caf43180 (diff) | |
download | samba-5076c64d43c68a028ac944c336715b4cb277365f.tar.gz samba-5076c64d43c68a028ac944c336715b4cb277365f.tar.bz2 samba-5076c64d43c68a028ac944c336715b4cb277365f.zip |
Merge branch 'master' of ssh://git.samba.org/data/git/samba
Diffstat (limited to 'source4/libcli/ldap/ldap.c')
-rw-r--r-- | source4/libcli/ldap/ldap.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c index 87c89daf9f..7a65cc5c27 100644 --- a/source4/libcli/ldap/ldap.c +++ b/source4/libcli/ldap/ldap.c @@ -504,9 +504,9 @@ static const char *blob2string_talloc(TALLOC_CTX *mem_ctx, return result; } -static bool asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx, - struct asn1_data *data, - const char **result) +bool asn1_read_OctetString_talloc(TALLOC_CTX *mem_ctx, + struct asn1_data *data, + const char **result) { DATA_BLOB string; if (!asn1_read_OctetString(data, mem_ctx, &string)) @@ -894,7 +894,7 @@ failed: return NULL; } - +/* Decode a single LDAP attribute, possibly containing multiple values */ static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, struct asn1_data *data, struct ldb_message_element *attrib) { @@ -911,11 +911,11 @@ static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, struct asn1_data *data, } -static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, struct asn1_data *data, - struct ldb_message_element **attributes, - int *num_attributes) +/* Decode a set of LDAP attributes, as found in the dereference control */ +void ldap_decode_attribs_bare(TALLOC_CTX *mem_ctx, struct asn1_data *data, + struct ldb_message_element **attributes, + int *num_attributes) { - asn1_start_tag(data, ASN1_SEQUENCE(0)); while (asn1_peek_tag(data, ASN1_SEQUENCE(0))) { struct ldb_message_element attrib; ZERO_STRUCT(attrib); @@ -923,6 +923,16 @@ static void ldap_decode_attribs(TALLOC_CTX *mem_ctx, struct asn1_data *data, add_attrib_to_array_talloc(mem_ctx, &attrib, attributes, num_attributes); } +} + +/* Decode a set of LDAP attributes, as found in a search entry */ +void ldap_decode_attribs(TALLOC_CTX *mem_ctx, struct asn1_data *data, + struct ldb_message_element **attributes, + int *num_attributes) +{ + asn1_start_tag(data, ASN1_SEQUENCE(0)); + ldap_decode_attribs_bare(mem_ctx, data, + attributes, num_attributes); asn1_end_tag(data); } |