1.6.1
This commit is contained in:
parent
2688b643e3
commit
47ca1c0ae4
1
.gitignore
vendored
1
.gitignore
vendored
@ -52,3 +52,4 @@ cups-1.4.4-source.tar.bz2
|
||||
/cups-1.5.2-source.tar.bz2
|
||||
/cups-1.5.3-source.tar.bz2
|
||||
/cups-1.5.4-source.tar.bz2
|
||||
/cups-1.6.1-source.tar.bz2
|
||||
|
@ -1,14 +1,14 @@
|
||||
diff -up cups-1.5.3/Makedefs.in.0755 cups-1.5.3/Makedefs.in
|
||||
--- cups-1.5.3/Makedefs.in.0755 2012-05-15 16:51:31.000000000 +0200
|
||||
+++ cups-1.5.3/Makedefs.in 2012-05-15 16:52:59.246906315 +0200
|
||||
@@ -41,14 +41,14 @@ SHELL = /bin/sh
|
||||
diff -up cups-1.6b1/Makedefs.in.0755 cups-1.6b1/Makedefs.in
|
||||
--- cups-1.6b1/Makedefs.in.0755 2012-05-23 01:58:31.000000000 +0200
|
||||
+++ cups-1.6b1/Makedefs.in 2012-05-25 16:09:40.545463214 +0200
|
||||
@@ -40,14 +40,14 @@ SHELL = /bin/sh
|
||||
# Installation programs...
|
||||
#
|
||||
|
||||
-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 755 @INSTALL_STRIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_COMPDATA = $(INSTALL) -c -m 444 @INSTALL_GZIP@
|
||||
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
|
||||
INSTALL_DATA = $(INSTALL) -c -m 444
|
||||
INSTALL_DIR = $(INSTALL) -d
|
||||
-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
|
||||
@ -19,15 +19,3 @@ diff -up cups-1.5.3/Makedefs.in.0755 cups-1.5.3/Makedefs.in
|
||||
|
||||
#
|
||||
# Default user, group, and system groups for the scheduler...
|
||||
diff -up cups-1.5.3/scheduler/Makefile.0755 cups-1.5.3/scheduler/Makefile
|
||||
--- cups-1.5.3/scheduler/Makefile.0755 2011-05-12 00:17:34.000000000 +0200
|
||||
+++ cups-1.5.3/scheduler/Makefile 2012-05-15 16:51:31.703516547 +0200
|
||||
@@ -213,7 +213,7 @@ install-data:
|
||||
install-exec:
|
||||
echo Installing programs in $(SBINDIR)...
|
||||
$(INSTALL_DIR) -m 755 $(SBINDIR)
|
||||
- $(INSTALL_BIN) -m 500 cupsd $(SBINDIR)
|
||||
+ $(INSTALL_BIN) -m 755 cupsd $(SBINDIR)
|
||||
$(INSTALL_BIN) cupsfilter $(SBINDIR)
|
||||
-if test "x`uname`" = xDarwin; then \
|
||||
$(INSTALL_DIR) $(BUILDROOT)/System/Library/Printers/Libraries; \
|
||||
|
@ -1,42 +0,0 @@
|
||||
diff -up cups-1.5.2/config.h.in.avahi-1-config cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.avahi-1-config 2011-06-16 21:12:16.000000000 +0100
|
||||
+++ cups-1.5.2/config.h.in 2012-03-14 15:04:51.365347165 +0000
|
||||
@@ -390,6 +390,13 @@
|
||||
|
||||
|
||||
/*
|
||||
+ * Do we have Avahi for DNS Service Discovery?
|
||||
+ */
|
||||
+
|
||||
+#undef HAVE_AVAHI
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* Do we have <sys/ioctl.h>?
|
||||
*/
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config cups-1.5.2/config-scripts/cups-dnssd.m4
|
||||
--- cups-1.5.2/config-scripts/cups-dnssd.m4.avahi-1-config 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.2/config-scripts/cups-dnssd.m4 2012-03-14 15:04:51.365347165 +0000
|
||||
@@ -23,6 +23,21 @@ AC_ARG_WITH(dnssd-includes, [ --with-dn
|
||||
DNSSDLIBS=""
|
||||
DNSSD_BACKEND=""
|
||||
|
||||
+AC_ARG_ENABLE(avahi, [ --enable-avahi turn on DNS Service Discovery support, default=no],
|
||||
+ [if test x$enable_avahi = xyes; then
|
||||
+ AC_MSG_CHECKING(for Avahi)
|
||||
+ if $PKGCONFIG --exists avahi-client; then
|
||||
+ AC_MSG_RESULT(yes)
|
||||
+ CFLAGS="$CFLAGS `$PKGCONFIG --cflags avahi-client`"
|
||||
+ DNSSDLIBS="`$PKGCONFIG --libs avahi-client`"
|
||||
+ DNSSD_BACKEND="dnssd"
|
||||
+ AC_DEFINE(HAVE_AVAHI)
|
||||
+ enable_dnssd=no
|
||||
+ else
|
||||
+ AC_MSG_RESULT(no)
|
||||
+ fi
|
||||
+ fi])
|
||||
+
|
||||
if test x$enable_dnssd != xno; then
|
||||
AC_CHECK_HEADER(dns_sd.h, [
|
||||
case "$uname" in
|
File diff suppressed because it is too large
Load Diff
@ -1,381 +0,0 @@
|
||||
diff -up cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts cups-1.5.2/scheduler/cupsd.h
|
||||
--- cups-1.5.2/scheduler/cupsd.h.avahi-3-timeouts 2011-05-11 23:17:34.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/cupsd.h 2012-03-14 15:06:36.509476983 +0000
|
||||
@@ -140,6 +140,15 @@ extern const char *cups_hstrerror(int);
|
||||
|
||||
typedef void (*cupsd_selfunc_t)(void *data);
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+/*
|
||||
+ * Timeout callback function type...
|
||||
+ */
|
||||
+
|
||||
+typedef struct _cupsd_timeout_s cupsd_timeout_t;
|
||||
+typedef void (*cupsd_timeoutfunc_t)(cupsd_timeout_t *timeout, void *data);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
|
||||
/*
|
||||
* Globals...
|
||||
@@ -173,6 +182,11 @@ VAR int Launchd VALUE(0);
|
||||
/* Running from launchd */
|
||||
#endif /* HAVE_LAUNCH_H */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+VAR cups_array_t *Timeouts; /* Timed callbacks for main loop */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
@@ -242,6 +256,20 @@ extern void cupsdStopSelect(void);
|
||||
extern void cupsdStartServer(void);
|
||||
extern void cupsdStopServer(void);
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+extern void cupsdInitTimeouts(void);
|
||||
+extern cupsd_timeout_t *cupsdAddTimeout (const struct timeval *tv,
|
||||
+ cupsd_timeoutfunc_t cb,
|
||||
+ void *data);
|
||||
+extern cupsd_timeout_t *cupsdNextTimeout (long *delay);
|
||||
+extern void cupsdRunTimeout (cupsd_timeout_t *timeout);
|
||||
+extern void cupsdUpdateTimeout (cupsd_timeout_t *timeout,
|
||||
+ const struct timeval *tv);
|
||||
+extern void cupsdRemoveTimeout (cupsd_timeout_t *timeout);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+extern int cupsdRemoveFile(const char *filename);
|
||||
+
|
||||
|
||||
/*
|
||||
* End of "$Id: cupsd.h 9766 2011-05-11 22:17:34Z mike $".
|
||||
diff -up cups-1.5.2/scheduler/main.c.avahi-3-timeouts cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.avahi-3-timeouts 2012-03-14 15:04:17.655305548 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-03-14 15:06:36.511476986 +0000
|
||||
@@ -146,6 +146,10 @@ main(int argc, /* I - Number of comm
|
||||
int launchd_idle_exit;
|
||||
/* Idle exit on select timeout? */
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ cupsd_timeout_t *tmo; /* Next scheduled timed callback */
|
||||
+ long tmo_delay; /* Time before it must be called */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
|
||||
|
||||
#ifdef HAVE_GETEUID
|
||||
@@ -535,6 +539,14 @@ main(int argc, /* I - Number of comm
|
||||
|
||||
httpInitialize();
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * Initialize timed callback structures.
|
||||
+ */
|
||||
+
|
||||
+ cupsdInitTimeouts();
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
cupsdStartServer();
|
||||
|
||||
/*
|
||||
@@ -874,6 +886,16 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * If a timed callback is due, run it.
|
||||
+ */
|
||||
+
|
||||
+ tmo = cupsdNextTimeout (&tmo_delay);
|
||||
+ if (tmo && tmo_delay == 0)
|
||||
+ cupsdRunTimeout (tmo);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
#ifndef __APPLE__
|
||||
/*
|
||||
* Update the network interfaces once a minute...
|
||||
@@ -1787,6 +1809,10 @@ select_timeout(int fds) /* I - Number
|
||||
cupsd_job_t *job; /* Job information */
|
||||
cupsd_subscription_t *sub; /* Subscription information */
|
||||
const char *why; /* Debugging aid */
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ cupsd_timeout_t *tmo; /* Timed callback */
|
||||
+ long tmo_delay; /* Seconds before calling it */
|
||||
+#endif /* HAVE_AVAHI */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1829,6 +1855,19 @@ select_timeout(int fds) /* I - Number
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef HAVE_AVAHI
|
||||
+ /*
|
||||
+ * See if there are any scheduled timed callbacks to run.
|
||||
+ */
|
||||
+
|
||||
+ if ((tmo = cupsdNextTimeout(&tmo_delay)) != NULL &&
|
||||
+ (now + tmo_delay) < timeout)
|
||||
+ {
|
||||
+ timeout = tmo_delay;
|
||||
+ why = "run a timed callback";
|
||||
+ }
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
/*
|
||||
* Check whether we are accepting new connections...
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/Makefile.avahi-3-timeouts cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.avahi-3-timeouts 2012-03-14 15:04:17.685305586 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-14 15:06:36.508476980 +0000
|
||||
@@ -39,7 +39,8 @@ CUPSDOBJS = \
|
||||
server.o \
|
||||
statbuf.o \
|
||||
subscriptions.o \
|
||||
- sysman.o
|
||||
+ sysman.o \
|
||||
+ timeout.o
|
||||
LIBOBJS = \
|
||||
filter.o \
|
||||
mime.o \
|
||||
diff -up cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts cups-1.5.2/scheduler/timeout.c
|
||||
--- cups-1.5.2/scheduler/timeout.c.avahi-3-timeouts 2012-03-14 15:06:36.552477037 +0000
|
||||
+++ cups-1.5.2/scheduler/timeout.c 2012-03-14 15:06:36.552477037 +0000
|
||||
@@ -0,0 +1,235 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Timeout functions for the Common UNIX Printing System (CUPS).
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ *
|
||||
+ * Contents:
|
||||
+ *
|
||||
+ * cupsdInitTimeouts() - Initialise timeout structure.
|
||||
+ * cupsdAddTimeout() - Add a timed callback.
|
||||
+ * cupsdNextTimeout() - Find the next enabled timed callback.
|
||||
+ * cupsdUpdateTimeout() - Adjust the time of a timed callback or disable it.
|
||||
+ * cupsdRemoveTimeout() - Discard a timed callback.
|
||||
+ * compare_timeouts() - Compare timed callbacks for array sorting.
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI /* Applies to entire file... */
|
||||
+
|
||||
+/*
|
||||
+ * Include necessary headers...
|
||||
+ */
|
||||
+
|
||||
+#include "cupsd.h"
|
||||
+
|
||||
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
+# include <malloc.h>
|
||||
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-common/timeval.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+struct _cupsd_timeout_s
|
||||
+{
|
||||
+ struct timeval when;
|
||||
+ int enabled;
|
||||
+ cupsd_timeoutfunc_t callback;
|
||||
+ void *data;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Local functions...
|
||||
+ */
|
||||
+
|
||||
+/*
|
||||
+ * 'compare_timeouts()' - Compare timed callbacks for array sorting.
|
||||
+ */
|
||||
+
|
||||
+static int
|
||||
+compare_addrs (void *p0, void *p1)
|
||||
+{
|
||||
+ if (p0 == p1)
|
||||
+ return (0);
|
||||
+ if (p0 < p1)
|
||||
+ return (-1);
|
||||
+ return (1);
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+compare_timeouts (cupsd_timeout_t *p0, cupsd_timeout_t *p1)
|
||||
+{
|
||||
+ int addrsdiff = compare_addrs (p0, p1);
|
||||
+ int tvdiff;
|
||||
+
|
||||
+ if (addrsdiff == 0)
|
||||
+ return (0);
|
||||
+
|
||||
+ if (!p0->enabled || !p1->enabled)
|
||||
+ {
|
||||
+ if (!p0->enabled && !p1->enabled)
|
||||
+ return (addrsdiff);
|
||||
+
|
||||
+ return (p0->enabled ? -1 : 1);
|
||||
+ }
|
||||
+
|
||||
+ tvdiff = avahi_timeval_compare (&p0->when, &p1->when);
|
||||
+ if (tvdiff != 0)
|
||||
+ return (tvdiff);
|
||||
+
|
||||
+ return (addrsdiff);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdInitTimeouts()' - Initialise timeout structures.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdInitTimeouts(void)
|
||||
+{
|
||||
+ Timeouts = cupsArrayNew ((cups_array_func_t)compare_timeouts, NULL);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdAddTimeout()' - Add a timed callback.
|
||||
+ */
|
||||
+
|
||||
+cupsd_timeout_t * /* O - Timeout handle */
|
||||
+cupsdAddTimeout(const struct timeval *tv, /* I - Absolute time */
|
||||
+ cupsd_timeoutfunc_t cb, /* I - Callback function */
|
||||
+ void *data) /* I - User data */
|
||||
+{
|
||||
+ cupsd_timeout_t *timeout;
|
||||
+
|
||||
+ timeout = malloc (sizeof(cupsd_timeout_t));
|
||||
+ if (timeout != NULL)
|
||||
+ {
|
||||
+ timeout->enabled = (tv != NULL);
|
||||
+ if (tv)
|
||||
+ {
|
||||
+ timeout->when.tv_sec = tv->tv_sec;
|
||||
+ timeout->when.tv_usec = tv->tv_usec;
|
||||
+ }
|
||||
+
|
||||
+ timeout->callback = cb;
|
||||
+ timeout->data = data;
|
||||
+ cupsArrayAdd (Timeouts, timeout);
|
||||
+ }
|
||||
+
|
||||
+ return timeout;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdNextTimeout()' - Find the next enabled timed callback.
|
||||
+ */
|
||||
+
|
||||
+cupsd_timeout_t * /* O - Next enabled timeout or NULL */
|
||||
+cupsdNextTimeout(long *delay) /* O - Seconds before scheduled */
|
||||
+{
|
||||
+ cupsd_timeout_t *first = cupsArrayFirst (Timeouts);
|
||||
+ struct timeval curtime;
|
||||
+
|
||||
+ if (first && !first->enabled)
|
||||
+ first = NULL;
|
||||
+
|
||||
+ if (first && delay)
|
||||
+ {
|
||||
+ gettimeofday (&curtime, NULL);
|
||||
+ if (avahi_timeval_compare (&curtime, &first->when) > 0)
|
||||
+ {
|
||||
+ *delay = 0;
|
||||
+ } else {
|
||||
+ *delay = 1 + first->when.tv_sec - curtime.tv_sec;
|
||||
+ if (first->when.tv_usec < curtime.tv_usec)
|
||||
+ (*delay)--;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return (first);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdRunTimeout()' - Run a timed callback.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdRunTimeout(cupsd_timeout_t *timeout) /* I - Timeout */
|
||||
+{
|
||||
+ if (!timeout)
|
||||
+ return;
|
||||
+ timeout->enabled = 0;
|
||||
+ if (!timeout->callback)
|
||||
+ return;
|
||||
+ timeout->callback (timeout, timeout->data);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdUpdateTimeout()' - Adjust the time of a timed callback or disable it.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdUpdateTimeout(cupsd_timeout_t *timeout, /* I - Timeout */
|
||||
+ const struct timeval *tv) /* I - Absolute time or NULL */
|
||||
+{
|
||||
+ cupsArrayRemove (Timeouts, timeout);
|
||||
+ timeout->enabled = (tv != NULL);
|
||||
+ if (tv)
|
||||
+ {
|
||||
+ timeout->when.tv_sec = tv->tv_sec;
|
||||
+ timeout->when.tv_usec = tv->tv_usec;
|
||||
+ }
|
||||
+ cupsArrayAdd (Timeouts, timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'cupsdRemoveTimeout()' - Discard a timed callback.
|
||||
+ */
|
||||
+
|
||||
+void
|
||||
+cupsdRemoveTimeout(cupsd_timeout_t *timeout) /* I - Timeout */
|
||||
+{
|
||||
+ cupsArrayRemove (Timeouts, timeout);
|
||||
+ free (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#endif /* HAVE_AVAHI ... from top of file */
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
@ -1,529 +0,0 @@
|
||||
diff -up cups-1.5.2/scheduler/avahi.c.avahi-4-poll cups-1.5.2/scheduler/avahi.c
|
||||
--- cups-1.5.2/scheduler/avahi.c.avahi-4-poll 2012-03-14 15:07:29.477542381 +0000
|
||||
+++ cups-1.5.2/scheduler/avahi.c 2012-03-14 15:07:29.477542381 +0000
|
||||
@@ -0,0 +1,441 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Avahi poll implementation for the CUPS scheduler.
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ *
|
||||
+ * Contents:
|
||||
+ *
|
||||
+ * watch_read_cb - Read callback for file descriptor
|
||||
+ * watch_write_cb - Write callback for file descriptor
|
||||
+ * watched_fd_add_select() - Call cupsdAddSelect() as needed
|
||||
+ * watch_new() - Create a new file descriptor watch
|
||||
+ * watch_free() - Free a file descriptor watch
|
||||
+ * watch_update() - Update watched events for a file descriptor
|
||||
+ * watch_get_events() - Get events that happened for a file descriptor
|
||||
+ * timeout_cb() - Run a timed Avahi callback
|
||||
+ * timeout_new() - Set a wakeup time
|
||||
+ * timeout_update() - Update the expiration time for a timeout
|
||||
+ * timeout_free() - Free a timeout
|
||||
+ * compare_watched_fds() - Compare watched file descriptors for array sorting
|
||||
+ * avahi_cups_poll_new() - Create a new Avahi main loop object for CUPS
|
||||
+ * avahi_cups_poll_free() - Free an Avahi main loop object for CUPS
|
||||
+ * avahi_cups_poll_get() - Get the abstract poll API structure
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI /* Applies to entire file... */
|
||||
+
|
||||
+/*
|
||||
+ * Include necessary headers...
|
||||
+ */
|
||||
+
|
||||
+#include "cupsd.h"
|
||||
+
|
||||
+#if defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
|
||||
+# include <malloc.h>
|
||||
+#endif /* HAVE_MALLOC_H && HAVE_MALLINFO */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-common/timeval.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+typedef struct
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll;
|
||||
+
|
||||
+ int fd;
|
||||
+ AvahiWatchEvent occurred;
|
||||
+ cups_array_t *watches;
|
||||
+} cupsd_watched_fd_t;
|
||||
+
|
||||
+struct AvahiWatch
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd;
|
||||
+
|
||||
+ AvahiWatchEvent events;
|
||||
+ AvahiWatchCallback callback;
|
||||
+ void *userdata;
|
||||
+};
|
||||
+
|
||||
+struct AvahiTimeout
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll;
|
||||
+ AvahiTimeoutCallback callback;
|
||||
+ void *userdata;
|
||||
+ cupsd_timeout_t *cupsd_timeout;
|
||||
+};
|
||||
+
|
||||
+/*
|
||||
+ * Local functions...
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatch * watch_new(const AvahiPoll *api,
|
||||
+ int fd,
|
||||
+ AvahiWatchEvent events,
|
||||
+ AvahiWatchCallback callback,
|
||||
+ void *userdata);
|
||||
+static void watch_free(AvahiWatch *watch);
|
||||
+static void watch_update(AvahiWatch *watch,
|
||||
+ AvahiWatchEvent events);
|
||||
+static AvahiWatchEvent watch_get_events(AvahiWatch *watch);
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_read_cb' - Read callback for file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_read_cb (void *userdata)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_watched_fd_t *watched_fd = userdata;
|
||||
+ watched_fd->occurred |= AVAHI_WATCH_IN;
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ if (watch->events & watched_fd->occurred)
|
||||
+ {
|
||||
+ (watch->callback) (watch, watched_fd->fd,
|
||||
+ AVAHI_WATCH_IN, watch->userdata);
|
||||
+ watched_fd->occurred &= ~AVAHI_WATCH_IN;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_write_cb' - Write callback for file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_write_cb (void *userdata)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_watched_fd_t *watched_fd = userdata;
|
||||
+ watched_fd->occurred |= AVAHI_WATCH_OUT;
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ if (watch->events & watched_fd->occurred)
|
||||
+ {
|
||||
+ (watch->callback) (watch, watched_fd->fd,
|
||||
+ AVAHI_WATCH_OUT, watch->userdata);
|
||||
+ watched_fd->occurred &= ~AVAHI_WATCH_OUT;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watched_fd_add_select' - Call cupsdAddSelect() as needed
|
||||
+ */
|
||||
+
|
||||
+static int /* O - Watches? */
|
||||
+watched_fd_add_select (cupsd_watched_fd_t *watched_fd)
|
||||
+{
|
||||
+ AvahiWatch *watch;
|
||||
+ cupsd_selfunc_t read_cb = NULL, write_cb = NULL;
|
||||
+ int any_watches = 0;
|
||||
+
|
||||
+ for (watch = (AvahiWatch *)cupsArrayFirst(watched_fd->watches);
|
||||
+ watch;
|
||||
+ watch = (AvahiWatch *)cupsArrayNext(watched_fd->watches))
|
||||
+ {
|
||||
+ any_watches = 1;
|
||||
+ if (watch->events & (AVAHI_WATCH_IN |
|
||||
+ AVAHI_WATCH_ERR |
|
||||
+ AVAHI_WATCH_HUP))
|
||||
+ {
|
||||
+ read_cb = (cupsd_selfunc_t)watch_read_cb;
|
||||
+ if (write_cb != NULL)
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (watch->events & AVAHI_WATCH_OUT)
|
||||
+ {
|
||||
+ write_cb = (cupsd_selfunc_t)watch_write_cb;
|
||||
+ if (read_cb != NULL)
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (read_cb || write_cb)
|
||||
+ cupsdAddSelect (watched_fd->fd, read_cb, write_cb, watched_fd);
|
||||
+ else
|
||||
+ cupsdRemoveSelect (watched_fd->fd);
|
||||
+
|
||||
+ return (any_watches);
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_new' - Create a new file descriptor watch
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatch *
|
||||
+watch_new (const AvahiPoll *api,
|
||||
+ int fd,
|
||||
+ AvahiWatchEvent events,
|
||||
+ AvahiWatchCallback callback,
|
||||
+ void *userdata)
|
||||
+{
|
||||
+ cupsd_watched_fd_t key, *watched_fd;
|
||||
+ AvahiCupsPoll *cups_poll = api->userdata;
|
||||
+ AvahiWatch *watch = malloc(sizeof(AvahiWatch));
|
||||
+ if (watch == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ watch->events = events;
|
||||
+ watch->callback = callback;
|
||||
+ watch->userdata = userdata;
|
||||
+
|
||||
+ key.fd = fd;
|
||||
+ watched_fd = cupsArrayFind (cups_poll->watched_fds, &key);
|
||||
+ if (watched_fd == NULL)
|
||||
+ {
|
||||
+ watched_fd = malloc(sizeof(cupsd_watched_fd_t));
|
||||
+ if (watched_fd == NULL)
|
||||
+ {
|
||||
+ free (watch);
|
||||
+ return (NULL);
|
||||
+ }
|
||||
+
|
||||
+ watched_fd->fd = fd;
|
||||
+ watched_fd->occurred = 0;
|
||||
+ watched_fd->cups_poll = cups_poll;
|
||||
+ watched_fd->watches = cupsArrayNew (NULL, NULL);
|
||||
+ cupsArrayAdd (cups_poll->watched_fds, watched_fd);
|
||||
+ }
|
||||
+
|
||||
+ watch->watched_fd = watched_fd;
|
||||
+ cupsArrayAdd(watched_fd->watches, watch);
|
||||
+ watched_fd_add_select (watched_fd);
|
||||
+ return (watch);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_free' - Free a file descriptor watch
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_free (AvahiWatch *watch)
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd = watch->watched_fd;
|
||||
+ AvahiCupsPoll *cups_poll = watched_fd->cups_poll;
|
||||
+
|
||||
+ cupsArrayRemove (watched_fd->watches, watch);
|
||||
+ free (watch);
|
||||
+
|
||||
+ if (!watched_fd_add_select (watched_fd))
|
||||
+ {
|
||||
+ /* No more watches */
|
||||
+ cupsArrayRemove (cups_poll->watched_fds, watched_fd);
|
||||
+ free (watched_fd);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_update' - Update watched events for a file descriptor
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+watch_update (AvahiWatch *watch,
|
||||
+ AvahiWatchEvent events)
|
||||
+{
|
||||
+ watch->events = events;
|
||||
+ watched_fd_add_select (watch->watched_fd);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'watch_get_events' - Get events that happened for a file descriptor
|
||||
+ */
|
||||
+
|
||||
+static AvahiWatchEvent
|
||||
+watch_get_events (AvahiWatch *watch)
|
||||
+{
|
||||
+ return (watch->watched_fd->occurred);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_cb()' - Run a timed Avahi callback
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_cb (cupsd_timeout_t *cupsd_timeout, void *userdata)
|
||||
+{
|
||||
+ AvahiTimeout *timeout = userdata;
|
||||
+ (timeout->callback) (timeout, timeout->userdata);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_new' - Set a wakeup time
|
||||
+ */
|
||||
+
|
||||
+static AvahiTimeout *
|
||||
+timeout_new (const AvahiPoll *api,
|
||||
+ const struct timeval *tv,
|
||||
+ AvahiTimeoutCallback callback,
|
||||
+ void *userdata)
|
||||
+{
|
||||
+ AvahiTimeout *timeout;
|
||||
+ AvahiCupsPoll *cups_poll = api->userdata;
|
||||
+
|
||||
+ timeout = malloc(sizeof(AvahiTimeout));
|
||||
+ if (timeout == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ timeout->cups_poll = cups_poll;
|
||||
+ timeout->callback = callback;
|
||||
+ timeout->userdata = userdata;
|
||||
+ timeout->cupsd_timeout = cupsdAddTimeout (tv,
|
||||
+ (cupsd_timeoutfunc_t)timeout_cb,
|
||||
+ timeout);
|
||||
+ cupsArrayAdd (cups_poll->timeouts, timeout);
|
||||
+ return (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'timeout_update' - Update the expiration time for a timeout
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_update (AvahiTimeout *timeout,
|
||||
+ const struct timeval *tv)
|
||||
+{
|
||||
+ cupsdUpdateTimeout (timeout->cupsd_timeout, tv);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * ' timeout_free' - Free a timeout
|
||||
+ */
|
||||
+
|
||||
+static void
|
||||
+timeout_free (AvahiTimeout *timeout)
|
||||
+{
|
||||
+ cupsArrayRemove (timeout->cups_poll->timeouts, timeout);
|
||||
+ cupsdRemoveTimeout (timeout->cupsd_timeout);
|
||||
+ free (timeout);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'compare_watched_fds' - Compare watched file descriptors for array sorting
|
||||
+ */
|
||||
+static int
|
||||
+compare_watched_fds(cupsd_watched_fd_t *p0,
|
||||
+ cupsd_watched_fd_t *p1)
|
||||
+{
|
||||
+ /*
|
||||
+ * Compare by fd (no two elements have the same fd)
|
||||
+ */
|
||||
+
|
||||
+ if (p0->fd == p1->fd)
|
||||
+ return 0;
|
||||
+
|
||||
+ return (p0->fd < p1->fd ? -1 : 1);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_new' - Create a new Avahi main loop object for CUPS
|
||||
+ */
|
||||
+
|
||||
+AvahiCupsPoll *
|
||||
+avahi_cups_poll_new (void)
|
||||
+{
|
||||
+ AvahiCupsPoll *cups_poll = malloc(sizeof(AvahiCupsPoll));
|
||||
+ if (cups_poll == NULL)
|
||||
+ return (NULL);
|
||||
+
|
||||
+ cups_poll->watched_fds = cupsArrayNew ((cups_array_func_t)compare_watched_fds,
|
||||
+ NULL);
|
||||
+ cups_poll->timeouts = cupsArrayNew (NULL, NULL);
|
||||
+
|
||||
+ cups_poll->api.userdata = cups_poll;
|
||||
+ cups_poll->api.watch_new = watch_new;
|
||||
+ cups_poll->api.watch_free = watch_free;
|
||||
+ cups_poll->api.watch_update = watch_update;
|
||||
+ cups_poll->api.watch_get_events = watch_get_events;
|
||||
+
|
||||
+ cups_poll->api.timeout_new = timeout_new;
|
||||
+ cups_poll->api.timeout_update = timeout_update;
|
||||
+ cups_poll->api.timeout_free = timeout_free;
|
||||
+
|
||||
+ return (cups_poll);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_free' - Free an Avahi main loop object for CUPS
|
||||
+ */
|
||||
+void
|
||||
+avahi_cups_poll_free (AvahiCupsPoll *cups_poll)
|
||||
+{
|
||||
+ cupsd_watched_fd_t *watched_fd;
|
||||
+
|
||||
+ for (watched_fd = (cupsd_watched_fd_t*)cupsArrayFirst(cups_poll->watched_fds);
|
||||
+ watched_fd;
|
||||
+ watched_fd = (cupsd_watched_fd_t*)cupsArrayNext(cups_poll->watched_fds))
|
||||
+ cupsArrayClear (watched_fd->watches);
|
||||
+
|
||||
+ cupsArrayClear (cups_poll->watched_fds);
|
||||
+ cupsArrayClear (cups_poll->timeouts);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * 'avahi_cups_poll_get' - Get the abstract poll API structure
|
||||
+ */
|
||||
+
|
||||
+const AvahiPoll *
|
||||
+avahi_cups_poll_get (AvahiCupsPoll *cups_poll)
|
||||
+{
|
||||
+ return (&cups_poll->api);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+#endif /* HAVE_AVAHI ... from top of file */
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-1.5.2/scheduler/avahi.h.avahi-4-poll cups-1.5.2/scheduler/avahi.h
|
||||
--- cups-1.5.2/scheduler/avahi.h.avahi-4-poll 2012-03-14 15:07:29.477542381 +0000
|
||||
+++ cups-1.5.2/scheduler/avahi.h 2012-03-14 15:07:29.477542381 +0000
|
||||
@@ -0,0 +1,69 @@
|
||||
+/*
|
||||
+ * "$Id$"
|
||||
+ *
|
||||
+ * Avahi poll implementation for the CUPS scheduler.
|
||||
+ *
|
||||
+ * Copyright (C) 2010, 2011 Red Hat, Inc.
|
||||
+ * Authors:
|
||||
+ * Tim Waugh <twaugh@redhat.com>
|
||||
+ *
|
||||
+ * Redistribution and use in source and binary forms, with or without
|
||||
+ * modification, are permitted provided that the following conditions
|
||||
+ * are met:
|
||||
+ *
|
||||
+ * Redistributions of source code must retain the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer.
|
||||
+ *
|
||||
+ * Redistributions in binary form must reproduce the above copyright
|
||||
+ * notice, this list of conditions and the following disclaimer in the
|
||||
+ * documentation and/or other materials provided with the distribution.
|
||||
+ *
|
||||
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
+ */
|
||||
+
|
||||
+#include <config.h>
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+# include <avahi-client/client.h>
|
||||
+# include <avahi-client/publish.h>
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+#ifdef HAVE_AUTHORIZATION_H
|
||||
+# include <Security/Authorization.h>
|
||||
+#endif /* HAVE_AUTHORIZATION_H */
|
||||
+
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+typedef struct
|
||||
+{
|
||||
+ AvahiPoll api;
|
||||
+ cups_array_t *watched_fds;
|
||||
+ cups_array_t *timeouts;
|
||||
+} AvahiCupsPoll;
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+/*
|
||||
+ * Prototypes...
|
||||
+ */
|
||||
+
|
||||
+#ifdef HAVE_AVAHI
|
||||
+extern AvahiCupsPoll * avahi_cups_poll_new(void);
|
||||
+extern void avahi_cups_poll_free(AvahiCupsPoll *cups_poll);
|
||||
+extern const AvahiPoll *avahi_cups_poll_get(AvahiCupsPoll *cups_poll);
|
||||
+#endif /* HAVE_AVAHI */
|
||||
+
|
||||
+
|
||||
+/*
|
||||
+ * End of "$Id$".
|
||||
+ */
|
||||
diff -up cups-1.5.2/scheduler/Makefile.avahi-4-poll cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.avahi-4-poll 2012-03-14 15:06:36.508476980 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-14 15:07:29.476542380 +0000
|
||||
@@ -17,6 +17,7 @@ include ../Makedefs
|
||||
|
||||
CUPSDOBJS = \
|
||||
auth.o \
|
||||
+ avahi.o \
|
||||
banners.o \
|
||||
cert.o \
|
||||
classes.o \
|
File diff suppressed because it is too large
Load Diff
@ -81,7 +81,7 @@ diff -up cups-1.5.0/cups/dest.c.cups-get-classes cups-1.5.0/cups/dest.c
|
||||
+ */
|
||||
+
|
||||
+ if (get_classes)
|
||||
+ num_dests = _cupsGetDests (http, CUPS_GET_CLASSES, name, dests);
|
||||
+ num_dests = _cupsGetDests (http, CUPS_GET_CLASSES, name, dests, 0, 0);
|
||||
+
|
||||
+ /*
|
||||
* Return the count...
|
||||
|
@ -1,38 +1,38 @@
|
||||
diff -up cups-1.5b1/backend/dnssd.c.dnssd-deviceid cups-1.5b1/backend/dnssd.c
|
||||
--- cups-1.5b1/backend/dnssd.c.dnssd-deviceid 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/dnssd.c 2011-05-24 17:28:18.000000000 +0200
|
||||
@@ -817,15 +817,22 @@ query_callback(
|
||||
if (device->device_id)
|
||||
free(device->device_id);
|
||||
diff -up cups-1.6b1/backend/dnssd.c.dnssd-deviceid cups-1.6b1/backend/dnssd.c
|
||||
--- cups-1.6b1/backend/dnssd.c.dnssd-deviceid 2012-05-21 18:05:58.000000000 +0200
|
||||
+++ cups-1.6b1/backend/dnssd.c 2012-05-25 16:27:49.226874427 +0200
|
||||
@@ -1181,15 +1181,22 @@ query_callback(
|
||||
if (device->device_id)
|
||||
free(device->device_id);
|
||||
|
||||
+ if (device_id[0])
|
||||
+ {
|
||||
+ /* Mark this as the real device ID. */
|
||||
+ ptr = device_id + strlen(device_id);
|
||||
+ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;");
|
||||
+ }
|
||||
+ if (device_id[0])
|
||||
+ {
|
||||
+ /* Mark this as the real device ID. */
|
||||
+ ptr = device_id + strlen(device_id);
|
||||
+ snprintf(ptr, sizeof(device_id) - (ptr - device_id), "FZY:0;");
|
||||
+ }
|
||||
+
|
||||
if (!device_id[0] && strcmp(model, "Unknown"))
|
||||
{
|
||||
if (make_and_model[0])
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, model);
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10);
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -835,7 +842,7 @@ query_callback(
|
||||
memcpy(make_and_model, model, ptr - model);
|
||||
make_and_model[ptr - model] = '\0';
|
||||
if (!device_id[0] && strcmp(model, "Unknown"))
|
||||
{
|
||||
if (make_and_model[0])
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, model);
|
||||
else if (!_cups_strncasecmp(model, "designjet ", 10))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s", model + 10);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:HP;MDL:%s;FZY:1;", model + 10);
|
||||
else if (!_cups_strncasecmp(model, "stylus ", 7))
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s", model + 7);
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:EPSON;MDL:%s;FZY:1;", model + 7);
|
||||
else if ((ptr = strchr(model, ' ')) != NULL)
|
||||
{
|
||||
/*
|
||||
@@ -1199,7 +1206,7 @@ query_callback(
|
||||
memcpy(make_and_model, model, ptr - model);
|
||||
make_and_model[ptr - model] = '\0';
|
||||
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, ptr + 1);
|
||||
}
|
||||
}
|
||||
- snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s",
|
||||
+ snprintf(device_id, sizeof(device_id), "MFG:%s;MDL:%s;FZY:1;",
|
||||
make_and_model, ptr + 1);
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
diff -up cups-1.5b1/scheduler/job.c.filter-debug cups-1.5b1/scheduler/job.c
|
||||
--- cups-1.5b1/scheduler/job.c.filter-debug 2011-05-24 15:58:07.000000000 +0200
|
||||
+++ cups-1.5b1/scheduler/job.c 2011-05-24 15:58:07.000000000 +0200
|
||||
@@ -557,10 +557,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
diff -up cups-1.6b1/scheduler/job.c.filter-debug cups-1.6b1/scheduler/job.c
|
||||
--- cups-1.6b1/scheduler/job.c.filter-debug 2012-05-25 16:06:01.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/job.c 2012-05-25 16:07:46.309259511 +0200
|
||||
@@ -625,10 +625,28 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
|
||||
if (!filters)
|
||||
{
|
||||
+ mime_filter_t *current;
|
||||
+
|
||||
cupsdLogJob(job, CUPSD_LOG_ERROR,
|
||||
"Unable to convert file %d to printable format!",
|
||||
"Unable to convert file %d to printable format.",
|
||||
job->current_file);
|
||||
|
||||
+ cupsdLogJob(job, CUPSD_LOG_ERROR,
|
||||
|
@ -1,50 +0,0 @@
|
||||
diff -up cups-1.5b1/cups/usersys.c.getpass cups-1.5b1/cups/usersys.c
|
||||
--- cups-1.5b1/cups/usersys.c.getpass 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/cups/usersys.c 2011-05-24 15:41:33.000000000 +0200
|
||||
@@ -43,6 +43,8 @@
|
||||
#include "cups-private.h"
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
+#include <termios.h>
|
||||
+#include <signal.h>
|
||||
#ifdef WIN32
|
||||
# include <windows.h>
|
||||
#else
|
||||
@@ -501,13 +503,31 @@ _cupsGetPassword(const char *prompt) /*
|
||||
* empty password is treated as canceling the authentication request.
|
||||
*/
|
||||
|
||||
- const char *password = getpass(prompt);
|
||||
- /* Password string */
|
||||
-
|
||||
- if (!password || !password[0])
|
||||
- return (NULL);
|
||||
- else
|
||||
+ static char password[100];
|
||||
+ struct termios oldtio, newtio;
|
||||
+ sigset_t oldset, newset;
|
||||
+ int nread;
|
||||
+ sigprocmask (SIG_BLOCK, NULL, &newset);
|
||||
+ sigaddset (&newset, SIGINT);
|
||||
+ sigaddset (&newset, SIGTSTP);
|
||||
+ sigprocmask (SIG_BLOCK, &newset, &oldset);
|
||||
+ tcgetattr (STDIN_FILENO, &oldtio);
|
||||
+ newtio = oldtio;
|
||||
+ newtio.c_lflag &= ~ECHO;
|
||||
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &newtio);
|
||||
+ fputs (prompt, stdout);
|
||||
+ fflush (stdout);
|
||||
+ nread = read (STDIN_FILENO, password, sizeof (password));
|
||||
+ tcsetattr (STDIN_FILENO, TCSAFLUSH, &oldtio);
|
||||
+ fputc ('\n', stdout);
|
||||
+ sigprocmask (SIG_SETMASK, &oldset, NULL);
|
||||
+ if (nread > 0)
|
||||
+ {
|
||||
+ password[nread - 1] = '\0';
|
||||
return (password);
|
||||
+ }
|
||||
+ else
|
||||
+ return (NULL);
|
||||
#endif /* WIN32 */
|
||||
}
|
||||
|
1042
cups-icc.patch
1042
cups-icc.patch
File diff suppressed because it is too large
Load Diff
293
cups-lspp.patch
293
cups-lspp.patch
@ -1,9 +1,9 @@
|
||||
diff -up cups-1.5.2/config.h.in.lspp cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.lspp 2012-02-15 13:02:38.423776301 +0000
|
||||
+++ cups-1.5.2/config.h.in 2012-02-15 13:02:38.438776307 +0000
|
||||
@@ -754,6 +754,12 @@
|
||||
|
||||
#undef HAVE_XPC
|
||||
diff -up cups-1.6b1/config.h.in.lspp cups-1.6b1/config.h.in
|
||||
--- cups-1.6b1/config.h.in.lspp 2012-05-25 17:01:32.000000000 +0200
|
||||
+++ cups-1.6b1/config.h.in 2012-05-25 17:03:16.889043298 +0200
|
||||
@@ -768,6 +768,13 @@ static __inline int _cups_abs(int i) { r
|
||||
# endif /* __GNUC__ || __STDC_VERSION__ */
|
||||
#endif /* !HAVE_ABS && !abs */
|
||||
|
||||
+/*
|
||||
+ * Are we trying to meet LSPP requirements?
|
||||
@ -11,12 +11,13 @@ diff -up cups-1.5.2/config.h.in.lspp cups-1.5.2/config.h.in
|
||||
+
|
||||
+#undef WITH_LSPP
|
||||
+
|
||||
|
||||
+
|
||||
#endif /* !_CUPS_CONFIG_H_ */
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-lspp.m4.lspp cups-1.5.2/config-scripts/cups-lspp.m4
|
||||
--- cups-1.5.2/config-scripts/cups-lspp.m4.lspp 2012-02-15 13:02:38.438776307 +0000
|
||||
+++ cups-1.5.2/config-scripts/cups-lspp.m4 2012-02-15 13:02:38.438776307 +0000
|
||||
/*
|
||||
diff -up cups-1.6b1/config-scripts/cups-lspp.m4.lspp cups-1.6b1/config-scripts/cups-lspp.m4
|
||||
--- cups-1.6b1/config-scripts/cups-lspp.m4.lspp 2012-05-25 17:01:32.852768495 +0200
|
||||
+++ cups-1.6b1/config-scripts/cups-lspp.m4 2012-05-25 17:01:32.853768488 +0200
|
||||
@@ -0,0 +1,36 @@
|
||||
+dnl
|
||||
+dnl LSPP code for the Common UNIX Printing System (CUPS).
|
||||
@ -54,11 +55,11 @@ diff -up cups-1.5.2/config-scripts/cups-lspp.m4.lspp cups-1.5.2/config-scripts/c
|
||||
+ ;;
|
||||
+ esac
|
||||
+fi
|
||||
diff -up cups-1.5.2/configure.in.lspp cups-1.5.2/configure.in
|
||||
--- cups-1.5.2/configure.in.lspp 2012-02-15 13:02:38.424776301 +0000
|
||||
+++ cups-1.5.2/configure.in 2012-02-15 13:02:38.439776308 +0000
|
||||
@@ -42,6 +42,8 @@ sinclude(config-scripts/cups-defaults.m4
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
diff -up cups-1.6b1/configure.in.lspp cups-1.6b1/configure.in
|
||||
--- cups-1.6b1/configure.in.lspp 2012-05-25 17:01:32.000000000 +0200
|
||||
+++ cups-1.6b1/configure.in 2012-05-25 17:04:03.994714943 +0200
|
||||
@@ -37,6 +37,8 @@ sinclude(config-scripts/cups-systemd.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
|
||||
+sinclude(config-scripts/cups-lspp.m4)
|
||||
@ -66,9 +67,9 @@ diff -up cups-1.5.2/configure.in.lspp cups-1.5.2/configure.in
|
||||
INSTALL_LANGUAGES=""
|
||||
UNINSTALL_LANGUAGES=""
|
||||
LANGFILES=""
|
||||
diff -up cups-1.5.2/filter/common.c.lspp cups-1.5.2/filter/common.c
|
||||
--- cups-1.5.2/filter/common.c.lspp 2011-05-20 04:49:49.000000000 +0100
|
||||
+++ cups-1.5.2/filter/common.c 2012-02-15 13:02:38.441776309 +0000
|
||||
diff -up cups-1.6b1/filter/common.c.lspp cups-1.6b1/filter/common.c
|
||||
--- cups-1.6b1/filter/common.c.lspp 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.6b1/filter/common.c 2012-05-25 17:01:32.854768481 +0200
|
||||
@@ -30,6 +30,12 @@
|
||||
* Include necessary headers...
|
||||
*/
|
||||
@ -237,10 +238,10 @@ diff -up cups-1.5.2/filter/common.c.lspp cups-1.5.2/filter/common.c
|
||||
|
||||
|
||||
/*
|
||||
diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c
|
||||
--- cups-1.5.2/filter/pstops.c.lspp 2011-09-02 19:14:34.000000000 +0100
|
||||
+++ cups-1.5.2/filter/pstops.c 2012-02-15 13:02:38.441776310 +0000
|
||||
@@ -3259,6 +3259,18 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
diff -up cups-1.6b1/filter/pstops.c.lspp cups-1.6b1/filter/pstops.c
|
||||
--- cups-1.6b1/filter/pstops.c.lspp 2012-04-23 21:19:19.000000000 +0200
|
||||
+++ cups-1.6b1/filter/pstops.c 2012-05-25 17:01:32.855768474 +0200
|
||||
@@ -3202,6 +3202,18 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
{
|
||||
const char *classification; /* CLASSIFICATION environment variable */
|
||||
const char *ptr; /* Temporary string pointer */
|
||||
@ -259,7 +260,7 @@ diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c
|
||||
|
||||
|
||||
/*
|
||||
@@ -3281,6 +3293,124 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
@@ -3224,6 +3236,124 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
return;
|
||||
}
|
||||
|
||||
@ -384,7 +385,7 @@ diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c
|
||||
/*
|
||||
* Set the classification + page label string...
|
||||
*/
|
||||
@@ -3359,7 +3489,10 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
@@ -3302,7 +3432,10 @@ write_label_prolog(pstops_doc_t *doc, /*
|
||||
doc_printf(doc, " %.0f moveto ESPpl show\n", top - 14.0);
|
||||
doc_puts(doc, "pop\n");
|
||||
doc_puts(doc, "}bind put\n");
|
||||
@ -395,11 +396,11 @@ diff -up cups-1.5.2/filter/pstops.c.lspp cups-1.5.2/filter/pstops.c
|
||||
|
||||
|
||||
/*
|
||||
diff -up cups-1.5.2/Makedefs.in.lspp cups-1.5.2/Makedefs.in
|
||||
--- cups-1.5.2/Makedefs.in.lspp 2012-02-15 13:02:38.429776302 +0000
|
||||
+++ cups-1.5.2/Makedefs.in 2012-02-15 13:02:38.442776310 +0000
|
||||
@@ -159,7 +159,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f
|
||||
LEGACY_BACKENDS = @LEGACY_BACKENDS@
|
||||
diff -up cups-1.6b1/Makedefs.in.lspp cups-1.6b1/Makedefs.in
|
||||
--- cups-1.6b1/Makedefs.in.lspp 2012-05-25 17:01:32.000000000 +0200
|
||||
+++ cups-1.6b1/Makedefs.in 2012-05-25 17:07:57.325088484 +0200
|
||||
@@ -146,7 +146,7 @@ LDFLAGS = -L../cgi-bin -L../cups -L../f
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
LINKCUPS = @LINKCUPS@ $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LIBZ)
|
||||
LINKCUPSIMAGE = @LINKCUPSIMAGE@
|
||||
-LIBS = $(LINKCUPS) $(COMMONLIBS)
|
||||
@ -407,18 +408,18 @@ diff -up cups-1.5.2/Makedefs.in.lspp cups-1.5.2/Makedefs.in
|
||||
OPTIM = @OPTIM@
|
||||
OPTIONS =
|
||||
PAMLIBS = @PAMLIBS@
|
||||
diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
--- cups-1.5.2/scheduler/client.c.lspp 2012-02-15 13:02:38.394776287 +0000
|
||||
+++ cups-1.5.2/scheduler/client.c 2012-02-15 13:02:38.444776310 +0000
|
||||
@@ -45,6 +45,7 @@
|
||||
* valid_host() - Is the Host: field valid?
|
||||
* write_file() - Send a file via HTTP.
|
||||
* write_pipe() - Flag that data is available on the CGI pipe.
|
||||
+ * client_pid_to_auid() - Get the audit login uid of the client.
|
||||
diff -up cups-1.6b1/scheduler/client.c.lspp cups-1.6b1/scheduler/client.c
|
||||
--- cups-1.6b1/scheduler/client.c.lspp 2012-05-08 00:41:30.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/client.c 2012-05-25 17:13:38.947707163 +0200
|
||||
@@ -41,6 +41,7 @@
|
||||
* valid_host() - Is the Host: field valid?
|
||||
* write_file() - Send a file via HTTP.
|
||||
* write_pipe() - Flag that data is available on the CGI pipe.
|
||||
+ * client_pid_to_auid() - Get the audit login uid of the client.
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -53,10 +54,17 @@
|
||||
@@ -49,10 +50,16 @@
|
||||
|
||||
#include "cupsd.h"
|
||||
|
||||
@ -432,11 +433,10 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
+#include <selinux/context.h>
|
||||
+#include <fcntl.h>
|
||||
+#endif /* WITH_LSPP */
|
||||
+
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -354,6 +362,57 @@ cupsdAcceptClient(cupsd_listener_t *lis)
|
||||
* Local globals...
|
||||
@@ -371,6 +378,57 @@ cupsdAcceptClient(cupsd_listener_t *lis)
|
||||
}
|
||||
#endif /* HAVE_TCPD_H */
|
||||
|
||||
@ -493,8 +493,8 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
+
|
||||
#ifdef AF_LOCAL
|
||||
if (con->http.hostaddr->addr.sa_family == AF_LOCAL)
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "cupsdAcceptClient: %d from %s (Domain)",
|
||||
@@ -714,6 +773,13 @@ cupsdReadClient(cupsd_client_t *con) /*
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG, "[Client %d] Accepted from %s (Domain)",
|
||||
@@ -678,6 +736,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 */
|
||||
@ -508,7 +508,7 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
|
||||
|
||||
status = HTTP_CONTINUE;
|
||||
@@ -2140,6 +2206,67 @@ cupsdReadClient(cupsd_client_t *con) /*
|
||||
@@ -2126,6 +2191,67 @@ cupsdReadClient(cupsd_client_t *con) /*
|
||||
fchmod(con->file, 0640);
|
||||
fchown(con->file, RunUser, Group);
|
||||
fcntl(con->file, F_SETFD, fcntl(con->file, F_GETFD) | FD_CLOEXEC);
|
||||
@ -576,9 +576,9 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
}
|
||||
|
||||
if (con->http.state != HTTP_POST_SEND)
|
||||
@@ -4550,6 +4677,50 @@ make_certificate(cupsd_client_t *con) /*
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
@@ -3581,6 +3707,49 @@ is_path_absolute(const char *path) /* I
|
||||
return (1);
|
||||
}
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+/*
|
||||
@ -623,13 +623,12 @@ diff -up cups-1.5.2/scheduler/client.c.lspp cups-1.5.2/scheduler/client.c
|
||||
+ return uid;
|
||||
+}
|
||||
+#endif /* WITH_LSPP */
|
||||
+
|
||||
|
||||
/*
|
||||
* 'pipe_command()' - Pipe the output of a command to the remote client.
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h
|
||||
--- cups-1.5.2/scheduler/client.h.lspp 2012-02-15 13:02:38.430776303 +0000
|
||||
+++ cups-1.5.2/scheduler/client.h 2012-02-15 13:02:38.446776310 +0000
|
||||
diff -up cups-1.6b1/scheduler/client.h.lspp cups-1.6b1/scheduler/client.h
|
||||
--- cups-1.6b1/scheduler/client.h.lspp 2012-05-25 17:01:32.847768530 +0200
|
||||
+++ cups-1.6b1/scheduler/client.h 2012-05-25 17:14:12.963470050 +0200
|
||||
@@ -18,6 +18,13 @@
|
||||
#endif /* HAVE_AUTHORIZATION_H */
|
||||
|
||||
@ -644,7 +643,7 @@ diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h
|
||||
/*
|
||||
* HTTP client structure...
|
||||
*/
|
||||
@@ -61,6 +68,10 @@ struct cupsd_client_s
|
||||
@@ -63,6 +70,10 @@ struct cupsd_client_s
|
||||
#ifdef HAVE_AUTHORIZATION_H
|
||||
AuthorizationRef authref; /* Authorization ref */
|
||||
#endif /* HAVE_AUTHORIZATION_H */
|
||||
@ -655,7 +654,7 @@ diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h
|
||||
};
|
||||
|
||||
#define HTTP(con) &((con)->http)
|
||||
@@ -133,6 +144,9 @@ extern void cupsdStartListening(void);
|
||||
@@ -135,6 +146,9 @@ extern void cupsdStartListening(void);
|
||||
extern void cupsdStopListening(void);
|
||||
extern void cupsdUpdateCGI(void);
|
||||
extern void cupsdWriteClient(cupsd_client_t *con);
|
||||
@ -663,12 +662,12 @@ diff -up cups-1.5.2/scheduler/client.h.lspp cups-1.5.2/scheduler/client.h
|
||||
+extern uid_t client_pid_to_auid(pid_t clipid);
|
||||
+#endif /* WITH_LSPP */
|
||||
|
||||
|
||||
/*
|
||||
diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
--- cups-1.5.2/scheduler/conf.c.lspp 2012-02-15 13:02:38.397776287 +0000
|
||||
+++ cups-1.5.2/scheduler/conf.c 2012-02-15 13:02:38.448776311 +0000
|
||||
@@ -31,6 +31,7 @@
|
||||
#ifdef HAVE_SSL
|
||||
extern int cupsdEndTLS(cupsd_client_t *con);
|
||||
diff -up cups-1.6b1/scheduler/conf.c.lspp cups-1.6b1/scheduler/conf.c
|
||||
--- cups-1.6b1/scheduler/conf.c.lspp 2012-05-25 17:01:32.778769011 +0200
|
||||
+++ cups-1.6b1/scheduler/conf.c 2012-05-25 17:01:32.860768439 +0200
|
||||
@@ -32,6 +32,7 @@
|
||||
* read_location() - Read a <Location path> definition.
|
||||
* read_policy() - Read a <Policy name> definition.
|
||||
* set_policy_defaults() - Set default policy values as needed.
|
||||
@ -676,7 +675,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -56,6 +57,9 @@
|
||||
@@ -57,6 +58,9 @@
|
||||
# define INADDR_NONE 0xffffffff
|
||||
#endif /* !INADDR_NONE */
|
||||
|
||||
@ -686,7 +685,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
|
||||
/*
|
||||
* Configuration variable structure...
|
||||
@@ -173,6 +177,10 @@ static const cupsd_var_t variables[] =
|
||||
@@ -164,6 +168,10 @@ static const cupsd_var_t variables[] =
|
||||
# if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
|
||||
{ "ServerKey", &ServerKey, CUPSD_VARTYPE_PATHNAME },
|
||||
# endif /* HAVE_LIBSSL || HAVE_GNUTLS */
|
||||
@ -697,7 +696,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
#endif /* HAVE_SSL */
|
||||
{ "ServerName", &ServerName, CUPSD_VARTYPE_STRING },
|
||||
{ "ServerRoot", &ServerRoot, CUPSD_VARTYPE_PATHNAME },
|
||||
@@ -434,6 +442,9 @@ cupsdReadConfiguration(void)
|
||||
@@ -537,6 +545,9 @@ cupsdReadConfiguration(void)
|
||||
const char *tmpdir; /* TMPDIR environment variable */
|
||||
struct stat tmpinfo; /* Temporary directory info */
|
||||
cupsd_policy_t *p; /* Policy */
|
||||
@ -707,7 +706,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
|
||||
|
||||
/*
|
||||
@@ -726,6 +737,25 @@ cupsdReadConfiguration(void)
|
||||
@@ -801,6 +812,25 @@ cupsdReadConfiguration(void)
|
||||
|
||||
RunUser = getuid();
|
||||
|
||||
@ -733,7 +732,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
cupsdLogMessage(CUPSD_LOG_INFO, "Remote access is %s.",
|
||||
RemotePort ? "enabled" : "disabled");
|
||||
|
||||
@@ -1116,7 +1146,19 @@ cupsdReadConfiguration(void)
|
||||
@@ -1185,7 +1215,19 @@ cupsdReadConfiguration(void)
|
||||
cupsdClearString(&Classification);
|
||||
|
||||
if (Classification)
|
||||
@ -753,7 +752,7 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
|
||||
/*
|
||||
* Check the MaxClients setting, and then allocate memory for it...
|
||||
@@ -3781,6 +3823,18 @@ read_location(cups_file_t *fp, /* I - C
|
||||
@@ -3423,6 +3465,18 @@ read_location(cups_file_t *fp, /* I - C
|
||||
return ((FatalErrors & CUPSD_FATAL_CONFIG) ? 0 : linenum);
|
||||
}
|
||||
|
||||
@ -772,35 +771,36 @@ diff -up cups-1.5.2/scheduler/conf.c.lspp cups-1.5.2/scheduler/conf.c
|
||||
|
||||
/*
|
||||
* 'read_policy()' - Read a <Policy name> definition.
|
||||
diff -up cups-1.5.2/scheduler/conf.h.lspp cups-1.5.2/scheduler/conf.h
|
||||
--- cups-1.5.2/scheduler/conf.h.lspp 2012-02-15 13:02:38.320776250 +0000
|
||||
+++ cups-1.5.2/scheduler/conf.h 2012-02-15 13:02:38.450776313 +0000
|
||||
@@ -250,6 +250,12 @@ VAR char *ServerKey VALUE(NULL);
|
||||
VAR int SSLOptions VALUE(CUPSD_SSL_NONE);
|
||||
diff -up cups-1.6b1/scheduler/conf.h.lspp cups-1.6b1/scheduler/conf.h
|
||||
--- cups-1.6b1/scheduler/conf.h.lspp 2012-05-25 17:01:32.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/conf.h 2012-05-25 17:16:20.522580884 +0200
|
||||
@@ -247,6 +247,13 @@ VAR int SSLOptions VALUE(CUPSD_SSL_NO
|
||||
/* SSL/TLS options */
|
||||
#endif /* HAVE_SSL */
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+VAR int AuditLog VALUE(-1),
|
||||
+ /* File descriptor for audit */
|
||||
+ PerPageLabels VALUE(TRUE);
|
||||
+ /* Put the label on each page */
|
||||
+#endif /* WITH_LSPP */
|
||||
|
||||
+
|
||||
#ifdef HAVE_LAUNCHD
|
||||
VAR int LaunchdTimeout VALUE(DEFAULT_KEEPALIVE);
|
||||
@@ -261,6 +267,9 @@ VAR char *SystemGroupAuthKey VALUE(NULL
|
||||
/* System group auth key */
|
||||
#endif /* HAVE_AUTHORIZATION_H */
|
||||
VAR int LaunchdTimeout VALUE(10);
|
||||
/* Time after which an idle cupsd will exit */
|
||||
@@ -265,6 +272,9 @@ int HaveServerCreds VALUE(0);
|
||||
gss_cred_id_t ServerCreds; /* Server's GSS credentials */
|
||||
#endif /* HAVE_GSSAPI */
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+extern int is_lspp_config(void);
|
||||
+extern int is_lspp_config(void);
|
||||
+#endif /* WITH_LSPP */
|
||||
|
||||
/*
|
||||
* Prototypes...
|
||||
diff -up cups-1.5.2/scheduler/cupsd.h.lspp cups-1.5.2/scheduler/cupsd.h
|
||||
--- cups-1.5.2/scheduler/cupsd.h.lspp 2012-02-15 13:02:38.383776281 +0000
|
||||
+++ cups-1.5.2/scheduler/cupsd.h 2012-02-15 13:02:38.450776313 +0000
|
||||
diff -up cups-1.6b1/scheduler/cupsd.h.lspp cups-1.6b1/scheduler/cupsd.h
|
||||
--- cups-1.6b1/scheduler/cupsd.h.lspp 2012-05-21 19:40:22.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/cupsd.h 2012-05-25 17:01:32.861768432 +0200
|
||||
@@ -13,6 +13,8 @@
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
@ -832,10 +832,10 @@ diff -up cups-1.5.2/scheduler/cupsd.h.lspp cups-1.5.2/scheduler/cupsd.h
|
||||
/*
|
||||
* Some OS's don't have hstrerror(), most notably Solaris...
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
--- cups-1.5.2/scheduler/ipp.c.lspp 2012-02-15 13:02:38.417776295 +0000
|
||||
+++ cups-1.5.2/scheduler/ipp.c 2012-02-15 13:02:38.454776315 +0000
|
||||
@@ -41,6 +41,7 @@
|
||||
diff -up cups-1.6b1/scheduler/ipp.c.lspp cups-1.6b1/scheduler/ipp.c
|
||||
--- cups-1.6b1/scheduler/ipp.c.lspp 2012-05-25 17:01:32.810768787 +0200
|
||||
+++ cups-1.6b1/scheduler/ipp.c 2012-05-25 17:18:06.620841313 +0200
|
||||
@@ -35,6 +35,7 @@
|
||||
* cancel_all_jobs() - Cancel all or selected print jobs.
|
||||
* cancel_job() - Cancel a print job.
|
||||
* cancel_subscription() - Cancel a subscription.
|
||||
@ -843,7 +843,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
* check_rss_recipient() - Check that we do not have a duplicate RSS
|
||||
* feed URI.
|
||||
* check_quotas() - Check quotas for a printer and user.
|
||||
@@ -106,6 +107,9 @@
|
||||
@@ -99,6 +100,9 @@
|
||||
* validate_user() - Validate the user for the request.
|
||||
*/
|
||||
|
||||
@ -853,7 +853,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
@@ -131,6 +135,14 @@ extern int mbr_check_membership_by_id(uu
|
||||
@@ -122,6 +126,14 @@ extern int mbr_check_membership_by_id(uu
|
||||
# endif /* HAVE_MEMBERSHIPPRIV_H */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
@ -868,7 +868,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -168,6 +180,9 @@ static void cancel_all_jobs(cupsd_client
|
||||
@@ -146,6 +158,9 @@ static void cancel_all_jobs(cupsd_client
|
||||
static void cancel_job(cupsd_client_t *con, ipp_attribute_t *uri);
|
||||
static void cancel_subscription(cupsd_client_t *con, int id);
|
||||
static int check_rss_recipient(const char *recipient);
|
||||
@ -876,9 +876,9 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
+static int check_context(cupsd_client_t *con, cupsd_job_t *job);
|
||||
+#endif /* WITH_LSPP */
|
||||
static int check_quotas(cupsd_client_t *con, cupsd_printer_t *p);
|
||||
static ipp_attribute_t *copy_attribute(ipp_t *to, ipp_attribute_t *attr,
|
||||
int quickcopy);
|
||||
@@ -1365,6 +1380,21 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
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,
|
||||
@@ -1285,6 +1300,21 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
ipp_attribute_t *media_col, /* media-col attribute */
|
||||
*media_margin; /* media-*-margin attribute */
|
||||
ipp_t *unsup_col; /* media-col in unsupported response */
|
||||
@ -900,7 +900,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "add_job(%p[%d], %p(%s), %p(%s/%s))",
|
||||
@@ -1622,6 +1652,106 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1542,6 +1572,106 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
ippAddString(con->request, IPP_TAG_JOB, IPP_TAG_NAME, "job-name", NULL,
|
||||
"Untitled");
|
||||
|
||||
@ -1007,7 +1007,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
if ((job = cupsdAddJob(priority, printer->name)) == NULL)
|
||||
{
|
||||
send_ipp_status(con, IPP_INTERNAL_ERROR,
|
||||
@@ -1630,6 +1760,32 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1550,6 +1680,32 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@ -1037,10 +1037,10 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
+ }
|
||||
+#endif /* WITH_LSPP */
|
||||
+
|
||||
job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_IMPLICIT |
|
||||
CUPS_PRINTER_REMOTE);
|
||||
job->dtype = printer->type & (CUPS_PRINTER_CLASS | CUPS_PRINTER_REMOTE);
|
||||
job->attrs = con->request;
|
||||
@@ -1835,6 +1991,29 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
job->dirty = 1;
|
||||
@@ -1759,6 +1915,29 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
attr->values[0].string.text = _cupsStrRetain(printer->job_sheets[0]);
|
||||
attr->values[1].string.text = _cupsStrRetain(printer->job_sheets[1]);
|
||||
}
|
||||
@ -1070,7 +1070,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
job->job_sheets = attr;
|
||||
|
||||
@@ -1865,6 +2044,9 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1789,6 +1968,9 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
"job-sheets=\"%s,none\", "
|
||||
"job-originating-user-name=\"%s\"",
|
||||
Classification, job->username);
|
||||
@ -1080,7 +1080,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
}
|
||||
else if (attr->num_values == 2 &&
|
||||
strcmp(attr->values[0].string.text,
|
||||
@@ -1883,6 +2065,9 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1807,6 +1989,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);
|
||||
@ -1090,7 +1090,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
}
|
||||
else if (strcmp(attr->values[0].string.text, Classification) &&
|
||||
strcmp(attr->values[0].string.text, "none") &&
|
||||
@@ -1903,6 +2088,9 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1827,6 +2012,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);
|
||||
@ -1100,7 +1100,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
}
|
||||
}
|
||||
else if (strcmp(attr->values[0].string.text, Classification) &&
|
||||
@@ -1943,8 +2131,52 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
@@ -1867,8 +2055,52 @@ add_job(cupsd_client_t *con, /* I - Cl
|
||||
"job-sheets=\"%s\", "
|
||||
"job-originating-user-name=\"%s\"",
|
||||
Classification, job->username);
|
||||
@ -1153,7 +1153,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
/*
|
||||
* See if we need to add the starting sheet...
|
||||
@@ -4709,6 +4941,111 @@ check_rss_recipient(
|
||||
@@ -3615,6 +3847,111 @@ check_rss_recipient(
|
||||
}
|
||||
|
||||
|
||||
@ -1265,7 +1265,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
/*
|
||||
* 'check_quotas()' - Check quotas for a printer and user.
|
||||
*/
|
||||
@@ -5349,6 +5686,15 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
@@ -4067,6 +4404,15 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
char attrname[255], /* Name of attribute */
|
||||
*s; /* Pointer into name */
|
||||
ipp_attribute_t *attr; /* Attribute */
|
||||
@ -1281,7 +1281,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
@@ -5384,6 +5730,82 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
@@ -4102,6 +4448,82 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
|
||||
fchmod(cupsFileNumber(out), 0640);
|
||||
fchown(cupsFileNumber(out), RunUser, Group);
|
||||
@ -1364,7 +1364,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
|
||||
/*
|
||||
* Try the localized banner file under the subdirectory...
|
||||
@@ -5478,6 +5900,24 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
@@ -4196,6 +4618,24 @@ copy_banner(cupsd_client_t *con, /* I -
|
||||
else
|
||||
s = attrname;
|
||||
|
||||
@ -1389,7 +1389,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
if (!strcmp(s, "printer-name"))
|
||||
{
|
||||
cupsFilePuts(out, job->dest);
|
||||
@@ -7475,6 +7915,22 @@ get_job_attrs(cupsd_client_t *con, /* I
|
||||
@@ -6273,6 +6713,22 @@ get_job_attrs(cupsd_client_t *con, /* I
|
||||
|
||||
exclude = cupsdGetPrivateAttrs(policy, con, printer, job->username);
|
||||
|
||||
@ -1412,7 +1412,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
/*
|
||||
* Copy attributes...
|
||||
*/
|
||||
@@ -7828,6 +8284,11 @@ get_jobs(cupsd_client_t *con, /* I - C
|
||||
@@ -6626,6 +7082,11 @@ get_jobs(cupsd_client_t *con, /* I - C
|
||||
if (username[0] && _cups_strcasecmp(username, job->username))
|
||||
continue;
|
||||
|
||||
@ -1424,7 +1424,7 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
if (count > 0)
|
||||
ippAddSeparator(con->response);
|
||||
|
||||
@@ -12287,6 +12748,11 @@ validate_user(cupsd_job_t *job, /* I
|
||||
@@ -11106,6 +11567,11 @@ validate_user(cupsd_job_t *job, /* I
|
||||
|
||||
strlcpy(username, get_username(con), userlen);
|
||||
|
||||
@ -1436,11 +1436,11 @@ diff -up cups-1.5.2/scheduler/ipp.c.lspp cups-1.5.2/scheduler/ipp.c
|
||||
/*
|
||||
* Check the username against the owner...
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
--- cups-1.5.2/scheduler/job.c.lspp 2012-02-15 13:02:38.362776272 +0000
|
||||
+++ cups-1.5.2/scheduler/job.c 2012-02-15 13:02:38.457776315 +0000
|
||||
@@ -64,6 +64,9 @@
|
||||
* update_job_attrs() - Update the job-printer-* attributes.
|
||||
diff -up cups-1.6b1/scheduler/job.c.lspp cups-1.6b1/scheduler/job.c
|
||||
--- cups-1.6b1/scheduler/job.c.lspp 2012-05-25 17:01:32.824768691 +0200
|
||||
+++ cups-1.6b1/scheduler/job.c 2012-05-25 17:22:50.856860012 +0200
|
||||
@@ -68,6 +68,9 @@
|
||||
* update_job_attrs() - Update the job-printer-* attributes.
|
||||
*/
|
||||
|
||||
+/* Copyright (C) 2005 Trusted Computer Solutions, Inc. */
|
||||
@ -1449,7 +1449,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
@@ -79,6 +82,14 @@
|
||||
@@ -83,6 +86,14 @@
|
||||
# endif /* HAVE_IOKIT_PWR_MGT_IOPMLIBPRIVATE_H */
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
@ -1464,7 +1464,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
|
||||
/*
|
||||
* Design Notes for Job Management
|
||||
@@ -519,6 +530,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
@@ -580,6 +591,14 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
/* PRINTER_STATE_REASONS env var */
|
||||
rip_max_cache[255];
|
||||
/* RIP_MAX_CACHE env variable */
|
||||
@ -1479,7 +1479,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2,
|
||||
@@ -1007,6 +1026,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
@@ -1071,6 +1090,67 @@ cupsdContinueJob(cupsd_job_t *job) /* I
|
||||
}
|
||||
}
|
||||
|
||||
@ -1547,8 +1547,8 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
if (Classification && !banner_page)
|
||||
{
|
||||
if ((attr = ippFindAttribute(job->attrs, "job-sheets",
|
||||
@@ -1728,6 +1808,20 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J
|
||||
goto error;
|
||||
@@ -1845,6 +1925,20 @@ cupsdLoadJob(cupsd_job_t *job) /* I - J
|
||||
ippSetString(job->attrs, &job->reasons, 0, "none");
|
||||
}
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
@ -1568,9 +1568,9 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
job->sheets = ippFindAttribute(job->attrs, "job-media-sheets-completed",
|
||||
IPP_TAG_INTEGER);
|
||||
job->job_sheets = ippFindAttribute(job->attrs, "job-sheets", IPP_TAG_NAME);
|
||||
@@ -2116,6 +2210,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
|
||||
char filename[1024], /* Job control filename */
|
||||
newfile[1024]; /* New job control filename */
|
||||
@@ -2235,6 +2329,14 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
|
||||
{
|
||||
char filename[1024]; /* Job control filename */
|
||||
cups_file_t *fp; /* Job file */
|
||||
+#ifdef WITH_LSPP
|
||||
+ security_context_t spoolcon; /* context of the job control file */
|
||||
@ -1583,8 +1583,8 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
|
||||
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdSaveJob(job=%p(%d)): job->attrs=%p",
|
||||
@@ -2135,6 +2237,76 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
|
||||
fchmod(cupsFileNumber(fp), 0600);
|
||||
@@ -2247,6 +2349,76 @@ cupsdSaveJob(cupsd_job_t *job) /* I - J
|
||||
|
||||
fchown(cupsFileNumber(fp), RunUser, Group);
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
@ -1660,7 +1660,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
job->attrs->state = IPP_IDLE;
|
||||
|
||||
if (ippWriteIO(fp, (ipp_iocb_t)cupsFileWrite, 1, NULL,
|
||||
@@ -3525,6 +3697,18 @@ get_options(cupsd_job_t *job, /* I - Jo
|
||||
@@ -3735,6 +3907,18 @@ get_options(cupsd_job_t *job, /* I - Jo
|
||||
banner_page)
|
||||
continue;
|
||||
|
||||
@ -1679,7 +1679,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
/*
|
||||
* Otherwise add them to the list...
|
||||
*/
|
||||
@@ -4159,6 +4343,19 @@ static void
|
||||
@@ -4457,6 +4641,19 @@ static void
|
||||
start_job(cupsd_job_t *job, /* I - Job ID */
|
||||
cupsd_printer_t *printer) /* I - Printer to print job */
|
||||
{
|
||||
@ -1699,7 +1699,7 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
cupsdLogMessage(CUPSD_LOG_DEBUG2, "start_job(job=%p(%d), printer=%p(%s))",
|
||||
job, job->id, printer, printer->name);
|
||||
|
||||
@@ -4288,6 +4485,108 @@ start_job(cupsd_job_t *job, /* I -
|
||||
@@ -4599,6 +4796,108 @@ start_job(cupsd_job_t *job, /* I -
|
||||
fcntl(job->side_pipes[1], F_SETFD,
|
||||
fcntl(job->side_pipes[1], F_GETFD) | FD_CLOEXEC);
|
||||
|
||||
@ -1808,9 +1808,9 @@ diff -up cups-1.5.2/scheduler/job.c.lspp cups-1.5.2/scheduler/job.c
|
||||
/*
|
||||
* Now start the first file in the job...
|
||||
*/
|
||||
diff -up cups-1.5.2/scheduler/job.h.lspp cups-1.5.2/scheduler/job.h
|
||||
--- cups-1.5.2/scheduler/job.h.lspp 2011-05-18 03:27:11.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/job.h 2012-02-15 13:02:38.459776316 +0000
|
||||
diff -up cups-1.6b1/scheduler/job.h.lspp cups-1.6b1/scheduler/job.h
|
||||
--- cups-1.6b1/scheduler/job.h.lspp 2012-05-23 03:36:50.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/job.h 2012-05-25 17:23:41.802504888 +0200
|
||||
@@ -13,6 +13,13 @@
|
||||
* file is missing or damaged, see the license at "http://www.cups.org/".
|
||||
*/
|
||||
@ -1825,10 +1825,10 @@ diff -up cups-1.5.2/scheduler/job.h.lspp cups-1.5.2/scheduler/job.h
|
||||
/*
|
||||
* Constants...
|
||||
*/
|
||||
@@ -76,6 +83,10 @@ struct cupsd_job_s /**** Job request *
|
||||
void *profile; /* Security profile */
|
||||
cups_array_t *history; /* Debug log history */
|
||||
@@ -82,6 +89,10 @@ struct cupsd_job_s /**** Job request *
|
||||
int progress; /* Printing progress */
|
||||
int num_keywords; /* Number of PPD keywords */
|
||||
cups_option_t *keywords; /* PPD keywords */
|
||||
+#ifdef WITH_LSPP
|
||||
+ security_context_t scon; /* Security context of job */
|
||||
+ uid_t auid; /* Audit loginuid for this job */
|
||||
@ -1836,9 +1836,9 @@ diff -up cups-1.5.2/scheduler/job.h.lspp cups-1.5.2/scheduler/job.h
|
||||
};
|
||||
|
||||
typedef struct cupsd_joblog_s /**** Job log message ****/
|
||||
diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.lspp 2012-02-15 13:02:38.436776304 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-02-15 13:02:38.461776318 +0000
|
||||
diff -up cups-1.6b1/scheduler/main.c.lspp cups-1.6b1/scheduler/main.c
|
||||
--- cups-1.6b1/scheduler/main.c.lspp 2012-05-25 17:01:32.849768516 +0200
|
||||
+++ cups-1.6b1/scheduler/main.c 2012-05-25 17:01:32.868768383 +0200
|
||||
@@ -38,6 +38,8 @@
|
||||
* usage() - Show scheduler usage.
|
||||
*/
|
||||
@ -1858,7 +1858,7 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -143,6 +148,9 @@ main(int argc, /* I - Number of comm
|
||||
@@ -138,6 +143,9 @@ main(int argc, /* I - Number of comm
|
||||
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
|
||||
struct sigaction action; /* Actions for POSIX signals */
|
||||
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
|
||||
@ -1868,7 +1868,7 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c
|
||||
#ifdef __sgi
|
||||
cups_file_t *fp; /* Fake lpsched lock file */
|
||||
struct stat statbuf; /* Needed for checking lpsched FIFO */
|
||||
@@ -472,6 +480,25 @@ main(int argc, /* I - Number of comm
|
||||
@@ -463,6 +471,25 @@ main(int argc, /* I - Number of comm
|
||||
#endif /* DEBUG */
|
||||
}
|
||||
|
||||
@ -1894,7 +1894,7 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c
|
||||
/*
|
||||
* Set the timezone info...
|
||||
*/
|
||||
@@ -1246,6 +1273,11 @@ main(int argc, /* I - Number of comm
|
||||
@@ -1180,6 +1207,11 @@ main(int argc, /* I - Number of comm
|
||||
|
||||
cupsdStopSelect();
|
||||
|
||||
@ -1906,9 +1906,9 @@ diff -up cups-1.5.2/scheduler/main.c.lspp cups-1.5.2/scheduler/main.c
|
||||
return (!stop_scheduler);
|
||||
}
|
||||
|
||||
diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c
|
||||
--- cups-1.5.2/scheduler/printers.c.lspp 2012-02-15 13:02:38.420776300 +0000
|
||||
+++ cups-1.5.2/scheduler/printers.c 2012-02-15 13:02:38.463776320 +0000
|
||||
diff -up cups-1.6b1/scheduler/printers.c.lspp cups-1.6b1/scheduler/printers.c
|
||||
--- cups-1.6b1/scheduler/printers.c.lspp 2012-05-25 17:01:32.786768955 +0200
|
||||
+++ cups-1.6b1/scheduler/printers.c 2012-05-25 17:24:11.144300359 +0200
|
||||
@@ -56,6 +56,8 @@
|
||||
* write_xml_string() - Write a string with XML escaping.
|
||||
*/
|
||||
@ -1918,19 +1918,18 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c
|
||||
/*
|
||||
* Include necessary headers...
|
||||
*/
|
||||
@@ -84,6 +86,11 @@
|
||||
# include "colord.h"
|
||||
#endif /* HAVE_DBUS */
|
||||
@@ -80,6 +82,10 @@
|
||||
# include <asl.h>
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
+#ifdef WITH_LSPP
|
||||
+# include <libaudit.h>
|
||||
+# include <selinux/context.h>
|
||||
+#endif /* WITH_LSPP */
|
||||
+
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
*/
|
||||
@@ -2199,6 +2206,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
|
||||
@@ -2101,6 +2107,13 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
|
||||
"username",
|
||||
"password"
|
||||
};
|
||||
@ -1944,7 +1943,7 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c
|
||||
|
||||
|
||||
DEBUG_printf(("cupsdSetPrinterAttrs: entering name = %s, type = %x\n", p->name,
|
||||
@@ -2336,6 +2350,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
|
||||
@@ -2234,6 +2247,45 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)
|
||||
attr->values[1].string.text = _cupsStrAlloc(Classification ?
|
||||
Classification : p->job_sheets[1]);
|
||||
}
|
||||
@ -1990,7 +1989,7 @@ diff -up cups-1.5.2/scheduler/printers.c.lspp cups-1.5.2/scheduler/printers.c
|
||||
}
|
||||
|
||||
p->raw = 0;
|
||||
@@ -5546,7 +5599,6 @@ write_irix_state(cupsd_printer_t *p) /*
|
||||
@@ -5320,7 +5372,6 @@ write_irix_state(cupsd_printer_t *p) /*
|
||||
}
|
||||
#endif /* __sgi */
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
diff -up cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.5b1/config-scripts/cups-manpages.m4
|
||||
--- cups-1.5b1/config-scripts/cups-manpages.m4.no-gzip-man 2011-05-12 07:21:56.000000000 +0200
|
||||
+++ cups-1.5b1/config-scripts/cups-manpages.m4 2011-05-23 17:25:50.000000000 +0200
|
||||
diff -up cups-1.6b1/config-scripts/cups-manpages.m4.no-gzip-man cups-1.6b1/config-scripts/cups-manpages.m4
|
||||
--- cups-1.6b1/config-scripts/cups-manpages.m4.no-gzip-man 2012-04-23 19:26:57.000000000 +0200
|
||||
+++ cups-1.6b1/config-scripts/cups-manpages.m4 2012-05-25 14:57:01.959845267 +0200
|
||||
@@ -69,10 +69,10 @@ case "$uname" in
|
||||
;;
|
||||
Linux* | GNU* | Darwin*)
|
||||
# Linux, GNU Hurd, and Mac OS X
|
||||
# Linux, GNU Hurd, and OS X
|
||||
- MAN1EXT=1.gz
|
||||
- MAN5EXT=5.gz
|
||||
- MAN7EXT=7.gz
|
||||
|
@ -1,7 +1,7 @@
|
||||
diff -up cups-1.5b1/cups/http-addr.c.res_init cups-1.5b1/cups/http-addr.c
|
||||
--- cups-1.5b1/cups/http-addr.c.res_init 2011-04-16 01:38:13.000000000 +0200
|
||||
+++ cups-1.5b1/cups/http-addr.c 2011-05-24 15:56:50.000000000 +0200
|
||||
@@ -256,7 +256,8 @@ httpAddrLookup(
|
||||
diff -up cups-1.6b1/cups/http-addr.c.res_init cups-1.6b1/cups/http-addr.c
|
||||
--- cups-1.6b1/cups/http-addr.c.res_init 2012-05-17 00:57:03.000000000 +0200
|
||||
+++ cups-1.6b1/cups/http-addr.c 2012-05-25 15:51:51.323916352 +0200
|
||||
@@ -254,7 +254,8 @@ httpAddrLookup(
|
||||
|
||||
if (error)
|
||||
{
|
||||
@ -11,16 +11,16 @@ diff -up cups-1.5b1/cups/http-addr.c.res_init cups-1.5b1/cups/http-addr.c
|
||||
cg->need_res_init = 1;
|
||||
|
||||
return (httpAddrString(addr, name, namelen));
|
||||
diff -up cups-1.5b1/cups/http-addrlist.c.res_init cups-1.5b1/cups/http-addrlist.c
|
||||
--- cups-1.5b1/cups/http-addrlist.c.res_init 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/cups/http-addrlist.c 2011-05-24 15:56:50.000000000 +0200
|
||||
@@ -386,7 +386,8 @@ httpAddrGetList(const char *hostname, /*
|
||||
|
||||
freeaddrinfo(results);
|
||||
diff -up cups-1.6b1/cups/http-addrlist.c.res_init cups-1.6b1/cups/http-addrlist.c
|
||||
--- cups-1.6b1/cups/http-addrlist.c.res_init 2012-04-23 19:26:57.000000000 +0200
|
||||
+++ cups-1.6b1/cups/http-addrlist.c 2012-05-25 16:05:05.930377452 +0200
|
||||
@@ -540,7 +540,8 @@ httpAddrGetList(const char *hostname, /*
|
||||
}
|
||||
- else if (error == EAI_FAIL)
|
||||
+ else if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA ||
|
||||
+ error == EAI_NONAME)
|
||||
cg->need_res_init = 1;
|
||||
else
|
||||
{
|
||||
- if (error == EAI_FAIL)
|
||||
+ if (error == EAI_FAIL || error == EAI_AGAIN || error == EAI_NODATA ||
|
||||
+ error == EAI_NONAME)
|
||||
cg->need_res_init = 1;
|
||||
|
||||
#else
|
||||
_cupsSetError(IPP_INTERNAL_ERROR, gai_strerror(error), 0);
|
||||
|
@ -1,11 +0,0 @@
|
||||
diff -up cups-1.5b1/backend/serial.c.serial cups-1.5b1/backend/serial.c
|
||||
--- cups-1.5b1/backend/serial.c.serial 2011-05-20 05:49:49.000000000 +0200
|
||||
+++ cups-1.5b1/backend/serial.c 2011-05-23 17:34:33.000000000 +0200
|
||||
@@ -75,6 +75,7 @@
|
||||
#endif /* __APPLE__ */
|
||||
|
||||
#if defined(__linux) && defined(TIOCGSERIAL)
|
||||
+# include <linux/types.h>
|
||||
# include <linux/serial.h>
|
||||
# include <linux/ioctl.h>
|
||||
#endif /* __linux && TIOCGSERIAL */
|
@ -1,115 +0,0 @@
|
||||
diff -up cups-1.5.2/backend/snmp-supplies.c.snmp-quirks cups-1.5.2/backend/snmp-supplies.c
|
||||
--- cups-1.5.2/backend/snmp-supplies.c.snmp-quirks 2011-10-07 23:41:07.000000000 +0200
|
||||
+++ cups-1.5.2/backend/snmp-supplies.c 2012-02-06 10:48:47.543906526 +0100
|
||||
@@ -47,6 +47,13 @@
|
||||
|
||||
|
||||
/*
|
||||
+ * Printer quirks...
|
||||
+ */
|
||||
+
|
||||
+#define QUIRK_CAPACITY (1<<0)
|
||||
+
|
||||
+
|
||||
+/*
|
||||
* Local structures...
|
||||
*/
|
||||
|
||||
@@ -66,6 +73,12 @@ typedef struct /**** Printer state ta
|
||||
const char *keyword; /* IPP printer-state-reasons keyword */
|
||||
} backend_state_t;
|
||||
|
||||
+typedef struct /**** Quirk names table ****/
|
||||
+{
|
||||
+ int bit; /* Quirk bit */
|
||||
+ const char *keyword; /* cupsSNMPQuirks keyword */
|
||||
+} quirk_name_t;
|
||||
+
|
||||
|
||||
/*
|
||||
* Local globals...
|
||||
@@ -77,6 +90,7 @@ static int current_state = -1;
|
||||
static int charset = -1; /* Character set for supply names */
|
||||
static int num_supplies = 0;
|
||||
/* Number of supplies found */
|
||||
+static int quirks = 0; /* Printer quirks */
|
||||
static backend_supplies_t supplies[CUPS_MAX_SUPPLIES];
|
||||
/* Supply information */
|
||||
static int supply_state = -1;
|
||||
@@ -176,6 +190,15 @@ static const backend_state_t const suppl
|
||||
{ CUPS_TONER_EMPTY, "toner-empty-warning" }
|
||||
};
|
||||
|
||||
+static const quirk_name_t const quirk_names[] =
|
||||
+ {
|
||||
+ /*
|
||||
+ * The prtMarkerSuppliesLevel values are
|
||||
+ * percentages, not levels relative to the
|
||||
+ * stated capacity.
|
||||
+ */
|
||||
+ { QUIRK_CAPACITY, "capacity" }
|
||||
+ };
|
||||
|
||||
/*
|
||||
* Local functions...
|
||||
@@ -229,6 +252,9 @@ backendSNMPSupplies(
|
||||
|
||||
for (i = 0, ptr = value; i < num_supplies; i ++, ptr += strlen(ptr))
|
||||
{
|
||||
+ if (quirks & QUIRK_CAPACITY)
|
||||
+ supplies[i].max_capacity = 100;
|
||||
+
|
||||
if (supplies[i].max_capacity > 0 && supplies[i].level >= 0)
|
||||
percent = 100 * supplies[i].level / supplies[i].max_capacity;
|
||||
else
|
||||
@@ -401,6 +427,7 @@ backend_init_supplies(
|
||||
http_addr_t *addr) /* I - Printer address */
|
||||
{
|
||||
int i, /* Looping var */
|
||||
+ len, /* Quirk name length */
|
||||
type; /* Current marker type */
|
||||
cups_file_t *cachefile; /* Cache file */
|
||||
const char *cachedir; /* CUPS_CACHEDIR value */
|
||||
@@ -462,6 +489,7 @@ backend_init_supplies(
|
||||
current_state = -1;
|
||||
num_supplies = -1;
|
||||
charset = -1;
|
||||
+ quirks = 0;
|
||||
|
||||
memset(supplies, 0, sizeof(supplies));
|
||||
|
||||
@@ -477,6 +505,34 @@ backend_init_supplies(
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (ppd &&
|
||||
+ (ppdattr = ppdFindAttr(ppd, "cupsSNMPQuirks", NULL)) != NULL &&
|
||||
+ ppdattr->value)
|
||||
+ {
|
||||
+ ptr = ppdattr->value;
|
||||
+ while (*ptr != '\0')
|
||||
+ {
|
||||
+ /*
|
||||
+ * Match keyword against quirk_names table.
|
||||
+ */
|
||||
+
|
||||
+ for (i = 0; i < sizeof (quirk_names) / sizeof (quirk_names[0]); i++)
|
||||
+ {
|
||||
+ len = strlen (quirk_names[i].keyword);
|
||||
+ if (!strncmp (ptr, quirk_names[i].keyword, len) &&
|
||||
+ (ptr[len] == '\0' || ptr[len] == ' '))
|
||||
+ quirks |= quirk_names[i].bit;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Advance to next keyword.
|
||||
+ */
|
||||
+
|
||||
+ ptr += strcspn (ptr, " ");
|
||||
+ ptr += strspn (ptr, " ");
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
ppdClose(ppd);
|
||||
|
||||
/*
|
@ -1,7 +1,7 @@
|
||||
diff -up cups-1.5.2/config.h.in.systemd-socket cups-1.5.2/config.h.in
|
||||
--- cups-1.5.2/config.h.in.systemd-socket 2012-03-16 14:50:57.089449755 +0000
|
||||
+++ cups-1.5.2/config.h.in 2012-03-16 14:50:57.146449787 +0000
|
||||
@@ -503,6 +503,13 @@
|
||||
diff -up cups-1.6b1/config.h.in.systemd-socket cups-1.6b1/config.h.in
|
||||
--- cups-1.6b1/config.h.in.systemd-socket 2012-05-17 00:57:03.000000000 +0200
|
||||
+++ cups-1.6b1/config.h.in 2012-05-28 11:16:35.657250584 +0200
|
||||
@@ -506,6 +506,13 @@
|
||||
|
||||
|
||||
/*
|
||||
@ -15,9 +15,9 @@ diff -up cups-1.5.2/config.h.in.systemd-socket cups-1.5.2/config.h.in
|
||||
* Various scripting languages...
|
||||
*/
|
||||
|
||||
diff -up cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.2/config-scripts/cups-systemd.m4
|
||||
--- cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket 2012-03-16 14:50:57.146449787 +0000
|
||||
+++ cups-1.5.2/config-scripts/cups-systemd.m4 2012-03-16 14:50:57.146449787 +0000
|
||||
diff -up cups-1.6b1/config-scripts/cups-systemd.m4.systemd-socket cups-1.6b1/config-scripts/cups-systemd.m4
|
||||
--- cups-1.6b1/config-scripts/cups-systemd.m4.systemd-socket 2012-05-28 11:16:35.658250577 +0200
|
||||
+++ cups-1.6b1/config-scripts/cups-systemd.m4 2012-05-28 11:16:35.658250577 +0200
|
||||
@@ -0,0 +1,36 @@
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
@ -55,18 +55,18 @@ diff -up cups-1.5.2/config-scripts/cups-systemd.m4.systemd-socket cups-1.5.2/con
|
||||
+dnl
|
||||
+dnl "$Id$"
|
||||
+dnl
|
||||
diff -up cups-1.5.2/configure.in.systemd-socket cups-1.5.2/configure.in
|
||||
--- cups-1.5.2/configure.in.systemd-socket 2011-08-31 02:36:33.000000000 +0100
|
||||
+++ cups-1.5.2/configure.in 2012-03-16 14:50:57.146449787 +0000
|
||||
@@ -37,6 +37,7 @@ sinclude(config-scripts/cups-pam.m4)
|
||||
diff -up cups-1.6b1/configure.in.systemd-socket cups-1.6b1/configure.in
|
||||
--- cups-1.6b1/configure.in.systemd-socket 2012-04-23 19:26:57.000000000 +0200
|
||||
+++ cups-1.6b1/configure.in 2012-05-28 11:16:35.658250577 +0200
|
||||
@@ -33,6 +33,7 @@ sinclude(config-scripts/cups-pam.m4)
|
||||
sinclude(config-scripts/cups-largefile.m4)
|
||||
sinclude(config-scripts/cups-dnssd.m4)
|
||||
sinclude(config-scripts/cups-launchd.m4)
|
||||
+sinclude(config-scripts/cups-systemd.m4)
|
||||
sinclude(config-scripts/cups-defaults.m4)
|
||||
sinclude(config-scripts/cups-pdf.m4)
|
||||
sinclude(config-scripts/cups-scripting.m4)
|
||||
@@ -71,6 +72,9 @@ AC_OUTPUT(Makedefs
|
||||
|
||||
@@ -66,6 +67,9 @@ AC_OUTPUT(Makedefs
|
||||
conf/snmp.conf
|
||||
cups-config
|
||||
data/testprint
|
||||
@ -76,10 +76,10 @@ diff -up cups-1.5.2/configure.in.systemd-socket cups-1.5.2/configure.in
|
||||
desktop/cups.desktop
|
||||
doc/help/ref-cupsd-conf.html
|
||||
doc/help/standard.html
|
||||
diff -up cups-1.5.2/cups/usersys.c.systemd-socket cups-1.5.2/cups/usersys.c
|
||||
--- cups-1.5.2/cups/usersys.c.systemd-socket 2012-03-16 14:50:57.054449734 +0000
|
||||
+++ cups-1.5.2/cups/usersys.c 2012-03-16 14:50:57.148449788 +0000
|
||||
@@ -778,7 +778,7 @@ cups_read_client_conf(
|
||||
diff -up cups-1.6b1/cups/usersys.c.systemd-socket cups-1.6b1/cups/usersys.c
|
||||
--- cups-1.6b1/cups/usersys.c.systemd-socket 2012-04-23 19:26:57.000000000 +0200
|
||||
+++ cups-1.6b1/cups/usersys.c 2012-05-28 11:16:35.659250570 +0200
|
||||
@@ -975,7 +975,7 @@ cups_read_client_conf(
|
||||
struct stat sockinfo; /* Domain socket information */
|
||||
|
||||
if (!stat(CUPS_DEFAULT_DOMAINSOCKET, &sockinfo) &&
|
||||
@ -88,9 +88,9 @@ diff -up cups-1.5.2/cups/usersys.c.systemd-socket cups-1.5.2/cups/usersys.c
|
||||
cups_server = CUPS_DEFAULT_DOMAINSOCKET;
|
||||
else
|
||||
#endif /* CUPS_DEFAULT_DOMAINSOCKET */
|
||||
diff -up cups-1.5.2/data/cups.path.in.systemd-socket cups-1.5.2/data/cups.path.in
|
||||
--- cups-1.5.2/data/cups.path.in.systemd-socket 2012-03-16 14:50:57.148449788 +0000
|
||||
+++ cups-1.5.2/data/cups.path.in 2012-03-16 14:50:57.148449788 +0000
|
||||
diff -up cups-1.6b1/data/cups.path.in.systemd-socket cups-1.6b1/data/cups.path.in
|
||||
--- cups-1.6b1/data/cups.path.in.systemd-socket 2012-05-28 11:16:35.659250570 +0200
|
||||
+++ cups-1.6b1/data/cups.path.in 2012-05-28 11:16:35.659250570 +0200
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printer Service Spool
|
||||
@ -100,9 +100,9 @@ diff -up cups-1.5.2/data/cups.path.in.systemd-socket cups-1.5.2/data/cups.path.i
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
diff -up cups-1.5.2/data/cups.service.in.systemd-socket cups-1.5.2/data/cups.service.in
|
||||
--- cups-1.5.2/data/cups.service.in.systemd-socket 2012-03-16 14:50:57.149449788 +0000
|
||||
+++ cups-1.5.2/data/cups.service.in 2012-03-16 14:50:57.149449788 +0000
|
||||
diff -up cups-1.6b1/data/cups.service.in.systemd-socket cups-1.6b1/data/cups.service.in
|
||||
--- cups-1.6b1/data/cups.service.in.systemd-socket 2012-05-28 11:16:35.659250570 +0200
|
||||
+++ cups-1.6b1/data/cups.service.in 2012-05-28 11:16:35.659250570 +0200
|
||||
@@ -0,0 +1,10 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service
|
||||
@ -114,9 +114,9 @@ diff -up cups-1.5.2/data/cups.service.in.systemd-socket cups-1.5.2/data/cups.ser
|
||||
+[Install]
|
||||
+Also=cups.socket cups.path
|
||||
+WantedBy=printer.target
|
||||
diff -up cups-1.5.2/data/cups.socket.in.systemd-socket cups-1.5.2/data/cups.socket.in
|
||||
--- cups-1.5.2/data/cups.socket.in.systemd-socket 2012-03-16 14:50:57.150449788 +0000
|
||||
+++ cups-1.5.2/data/cups.socket.in 2012-03-16 14:50:57.150449788 +0000
|
||||
diff -up cups-1.6b1/data/cups.socket.in.systemd-socket cups-1.6b1/data/cups.socket.in
|
||||
--- cups-1.6b1/data/cups.socket.in.systemd-socket 2012-05-28 11:16:35.660250563 +0200
|
||||
+++ cups-1.6b1/data/cups.socket.in 2012-05-28 11:16:35.660250563 +0200
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=CUPS Printing Service Sockets
|
||||
@ -126,10 +126,10 @@ diff -up cups-1.5.2/data/cups.socket.in.systemd-socket cups-1.5.2/data/cups.sock
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
diff -up cups-1.5.2/data/Makefile.systemd-socket cups-1.5.2/data/Makefile
|
||||
--- cups-1.5.2/data/Makefile.systemd-socket 2011-05-12 06:21:56.000000000 +0100
|
||||
+++ cups-1.5.2/data/Makefile 2012-03-16 14:50:57.151449789 +0000
|
||||
@@ -112,6 +112,12 @@ install-data:
|
||||
diff -up cups-1.6b1/data/Makefile.systemd-socket cups-1.6b1/data/Makefile
|
||||
--- cups-1.6b1/data/Makefile.systemd-socket 2011-08-27 11:23:01.000000000 +0200
|
||||
+++ cups-1.6b1/data/Makefile 2012-05-28 11:16:35.660250563 +0200
|
||||
@@ -100,6 +100,12 @@ install-data:
|
||||
$(INSTALL_DATA) $$file $(DATADIR)/ppdc; \
|
||||
done
|
||||
$(INSTALL_DIR) -m 755 $(DATADIR)/profiles
|
||||
@ -142,8 +142,8 @@ diff -up cups-1.5.2/data/Makefile.systemd-socket cups-1.5.2/data/Makefile
|
||||
|
||||
|
||||
#
|
||||
@@ -159,6 +165,9 @@ uninstall:
|
||||
-$(RMDIR) $(DATADIR)/charsets
|
||||
@@ -143,6 +149,9 @@ uninstall:
|
||||
-$(RMDIR) $(DATADIR)/data
|
||||
-$(RMDIR) $(DATADIR)/banners
|
||||
-$(RMDIR) $(DATADIR)
|
||||
+ for file in $(SYSTEMD_UNITS); do \
|
||||
@ -152,10 +152,10 @@ diff -up cups-1.5.2/data/Makefile.systemd-socket cups-1.5.2/data/Makefile
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
--- cups-1.5.2/Makedefs.in.systemd-socket 2012-03-16 14:50:57.081449751 +0000
|
||||
+++ cups-1.5.2/Makedefs.in 2012-03-16 14:50:57.152449790 +0000
|
||||
@@ -143,6 +143,7 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
diff -up cups-1.6b1/Makedefs.in.systemd-socket cups-1.6b1/Makedefs.in
|
||||
--- cups-1.6b1/Makedefs.in.systemd-socket 2012-05-28 11:16:35.648250647 +0200
|
||||
+++ cups-1.6b1/Makedefs.in 2012-05-28 11:16:35.660250563 +0200
|
||||
@@ -134,11 +134,13 @@ CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@
|
||||
CXXLIBS = @CXXLIBS@
|
||||
DBUS_NOTIFIER = @DBUS_NOTIFIER@
|
||||
DBUS_NOTIFIERLIBS = @DBUS_NOTIFIERLIBS@
|
||||
@ -163,15 +163,13 @@ diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
DNSSD_BACKEND = @DNSSD_BACKEND@
|
||||
DSOFLAGS = -L../cups @DSOFLAGS@
|
||||
DSOLIBS = @DSOLIBS@ $(COMMONLIBS)
|
||||
@@ -151,6 +152,7 @@ FONTS = @FONTS@
|
||||
IMGLIBS = @IMGLIBS@
|
||||
IMGFILTERS = @IMGFILTERS@
|
||||
DNSSDLIBS = @DNSSDLIBS@
|
||||
LAUNCHDLIBS = @LAUNCHDLIBS@
|
||||
+SDLIBS = @SDLIBS@
|
||||
LDFLAGS = -L../cgi-bin -L../cups -L../filter -L../ppdc \
|
||||
-L../scheduler @LDARCHFLAGS@ \
|
||||
@LDFLAGS@ @RELROFLAGS@ @PIEFLAGS@ $(OPTIM)
|
||||
@@ -267,6 +269,7 @@ PAMFILE = @PAMFILE@
|
||||
@@ -229,6 +231,7 @@ PAMFILE = @PAMFILE@
|
||||
|
||||
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
|
||||
DBUSDIR = @DBUSDIR@
|
||||
@ -179,10 +177,10 @@ diff -up cups-1.5.2/Makedefs.in.systemd-socket cups-1.5.2/Makedefs.in
|
||||
|
||||
|
||||
#
|
||||
diff -up cups-1.5.2/scheduler/client.h.systemd-socket cups-1.5.2/scheduler/client.h
|
||||
--- cups-1.5.2/scheduler/client.h.systemd-socket 2011-03-25 21:25:38.000000000 +0000
|
||||
+++ cups-1.5.2/scheduler/client.h 2012-03-16 14:50:57.153449791 +0000
|
||||
@@ -75,6 +75,9 @@ typedef struct
|
||||
diff -up cups-1.6b1/scheduler/client.h.systemd-socket cups-1.6b1/scheduler/client.h
|
||||
--- cups-1.6b1/scheduler/client.h.systemd-socket 2012-03-22 21:30:20.000000000 +0100
|
||||
+++ cups-1.6b1/scheduler/client.h 2012-05-28 11:16:35.661250556 +0200
|
||||
@@ -77,6 +77,9 @@ typedef struct
|
||||
int fd; /* File descriptor for this server */
|
||||
http_addr_t address; /* Bind address of socket */
|
||||
http_encryption_t encryption; /* To encrypt or not to encrypt... */
|
||||
@ -192,99 +190,9 @@ diff -up cups-1.5.2/scheduler/client.h.systemd-socket cups-1.5.2/scheduler/clien
|
||||
} cupsd_listener_t;
|
||||
|
||||
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.c.systemd-socket cups-1.5.2/scheduler/dirsvc.c
|
||||
--- cups-1.5.2/scheduler/dirsvc.c.systemd-socket 2012-03-16 14:50:57.112449768 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.c 2012-03-16 14:50:57.155449792 +0000
|
||||
@@ -1512,7 +1512,7 @@ cupsdStartBrowsing(void)
|
||||
}
|
||||
}
|
||||
|
||||
- if (BrowseSocket >= 0)
|
||||
+ if (BrowseSocket >= 0 && !BrowseSocketIsSystemd)
|
||||
{
|
||||
/*
|
||||
* Bind the socket to browse port...
|
||||
@@ -1556,13 +1556,17 @@ cupsdStartBrowsing(void)
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "Unable to set broadcast mode - %s.",
|
||||
strerror(errno));
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
|
||||
- BrowseSocket = -1;
|
||||
+ BrowseSocket = -1;
|
||||
+ }
|
||||
+
|
||||
BrowseLocalProtocols &= ~BROWSE_CUPS;
|
||||
BrowseRemoteProtocols &= ~BROWSE_CUPS;
|
||||
|
||||
@@ -1885,15 +1889,22 @@ cupsdStopBrowsing(void)
|
||||
if (((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS) &&
|
||||
BrowseSocket >= 0)
|
||||
{
|
||||
- /*
|
||||
- * Close the socket and remove it from the input selection set.
|
||||
- */
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
+ /*
|
||||
+ * Close the socket.
|
||||
+ */
|
||||
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Remove it from the input selection set.
|
||||
+ */
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
@@ -5693,11 +5704,14 @@ update_cups_browse(void)
|
||||
strerror(errno));
|
||||
cupsdLogMessage(CUPSD_LOG_ERROR, "CUPS browsing turned off.");
|
||||
|
||||
+ if (!BrowseSocketIsSystemd)
|
||||
+ {
|
||||
#ifdef WIN32
|
||||
- closesocket(BrowseSocket);
|
||||
+ closesocket(BrowseSocket);
|
||||
#else
|
||||
- close(BrowseSocket);
|
||||
+ close(BrowseSocket);
|
||||
#endif /* WIN32 */
|
||||
+ }
|
||||
|
||||
cupsdRemoveSelect(BrowseSocket);
|
||||
BrowseSocket = -1;
|
||||
diff -up cups-1.5.2/scheduler/dirsvc.h.systemd-socket cups-1.5.2/scheduler/dirsvc.h
|
||||
--- cups-1.5.2/scheduler/dirsvc.h.systemd-socket 2012-03-16 14:50:57.113449769 +0000
|
||||
+++ cups-1.5.2/scheduler/dirsvc.h 2012-03-16 14:50:57.157449792 +0000
|
||||
@@ -100,6 +100,8 @@ VAR int Browsing VALUE(TRUE),
|
||||
/* Short names for remote printers? */
|
||||
BrowseSocket VALUE(-1),
|
||||
/* Socket for browsing */
|
||||
+ BrowseSocketIsSystemd VALUE(0),
|
||||
+ /* BrowseSocket is systemd-provided? */
|
||||
BrowsePort VALUE(IPP_PORT),
|
||||
/* Port number for broadcasts */
|
||||
BrowseInterval VALUE(DEFAULT_INTERVAL),
|
||||
diff -up cups-1.5.2/scheduler/listen.c.systemd-socket cups-1.5.2/scheduler/listen.c
|
||||
--- cups-1.5.2/scheduler/listen.c.systemd-socket 2011-04-16 00:38:13.000000000 +0100
|
||||
+++ cups-1.5.2/scheduler/listen.c 2012-03-16 14:50:57.158449792 +0000
|
||||
diff -up cups-1.6b1/scheduler/listen.c.systemd-socket cups-1.6b1/scheduler/listen.c
|
||||
--- cups-1.6b1/scheduler/listen.c.systemd-socket 2011-04-16 01:38:13.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/listen.c 2012-05-28 11:16:35.661250556 +0200
|
||||
@@ -401,7 +401,11 @@ cupsdStopListening(void)
|
||||
lis;
|
||||
lis = (cupsd_listener_t *)cupsArrayNext(Listeners))
|
||||
@ -298,9 +206,9 @@ diff -up cups-1.5.2/scheduler/listen.c.systemd-socket cups-1.5.2/scheduler/liste
|
||||
{
|
||||
#ifdef WIN32
|
||||
closesocket(lis->fd);
|
||||
diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
--- cups-1.5.2/scheduler/main.c.systemd-socket 2012-03-16 14:50:57.121449773 +0000
|
||||
+++ cups-1.5.2/scheduler/main.c 2012-03-16 14:51:55.409483636 +0000
|
||||
diff -up cups-1.6b1/scheduler/main.c.systemd-socket cups-1.6b1/scheduler/main.c
|
||||
--- cups-1.6b1/scheduler/main.c.systemd-socket 2012-05-28 11:16:35.612250897 +0200
|
||||
+++ cups-1.6b1/scheduler/main.c 2012-05-28 12:49:32.698375139 +0200
|
||||
@@ -26,6 +26,8 @@
|
||||
* launchd_checkin() - Check-in with launchd and collect the listening
|
||||
* fds.
|
||||
@ -331,7 +239,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
static void parent_handler(int sig);
|
||||
static void process_children(void);
|
||||
static void sigchld_handler(int sig);
|
||||
@@ -537,6 +546,13 @@ main(int argc, /* I - Number of comm
|
||||
@@ -528,6 +537,13 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
@ -345,7 +253,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
/*
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -759,6 +775,15 @@ main(int argc, /* I - Number of comm
|
||||
@@ -738,6 +754,15 @@ main(int argc, /* I - Number of comm
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
@ -361,7 +269,7 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
/*
|
||||
* Startup the server...
|
||||
*/
|
||||
@@ -1584,6 +1609,139 @@ launchd_checkout(void)
|
||||
@@ -1516,6 +1541,102 @@ launchd_checkout(void)
|
||||
}
|
||||
#endif /* HAVE_LAUNCHD */
|
||||
|
||||
@ -403,43 +311,6 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
+
|
||||
+ if (!r)
|
||||
+ {
|
||||
+ if (Browsing &&
|
||||
+ ((BrowseLocalProtocols | BrowseRemoteProtocols) & BROWSE_CUPS))
|
||||
+ {
|
||||
+ r = sd_is_socket(fd, AF_UNSPEC, SOCK_DGRAM, 0);
|
||||
+ if (r < 0)
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to verify socket type - %s",
|
||||
+ strerror(-r));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (r)
|
||||
+ {
|
||||
+ /*
|
||||
+ * This is the browse socket.
|
||||
+ */
|
||||
+
|
||||
+ char addrstr[256];
|
||||
+ if (getsockname(fd, (struct sockaddr*) &addr, &addrlen))
|
||||
+ {
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Unable to get local address - %s",
|
||||
+ strerror(errno));
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ httpAddrString (&addr, addrstr, sizeof (addrstr));
|
||||
+ BrowseSocket = fd;
|
||||
+ BrowseSocketIsSystemd = 1;
|
||||
+ cupsdLogMessage(CUPSD_LOG_DEBUG,
|
||||
+ "systemd_checkin: Matched browse (port %d) with fd %d:%s...",
|
||||
+ BrowsePort, fd, addrstr);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+ cupsdLogMessage(CUPSD_LOG_ERROR,
|
||||
+ "systemd_checkin: Socket not of the right type");
|
||||
+ continue;
|
||||
@ -501,10 +372,10 @@ diff -up cups-1.5.2/scheduler/main.c.systemd-socket cups-1.5.2/scheduler/main.c
|
||||
|
||||
/*
|
||||
* 'parent_handler()' - Catch USR1/CHLD signals...
|
||||
diff -up cups-1.5.2/scheduler/Makefile.systemd-socket cups-1.5.2/scheduler/Makefile
|
||||
--- cups-1.5.2/scheduler/Makefile.systemd-socket 2012-03-16 14:50:57.130449778 +0000
|
||||
+++ cups-1.5.2/scheduler/Makefile 2012-03-16 14:50:57.160449794 +0000
|
||||
@@ -382,7 +382,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu
|
||||
diff -up cups-1.6b1/scheduler/Makefile.systemd-socket cups-1.6b1/scheduler/Makefile
|
||||
--- cups-1.6b1/scheduler/Makefile.systemd-socket 2012-05-21 19:40:22.000000000 +0200
|
||||
+++ cups-1.6b1/scheduler/Makefile 2012-05-28 11:16:35.663250542 +0200
|
||||
@@ -371,7 +371,7 @@ cupsd: $(CUPSDOBJS) $(LIBCUPSMIME) ../cu
|
||||
$(CC) $(LDFLAGS) -o cupsd $(CUPSDOBJS) -L. -lcupsmime \
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
$(LIBPAPER) $(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBS) \
|
||||
@ -513,12 +384,12 @@ diff -up cups-1.5.2/scheduler/Makefile.systemd-socket cups-1.5.2/scheduler/Makef
|
||||
|
||||
cupsd-static: $(CUPSDOBJS) libcupsmime.a ../cups/$(LIBCUPSSTATIC)
|
||||
echo Linking $@...
|
||||
@@ -390,7 +390,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a
|
||||
@@ -379,7 +379,7 @@ cupsd-static: $(CUPSDOBJS) libcupsmime.a
|
||||
$(LIBZ) $(SSLLIBS) $(LIBSLP) $(LIBLDAP) $(PAMLIBS) \
|
||||
../cups/$(LIBCUPSSTATIC) $(COMMONLIBS) $(LIBZ) $(LIBPAPER) \
|
||||
$(LIBMALLOC) $(SERVERLIBS) $(DNSSDLIBS) $(LIBGSSAPI) \
|
||||
- $(LIBWRAP)
|
||||
+ $(LIBWRAP) $(SDLIBS)
|
||||
+ $(LIBWRAP) $(SDLIBS)
|
||||
|
||||
tls.o: tls-darwin.c tls-gnutls.c tls-openssl.c
|
||||
|
||||
#
|
||||
|
267
cups.spec
267
cups.spec
@ -1,5 +1,3 @@
|
||||
%global php_extdir %(php-config --extension-dir 2>/dev/null || echo %{_libdir}/php4)
|
||||
|
||||
%global use_alternatives 1
|
||||
%global lspp 1
|
||||
|
||||
@ -11,15 +9,13 @@
|
||||
|
||||
Summary: Common Unix Printing System
|
||||
Name: cups
|
||||
Version: 1.5.4
|
||||
Version: 1.6.1
|
||||
Release: 1%{?dist}
|
||||
License: GPLv2
|
||||
Group: System Environment/Daemons
|
||||
Source: http://ftp.easysw.com/pub/cups/%{version}/cups-%{version}-source.tar.bz2
|
||||
# Pixmap for desktop file
|
||||
Source2: cupsprinter.png
|
||||
# LSPP-required ps->pdf filter
|
||||
Source4: pstopdf
|
||||
# xinetd config file for cups-lpd service
|
||||
Source5: cups-lpd
|
||||
# Logrotate configuration
|
||||
@ -28,14 +24,11 @@ Source6: cups.logrotate
|
||||
Source7: ncp.backend
|
||||
# Cron-based tmpwatch for /var/spool/cups/tmp
|
||||
Source8: cups.cron
|
||||
# Filter and PPD for textonly printing
|
||||
Source9: textonly.filter
|
||||
Source10: textonly.ppd
|
||||
Source11: macros.cups
|
||||
Patch1: cups-no-gzip-man.patch
|
||||
Patch2: cups-system-auth.patch
|
||||
Patch3: cups-multilib.patch
|
||||
Patch4: cups-serial.patch
|
||||
|
||||
Patch5: cups-banners.patch
|
||||
Patch6: cups-serverbin-compat.patch
|
||||
Patch7: cups-no-export-ssllibs.patch
|
||||
@ -44,31 +37,24 @@ Patch9: cups-lpr-help.patch
|
||||
Patch10: cups-peercred.patch
|
||||
Patch11: cups-pid.patch
|
||||
Patch12: cups-eggcups.patch
|
||||
Patch13: cups-getpass.patch
|
||||
|
||||
Patch14: cups-driverd-timeout.patch
|
||||
Patch15: cups-strict-ppd-line-length.patch
|
||||
Patch16: cups-logrotate.patch
|
||||
Patch17: cups-usb-paperout.patch
|
||||
Patch18: cups-build.patch
|
||||
#Patch18: cups-build.patch
|
||||
Patch19: cups-res_init.patch
|
||||
Patch20: cups-filter-debug.patch
|
||||
Patch21: cups-uri-compat.patch
|
||||
Patch22: cups-cups-get-classes.patch
|
||||
Patch23: cups-str3382.patch
|
||||
Patch25: cups-0755.patch
|
||||
Patch26: cups-snmp-quirks.patch
|
||||
|
||||
Patch27: cups-hp-deviceid-oid.patch
|
||||
Patch28: cups-dnssd-deviceid.patch
|
||||
Patch29: cups-ricoh-deviceid-oid.patch
|
||||
|
||||
Patch30: cups-avahi-1-config.patch
|
||||
Patch31: cups-avahi-2-backend.patch
|
||||
Patch32: cups-avahi-3-timeouts.patch
|
||||
Patch33: cups-avahi-4-poll.patch
|
||||
Patch34: cups-avahi-5-services.patch
|
||||
|
||||
Patch35: cups-icc.patch
|
||||
Patch36: cups-systemd-socket.patch
|
||||
Patch30: cups-systemd-socket.patch
|
||||
|
||||
Patch100: cups-lspp.patch
|
||||
|
||||
@ -76,6 +62,7 @@ Epoch: 1
|
||||
Url: http://www.cups.org/
|
||||
|
||||
Requires: /sbin/chkconfig /sbin/service
|
||||
Requires: %{name}-filesystem = %{epoch}:%{version}-%{release}
|
||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
%if %use_alternatives
|
||||
Provides: /usr/bin/lpq /usr/bin/lpr /usr/bin/lp /usr/bin/cancel /usr/bin/lprm /usr/bin/lpstat
|
||||
@ -97,16 +84,12 @@ Conflicts: kdelibs < 6:3.5.2-6
|
||||
BuildRequires: pam-devel pkgconfig
|
||||
BuildRequires: gnutls-devel libacl-devel
|
||||
BuildRequires: openldap-devel
|
||||
BuildRequires: make >= 1:3.80
|
||||
BuildRequires: php-devel, pcre-devel
|
||||
BuildRequires: libjpeg-devel
|
||||
BuildRequires: libpng-devel
|
||||
BuildRequires: libtiff-devel
|
||||
BuildRequires: libusb1-devel
|
||||
BuildRequires: krb5-devel
|
||||
BuildRequires: avahi-devel
|
||||
BuildRequires: poppler-utils
|
||||
BuildRequires: systemd-units, systemd-devel
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: automake
|
||||
|
||||
# Make sure we get postscriptdriver tags.
|
||||
BuildRequires: python-cups
|
||||
@ -116,13 +99,7 @@ BuildRequires: libselinux-devel >= 1.23
|
||||
BuildRequires: audit-libs-devel >= 1.1
|
||||
%endif
|
||||
|
||||
# -fstack-protector-all requires GCC 4.0.1
|
||||
BuildRequires: gcc >= 4.0.1
|
||||
|
||||
BuildRequires: automake
|
||||
|
||||
BuildRequires: dbus-devel >= 0.90
|
||||
Requires: dbus >= 0.90
|
||||
Requires: dbus
|
||||
|
||||
# Requires tmpwatch for the cron.daily script (bug #218901).
|
||||
Requires: tmpwatch
|
||||
@ -136,8 +113,6 @@ Requires(post): systemd-sysv
|
||||
# Requires working PrivateTmp (bug #807672)
|
||||
Requires(pre): systemd >= 37-14
|
||||
|
||||
Requires: poppler-utils
|
||||
|
||||
# We ship udev rules which use setfacl.
|
||||
Requires: systemd
|
||||
Requires: acl
|
||||
@ -161,6 +136,11 @@ Summary: Common Unix Printing System - libraries
|
||||
Group: System Environment/Libraries
|
||||
License: LGPLv2
|
||||
|
||||
%package filesystem
|
||||
Summary: Common Unix Printing System - directory layout
|
||||
Group: System Environment/Base
|
||||
BuildArch: noarch
|
||||
|
||||
%package lpd
|
||||
Summary: Common Unix Printing System - lpd emulation
|
||||
Group: System Environment/Daemons
|
||||
@ -168,47 +148,39 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
Requires: xinetd
|
||||
|
||||
%package php
|
||||
Summary: Common Unix Printing System - php module
|
||||
Group: Development/Languages
|
||||
Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
|
||||
Requires: php(zend-abi) = %{php_zend_api}
|
||||
Requires: php(api) = %{php_core_api}
|
||||
|
||||
%package ipptool
|
||||
Summary: Common Unix Printing System - tool for performing IPP requests
|
||||
Group: System Environment/Daemons
|
||||
Requires: %{name}-libs = %{epoch}:%{version}-%{release}
|
||||
Requires: %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. It has been developed by Easy Software Products
|
||||
to promote a standard printing solution for all UNIX vendors and users.
|
||||
CUPS provides the System V and Berkeley command-line interfaces.
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. It has been developed by Easy Software Products
|
||||
to promote a standard printing solution for all UNIX vendors and users.
|
||||
CUPS provides the System V and Berkeley command-line interfaces.
|
||||
|
||||
%description devel
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This is the development package for creating
|
||||
additional printer drivers, and other CUPS services.
|
||||
|
||||
%description libs
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. It has been developed by Easy Software Products
|
||||
to promote a standard printing solution for all UNIX vendors and users.
|
||||
CUPS provides the System V and Berkeley command-line interfaces.
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. It has been developed by Easy Software Products
|
||||
to promote a standard printing solution for all UNIX vendors and users.
|
||||
CUPS provides the System V and Berkeley command-line interfaces.
|
||||
The cups-libs package provides libraries used by applications to use CUPS
|
||||
natively, without needing the lp/lpr commands.
|
||||
|
||||
%description lpd
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This is the package that provides standard
|
||||
lpd emulation.
|
||||
|
||||
%description php
|
||||
%description filesystem
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This is the package that provides a PHP
|
||||
module.
|
||||
UNIX® operating systems. This package provides some directories which are
|
||||
required by other packages that add CUPS drivers (i.e. filters, backends etc.).
|
||||
|
||||
%description lpd
|
||||
The Common UNIX Printing System provides a portable printing layer for
|
||||
UNIX® operating systems. This is the package that provides standard
|
||||
lpd emulation.
|
||||
|
||||
%description ipptool
|
||||
Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
@ -221,8 +193,7 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
%patch2 -p1 -b .system-auth
|
||||
# Prevent multilib conflict in cups-config script.
|
||||
%patch3 -p1 -b .multilib
|
||||
# Fix compilation of serial backend.
|
||||
%patch4 -p1 -b .serial
|
||||
|
||||
# Ignore rpm save/new files in the banners directory.
|
||||
%patch5 -p1 -b .banners
|
||||
# Use compatibility fallback path for ServerBin.
|
||||
@ -239,8 +210,7 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
%patch11 -p1 -b .pid
|
||||
# Fix implementation of com.redhat.PrinterSpooler D-Bus object.
|
||||
%patch12 -p1 -b .eggcups
|
||||
# More sophisticated implementation of cupsGetPassword than getpass.
|
||||
%patch13 -p1 -b .getpass
|
||||
|
||||
# Increase driverd timeout to 70s to accommodate foomatic (bug #744715).
|
||||
%patch14 -p1 -b .driverd-timeout
|
||||
# Only enforce maximum PPD line length when in strict mode.
|
||||
@ -250,8 +220,8 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
# Support for errno==ENOSPACE-based USB paper-out reporting.
|
||||
%patch17 -p1 -b .usb-paperout
|
||||
# Simplify the DNSSD parts so they can build using the compat library.
|
||||
%patch18 -p1 -b .build
|
||||
# Re-initialise the resolver on failure in httpAddrGetList().
|
||||
#%%patch18 -p1 -b .build
|
||||
# Re-initialise the resolver on failure in httpAddrGetList() (bug #567353).
|
||||
%patch19 -p1 -b .res_init
|
||||
# Log extra debugging information if no filters are available.
|
||||
%patch20 -p1 -b .filter-debug
|
||||
@ -263,8 +233,7 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
%patch23 -p1 -b .str3382
|
||||
# Use mode 0755 for binaries and libraries where appropriate.
|
||||
%patch25 -p1 -b .0755
|
||||
# Handle SNMP supply level quirks (bug #581825).
|
||||
%patch26 -p1 -b .snmp-quirks
|
||||
|
||||
# Add an SNMP query for HP's device ID OID (STR #3552).
|
||||
%patch27 -p1 -b .hp-deviceid-oid
|
||||
# Mark DNS-SD Device IDs that have been guessed at with "FZY:1;".
|
||||
@ -272,27 +241,23 @@ Sends IPP requests to the specified URI and tests and/or displays the results.
|
||||
# Add an SNMP query for Ricoh's device ID OID (STR #3552).
|
||||
%patch29 -p1 -b .ricoh-deviceid-oid
|
||||
|
||||
# Avahi support:
|
||||
# - discovery in the dnssd backend
|
||||
# - service announcement in the scheduler
|
||||
%patch30 -p1 -b .avahi-1-config
|
||||
%patch31 -p1 -b .avahi-2-backend
|
||||
%patch32 -p1 -b .avahi-3-timeouts
|
||||
%patch33 -p1 -b .avahi-4-poll
|
||||
%patch34 -p1 -b .avahi-5-services
|
||||
|
||||
# ICC colord support.
|
||||
%patch35 -p1 -b .icc
|
||||
|
||||
# Add support for systemd socket activation (patch from Lennart
|
||||
# Poettering).
|
||||
%patch36 -p1 -b .systemd-socket
|
||||
%patch30 -p1 -b .systemd-socket
|
||||
|
||||
%if %lspp
|
||||
# LSPP support.
|
||||
%patch100 -p1 -b .lspp
|
||||
%endif
|
||||
|
||||
# We want to use the PDF workflow in principle with one exception when the input
|
||||
# is PostScript and the printer is a native PostScript printer.
|
||||
# To avoid the PS -> PDF -> PS conversion (costs 66),
|
||||
# set the cost factor of pstops to 65.
|
||||
# This forth-and-back conversion sometimes produces PostScript files which are
|
||||
# too big for the printer's memory resulting in not getting printed.
|
||||
sed -i -r -e '/\spstops$/ { s/66/65/ }' conf/mime.convs.in
|
||||
|
||||
sed -i -e '1iMaxLogSize 0' conf/cupsd.conf.in
|
||||
|
||||
cp %{SOURCE5} cups-lpd.real
|
||||
@ -301,15 +266,11 @@ perl -pi -e "s,\@LIBDIR\@,%{_libdir},g" cups-lpd.real
|
||||
# Let's look at the compilation command lines.
|
||||
perl -pi -e "s,^.SILENT:,," Makedefs.in
|
||||
|
||||
# Fix locale code for Norwegian (bug #520379).
|
||||
mv locale/cups_no.po locale/cups_nb.po
|
||||
|
||||
f=CREDITS.txt
|
||||
mv "$f" "$f"~
|
||||
iconv -f MACINTOSH -t UTF-8 "$f"~ > "$f"
|
||||
rm "$f"~
|
||||
|
||||
# Rebuild configure script for --enable-avahi.
|
||||
aclocal -I config-scripts
|
||||
autoconf -I config-scripts
|
||||
|
||||
@ -320,10 +281,12 @@ export CFLAGS="$RPM_OPT_FLAGS -fstack-protector-all -DLDAP_DEPRECATED=1"
|
||||
%if %lspp
|
||||
--enable-lspp \
|
||||
%endif
|
||||
--with-log-file-perm=0600 --enable-relro \
|
||||
--with-pdftops=pdftops \
|
||||
--with-cupsd-file-perm=0755 \
|
||||
--with-log-file-perm=0600 \
|
||||
--enable-relro \
|
||||
--with-dbusdir=%{_sysconfdir}/dbus-1 \
|
||||
--with-php=/usr/bin/php-cgi --enable-avahi \
|
||||
--with-php=/usr/bin/php-cgi \
|
||||
--enable-avahi \
|
||||
--enable-threads --enable-gnutls \
|
||||
localedir=%{_datadir}/locale
|
||||
|
||||
@ -333,9 +296,6 @@ make %{?_smp_mflags}
|
||||
%install
|
||||
make BUILDROOT=$RPM_BUILD_ROOT install
|
||||
|
||||
# Serial backend needs to run as root (bug #212577).
|
||||
chmod 700 $RPM_BUILD_ROOT%{cups_serverbin}/backend/serial
|
||||
|
||||
rm -rf $RPM_BUILD_ROOT%{_initddir} \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/init.d \
|
||||
$RPM_BUILD_ROOT%{_sysconfdir}/rc?.d
|
||||
@ -365,13 +325,6 @@ install -c -m 644 cups-lpd.real $RPM_BUILD_ROOT%{_sysconfdir}/xinetd.d/cups-lpd
|
||||
install -c -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/cups
|
||||
install -c -m 755 %{SOURCE7} $RPM_BUILD_ROOT%{cups_serverbin}/backend/ncp
|
||||
install -c -m 755 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/cron.daily/cups
|
||||
install -c -m 755 %{SOURCE9} $RPM_BUILD_ROOT%{cups_serverbin}/filter/textonly
|
||||
install -c -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_datadir}/cups/model/textonly.ppd
|
||||
|
||||
# Ship pstopdf for LSPP systems to deal with malicious postscript
|
||||
%if %lspp
|
||||
install -c -m 755 %{SOURCE4} $RPM_BUILD_ROOT%{cups_serverbin}/filter
|
||||
%endif
|
||||
|
||||
# Ship an rpm macro for where to put driver executables.
|
||||
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm/
|
||||
@ -394,13 +347,9 @@ mkdir -p $RPM_BUILD_ROOT%{_datadir}/ppd
|
||||
rm -rf $RPM_BUILD_ROOT%{_mandir}/cat? $RPM_BUILD_ROOT%{_mandir}/*/cat?
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/applications/cups.desktop
|
||||
rm -rf $RPM_BUILD_ROOT%{_datadir}/icons
|
||||
|
||||
# Put the php config bit into place
|
||||
%{__mkdir_p} $RPM_BUILD_ROOT%{_sysconfdir}/php.d
|
||||
%{__cat} << __EOF__ > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{name}.ini
|
||||
; Enable %{name} extension module
|
||||
extension=phpcups.so
|
||||
__EOF__
|
||||
# these are shipped with cups-filters
|
||||
rm -rf $RPM_BUILD_ROOT%{_datadir}/cups/banners
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/cups/data/testprint
|
||||
|
||||
# install /usr/lib/tmpfiles.d/cups.conf (bug #656566)
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_prefix}/lib/tmpfiles.d
|
||||
@ -430,20 +379,9 @@ s:.*\('%{_datadir}'/\)\([^/_]\+\)\(.*\.po$\):%lang(\2) \1\2\3:
|
||||
/^\([^%].*\)/d
|
||||
' > %{name}.lang
|
||||
|
||||
%check
|
||||
# Minimal load test of php extension
|
||||
LD_LIBRARY_PATH=${RPM_BUILD_ROOT}%{_libdir} \
|
||||
php --no-php-ini \
|
||||
--define extension_dir=${RPM_BUILD_ROOT}%{php_extdir} \
|
||||
--define extension=phpcups.so \
|
||||
--modules | grep phpcups
|
||||
|
||||
|
||||
%post
|
||||
if [ $1 -eq 1 ] ; then
|
||||
# Initial installation
|
||||
/bin/systemctl enable cups.{service,socket,path} >/dev/null 2>&1 || :
|
||||
fi
|
||||
%{systemd_post} %{name}.path %{name}.socket %{name}.service
|
||||
|
||||
# Remove old-style certs directory; new-style is /var/run
|
||||
# (see bug #194581 for why this is necessary).
|
||||
@ -472,24 +410,21 @@ exit 0
|
||||
%postun libs -p /sbin/ldconfig
|
||||
|
||||
%preun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
# Package removal, not upgrade
|
||||
/bin/systemctl --no-reload disable %{name}.path %{name}.socket %{name}.service >/dev/null 2>&1 || :
|
||||
/bin/systemctl stop %{name}.path %{name}.socket %{name}.service >/dev/null 2>&1 || :
|
||||
%{systemd_preun} %{name}.path %{name}.socket %{name}.service
|
||||
|
||||
%if %use_alternatives
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/usr/sbin/alternatives --remove print %{_bindir}/lpr.cups
|
||||
%endif
|
||||
fi
|
||||
%endif
|
||||
|
||||
exit 0
|
||||
|
||||
%postun
|
||||
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
|
||||
if [ $1 -ge 1 ]; then
|
||||
# Package upgrade, not uninstall
|
||||
/bin/systemctl try-restart %{name}.service >/dev/null 2>&1 || :
|
||||
fi
|
||||
%{systemd_postun_with_restart} %{name}.service
|
||||
exit 0
|
||||
|
||||
|
||||
%triggerun -- %{name} < 1:1.5.0-22
|
||||
# This package is allowed to autostart; however, the upgrade trigger
|
||||
# in Fedora 16 final failed to actually do this. Do it now as a
|
||||
@ -546,26 +481,17 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%config(noreplace) %{_sysconfdir}/pam.d/cups
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/cups
|
||||
%dir %{_datadir}/%{name}/www
|
||||
%dir %{_datadir}/%{name}/www/ca
|
||||
%dir %{_datadir}/%{name}/www/es
|
||||
%dir %{_datadir}/%{name}/www/eu
|
||||
%dir %{_datadir}/%{name}/www/ja
|
||||
%dir %{_datadir}/%{name}/www/pl
|
||||
%dir %{_datadir}/%{name}/www/ru
|
||||
%{_datadir}/%{name}/www/images
|
||||
%{_datadir}/%{name}/www/*.css
|
||||
%doc %{_datadir}/%{name}/www/index.html
|
||||
%doc %{_datadir}/%{name}/www/help
|
||||
%doc %{_datadir}/%{name}/www/robots.txt
|
||||
%doc %{_datadir}/%{name}/www/de/index.html
|
||||
%doc %{_datadir}/%{name}/www/ca/index.html
|
||||
%doc %{_datadir}/%{name}/www/es/index.html
|
||||
%doc %{_datadir}/%{name}/www/eu/index.html
|
||||
%doc %{_datadir}/%{name}/www/fr/index.html
|
||||
%doc %{_datadir}/%{name}/www/hu/index.html
|
||||
%doc %{_datadir}/%{name}/www/id/index.html
|
||||
%doc %{_datadir}/%{name}/www/it/index.html
|
||||
%doc %{_datadir}/%{name}/www/ja/index.html
|
||||
%doc %{_datadir}/%{name}/www/pl/index.html
|
||||
%doc %{_datadir}/%{name}/www/ru/index.html
|
||||
%{_unitdir}/%{name}.service
|
||||
%{_unitdir}/%{name}.socket
|
||||
%{_unitdir}/%{name}.path
|
||||
@ -574,54 +500,34 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%{_bindir}/cancel*
|
||||
%{_bindir}/lp*
|
||||
%{_bindir}/ppd*
|
||||
%dir %{cups_serverbin}
|
||||
%{cups_serverbin}/backend
|
||||
%{cups_serverbin}/backend/*
|
||||
%{cups_serverbin}/cgi-bin
|
||||
%dir %{cups_serverbin}/daemon
|
||||
%{cups_serverbin}/daemon/cups-polld
|
||||
%{cups_serverbin}/daemon/cups-deviced
|
||||
%{cups_serverbin}/daemon/cups-driverd
|
||||
%{cups_serverbin}/daemon/cups-exec
|
||||
%{cups_serverbin}/notifier
|
||||
%{cups_serverbin}/filter
|
||||
%{cups_serverbin}/filter/*
|
||||
%{cups_serverbin}/monitor
|
||||
%{cups_serverbin}/driver
|
||||
%{_mandir}/man1/cancel*
|
||||
%{_mandir}/man1/cupstest*
|
||||
%{_mandir}/man1/lp*
|
||||
%{_mandir}/man1/ppd*
|
||||
%{_mandir}/man[578]/*
|
||||
%{_sbindir}/*
|
||||
%dir %{_datadir}/cups
|
||||
%dir %{_datadir}/cups/banners
|
||||
%{_datadir}/cups/banners/*
|
||||
%{_datadir}/cups/charsets
|
||||
%{_datadir}/cups/data
|
||||
%{_datadir}/cups/fonts
|
||||
%{_datadir}/cups/model
|
||||
%dir %{_datadir}/cups/templates
|
||||
%{_datadir}/cups/templates/*.tmpl
|
||||
%{_datadir}/cups/templates/de/*.tmpl
|
||||
%{_datadir}/cups/templates/ca/*.tmpl
|
||||
%{_datadir}/cups/templates/es/*.tmpl
|
||||
%{_datadir}/cups/templates/eu/*.tmpl
|
||||
%{_datadir}/cups/templates/fr/*.tmpl
|
||||
%{_datadir}/cups/templates/hu/*.tmpl
|
||||
%{_datadir}/cups/templates/id/*.tmpl
|
||||
%{_datadir}/cups/templates/it/*.tmpl
|
||||
%{_datadir}/cups/templates/ja/*.tmpl
|
||||
%{_datadir}/cups/templates/pl/*.tmpl
|
||||
%{_datadir}/cups/templates/ru/*.tmpl
|
||||
%{_datadir}/locale/*/*.po
|
||||
%{_datadir}/ppd
|
||||
%dir %attr(1770,root,lp) %{_localstatedir}/spool/cups/tmp
|
||||
%dir %attr(0710,root,lp) %{_localstatedir}/spool/cups
|
||||
%dir %attr(0755,lp,sys) %{_localstatedir}/log/cups
|
||||
%{_datadir}/pixmaps/cupsprinter.png
|
||||
%{_sysconfdir}/cron.daily/cups
|
||||
%config(noreplace) %{_sysconfdir}/dbus-1/system.d/cups.conf
|
||||
%{_datadir}/cups/drv
|
||||
%{_datadir}/cups/drv/sample.drv
|
||||
%{_datadir}/cups/examples
|
||||
%dir %{_datadir}/cups/mime
|
||||
%{_datadir}/cups/mime/mime.types
|
||||
%{_datadir}/cups/mime/mime.convs
|
||||
%dir %{_datadir}/cups/ppdc
|
||||
@ -632,6 +538,20 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%doc LICENSE.txt
|
||||
%{_libdir}/*.so.*
|
||||
|
||||
%files filesystem
|
||||
%dir %{cups_serverbin}
|
||||
%dir %{cups_serverbin}/backend
|
||||
%dir %{cups_serverbin}/driver
|
||||
%dir %{cups_serverbin}/filter
|
||||
%dir %{_datadir}/cups
|
||||
#%%dir %%{_datadir}/cups/banners
|
||||
#%%dir %%{_datadir}/cups/charsets
|
||||
%dir %{_datadir}/cups/data
|
||||
%dir %{_datadir}/cups/drv
|
||||
%dir %{_datadir}/cups/mime
|
||||
%dir %{_datadir}/cups/model
|
||||
%dir %{_datadir}/ppd
|
||||
|
||||
%files devel
|
||||
%{_bindir}/cups-config
|
||||
%{_libdir}/*.so
|
||||
@ -645,10 +565,6 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%dir %{cups_serverbin}/daemon
|
||||
%{cups_serverbin}/daemon/cups-lpd
|
||||
|
||||
%files php
|
||||
%config(noreplace) %{_sysconfdir}/php.d/%{name}.ini
|
||||
%{php_extdir}/phpcups.so
|
||||
|
||||
%files ipptool
|
||||
%{_bindir}/ipptool
|
||||
%dir %{_datadir}/cups/ipptool
|
||||
@ -656,6 +572,23 @@ rm -f %{cups_serverbin}/backend/smb
|
||||
%{_mandir}/man1/ipptool.1.gz
|
||||
|
||||
%changelog
|
||||
* Wed Aug 08 2012 Jiri Popelka <jpopelka@redhat.com> 1:1.6.1-1
|
||||
- 1.6.1
|
||||
- simplified systemd.patch due to removed CUPS Browsing protocol (STR #3922)
|
||||
- removed:
|
||||
textonly filter - moved to cups-filters
|
||||
pstopdf filter - cups-filters also has pstopdf (different)
|
||||
PHP module - moved to cups-filters (STR #3932)
|
||||
serial.patch - moved to cups-filters
|
||||
getpass.patch - r10140 removed the getpass() use
|
||||
snmp-quirks.patch - fixed upstream (r10493)
|
||||
avahi patches - merged upstream (STR #3066)
|
||||
icc.patch - merged upstream (STR #3808)
|
||||
- TODO:
|
||||
- do we need cups-build.patch ?
|
||||
- added filesystem sub-package (#624695)
|
||||
- use macroized systemd scriptlets
|
||||
|
||||
* Thu Jul 26 2012 Jiri Popelka <jpopelka@redhat.com> 1:1.5.4-1
|
||||
- 1.5.4
|
||||
|
||||
|
54
pstopdf
54
pstopdf
@ -1,54 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# CUPS filter script for Ghostscript.
|
||||
#
|
||||
# Copyright 2001-2002 by Easy Software Products.
|
||||
# Copyright 2006 by Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU General Public License
|
||||
# as published by the Free Software Foundation; either version 2
|
||||
# of the License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
# Installation directories...
|
||||
prefix=/usr
|
||||
exec_prefix=${prefix}
|
||||
bindir=${exec_prefix}/bin
|
||||
|
||||
# Set the library/font path...
|
||||
GS_FONTPATH="$CUPS_FONTPATH"
|
||||
export GS_FONTPATH
|
||||
|
||||
# Options we use with Ghostscript...
|
||||
gsopts="-dQUIET -dDEBUG -dPARANOIDSAFER -dNOPAUSE -dBATCH "
|
||||
gsopts="$gsopts -dNOMEDIAATTRS -sDEVICE=pdfwrite -sstdout=%stderr"
|
||||
|
||||
# See if we have a profile=n,n,n,n,n,n,n,n,n,n,n option...
|
||||
profile=""
|
||||
for option in $5; do
|
||||
case $option in
|
||||
profile=*)
|
||||
profile="-scupsProfile=`echo $option | awk -F= '{print $2}'`"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# See if we have a filename on the command-line...
|
||||
if test -z "$6"; then
|
||||
ifile="-"
|
||||
else
|
||||
ifile="$6"
|
||||
fi
|
||||
|
||||
# Now run Ghostscript...
|
||||
$bindir/gs $gsopts -sOUTPUTFILE="%stdout" $profile $ifile
|
||||
|
2
sources
2
sources
@ -1 +1 @@
|
||||
de3006e5cf1ee78a9c6145ce62c4e982 cups-1.5.4-source.tar.bz2
|
||||
87ade07e3d1efd03c9c3add949cf9c00 cups-1.6.1-source.tar.bz2
|
||||
|
124
textonly.filter
124
textonly.filter
@ -1,124 +0,0 @@
|
||||
#!/bin/bash
|
||||
## Copyright (C) 2003-2006 Red Hat, Inc.
|
||||
## Copyright (C) 2003-2006 Tim Waugh <twaugh@redhat.com>
|
||||
## Changed on 2007/05/17, Opher Shachar, LADPC Ltd.
|
||||
## Added support for page-ranges option.
|
||||
## Added page accounting.
|
||||
|
||||
## This program is free software; you can redistribute it and/or
|
||||
## modify it under the terms of the GNU General Public License
|
||||
## as published by the Free Software Foundation; either version 2
|
||||
## of the License, or (at your option) any later version.
|
||||
|
||||
## This program is distributed in the hope that it will be useful,
|
||||
## but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
## GNU General Public License for more details.
|
||||
|
||||
## You should have received a copy of the GNU General Public License
|
||||
## along with this program; if not, write to the Free Software
|
||||
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
|
||||
if [ $# == 0 ]; then
|
||||
echo >&2 "ERROR: $0 job-id user title copies options [file]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Extract the papersize
|
||||
SENDFF=`grep '^\*DefaultSendFF' "$PPD" | cut -d\ -f2`
|
||||
COPIES=1
|
||||
if [ $# -ge 4 ]; then
|
||||
COPIES="$4"
|
||||
fi
|
||||
|
||||
if [ $# -lt 6 ]; then
|
||||
unset TMPFILE
|
||||
trap -- 'rm -f "$TMPFILE"' EXIT
|
||||
TMPFILE=$(mktemp ${TMPDIR:-/tmp}/textonly.XXXXXX)
|
||||
cat > "$TMPFILE"
|
||||
else
|
||||
TMPFILE="$6"
|
||||
fi
|
||||
|
||||
PR=${5#*page-ranges=}
|
||||
# Do options specify page-ranges?
|
||||
if [[ "$PR" != "$5" ]]; then
|
||||
PR=${PR%% *}
|
||||
else
|
||||
#unset PR
|
||||
PR=1-999999
|
||||
fi
|
||||
|
||||
if [[ "$PR" ]]; then
|
||||
TMPFILE2=$(mktemp ${TMPDIR:-/tmp}/textonly2.XXXXXX)
|
||||
pagenum=0
|
||||
EOF=
|
||||
{
|
||||
while [[ "$PR" ]]; do
|
||||
pl=${PR%%,*} ;# take first subrange
|
||||
PR=${PR#$pl};PR=${PR#,} ;# remove from range list
|
||||
pu=${pl#*-} ;# extract upper and lower
|
||||
pl=${pl%-*} ;# pages of subrange
|
||||
# Allows interpreting 0-5,3-10 as 1-5,6-10 rejects 5-1 or 1-
|
||||
(( pagenum >= pl )) && pl=$(( pagenum + 1 ))
|
||||
(( pl > pu )) && continue
|
||||
|
||||
# Loop reading pages until at or over lower page of subrange.
|
||||
while read -d `echo -ne '\f'` -r; do
|
||||
(( pagenum++ ))
|
||||
(( pagenum == pl )) && break
|
||||
done
|
||||
# Did we reach lower page of subrange or EOF?
|
||||
if (( pagenum < pl )); then
|
||||
[[ ! "$REPLY" ]] && break ;# empty last page - we're done.
|
||||
(( pagenum++ ))
|
||||
EOF=y
|
||||
fi
|
||||
# Output page and report to page log
|
||||
if (( pagenum == pl )); then
|
||||
echo -n "${REPLY}" >>"$TMPFILE2"
|
||||
# If EOF then page has no final FF
|
||||
[[ ! "$EOF" ]] && echo -ne '\f' >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
fi
|
||||
[[ "$EOF" ]] && break
|
||||
# Is the current subrange a single page?
|
||||
(( pagenum == pu )) && continue
|
||||
while read -d `echo -ne '\f'` -r; do
|
||||
(( pagenum++ ))
|
||||
echo -ne "${REPLY}\f" >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
(( pagenum == pu )) && break
|
||||
done
|
||||
# Could be that we reached EOF before page boundry
|
||||
if (( pagenum < pu )); then
|
||||
if [[ "$REPLY" ]]; then
|
||||
(( pagenum++ ))
|
||||
echo -n "${REPLY}" >>"$TMPFILE2"
|
||||
echo "PAGE: $pagenum $COPIES" >&2
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
} <"$TMPFILE"
|
||||
else
|
||||
TMPFILE2="$TMPFILE"
|
||||
pc=$(grep -co `echo -ne '\f'` "$TMPFILE2")
|
||||
pc=$(( pc * $COPIES ))
|
||||
echo "PAGE: $pc" >&2
|
||||
fi
|
||||
|
||||
while [ "$COPIES" -gt 0 ]; do
|
||||
# Just translate LF->CRLF at the moment, until the PPD has options added.
|
||||
sed -e 's/$/'`echo -ne '\r'`'/g' "$TMPFILE2"
|
||||
|
||||
if [ "$SENDFF" == "True" ]
|
||||
then
|
||||
echo -ne '\f'
|
||||
fi
|
||||
|
||||
COPIES=$(($COPIES - 1))
|
||||
done
|
||||
# Cleanup
|
||||
[[ "$TMPFILE" != "$TMPFILE2" ]] && rm -f "$TMPFILE2"
|
||||
exit 0
|
47
textonly.ppd
47
textonly.ppd
@ -1,47 +0,0 @@
|
||||
*PPD-Adobe: "4.3"
|
||||
*%
|
||||
*% Text-only printer definition
|
||||
*%
|
||||
*FormatVersion: "4.3"
|
||||
*FileVersion: "1.1"
|
||||
*LanguageVersion: English
|
||||
*LanguageEncoding: ISOLatin1
|
||||
*PCFileName: "TEXTONLY.PPD"
|
||||
*Manufacturer: "Generic"
|
||||
*Product: "(Generic)"
|
||||
*cupsVersion: 1.0
|
||||
*cupsManualCopies: True
|
||||
*cupsModelNumber: 2
|
||||
*cupsFilter: "text/plain 0 textonly"
|
||||
*ModelName: "Generic text-only printer"
|
||||
*ShortNickName: "Generic text-only printer"
|
||||
*NickName: "Generic text-only printer"
|
||||
*PSVersion: "(2017.000) 0"
|
||||
*LanguageLevel: "2"
|
||||
*ColorDevice: False
|
||||
*DefaultColorSpace: Gray
|
||||
*FileSystem: False
|
||||
*Throughput: "8"
|
||||
*LandscapeOrientation: Plus90
|
||||
*VariablePaperSize: False
|
||||
*TTRasterizer: Type42
|
||||
*DefaultImageableArea: Letter
|
||||
*ImageableArea Letter/US Letter: "18 36 594 756"
|
||||
*DefaultPaperDimension: Letter
|
||||
*PaperDimension Letter/Letter: "612 792"
|
||||
*OpenUI *PageSize/Media Size: PickOne
|
||||
*OrderDependency: 10 AnySetup *PageSize
|
||||
*DefaultPageSize: Letter
|
||||
*PageSize Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
|
||||
*CloseUI: *PageSize
|
||||
*OpenUI *PageRegion: PickOne
|
||||
*OrderDependency: 10 AnySetup *PageRegion
|
||||
*DefaultPageRegion: Letter
|
||||
*PageRegion Letter/Letter: "<</PageSize[612 792]/ImagingBBox null>>setpagedevice"
|
||||
*CloseUI: *PageRegion
|
||||
|
||||
*OpenUI *SendFF: Boolean
|
||||
*DefaultSendFF: False
|
||||
*SendFF True/True: ""
|
||||
*SendFF False/False: ""
|
||||
*CloseUI: *SendFF
|
Loading…
Reference in New Issue
Block a user