r6679: BUG 2684: abartlett's patch for check the per service hosts allow/deny on...
authorGerald Carter <jerry@samba.org>
Mon, 9 May 2005 12:52:57 +0000 (12:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:56:51 +0000 (10:56 -0500)
(This used to be commit 80da9ca3869380541728cb38df93d012eb20c307)

source3/rpc_server/srv_spoolss_nt.c

index 0f33fd7dec87c113b6167ae8069982652dca5979..7daf1630fe2e3545896b061a497d2dd0f7846826 100644 (file)
@@ -1730,6 +1730,11 @@ WERROR _spoolss_open_printer_ex( pipes_struct *p, SPOOL_Q_OPEN_PRINTER_EX *q_u,
 
                /* check smb.conf parameters and the the sec_desc */
                
+               if ( !check_access(smbd_server_fd(), lp_hostsallow(snum), lp_hostsdeny(snum)) ) {    
+                       DEBUG(3, ("access DENIED (hosts allow/deny) for printer open\n"));
+                       return WERR_ACCESS_DENIED;
+               }
+
                if (!user_ok(uidtoname(user.uid), snum, user.groups, user.ngroups) || !print_access_check(&user, snum, printer_default->access_required)) {
                        DEBUG(3, ("access DENIED for printer open\n"));
                        close_printer_handle(p, handle);