From 4f3c2d4424823df26e56c8ecbfea54d743469304 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 9 May 2005 12:52:57 +0000 Subject: r6679: BUG 2684: abartlett's patch for check the per service hosts allow/deny on printers when connecting via MS-RPC (This used to be commit 80da9ca3869380541728cb38df93d012eb20c307) --- source3/rpc_server/srv_spoolss_nt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 0f33fd7dec..7daf1630fe 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -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); -- cgit