Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AirPrint and Mopria Compatibility #126

Merged
merged 26 commits into from
Mar 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fe80a7e
Add ReadyPaperSizes directive for cupsd.conf.
michaelrsweet Mar 7, 2021
0f07bc3
Add _universal sub-type.
michaelrsweet Mar 8, 2021
64fe4bf
Add mopria-certified and URF/urf-supported keys/attributes.
michaelrsweet Mar 8, 2021
b5e28e9
Fix some clang-reported warnings.
michaelrsweet Mar 8, 2021
63624e0
Add document-format-preferred and include image/urf in the TXT record.
michaelrsweet Mar 8, 2021
b781c7a
Add media-col-ready and media-ready.
michaelrsweet Mar 8, 2021
687c0ba
Fix scheduler crash when iterating supported sizes.
michaelrsweet Mar 8, 2021
6edbd4e
Refactor the media[-col]-ready code to loop through the printer's med…
michaelrsweet Mar 8, 2021
e95ce16
Fix TXT record.
michaelrsweet Mar 9, 2021
477dc74
The CUPS Snap uses "cups--control" and not "admin" any more as admin …
tillkamppeter Mar 9, 2021
136b355
Install the USB backend to run as root.
michaelrsweet Mar 10, 2021
00e3540
Free emulations (Issue #124)
michaelrsweet Mar 10, 2021
8bcbc0e
added new translations
jschwender Mar 8, 2021
aca3414
translation fix
jschwender Mar 8, 2021
83b92e6
change web page reference to openprinting web page
jschwender Mar 8, 2021
57a349a
scheduler: Admin task check: Grant access when client is our Snap
tillkamppeter Mar 10, 2021
6cbacf3
adding pkgconfig file
surajkulriya Mar 8, 2021
87f6532
Deprecate cups-config (Issue #97)
michaelrsweet Mar 10, 2021
07db18c
Do some cleanup of the pkg-config support.
michaelrsweet Mar 10, 2021
0dddb6a
Update Xcode project file.
michaelrsweet Mar 10, 2021
7720619
Fix localization of InputSlot/media-source (Issue #120)
michaelrsweet Mar 11, 2021
1340db2
Update pager.tmpl
jschwender Mar 11, 2021
40d7e6e
Changelog.
michaelrsweet Mar 11, 2021
954d47c
Address review by Till Kamppeter:
michaelrsweet Mar 11, 2021
dffa660
Fix typo
michaelrsweet Mar 11, 2021
673e0e9
Update cupsd.conf.5 man page to address feedback from Till.
michaelrsweet Mar 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/config.log
/config.status
/configure~
/cups.pc
/cups-config
/Makedefs
/backend/dnssd
Expand Down
13 changes: 9 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Changes in OpenPrinting CUPS
CUPS v2.4rc1 (Pending)
----------------------

- Added support for CUPS running in a snapcraft snap.
- Added extra check for administrative inquiries from snapped clients.
- Added support for CUPS running in a Snapcraft snap.
- Added support for AirPrint and Mopria clients (Issue #105)
- Fixed Kerberos authentication for the web interface (Issue #19)
- The ZPL sample driver now supports more "standard" label sizes (Issue #70)
- The IPP backend did not return the correct status code when a job was canceled
Expand All @@ -14,10 +14,15 @@ CUPS v2.4rc1 (Pending)
by default (Issue #85)
- The `cupsfilter` command now shows error messages when options are used
incorrectly (Issue #88)
- Documentation fixes (Issue #92)
- Kerberos (`AuthType Negotiate`) authentication is now deprecated (Issue #98)
- The PPD functions now treat boolean values as case-insensitive (Issue #106)
- Temporary queue names no longer end with an underscore (Issue #110)
- The USB backend now runs as root (Issue #121)
- Added pkg-config file for libcups (Issue #122)
- Fixed a PPD memory leak caused by emulator definitions (Issue #124)
- Documentation fixes (Issue #92)
- Localization updates (Issue #123, Issue #129)
- Deprecated cups-config (Issue #97)
- Deprecated Kerberos (`AuthType Negotiate`) authentication (Issue #98)
- Removed support for the (long deprecated and unused) `FontPath`,
`LPDConfigFile`, `RIPCache`, and `SMBConfigFile` directives in `cupsd.conf`
and `cups-files.conf`.
Expand Down
1 change: 1 addition & 0 deletions Makedefs.in
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ BUNDLEDIR = @CUPS_BUNDLEDIR@
CACHEDIR = $(BUILDROOT)@CUPS_CACHEDIR@
DATADIR = $(BUILDROOT)@CUPS_DATADIR@
DOCDIR = $(BUILDROOT)@CUPS_DOCROOT@
CUPS_PKGCONFPATH = @CUPS_PKGCONFPATH@
ICONDIR = @ICONDIR@
INCLUDEDIR = $(BUILDROOT)$(includedir)
LIBDIR = $(BUILDROOT)$(libdir)
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ distclean: clean
$(RM) Makedefs config.h config.log config.status
$(RM) conf/cups-files.conf conf/cupsd.conf conf/mime.convs conf/pam.std conf/snmp.conf
$(RM) cups-config
$(RM) cups.pc
$(RM) desktop/cups.desktop
$(RM) doc/index.html
$(RM) packaging/cups.list
Expand Down Expand Up @@ -173,6 +174,9 @@ install-data:
echo Installing cups-config script...
$(INSTALL_DIR) -m 755 $(BINDIR)
$(INSTALL_SCRIPT) cups-config $(BINDIR)/cups-config
echo Installing cups.pc file...
$(INSTALL_DIR) -m 755 $(CUPS_PKGCONFPATH)
$(INSTALL_DATA) cups.pc $(CUPS_PKGCONFPATH)/cups.pc


#
Expand Down Expand Up @@ -225,6 +229,9 @@ uninstall:
echo Uninstalling cups-config script...
$(RM) $(BINDIR)/cups-config
-$(RMDIR) $(BINDIR)
echo Uninstalling cups.pc file...
$(RM) $(CUPS_PKGCONFPATH)/cups.pc
-$(RMDIR) $(CUPS_PKGCONFPATH)


#
Expand Down
34 changes: 11 additions & 23 deletions backend/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#
# Backend makefile for CUPS.
#
# Copyright 2007-2019 by Apple Inc.
# Copyright 1997-2007 by Easy Software Products, all rights reserved.
# Copyright © 2021 by OpenPrinting.
# Copyright © 2007-2019 by Apple Inc.
# Copyright © 1997-2007 by Easy Software Products, all rights reserved.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
# Licensed under Apache License v2.0. See the file "LICENSE" for more
# information.
#

include ../Makedefs
Expand All @@ -15,28 +17,26 @@ include ../Makedefs

# RBACKENDS are installed mode 0744 so cupsd will run them as root...
#
# UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
# an unprivileged user...
# UBACKENDS are installed mode 0755 so cupsd will run them as an unprivileged
# user...
#
# See http://www.cups.org/doc/api-filter.html for more info...
RBACKENDS = \
ipp \
lpd \
usb \
$(DNSSD_BACKEND)
UBACKENDS = \
snmp \
socket
ULBACKENDS = \
usb
UNITTESTS = \
test1284 \
testbackend \
testsupplies
TARGETS = \
libbackend.a \
$(RBACKENDS) \
$(UBACKENDS) \
$(ULBACKENDS)
$(UBACKENDS)
LIBOBJS = \
ieee1284.o \
network.o \
Expand Down Expand Up @@ -65,7 +65,7 @@ all: $(TARGETS)
# Make library targets...
#

libs: $(ULBACKENDS)
libs:


#
Expand Down Expand Up @@ -161,18 +161,6 @@ install-headers:
#

install-libs:
echo Installing backends in $(SERVERBIN)/backend
$(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
for file in $(ULBACKENDS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
done
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(ULBACKENDS); do \
cp $$file $(SYMROOT); \
dsymutil $(SYMROOT)/$$file; \
done \
fi


#
Expand All @@ -185,7 +173,7 @@ uninstall:
$(RM) $(SERVERBIN)/apple/$$file; \
done
-$(RMDIR) $(SERVERBIN)/apple
for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \
for file in $(RBACKENDS) $(UBACKENDS); do \
$(RM) $(SERVERBIN)/backend/$$file; \
done
for file in $(IPPALIASES); do \
Expand Down
5 changes: 3 additions & 2 deletions backend/usb-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,8 @@ print_device(const char *uri, /* I - Device URI */


(void)uri;
(void)argc;
(void)argv;

/*
* Catch SIGQUIT to determine who is sending it...
Expand Down Expand Up @@ -1510,12 +1512,11 @@ static kern_return_t load_printerdriver(CFStringRef *driverBundlePath)
SInt32 score;
kern_return_t kr;
printer_interface_t interface;
HRESULT res;

kr = IOCreatePlugInInterfaceForService(g.printer_obj, kIOUSBInterfaceUserClientTypeID, kIOCFPlugInInterfaceID, &iodev, &score);
if (kr == kIOReturnSuccess)
{
if ((res = (*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &interface)) == noErr)
if ((*iodev)->QueryInterface(iodev, USB_INTERFACE_KIND, (LPVOID *) &interface) == noErr)
{
*driverBundlePath = IORegistryEntryCreateCFProperty(g.printer_obj, kUSBClassDriverProperty, NULL, kNilOptions);

Expand Down
21 changes: 16 additions & 5 deletions config-scripts/cups-common.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ AC_CONFIG_HEADERS([config.h])

dnl Version number information...
CUPS_VERSION="AC_PACKAGE_VERSION"
CUPS_REVISION=""
CUPS_API_VERSION="$(echo AC_PACKAGE_VERSION | awk -F. '{print $1 "." $2}')"
CUPS_BUILD="cups-$CUPS_VERSION"

AC_ARG_WITH([cups_build], AS_HELP_STRING([--with-cups-build], [set "pkg-config --variable=build" string]), [
CUPS_BUILD="$withval"
])

AC_SUBST([CUPS_VERSION])
AC_SUBST([CUPS_REVISION])
AC_SUBST([CUPS_API_VERSION])
AC_SUBST([CUPS_BUILD])
AC_DEFINE_UNQUOTED([CUPS_SVERSION], ["AC_PACKAGE_NAME v$CUPS_VERSION$CUPS_REVISION"], [Version number])
AC_DEFINE_UNQUOTED([CUPS_MINIMAL], ["AC_PACKAGE_NAME/$CUPS_VERSION$CUPS_REVISION"], [Version for HTTP headers])
AC_SUBST([CUPS_VERSION])
AC_DEFINE_UNQUOTED([CUPS_SVERSION], ["AC_PACKAGE_NAME v$CUPS_VERSION"], [Version number])
AC_DEFINE_UNQUOTED([CUPS_MINIMAL], ["AC_PACKAGE_NAME/$CUPS_VERSION"], [Version for HTTP headers])

dnl Default compiler flags...
CFLAGS="${CFLAGS:=}"
Expand Down Expand Up @@ -82,6 +82,14 @@ AC_SUBST([INSTALLSTATIC])

dnl Check for pkg-config, which is used for some other tests later on...
AC_PATH_TOOL([PKGCONFIG], [pkg-config])
PKGCONFIG_CFLAGS=""
PKGCONFIG_LIBS=""
PKGCONFIG_LIBS_STATIC=""
PKGCONFIG_REQUIRES=""
AC_SUBST([PKGCONFIG_CFLAGS])
AC_SUBST([PKGCONFIG_LIBS])
AC_SUBST([PKGCONFIG_LIBS_STATIC])
AC_SUBST([PKGCONFIG_REQUIRES])

dnl Check for libraries...
AC_SEARCH_LIBS([abs], [m], [AC_DEFINE(HAVE_ABS)])
Expand Down Expand Up @@ -278,6 +286,8 @@ AC_CHECK_HEADER([zlib.h], [
AC_SUBST([INSTALL_GZIP])
AC_SUBST([LIBZ])

PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $LIBZ"

dnl Flags for "ar" command...
AS_CASE([host_os_name], [darwin* | *bsd*], [
ARFLAGS="-rcv"
Expand Down Expand Up @@ -354,6 +364,7 @@ AS_CASE([$host_os_name], [darwin*], [
BACKLIBS="$BACKLIBS -framework IOKit"
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
LIBS="-framework CoreFoundation -framework Security $LIBS"
PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC -framework CoreFoundation -framework Security"

dnl Check for framework headers...
AC_CHECK_HEADER([ApplicationServices/ApplicationServices.h], [
Expand Down
30 changes: 30 additions & 0 deletions config-scripts/cups-directories.m4
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ dnl Fix "includedir" variable if it hasn't been specified...
AS_IF([test "$includedir" = "\${prefix}/include" -a "$prefix" = "/"], [
includedir="/usr/include"
])
AS_IF([test "$includedir" != "/usr/include"], [
PKGCONFIG_CFLAGS="$PKGCONFIG_CFLAGS -I$includedir"
])

dnl Fix "localstatedir" variable if it hasn't been specified...
AS_IF([test "$localstatedir" = "\${prefix}/var"], [
Expand Down Expand Up @@ -94,9 +97,18 @@ AS_IF([test "$libdir" = "\${exec_prefix}/lib"], [
AS_CASE(["$host_os_name"], [linux*], [
AS_IF([test -d /usr/lib64 -a ! -d /usr/lib64/fakeroot], [
libdir="$exec_prefix/lib64"
], [
libdir="$exec_prefix/lib"
])
], [*], [
libdir="$exec_prefix/lib"
])
])
AS_IF([test "$libdir" = "/usr/lib"], [
PKGCONFIG_LIBS="-lcups"
], [
PKGCONFIG_LIBS="-L$libdir -lcups"
])

dnl Setup default locations...
# Cache data...
Expand Down Expand Up @@ -185,6 +197,24 @@ AS_IF([test "$localedir" = "\${datarootdir}/locale"], [
AC_DEFINE_UNQUOTED([CUPS_LOCALEDIR], ["$CUPS_LOCALEDIR"], [Location of localization files.])
AC_SUBST([CUPS_LOCALEDIR])


# cups.pc file...
AC_ARG_WITH([pkgconfpath], AS_HELP_STRING([--with-pkgconfpath], [set path for cups.pc file]), [
pkgconfpath="$withval"
], [
pkgconfpath=""
])

AS_IF([test x$pkgconfpath = x], [
CUPS_PKGCONFPATH="$exec_prefix/lib/pkgconfig"
], [
CUPS_PKGCONFPATH="$pkgconfpath"
])
AC_DEFINE_UNQUOTED([CUPS_PKGCONFPATH], ["$CUPS_PKGCONFPATH"], [Location of cups.pc file.])
AC_SUBST([CUPS_PKGCONFPATH])



# Log files...
AC_ARG_WITH([logdir], AS_HELP_STRING([--with-logdir], [set path for log files]), [
logdir="$withval"
Expand Down
2 changes: 2 additions & 0 deletions config-scripts/cups-dnssd.m4
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ AS_IF([test $with_dnssd = yes -o $with_dnssd = mdnsresponder], [
DNSSD_BACKEND="dnssd"
IPPFIND_BIN="ippfind"
IPPFIND_MAN="ippfind.1"
PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $DNSSDLIBS"
], [
AC_MSG_RESULT([no])
AS_IF([test $with_dnssd = mdnsresponder], [
Expand All @@ -86,6 +87,7 @@ AS_IF([test $with_dnssd = avahi -o $with_dnssd = yes], [
DNSSD_BACKEND="dnssd"
IPPFIND_BIN="ippfind"
IPPFIND_MAN="ippfind.1"
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES avahi-client"
AC_DEFINE([HAVE_AVAHI], [1], [Have Avahi client library?])
AC_DEFINE([HAVE_DNSSD], [1], [Have DNS-SD support?])
], [
Expand Down
3 changes: 2 additions & 1 deletion config-scripts/cups-gssapi.m4
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ AS_IF([test x$enable_gssapi = xyes], [

SAVELIBS="$LIBS"
LIBS="$LIBS $LIBGSSAPI"

PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $LIBGSSAPI"

AC_CHECK_FUNC([__ApplePrivate_gss_acquire_cred_ex_f], [
AC_DEFINE([HAVE_GSS_ACQUIRE_CRED_EX_F], [1], [Have __ApplePrivate_gss_acquire_cred_ex_f function?])
])
Expand Down
10 changes: 8 additions & 2 deletions config-scripts/cups-snap.m4
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,22 @@ dnl

AC_ARG_ENABLE([snapped_cupsd], AS_HELP_STRING([--enable-snapped-cupsd], [enable support for packaging CUPS in a Snap]))
AC_ARG_ENABLE([snapped_clients], AS_HELP_STRING([--enable-snapped-clients], [enable support for CUPS controlling admin access from snapped clients]))
AC_ARG_WITH([our-snap-name], AS_HELP_STRING([--with-our-snap-name], [Set name of the Snap we are snapped in, only needed with --enable-snapped-cupsd, default=cups]), [
OUR_SNAP_NAME="$withval"
], [
OUR_SNAP_NAME="cups"
])
AC_DEFINE_UNQUOTED([OUR_SNAP_NAME], ["$OUR_SNAP_NAME"], [Name of the Snap we are snapped in.])
AC_ARG_WITH([snapctl], AS_HELP_STRING([--with-snapctl], [Set path for snapctl, only needed with --enable-snapped-cupsd, default=/usr/bin/snapctl]), [
SNAPCTL="$withval"
], [
SNAPCTL="/usr/bin/snapctl"
])
AC_DEFINE_UNQUOTED([SNAPCTL], ["$SNAPCTL"], [Location of snapctl program.])
AC_ARG_WITH([cups_control_slot], AS_HELP_STRING([--with-cups-control-slot], [Name for cups-control slot as defined in snapcraft.yaml, only needed with --enable-snapped-cupsd, default=admin]), [
AC_ARG_WITH([cups_control_slot], AS_HELP_STRING([--with-cups-control-slot], [Name for cups-control slot as defined in snapcraft.yaml, only needed with --enable-snapped-cupsd, default=cups-control]), [
CUPS_CONTROL_SLOT="$withval"
], [
CUPS_CONTROL_SLOT="admin"
CUPS_CONTROL_SLOT="cups-control"
])
AC_DEFINE_UNQUOTED([CUPS_CONTROL_SLOT], ["$CUPS_CONTROL_SLOT"], ["cups-control" slot name for snap.])

Expand Down
2 changes: 2 additions & 0 deletions config-scripts/cups-tls.m4
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ AS_IF([test $with_tls = yes -o $with_tls = gnutls], [
with_tls="gnutls"
TLSLIBS="$($PKGCONFIG --libs gnutls)"
TLSFLAGS="$($PKGCONFIG --cflags gnutls)"
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES gnutls"
AC_DEFINE([HAVE_TLS], [1], [Do we support TLS?])
AC_DEFINE([HAVE_GNUTLS], [1], [Do we have the GNU TLS library?])
], [
Expand All @@ -70,6 +71,7 @@ AS_IF([test $with_tls = yes -o $with_tls = gnutls], [
with_tls="gnutls"
TLSLIBS="$($LIBGNUTLSCONFIG --libs)"
TLSFLAGS="$($LIBGNUTLSCONFIG --cflags)"
PKGCONFIG_LIBS_STATIC="$PKGCONFIG_LIBS_STATIC $TLSLIBS"
AC_DEFINE([HAVE_TLS], [1], [Do we support TLS?])
AC_DEFINE([HAVE_GNUTLS], [1], [Do we have the GNU TLS library?])
])
Expand Down
1 change: 1 addition & 0 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,7 @@
#undef HAVE_SNAPDGLIB
#undef HAVE_SNAPD_CLIENT_RUN_SNAPCTL2_SYNC
#undef HAVE_SNAPCTL_IS_CONNECTED
#undef OUR_SNAP_NAME
#undef SNAPCTL
#undef CUPS_CONTROL_SLOT
#undef SUPPORT_SNAPPED_CUPSD
Expand Down
Loading