summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c11
-rw-r--r--source3/printing/printing.c4
2 files changed, 12 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 510432ea74..7fe21dc7e7 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2170,9 +2170,13 @@ BOOL print_access_check(struct current_user *user, int snum,
/* Get printer name */
pname = PRINTERNAME(snum);
- if (!pname || !*pname) pname = SERVICE(snum);
+ if (!pname || !*pname)
+ pname = SERVICE(snum);
- if (!pname || !*pname) return False;
+ if (!pname || !*pname) {
+ errno = EACCES;
+ return False;
+ }
/* Get printer security descriptor */
nt_printing_getsec(pname, &secdesc);
@@ -2220,6 +2224,9 @@ BOOL print_access_check(struct current_user *user, int snum,
/* Free mallocated memory */
free_sec_desc_buf(&secdesc);
+ if (!result)
+ errno = EACCES;
+
return result;
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index a6dc81b172..f5f40d8b9c 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -622,6 +622,8 @@ int print_job_start(struct current_user *user, int snum, char *jobname)
int next_jobid;
extern struct current_user current_user;
+ errno = 0;
+
if (!print_access_check(user, snum, PRINTER_ACE_PRINT)) {
DEBUG(3, ("job start denied by security descriptor\n"));
return False;
@@ -713,7 +715,7 @@ int print_job_start(struct current_user *user, int snum, char *jobname)
}
tdb_writeunlock(tdb);
- return jobid;
+ return -1;
}
/****************************************************************************