diff options
author | Gerald Carter <jerry@samba.org> | 2005-01-14 21:24:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:53 -0500 |
commit | 2c33c41b0c98ee36f5c9b6a368deb1192360fd5b (patch) | |
tree | 54c32d68910eb1a4a9a2e3fbaf43b531c1b9c88a /source3/printing | |
parent | 16b2db57a72e300117097f6d6f734e2827a0cc82 (diff) | |
download | samba-2c33c41b0c98ee36f5c9b6a368deb1192360fd5b.tar.gz samba-2c33c41b0c98ee36f5c9b6a368deb1192360fd5b.tar.bz2 samba-2c33c41b0c98ee36f5c9b6a368deb1192360fd5b.zip |
r4740: allow SE_PRINT_OPERATORS to have printer admin access
(This used to be commit 85731706c9d794e8bd3f26ce9b1f881c1ee6a3ba)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index a72f63009a..a7513030bd 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -5034,6 +5034,11 @@ void map_printer_permissions(SEC_DESC *sd) print_job_delete, print_job_pause, print_job_resume, print_queue_purge + Try access control in the following order (for performance reasons): + 1) root ans SE_PRINT_OPERATOR can do anything (easy check) + 2) check security descriptor (bit comparisons in memory) + 3) "printer admins" (may result in numerous calls to winbind) + ****************************************************************************/ BOOL print_access_check(struct current_user *user, int snum, int access_type) { @@ -5050,10 +5055,9 @@ BOOL print_access_check(struct current_user *user, int snum, int access_type) if (!user) user = ¤t_user; - /* Always allow root or printer admins to do anything */ + /* Always allow root or SE_PRINT_OPERATROR to do anything */ - if (user->uid == 0 || - user_in_list(uidtoname(user->uid), lp_printer_admin(snum), user->groups, user->ngroups)) { + if ( user->uid == 0 || user_has_privilege(user->nt_user_token, SE_PRINT_OPERATOR) ) { return True; } @@ -5102,6 +5106,13 @@ BOOL print_access_check(struct current_user *user, int snum, int access_type) DEBUG(4, ("access check was %s\n", result ? "SUCCESS" : "FAILURE")); + /* see if we need to try the printer admin list */ + + if ( access_granted == 0 ) { + if ( user_in_list(uidtoname(user->uid), lp_printer_admin(snum), user->groups, user->ngroups) ) + return True; + } + talloc_destroy(mem_ctx); if (!result) |