r21511: this seems to be the nicer fix for the problem with
authorStefan Metzmacher <metze@samba.org>
Fri, 23 Feb 2007 07:46:51 +0000 (07:46 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:48:47 +0000 (14:48 -0500)
the windows 2000 LDAP client

metze

source/ldap_server/ldap_bind.c
source/libcli/ldap/ldap.c

index 3d5df58e210ad48d0f47542f73fbce5c6aef8ff2..c0d3e67ff282fbe78b31c43d1c82cb1fd136ef7d 100644 (file)
@@ -185,14 +185,10 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
                status = gensec_update(conn->gensec, reply,
                                       input, &output);
 
-               /* TODO: gensec should really handle the difference between NULL and length=0 better! */
-               if (output.data) {
-                       resp->SASL.secblob = talloc(reply, DATA_BLOB);
-                       NT_STATUS_HAVE_NO_MEMORY(resp->SASL.secblob);
-                       *resp->SASL.secblob = output;
-               } else {
-                       resp->SASL.secblob = NULL;
-               }
+               /* Windows 2000 mmc doesn't like secblob == NULL and reports a decoding error */
+               resp->SASL.secblob = talloc(reply, DATA_BLOB);
+               NT_STATUS_HAVE_NO_MEMORY(resp->SASL.secblob);
+               *resp->SASL.secblob = output;
        } else {
                resp->SASL.secblob = NULL;
        }
index bdcea0962da4856ec626ff224c7e78e26e1e61b2..5a7174b41dbadc095533517ad27484b654351f9e 100644 (file)
@@ -237,10 +237,6 @@ BOOL ldap_encode(struct ldap_message *msg, DATA_BLOB *result, TALLOC_CTX *mem_ct
                ldap_encode_response(&data, &r->response);
                if (r->SASL.secblob) {
                        asn1_write_ContextSimple(&data, 7, r->SASL.secblob);
-               } else {
-                       /* ugly but the windows 2000 mmc deturns decoding error without this */
-                       DATA_BLOB zero = data_blob(NULL, 0);
-                       asn1_write_ContextSimple(&data, 7, &zero);
                }
                asn1_pop_tag(&data);
                break;