summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-30 11:19:42 +0200
committerGünther Deschner <gd@samba.org>2009-04-30 11:22:23 +0200
commitd22965e2e596c8ad78f5330398d43d96bf564773 (patch)
tree8e1d0837fe7497a979fc7dd66f0c9a77b41a31c5 /source3/rpc_server
parent233bfb25c9443688f74c506348b0a7b34489e1d1 (diff)
downloadsamba-d22965e2e596c8ad78f5330398d43d96bf564773.tar.gz
samba-d22965e2e596c8ad78f5330398d43d96bf564773.tar.bz2
samba-d22965e2e596c8ad78f5330398d43d96bf564773.zip
s3-spoolss: avoid referring to uid 0 in spoolss server (use sec_initial_uid() instead).
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index a4c994a193..57410d0539 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1639,7 +1639,7 @@ WERROR _spoolss_OpenPrinterEx(pipes_struct *p,
/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
and not a printer admin, then fail */
- if ((p->server_info->utok.uid != 0) &&
+ if ((p->server_info->utok.uid != sec_initial_uid()) &&
!user_has_privileges(p->server_info->ptok,
&se_printop ) &&
!token_contains_name_in_list(
@@ -2117,7 +2117,7 @@ WERROR _spoolss_DeletePrinterDriver(pipes_struct *p,
/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
and not a printer admin, then fail */
- if ( (p->server_info->utok.uid != 0)
+ if ( (p->server_info->utok.uid != sec_initial_uid())
&& !user_has_privileges(p->server_info->ptok, &se_printop )
&& !token_contains_name_in_list(
uidtoname(p->server_info->utok.uid), NULL,
@@ -2217,7 +2217,7 @@ WERROR _spoolss_DeletePrinterDriverEx(pipes_struct *p,
/* if the user is not root, doesn't have SE_PRINT_OPERATOR privilege,
and not a printer admin, then fail */
- if ( (p->server_info->utok.uid != 0)
+ if ( (p->server_info->utok.uid != sec_initial_uid())
&& !user_has_privileges(p->server_info->ptok, &se_printop )
&& !token_contains_name_in_list(
uidtoname(p->server_info->utok.uid), NULL, NULL,