-diff -up cups-2.2b2/scheduler/avahi.c.avahi-no-threaded cups-2.2b2/scheduler/avahi.c
---- cups-2.2b2/scheduler/avahi.c.avahi-no-threaded 2016-06-27 17:55:19.568728958 +0200
-+++ cups-2.2b2/scheduler/avahi.c 2016-06-27 17:55:19.568728958 +0200
+diff -up cups-2.2.5/scheduler/avahi.c.avahi-no-threaded cups-2.2.5/scheduler/avahi.c
+--- cups-2.2.5/scheduler/avahi.c.avahi-no-threaded 2017-10-17 19:03:00.760881016 +0200
++++ cups-2.2.5/scheduler/avahi.c 2017-10-17 19:03:00.760881016 +0200
@@ -0,0 +1,441 @@
+/*
+ * "$Id$"
+/*
+ * End of "$Id$".
+ */
-diff -up cups-2.2b2/scheduler/avahi.h.avahi-no-threaded cups-2.2b2/scheduler/avahi.h
---- cups-2.2b2/scheduler/avahi.h.avahi-no-threaded 2016-06-27 17:55:19.568728958 +0200
-+++ cups-2.2b2/scheduler/avahi.h 2016-06-27 17:55:19.568728958 +0200
+diff -up cups-2.2.5/scheduler/avahi.h.avahi-no-threaded cups-2.2.5/scheduler/avahi.h
+--- cups-2.2.5/scheduler/avahi.h.avahi-no-threaded 2017-10-17 19:03:00.760881016 +0200
++++ cups-2.2.5/scheduler/avahi.h 2017-10-17 19:03:00.760881016 +0200
@@ -0,0 +1,69 @@
+/*
+ * "$Id$"
+/*
+ * End of "$Id$".
+ */
-diff -up cups-2.2b2/scheduler/cupsd.h.avahi-no-threaded cups-2.2b2/scheduler/cupsd.h
---- cups-2.2b2/scheduler/cupsd.h.avahi-no-threaded 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/cupsd.h 2016-06-27 17:57:45.476572827 +0200
+diff -up cups-2.2.5/scheduler/cupsd.h.avahi-no-threaded cups-2.2.5/scheduler/cupsd.h
+--- cups-2.2.5/scheduler/cupsd.h.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/cupsd.h 2017-10-17 19:03:00.760881016 +0200
@@ -118,6 +118,7 @@ extern const char *cups_hstrerror(int);
#include "colorman.h"
#include "conf.h"
+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout);
+#endif /* HAVE_AVAHI */
\ No newline at end of file
-diff -up cups-2.2b2/scheduler/dirsvc.c.avahi-no-threaded cups-2.2b2/scheduler/dirsvc.c
---- cups-2.2b2/scheduler/dirsvc.c.avahi-no-threaded 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/dirsvc.c 2016-06-27 17:55:19.569728950 +0200
+diff -up cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded cups-2.2.5/scheduler/dirsvc.c
+--- cups-2.2.5/scheduler/dirsvc.c.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/dirsvc.c 2017-10-17 19:05:35.938592292 +0200
@@ -193,7 +193,7 @@ cupsdStartBrowsing(void)
cupsdUpdateDNSSDName();
}
# endif /* HAVE_DNSSD */
}
-@@ -606,7 +604,7 @@ dnssdClientCallback(
+@@ -635,7 +633,7 @@ dnssdClientCallback(
* Renew Avahi client...
*/
if (!DNSSDClient)
{
-@@ -670,13 +668,7 @@ dnssdDeregisterInstance(
- DNSServiceRefDeallocate(*srv);
-
+@@ -701,13 +699,7 @@ dnssdDeregisterInstance(
# else /* HAVE_AVAHI */
-- if (!from_callback)
-- avahi_threaded_poll_lock(DNSSDMaster);
+ if (*srv)
+ {
+- if (!from_callback)
+- avahi_threaded_poll_lock(DNSSDMaster);
-
- avahi_entry_group_free(*srv);
+ avahi_entry_group_free(*srv);
-
-- if (!from_callback)
-- avahi_threaded_poll_unlock(DNSSDMaster);
+- if (!from_callback)
+- avahi_threaded_poll_unlock(DNSSDMaster);
+ }
# endif /* HAVE_DNSSD */
- *srv = NULL;
-@@ -997,16 +989,10 @@ dnssdRegisterInstance(
+@@ -1029,16 +1021,10 @@ dnssdRegisterInstance(
(void)commit;
# else /* HAVE_AVAHI */
cupsdLogMessage(CUPSD_LOG_WARN, "DNS-SD registration of \"%s\" failed: %s",
name, dnssdErrorString(avahi_client_errno(DNSSDClient)));
return (0);
-@@ -1121,9 +1107,6 @@ dnssdRegisterInstance(
+@@ -1153,9 +1139,6 @@ dnssdRegisterInstance(
cupsdLogMessage(CUPSD_LOG_DEBUG, "DNS-SD commit of \"%s\" failed.",
name);
}
# endif /* HAVE_DNSSD */
if (error)
-@@ -1294,9 +1277,6 @@ dnssdStop(void)
+@@ -1326,9 +1309,6 @@ dnssdStop(void)
DNSSDMaster = NULL;
# else /* HAVE_AVAHI */
if (DNSSDClient)
{
avahi_client_free(DNSSDClient);
-@@ -1305,7 +1285,7 @@ dnssdStop(void)
+@@ -1337,7 +1317,7 @@ dnssdStop(void)
if (DNSSDMaster)
{
DNSSDMaster = NULL;
}
# endif /* HAVE_DNSSD */
-diff -up cups-2.2b2/scheduler/dirsvc.h.avahi-no-threaded cups-2.2b2/scheduler/dirsvc.h
---- cups-2.2b2/scheduler/dirsvc.h.avahi-no-threaded 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/dirsvc.h 2016-06-27 17:55:19.569728950 +0200
+diff -up cups-2.2.5/scheduler/dirsvc.h.avahi-no-threaded cups-2.2.5/scheduler/dirsvc.h
+--- cups-2.2.5/scheduler/dirsvc.h.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/dirsvc.h 2017-10-17 19:03:00.761881007 +0200
@@ -49,7 +49,7 @@ VAR cups_array_t *DNSSDPrinters VALUE(NU
VAR DNSServiceRef DNSSDMaster VALUE(NULL);
/* Master DNS-SD service reference */
/* Master polling interface for Avahi */
VAR AvahiClient *DNSSDClient VALUE(NULL);
/* Client information */
-diff -up cups-2.2b2/scheduler/main.c.avahi-no-threaded cups-2.2b2/scheduler/main.c
---- cups-2.2b2/scheduler/main.c.avahi-no-threaded 2016-06-27 17:55:19.555729061 +0200
-+++ cups-2.2b2/scheduler/main.c 2016-06-27 17:58:44.350106330 +0200
+diff -up cups-2.2.5/scheduler/main.c.avahi-no-threaded cups-2.2.5/scheduler/main.c
+--- cups-2.2.5/scheduler/main.c.avahi-no-threaded 2017-10-17 19:03:00.753881074 +0200
++++ cups-2.2.5/scheduler/main.c 2017-10-17 19:03:00.761881007 +0200
@@ -131,7 +131,10 @@ main(int argc, /* I - Number of comm
int service_idle_exit;
/* Idle exit on select timeout? */
#ifdef HAVE_GETEUID
/*
-@@ -609,6 +612,14 @@ main(int argc, /* I - Number of comm
+@@ -610,6 +613,14 @@ main(int argc, /* I - Number of comm
httpInitialize();
cupsdStartServer();
/*
-@@ -930,6 +941,16 @@ main(int argc, /* I - Number of comm
+@@ -928,6 +939,16 @@ main(int argc, /* I - Number of comm
}
#endif /* __APPLE__ */
#ifndef __APPLE__
/*
* Update the network interfaces once a minute...
-@@ -1620,6 +1641,10 @@ select_timeout(int fds) /* I - Number
- cupsd_client_t *con; /* Client information */
+@@ -1632,6 +1653,10 @@ select_timeout(int fds) /* I - Number
cupsd_job_t *job; /* Job information */
+ cupsd_printer_t *printer; /* Printer information */
const char *why; /* Debugging aid */
+#ifdef HAVE_AVAHI
+ cupsd_timeout_t *tmo; /* Timed callback */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "select_timeout: JobHistoryUpdate=%ld",
-@@ -1665,6 +1690,19 @@ select_timeout(int fds) /* I - Number
+@@ -1677,6 +1702,19 @@ select_timeout(int fds) /* I - Number
}
#endif /* __APPLE__ */
/*
* Check whether we are accepting new connections...
*/
-diff -up cups-2.2b2/scheduler/Makefile.avahi-no-threaded cups-2.2b2/scheduler/Makefile
---- cups-2.2b2/scheduler/Makefile.avahi-no-threaded 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/Makefile 2016-06-27 17:55:19.569728950 +0200
+diff -up cups-2.2.5/scheduler/Makefile.avahi-no-threaded cups-2.2.5/scheduler/Makefile
+--- cups-2.2.5/scheduler/Makefile.avahi-no-threaded 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/Makefile 2017-10-17 19:03:00.762880999 +0200
@@ -15,6 +15,7 @@ include ../Makedefs
CUPSDOBJS = \
LIBOBJS = \
filter.o \
mime.o \
-diff -up cups-2.2b2/scheduler/timeout.c.avahi-no-threaded cups-2.2b2/scheduler/timeout.c
---- cups-2.2b2/scheduler/timeout.c.avahi-no-threaded 2016-06-27 17:55:19.569728950 +0200
-+++ cups-2.2b2/scheduler/timeout.c 2016-06-27 17:55:19.569728950 +0200
+diff -up cups-2.2.5/scheduler/timeout.c.avahi-no-threaded cups-2.2.5/scheduler/timeout.c
+--- cups-2.2.5/scheduler/timeout.c.avahi-no-threaded 2017-10-17 19:03:00.762880999 +0200
++++ cups-2.2.5/scheduler/timeout.c 2017-10-17 19:03:00.762880999 +0200
@@ -0,0 +1,235 @@
+/*
+ * "$Id$"
-diff -up cups-2.2b2/config.h.in.lspp cups-2.2b2/config.h.in
---- cups-2.2b2/config.h.in.lspp 2016-06-27 17:39:48.075973879 +0200
-+++ cups-2.2b2/config.h.in 2016-06-27 17:47:31.376356684 +0200
-@@ -737,4 +737,11 @@ static __inline int _cups_abs(int i) { r
+diff -up cups-2.2.5/config.h.in.lspp cups-2.2.5/config.h.in
+--- cups-2.2.5/config.h.in.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/config.h.in 2017-10-17 19:06:19.640228964 +0200
+@@ -730,4 +730,11 @@ static __inline int _cups_abs(int i) { r
# endif /* __GNUC__ || __STDC_VERSION__ */
#endif /* !HAVE_ABS && !abs */
+
+
#endif /* !_CUPS_CONFIG_H_ */
-diff -up cups-2.2b2/config-scripts/cups-lspp.m4.lspp cups-2.2b2/config-scripts/cups-lspp.m4
---- cups-2.2b2/config-scripts/cups-lspp.m4.lspp 2016-06-27 17:39:48.076973871 +0200
-+++ cups-2.2b2/config-scripts/cups-lspp.m4 2016-06-27 17:39:48.076973871 +0200
+diff -up cups-2.2.5/config-scripts/cups-lspp.m4.lspp cups-2.2.5/config-scripts/cups-lspp.m4
+--- cups-2.2.5/config-scripts/cups-lspp.m4.lspp 2017-10-17 19:06:19.640228964 +0200
++++ cups-2.2.5/config-scripts/cups-lspp.m4 2017-10-17 19:06:19.640228964 +0200
@@ -0,0 +1,36 @@
+dnl
+dnl LSPP code for the Common UNIX Printing System (CUPS).
+ ;;
+ esac
+fi
-diff -up cups-2.2b2/configure.ac.lspp cups-2.2b2/configure.ac
---- cups-2.2b2/configure.ac.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/configure.ac 2016-06-27 17:39:48.076973871 +0200
+diff -up cups-2.2.5/configure.ac.lspp cups-2.2.5/configure.ac
+--- cups-2.2.5/configure.ac.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/configure.ac 2017-10-17 19:06:19.640228964 +0200
@@ -38,6 +38,8 @@ sinclude(config-scripts/cups-startup.m4)
sinclude(config-scripts/cups-defaults.m4)
sinclude(config-scripts/cups-scripting.m4)
INSTALL_LANGUAGES=""
UNINSTALL_LANGUAGES=""
LANGFILES=""
-diff -up cups-2.2b2/filter/common.c.lspp cups-2.2b2/filter/common.c
---- cups-2.2b2/filter/common.c.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/filter/common.c 2016-06-27 17:39:48.076973871 +0200
+diff -up cups-2.2.5/filter/common.c.lspp cups-2.2.5/filter/common.c
+--- cups-2.2.5/filter/common.c.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/filter/common.c 2017-10-17 19:06:19.640228964 +0200
@@ -17,6 +17,12 @@
* Include necessary headers...
*/
/*
-diff -up cups-2.2b2/filter/pstops.c.lspp cups-2.2b2/filter/pstops.c
---- cups-2.2b2/filter/pstops.c.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/filter/pstops.c 2016-06-27 17:39:48.077973863 +0200
+diff -up cups-2.2.5/filter/pstops.c.lspp cups-2.2.5/filter/pstops.c
+--- cups-2.2.5/filter/pstops.c.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/filter/pstops.c 2017-10-17 19:06:19.641228955 +0200
@@ -3176,6 +3176,18 @@ write_label_prolog(pstops_doc_t *doc, /*
{
const char *classification; /* CLASSIFICATION environment variable */
/*
-diff -up cups-2.2b2/Makedefs.in.lspp cups-2.2b2/Makedefs.in
---- cups-2.2b2/Makedefs.in.lspp 2016-06-27 17:39:48.045974117 +0200
-+++ cups-2.2b2/Makedefs.in 2016-06-27 17:39:48.077973863 +0200
-@@ -143,7 +143,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f
+diff -up cups-2.2.5/Makedefs.in.lspp cups-2.2.5/Makedefs.in
+--- cups-2.2.5/Makedefs.in.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/Makedefs.in 2017-10-17 19:06:19.641228955 +0200
+@@ -161,7 +161,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
- LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(LIBZ)
+ LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(DNSSDLIBS) $(SSLLIBS) $(LIBZ)
LINKCUPSIMAGE = @LINKCUPSIMAGE@
-LIBS = $(LINKCUPS) $(COMMONLIBS)
+LIBS = $(LINKCUPS) $(COMMONLIBS) @LIBAUDIT@ @LIBSELINUX@
ONDEMANDFLAGS = @ONDEMANDFLAGS@
ONDEMANDLIBS = @ONDEMANDLIBS@
OPTIM = @OPTIM@
-diff -up cups-2.2b2/scheduler/client.c.lspp cups-2.2b2/scheduler/client.c
---- cups-2.2b2/scheduler/client.c.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/client.c 2016-06-27 17:39:48.077973863 +0200
+diff -up cups-2.2.5/scheduler/client.c.lspp cups-2.2.5/scheduler/client.c
+--- cups-2.2.5/scheduler/client.c.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/client.c 2017-10-17 19:06:19.689228556 +0200
@@ -22,12 +22,20 @@
#define _HTTP_NO_PRIVATE
#include "cupsd.h"
/*
-@@ -266,6 +274,59 @@ cupsdAcceptClient(cupsd_listener_t *lis)
+@@ -268,6 +276,59 @@ cupsdAcceptClient(cupsd_listener_t *lis)
}
#endif /* HAVE_TCPD_H */
#ifdef AF_LOCAL
if (httpAddrFamily(httpGetAddress(con->http)) == AF_LOCAL)
{
-@@ -560,6 +621,13 @@ cupsdReadClient(cupsd_client_t *con) /*
+@@ -562,6 +623,13 @@ cupsdReadClient(cupsd_client_t *con) /*
mime_type_t *type; /* MIME type of file */
cupsd_printer_t *p; /* Printer */
static unsigned request_id = 0; /* Request ID for temp files */
status = HTTP_STATUS_CONTINUE;
-@@ -1924,6 +1992,73 @@ cupsdReadClient(cupsd_client_t *con) /*
+@@ -1926,6 +1994,73 @@ cupsdReadClient(cupsd_client_t *con) /*
fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC);
}
/*
* 'pipe_command()' - Pipe the output of a command to the remote client.
-diff -up cups-2.2b2/scheduler/client.h.lspp cups-2.2b2/scheduler/client.h
---- cups-2.2b2/scheduler/client.h.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/client.h 2016-06-27 17:39:48.077973863 +0200
+diff -up cups-2.2.5/scheduler/client.h.lspp cups-2.2.5/scheduler/client.h
+--- cups-2.2.5/scheduler/client.h.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/client.h 2017-10-17 19:06:19.690228548 +0200
@@ -16,6 +16,13 @@
#endif /* HAVE_AUTHORIZATION_H */
#ifdef HAVE_SSL
extern int cupsdEndTLS(cupsd_client_t *con);
-diff -up cups-2.2b2/scheduler/conf.c.lspp cups-2.2b2/scheduler/conf.c
---- cups-2.2b2/scheduler/conf.c.lspp 2016-06-27 17:39:48.072973903 +0200
-+++ cups-2.2b2/scheduler/conf.c 2016-06-27 17:39:48.078973855 +0200
+diff -up cups-2.2.5/scheduler/conf.c.lspp cups-2.2.5/scheduler/conf.c
+--- cups-2.2.5/scheduler/conf.c.lspp 2017-10-17 19:06:19.637228989 +0200
++++ cups-2.2.5/scheduler/conf.c 2017-10-17 19:06:19.691228540 +0200
@@ -40,6 +40,9 @@
# define INADDR_NONE 0xffffffff
#endif /* !INADDR_NONE */
{ "WebInterface", &WebInterface, CUPSD_VARTYPE_BOOLEAN }
};
static const cupsd_var_t cupsfiles_vars[] =
-@@ -577,6 +584,9 @@ cupsdReadConfiguration(void)
+@@ -544,6 +551,9 @@ cupsdReadConfiguration(void)
const char *tmpdir; /* TMPDIR environment variable */
struct stat tmpinfo; /* Temporary directory info */
cupsd_policy_t *p; /* Policy */
/*
-@@ -931,6 +941,25 @@ cupsdReadConfiguration(void)
+@@ -866,6 +876,25 @@ cupsdReadConfiguration(void)
RunUser = getuid();
cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.",
RemotePort ? "enabled" : "disabled");
-@@ -1350,7 +1379,19 @@ cupsdReadConfiguration(void)
+@@ -1286,7 +1315,19 @@ cupsdReadConfiguration(void)
cupsdClearString(&Classification);
if (Classification)
/*
* Check the MaxClients setting, and then allocate memory for it...
-@@ -3827,6 +3868,18 @@ read_location(cups_file_t *fp, /* I - C
+@@ -3770,6 +3811,18 @@ read_location(cups_file_t *fp, /* I - C
return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum);
}
/*
* 'read_policy()' - Read a <Policy name> definition.
-diff -up cups-2.2b2/scheduler/conf.h.lspp cups-2.2b2/scheduler/conf.h
---- cups-2.2b2/scheduler/conf.h.lspp 2016-06-27 17:39:48.078973855 +0200
-+++ cups-2.2b2/scheduler/conf.h 2016-06-27 17:44:46.370632333 +0200
-@@ -248,6 +248,13 @@ VAR char *ServerKeychain VALUE(NULL);
+diff -up cups-2.2.5/scheduler/conf.h.lspp cups-2.2.5/scheduler/conf.h
+--- cups-2.2.5/scheduler/conf.h.lspp 2017-10-17 19:06:19.585229421 +0200
++++ cups-2.2.5/scheduler/conf.h 2017-10-17 19:06:19.691228540 +0200
+@@ -250,6 +250,13 @@ VAR char *ServerKeychain VALUE(NULL);
/* Keychain holding cert + key */
#endif /* HAVE_SSL */
#ifdef HAVE_ONDEMAND
VAR int IdleExitTimeout VALUE(60);
/* Time after which an idle cupsd will exit */
-@@ -266,6 +273,9 @@ VAR int HaveServerCreds VALUE(0);
+@@ -268,6 +275,9 @@ VAR int HaveServerCreds VALUE(0);
VAR gss_cred_id_t ServerCreds; /* Server's GSS credentials */
#endif /* HAVE_GSSAPI */
/*
* Prototypes...
-diff -up cups-2.2b2/scheduler/cupsd.h.lspp cups-2.2b2/scheduler/cupsd.h
---- cups-2.2b2/scheduler/cupsd.h.lspp 2016-06-27 17:39:48.064973966 +0200
-+++ cups-2.2b2/scheduler/cupsd.h 2016-06-27 17:39:48.078973855 +0200
+diff -up cups-2.2.5/scheduler/cupsd.h.lspp cups-2.2.5/scheduler/cupsd.h
+--- cups-2.2.5/scheduler/cupsd.h.lspp 2017-10-17 19:06:19.626229080 +0200
++++ cups-2.2.5/scheduler/cupsd.h 2017-10-17 19:06:19.691228540 +0200
@@ -11,6 +11,8 @@
* file is missing or damaged, see the license at "http://www.cups.org/".
*/
/*
* Some OS's don't have hstrerror(), most notably Solaris...
*/
-diff -up cups-2.2b2/scheduler/ipp.c.lspp cups-2.2b2/scheduler/ipp.c
---- cups-2.2b2/scheduler/ipp.c.lspp 2016-06-27 17:39:48.028974252 +0200
-+++ cups-2.2b2/scheduler/ipp.c 2016-06-27 17:39:48.080973839 +0200
+diff -up cups-2.2.5/scheduler/ipp.c.lspp cups-2.2.5/scheduler/ipp.c
+--- cups-2.2.5/scheduler/ipp.c.lspp 2017-10-17 19:06:19.599229305 +0200
++++ cups-2.2.5/scheduler/ipp.c 2017-10-17 19:06:19.695228506 +0200
@@ -14,6 +14,9 @@
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * missing or damaged, see the license at "http://www.cups.org/".
*/
+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
static int check_quotas(cupsd_client_t *con, cupsd_printer_t *p);
static void close_job(cupsd_client_t *con, ipp_attribute_t *uri);
static void copy_attrs(ipp_t *to, ipp_t *from, cups_array_t *ra,
-@@ -1248,6 +1262,21 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1286,6 +1300,21 @@ add_job(cupsd_client_t *con, /* I - Cl
"time-at-creation",
"time-at-processing"
};
cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))",
-@@ -1559,6 +1588,106 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1597,6 +1626,106 @@ add_job(cupsd_client_t *con, /* I - Cl
return (NULL);
}
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
{
send_ipp_status(con, IPP_INTERNAL_ERROR,
-@@ -1567,6 +1696,32 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1605,6 +1734,32 @@ add_job(cupsd_client_t *con, /* I - Cl
return (NULL);
}
job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
job->attrs = con->request;
job->dirty = 1;
-@@ -1756,6 +1911,29 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1794,6 +1949,29 @@ add_job(cupsd_client_t *con, /* I - Cl
ippSetString(job->attrs, &attr, 0, printer->job_sheets[0]);
ippSetString(job->attrs, &attr, 1, printer->job_sheets[1]);
}
job->job_sheets = attr;
-@@ -1786,6 +1964,9 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1824,6 +2002,9 @@ add_job(cupsd_client_t *con, /* I - Cl
"job-sheets=\"%s,none\", "
"job-originating-user-name=\"%s\"",
Classification, job->username);
}
else if (attr->num_values == 2 &&
strcmp(attr->values[0].string.text,
-@@ -1804,6 +1985,9 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1842,6 +2023,9 @@ add_job(cupsd_client_t *con, /* I - Cl
"job-originating-user-name=\"%s\"",
attr->values[0].string.text,
attr->values[1].string.text, job->username);
}
else if (strcmp(attr->values[0].string.text, Classification) &&
strcmp(attr->values[0].string.text, "none") &&
-@@ -1824,6 +2008,9 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1862,6 +2046,9 @@ add_job(cupsd_client_t *con, /* I - Cl
"job-originating-user-name=\"%s\"",
attr->values[0].string.text,
attr->values[1].string.text, job->username);
}
}
else if (strcmp(attr->values[0].string.text, Classification) &&
-@@ -1864,8 +2051,52 @@ add_job(cupsd_client_t *con, /* I - Cl
+@@ -1902,8 +2089,52 @@ add_job(cupsd_client_t *con, /* I - Cl
"job-sheets=\"%s\", "
"job-originating-user-name=\"%s\"",
Classification, job->username);
/*
* See if we need to add the starting sheet...
-@@ -3619,6 +3850,128 @@ check_rss_recipient(
+@@ -3686,6 +3917,128 @@ check_rss_recipient(
}
/*
* 'check_quotas()' - Check quotas for a printer and user.
*/
-@@ -4075,6 +4428,15 @@ copy_banner(cupsd_client_t *con, /* I -
+@@ -4142,6 +4495,15 @@ copy_banner(cupsd_client_t *con, /* I -
char attrname[255], /* Name of attribute */
*s; /* Pointer into name */
ipp_attribute_t *attr; /* Attribute */
cupsdLogMessage(CUPSD_LOG_DEBUG2,
-@@ -4110,6 +4472,85 @@ copy_banner(cupsd_client_t *con, /* I -
+@@ -4177,6 +4539,85 @@ copy_banner(cupsd_client_t *con, /* I -
fchmod(cupsFileNumber(out), 0640);
fchown(cupsFileNumber(out), RunUser, Group);
/*
* Try the localized banner file under the subdirectory...
-@@ -4204,6 +4645,24 @@ copy_banner(cupsd_client_t *con, /* I -
+@@ -4271,6 +4712,24 @@ copy_banner(cupsd_client_t *con, /* I -
else
s = attrname;
if (!strcmp(s, "printer-name"))
{
cupsFilePuts(out, job->dest);
-@@ -6389,6 +6848,22 @@ get_job_attrs(cupsd_client_t *con, /* I
+@@ -6459,6 +6918,22 @@ get_job_attrs(cupsd_client_t *con, /* I
exclude = cupsdGetPrivateAttrs(policy, con, printer, job->username);
/*
* Copy attributes...
*/
-@@ -6786,6 +7261,11 @@ get_jobs(cupsd_client_t *con, /* I - C
+@@ -6856,6 +7331,11 @@ get_jobs(cupsd_client_t *con, /* I - C
if (username[0] && _cups_strcasecmp(username, job->username))
continue;
if (count > 0)
ippAddSeparator(con->response);
-@@ -11415,6 +11895,11 @@ validate_user(cupsd_job_t *job, /* I
+@@ -11487,6 +11967,11 @@ validate_user(cupsd_job_t *job, /* I
strlcpy(username, get_username(con), userlen);
/*
* Check the username against the owner...
*/
-diff -up cups-2.2b2/scheduler/job.c.lspp cups-2.2b2/scheduler/job.c
---- cups-2.2b2/scheduler/job.c.lspp 2016-06-27 17:39:48.041974149 +0200
-+++ cups-2.2b2/scheduler/job.c 2016-06-27 17:39:48.081973831 +0200
+diff -up cups-2.2.5/scheduler/job.c.lspp cups-2.2.5/scheduler/job.c
+--- cups-2.2.5/scheduler/job.c.lspp 2017-10-17 19:06:19.607229238 +0200
++++ cups-2.2.5/scheduler/job.c 2017-10-17 19:06:19.696228498 +0200
@@ -11,6 +11,9 @@
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * missing or damaged, see the license at "http://www.cups.org/".
*/
+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
/*
* Design Notes for Job Management
-@@ -546,6 +557,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I
+@@ -547,6 +558,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I
/* PRINTER_STATE_REASONS env var */
rip_max_cache[255];
/* RIP_MAX_CACHE env variable */
cupsdLogMessage(CUPSD_LOG_DEBUG2,
-@@ -1082,6 +1101,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I
+@@ -1083,6 +1102,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I
if (final_content_type[0])
envp[envc ++] = final_content_type;
if (Classification && !banner_page)
{
if ((attr = ippFindAttribute(job->attrs, "job-sheets",
-@@ -1905,6 +1985,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J
+@@ -1908,6 +1988,22 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J
ippSetString(job->attrs, &job->reasons, 0, "none");
}
job->impressions = ippFindAttribute(job->attrs, "job-impressions-completed", IPP_TAG_INTEGER);
job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed", IPP_TAG_INTEGER);
job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME);
-@@ -2318,6 +2414,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
+@@ -2321,6 +2417,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
{
char filename[1024]; /* Job control filename */
cups_file_t *fp; /* Job file */
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p",
-@@ -2340,6 +2444,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
+@@ -2343,6 +2447,78 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
fchown(cupsFileNumber(fp), RunUser, Group);
job->attrs->state = IPP_IDLE;
if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL,
-@@ -3919,6 +4095,19 @@ get_options(cupsd_job_t *job, /* I - Jo
+@@ -3989,6 +4165,19 @@ get_options(cupsd_job_t *job, /* I - Jo
banner_page)
continue;
/*
* Otherwise add them to the list...
*/
-@@ -4680,6 +4869,18 @@ start_job(cupsd_job_t *job, /* I -
+@@ -4750,6 +4939,18 @@ start_job(cupsd_job_t *job, /* I -
cupsd_printer_t *printer) /* I - Printer to print job */
{
const char *filename; /* Support filename */
ipp_attribute_t *cancel_after = ippFindAttribute(job->attrs,
"job-cancel-after",
IPP_TAG_INTEGER);
-@@ -4856,6 +5057,113 @@ start_job(cupsd_job_t *job, /* I -
+@@ -4926,6 +5127,113 @@ start_job(cupsd_job_t *job, /* I -
fcntl(job->side_pipes[1], F_SETFD,
fcntl(job->side_pipes[1], F_GETFD) | FD_CLOEXEC);
/*
* Now start the first file in the job...
*/
-diff -up cups-2.2b2/scheduler/job.h.lspp cups-2.2b2/scheduler/job.h
---- cups-2.2b2/scheduler/job.h.lspp 2016-06-24 17:43:35.000000000 +0200
-+++ cups-2.2b2/scheduler/job.h 2016-06-27 17:39:48.081973831 +0200
+diff -up cups-2.2.5/scheduler/job.h.lspp cups-2.2.5/scheduler/job.h
+--- cups-2.2.5/scheduler/job.h.lspp 2017-10-13 20:22:26.000000000 +0200
++++ cups-2.2.5/scheduler/job.h 2017-10-17 19:06:19.696228498 +0200
@@ -11,6 +11,13 @@
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * missing or damaged, see the license at "http://www.cups.org/".
*/
+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
};
typedef struct cupsd_joblog_s /**** Job log message ****/
-diff -up cups-2.2b2/scheduler/main.c.lspp cups-2.2b2/scheduler/main.c
---- cups-2.2b2/scheduler/main.c.lspp 2016-06-27 17:39:48.064973966 +0200
-+++ cups-2.2b2/scheduler/main.c 2016-06-27 17:39:48.081973831 +0200
+diff -up cups-2.2.5/scheduler/main.c.lspp cups-2.2.5/scheduler/main.c
+--- cups-2.2.5/scheduler/main.c.lspp 2017-10-17 19:06:19.637228989 +0200
++++ cups-2.2.5/scheduler/main.c 2017-10-17 19:08:26.642173026 +0200
@@ -56,6 +56,9 @@
# include <sys/param.h>
#endif /* HAVE_SYS_PARAM_H */
#ifdef __APPLE__
int use_sysman = 1; /* Use system management functions? */
#else
-@@ -505,6 +511,25 @@ main(int argc, /* I - Number of comm
+@@ -516,6 +522,25 @@ main(int argc, /* I - Number of comm
exit(errno);
}
+#endif /* WITH_LSPP */
+
/*
- * Set the timezone info...
+ * Let the system know we are busy while we bring up cupsd...
*/
-@@ -1205,6 +1230,11 @@ main(int argc, /* I - Number of comm
+@@ -1227,6 +1252,11 @@ main(int argc, /* I - Number of comm
cupsdStopSelect();
return (!stop_scheduler);
}
-diff -up cups-2.2b2/scheduler/printers.c.lspp cups-2.2b2/scheduler/printers.c
---- cups-2.2b2/scheduler/printers.c.lspp 2016-06-27 17:39:48.013974372 +0200
-+++ cups-2.2b2/scheduler/printers.c 2016-06-27 17:39:48.082973823 +0200
+diff -up cups-2.2.5/scheduler/printers.c.lspp cups-2.2.5/scheduler/printers.c
+--- cups-2.2.5/scheduler/printers.c.lspp 2017-10-17 19:06:19.587229404 +0200
++++ cups-2.2.5/scheduler/printers.c 2017-10-17 19:06:19.697228490 +0200
@@ -11,6 +11,8 @@
- * file is missing or damaged, see the license at "http://www.cups.org/".
+ * missing or damaged, see the license at "http://www.cups.org/".
*/
+/* (c) Copyright 2005-2006 Hewlett-Packard Development Company, L.P. */
/*
* Local functions...
-@@ -2191,6 +2197,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
+@@ -2212,6 +2218,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
ipp_attribute_t *attr; /* Attribute data */
char *name, /* Current user/group name */
*filter; /* Current filter */
DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name,
-@@ -2318,6 +2331,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
+@@ -2339,6 +2352,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
attr->values[1].string.text = _cupsStrAlloc(Classification ?
Classification : p->job_sheets[1]);
}