summaryrefslogtreecommitdiff
path: root/source3/printing/printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-26 22:15:40 +0000
committerJeremy Allison <jra@samba.org>2001-03-26 22:15:40 +0000
commit071a770ed444f2ed35d96a3b371dd587bd64f993 (patch)
tree2c7f532be0658fdd05b5c8840f29b71c6b7ebaa8 /source3/printing/printing.c
parent8600979fad54ba8b70656494a39f3d2bf048b08e (diff)
downloadsamba-071a770ed444f2ed35d96a3b371dd587bd64f993.tar.gz
samba-071a770ed444f2ed35d96a3b371dd587bd64f993.tar.bz2
samba-071a770ed444f2ed35d96a3b371dd587bd64f993.zip
Fix from Dave Collier Brown to log a debug at level zero on common misconfigure.
Jeremy. (This used to be commit 4a3d2a13d3b0acab69c27b5b6522575b949eb5e6)
Diffstat (limited to 'source3/printing/printing.c')
-rw-r--r--source3/printing/printing.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 84ed1a3993..e886bd75a2 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -918,7 +918,19 @@ int print_job_start(struct current_user *user, int snum, char *jobname)
goto next_jobnum;
}
pjob.fd = sys_open(pjob.filename,O_WRONLY|O_CREAT|O_EXCL,0600);
- if (pjob.fd == -1) goto fail;
+
+ if (pjob.fd == -1) {
+ if (errno == EACCES) {
+ /* Common setup error, force a report. */
+ DEBUG(0, ("print_job_start: insufficient permissions \
+to open spool file %s.\n", pjob.filename));
+ } else {
+ /* Normal case, report at level 3 and above. */
+ DEBUG(3, ("print_job_start: can't open spool file %s,\n", pjob.filename));
+ DEBUGADD(3, ("errno = %d (%s).\n", errno, strerror(errno)));
+ }
+ goto fail;
+ }
print_job_store(jobid, &pjob);