summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/ldap/ldap.c20
-rw-r--r--source4/libcli/ldap/ldap.h2
2 files changed, 17 insertions, 5 deletions
diff --git a/source4/libcli/ldap/ldap.c b/source4/libcli/ldap/ldap.c
index af21962265..a2f8e91b6c 100644
--- a/source4/libcli/ldap/ldap.c
+++ b/source4/libcli/ldap/ldap.c
@@ -589,14 +589,15 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result)
asn1_push_tag(&data, ASN1_SEQUENCE(0));
asn1_write_OctetString(&data, r->attribute,
strlen(r->attribute));
- asn1_write_OctetString(&data, r->value,
- strlen(r->value));
+ asn1_write_OctetString(&data, r->value.data,
+ r->value.length);
asn1_pop_tag(&data);
asn1_pop_tag(&data);
break;
}
case LDAP_TAG_CompareResponse: {
-/* struct ldap_Result *r = &msg->r.CompareResponse; */
+ struct ldap_Result *r = &msg->r.ModifyDNResponse;
+ ldap_encode_response(msg->type, r, &data);
break;
}
case LDAP_TAG_AbandonRequest: {
@@ -1070,8 +1071,19 @@ BOOL ldap_decode(ASN1_DATA *data, struct ldap_message *msg)
}
case ASN1_APPLICATION(LDAP_TAG_CompareRequest): {
-/* struct ldap_CompareRequest *r = &msg->r.CompareRequest; */
+ struct ldap_CompareRequest *r = &msg->r.CompareRequest;
msg->type = LDAP_TAG_CompareRequest;
+ asn1_start_tag(data,
+ ASN1_APPLICATION(LDAP_TAG_CompareRequest));
+ asn1_read_OctetString_talloc(msg->mem_ctx, data, &r->dn);
+ asn1_start_tag(data, ASN1_SEQUENCE(0));
+ asn1_read_OctetString_talloc(msg->mem_ctx, data, &r->attribute);
+ asn1_read_OctetString(data, &r->value);
+ if (r->value.data) {
+ talloc_steal(msg->mem_ctx, r->value.data);
+ }
+ asn1_end_tag(data);
+ asn1_end_tag(data);
break;
}
diff --git a/source4/libcli/ldap/ldap.h b/source4/libcli/ldap/ldap.h
index ca546e11e1..c0d16e67a3 100644
--- a/source4/libcli/ldap/ldap.h
+++ b/source4/libcli/ldap/ldap.h
@@ -169,7 +169,7 @@ struct ldap_ModifyDNRequest {
struct ldap_CompareRequest {
const char *dn;
const char *attribute;
- const char *value;
+ DATA_BLOB value;
};
struct ldap_AbandonRequest {