diff options
author | Jeremy Allison <jra@samba.org> | 2003-02-08 01:04:26 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-02-08 01:04:26 +0000 |
commit | d05322efce826e7029d4123eb08c24d2fb0e33b8 (patch) | |
tree | de6598f2ca7601e7e97ca95c2bfc0ae2f5c22744 /source3/printing | |
parent | 99f9caebe4989df40bbb82b5bc0beb4b84f11f8c (diff) | |
download | samba-d05322efce826e7029d4123eb08c24d2fb0e33b8.tar.gz samba-d05322efce826e7029d4123eb08c24d2fb0e33b8.tar.bz2 samba-d05322efce826e7029d4123eb08c24d2fb0e33b8.zip |
Ensure we return NOSPACE if we can't fast allocate a print job.
Jeremy.
(This used to be commit 9cd29f2bacd7c61f82f799e97f93d88f98f9ece6)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/printing.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c index a46fff0de2..3bf992ad69 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1595,6 +1595,8 @@ static BOOL allocate_print_jobid(struct tdb_print_db *pdb, int snum, const char if (i > 2) { DEBUG(0, ("allocate_print_jobid: failed to allocate a print job for queue %s\n", printername )); + /* Probably full... */ + errno = ENOSPC; return False; } @@ -1669,13 +1671,16 @@ uint32 print_job_start(struct current_user *user, int snum, char *jobname, NT_DE /* Insure the maximum queue size is not violated */ if ((njobs = print_queue_length(snum,NULL)) > lp_maxprintjobs(snum)) { - DEBUG(3, ("print_job_start: number of jobs (%d) larger than max printjobs per queue (%d).\n", - njobs, lp_maxprintjobs(snum) )); + DEBUG(3, ("print_job_start: Queue %s number of jobs (%d) larger than max printjobs per queue (%d).\n", + printername, njobs, lp_maxprintjobs(snum) )); release_print_db(pdb); errno = ENOSPC; return (uint32)-1; } + DEBUG(10,("print_job_start: Queue %s number of jobs (%d), max printjobs = %d\n", + printername, njobs, lp_maxprintjobs(snum) )); + if (!allocate_print_jobid(pdb, snum, printername, &jobid)) goto fail; |