diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-06-10 11:45:13 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-06-10 11:45:53 +1000 |
commit | a5003de56beefa800858b60bb62545c1ad324922 (patch) | |
tree | 985336e3b473b7415f646d0bbdd1aa81c551980d /source4/libcli | |
parent | d42019644bdad2b0810d054e72378026a02dc295 (diff) | |
download | samba-a5003de56beefa800858b60bb62545c1ad324922.tar.gz samba-a5003de56beefa800858b60bb62545c1ad324922.tar.xz samba-a5003de56beefa800858b60bb62545c1ad324922.zip |
fixed the encoding/decoding of the reverse attribute for server side sort
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap_controls.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c index 7949758a80c..48ac5424a0b 100644 --- a/source4/libcli/ldap/ldap_controls.c +++ b/source4/libcli/ldap/ldap_controls.c @@ -126,9 +126,9 @@ static bool decode_server_sort_request(void *mem_ctx, DATA_BLOB in, void *_out) } } - if (asn1_peek_tag(data, ASN1_BOOLEAN)) { + if (asn1_peek_tag(data, ASN1_CONTEXT_SIMPLE(1))) { bool reverse; - if (!asn1_read_BOOLEAN(data, &reverse)) { + if (!asn1_read_BOOLEAN_context(data, &reverse, 1)) { return false; } lssc[num]->reverse = reverse; @@ -688,6 +688,13 @@ static bool encode_server_sort_request(void *mem_ctx, void *in, DATA_BLOB *out) return false; } + /* + RFC2891 section 1.1: + SortKeyList ::= SEQUENCE OF SEQUENCE { + attributeType AttributeDescription, + orderingRule [0] MatchingRuleId OPTIONAL, + reverseOrder [1] BOOLEAN DEFAULT FALSE } + */ for (num = 0; lssc[num]; num++) { if (!asn1_push_tag(data, ASN1_SEQUENCE(0))) { return false; @@ -704,7 +711,7 @@ static bool encode_server_sort_request(void *mem_ctx, void *in, DATA_BLOB *out) } if (lssc[num]->reverse) { - if (!asn1_write_BOOLEAN(data, lssc[num]->reverse)) { + if (!asn1_write_BOOLEAN_context(data, lssc[num]->reverse, 1)) { return false; } } |