diff options
-rw-r--r-- | source3/printing/printing.c | 16 |
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) { |