tldap: Receiving "msgid == 0" means the connection is dead
authorVolker Lendecke <vl@samba.org>
Tue, 11 Aug 2020 16:09:14 +0000 (18:09 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 3 Sep 2020 13:34:11 +0000 (13:34 +0000)
We never use msgid=0, see tldap_next_msgid(). RFC4511 section 4.4.1
says that the unsolicited disconnect response uses msgid 0. We don't
parse this message, which supposedly is an extended response: Windows
up to 2019 sends an extended response in an ASN.1 encoding that does
not match RFC4511.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14465

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Aug 21 20:37:25 UTC 2020 on sn-devel-184

(cherry picked from commit ccaf661f7c75717341140e3fbfb2a48f96ea952c)

selftest/knownfail.d/ticket_expiry [deleted file]
source3/lib/tldap.c

diff --git a/selftest/knownfail.d/ticket_expiry b/selftest/knownfail.d/ticket_expiry
deleted file mode 100644 (file)
index 04e508a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-idmap_ad.ticket_expiry.timeout.DURATION.*\(ad_member_idmap_ad:local\)
index af6959ee895ab230297478028f8c64ed398a64c8..0e39a30772858055cd886280a538ec1cbde6f2e0 100644 (file)
@@ -704,6 +704,17 @@ static void tldap_msg_received(struct tevent_req *subreq)
        tldap_debug(ld, TLDAP_DEBUG_TRACE, "tldap_msg_received: got msg %d "
                    "type %d\n", id, (int)type);
 
+       if (id == 0) {
+               tldap_debug(
+                       ld,
+                       TLDAP_DEBUG_WARNING,
+                       "tldap_msg_received: got msgid 0 of "
+                       "type %"PRIu8", disconnecting\n",
+                       type);
+               tldap_context_disconnect(ld, TLDAP_SERVER_DOWN);
+               return;
+       }
+
        num_pending = talloc_array_length(ld->pending);
 
        for (i=0; i<num_pending; i++) {