[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1067122: cups-daemon: cupsd ignores job-originating-host-name



Package: cups-daemon
Version: 2.4.2-3+deb12u5
Severity: normal
Tags: patch

I noticed that the cupsd server ignores (overrides) the value of
job-originating-host-name sent. I get good results with my proposed
patch for this issue, below.

Cheers, Paul
--
Paul Szabo       psz@maths.usyd.edu.au       www.maths.usyd.edu.au/u/psz
School of Mathematics and Statistics   University of Sydney    Australia


-- System Information:
Debian Release: 12.5
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.5+pk12.50 (SMP w/64 CPU threads; PREEMPT)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages cups-daemon depends on:
ii  adduser                    3.134
ii  bc                         1.07.1-3+b1
ii  init-system-helpers        1.65.2
ii  libavahi-client3           0.8-10
ii  libavahi-common3           0.8-10
ii  libc6                      2.36-9+deb12u4
ii  libcups2                   2.4.2-3+deb12u5
ii  libdbus-1-3                1.14.10-1~deb12u1
ii  libgssapi-krb5-2           1.20.1-2+deb12u1
ii  libpam0g                   1.5.2-6+deb12u1
ii  libpaper1                  1.1.29
ii  libsystemd0                252.22-1~deb12u1++psz
ii  lsb-base                   11.6
ii  procps                     2:4.0.2-3
ii  ssl-cert                   1.1.2
ii  sysvinit-utils [lsb-base]  3.06-4

Versions of packages cups-daemon recommends:
pn  avahi-daemon  <none>
pn  colord        <none>
pn  cups-browsed  <none>
pn  ipp-usb       <none>

Versions of packages cups-daemon suggests:
ii  cups                                       2.4.2-3+deb12u5
ii  cups-bsd                                   2.4.2-3+deb12u5
ii  cups-client                                2.4.2-3+deb12u5
ii  cups-common                                2.4.2-3+deb12u5
ii  cups-filters                               1.28.17-3
pn  cups-pdf                                   <none>
ii  cups-ppdc                                  2.4.2-3+deb12u5
ii  cups-server-common                         2.4.2-3+deb12u5
pn  foomatic-db-compressed-ppds | foomatic-db  <none>
ii  ghostscript                                10.0.0~dfsg-11+deb12u3
ii  poppler-utils                              22.12.0-2+b1
pn  smbclient                                  <none>
ii  udev                                       252.22-1~deb12u1

-- no debconf information
--- cups-2.4.2/scheduler/ipp.c.ORIG	2024-03-18 16:35:43.000000000 +1100
+++ cups-2.4.2/scheduler/ipp.c	2024-03-18 16:38:21.073982871 +1100
@@ -1637,9 +1637,20 @@
     * Request contains a job-originating-host-name attribute; validate it...
     */
 
+   /*
+    * PSz 18 Mar 24
+    * Override if the value is clearly wrong or impossible, or if
+    * the value is "localhost" but relative to some remote machine.
+    * Do not override just because we are not talking to localhost;
+    * in particular, keep and treasure the value sent to us from
+    * some intermediate or proxy server.
+    *if (attr->value_tag != IPP_TAG_NAME ||
+    *    attr->num_values != 1 ||
+    *    strcmp(con->http->hostname, "localhost"))
+    */
     if (attr->value_tag != IPP_TAG_NAME ||
         attr->num_values != 1 ||
-        strcmp(con->http->hostname, "localhost"))
+        !strcmp(attr->values[0].string.text, "localhost"))
     {
      /*
       * Can't override the value if we aren't connected via localhost.

Reply to: