summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-05-05 08:56:46 -0400
committerSimo Sorce <idra@samba.org>2010-07-27 10:27:13 -0400
commit628f9bee05b96b806225f3494c05c3a86acb1a1f (patch)
tree577abc6a45de29b7c1949382787c70b6f1819477 /source3/rpc_server
parent95f587a565543678da3beeff46167001b92bea79 (diff)
downloadsamba-628f9bee05b96b806225f3494c05c3a86acb1a1f.tar.gz
samba-628f9bee05b96b806225f3494c05c3a86acb1a1f.tar.bz2
samba-628f9bee05b96b806225f3494c05c3a86acb1a1f.zip
s3-spoolss: Use WERROR for print_job_delete.
And also check for PJOB_SMBD_SPOOLING in print_job_write. Signed-off-by: Jim McDonough <jmcd@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 1f0b36450f..5a33a34ca5 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -5234,6 +5234,7 @@ WERROR _spoolss_WritePrinter(pipes_struct *p,
if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
+ /* print_job_write takes care of checking for PJOB_SMBD_SPOOLING */
buffer_written = print_job_write(snum, Printer->jobid,
(const char *)r->in.data.data,
(SMB_OFF_T)-1,
@@ -5314,7 +5315,11 @@ WERROR _spoolss_AbortPrinter(pipes_struct *p,
if (!get_printer_snum(p, r->in.handle, &snum, NULL))
return WERR_BADFID;
- print_job_delete(p->server_info, snum, Printer->jobid, &errcode );
+ if (!Printer->document_started) {
+ return WERR_SPL_NO_STARTDOC;
+ }
+
+ errcode = print_job_delete(p->server_info, snum, Printer->jobid);
return errcode;
}
@@ -6573,7 +6578,9 @@ WERROR _spoolss_SetJob(pipes_struct *p,
switch (r->in.command) {
case SPOOLSS_JOB_CONTROL_CANCEL:
case SPOOLSS_JOB_CONTROL_DELETE:
- if (print_job_delete(p->server_info, snum, r->in.job_id, &errcode)) {
+ errcode = print_job_delete(p->server_info,
+ snum, r->in.job_id);
+ if (W_ERROR_EQUAL(errcode, WERR_PRINTER_HAS_JOBS_QUEUED)) {
errcode = WERR_OK;
}
break;