summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-14 02:06:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:26 -0500
commit2e8b3ca0cb6956e5ce28fcafe85f6951a8955cd5 (patch)
treefe808577e5dc072107df7987c6fc10a5ae94af47
parenta5da0a72e1f1e026690df4b149a63754f29e6c28 (diff)
downloadsamba-2e8b3ca0cb6956e5ce28fcafe85f6951a8955cd5.tar.gz
samba-2e8b3ca0cb6956e5ce28fcafe85f6951a8955cd5.tar.bz2
samba-2e8b3ca0cb6956e5ce28fcafe85f6951a8955cd5.zip
r16216: Add debug messages to make it possible to try and
debug why a job pause or resume command is not being done. Jeremy. (This used to be commit e6aacb1426bd04c4006f7be66228f9f8d9a7065d)
-rw-r--r--source3/printing/printing.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index b131727f8a..c7ca917af0 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -337,27 +337,38 @@ static struct printjob *print_job_find(const char *sharename, uint32 jobid)
TDB_DATA ret;
struct tdb_print_db *pdb = get_print_db_byname(sharename);
+ DEBUG(10,("print_job_find: looking up job %u for share %s\n",
+ (unsigned int)jobid, sharename ));
- if (!pdb)
+ if (!pdb) {
return NULL;
+ }
ret = tdb_fetch(pdb->tdb, print_key(jobid));
release_print_db(pdb);
- if (!ret.dptr)
+ if (!ret.dptr) {
+ DEBUG(10,("print_job_find: failed to find jobid %u.\n", (unsigned int)jobid ));
return NULL;
+ }
- if ( pjob.nt_devmode )
+ if ( pjob.nt_devmode ) {
free_nt_devicemode( &pjob.nt_devmode );
+ }
ZERO_STRUCT( pjob );
if ( unpack_pjob( ret.dptr, ret.dsize, &pjob ) == -1 ) {
+ DEBUG(10,("print_job_find: failed to unpack jobid %u.\n", (unsigned int)jobid ));
SAFE_FREE(ret.dptr);
return NULL;
}
- SAFE_FREE(ret.dptr);
+ SAFE_FREE(ret.dptr);
+
+ DEBUG(10,("print_job_find: returning system job %d for jobid %u.\n",
+ (int)pjob.sysjob, (unsigned int)jobid ));
+
return &pjob;
}
@@ -2014,11 +2025,17 @@ BOOL print_job_pause(struct current_user *user, int snum, uint32 jobid, WERROR *
pjob = print_job_find(sharename, jobid);
- if (!pjob || !user)
+ if (!pjob || !user) {
+ DEBUG(10, ("print_job_pause: no pjob or user for jobid %u\n",
+ (unsigned int)jobid ));
return False;
+ }
- if (!pjob->spooled || pjob->sysjob == -1)
+ if (!pjob->spooled || pjob->sysjob == -1) {
+ DEBUG(10, ("print_job_pause: not spooled or bad sysjob = %d for jobid %u\n",
+ (int)pjob->sysjob, (unsigned int)jobid ));
return False;
+ }
if (!is_owner(user, snum, jobid) &&
!print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {
@@ -2068,11 +2085,17 @@ BOOL print_job_resume(struct current_user *user, int snum, uint32 jobid, WERROR
pjob = print_job_find(sharename, jobid);
- if (!pjob || !user)
+ if (!pjob || !user) {
+ DEBUG(10, ("print_job_resume: no pjob or user for jobid %u\n",
+ (unsigned int)jobid ));
return False;
+ }
- if (!pjob->spooled || pjob->sysjob == -1)
+ if (!pjob->spooled || pjob->sysjob == -1) {
+ DEBUG(10, ("print_job_resume: not spooled or bad sysjob = %d for jobid %u\n",
+ (int)pjob->sysjob, (unsigned int)jobid ));
return False;
+ }
if (!is_owner(user, snum, jobid) &&
!print_access_check(user, snum, JOB_ACCESS_ADMINISTER)) {