diff options
author | Herb Lewis <herb@samba.org> | 2001-02-15 19:33:57 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2001-02-15 19:33:57 +0000 |
commit | c237db1c11d59c9715c65dc808817483e04903e2 (patch) | |
tree | f90a024261967fc71c5f211d08360608766f3d1c /source3/printing | |
parent | 7f9fbcd0eff68e7a27847dd56a0f17f9433af93f (diff) | |
download | samba-c237db1c11d59c9715c65dc808817483e04903e2.tar.gz samba-c237db1c11d59c9715c65dc808817483e04903e2.tar.bz2 samba-c237db1c11d59c9715c65dc808817483e04903e2.zip |
DEBUG merge from 2.2 about tdb init failure.
Patch from David Collier-Brown to print permission error on spool file
creation.
(This used to be commit 8907a51743b7b9b9ad4168033fae4d44012cca37)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 22 |
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); |