]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: remove useless allow_access() check for AS_GUEST
authorStefan Metzmacher <metze@samba.org>
Wed, 23 May 2018 12:23:17 +0000 (14:23 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2018 18:52:23 +0000 (20:52 +0200)
We already call allow_access() when we accept the connection
in smbd_add_connection().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/process.c

index cf307b000727a4df1872a43e36e43994e4543104..e0528f3498cc83abb63061b88c6ca079747b92dd 100644 (file)
@@ -1661,33 +1661,10 @@ static connection_struct *switch_message(uint8_t type, struct smb_request *req)
         * messenger service requests have this...)
         */
        if (flags & AS_GUEST) {
-               char *raddr;
-               bool ok;
-
                if (!change_to_guest()) {
                        reply_nterror(req, NT_STATUS_ACCESS_DENIED);
                        return conn;
                }
-
-               raddr = tsocket_address_inet_addr_string(xconn->remote_address,
-                                                        talloc_tos());
-               if (raddr == NULL) {
-                       reply_nterror(req, NT_STATUS_NO_MEMORY);
-                       return conn;
-               }
-
-               /*
-                * Haven't we checked this in smbd_process already???
-                */
-
-               ok = allow_access(lp_hosts_deny(-1), lp_hosts_allow(-1),
-                                 xconn->remote_hostname, raddr);
-               TALLOC_FREE(raddr);
-
-               if (!ok) {
-                       reply_nterror(req, NT_STATUS_ACCESS_DENIED);
-                       return conn;
-               }
        }
 
        /*