summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-08-17 09:17:26 +0200
committerVolker Lendecke <vl@samba.org>2010-08-18 11:18:23 +0200
commit29093bc0009bbcd5f9a98a2f4611fc3eb65f2539 (patch)
treeebed5b90d615fad1320a3e1167166c90f4351f70 /source3
parent4b5e252354660501576c8452f48514852f40270e (diff)
downloadsamba-29093bc0009bbcd5f9a98a2f4611fc3eb65f2539.tar.gz
samba-29093bc0009bbcd5f9a98a2f4611fc3eb65f2539.tar.bz2
samba-29093bc0009bbcd5f9a98a2f4611fc3eb65f2539.zip
s3: Move initializing pjob.clientname to print_job_start()
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/printing.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 82516b352c..297fdd1d28 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -2695,6 +2695,8 @@ WERROR print_job_start(struct auth_serversupplied_info *server_info,
struct tdb_print_db *pdb = get_print_db_byname(sharename);
int njobs;
WERROR werr;
+ const char *clientname;
+ char addr[INET6_ADDRSTRLEN];
if (!pdb) {
return WERR_INTERNAL_DB_CORRUPTION;
@@ -2733,6 +2735,12 @@ WERROR print_job_start(struct auth_serversupplied_info *server_info,
fstrcpy(pjob.jobname, docname);
+ clientname = client_name(smbd_server_fd());
+ if (strcmp(clientname, "UNKNOWN") == 0) {
+ clientname = client_addr(smbd_server_fd(),addr,sizeof(addr));
+ }
+ fstrcpy(pjob.clientmachine, clientname);
+
fstrcpy(pjob.user, lp_printjob_username(snum));
standard_sub_advanced(sharename, server_info->sanitized_username,
path, server_info->utok.gid,
@@ -2811,8 +2819,6 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
SMB_STRUCT_STAT sbuf;
struct printif *current_printif = get_printer_fns( snum );
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
- const char *clientname;
- char addr[INET6_ADDRSTRLEN];
pjob = print_job_find(sharename, jobid);
@@ -2875,12 +2881,6 @@ NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
return NT_STATUS_OK;
}
- clientname = client_name(smbd_server_fd());
- if (strcmp(clientname, "UNKNOWN") == 0) {
- clientname = client_addr(smbd_server_fd(),addr,sizeof(addr));
- }
- fstrcpy(pjob->clientmachine, clientname);
-
ret = (*(current_printif->job_submit))(snum, pjob);
if (ret) {