summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_spoolss_nt.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-05-09 12:52:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:56:51 -0500
commit4f3c2d4424823df26e56c8ecbfea54d743469304 (patch)
tree5159b60a1ac9084ccedb7973f5a2ed740ef34ee9 /source3/rpc_server/srv_spoolss_nt.c
parent3c181a88c6c03cde3d6abb917c656bbe6be8a130 (diff)
downloadsamba-4f3c2d4424823df26e56c8ecbfea54d743469304.tar.gz
samba-4f3c2d4424823df26e56c8ecbfea54d743469304.tar.bz2
samba-4f3c2d4424823df26e56c8ecbfea54d743469304.zip
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)
Diffstat (limited to 'source3/rpc_server/srv_spoolss_nt.c')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c5
1 files changed, 5 insertions, 0 deletions
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);