summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-08 14:28:17 +0200
committerVolker Lendecke <vl@samba.org>2010-08-08 16:03:25 +0200
commitbe7fd4ae5054435b25b1a6a460b626d556f39936 (patch)
tree6f330c02c00a23963c553dc8634e49a5de234f7b /source3/printing
parentd79895e82606bcfe265a67bf9a6b7e03368f0bae (diff)
downloadsamba-be7fd4ae5054435b25b1a6a460b626d556f39936.tar.gz
samba-be7fd4ae5054435b25b1a6a460b626d556f39936.tar.bz2
samba-be7fd4ae5054435b25b1a6a460b626d556f39936.zip
s3: Lift the smbd_messaging_context from print_access_check
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c5
-rw-r--r--source3/printing/printing.c20
2 files changed, 16 insertions, 9 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 937cdfc6f5..73ce7e6d45 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2063,7 +2063,8 @@ void map_job_permissions(struct security_descriptor *sd)
3) "printer admins" (may result in numerous calls to winbind)
****************************************************************************/
-bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
+bool print_access_check(struct auth_serversupplied_info *server_info,
+ struct messaging_context *msg_ctx, int snum,
int access_type)
{
struct spoolss_security_descriptor *secdesc = NULL;
@@ -2102,7 +2103,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
result = winreg_get_printer_secdesc(mem_ctx,
server_info,
- smbd_messaging_context(),
+ msg_ctx,
pname,
&secdesc);
if (!W_ERROR_IS_OK(result)) {
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 0412d755a9..a6f8bf069f 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -2125,7 +2125,8 @@ WERROR print_job_delete(struct auth_serversupplied_info *server_info,
owns their job. */
if (!owner &&
- !print_access_check(server_info, snum, JOB_ACCESS_ADMINISTER)) {
+ !print_access_check(server_info, smbd_messaging_context(), snum,
+ JOB_ACCESS_ADMINISTER)) {
DEBUG(3, ("delete denied by security descriptor\n"));
/* BEGIN_ADMIN_LOG */
@@ -2200,7 +2201,8 @@ bool print_job_pause(struct auth_serversupplied_info *server_info, int snum,
}
if (!is_owner(server_info, lp_const_servicename(snum), jobid) &&
- !print_access_check(server_info, snum, JOB_ACCESS_ADMINISTER)) {
+ !print_access_check(server_info, smbd_messaging_context(), snum,
+ JOB_ACCESS_ADMINISTER)) {
DEBUG(3, ("pause denied by security descriptor\n"));
/* BEGIN_ADMIN_LOG */
@@ -2262,7 +2264,8 @@ bool print_job_resume(struct auth_serversupplied_info *server_info, int snum,
}
if (!is_owner(server_info, lp_const_servicename(snum), jobid) &&
- !print_access_check(server_info, snum, JOB_ACCESS_ADMINISTER)) {
+ !print_access_check(server_info, smbd_messaging_context(), snum,
+ JOB_ACCESS_ADMINISTER)) {
DEBUG(3, ("resume denied by security descriptor\n"));
*errcode = WERR_ACCESS_DENIED;
@@ -2509,7 +2512,8 @@ static WERROR print_job_checks(struct auth_serversupplied_info *server_info,
uint64_t minspace;
int ret;
- if (!print_access_check(server_info, snum, PRINTER_ACCESS_USE)) {
+ if (!print_access_check(server_info, smbd_messaging_context(), snum,
+ PRINTER_ACCESS_USE)) {
DEBUG(3, ("print_job_checks: "
"job start denied by security descriptor\n"));
return WERR_ACCESS_DENIED;
@@ -3031,7 +3035,7 @@ WERROR print_queue_pause(struct auth_serversupplied_info *server_info, int snum)
int ret;
struct printif *current_printif = get_printer_fns( snum );
- if (!print_access_check(server_info, snum,
+ if (!print_access_check(server_info, smbd_messaging_context(), snum,
PRINTER_ACCESS_ADMINISTER)) {
return WERR_ACCESS_DENIED;
}
@@ -3066,7 +3070,7 @@ WERROR print_queue_resume(struct auth_serversupplied_info *server_info, int snum
int ret;
struct printif *current_printif = get_printer_fns( snum );
- if (!print_access_check(server_info, snum,
+ if (!print_access_check(server_info, smbd_messaging_context(), snum,
PRINTER_ACCESS_ADMINISTER)) {
return WERR_ACCESS_DENIED;
}
@@ -3106,7 +3110,9 @@ WERROR print_queue_purge(struct auth_serversupplied_info *server_info, int snum)
/* Force and update so the count is accurate (i.e. not a cached count) */
print_queue_update(snum, True);
- can_job_admin = print_access_check(server_info, snum,
+ can_job_admin = print_access_check(server_info,
+ smbd_messaging_context(),
+ snum,
JOB_ACCESS_ADMINISTER);
njobs = print_queue_status(snum, &queue, &status);