diff options
author | Günther Deschner <gd@samba.org> | 2010-04-27 19:57:47 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2010-04-28 00:10:40 +0200 |
commit | 1691eb73da62f3a50c12031d0a76cc6d4deed955 (patch) | |
tree | 3e984189132f6bdc077f6d97e906d14b664a44d7 /source3/printing | |
parent | 2b7002f38571a920244d9ad309c606caaf2c0411 (diff) | |
download | samba-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/printing')
-rw-r--r-- | source3/printing/printing.c | 24 |
1 files changed, 23 insertions, 1 deletions
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. ***************************************************************************/ |