summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-11-24 18:38:15 +0000
committerGerald Carter <jerry@samba.org>2003-11-24 18:38:15 +0000
commit3500dfdcdc4b0e1a1f5071597fff98369dc122d0 (patch)
tree3f196218fadc1c7790bd9d18ed5b6d051c228fc9 /source3
parentf5ee9c7b02d6acf02d8e516c6e258965a029dd79 (diff)
downloadsamba-3500dfdcdc4b0e1a1f5071597fff98369dc122d0.tar.gz
samba-3500dfdcdc4b0e1a1f5071597fff98369dc122d0.tar.bz2
samba-3500dfdcdc4b0e1a1f5071597fff98369dc122d0.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 eae48cda0f7f1346cd66d5a581c1273880f214d4)
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 7cf21c966e..291028b70c 100644
--- a/source3/printing/print_cups.c
+++ b/source3/printing/print_cups.c
@@ -680,7 +680,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));
@@ -734,9 +734,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);