Patch for print_cups.c (ip address in originating-host attribute)

Matthias Hilbig necmas at gmx.de
Thu Aug 28 15:48:29 GMT 2003


Hi,

As stated in a previous message I had problems with the use of netbios 
names in the IPP originating-host attribute. The attached patch makes 
samba use dns name or ip address of the client instead of the netbios name.

Matthias


-------------- next part --------------
diff -r -u --ignore-all-space samba-3.0.0rc1/source/printing/print_cups.c samba-3.0.0rc1_modified/source/printing/print_cups.c
--- samba-3.0.0rc1/source/printing/print_cups.c	Sat Jun  7 19:57:36 2003
+++ samba-3.0.0rc1_modified/source/printing/print_cups.c	Thu Aug 28 17:17:36 2003
@@ -680,7 +680,7 @@
 			*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 @@
 	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);


More information about the samba-technical mailing list