From 1691eb73da62f3a50c12031d0a76cc6d4deed955 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 27 Apr 2010 19:57:47 +0200 Subject: s3-spoolss: add support for SetJobInfo level 1 (for jobfile rename). Guenther --- source3/printing/printing.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'source3/printing/printing.c') diff --git a/source3/printing/printing.c b/source3/printing/printing.c index a6b1ad3484..e67c5d41a3 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -1857,7 +1857,7 @@ NT_DEVICEMODE *print_job_devmode(const char* sharename, uint32 jobid) Set the name of a job. Only possible for owner. ****************************************************************************/ -bool print_job_set_name(const char *sharename, uint32 jobid, char *name) +bool print_job_set_name(const char *sharename, uint32 jobid, const char *name) { struct printjob *pjob; @@ -1869,6 +1869,28 @@ bool print_job_set_name(const char *sharename, uint32 jobid, char *name) return pjob_store(sharename, jobid, pjob); } +/**************************************************************************** + Get the name of a job. Only possible for owner. +****************************************************************************/ + +bool print_job_get_name(TALLOC_CTX *mem_ctx, const char *sharename, uint32_t jobid, char **name) +{ + struct printjob *pjob; + + pjob = print_job_find(sharename, jobid); + if (!pjob || pjob->pid != sys_getpid()) { + return false; + } + + *name = talloc_strdup(mem_ctx, pjob->jobname); + if (!*name) { + return false; + } + + return true; +} + + /*************************************************************************** Remove a jobid from the 'jobs changed' list. ***************************************************************************/ -- cgit