s3:libsmb: Check disable_netbios in socket connect
authorJustin Stephenson <jstephen@redhat.com>
Thu, 3 Jan 2019 17:07:01 +0000 (12:07 -0500)
committerNoel Power <npower@samba.org>
Wed, 9 Jan 2019 17:40:44 +0000 (18:40 +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.

Signed-off-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Noel Power <nopower@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/smbsock_connect.c

index 9f915e1..bb3cb07 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,