From 071a770ed444f2ed35d96a3b371dd587bd64f993 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 26 Mar 2001 22:15:40 +0000 Subject: Fix from Dave Collier Brown to log a debug at level zero on common misconfigure. Jeremy. (This used to be commit 4a3d2a13d3b0acab69c27b5b6522575b949eb5e6) --- source3/printing/printing.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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); -- cgit