summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-08-23 23:05:49 +0000
committerJeremy Allison <jra@samba.org>2000-08-23 23:05:49 +0000
commitf03879e0b3db1871d003bfb5713a88928f032260 (patch)
treef3a6efbb4ef8e10aa9953ca58e74e00a3a6f9510 /source3/printing/nt_printing.c
parentb3addf7ebe319826eb0926cc84bcfb729e725916 (diff)
downloadsamba-f03879e0b3db1871d003bfb5713a88928f032260.tar.gz
samba-f03879e0b3db1871d003bfb5713a88928f032260.tar.bz2
samba-f03879e0b3db1871d003bfb5713a88928f032260.zip
Tidied up some error returns from printing calls. Still need to map UNIX
errors to NT error for print job failure returns. Patch from John Reilly at HP. Jeremy. (This used to be commit 3514b5bb8fffd78e3647425d93b74e2e6291bafc)
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;
}