s3-spoolss: avoid referring to uid 0 in spoolss server (use sec_initial_uid() instead).
authorGünther Deschner <gd@samba.org>
Thu, 30 Apr 2009 09:19:42 +0000 (11:19 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 30 Apr 2009 09:22:23 +0000 (11:22 +0200)
Guenther

source3/rpc_server/srv_spoolss_nt.c

index a4c994a19333cadc45a52bb691c2d28d82cca73a..57410d0539020397f3e43c42cb566033c4e18ac4 100644 (file)
@@ -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,