From 9393d95f22276a5374f991746d48050fe0be47c5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 23 May 2018 14:23:17 +0200 Subject: [PATCH] smbd: remove useless allow_access() check for AS_GUEST We already call allow_access() when we accept the connection in smbd_add_connection(). Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/smbd/process.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/source3/smbd/process.c b/source3/smbd/process.c index cf307b00072..e0528f3498c 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -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; - } } /*