Index: head/print/cups/Makefile =================================================================== --- head/print/cups/Makefile (revision 472495) +++ head/print/cups/Makefile (revision 472496) @@ -1,123 +1,124 @@ # Created by: Alan Eldridge # $FreeBSD$ PORTNAME= cups PORTVERSION= 2.2.8 DISTVERSIONPREFIX=v +PORTREVISION= 1 CATEGORIES= print MAINTAINER= tijl@FreeBSD.org COMMENT= Common UNIX Printing System LICENSE= GPLv2 LGPL20 LICENSE_COMB= multi LICENSE_FILE_GPLv2= ${WRKSRC}/LICENSE.txt LICENSE_FILE_LGPL20= ${WRKSRC}/LICENSE.txt CONFLICTS= LPRng-[0-9]* USE_GITHUB= yes GH_ACCOUNT= apple DESTDIRNAME= DSTROOT GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-dnssd \ --disable-gssapi \ --disable-launchd \ --disable-systemd \ --with-cups-user=${USERS} \ --with-cups-group=${GROUPS} \ --with-system-groups=wheel \ --with-dbusdir="${PREFIX}/etc/dbus-1" \ --with-icondir="${PREFIX}/share/icons" \ --with-menudir="${DESKTOPDIR}" \ --with-printcap="${PREFIX}/etc/printcap" \ --with-rcdir=no \ --with-optim=" " \ --with-pam-module="unix" \ ac_cv_path_JAVA= ac_cv_path_PERL= ac_cv_path_PHPCGI= \ ac_cv_path_PHP= ac_cv_path_PYTHON= USES= cpe gmake iconv localbase pkgconfig CPE_VENDOR= apple USE_LDCONFIG= yes USE_RC_SUBR= cupsd GROUPS= cups USERS= cups OPTIONS_DEFINE= AVAHI DBUS DOCS GNUTLS IPPTOOL LIBPAPER NLS X11 OPTIONS_DEFAULT= AVAHI DBUS GNUTLS LIBPAPER OPTIONS_SUB= yes AVAHI_LIB_DEPENDS= libavahi-client.so:net/avahi-app AVAHI_CONFIGURE_ENABLE= avahi AVAHI_SUB_LIST= AVAHI_DAEMON=avahi_daemon AVAHI_SUB_LIST_OFF= AVAHI_DAEMON= DBUS_LIB_DEPENDS= libdbus-1.so:devel/dbus DBUS_CONFIGURE_ENABLE= dbus DBUS_SUB_LIST= DBUS_DAEMON=dbus DBUS_SUB_LIST_OFF= DBUS_DAEMON= GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_ON= --enable-gnutls GNUTLS_CONFIGURE_OFF= --disable-ssl IPPTOOL_DESC= Internet Printing Protocol testing tool LIBPAPER_LIB_DEPENDS= libpaper.so:print/libpaper LIBPAPER_CONFIGURE_ENABLE=libpaper X11_DESC= Install desktop menu item X11_BUILD_DEPENDS= xdg-open:devel/xdg-utils X11_RUN_DEPENDS= xdg-open:devel/xdg-utils .if defined(CUPS_OVERWRITE_BASE) PLIST_SUB+= OVERWRITE="" .else PLIST_SUB+= OVERWRITE="@comment " .endif .if exists(/usr/lib/libusb.so) PLIST_SUB+= USB="" .else PLIST_SUB+= USB="@comment " .endif .include .if empty(ICONV_LIB) CONFIGURE_ARGS+=ac_cv_search_libiconv_open=no .endif post-patch: @${REINPLACE_CMD} -e '/SILENT/d' ${WRKSRC}/Makedefs.in @${REINPLACE_CMD} 's/usblp/ulpt/g' ${WRKSRC}/backend/usb-libusb.c @${REINPLACE_CMD} -e 's|/usr/local/etc/pam.d|${LOCALBASE}/etc/pam.d|' \ -e 's/-fstack-protector//' ${WRKSRC}/configure @${FIND} ${WRKSRC}/doc ${WRKSRC}/templates -type f -exec ${SED} -i '' \ 's|http://www.cups.org|https://www.cups.org|g' {} + @${REINPLACE_CMD} '/stripopt=/s/-x//' ${WRKSRC}/install-sh @${REINPLACE_CMD} 's|/etc/cups|${LOCALBASE}/etc/cups|g' \ ${WRKSRC}/man/*.man* @${REINPLACE_CMD} -e 's|\.default|.sample|'\ ${WRKSRC}/cgi-bin/admin.c\ ${WRKSRC}/conf/Makefile .if !empty(ARCH:Mpowerpc*) @${REINPLACE_CMD} -e 's|@PIEFLAGS@||g' ${WRKSRC}/Makedefs.in .endif post-patch-DOCS-off: # Link to online documentation. @${FIND} ${WRKSRC}/doc ${WRKSRC}/templates -type f -exec ${SED} -i '' \ -e 's|[Hh][Rr][Ee][Ff]="/*help/\([{"]\)|href="https://www.cups.org/documentation.html\1|g' \ -e '/have_gssapi/s|[Hh][Rr][Ee][Ff]="/*help/|href="https\\://www.cups.org/doc/|g' \ -e 's|[Hh][Rr][Ee][Ff]="/*help/|href="https://www.cups.org/doc/|g' {} + post-install: ${LN} -sf lpr ${STAGEDIR}${PREFIX}/bin/lpr-cups ${INSTALL_DATA} ${FILESDIR}/cups.conf.sample \ ${STAGEDIR}${PREFIX}/etc/devd ${INSTALL_DATA} ${FILESDIR}/cups ${STAGEDIR}${PREFIX}/etc/pam.d .include Index: head/print/cups/files/patch-cups_ipp.c =================================================================== --- head/print/cups/files/patch-cups_ipp.c (nonexistent) +++ head/print/cups/files/patch-cups_ipp.c (revision 472496) @@ -0,0 +1,60 @@ +From 455c52a027ab3548953372a0b7bdb0008420e9ba Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +Date: Fri, 8 Jun 2018 22:29:50 +0200 +Subject: [PATCH] Fix validation rejecting all NAME and TEXT attrs + +When the UTF-8 validation loop finishes successfully, `*ptr` points at +the `'\0'` at the end of the string. The code misinterpreted this as a +control character (`*ptr < ' '`) and failed the validation. + +Fixes https://github.com/apple/cups/issues/5325 +--- + cups/ipp.c | 24 ++++++++++-------------- + 1 file changed, 10 insertions(+), 14 deletions(-) + +diff --git a/cups/ipp.c b/cups/ipp.c +index 95d53cc44..204c71fcd 100644 +--- cups/ipp.c ++++ cups/ipp.c +@@ -5030,15 +5030,13 @@ ippValidateAttribute( + else if (*ptr & 0x80) + break; + else if ((*ptr < ' ' && *ptr != '\n' && *ptr != '\r' && *ptr != '\t') || *ptr == 0x7f) +- break; ++ { ++ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); ++ return (0); ++ } + } + +- if (*ptr < ' ' || *ptr == 0x7f) +- { +- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad control character (PWG 5100.14 section 8.3)."), attr->name, attr->values[i].string.text); +- return (0); +- } +- else if (*ptr) ++ if (*ptr) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad text value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.2)."), attr->name, attr->values[i].string.text); + return (0); +@@ -5088,15 +5086,13 @@ ippValidateAttribute( + else if (*ptr & 0x80) + break; + else if (*ptr < ' ' || *ptr == 0x7f) +- break; ++ { ++ ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); ++ return (0); ++ } + } + +- if (*ptr < ' ' || *ptr == 0x7f) +- { +- ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad control character (PWG 5100.14 section 8.1)."), attr->name, attr->values[i].string.text); +- return (0); +- } +- else if (*ptr) ++ if (*ptr) + { + ipp_set_error(IPP_STATUS_ERROR_BAD_REQUEST, _("\"%s\": Bad name value \"%s\" - bad UTF-8 sequence (RFC 8011 section 5.1.3)."), attr->name, attr->values[i].string.text); + return (0); Property changes on: head/print/cups/files/patch-cups_ipp.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property