summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-04-27 19:57:47 +0200
committerGünther Deschner <gd@samba.org>2010-04-28 00:10:40 +0200
commit1691eb73da62f3a50c12031d0a76cc6d4deed955 (patch)
tree3e984189132f6bdc077f6d97e906d14b664a44d7 /source3/rpc_server
parent2b7002f38571a920244d9ad309c606caaf2c0411 (diff)
downloadsamba-1691eb73da62f3a50c12031d0a76cc6d4deed955.tar.gz
samba-1691eb73da62f3a50c12031d0a76cc6d4deed955.tar.bz2
samba-1691eb73da62f3a50c12031d0a76cc6d4deed955.zip
s3-spoolss: add support for SetJobInfo level 1 (for jobfile rename).
Guenther
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 28e8a7d5e7..db6a6d784a 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -6427,6 +6427,31 @@ WERROR _spoolss_ScheduleJob(pipes_struct *p,
}
/****************************************************************
+****************************************************************/
+
+static WERROR spoolss_setjob_1(TALLOC_CTX *mem_ctx,
+ const char *printer_name,
+ uint32_t job_id,
+ struct spoolss_SetJobInfo1 *r)
+{
+ char *old_doc_name;
+
+ if (!print_job_get_name(mem_ctx, printer_name, job_id, &old_doc_name)) {
+ return WERR_BADFID;
+ }
+
+ if (strequal(old_doc_name, r->document_name)) {
+ return WERR_OK;
+ }
+
+ if (!print_job_set_name(printer_name, job_id, r->document_name)) {
+ return WERR_BADFID;
+ }
+
+ return WERR_OK;
+}
+
+/****************************************************************
_spoolss_SetJob
****************************************************************/
@@ -6462,6 +6487,30 @@ WERROR _spoolss_SetJob(pipes_struct *p,
errcode = WERR_OK;
}
break;
+ case 0:
+ errcode = WERR_OK;
+ break;
+ default:
+ return WERR_UNKNOWN_LEVEL;
+ }
+
+ if (!W_ERROR_IS_OK(errcode)) {
+ return errcode;
+ }
+
+ if (r->in.ctr == NULL) {
+ return errcode;
+ }
+
+ switch (r->in.ctr->level) {
+ case 1:
+ errcode = spoolss_setjob_1(p->mem_ctx, lp_const_servicename(snum),
+ r->in.job_id,
+ r->in.ctr->info.info1);
+ break;
+ case 2:
+ case 3:
+ case 4:
default:
return WERR_UNKNOWN_LEVEL;
}