From: Garming Sam Date: Wed, 16 Dec 2015 21:33:54 +0000 (+1300) Subject: ldap: fix search control rule identifiers ASN.1 type X-Git-Tag: tdb-1.3.9~479 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b650a5ab3601be96377022ce9f98b5817fb4aa3;p=thirdparty%2Fsamba.git ldap: fix search control rule identifiers ASN.1 type Wireshark and Windows both expect matching rule identifiers to be given the ContextSimple type identifier instead of the Octet String. As far as we can tell this is not formally specified anywhere. Pair-programmed-with: Douglas Bagnall Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett --- diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c index 0a23cc79a47..98e690d0505 100644 --- a/source4/libcli/ldap/ldap_controls.c +++ b/source4/libcli/ldap/ldap_controls.c @@ -757,7 +757,8 @@ static bool encode_server_sort_request(void *mem_ctx, void *in, DATA_BLOB *out) } if (lssc[num]->orderingRule) { - if (!asn1_write_OctetString(data, lssc[num]->orderingRule, strlen(lssc[num]->orderingRule))) { + DATA_BLOB order = data_blob_string_const(lssc[num]->orderingRule); + if (!asn1_write_ContextSimple(data, 0, &order)) { return false; } }