summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-09-29 12:18:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:29 -0500
commit88ead90b1d6f7e32181b5e9bf2b48cf0ef0b7c95 (patch)
tree390b26028b62f61880049230c537656b44ef96b1 /source4/libcli
parente0aeffbc85ae42c56970237759d5521ee224826b (diff)
downloadsamba-88ead90b1d6f7e32181b5e9bf2b48cf0ef0b7c95.tar.gz
samba-88ead90b1d6f7e32181b5e9bf2b48cf0ef0b7c95.tar.bz2
samba-88ead90b1d6f7e32181b5e9bf2b48cf0ef0b7c95.zip
r2747: use DATA_BLOB for attribute values
en/decode CompareRequest/Response correct metze (This used to be commit 72dfea2b07aea83d0965a585f6e388eb88a7c6d1)
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 {