s3:libsmb: Check disable_netbios in socket connect
authorJustin Stephenson <jstephen@redhat.com>
Thu, 3 Jan 2019 17:07:01 +0000 (12:07 -0500)
committerKarolin Seeger <kseeger@samba.org>
Fri, 1 Feb 2019 10:34:09 +0000 (11:34 +0100)
If the disable_netbios option is set then return NT_STATUS_NOT_SUPPORTED
for a port 139 connection in the low level socket connection code.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13727

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Noel Power <nopower@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 78f51a1d3c53248159c1e7643364b62e52457bb9)

source3/libsmb/smbsock_connect.c

index 9f915e1bb42b44d6ad48a90e7637d6e9bb278422..bb3cb07646cdd3fa3dcee484fd46b09cd6cfa5e6 100644 (file)
@@ -376,6 +376,11 @@ struct tevent_req *smbsock_connect_send(TALLOC_CTX *mem_ctx,
        tevent_req_set_cleanup_fn(req, smbsock_connect_cleanup);
 
        if (port == NBT_SMB_PORT) {
+               if (lp_disable_netbios()) {
+                       tevent_req_nterror(req, NT_STATUS_NOT_SUPPORTED);
+                       return tevent_req_post(req, ev);
+               }
+
                state->req_139 = nb_connect_send(state, state->ev, state->addr,
                                                 state->called_name,
                                                 state->called_type,