summaryrefslogtreecommitdiff
path: root/source3/rpc_server/spoolss
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2012-06-22 15:38:25 +0200
committerAndreas Schneider <asn@samba.org>2012-07-03 21:56:49 +0200
commit98ab0740946f8ffff72e96465270efaea01e9459 (patch)
tree2a03ae212c89f75bac2154c0ce7c734a2ab64de8 /source3/rpc_server/spoolss
parentc87acebd7e8d0a28064699564088fb558c34c4f2 (diff)
downloadsamba-98ab0740946f8ffff72e96465270efaea01e9459.tar.gz
samba-98ab0740946f8ffff72e96465270efaea01e9459.tar.bz2
samba-98ab0740946f8ffff72e96465270efaea01e9459.zip
s3-printing: Remove deprecated lp_printer_admin().
Diffstat (limited to 'source3/rpc_server/spoolss')
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c56
1 files changed, 14 insertions, 42 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 8278ae8390..b67d571807 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -1811,13 +1811,8 @@ WERROR _spoolss_OpenPrinterEx(struct pipes_struct *p,
if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
!security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) &&
- !nt_token_check_sid(&global_sid_Builtin_Print_Operators, p->session_info->security_token) &&
- !token_contains_name_in_list(
- uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token,
- lp_printer_admin(snum))) {
+ !nt_token_check_sid(&global_sid_Builtin_Print_Operators,
+ p->session_info->security_token)) {
close_printer_handle(p, r->out.handle);
ZERO_STRUCTP(r->out.handle);
DEBUG(3,("access DENIED as user is not root, "
@@ -2081,15 +2076,9 @@ WERROR _spoolss_DeletePrinterDriver(struct 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->session_info->unix_token->uid != sec_initial_uid())
- && !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR)
- && !token_contains_name_in_list(
- uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token,
- lp_printer_admin(-1)) )
- {
+ if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
+ !security_token_has_privilege(p->session_info->security_token,
+ SEC_PRIV_PRINT_OPERATOR)) {
return WERR_ACCESS_DENIED;
}
@@ -2226,14 +2215,9 @@ WERROR _spoolss_DeletePrinterDriverEx(struct 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->session_info->unix_token->uid != sec_initial_uid())
- && !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR)
- && !token_contains_name_in_list(
- uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token, lp_printer_admin(-1)) )
- {
+ if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
+ !security_token_has_privilege(p->session_info->security_token,
+ SEC_PRIV_PRINT_OPERATOR)) {
return WERR_ACCESS_DENIED;
}
@@ -8664,12 +8648,8 @@ WERROR _spoolss_AddForm(struct pipes_struct *p,
and not a printer admin, then fail */
if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
- !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) &&
- !token_contains_name_in_list(uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token,
- lp_printer_admin(snum))) {
+ !security_token_has_privilege(p->session_info->security_token,
+ SEC_PRIV_PRINT_OPERATOR)) {
DEBUG(2,("_spoolss_Addform: denied by insufficient permissions.\n"));
return WERR_ACCESS_DENIED;
}
@@ -8742,12 +8722,8 @@ WERROR _spoolss_DeleteForm(struct pipes_struct *p,
}
if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
- !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) &&
- !token_contains_name_in_list(uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token,
- lp_printer_admin(snum))) {
+ !security_token_has_privilege(p->session_info->security_token,
+ SEC_PRIV_PRINT_OPERATOR)) {
DEBUG(2,("_spoolss_DeleteForm: denied by insufficient permissions.\n"));
return WERR_ACCESS_DENIED;
}
@@ -8816,12 +8792,8 @@ WERROR _spoolss_SetForm(struct pipes_struct *p,
and not a printer admin, then fail */
if ((p->session_info->unix_token->uid != sec_initial_uid()) &&
- !security_token_has_privilege(p->session_info->security_token, SEC_PRIV_PRINT_OPERATOR) &&
- !token_contains_name_in_list(uidtoname(p->session_info->unix_token->uid),
- p->session_info->info->domain_name,
- NULL,
- p->session_info->security_token,
- lp_printer_admin(snum))) {
+ !security_token_has_privilege(p->session_info->security_token,
+ SEC_PRIV_PRINT_OPERATOR)) {
DEBUG(2,("_spoolss_Setform: denied by insufficient permissions.\n"));
return WERR_ACCESS_DENIED;
}