From a847f13d7b0c8606471792a50e9c64d1f6bd430c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 17 Aug 2010 09:34:27 +0200 Subject: s3: Use pipe_struct->client_id->name for pjob.clientmachine --- source3/include/printing.h | 1 + source3/printing/printing.c | 9 ++------- source3/rpc_server/srv_spoolss_nt.c | 3 ++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/source3/include/printing.h b/source3/include/printing.h index b5fd98dd85..a16917fe32 100644 --- a/source3/include/printing.h +++ b/source3/include/printing.h @@ -142,6 +142,7 @@ int print_queue_length(struct messaging_context *msg_ctx, int snum, print_status_struct *pstatus); WERROR print_job_start(struct auth_serversupplied_info *server_info, struct messaging_context *msg_ctx, + const char *clientmachine, int snum, const char *docname, const char *filename, struct spoolss_DeviceMode *devmode, uint32_t *_jobid); void print_job_endpage(struct messaging_context *msg_ctx, diff --git a/source3/printing/printing.c b/source3/printing/printing.c index 297fdd1d28..4240ddf330 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -2685,6 +2685,7 @@ static WERROR print_job_spool_file(int snum, uint32_t jobid, WERROR print_job_start(struct auth_serversupplied_info *server_info, struct messaging_context *msg_ctx, + const char *clientmachine, int snum, const char *docname, const char *filename, struct spoolss_DeviceMode *devmode, uint32_t *_jobid) { @@ -2695,8 +2696,6 @@ 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; @@ -2735,11 +2734,7 @@ 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.clientmachine, clientmachine); fstrcpy(pjob.user, lp_printjob_username(snum)); standard_sub_advanced(sharename, server_info->sanitized_username, diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index cdb03ff897..46e47f595f 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -5291,7 +5291,8 @@ WERROR _spoolss_StartDocPrinter(struct pipes_struct *p, return WERR_BADFID; } - werr = print_job_start(p->server_info, p->msg_ctx, snum, + werr = print_job_start(p->server_info, p->msg_ctx, + p->client_id->name, snum, info_1->document_name, info_1->output_file, Printer->devmode, &Printer->jobid); -- cgit