summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-07-17 17:36:26 -0700
committerJeremy Allison <jra@samba.org>2009-07-17 17:36:26 -0700
commit6a9e0039100b57f9626e87defec6720c476b9789 (patch)
tree614ea76e56332e7c647514997195b6098d0e326d /source3/rpc_server
parent33251da8611ddc98c3ae73d62601218e5b784e63 (diff)
downloadsamba-6a9e0039100b57f9626e87defec6720c476b9789.tar.gz
samba-6a9e0039100b57f9626e87defec6720c476b9789.tar.bz2
samba-6a9e0039100b57f9626e87defec6720c476b9789.zip
Fix bug #6564 - SetPrinter fails (panics) as non root.
Missing become_root()/unbecome_root() around reload_services. Jeremy.
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 48ac103667..9dc1a26e3b 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -309,7 +309,9 @@ static WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const c
return WERR_BADFID; /* What to return here? */
/* go ahead and re-read the services immediately */
+ become_root();
reload_services(false);
+ unbecome_root();
if ( lp_servicenumber( sharename ) < 0 )
return WERR_ACCESS_DENIED;
@@ -6034,7 +6036,9 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEV
}
/* reload our services immediately */
+ become_root();
reload_services(false);
+ unbecome_root();
numlines = 0;
/* Get lines and convert them back to dos-codepage */