diff options
author | Volker Lendecke <vl@samba.org> | 2008-06-24 16:03:28 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-06-26 13:13:23 +0200 |
commit | a3c0be63256b7db6325d8dcb599497e8e7905f08 (patch) | |
tree | ab10bc82f5222b9ca22fcbf3deb8b7a2a5913bfa /source3/printing/nt_printing.c | |
parent | aa02c3fcd580a9e53b87d885fb87fb71f138bb7d (diff) | |
download | samba-a3c0be63256b7db6325d8dcb599497e8e7905f08.tar.gz samba-a3c0be63256b7db6325d8dcb599497e8e7905f08.tar.bz2 samba-a3c0be63256b7db6325d8dcb599497e8e7905f08.zip |
Change print_access_check to take auth_serversupplied_info instead of current_user
Reason: This is the main user of p->current_user which I would like to remove
(This used to be commit fd43059b3dfa8cdac9814de1c76f963ba5de9bcb)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index c13ab5a180..68d4a2ffd6 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -5763,7 +5763,8 @@ void map_job_permissions(SEC_DESC *sd) 3) "printer admins" (may result in numerous calls to winbind) ****************************************************************************/ -bool print_access_check(struct current_user *user, int snum, int access_type) +bool print_access_check(struct auth_serversupplied_info *server_info, int snum, + int access_type) { SEC_DESC_BUF *secdesc = NULL; uint32 access_granted; @@ -5775,12 +5776,10 @@ bool print_access_check(struct current_user *user, int snum, int access_type) /* If user is NULL then use the current_user structure */ - if (!user) - user = ¤t_user; - /* Always allow root or SE_PRINT_OPERATROR to do anything */ - if ( user->ut.uid == 0 || user_has_privileges(user->nt_user_token, &se_printop ) ) { + if (server_info->utok.uid == 0 + || user_has_privileges(server_info->ptok, &se_printop ) ) { return True; } @@ -5827,7 +5826,7 @@ bool print_access_check(struct current_user *user, int snum, int access_type) } /* Check access */ - result = se_access_check(secdesc->sd, user->nt_user_token, access_type, + result = se_access_check(secdesc->sd, server_info->ptok, access_type, &access_granted, &status); DEBUG(4, ("access check was %s\n", result ? "SUCCESS" : "FAILURE")); @@ -5835,8 +5834,8 @@ bool print_access_check(struct current_user *user, int snum, int access_type) /* see if we need to try the printer admin list */ if ((access_granted == 0) && - (token_contains_name_in_list(uidtoname(user->ut.uid), NULL, NULL, - user->nt_user_token, + (token_contains_name_in_list(uidtoname(server_info->utok.uid), + NULL, NULL, server_info->ptok, lp_printer_admin(snum)))) { talloc_destroy(mem_ctx); return True; |