Major update to cups-1.4.3.

Changelog is to big to detail here, refer to HOMEPAGE for details.

I have been using 1.4.X for several months.
Versions 1.4.0 and 1.4.2 have been tested in bulks by jasper@, thanks!

Please contact me directly if you see regressions.
This commit is contained in:
ajacoutot 2010-03-31 16:20:02 +00:00
parent ae8ce23957
commit d1ea956b94
39 changed files with 1884 additions and 1590 deletions

View File

@ -1,20 +1,24 @@
# $OpenBSD: Makefile,v 1.68 2010/03/29 13:11:42 sthen Exp $
# $OpenBSD: Makefile,v 1.69 2010/03/31 16:20:02 ajacoutot Exp $
COMMENT= Common Unix Printing System
COMMENT= Common Unix Printing System
VERSION= 1.3.11
DISTNAME= cups-${VERSION}-source
PKGNAME= cups-${VERSION}p7
VERSION= 1.4.3
DISTNAME= cups-${VERSION}-source
PKGNAME= cups-${VERSION}
CATEGORIES= print sysutils
CATEGORIES= print sysutils
SHARED_LIBS+= cups 4.0
# XXX ghostscript needs to dlopen() libcupsimage.so.3
SHARED_LIBS+= cupsimage 3.0
# XXX ghostscript needs to dlopen() libcupsimage.so.4
SHARED_LIBS+= cupsimage 4.0
SHARED_LIBS+= cups 5.0
SHARED_LIBS+= cupscgi 0.0
SHARED_LIBS+= cupsdriver 0.0
SHARED_LIBS+= cupsmime 0.0
SHARED_LIBS+= cupsppdc 0.0
HOMEPAGE= http://www.cups.org/
HOMEPAGE= http://www.cups.org/
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>
# GPLv2 - LGPLv2
PERMIT_PACKAGE_CDROM= Yes
@ -22,79 +26,85 @@ PERMIT_PACKAGE_FTP= Yes
PERMIT_DISTFILES_CDROM= Yes
PERMIT_DISTFILES_FTP= Yes
WANTLIB += asn1 c crypto gssapi jpeg krb5 m pthread ssl z
WANTLIB += asn1 c crypto dbus-1 gssapi jpeg krb5 m pthread ssl
WANTLIB += stdc++ z
MASTER_SITES= http://ftp.easysw.com/pub/cups/${VERSION}/ \
http://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp2.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp3.easysw.com/pub/cups/${VERSION}/
MASTER_SITES= http://ftp.easysw.com/pub/cups/${VERSION}/ \
http://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp.funet.fi/pub/mirrors/ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp2.easysw.com/pub/cups/${VERSION}/ \
ftp://ftp3.easysw.com/pub/cups/${VERSION}/
EXTRACT_SUFX= .tar.bz2
EXTRACT_SUFX= .tar.bz2
RUN_DEPENDS= :desktop-file-utils-*:devel/desktop-file-utils \
::devel/xdg-utils
LIB_DEPENDS= png.>=3::graphics/png \
tiff.>=35::graphics/tiff \
dbus-1.>=7::x11/dbus \
dns_sd::net/avahi
WRKDIST= ${WRKDIR}/${DISTNAME:S/-source//}
FAKE_FLAGS= BINMODE=${BINMODE} \
SHAREMODE=${SHAREMODE} \
ICONDIR=${DESTDIR}${PREFIX}/share/icons \
MENUDIR=${DESTDIR}${PREFIX}/share/applications \
DBUSDIR=${WRKINST}/${TRUEPREFIX}/share/examples/cups/dbus-1/system.d \
PDFTOPS="pdftops"
BUILD_DEPENDS= ::devel/xdg-utils \
${MODGNU_AUTOMAKE_DEPENDS} \
${MODGNU_AUTOCONF_DEPENDS}
MAKE_ENV+= LIBcups_VERSION=${LIBcups_VERSION} \
LIBcupsimage_VERSION=${LIBcupsimage_VERSION}
RUN_DEPENDS= :desktop-file-utils-*:devel/desktop-file-utils \
::devel/xdg-utils
# UTF8 desktop file patch
DIFF_ARGS= -a
LIB_DEPENDS= png.>=3::graphics/png \
tiff.>=35::graphics/tiff \
avahi-client,avahi-common::net/avahi
CONFIGURE_STYLE= gnu dest
AUTOCONF_VERSION= 2.59
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
--with-cups-user=_cups \
--with-cups-group=_cups \
--with-system-groups=wheel \
--localstatedir=/var \
--without-java \
--with-perl="/usr/bin/perl" \
--with-optim="${CFLAGS}" \
--without-php \
--without-python \
--enable-image \
--enable-dbus \
--enable-raw-printing \
--enable-gssapi \
--enable-dnssd \
--disable-pap \
--disable-ldap \
--disable-slp \
--disable-default-shared \
--disable-pdftops \
--disable-gnutls
LIBS_ENV= LIBcups_VERSION=${LIBcups_VERSION} \
LIBcupscgi_VERSION=${LIBcupscgi_VERSION} \
LIBcupsdriver_VERSION=${LIBcupsdriver_VERSION} \
LIBcupsimage_VERSION=${LIBcupsimage_VERSION} \
LIBcupsmime_VERSION=${LIBcupsmime_VERSION} \
LIBcupsppdc_VERSION=${LIBcupsppdc_VERSION} \
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include \
-I${LOCALBASE}/include/libpng \
-I${LOCALBASE}/include/avahi-compat-libdns_sd" \
DSOFLAGS="-L${LOCALBASE}/lib" \
LDFLAGS="-L${LOCALBASE}/lib -pthread" \
LIBcups_VERSION=${LIBcups_VERSION} \
LIBcupsimage_VERSION=${LIBcupsimage_VERSION} \
ac_cv_path_CUPS_GHOSTSCRIPT="${LOCALBASE}/bin/gs"
MAKE_ENV= ${LIBS_ENV}
CFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/libpng
FAKE_FLAGS= BINMODE=${BINMODE} \
SHAREMODE=${SHAREMODE} \
DBUSDIR=${DESTDIR}${PREFIX}/share/examples/cups/dbus-1/system.d \
ICONDIR=${DESTDIR}${PREFIX}/share/icons \
MENUDIR=${DESTDIR}${PREFIX}/share/applications
WRKDIST= ${WRKDIR}/${DISTNAME:S/-source//}
USE_GMAKE= Yes
AUTOCONF_VERSION= 2.62
AUTOMAKE_VERSION= 1.9
REGRESS_FLAGS= LOCALBASE=${LOCALBASE}
USE_GMAKE= Yes
REGRESS_DEPENDS= ::print/htmldoc
REGRESS_IS_INTERACTIVE= Yes
CONFIGURE_STYLE= gnu dest
CONFIGURE_ARGS= ${CONFIGURE_SHARED} \
--enable-static \
--with-cups-user=_cups \
--with-cups-group=_cups \
--with-system-groups=wheel \
--localstatedir=/var \
--without-java \
--with-perl="/usr/bin/perl" \
--with-optim="${CFLAGS}" \
--with-smbconfigfile="samba:///${SYSCONFDIR}/samba/smb.conf" \
--with-pdftops="${LOCALBASE}/bin/gs" \
--without-php \
--without-python \
--enable-avahi \
--enable-image \
--enable-tcp-wrappers \
--enable-dbus \
--enable-texttops \
--enable-raw-printing \
--enable-gssapi \
--enable-openssl \
--disable-gnutls \
--disable-libusb \
--disable-pam \
--disable-launchd \
--disable-pap \
--disable-slp \
--disable-default-shared
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include \
-I${LOCALBASE}/include/libpng" \
LDFLAGS="-L${LOCALBASE}/lib -pthread" \
${LIBS_ENV}
# gcc 3.3.5 internal compiler error
.if ${MACHINE_ARCH:Mmips64*}
@ -105,27 +115,28 @@ FLAVORS= ldap
FLAVOR?=
.if ${FLAVOR:L:Mldap}
CONFIGURE_ARGS+= --enable-ldap
LIB_DEPENDS+= ldap,lber::databases/openldap
CONFIGURE_ARGS+= --enable-ldap
LIB_DEPENDS+= ldap,lber::databases/openldap
.else
CONFIGURE_ARGS+= --disable-ldap
CONFIGURE_ARGS+=--disable-ldap
.endif
post-extract:
${INSTALL} -m 555 ${FILESDIR}/krb5-config ${WRKDIR}/bin
pre-configure:
cd ${WRKSRC} && AUTOMAKE_VERSION=${AUTOMAKE_VERSION} aclocal -I config-scripts
cd ${WRKSRC} && AUTOCONF_VERSION=${AUTOCONF_VERSION} autoconf -I config-scripts
post-configure:
cd ${WRKBUILD} && perl -pi -e 's|\$${DESTDIR}||g' init/cups.sh \
config.h cups-config conf/cupsd.conf man/*.man
${SUBST_CMD} ${WRKSRC}/Makefile
cd ${WRKBUILD} && perl -pi -e 's|\$${DESTDIR}||g' \
config.h cups-config man/*.man
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cups/init
cd ${WRKINST}${SYSCONFDIR}/cups && cp -R * \
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/cups/
cd ${WRKINST}${SYSCONFDIR}/cups/ && mv * \
${PREFIX}/share/examples/cups
rm -r ${WRKINST}${SYSCONFDIR}/cups ${WRKINST}/var/run \
${WRKINST}/var/cache
${INSTALL_DATA} ${WRKBUILD}/init/cups.sh ${PREFIX}/share/cups/init
@rmdir ${WRKINST}${SYSCONFDIR}/cups/
.for file in cups-enable cups-disable
cp ${FILESDIR}/${file} ${WRKBUILD}
${SUBST_CMD} ${WRKBUILD}/${file}

View File

@ -1,5 +1,5 @@
MD5 (cups-1.3.11-source.tar.bz2) = I7M0rBoj7BaTDlzW8JI7sg==
RMD160 (cups-1.3.11-source.tar.bz2) = oGRvK6KfvTnSEepcP9vSSgD2ang=
SHA1 (cups-1.3.11-source.tar.bz2) = 31z7ZPtgj8EorK3eZw3DCvSb2xg=
SHA256 (cups-1.3.11-source.tar.bz2) = XjEP0yShX64eHJchh59clI14jgRzWlJjpAxhRv/2B7g=
SIZE (cups-1.3.11-source.tar.bz2) = 3799393
MD5 (cups-1.4.3-source.tar.bz2) = 5wscP2AUPXMQwddMERohqw==
RMD160 (cups-1.4.3-source.tar.bz2) = bFqygkBdahEyFjxydYPzpXIwfYg=
SHA1 (cups-1.4.3-source.tar.bz2) = Ddnj1wlhTSbM53couSY1VslMlVk=
SHA256 (cups-1.4.3-source.tar.bz2) = R6VZscUBkrlEea59qxMuoACHJwRdSZNQHPCm3wxk25c=
SIZE (cups-1.4.3-source.tar.bz2) = 4461101

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: cups-disable,v 1.2 2009/04/27 08:25:39 bernd Exp $
# $OpenBSD: cups-disable,v 1.3 2010/03/31 16:20:02 ajacoutot Exp $
#
# this script disables CUPS by removing links created by
# cups-enable.
@ -91,9 +91,11 @@ else
/usr/bin/lprm \
/usr/sbin/lpc \
/usr/sbin/lpd \
/usr/sbin/lptest \
/usr/share/man/cat1/lpq.0 \
/usr/share/man/cat1/lpr.0 \
/usr/share/man/cat1/lprm.0 \
/usr/share/man/cat1/lptest.0 \
/usr/share/man/cat8/lpc.0 \
/usr/share/man/cat8/lpd.0 \
/etc/printcap

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# $OpenBSD: cups-enable,v 1.2 2009/04/27 08:25:39 bernd Exp $
# $OpenBSD: cups-enable,v 1.3 2010/03/31 16:20:02 ajacoutot Exp $
#
# this script replaces OpenBSD lpd files with the corresponding
# files from CUPS.
@ -27,7 +27,7 @@ if [ X$answer != Xy ]; then
fi
######################################################################
if [ -e /usr/sbin/lpd.pre-cups ]; then
if [ -e /usr/sbin/lpd.pre-cups -a ! -f /usr/sbin/lpd -a -L /usr/sbin/lpc ]; then
echo "lpd already preserved, not saving old files."
echo ""
elif [ ! -e /usr/sbin/lpd ]; then
@ -42,21 +42,23 @@ else
/usr/bin/lprm \
/usr/sbin/lpc \
/usr/sbin/lpd \
/usr/sbin/lptest \
/usr/share/man/cat1/lpq.0 \
/usr/share/man/cat1/lpr.0 \
/usr/share/man/cat1/lprm.0 \
/usr/share/man/cat1/lptest.0 \
/usr/share/man/cat8/lpc.0 \
/usr/share/man/cat8/lpd.0
/usr/share/man/cat8/lpd.0
do
if [ -f $file ]; then
if [ -f $file -a ! -L $file ]; then
echo " $file"
mv -f $file $file.pre-cups
fi
done
if [ -f /etc/printcap ]; then
echo " /etc/printcap"
cp -f /etc/printcap /etc/printcap.pre-cups
if [ -f /etc/printcap -a ! -f /etc/printcap.pre-cups ]; then
echo " /etc/printcap"
cp -f /etc/printcap /etc/printcap.pre-cups
fi
echo done.

View File

@ -1,41 +0,0 @@
#!/bin/sh
usage()
{
cat <<EOF
Usage: libgnutls-config [OPTIONS]
Options:
[--version]
[--libs]
[--cflags]
EOF
exit $1
}
if test $# -eq 0; then
usage 1 1>&2
fi
while test $# -gt 0; do
case "$1" in
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case $1 in
--version)
echo "`pkg-config --modversion gnutls`"
exit 0
;;
--cflags)
echo "`pkg-config --cflags gnutls`"
;;
--libs)
echo "`pkg-config --libs gnutls`"
;;
*)
usage 1 1>&2
;;
esac
shift
done

View File

@ -1,59 +1,31 @@
$OpenBSD: patch-Makedefs_in,v 1.3 2009/04/27 08:25:39 bernd Exp $
--- Makedefs.in.orig Tue Jan 22 23:37:21 2008
+++ Makedefs.in Tue Mar 17 16:56:19 2009
@@ -40,13 +40,13 @@ STRIP = @STRIP@
$OpenBSD: patch-Makedefs_in,v 1.4 2010/03/31 16:20:02 ajacoutot Exp $
--- Makedefs.in.orig Wed May 27 01:27:06 2009
+++ Makedefs.in Mon Aug 31 10:29:45 2009
@@ -41,13 +41,13 @@ SHELL = /bin/sh
# Installation programs...
#
-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755
+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m $(BINMODE)
INSTALL_CONFIG = $(INSTALL) -m @CUPS_CONFIG_FILE_PERM@
-INSTALL_DATA = $(INSTALL) -m 644
+INSTALL_DATA = $(INSTALL) -m $(SHAREMODE)
-INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
+INSTALL_BIN = $(LIBTOOL) $(INSTALL) -c -m $(BINMODE) @INSTALL_STRIP@
INSTALL_CONFIG = $(INSTALL) -c -m @CUPS_CONFIG_FILE_PERM@
-INSTALL_DATA = $(INSTALL) -c -m 444
+INSTALL_DATA = $(INSTALL) -c -m $(SHAREMODE)
INSTALL_DIR = $(INSTALL) -d
-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755
-INSTALL_MAN = $(INSTALL) -m 644
-INSTALL_SCRIPT = $(INSTALL) -m 755
+INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m $(BINMODE)
+INSTALL_MAN = $(INSTALL) -m $(SHAREMODE)
+INSTALL_SCRIPT = $(INSTALL) -m $(BINMODE)
-INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m 555 @INSTALL_STRIP@
-INSTALL_MAN = $(INSTALL) -c -m 444
-INSTALL_SCRIPT = $(INSTALL) -c -m 555
+INSTALL_LIB = $(LIBTOOL) $(INSTALL) -c -m $(BINMODE) @INSTALL_STRIP@
+INSTALL_MAN = $(INSTALL) -c -m $(SHAREMODE)
+INSTALL_SCRIPT = $(INSTALL) -c -m $(BINMODE)
#
# Default user, group, and system groups for the scheduler...
@@ -206,8 +206,8 @@ DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
ICONDIR = @ICONDIR@
INCLUDEDIR = $(BUILDROOT)$(includedir)
-INITDIR = @INITDIR@
-INITDDIR = @INITDDIR@
+INITDIR =
+INITDDIR =
LIBDIR = $(BUILDROOT)$(libdir)
LOCALEDIR = $(BUILDROOT)@CUPS_LOCALEDIR@
LOGDIR = $(BUILDROOT)@CUPS_LOGDIR@
@@ -222,7 +222,7 @@ SBINDIR = $(BUILDROOT)@sbindir@
SERVERBIN = $(BUILDROOT)@CUPS_SERVERBIN@
SERVERROOT = $(BUILDROOT)@CUPS_SERVERROOT@
STATEDIR = $(BUILDROOT)@CUPS_STATEDIR@
-XINETD = @XINETD@
+XINETD =
MAN1EXT = @MAN1EXT@
MAN5EXT = @MAN5EXT@
@@ -234,14 +234,14 @@ PAMDIR = @PAMDIR@
PAMFILE = @PAMFILE@
DEFAULT_LAUNCHD_CONF = @DEFAULT_LAUNCHD_CONF@
-DBUSDIR = @DBUSDIR@
+DBUSDIR =
#
@@ -258,7 +258,7 @@ DBUSDIR = @DBUSDIR@
# Rules...
#
-.SILENT:
+#.SILENT:
.SUFFIXES: .1 .1.gz .1m .1m.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .32.o .64.o .gz
.SUFFIXES: .1 .1.gz .1m .1m.gz .3 .3.gz .5 .5.gz .7 .7.gz .8 .8.gz .a .c .cxx .h .man .o .32.o .64.o .gz
.c.o:

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-backend_betest_c,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- backend/betest.c.orig Sat Jul 12 00:48:49 2008
+++ backend/betest.c Tue Mar 17 16:21:49 2009
@@ -67,7 +67,7 @@ main(int argc, /* I - Number of command-line argumen
*/
execl(backend, argv[1], argv[2], argv[3], argv[4], argv[5], argv[6], argv[7],
- NULL);
+ (char *) 0);
return (1);
}

View File

@ -0,0 +1,804 @@
$OpenBSD: patch-backend_dnssd_c,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
Avahi support, from Fedora.
--- backend/dnssd.c.orig Sat Aug 8 00:27:12 2009
+++ backend/dnssd.c Thu Dec 10 15:48:31 2009
@@ -22,6 +22,7 @@
* exec_backend() - Execute the backend that corresponds to the
* resolved service name.
* get_device() - Create or update a device.
+* find_device()
* query_callback() - Process query data.
* sigterm_handler() - Handle termination signals...
* unquote() - Unquote a name string.
@@ -33,7 +34,18 @@
#include "backend-private.h"
#include <cups/array.h>
-#include <dns_sd.h>
+#ifdef HAVE_DNSSD
+# include <dns_sd.h>
+#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+# include <avahi-client/client.h>
+# include <avahi-client/lookup.h>
+# include <avahi-common/simple-watch.h>
+# include <avahi-common/domain.h>
+# include <avahi-common/error.h>
+# include <avahi-common/malloc.h>
+#define kDNSServiceMaxDomainName AVAHI_DOMAIN_NAME_MAX
+#endif /* HAVE_AVAHI */
/*
@@ -52,7 +64,12 @@ typedef enum
typedef struct
{
+#ifdef HAVE_DNSSD
DNSServiceRef ref; /* Service reference for resolve */
+#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+ int resolved; /* Did we resolve the device? */
+#endif /* HAVE_AVAHI */
char *name, /* Service name */
*domain, /* Domain name */
*fullName, /* Full name */
@@ -64,7 +81,21 @@ typedef struct
sent; /* Did we list the device? */
} cups_device_t;
+typedef struct
+{
+ char key[256];
+ char value[256];
+#ifdef HAVE_DNSSD
+ const uint8_t *data;
+ const uint8_t *datanext;
+ const uint8_t *dataend;
+#else /* HAVE_AVAHI */
+ AvahiStringList *txt;
+#endif /* HAVE_DNSSD */
+} cups_txt_records_t;
+
+
/*
* Local globals...
*/
@@ -77,6 +108,7 @@ static int job_canceled = 0;
* Local functions...
*/
+#ifdef HAVE_DNSSD
static void browse_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -92,12 +124,6 @@ static void browse_local_callback(DNSServiceRef sdRef
const char *regtype,
const char *replyDomain,
void *context);
-static int compare_devices(cups_device_t *a, cups_device_t *b);
-static void exec_backend(char **argv);
-static cups_device_t *get_device(cups_array_t *devices,
- const char *serviceName,
- const char *regtype,
- const char *replyDomain);
static void query_callback(DNSServiceRef sdRef,
DNSServiceFlags flags,
uint32_t interfaceIndex,
@@ -106,11 +132,113 @@ static void query_callback(DNSServiceRef sdRef,
uint16_t rrclass, uint16_t rdlen,
const void *rdata, uint32_t ttl,
void *context);
+#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+static void avahi_client_callback (AvahiClient *client,
+ AvahiClientState state,
+ void *context);
+static void avahi_browse_callback (AvahiServiceBrowser *browser,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiBrowserEvent event,
+ const char *serviceName,
+ const char *regtype,
+ const char *replyDomain,
+ AvahiLookupResultFlags flags,
+ void *context);
+#endif /* HAVE_AVAHI */
+
+static cups_device_t * find_device (cups_array_t *devices,
+ cups_txt_records_t *txt,
+ cups_device_t *dkey);
+static int compare_devices(cups_device_t *a, cups_device_t *b);
+static void exec_backend(char **argv);
+static cups_device_t *get_device(cups_array_t *devices,
+ const char *serviceName,
+ const char *regtype,
+ const char *replyDomain);
static void sigterm_handler(int sig);
static void unquote(char *dst, const char *src, size_t dstsize);
+#ifdef HAVE_AVAHI
+static AvahiSimplePoll *simple_poll = NULL;
+static int avahi_got_callback;
+#endif /* HAVE_AVAHI */
+
/*
+ * cups_txt_records_t access functions
+ */
+static cups_txt_records_t *
+next_txt_record (cups_txt_records_t *txt)
+{
+#ifdef HAVE_DNSSD
+ txt->data = txt->datanext;
+#else /* HAVE_AVAHI */
+ txt->txt = avahi_string_list_get_next (txt->txt);
+ if (txt->txt == NULL)
+ return NULL;
+#endif /* HAVE_DNSSD */
+
+ return txt;
+}
+
+static int
+parse_txt_record_pair (cups_txt_records_t *txt)
+{
+#ifdef HAVE_DNSSD
+ uint8_t datalen;
+ uint8_t *data = txt->data;
+ char *ptr;
+
+ /*
+ * Read a key/value pair starting with an 8-bit length. Since the
+ * length is 8 bits and the size of the key/value buffers is 256, we
+ * don't need to check for overflow...
+ */
+
+ datalen = *data++;
+ if (!datalen || (data + datalen) >= txt->dataend)
+ return NULL;
+ txt->datanext = data + datalen;
+
+ for (ptr = txt->key; data < txt->datanext && *data != '='; data ++)
+ *ptr++ = *data;
+ *ptr = '\0';
+
+ if (data < txt->datanext && *data == '=')
+ {
+ data++;
+
+ if (data < datanext)
+ memcpy (txt->value, data, txt->datanext - data);
+ value[txt->datanext - data] = '\0';
+ }
+ else
+ return 1;
+#else /* HAVE_AVAHI */
+ char *key, *value;
+ size_t len;
+ avahi_string_list_get_pair (txt->txt, &key, &value, &len);
+ if (len > sizeof (txt->value) - 1)
+ len = sizeof (txt->value) - 1;
+
+ memcpy (txt->value, value, len);
+ txt->value[len] = '\0';
+ len = strlen (key);
+ if (len > sizeof (txt->key) - 1)
+ len = sizeof (txt->key) - 1;
+
+ memcpy (txt->key, key, len);
+ txt->key[len] = '\0';
+ avahi_free (key);
+ avahi_free (value);
+#endif /* HAVE_AVAHI */
+
+ return 0;
+}
+
+/*
* 'main()' - Browse for printers.
*/
@@ -119,6 +247,13 @@ main(int argc, /* I - Number of command-line args
char *argv[]) /* I - Command-line arguments */
{
const char *name; /* Backend name */
+ cups_array_t *devices; /* Device array */
+ cups_device_t *device; /* Current device */
+ char uriName[1024]; /* Unquoted fullName for URI */
+#ifdef HAVE_DNSSD
+ int fd; /* Main file descriptor */
+ fd_set input; /* Input set for select() */
+ struct timeval timeout; /* Timeout for select() */
DNSServiceRef main_ref, /* Main service reference */
fax_ipp_ref, /* IPP fax service reference */
ipp_ref, /* IPP service reference */
@@ -130,12 +265,11 @@ main(int argc, /* I - Number of command-line args
pdl_datastream_ref, /* AppSocket service reference */
printer_ref, /* LPD service reference */
riousbprint_ref; /* Remote IO service reference */
- int fd; /* Main file descriptor */
- fd_set input; /* Input set for select() */
- struct timeval timeout; /* Timeout for select() */
- cups_array_t *devices; /* Device array */
- cups_device_t *device; /* Current device */
- char uriName[1024]; /* Unquoted fullName for URI */
+#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+ AvahiClient *client;
+ int error;
+#endif /* HAVE_AVAHI */
#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
struct sigaction action; /* Actions for POSIX signals */
#endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -194,6 +328,49 @@ main(int argc, /* I - Number of command-line args
* Browse for different kinds of printers...
*/
+#ifdef HAVE_AVAHI
+ if ((simple_poll = avahi_simple_poll_new ()) == NULL)
+ {
+ perror ("ERROR: Unable to create avahi simple poll object");
+ return (1);
+ }
+
+ client = avahi_client_new (avahi_simple_poll_get (simple_poll),
+ 0, avahi_client_callback, NULL, &error);
+ if (!client)
+ {
+ perror ("ERROR: Unable to create avahi client");
+ return (1);
+ }
+
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_fax-ipp._tcp", NULL, 0,
+ avahi_browse_callback, devices);
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_ipp._tcp", NULL, 0,
+ avahi_browse_callback, devices);
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_ipp-tls._tcp", NULL, 0,
+ avahi_browse_callback, devices);
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_pdl-datastream._tcp",
+ NULL, 0,
+ avahi_browse_callback,
+ devices);
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_printer._tcp", NULL, 0,
+ avahi_browse_callback, devices);
+ avahi_service_browser_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC,
+ "_riousbprint._tcp", NULL, 0,
+ avahi_browse_callback, devices);
+#endif /* HAVE_AVAHI */
+#ifdef HAVE_DNSSD
if (DNSServiceCreateConnection(&main_ref) != kDNSServiceErr_NoError)
{
perror("ERROR: Unable to create service connection");
@@ -245,6 +422,7 @@ main(int argc, /* I - Number of command-line args
riousbprint_ref = main_ref;
DNSServiceBrowse(&riousbprint_ref, kDNSServiceFlagsShareConnection, 0,
"_riousbprint._tcp", NULL, browse_callback, devices);
+#endif /* HAVE_DNSSD */
/*
* Loop until we are killed...
@@ -252,6 +430,9 @@ main(int argc, /* I - Number of command-line args
while (!job_canceled)
{
+ int announce = 0;
+
+#ifdef HAVE_DNSSD
FD_ZERO(&input);
FD_SET(fd, &input);
@@ -271,11 +452,35 @@ main(int argc, /* I - Number of command-line args
}
else
{
+ announce = 1;
+ }
+#else /* HAVE_AVAHI */
+ int r;
+ avahi_got_callback = 0;
+ r = avahi_simple_poll_iterate (simple_poll, 1);
+ if (r != 0 && r != EINTR)
+ {
/*
+ * We've been told to exit the loop. Perhaps the connection to
+ * avahi failed.
+ */
+
+ break;
+ }
+
+ if (avahi_got_callback)
+ announce = 1;
+#endif /* HAVE_DNSSD */
+
+ if (announce)
+ {
+ /*
* Announce any devices we've found...
*/
+#ifdef HAVE_DNSSD
DNSServiceErrorType status; /* DNS query status */
+#endif /* HAVE_DNSSD */
cups_device_t *best; /* Best matching device */
char device_uri[1024]; /* Device URI */
int count; /* Number of queries */
@@ -285,6 +490,7 @@ main(int argc, /* I - Number of command-line args
best = NULL, count = 0;
device;
device = (cups_device_t *)cupsArrayNext(devices))
+#ifdef HAVE_DNSSD
if (!device->ref && !device->sent)
{
/*
@@ -313,14 +519,23 @@ main(int argc, /* I - Number of command-line args
count ++;
}
}
- else if (!device->sent)
+ else
+#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+ if (!device->resolved)
+ continue;
+ else
+#endif /* HAVE_AVAHI */
+ if (!device->sent)
{
+#ifdef HAVE_DNSSD
/*
* Got the TXT records, now report the device...
*/
DNSServiceRefDeallocate(device->ref);
device->ref = 0;
+#endif /* HAVE_DNSSD */
if (!best)
best = device;
@@ -372,6 +587,7 @@ main(int argc, /* I - Number of command-line args
* 'browse_callback()' - Browse devices.
*/
+#ifdef HAVE_DNSSD
static void
browse_callback(
DNSServiceRef sdRef, /* I - Service reference */
@@ -405,12 +621,14 @@ browse_callback(
get_device((cups_array_t *)context, serviceName, regtype, replyDomain);
}
+#endif /* HAVE_DNSSD */
/*
* 'browse_local_callback()' - Browse local devices.
*/
+#ifdef HAVE_DNSSD
static void
browse_local_callback(
DNSServiceRef sdRef, /* I - Service reference */
@@ -456,6 +674,7 @@ browse_local_callback(
device->fullName);
device->sent = 1;
}
+#endif /* HAVE_DNSSD */
/*
@@ -528,7 +747,33 @@ exec_backend(char **argv) /* I - Command-line argumen
exit(CUPS_BACKEND_STOP);
}
+static int
+device_type (const char *regtype)
+{
+#ifdef HAVE_AVAHI
+ if (!strcmp(regtype, "_ipp._tcp") ||
+ !strcmp(regtype, "_ipp-tls._tcp"))
+ return (CUPS_DEVICE_IPP);
+ else if (!strcmp(regtype, "_fax-ipp._tcp"))
+ return (CUPS_DEVICE_FAX_IPP);
+ else if (!strcmp(regtype, "_printer._tcp"))
+ return (CUPS_DEVICE_PDL_DATASTREAM);
+#else
+ if (!strcmp(regtype, "_ipp._tcp.") ||
+ !strcmp(regtype, "_ipp-tls._tcp."))
+ return (CUPS_DEVICE_IPP);
+ else if (!strcmp(regtype, "_fax-ipp._tcp."))
+ return (CUPS_DEVICE_FAX_IPP);
+ else if (!strcmp(regtype, "_printer._tcp."))
+ return (CUPS_DEVICE_PRINTER);
+ else if (!strcmp(regtype, "_pdl-datastream._tcp."))
+ return (CUPS_DEVICE_PDL_DATASTREAM);
+#endif /* HAVE_AVAHI */
+ return (CUPS_DEVICE_RIOUSBPRINT);
+}
+
+
/*
* 'get_device()' - Create or update a device.
*/
@@ -550,19 +795,8 @@ get_device(cups_array_t *devices, /* I - Device array
*/
key.name = (char *)serviceName;
+ key.type = device_type (regtype);
- if (!strcmp(regtype, "_ipp._tcp.") ||
- !strcmp(regtype, "_ipp-tls._tcp."))
- key.type = CUPS_DEVICE_IPP;
- else if (!strcmp(regtype, "_fax-ipp._tcp."))
- key.type = CUPS_DEVICE_FAX_IPP;
- else if (!strcmp(regtype, "_printer._tcp."))
- key.type = CUPS_DEVICE_PRINTER;
- else if (!strcmp(regtype, "_pdl-datastream._tcp."))
- key.type = CUPS_DEVICE_PDL_DATASTREAM;
- else
- key.type = CUPS_DEVICE_RIOUSBPRINT;
-
for (device = cupsArrayFind(devices, &key);
device;
device = cupsArrayNext(devices))
@@ -581,8 +815,14 @@ get_device(cups_array_t *devices, /* I - Device array
free(device->domain);
device->domain = strdup(replyDomain);
+#ifdef HAVE_DNSSD
DNSServiceConstructFullName(fullName, device->name, regtype,
replyDomain);
+#else /* HAVE_AVAHI */
+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName,
+ serviceName, regtype, replyDomain);
+#endif /* HAVE_DNSSD */
+
free(device->fullName);
device->fullName = strdup(fullName);
}
@@ -602,6 +842,9 @@ get_device(cups_array_t *devices, /* I - Device array
device->domain = strdup(replyDomain);
device->type = key.type;
device->priority = 50;
+#ifdef HAVE_AVAHI
+ device->resolved = 0;
+#endif /* HAVE_AVAHI */
cupsArrayAdd(devices, device);
@@ -609,7 +852,13 @@ get_device(cups_array_t *devices, /* I - Device array
* Set the "full name" of this service, which is used for queries...
*/
+#ifdef HAVE_DNSSD
DNSServiceConstructFullName(fullName, serviceName, regtype, replyDomain);
+#else /* HAVE_AVAHI */
+ avahi_service_name_join (fullName, kDNSServiceMaxDomainName,
+ serviceName, regtype, replyDomain);
+#endif /* HAVE_DNSSD */
+
device->fullName = strdup(fullName);
return (device);
@@ -620,6 +869,7 @@ get_device(cups_array_t *devices, /* I - Device array
* 'query_callback()' - Process query data.
*/
+#ifdef HAVE_DNSSD
static void
query_callback(
DNSServiceRef sdRef, /* I - Service reference */
@@ -639,8 +889,8 @@ query_callback(
*ptr; /* Pointer into string */
cups_device_t dkey, /* Search key */
*device; /* Device */
+ cups_txt_records_t txt;
-
fprintf(stderr, "DEBUG2: query_callback(sdRef=%p, flags=%x, "
"interfaceIndex=%d, errorCode=%d, fullName=\"%s\", "
"rrtype=%u, rrclass=%u, rdlen=%u, rdata=%p, ttl=%u, "
@@ -673,84 +923,212 @@ query_callback(
if ((ptr = strstr(name, "._")) != NULL)
*ptr = '\0';
- if (strstr(fullName, "_ipp._tcp.") ||
- strstr(fullName, "_ipp-tls._tcp."))
- dkey.type = CUPS_DEVICE_IPP;
- else if (strstr(fullName, "_fax-ipp._tcp."))
- dkey.type = CUPS_DEVICE_FAX_IPP;
- else if (strstr(fullName, "_printer._tcp."))
- dkey.type = CUPS_DEVICE_PRINTER;
- else if (strstr(fullName, "_pdl-datastream._tcp."))
- dkey.type = CUPS_DEVICE_PDL_DATASTREAM;
+ dkey.type = device_type (fullName);
+
+ txt.data = rdata;
+ txt.dataend = rdata + rdlen;
+ device = find_device ((cups_array_t *) context, &txt, &dkey);
+ if (!device)
+ fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName);
+}
+#endif /* HAVE_DNSSD */
+
+#ifdef HAVE_AVAHI
+static void
+avahi_client_callback(AvahiClient *client,
+ AvahiClientState state,
+ void *context)
+{
+ /*
+ * If the connection drops, quit.
+ */
+
+ if (state == AVAHI_CLIENT_FAILURE)
+ {
+ fprintf (stderr, "ERROR: Avahi connection failed\n");
+ avahi_simple_poll_quit (simple_poll);
+ }
+}
+
+static void
+avahi_query_callback(AvahiServiceResolver *resolver,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event,
+ const char *name,
+ const char *type,
+ const char *domain,
+ const char *host_name,
+ const AvahiAddress *address,
+ uint16_t port,
+ AvahiStringList *txt,
+ AvahiLookupResultFlags flags,
+ void *context)
+{
+ AvahiClient *client;
+ cups_device_t key,
+ *device;
+ char uqname[1024],
+ *ptr;
+ cups_txt_records_t txtr;
+
+ client = avahi_service_resolver_get_client (resolver);
+ if (event != AVAHI_RESOLVER_FOUND)
+ {
+ if (event == AVAHI_RESOLVER_FAILURE)
+ {
+ fprintf (stderr, "ERROR: %s\n",
+ avahi_strerror (avahi_client_errno (client)));
+ }
+
+ avahi_service_resolver_free (resolver);
+ return;
+ }
+
+ /*
+ * Set search key for device.
+ */
+
+ key.name = uqname;
+ unquote (uqname, name, sizeof (uqname));
+ if ((ptr = strstr(name, "._")) != NULL)
+ *ptr = '\0';
+
+ key.domain = (char *) domain;
+ key.type = device_type (type);
+
+ /*
+ * Find the device and the the TXT information.
+ */
+
+ txtr.txt = txt;
+ device = find_device ((cups_array_t *) context, &txtr, &key);
+ if (device)
+ {
+ /*
+ * Let the main loop know to announce the device.
+ */
+
+ device->resolved = 1;
+ avahi_got_callback = 1;
+ }
else
- dkey.type = CUPS_DEVICE_RIOUSBPRINT;
+ fprintf (stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", name);
- for (device = cupsArrayFind(devices, &dkey);
+ avahi_service_resolver_free (resolver);
+}
+
+static void
+avahi_browse_callback(AvahiServiceBrowser *browser,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiBrowserEvent event,
+ const char *name,
+ const char *type,
+ const char *domain,
+ AvahiLookupResultFlags flags,
+ void *context)
+{
+ AvahiClient *client = avahi_service_browser_get_client (browser);
+
+ switch (event)
+ {
+ case AVAHI_BROWSER_FAILURE:
+ fprintf (stderr, "ERROR: %s\n",
+ avahi_strerror (avahi_client_errno (client)));
+ avahi_simple_poll_quit (simple_poll);
+ return;
+
+ case AVAHI_BROWSER_NEW:
+ /*
+ * This object is new on the network.
+ */
+
+ if (flags & AVAHI_LOOKUP_RESULT_LOCAL)
+ {
+ /*
+ * This comes from the local machine so ignore it.
+ */
+
+ fprintf (stderr, "DEBUG: ignoring local service %s\n", name);
+ }
+ else
+ {
+ /*
+ * Create a device entry for it if it doesn't yet exist.
+ */
+
+ get_device ((cups_array_t *)context, name, type, domain);
+
+ /*
+ * Now look for a TXT entry.
+ */
+
+ if (avahi_service_resolver_new (client, interface, protocol,
+ name, type, domain,
+ AVAHI_PROTO_UNSPEC, 0,
+ avahi_query_callback, context) == NULL)
+ {
+ fprintf (stderr, "ERROR: failed to resolve service %s: %s\n",
+ name, avahi_strerror (avahi_client_errno (client)));
+ }
+ }
+
+ break;
+
+ case AVAHI_BROWSER_REMOVE:
+ case AVAHI_BROWSER_ALL_FOR_NOW:
+ case AVAHI_BROWSER_CACHE_EXHAUSTED:
+ break;
+ }
+}
+#endif /* HAVE_AVAHI */
+
+static cups_device_t *
+find_device (cups_array_t *devices,
+ cups_txt_records_t *txt,
+ cups_device_t *dkey)
+{
+ cups_device_t *device;
+ char *ptr;
+
+ for (device = cupsArrayFind(devices, dkey);
device;
device = cupsArrayNext(devices))
{
- if (strcasecmp(device->name, dkey.name) ||
- strcasecmp(device->domain, dkey.domain))
+ if (strcasecmp(device->name, dkey->name) ||
+ strcasecmp(device->domain, dkey->domain))
{
device = NULL;
break;
}
- else if (device->type == dkey.type)
+ else if (device->type == dkey->type)
{
/*
* Found it, pull out the priority and make and model from the TXT
* record and save it...
*/
- const uint8_t *data, /* Pointer into data */
- *datanext, /* Next key/value pair */
- *dataend; /* End of entire TXT record */
- uint8_t datalen; /* Length of current key/value pair */
- char key[256], /* Key string */
- value[256], /* Value string */
- make_and_model[512],
+ char make_and_model[512],
/* Manufacturer and model */
model[256], /* Model */
- device_id[2048];/* 1284 device ID */
+ device_id[2048]; /* 1284 device ID */
-
device_id[0] = '\0';
make_and_model[0] = '\0';
strcpy(model, "Unknown");
- for (data = rdata, dataend = data + rdlen;
- data < dataend;
- data = datanext)
+ for (;;)
{
- /*
- * Read a key/value pair starting with an 8-bit length. Since the
- * length is 8 bits and the size of the key/value buffers is 256, we
- * don't need to check for overflow...
- */
+ char *key;
+ char *value;
- datalen = *data++;
+ if (parse_txt_record_pair (txt))
+ goto next;
- if (!datalen || (data + datalen) >= dataend)
- break;
-
- datanext = data + datalen;
-
- for (ptr = key; data < datanext && *data != '='; data ++)
- *ptr++ = *data;
- *ptr = '\0';
-
- if (data < datanext && *data == '=')
- {
- data ++;
-
- if (data < datanext)
- memcpy(value, data, datanext - data);
- value[datanext - data] = '\0';
- }
- else
- continue;
-
+ key = txt->key;
+ value = txt->value;
if (!strncasecmp(key, "usb_", 4))
{
/*
@@ -805,6 +1183,10 @@ query_callback(
if (device->type == CUPS_DEVICE_PRINTER)
device->sent = 1;
}
+
+ next:
+ if (next_txt_record (txt) == NULL)
+ break;
}
if (device->device_id)
@@ -854,10 +1236,8 @@ query_callback(
}
}
- if (!device)
- fprintf(stderr, "DEBUG: Ignoring TXT record for \"%s\"...\n", fullName);
+ return device;
}
-
/*
* 'sigterm_handler()' - Handle termination signals...

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-cgi-bin_Makefile,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- cgi-bin/Makefile.orig Wed May 27 01:27:06 2009
+++ cgi-bin/Makefile Sun Aug 30 17:17:24 2009
@@ -143,10 +143,6 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSCGI) $(LIBDIR)
- if test $(LIBCUPSCGI) = "libcupscgi.so.1" -o $(LIBCUPSCGI) = "libcupscgi.sl.1"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
- $(LN) $(LIBCUPSCGI) $(LIBDIR)/`basename $(LIBCUPSCGI) .1`; \
- fi
if test $(LIBCUPSCGI) = "libcupscgi.1.dylib"; then \
$(RM) $(LIBDIR)/libcupscgi.dylib; \
$(LN) $(LIBCUPSCGI) $(LIBDIR)/libcupscgi.dylib; \
@@ -179,7 +175,7 @@ uninstall:
$(RM) $(LIBDIR)/libcupscgi.sl
$(RM) $(LIBDIR)/libcupscgi.sl.1
$(RM) $(LIBDIR)/libcupscgi.so
- $(RM) $(LIBDIR)/libcupscgi.so.1
+ $(RM) $(LIBDIR)/libcupscgi.so.${LIBcupscgi_VERSION}
-$(RMDIR) $(LIBDIR)
$(RM) $(INCLUDEDIR)/cups/cgi.h
$(RM) $(INCLUDEDIR)/cups/help-index.h
@@ -209,14 +205,12 @@ framedhelp:
#
-# libcupscgi.so.1, libcupscgi.sl.1
+# libcupscgi.so.${LIBcupscgi_VERSION}, libcupscgi.sl.1
#
-libcupscgi.so.1 libcupscgi.sl.1: $(LIBOBJS)
+libcupscgi.so.${LIBcupscgi_VERSION} libcupscgi.sl.1: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
- $(RM) `basename $@ .1`
- $(LN) $@ `basename $@ .1`
#

View File

@ -1,16 +1,7 @@
$OpenBSD: patch-cgi-bin_admin_c,v 1.5 2009/07/12 19:58:19 ajacoutot Exp $
--- cgi-bin/admin.c.orig Thu Jun 18 23:42:45 2009
+++ cgi-bin/admin.c Mon Jul 6 11:56:21 2009
@@ -414,7 +414,7 @@ do_am_class(http_t *http, /* I - HTTP connection */
*response; /* IPP response */
ipp_attribute_t *attr; /* member-uris attribute */
char uri[HTTP_MAX_URI]; /* Device or printer URI */
- const char *name, /* Pointer to class name */
+ const signed char *name, /* Pointer to class name */
*ptr; /* Pointer to CGI variable */
const char *title; /* Title of page */
static const char * const pattrs[] = /* Requested printer attributes */
@@ -701,7 +701,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
$OpenBSD: patch-cgi-bin_admin_c,v 1.6 2010/03/31 16:20:02 ajacoutot Exp $
--- cgi-bin/admin.c.orig Fri Jan 15 03:10:32 2010
+++ cgi-bin/admin.c Wed Mar 31 15:53:42 2010
@@ -835,7 +835,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
*uriptr; /* Pointer into URI */
int maxrate; /* Maximum baud rate */
char baudrate[255]; /* Baud rate string */

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-config-scripts_cups-common_m4,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
STR #3447: dbus notifier no longer builds
--- config-scripts/cups-common.m4.orig Tue Mar 30 22:40:58 2010
+++ config-scripts/cups-common.m4 Wed Mar 31 15:53:42 2010
@@ -268,6 +268,8 @@ if test "x$enable_dbus" != xno; then
dbus_message_iter_init_append,
AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND),,
`$PKGCONFIG --libs dbus-1`)
+ DBUS_NOTIFIER="dbus"
+ DBUS_NOTIFIERLIBS="`$PKGCONFIG --libs dbus-1`"
else
AC_MSG_RESULT(no)
fi

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-config-scripts_cups-compiler_m4,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- config-scripts/cups-compiler.m4.orig Mon Aug 31 16:45:57 2009
+++ config-scripts/cups-compiler.m4 Mon Aug 31 16:46:16 2009
@@ -123,7 +123,7 @@ if test -n "$GCC"; then
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
- OPTIM="-Os -g"
+ OPTIM=""
else
OPTIM="$with_optim $OPTIM"
fi

View File

@ -0,0 +1,28 @@
$OpenBSD: patch-config-scripts_cups-dnssd_m4,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
Avahi support, from Fedora.
--- config-scripts/cups-dnssd.m4.orig Sat Aug 29 00:54:34 2009
+++ config-scripts/cups-dnssd.m4 Thu Dec 10 15:48:31 2009
@@ -27,6 +27,21 @@ AC_ARG_WITH(dnssd-includes, [ --with-dnssd-includes
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

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-config-scripts_cups-pdf_m4,v 1.1 2009/10/25 16:04:34 jasper Exp $
$OpenBSD: patch-config-scripts_cups-pdf_m4,v 1.2 2010/03/31 16:20:02 ajacoutot Exp $
Security fix for CVE-2009-3608, CVE-2009-3609.
CUPS "pdftops" Filter Data Handling Integer Overflow Vulnerabilities
Patch from Ubuntu: poppler-based-pdftops-fixes.dpatch
--- config-scripts/cups-pdf.m4.orig Fri Oct 23 13:00:39 2009
+++ config-scripts/cups-pdf.m4 Fri Oct 23 13:01:00 2009
@@ -64,6 +64,12 @@ case "x$with_pdftops" in
--- config-scripts/cups-pdf.m4.orig Sat Aug 8 00:30:30 2009
+++ config-scripts/cups-pdf.m4 Thu Dec 10 15:28:50 2009
@@ -79,6 +79,12 @@ case "x$with_pdftops" in
;;
esac

View File

@ -1,14 +1,22 @@
$OpenBSD: patch-config-scripts_cups-sharedlibs_m4,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- config-scripts/cups-sharedlibs.m4.orig Wed Jul 11 23:46:42 2007
+++ config-scripts/cups-sharedlibs.m4 Tue Mar 17 16:21:50 2009
@@ -49,8 +49,8 @@ if test x$enable_shared != xno; then
$OpenBSD: patch-config-scripts_cups-sharedlibs_m4,v 1.5 2010/03/31 16:20:02 ajacoutot Exp $
--- config-scripts/cups-sharedlibs.m4.orig Sat Aug 29 22:45:43 2009
+++ config-scripts/cups-sharedlibs.m4 Sat Aug 29 22:47:18 2009
@@ -80,12 +80,12 @@ if test x$enable_shared != xno; then
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
- LIBCUPS="libcups.so.2"
- LIBCUPSCGI="libcupscgi.so.1"
- LIBCUPSDRIVER="libcupsdriver.so.1"
- LIBCUPSIMAGE="libcupsimage.so.2"
- LIBCUPSMIME="libcupsmime.so.1"
- LIBCUPSPPDC="libcupsppdc.so.1"
+ LIBCUPS="libcups.so.${LIBcups_VERSION}"
+ LIBCUPSCGI="libcupscgi.so.${LIBcupscgi_VERSION}"
+ LIBCUPSDRIVER="libcupsdriver.so.${LIBcupsdriver_VERSION}"
+ LIBCUPSIMAGE="libcupsimage.so.${LIBcupsimage_VERSION}"
+ LIBCUPSMIME="libcupsmime.so.${LIBcupsmime_VERSION}"
+ LIBCUPSPPDC="libcupsppdc.so.${LIBcupsppdc_VERSION}"
DSO="\$(CC)"
DSOXX="\$(CXX)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-config-scripts_cups-threads_m4,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- config-scripts/cups-threads.m4.orig Mon Aug 31 16:45:19 2009
+++ config-scripts/cups-threads.m4 Mon Aug 31 16:45:39 2009
@@ -23,7 +23,7 @@ if test "x$enable_threads" != xno; then
if test x$ac_cv_header_pthread_h = xyes; then
dnl Check various threading options for the platforms we support
- for flag in -lpthreads -lpthread -pthread; do
+ for flag in -pthread -lpthreads -lpthread; do
AC_MSG_CHECKING([for pthread_create using $flag])
SAVELIBS="$LIBS"
LIBS="$flag $LIBS"

View File

@ -1,17 +1,20 @@
$OpenBSD: patch-config_h_in,v 1.1 2009/10/25 16:04:34 jasper Exp $
$OpenBSD: patch-config_h_in,v 1.2 2010/03/31 16:20:02 ajacoutot Exp $
Security fix for CVE-2009-3608, CVE-2009-3609.
CUPS "pdftops" Filter Data Handling Integer Overflow Vulnerabilities
Avahi support, from Fedora.
Patch from Ubuntu: poppler-based-pdftops-fixes.dpatch
--- config.h.in.orig Fri Oct 23 13:01:25 2009
+++ config.h.in Fri Oct 23 13:01:39 2009
@@ -440,6 +440,7 @@
--- config.h.in.orig Wed Jun 10 17:51:21 2009
+++ config.h.in Thu Dec 10 15:48:31 2009
@@ -336,6 +336,13 @@
/*
+ * Do we have Avahi for DNS Service Discovery?
+ */
+
+#undef HAVE_AVAHI
+
+
+/*
* Do we have <sys/ioctl.h>?
*/
#undef HAVE_PDFTOPS
+#undef HAVE_PDFTOPS_WITH_ORIGPAGESIZES
#define CUPS_PDFTOPS "/usr/bin/pdftops"

View File

@ -1,41 +0,0 @@
$OpenBSD: patch-configure,v 1.7 2009/04/27 08:25:39 bernd Exp $
--- configure.orig Thu Apr 16 22:02:06 2009
+++ configure Thu Apr 23 12:57:20 2009
@@ -9874,8 +9874,8 @@ if test x$enable_shared != xno; then
DSOFLAGS="$DSOFLAGS -set_version,sgi2.6,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
OSF1* | Linux | GNU | *BSD*)
- LIBCUPS="libcups.so.2"
- LIBCUPSIMAGE="libcupsimage.so.2"
+ LIBCUPS="libcups.so.${LIBcups_VERSION}"
+ LIBCUPSIMAGE="libcupsimage.so.${LIBcupsimage_VERSION}"
DSO="\$(CC)"
DSOFLAGS="$DSOFLAGS -Wl,-soname,\`basename \$@\` -shared \$(OPTIM)"
;;
@@ -10141,7 +10141,7 @@ if test -n "$GCC"; then
if test -z "$OPTIM"; then
if test "x$with_optim" = x; then
# Default to optimize-for-size and debug
- OPTIM="-Os -g"
+ OPTIM=""
else
OPTIM="$with_optim $OPTIM"
fi
@@ -16791,7 +16791,7 @@ fi
if test x$ac_cv_header_pthread_h = xyes; then
- for flag in -lpthreads -lpthread -pthread; do
+ for flag in -pthread -lpthreads -lpthread; do
{ echo "$as_me:$LINENO: checking for pthread_create using $flag" >&5
echo $ECHO_N "checking for pthread_create using $flag... $ECHO_C" >&6; }
SAVELIBS="$LIBS"
@@ -18877,7 +18877,7 @@ cat >>confdefs.h <<_ACEOF
_ACEOF
cat >>confdefs.h <<_ACEOF
-#define CUPS_GHOSTSCRIPT "$CUPS_GHOSTSCRIPT"
+#define CUPS_GHOSTSCRIPT "$ac_cv_path_CUPS_GHOSTSCRIPT"
_ACEOF

View File

@ -1,30 +1,20 @@
$OpenBSD: patch-cups_Makefile,v 1.5 2009/05/19 11:15:28 ajacoutot Exp $
--- cups/Makefile.orig Sat Sep 6 02:30:39 2008
+++ cups/Makefile Tue May 19 12:50:40 2009
@@ -131,7 +131,7 @@ all: $(TARGETS)
clean:
$(RM) $(OBJS) $(TARGETS)
- $(RM) libcups.so libcups.sl libcups.dylib
+ $(RM) libcups.so libcups.so.${LIBcups_VERSION} libcups.sl libcups.dylib
$(RM) -r 32bit 64bit
@@ -156,9 +156,8 @@ depend:
install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
$OpenBSD: patch-cups_Makefile,v 1.6 2010/03/31 16:20:02 ajacoutot Exp $
--- cups/Makefile.orig Wed May 27 01:27:06 2009
+++ cups/Makefile Sun Aug 30 16:46:01 2009
@@ -222,10 +222,6 @@ install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL6
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
- if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
- $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
+ if test $(LIBCUPS) = "libcups.so.${LIBcups_VERSION}" -o $(LIBCUPS) = "libcups.sl.${LIBcups_VERSION}"; then \
+ $(RM) $(LIBDIR)/`basename $(LIBCUPS) .${LIBcups_VERSION}`; \
fi
- fi
if test $(LIBCUPS) = "libcups.2.dylib"; then \
$(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
@@ -185,13 +184,13 @@ installhdrs:
$(RM) $(LIBDIR)/libcups.dylib; \
$(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
@@ -244,14 +240,14 @@ installstatic:
install32bit:
echo Installing libraries in $(LIB32DIR)...
$(INSTALL_DIR) -m 755 $(LIB32DIR)
- $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
- $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
@ -32,6 +22,7 @@ $OpenBSD: patch-cups_Makefile,v 1.5 2009/05/19 11:15:28 ajacoutot Exp $
+ $(LN) libcups.so.${LIBcups_VERSION} $(LIB32DIR)/libcups.so
install64bit:
echo Installing libraries in $(LIB64DIR)...
$(INSTALL_DIR) -m 755 $(LIB64DIR)
- $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
- $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
@ -40,7 +31,7 @@ $OpenBSD: patch-cups_Makefile,v 1.5 2009/05/19 11:15:28 ajacoutot Exp $
#
@@ -206,7 +205,7 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
@@ -266,7 +262,7 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
$(RM) $(LIBDIR)/libcups.sl
$(RM) $(LIBDIR)/libcups.sl.2
$(RM) $(LIBDIR)/libcups.so
@ -49,43 +40,62 @@ $OpenBSD: patch-cups_Makefile,v 1.5 2009/05/19 11:15:28 ajacoutot Exp $
-$(RMDIR) $(LIBDIR)
for file in $(HEADERS); do \
$(RM) $(INCLUDEDIR)/cups/$$file; \
@@ -228,35 +227,35 @@ uninstall64bit:
# libcups.so.2, libcups.sl.2
@@ -275,51 +271,49 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
uninstall32bit:
$(RM) $(LIB32DIR)/libcups.so
- $(RM) $(LIB32DIR)/libcups.so.2
+ $(RM) $(LIB32DIR)/libcups.so.${LIBcups_VERSION}
-$(RMDIR) $(LIB32DIR)
uninstall64bit:
$(RM) $(LIB64DIR)/libcups.so
- $(RM) $(LIB64DIR)/libcups.so.2
+ $(RM) $(LIB64DIR)/libcups.so.${LIBcups_VERSION}
-$(RMDIR) $(LIB64DIR)
#
-# libcups.so.2, libcups.sl.2
+# libcups.so.${LIBcups_VERSION}, libcups.sl.2
#
-libcups.so.2 libcups.sl.2: $(LIBOBJS)
+libcups.so.${LIBcups_VERSION} libcups.sl.2: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
$(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
- $(RM) `basename $@ .2`
- $(LN) $@ `basename $@ .2`
+ $(RM) `basename $@ .${LIBcups_VERSION}`
+ $(LN) $@ `basename $@ .${LIBcups_VERSION}`
#
# 32bit/libcups.so.2
-# 32bit/libcups.so.2
+# 32bit/libcups.so.${LIBcups_VERSION}
#
-32bit/libcups.so.2: $(LIB32OBJS)
+32bit/libcups.so.${LIBcups_VERSION}: $(LIB32OBJS)
echo Linking 32-bit $@...
-mkdir 32bit
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) \
$(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 32bit/libcups.so
- $(LN) libcups.so.2 32bit/libcups.so
+ $(LN) libcups.so.${LIBcups_VERSION} 32bit/libcups.so
#
# 64bit/libcups.so.2
-# 64bit/libcups.so.2
+# 64bit/libcups.so.${LIBcups_VERSION}
#
-64bit/libcups.so.2: $(LIB64OBJS)
+64bit/libcups.so.${LIBcups_VERSION}: $(LIB64OBJS)
echo Linking 64-bit $@...
-mkdir 64bit
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) \
$(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
$(RM) 64bit/libcups.so
- $(LN) libcups.so.2 64bit/libcups.so
+ $(LN) libcups.so.${LIBcups_VERSION} 64bit/libcups.so

View File

@ -0,0 +1,254 @@
$OpenBSD: patch-cups_http-support_c,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
Avahi support, from Fedora.
--- cups/http-support.c.orig Fri Jun 12 02:21:58 2009
+++ cups/http-support.c Thu Dec 10 15:48:31 2009
@@ -55,6 +55,11 @@
# include <dns_sd.h>
# include <poll.h>
#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+# include <avahi-client/client.h>
+# include <avahi-client/lookup.h>
+# include <avahi-common/simple-watch.h>
+#endif /* HAVE_AVAHI */
/*
@@ -121,6 +126,24 @@ static void resolve_callback(DNSServiceRef sdRef,
void *context);
#endif /* HAVE_DNSSD */
+#ifdef HAVE_AVAHI
+static void avahi_resolve_uri_client_cb(AvahiClient *client,
+ AvahiClientState state,
+ void *simple_poll);
+static void avahi_resolve_uri_resolver_cb(AvahiServiceResolver *resolver,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event,
+ const char *name,
+ const char *type,
+ const char *domain,
+ const char *host_name,
+ const AvahiAddress *address,
+ uint16_t port,
+ AvahiStringList *txt,
+ AvahiLookupResultFlags flags,
+ void *context);
+#endif /* HAVE_AVAHI */
/*
* 'httpAssembleURI()' - Assemble a uniform resource identifier from its
@@ -1349,15 +1372,26 @@ _httpResolveURI(
if (strstr(hostname, "._tcp"))
{
+#if defined(HAVE_DNSSD) || defined(HAVE_AVAHI)
+ char *regtype, /* Pointer to type in hostname */
+ *domain; /* Pointer to domain in hostname */
#ifdef HAVE_DNSSD
DNSServiceRef ref, /* DNS-SD master service reference */
domainref, /* DNS-SD service reference for domain */
localref; /* DNS-SD service reference for .local */
int domainsent = 0; /* Send the domain resolve? */
- char *regtype, /* Pointer to type in hostname */
- *domain; /* Pointer to domain in hostname */
_http_uribuf_t uribuf; /* URI buffer */
struct pollfd polldata; /* Polling data */
+#else /* HAVE_AVAHI */
+ AvahiSimplePoll *simple_poll;
+ AvahiClient *client;
+ int error;
+ struct
+ {
+ AvahiSimplePoll *poll;
+ _http_uribuf_t uribuf;
+ } user_data;
+#endif /* HAVE_DNSSD */
if (logit)
@@ -1395,8 +1429,13 @@ _httpResolveURI(
if (domain)
*domain++ = '\0';
+#ifdef HAVE_DNSSD
uribuf.buffer = resolved_uri;
uribuf.bufsize = resolved_size;
+#else
+ user_data.uribuf.buffer = resolved_uri;
+ user_data.uribuf.bufsize = resolved_size;
+#endif
resolved_uri[0] = '\0';
@@ -1411,6 +1450,7 @@ _httpResolveURI(
uri = NULL;
+#ifdef HAVE_DNSSD
if (DNSServiceCreateConnection(&ref) == kDNSServiceErr_NoError)
{
localref = ref;
@@ -1486,7 +1526,37 @@ _httpResolveURI(
DNSServiceRefDeallocate(ref);
}
+#else /* HAVE_AVAHI */
+ if ((simple_poll = avahi_simple_poll_new ()) != NULL)
+ {
+ if ((client = avahi_client_new (avahi_simple_poll_get (simple_poll),
+ 0, avahi_resolve_uri_client_cb,
+ &simple_poll, &error)) != NULL)
+ {
+ user_data.poll = simple_poll;
+ if (avahi_service_resolver_new (client, AVAHI_IF_UNSPEC,
+ AVAHI_PROTO_UNSPEC, hostname,
+ regtype, domain, AVAHI_PROTO_UNSPEC, 0,
+ avahi_resolve_uri_resolver_cb,
+ &user_data) != NULL)
+ {
+ avahi_simple_poll_loop (simple_poll);
+ /*
+ * Collect the result.
+ */
+
+ if (resolved_uri[0])
+ uri = resolved_uri;
+ }
+
+ avahi_client_free (client);
+ }
+
+ avahi_simple_poll_free (simple_poll);
+ }
+#endif /* HAVE_DNSSD */
+
if (logit)
{
if (uri)
@@ -1497,13 +1567,13 @@ _httpResolveURI(
fputs("STATE: -connecting-to-device\n", stderr);
}
-#else
+#else /* HAVE_DNSSD || HAVE_AVAHI */
/*
* No DNS-SD support...
*/
uri = NULL;
-#endif /* HAVE_DNSSD */
+#endif /* HAVE_DNSSD || HAVE_AVAHI */
if (logit && !uri)
_cupsLangPuts(stderr, _("Unable to find printer!\n"));
@@ -1707,6 +1777,105 @@ resolve_callback(
uribuf->buffer));
}
#endif /* HAVE_DNSSD */
+
+#ifdef HAVE_AVAHI
+static void
+avahi_resolve_uri_client_cb (AvahiClient *client,
+ AvahiClientState state,
+ void *simple_poll)
+{
+ DEBUG_printf(("avahi_resolve_uri_client_callback(client=%p, state=%d, "
+ "simple_poll=%p)\n", client, state, simple_poll));
+
+ /*
+ * If the connection drops, quit.
+ */
+
+ if (state == AVAHI_CLIENT_FAILURE)
+ avahi_simple_poll_quit (simple_poll);
+}
+
+static void
+avahi_resolve_uri_resolver_cb (AvahiServiceResolver *resolver,
+ AvahiIfIndex interface,
+ AvahiProtocol protocol,
+ AvahiResolverEvent event,
+ const char *name,
+ const char *type,
+ const char *domain,
+ const char *host_name,
+ const AvahiAddress *address,
+ uint16_t port,
+ AvahiStringList *txt,
+ AvahiLookupResultFlags flags,
+ void *context)
+{
+ const char *scheme; /* URI scheme */
+ char rp[256]; /* Remote printer */
+ AvahiStringList *pair;
+ char *value;
+ size_t valueLen = 0;
+ char addr[AVAHI_ADDRESS_STR_MAX];
+ struct
+ {
+ AvahiSimplePoll *poll;
+ _http_uribuf_t uribuf;
+ } *poll_uribuf = context;
+
+ DEBUG_printf(("avahi_resolve_uri_resolver_callback(resolver=%p, "
+ "interface=%d, protocol=%d, event=%d, name=\"%s\", "
+ "type=\"%s\", domain=\"%s\", host_name=\"%s\", address=%p, "
+ "port=%d, txt=%p, flags=%d, context=%p)\n",
+ resolver, interface, protocol, event, name, type, domain,
+ host_name, address, port, txt, flags, context));
+
+ if (event != AVAHI_RESOLVER_FOUND)
+ {
+ avahi_service_resolver_free (resolver);
+ avahi_simple_poll_quit (poll_uribuf->poll);
+ return;
+ }
+
+ /*
+ * Figure out the scheme from the full name...
+ */
+
+ if (strstr(type, "_ipp."))
+ scheme = "ipp";
+ else if (strstr(type, "_printer."))
+ scheme = "lpd";
+ else if (strstr(type, "_pdl-datastream."))
+ scheme = "socket";
+ else
+ scheme = "riousbprint";
+
+ /*
+ * Extract the "remote printer key from the TXT record...
+ */
+
+ if ((pair = avahi_string_list_find (txt, "rp")) != NULL)
+ {
+ avahi_string_list_get_pair (pair, NULL, &value, &valueLen);
+ rp[0] = '/';
+ memcpy (rp + 1, value, valueLen);
+ rp[valueLen + 1] = '\0';
+ }
+ else
+ rp[0] = '\0';
+
+ /*
+ * Assemble the final device URI...
+ */
+
+ avahi_address_snprint (addr, AVAHI_ADDRESS_STR_MAX, address);
+ httpAssembleURI(HTTP_URI_CODING_ALL, poll_uribuf->uribuf.buffer,
+ poll_uribuf->uribuf.bufsize, scheme, NULL,
+ addr, port, rp);
+ DEBUG_printf(("avahi_resolve_uri_resolver_callback: Resolved URI is \"%s\"\n",
+ poll_uribuf->uribuf.buffer));
+ avahi_simple_poll_quit (poll_uribuf->poll);
+}
+#endif /* HAVE_AVAHI */
/*

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-desktop_cups_desktop,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- desktop/cups.desktop.orig Sat Sep 6 02:30:39 2008
+++ desktop/cups.desktop Tue Mar 17 16:41:22 2009
@@ -1,6 +1,6 @@
[Desktop Entry]
Categories=System;Printing;HardwareSettings;X-Red-Hat-Base;
-Exec=htmlview http://localhost:631/
+Exec=xdg-open http://localhost:631/
Icon=cups
StartupNotify=false
Terminal=false
@@ -24,7 +24,7 @@ Comment[id.UTF-8]=Antarmuka Web CUPS
Name[it.UTF-8]=Gestione stampa
Comment[it.UTF-8]=Interfaccia web di CUPS
Name[ja.UTF-8]=印刷の管理
-Comment[ja.UTF-8]=CUPS Web インタフェース
+Comment[it]=Interfaccia web di CUPS
Name[pl.UTF-8]=Zarządzanie drukowaniem
Comment[pl.UTF-8]=Interfejs WWW CUPS
Name[zh.UTF-8]=打印机管理

View File

@ -0,0 +1,40 @@
$OpenBSD: patch-driver_Makefile,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- driver/Makefile.orig Wed May 27 01:27:06 2009
+++ driver/Makefile Sun Aug 30 16:46:11 2009
@@ -149,10 +149,6 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSDRIVER) $(LIBDIR)
- if test $(LIBCUPSDRIVER) = "libcupsdriver.so.1" -o $(LIBCUPSDRIVER) = "libcupsdriver.sl.1"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
- $(LN) $(LIBCUPSDRIVER) $(LIBDIR)/`basename $(LIBCUPSDRIVER) .1`; \
- fi
if test $(LIBCUPSDRIVER) = "libcupsdriver.1.dylib"; then \
$(RM) $(LIBDIR)/libcupsdriver.dylib; \
$(LN) $(LIBCUPSDRIVER) $(LIBDIR)/libcupsdriver.dylib; \
@@ -184,7 +180,7 @@ uninstall:
$(RM) $(LIBDIR)/libcupsdriver.sl
$(RM) $(LIBDIR)/libcupsdriver.sl.1
$(RM) $(LIBDIR)/libcupsdriver.so
- $(RM) $(LIBDIR)/libcupsdriver.so.1
+ $(RM) $(LIBDIR)/libcupsdriver.so.${LIBcupsdriver_VERSION}
-$(RMDIR) $(LIBDIR)
$(RM) $(INCLUDEDIR)/cups/driver.h
-$(RMDIR) $(INCLUDEDIR)/cups
@@ -310,14 +306,12 @@ testrgb: test testrgb.o libcupsdriver.a ../cups/libcu
#
-# libcupsdriver.so.1, libcupsdriver.sl.1
+# libcupsdriver.so.${LIBcupsdriver_VERSION}, libcupsdriver.sl.1
#
-libcupsdriver.so.1 libcupsdriver.sl.1: $(LIBOBJS)
+libcupsdriver.so.${LIBcupsdriver_VERSION} libcupsdriver.sl.1: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
- $(RM) `basename $@ .1`
- $(LN) $@ `basename $@ .1`
#

View File

@ -1,28 +1,18 @@
$OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
--- filter/Makefile.orig Thu Mar 12 22:34:21 2009
+++ filter/Makefile Tue May 19 12:49:32 2009
@@ -57,7 +57,7 @@ all: $(TARGETS)
clean:
$(RM) $(OBJS) $(TARGETS)
- $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
+ $(RM) libcupsimage.so libcupsimage.${LIBcupsimage_VERSION} libcupsimage.sl libcupsimage.dylib
$(RM) -r 32bit 64bit
@@ -88,9 +88,8 @@ install: all installhdrs $(INSTALLSTATIC) $(INSTALL32)
$(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
$OpenBSD: patch-filter_Makefile,v 1.7 2010/03/31 16:20:02 ajacoutot Exp $
--- filter/Makefile.orig Wed May 27 01:27:06 2009
+++ filter/Makefile Sun Aug 30 16:46:22 2009
@@ -153,10 +153,6 @@ install-headers:
install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
- -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
- $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
+ -if test $(LIBCUPSIMAGE) = "libcupsimage.so.${LIBcupsimage_VERSION}" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
+ $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .${LIBcupsimage_VERSION}`; \
fi
- fi
-if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
$(STRIP) -x $(LIBDIR)/$(LIBCUPSIMAGE); \
@@ -116,13 +115,13 @@ installhdrs:
$(RM) $(LIBDIR)/libcupsimage.dylib; \
$(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
@@ -170,13 +166,13 @@ installstatic:
install32bit:
$(INSTALL_DIR) -m 755 $(LIB32DIR)
@ -40,7 +30,7 @@ $OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
#
@@ -143,7 +142,7 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
@@ -197,19 +193,19 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
$(RM) $(LIBDIR)/libcupsimage.sl
$(RM) $(LIBDIR)/libcupsimage.sl.2
$(RM) $(LIBDIR)/libcupsimage.so
@ -48,8 +38,7 @@ $OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
+ $(RM) $(LIBDIR)/libcupsimage.so.${LIBcupsimage_VERSION}
-$(RMDIR) $(LIBDIR)
$(RM) $(INCLUDEDIR)/cups/image.h
$(RM) $(INCLUDEDIR)/cups/raster.h
@@ -151,12 +150,12 @@ uninstall: $(UNINSTALL32) $(UNINSTALL64)
-$(RMDIR) $(INCLUDEDIR)/cups
uninstall32bit:
$(RM) $(LIB32DIR)/libcupsimage.so
@ -64,7 +53,7 @@ $OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
-$(RMDIR) $(LIB64DIR)
@@ -199,22 +198,22 @@ hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
@@ -320,22 +316,20 @@ hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
#
@ -79,8 +68,6 @@ $OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
-L../cups $(LINKCUPS) -lm
- $(RM) `basename $@ .2`
- $(LN) $@ `basename $@ .2`
+ $(RM) `basename $@ .${LIBcupsimage_VERSION}`
+ $(LN) $@ `basename $@ .${LIBcupsimage_VERSION}`
#
@ -93,7 +80,7 @@ $OpenBSD: patch-filter_Makefile,v 1.6 2009/05/19 11:15:28 ajacoutot Exp $
echo Linking 32-bit $@...
-mkdir 32bit
$(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
@@ -222,10 +221,10 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
@@ -343,10 +337,10 @@ libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
#

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-filter_imagetoraster_c,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- filter/imagetoraster.c.orig Sat Jul 12 00:48:49 2008
+++ filter/imagetoraster.c Tue Mar 17 16:21:50 2009
@@ -248,7 +248,7 @@ main(int argc, /* I - Number of command-line argum
$OpenBSD: patch-filter_imagetoraster_c,v 1.5 2010/03/31 16:20:02 ajacoutot Exp $
--- filter/imagetoraster.c.orig Fri Jun 5 23:38:52 2009
+++ filter/imagetoraster.c Sun Aug 30 15:14:02 2009
@@ -246,7 +246,7 @@ main(int argc, /* I - Number of command-line argum
close(mypipes[1]);
execlp("pstoraster", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5],
@ -10,7 +10,7 @@ $OpenBSD: patch-filter_imagetoraster_c,v 1.4 2009/04/27 08:25:39 bernd Exp $
perror("ERROR: Unable to exec pstoraster");
return (errno);
}
@@ -277,7 +277,7 @@ main(int argc, /* I - Number of command-line argum
@@ -274,7 +274,7 @@ main(int argc, /* I - Number of command-line argum
*/
execlp("imagetops", argv[0], argv[1], argv[2], argv[3], argv[4], argv[5],

View File

@ -1,13 +1,13 @@
$OpenBSD: patch-filter_pdftops_c,v 1.1 2009/10/25 16:04:34 jasper Exp $
$OpenBSD: patch-filter_pdftops_c,v 1.2 2010/03/31 16:20:02 ajacoutot Exp $
Security fix for CVE-2009-3608, CVE-2009-3609.
CUPS "pdftops" Filter Data Handling Integer Overflow Vulnerabilities
Patch from Ubuntu: poppler-based-pdftops-fixes.dpatch
--- filter/pdftops.c.orig Fri Oct 23 13:02:31 2009
+++ filter/pdftops.c Fri Oct 23 13:03:37 2009
@@ -303,7 +303,9 @@ main(int argc, /* I - Number of command-line args
--- filter/pdftops.c.orig Fri May 22 21:30:39 2009
+++ filter/pdftops.c Thu Dec 10 15:28:50 2009
@@ -302,7 +302,9 @@ main(int argc, /* I - Number of command-line args
}
else
#ifdef HAVE_PDFTOPS
@ -18,7 +18,7 @@ Patch from Ubuntu: poppler-based-pdftops-fixes.dpatch
#else
pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=3";
#endif /* HAVE_PDFTOPS */
@@ -389,7 +391,19 @@ main(int argc, /* I - Number of command-line args
@@ -388,7 +390,19 @@ main(int argc, /* I - Number of command-line args
pdf_argv[pdf_argc++] = pdf_width;
pdf_argv[pdf_argc++] = pdf_height;
#endif /* HAVE_PDFTOPS */

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-init_cups_sh_in,v 1.2 2009/04/27 08:25:39 bernd Exp $
$OpenBSD: patch-init_cups_sh_in,v 1.3 2010/03/31 16:20:02 ajacoutot Exp $
--- init/cups.sh.in.orig Wed Jul 11 23:46:42 2007
+++ init/cups.sh.in Tue Mar 17 16:21:50 2009
+++ init/cups.sh.in Mon Aug 31 10:28:36 2009
@@ -82,6 +82,16 @@ case "`uname`" in
fi
;;

View File

@ -1,22 +1,11 @@
$OpenBSD: patch-notifier_Makefile,v 1.1 2009/04/27 08:25:39 bernd Exp $
--- notifier/Makefile.orig Mon Jul 28 23:14:43 2008
+++ notifier/Makefile Tue Mar 17 17:34:02 2009
@@ -43,12 +43,12 @@ install: all
$(INSTALL_DIR) -m 755 $(SERVERBIN)/notifier
$(INSTALL_BIN) mailto $(SERVERBIN)/notifier
$(INSTALL_BIN) rss $(SERVERBIN)/notifier
- $(INSTALL_DIR) -m 775 $(CACHEDIR)/rss
- -chgrp $(CUPS_GROUP) $(CACHEDIR)/rss
- if test "x$(SYMROOT)" != "x"; then \
- $(INSTALL_DIR) $(SYMROOT); \
- cp mailto rss $(SYMROOT); \
- fi
+# $(INSTALL_DIR) -m 775 $(CACHEDIR)/rss
+# -chgrp $(CUPS_GROUP) $(CACHEDIR)/rss
+# if test "x$(SYMROOT)" != "x"; then \
+# $(INSTALL_DIR) $(SYMROOT); \
+# cp mailto rss $(SYMROOT); \
+# fi
$OpenBSD: patch-notifier_Makefile,v 1.2 2010/03/31 16:20:02 ajacoutot Exp $
--- notifier/Makefile.orig Sun Aug 30 16:29:00 2009
+++ notifier/Makefile Sun Aug 30 16:29:06 2009
@@ -62,7 +62,6 @@ install: all install-data install-headers install-libs
#
install-data:
- $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)/rss
#

View File

@ -0,0 +1,27 @@
$OpenBSD: patch-ppdc_Makefile,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- ppdc/Makefile.orig Wed May 27 01:27:06 2009
+++ ppdc/Makefile Sun Aug 30 16:46:52 2009
@@ -167,10 +167,6 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSPPDC) $(LIBDIR)
- if test $(LIBCUPSPPDC) = "libcupsppdc.so.1" -o $(LIBCUPSPPDC) = "libcupsppdc.sl.1"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
- $(LN) $(LIBCUPSPPDC) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
- fi
if test $(LIBCUPSPPDC) = "libcupsppdc.1.dylib"; then \
$(RM) $(LIBDIR)/libcupsppdc.dylib; \
$(LN) $(LIBCUPSPPDC) $(LIBDIR)/libcupsppdc.dylib; \
@@ -335,11 +331,9 @@ testcatalog: testcatalog.o libcupsppdc.a ../cups/libc
# libcupsppdc.so.1, libcupsppdc.sl.1
#
-libcupsppdc.so.1 libcupsppdc.sl.1: $(LIBOBJS) ../cups/$(LIBCUPS)
+libcupsppdc.so.${LIBcupsppdc_VERSION} libcupsppdc.sl.1: $(LIBOBJS) ../cups/$(LIBCUPS)
echo Linking $@...
$(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LINKCUPS)
- $(RM) `basename $@ .1`
- $(LN) $@ `basename $@ .1`
#

View File

@ -1,43 +1,62 @@
$OpenBSD: patch-scheduler_Makefile,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- scheduler/Makefile.orig Thu Aug 16 20:44:46 2007
+++ scheduler/Makefile Tue Mar 17 16:35:21 2009
@@ -135,23 +135,23 @@ install: all
$OpenBSD: patch-scheduler_Makefile,v 1.5 2010/03/31 16:20:02 ajacoutot Exp $
--- scheduler/Makefile.orig Wed May 27 01:27:06 2009
+++ scheduler/Makefile Sun Aug 30 16:47:04 2009
@@ -147,21 +147,6 @@ install-data:
echo Creating $(SERVERROOT)/ssl...; \
$(INSTALL_DIR) -m 700 $(SERVERROOT)/ssl; \
chgrp $(CUPS_GROUP) $(SERVERROOT)/ssl || true; \
$(INSTALL_DIR) -m 700 -g $(CUPS_GROUP) $(SERVERROOT)/ssl; \
fi
- if test "$(STATEDIR)" != "$(SERVERROOT)"; then \
- echo Creating $(STATEDIR)...; \
- $(INSTALL_DIR) -m 755 $(STATEDIR); \
- echo Creating $(STATEDIR)/certs...; \
- $(INSTALL_DIR) -m 511 $(STATEDIR)/certs; \
- chgrp $(CUPS_PRIMARY_SYSTEM_GROUP) $(STATEDIR)/certs || true; \
+ echo Creating $(DESTDIR)$(STATEDIR)...; \
+ $(INSTALL_DIR) -m 755 $(DESTDIR)$(STATEDIR); \
+ echo Creating $(DESTDIR)$(STATEDIR)/certs...; \
+ $(INSTALL_DIR) -m 511 $(DESTDIR)$(STATEDIR)/certs; \
+ chgrp $(CUPS_PRIMARY_SYSTEM_GROUP) $(DESTDIR)$(STATEDIR)/certs || true; \
fi
- fi
- echo Creating $(STATEDIR)/certs...
- $(INSTALL_DIR) -m 511 -o $(CUPS_USER) -g $(CUPS_PRIMARY_SYSTEM_GROUP) \
- $(STATEDIR)/certs
- echo Creating $(LOGDIR)...
- $(INSTALL_DIR) -m 755 $(LOGDIR)
- echo Creating $(REQUESTS)...
- $(INSTALL_DIR) -m 710 $(REQUESTS)
- -chgrp $(CUPS_GROUP) $(REQUESTS)
- $(INSTALL_DIR) -m 710 -g $(CUPS_GROUP) $(REQUESTS)
- echo Creating $(REQUESTS)/tmp...
- $(INSTALL_DIR) -m 1770 $(REQUESTS)/tmp
- -chgrp $(CUPS_GROUP) $(REQUESTS)/tmp
- $(INSTALL_DIR) -m 1770 -g $(CUPS_GROUP) $(REQUESTS)/tmp
- echo Creating $(CACHEDIR)...
- $(INSTALL_DIR) -m 775 $(CACHEDIR)
- -chgrp $(CUPS_GROUP) $(CACHEDIR)
+# echo Creating $(LOGDIR)...
+# $(INSTALL_DIR) -m 755 $(LOGDIR)
+# echo Creating $(REQUESTS)...
+# $(INSTALL_DIR) -m 710 $(REQUESTS)
+# -chgrp $(CUPS_GROUP) $(REQUESTS)
+# echo Creating $(REQUESTS)/tmp...
+# $(INSTALL_DIR) -m 1770 $(REQUESTS)/tmp
+# -chgrp $(CUPS_GROUP) $(REQUESTS)/tmp
+ echo Creating $(DESTDIR)$(CACHEDIR)...
+ $(INSTALL_DIR) -m 775 $(DESTDIR)$(CACHEDIR)
+ -chgrp $(CUPS_GROUP) $(DESTDIR)$(CACHEDIR)
# echo Creating $(CACHEDIR)/ppd...
# $(INSTALL_DIR) -m 755 $(CACHEDIR)/ppd
# -chgrp $(CUPS_GROUP) $(CACHEDIR)/ppd
- $(INSTALL_DIR) -m 775 -g $(CUPS_GROUP) $(CACHEDIR)
#
@@ -210,10 +195,6 @@ install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSMIME) $(LIBDIR)
- if test $(LIBCUPSMIME) = "libcupsmime.so.1" -o $(LIBCUPSMIME) = "libcupsmime.sl.1"; then \
- $(RM) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
- $(LN) $(LIBCUPSMIME) $(LIBDIR)/`basename $(LIBCUPSMIME) .1`; \
- fi
if test $(LIBCUPSMIME) = "libcupsmime.1.dylib"; then \
$(RM) $(LIBDIR)/libcupsmime.dylib; \
$(LN) $(LIBCUPSMIME) $(LIBDIR)/libcupsmime.dylib; \
@@ -262,7 +243,7 @@ uninstall:
$(RM) $(LIBDIR)/libcupsmime.sl
$(RM) $(LIBDIR)/libcupsmime.sl.1
$(RM) $(LIBDIR)/libcupsmime.so
- $(RM) $(LIBDIR)/libcupsmime.so.1
+ $(RM) $(LIBDIR)/libcupsmime.so.${LIBcupsmime_VERSION}
-$(RMDIR) $(LIBDIR)
$(RM) $(INCLUDEDIR)/cups/mime.h
-$(RMDIR) $(INCLUDEDIR)/cups
@@ -359,14 +340,12 @@ cups-polld: cups-polld.o ../cups/$(LIBCUPS)
#
-# libcupsmime.so.1, libcupsmime.sl.1
+# libcupsmime.so.${LIBcupsmime_VERSION}, libcupsmime.sl.1
#
-libcupsmime.so.1 libcupsmime.sl.1: $(LIBOBJS)
+libcupsmime.so.${LIBcupsmime_VERSION} libcupsmime.sl.1: $(LIBOBJS)
echo Linking $@...
$(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
- $(RM) `basename $@ .1`
- $(LN) $@ `basename $@ .1`
#

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-scheduler_cups-driverd_c,v 1.3 2009/04/27 08:25:39 bernd Exp $
--- scheduler/cups-driverd.c.orig Mon Jun 16 19:57:44 2008
+++ scheduler/cups-driverd.c Tue Mar 17 16:36:22 2009
@@ -350,7 +350,7 @@ cat_ppd(const char *name, /* I - PPD name */
argv[0] = scheme;
argv[1] = (char *)"cat";
argv[2] = (char *)name;
- argv[3] = NULL;
+ argv[3] = (char *)0;
if (cupsdExec(line, argv))
{

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-scheduler_cups-driverd_cxx,v 1.1 2010/03/31 16:20:02 ajacoutot Exp $
--- scheduler/cups-driverd.cxx.orig Mon Aug 31 23:26:25 2009
+++ scheduler/cups-driverd.cxx Tue Oct 6 15:11:48 2009
@@ -509,7 +509,7 @@ cat_ppd(const char *name, /* I - PPD name */
argv[0] = scheme;
argv[1] = (char *)"cat";
argv[2] = (char *)name;
- argv[3] = NULL;
+ argv[3] = (char *)0;
if (cupsdExec(line, argv))
{

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-scheduler_ipp_c,v 1.3 2010/03/31 16:20:02 ajacoutot Exp $
Increase timeout for the PPD file to be copied so that it doesn't fail
on low-end configurations.
--- scheduler/ipp.c.orig Mon Jan 18 17:18:29 2010
+++ scheduler/ipp.c Wed Mar 31 15:53:43 2010
@@ -5152,7 +5152,7 @@ copy_model(cupsd_client_t *con, /* I - Client connect
FD_SET(temppipe[0], &input);
FD_SET(CGIPipes[0], &input);
- timeout.tv_sec = 30;
+ timeout.tv_sec = 90;
timeout.tv_usec = 0;
if ((i = select(maxfd, &input, NULL, NULL, &timeout)) < 0)

View File

@ -1,43 +0,0 @@
$OpenBSD: patch-scheduler_select_c,v 1.1 2009/11/22 18:10:12 jasper Exp $
SECURITY FIX for CVE-2009-3553.
CUPS "cupsdDoSelect()" Denial of Service Vulnerability.
--- scheduler/select.c.orig Sun Nov 22 18:47:44 2009
+++ scheduler/select.c Sun Nov 22 18:49:58 2009
@@ -483,7 +483,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds
(*(fdptr->read_cb))(fdptr->data);
}
- if (fdptr->write_cb && event->filter == EVFILT_WRITE)
+ if (fdptr->use > 1 && fdptr->write_cb && event->filter == EVFILT_WRITE)
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDoSelect: Write on fd %d...",
fdptr->fd);
@@ -543,7 +543,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds
(*(fdptr->read_cb))(fdptr->data);
}
- if (fdptr->write_cb && (event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
+ if (fdptr->use > 1 && fdptr->write_cb && (event->events & (EPOLLOUT | EPOLLERR | EPOLLHUP)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDoSelect: Write on fd %d...",
fdptr->fd);
@@ -655,7 +655,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds
(*(fdptr->read_cb))(fdptr->data);
}
- if (fdptr->write_cb && (pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
+ if (fdptr->use > 1 && fdptr->write_cb && (pfd->revents & (POLLOUT | POLLERR | POLLHUP)))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDoSelect: Write on fd %d...",
fdptr->fd);
@@ -725,7 +725,7 @@ cupsdDoSelect(long timeout) /* I - Timeout in seconds
(*(fdptr->read_cb))(fdptr->data);
}
- if (fdptr->write_cb && FD_ISSET(fdptr->fd, &cupsd_current_output))
+ if (fdptr->use > 1 && fdptr->write_cb && FD_ISSET(fdptr->fd, &cupsd_current_output))
{
cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdDoSelect: Write on fd %d...",
fdptr->fd);

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-systemv_Makefile,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- systemv/Makefile.orig Wed Jul 11 23:46:42 2007
+++ systemv/Makefile Tue Mar 17 16:37:06 2009
@@ -70,7 +70,7 @@ install: all
$(INSTALL_BIN) lp $(BINDIR)
$(INSTALL_BIN) lpoptions $(BINDIR)
$(INSTALL_BIN) lpstat $(BINDIR)
- $(INSTALL_BIN) -m 4755 -o root lppasswd $(BINDIR) || $(INSTALL_BIN) lppasswd $(BINDIR)
+ $(INSTALL_BIN) lppasswd $(BINDIR)
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(TARGETS); do \

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-systemv_lpadmin_c,v 1.4 2009/04/27 08:25:39 bernd Exp $
--- systemv/lpadmin.c.orig Sat Jul 12 00:48:49 2008
+++ systemv/lpadmin.c Tue Mar 17 16:21:50 2009
@@ -1956,14 +1956,14 @@ set_printer_options(
$OpenBSD: patch-systemv_lpadmin_c,v 1.5 2010/03/31 16:20:02 ajacoutot Exp $
--- systemv/lpadmin.c.orig Tue Feb 17 00:57:08 2009
+++ systemv/lpadmin.c Sun Aug 30 15:14:02 2009
@@ -1952,14 +1952,14 @@ set_printer_options(
static int /* O - 0 if name is no good, 1 if name is good */
validate_name(const char *name) /* I - Name to check */
{
@ -18,7 +18,7 @@ $OpenBSD: patch-systemv_lpadmin_c,v 1.4 2009/04/27 08:25:39 bernd Exp $
if (*ptr == '@')
break;
else if ((*ptr >= 0 && *ptr <= ' ') || *ptr == 127 || *ptr == '/' ||
@@ -1974,7 +1974,7 @@ validate_name(const char *name) /* I - Name to check
@@ -1970,7 +1970,7 @@ validate_name(const char *name) /* I - Name to check
* All the characters are good; validate the length, too...
*/

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-test_4_4-subscription-ops_test,v 1.2 2009/04/27 08:25:39 bernd Exp $
--- test/4.4-subscription-ops.test.orig Wed Nov 19 20:50:56 2008
+++ test/4.4-subscription-ops.test Mon Apr 27 10:16:38 2009
@@ -142,6 +142,33 @@
EXPECT attributes-charset
EXPECT attributes-natural-language
}
+{
+ # The name of the test...
+ NAME "Check MaxSubscriptions limits"
+
+ # The operation to use
+ OPERATION Create-Printer-Subscription
+ RESOURCE /
+
+ # The attributes to send
+ GROUP operation
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $method://$hostname:$port/printers/Test1
+
+ GROUP subscription
+ ATTR uri notify-recipient-uri testnotify://
+ ATTR keyword notify-events printer-state-changed
+ ATTR integer notify-lease-duration 5
+
+ # What statuses are OK?
+ STATUS client-error-too-many-subscriptions
+
+ # What attributes do we expect?
+ EXPECT attributes-charset
+ EXPECT attributes-natural-language
+}
+
#

View File

@ -1,11 +1,6 @@
$OpenBSD: patch-test_run-stp-tests_sh,v 1.5 2009/04/27 08:25:39 bernd Exp $
Second chunk of this patch:
Security fix for CVE-2008-5183.
Patch adapted from Red Hat's solution.
--- test/run-stp-tests.sh.orig Wed Nov 19 20:50:56 2008
+++ test/run-stp-tests.sh Sat Apr 18 00:50:57 2009
$OpenBSD: patch-test_run-stp-tests_sh,v 1.6 2010/03/31 16:20:02 ajacoutot Exp $
--- test/run-stp-tests.sh.orig Wed Dec 9 07:10:22 2009
+++ test/run-stp-tests.sh Wed Mar 31 15:53:43 2010
@@ -21,7 +21,7 @@ argcount=$#
# Make the IPP test program...
#
@ -15,12 +10,12 @@ Patch adapted from Red Hat's solution.
#
# Figure out the proper echo options...
@@ -387,7 +387,7 @@ fi
@@ -410,7 +410,7 @@ fi
export LD_LIBRARY_PATH
-LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2"
+LD_PRELOAD="$root/cups/libcups.so.$LIBcups_VERSION:$root/filter/libcupsimage.so.$LIBcupsimage_VERSION"
export LD_PRELOAD
if test "x$DYLD_LIBRARY_PATH" = x; then
-LD_PRELOAD="$root/cups/libcups.so.2:$root/filter/libcupsimage.so.2:$root/cgi-bin/libcupscgi.so.1:$root/scheduler/libcupsmime.so.1:$root/driver/libcupsdriver.so.1:$root/ppdc/libcupsppdc.so.1"
+LD_PRELOAD="$root/cups/libcups.so.${LIBcups_VERSION}:$root/filter/libcupsimage.so.${LIBcupsimage_VERSION}:$root/cgi-bin/libcupscgi.so.${LIBcupscgi_VERSION}:$root/scheduler/libcupsmime.so.${LIBcupsmime_VERSION}:$root/driver/libcupsdriver.so.${LIBcupsdriver_VERSION}:$root/ppdc/libcupsppdc.so.${LIBcupsppdc_VERSION}"
if test `uname` = SunOS -a -r /usr/lib/libCrun.so.1; then
LD_PRELOAD="/usr/lib/libCrun.so.1:$LD_PRELOAD"
fi

View File

@ -0,0 +1,7 @@
@comment $OpenBSD: PFRAG.shared,v 1.5 2010/03/31 16:20:02 ajacoutot Exp $
@lib lib/libcups.so.${LIBcups_VERSION}
@lib lib/libcupscgi.so.${LIBcupscgi_VERSION}
@lib lib/libcupsdriver.so.${LIBcupsdriver_VERSION}
@lib lib/libcupsimage.so.${LIBcupsimage_VERSION}
@lib lib/libcupsmime.so.${LIBcupsmime_VERSION}
@lib lib/libcupsppdc.so.${LIBcupsppdc_VERSION}

File diff suppressed because it is too large Load Diff