summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-11-24 18:37:19 +0000
committerGerald Carter <jerry@samba.org>2003-11-24 18:37:19 +0000
commitc26aa9fd2dab2b5a3d06da0170bda86eae48226b (patch)
treefe9678d3b058649e7f3e6fea4b5805ce875a1d9b /source3
parentc39f5fea4ad7b57ee8ad4d2b115163f76753f853 (diff)
downloadsamba-c26aa9fd2dab2b5a3d06da0170bda86eae48226b.tar.gz
samba-c26aa9fd2dab2b5a3d06da0170bda86eae48226b.tar.bz2
samba-c26aa9fd2dab2b5a3d06da0170bda86eae48226b.zip
patch from Matthias Hilbig for bug 467; use the dns name (or IP) as the originating client name when using CUPS
(This used to be commit 71333299a6e6bc6d74d2172f71e3fe21ef75aa3c)
Diffstat (limited to 'source3')
-rw-r--r--source3/printing/print_cups.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/printing/print_cups.c b/source3/printing/print_cups.c
index 34eee7d97f..df62153798 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -681,7 +681,7 @@ cups_job_submit(int snum, struct printjob *pjob)
*response; /* IPP Response */
cups_lang_t *language; /* Default language */
char uri[HTTP_MAX_URI]; /* printer-uri attribute */
-
+ char *clientname; /* hostname of client for job-originating-host attribute */
DEBUG(5,("cups_job_submit(%d, %p (%d))\n", snum, pjob, pjob->sysjob));
@@ -735,9 +735,14 @@ cups_job_submit(int snum, struct printjob *pjob)
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "requesting-user-name",
NULL, pjob->user);
+ clientname = client_name();
+ if (strcmp(clientname, "UNKNOWN") == 0) {
+ clientname = client_addr();
+ }
+
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME,
"job-originating-host-name", NULL,
- get_remote_machine_name());
+ clientname);
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_NAME, "job-name", NULL,
pjob->jobname);