From d8d7aa10ec0064f15701550e0a6861e38228bcca Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Fri, 30 Aug 2019 00:29:37 +0200 Subject: [PATCH] Added "ippPort()" call to the beginning of the program, to initialize libcups The CUPS backend runs into a bug of libcups, of the default server name, port, domain socket file name not being initialized depending on which functions of the library are used. See this upstream bug report on CUPS: https://github.com/apple/cups/issues/5642 A simple call of "ippPort()" in the very beginning of the backend executable solves the problem. This also caused the issue https://github.com/OpenPrinting/cpdb-backend-cups/issues/2 which is solved now, too. --- src/print_backend_cups.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/print_backend_cups.c b/src/print_backend_cups.c index 273379c..76f89a0 100644 --- a/src/print_backend_cups.c +++ b/src/print_backend_cups.c @@ -23,6 +23,9 @@ BackendObj *b; int main() { + /* Initialize internal default settings of the CUPS library */ + int p = ippPort(); + b = get_new_BackendObj(); acquire_session_bus_name(BUS_NAME); GMainLoop *loop = g_main_loop_new(NULL, FALSE);