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

Bug#868316: cups-bsd: lpr does not print with "DefaultPolicy authenticated" in cupsd.conf


I believe that I found a complete solution:

What introduced the bug, is that httpAddrPort() from http-addr.c now returns 0 in the case when connection type is AF_UNIX. That differs from the cups version in jessie, where httpAddrPort returned 631 in that case. As in my opinion, it makes sense to return 0 as port number in an AF_UNIX connection, I did not change http-addr.c, but request.c so that the port comparison is only relevant if the connection type is not AF_UNIX.

Patch is attached.

Description: Do not compare port numbers when using UNIX socket
Author: Christoph Pleger <pleger@irb.cs.tu-dortmund.de>
Bug-Debian: https://bugs.debian.org/868316
Last-Update: 2017-08-28

Index: cups-2.2.1/cups/request.c
--- cups-2.2.1.orig/cups/request.c	2017-08-28 14:25:03.000000000 +0200
+++ cups-2.2.1/cups/request.c	2017-08-28 14:32:47.164118338 +0200
@@ -996,7 +996,7 @@
     if (strcmp(cg->http->hostname, cg->server) ||
-        cg->ipp_port != httpAddrPort(cg->http->hostaddr) ||
+        ((cg->http->hostaddr->addr.sa_family != AF_UNIX) && (cg->ipp_port != httpAddrPort(cg->http->hostaddr))) ||
         (cg->http->encryption != cg->encryption &&
 	 cg->http->encryption == HTTP_ENCRYPTION_NEVER))

Reply to: