summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/printing.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 4dbb01e839..9ed33bc6ae 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -76,7 +76,9 @@ BOOL print_backend_init(void)
if (tdb && local_pid == sys_getpid()) return True;
tdb = tdb_open(lock_path("printing.tdb"), 0, 0, O_RDWR|O_CREAT, 0600);
if (!tdb) {
- DEBUG(0,("Failed to open printing backend database\n"));
+ DEBUG(0,("print_backend_init: Failed to open printing backend database. Error = [%s]\n",
+ tdb_errorstr(tdb)));
+ return False;
}
local_pid = sys_getpid();
@@ -920,7 +922,23 @@ 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);