summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c11
1 files changed, 9 insertions, 2 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;
}