diff options
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/cldap/cldap.c | 2 | ||||
-rw-r--r-- | source4/libcli/ldap/ldap.c | 12 | ||||
-rw-r--r-- | source4/libcli/ldap/ldap.h | 18 | ||||
-rw-r--r-- | source4/libcli/ldap/ldap_ldif.c | 12 |
4 files changed, 19 insertions, 25 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c index 1674031c99..79cdff2437 100644 --- a/source4/libcli/cldap/cldap.c +++ b/source4/libcli/cldap/cldap.c @@ -679,7 +679,7 @@ NTSTATUS cldap_netlogon_reply(struct cldap_socket *cldap, response.dn = ""; response.num_attributes = 1; - response.attributes = talloc(tmp_ctx, struct ldap_attribute); + response.attributes = talloc(tmp_ctx, struct ldb_message_element); NT_STATUS_HAVE_NO_MEMORY(response.attributes); response.attributes->name = "netlogon"; response.attributes->num_values = 1; diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c index 0ac17c39bd..1a3ab6e0a5 100644 --- a/source4/libcli/ldap/ldap.c +++ b/source4/libcli/ldap/ldap.c @@ -201,7 +201,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result) asn1_write_OctetString(&data, r->dn, strlen(r->dn)); asn1_push_tag(&data, ASN1_SEQUENCE(0)); for (i=0; i<r->num_attributes; i++) { - struct ldap_attribute *attr = &r->attributes[i]; + struct ldb_message_element *attr = &r->attributes[i]; asn1_push_tag(&data, ASN1_SEQUENCE(0)); asn1_write_OctetString(&data, attr->name, strlen(attr->name)); @@ -232,7 +232,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result) asn1_push_tag(&data, ASN1_SEQUENCE(0)); for (i=0; i<r->num_mods; i++) { - struct ldap_attribute *attrib = &r->mods[i].attrib; + struct ldb_message_element *attrib = &r->mods[i].attrib; asn1_push_tag(&data, ASN1_SEQUENCE(0)); asn1_write_enumerated(&data, r->mods[i].type); asn1_push_tag(&data, ASN1_SEQUENCE(0)); @@ -268,7 +268,7 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result) asn1_push_tag(&data, ASN1_SEQUENCE(0)); for (i=0; i<r->num_attributes; i++) { - struct ldap_attribute *attrib = &r->attributes[i]; + struct ldb_message_element *attrib = &r->attributes[i]; asn1_push_tag(&data, ASN1_SEQUENCE(0)); asn1_write_OctetString(&data, attrib->name, strlen(attrib->name)); @@ -596,7 +596,7 @@ failed: static void ldap_decode_attrib(TALLOC_CTX *mem_ctx, struct asn1_data *data, - struct ldap_attribute *attrib) + struct ldb_message_element *attrib) { asn1_start_tag(data, ASN1_SEQUENCE(0)); asn1_read_OctetString_talloc(mem_ctx, data, &attrib->name); @@ -616,12 +616,12 @@ 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 ldap_attribute **attributes, + struct ldb_message_element **attributes, int *num_attributes) { asn1_start_tag(data, ASN1_SEQUENCE(0)); while (asn1_peek_tag(data, ASN1_SEQUENCE(0))) { - struct ldap_attribute attrib; + struct ldb_message_element attrib; ZERO_STRUCT(attrib); ldap_decode_attrib(mem_ctx, data, &attrib); add_attrib_to_array_talloc(mem_ctx, &attrib, diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h index f0f43e65fc..577df1fc3d 100644 --- a/source4/libcli/ldap/ldap.h +++ b/source4/libcli/ldap/ldap.h @@ -101,12 +101,6 @@ struct ldap_Result { const char *referral; }; -struct ldap_attribute { - const char *name; - int num_values; - DATA_BLOB *values; -}; - struct ldap_BindRequest { int version; const char *dn; @@ -159,7 +153,7 @@ struct ldap_SearchRequest { struct ldap_SearchResEntry { const char *dn; int num_attributes; - struct ldap_attribute *attributes; + struct ldb_message_element *attributes; }; struct ldap_SearchResRef { @@ -175,7 +169,7 @@ enum ldap_modify_type { struct ldap_mod { enum ldap_modify_type type; - struct ldap_attribute attrib; + struct ldb_message_element attrib; }; struct ldap_ModifyRequest { @@ -187,7 +181,7 @@ struct ldap_ModifyRequest { struct ldap_AddRequest { const char *dn; int num_attributes; - struct ldap_attribute *attributes; + struct ldb_message_element *attributes; }; struct ldap_DelRequest { @@ -338,10 +332,10 @@ NTSTATUS ldap2nterror(int ldaperror); /* The following definitions come from libcli/ldap/ldap_ldif.c */ BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value, - struct ldap_attribute *attrib); + struct ldb_message_element *attrib); BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx, - const struct ldap_attribute *attrib, - struct ldap_attribute **attribs, + const struct ldb_message_element *attrib, + struct ldb_message_element **attribs, int *num_attribs); BOOL add_mod_to_array_talloc(TALLOC_CTX *mem_ctx, struct ldap_mod *mod, diff --git a/source4/libcli/ldap/ldap_ldif.c b/source4/libcli/ldap/ldap_ldif.c index 0e0885c1cc..594640179e 100644 --- a/source4/libcli/ldap/ldap_ldif.c +++ b/source4/libcli/ldap/ldap_ldif.c @@ -158,7 +158,7 @@ static int next_attr(char **s, const char **attr, struct ldb_val *value) } BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value, - struct ldap_attribute *attrib) + struct ldb_message_element *attrib) { attrib->values = talloc_realloc(mem_ctx, attrib->values, @@ -174,13 +174,13 @@ BOOL add_value_to_attrib(TALLOC_CTX *mem_ctx, struct ldb_val *value, } BOOL add_attrib_to_array_talloc(TALLOC_CTX *mem_ctx, - const struct ldap_attribute *attrib, - struct ldap_attribute **attribs, + const struct ldb_message_element *attrib, + struct ldb_message_element **attribs, int *num_attribs) { *attribs = talloc_realloc(mem_ctx, *attribs, - struct ldap_attribute, + struct ldb_message_element, *num_attribs+1); if (*attribs == NULL) @@ -202,7 +202,7 @@ static BOOL fill_add_attributes(struct ldap_message *msg, char **chunk) while (next_attr(chunk, &attr_name, &value) == 0) { int i; - struct ldap_attribute *attrib = NULL; + struct ldb_message_element *attrib = NULL; for (i=0; i<r->num_attributes; i++) { if (strequal(r->attributes[i].name, attr_name)) { @@ -214,7 +214,7 @@ static BOOL fill_add_attributes(struct ldap_message *msg, char **chunk) if (attrib == NULL) { r->attributes = talloc_realloc(msg, r->attributes, - struct ldap_attribute, + struct ldb_message_element, r->num_attributes+1); if (r->attributes == NULL) return False; |