Hello community, here is the log from the commit of package cups-filters for openSUSE:Factory checked in at 2014-07-31 10:04:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/cups-filters (Old) and /work/SRC/openSUSE:Factory/.cups-filters.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "cups-filters" Changes: -------- --- /work/SRC/openSUSE:Factory/cups-filters/cups-filters.changes 2014-06-18 07:47:48.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.cups-filters.new/cups-filters.changes 2014-07-31 10:04:26.000000000 +0200 @@ -1,0 +2,47 @@ +Wed Jul 30 13:22:22 CEST 2014 - jsmeix@suse.de + +- Version upgrade to 1.0.55 + Changes in 1.0.54 (excerpt - for details see the NEWS file): + * pdftopdf: Fixed manual duplex by adding a blank page to even + pages if the total number of pages of the document is odd. + Otherwise the last page of the document would stay in + the input tray. This fixes also a side effect as the set of + even pages reducing to a zero page job if the job consists + of only one page, making Poppler's pdftops error out + (Ubuntu bug #1340435). + * cups-browsed: Do not mark a discovered printer as already + provided by another server when the other server's queue has + "disappeared" status. This queue can be from the same server + before it changed its name. + * cups-browsed: Do not create a local queue pointing to a + remote raw queue (Ubuntu bug #1335211). + * foomatic-rip, imagetoraster, pdftoraster, rastertopclx, + rastertopdf: Added colord "device_inhibit" support for + color-managed filters. + * bannertopdf: Fixed "Printer Location" and "Driver Version" + entries on test page/banners (linuxfoundation.org bug #1209). + * bannertopdf: Added new PDF template files which contain the + text strings appropriate to the banners, before the banners + were all equal, without text (linuxfoundation.org bug #1209). + * pstopdf: Use "grep -E" instead of "grep -P" as the latter + generates executable code and executes it, requiring + "execmem" privileges which could be not available in some + security policies. Thanks to Tim Waugh from Red Hat for the + patch (Red Hat bug #1079534). + * pdftoraster: Fixed segfault caused by introduction of + "no-color-management" option (linuxfoundation.org bug #1214). + * libcupsfilters: Let cupsRasterParseIPPOptions() also accept + "pwg-raster-document-type" settings with hyphen between + color space name and color depth. +- Our separated source files classified.pdf confidential.pdf + secret.pdf standard.pdf topsecret.pdf unclassified.pdf (see + the entry below dated "Thu Jun 12 17:27:56 CEST 2014") are + no longer needed because it is now provided in the upstream + sources (see "linuxfoundation.org bug #1209" entries above). +- Added CVE-2014-4336 CVE-2014-4337 bnc#883543 and + CVE-2014-4338 bnc#883536 to the matching entry below + dated "Mon Apr 28 10:49:21 CEST 2014" because those CVEs + and bncs have not been known at that time (cf. bnc#871327 + therein comment#47 and bnc#883307 therein comment#2). + +------------------------------------------------------------------- @@ -67 +114,2 @@ - (bnc#871327 therein comment#23 and subsequent comments). + (CVE-2014-4338 bnc#883536 and bnc#871327 therein comment#23 + and subsequent comments). @@ -70,2 +118,3 @@ - against OOB access are done - (bnc#871327 therein comment#30 and subsequent comments). + against OOB access are done (CVE-2014-4336 CVE-2014-4337 + bnc#883543 and bnc#871327 therein comment#30 and subsequent + comments). Old: ---- classified.pdf confidential.pdf cups-filters-1.0.54.tar.gz secret.pdf standard.pdf topsecret.pdf unclassified.pdf New: ---- cups-filters-1.0.55.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ cups-filters.spec ++++++ --- /var/tmp/diff_new_pack.VN2u7C/_old 2014-07-31 10:04:28.000000000 +0200 +++ /var/tmp/diff_new_pack.VN2u7C/_new 2014-07-31 10:04:28.000000000 +0200 @@ -36,7 +36,7 @@ # and also run: zypper vcmp 'next version' 'current version' # e.g. zypper vcmp '1.0.49' '1.0.49.20140326' -> 1.0.49 is older than 1.0.49.20140326 # and zypper vcmp '1.0.50' '1.0.49.20140326' -> 1.0.50 is newer than 1.0.49.20140326 -Version: 1.0.54 +Version: 1.0.55 Release: 0 # tarball_version is used below to specify the directory via "setup -n": # Special tarball_version needed for current cups-filters e.g. "define tarball_version 9.10rc1". @@ -44,14 +44,6 @@ # Special tarball_version needed for current cups-filters e.g. "define tarball_version 9.10rc1". %define tarball_version %{version} Source0: http://www.openprinting.org/download/cups-filters/cups-filters-%{tarball_version}.tar.gz -# PDF template files for PDF-BANNER printouts -# see https://bugs.linuxfoundation.org/show_bug.cgi?id=1209 -Source10: classified.pdf -Source11: confidential.pdf -Source12: secret.pdf -Source13: standard.pdf -Source14: topsecret.pdf -Source15: unclassified.pdf # Since cups-filters version 1.0.42 foomatic-rip is also provided by cups-filters. # The foomatic-rip version that is provided by cups-filters is not specified in the cups-filters sources # but on http://www.openprinting.org/download/foomatic/ the foomatic-filters-4.0-current.tar.gz @@ -331,23 +323,6 @@ rm -f %{buildroot}%{_libdir}/lib*.la # Not sure what is this good for rm -f %{buildroot}%{_bindir}/ttfread -# Install the PDF template files for PDF-BANNER printouts and -# modify the banner template files accordingly to use those PDF template files -# see https://bugs.linuxfoundation.org/show_bug.cgi?id=1209 -install -m 644 %{SOURCE10} %{buildroot}%{_datadir}/cups/data/classified.pdf -install -m 644 %{SOURCE11} %{buildroot}%{_datadir}/cups/data/confidential.pdf -install -m 644 %{SOURCE12} %{buildroot}%{_datadir}/cups/data/secret.pdf -install -m 644 %{SOURCE13} %{buildroot}%{_datadir}/cups/data/standard.pdf -install -m 644 %{SOURCE14} %{buildroot}%{_datadir}/cups/data/topsecret.pdf -install -m 644 %{SOURCE15} %{buildroot}%{_datadir}/cups/data/unclassified.pdf -for T in classified confidential secret standard topsecret unclassified -do F="%{buildroot}%{_datadir}/cups/banners/$T" - if grep -q 'Template default.pdf' $F - then sed -i -e "s/Template default.pdf/Template $T.pdf/" $F - else echo "No longer 'Template default.pdf' in banner template file $T - clean up cups-filters.spec" - exit 9 - fi -done %post /sbin/ldconfig ++++++ cups-filters-1.0.54.tar.gz -> cups-filters-1.0.55.tar.gz ++++++ ++++ 1674 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/INSTALL new/cups-filters-1.0.55/INSTALL --- old/cups-filters-1.0.54/INSTALL 2014-06-06 16:26:11.000000000 +0200 +++ new/cups-filters-1.0.55/INSTALL 2014-07-27 19:47:52.000000000 +0200 @@ -1,4 +1,4 @@ -INSTALL - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06 +INSTALL - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27 -------------------------------------------------------- This file describes how to compile and install OpenPrinting CUPS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/Makefile.am new/cups-filters-1.0.55/Makefile.am --- old/cups-filters-1.0.54/Makefile.am 2014-05-15 15:02:49.000000000 +0200 +++ new/cups-filters-1.0.55/Makefile.am 2014-06-18 14:04:59.000000000 +0200 @@ -207,7 +207,13 @@ data/form_english_in.odt \ data/form_russian_in.odt \ data/default-testpage.pdf \ - data/testprint + data/testprint \ + data/classified.pdf \ + data/confidential.pdf \ + data/secret.pdf \ + data/standard.pdf \ + data/topsecret.pdf \ + data/unclassified.pdf EXTRA_DIST += $(pkgcupsdata_DATA) @@ -467,7 +473,9 @@ $(FONTCONFIG_LIBS) \ libfontembed.la -bannertopdf_DEPENDENCIES = $(GETLINE) +bannertopdf_DEPENDENCIES = \ + $(GETLINE) \ + libfontembed.la commandtoescpx_SOURCES = \ cupsfilters/driver.h \ @@ -566,10 +574,14 @@ filter/rastertopdf.cpp rastertopdf_CXXFLAGS = \ $(CUPS_CFLAGS) \ - $(LIBQPDF_CFLAGS) + $(LCMS_CFLAGS) \ + $(LIBQPDF_CFLAGS) \ + -I$(srcdir)/cupsfilters/ rastertopdf_LDADD = \ $(CUPS_LIBS) \ - $(LIBQPDF_LIBS) + $(LCMS_LIBS) \ + $(LIBQPDF_LIBS) \ + libcupsfilters.la pdftoijs_SOURCES = \ filter/pdftoijs.cxx \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/NEWS new/cups-filters-1.0.55/NEWS --- old/cups-filters-1.0.54/NEWS 2014-06-06 16:25:32.000000000 +0200 +++ new/cups-filters-1.0.55/NEWS 2014-07-27 19:48:09.000000000 +0200 @@ -1,6 +1,54 @@ -NEWS - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06 +NEWS - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27 ----------------------------------------------------- +CHANGES IN V1.0.55 + + - pdftopdf: Fixed manual duplex by adding a blank page to evn + pages if the total number of pages of the document is + odd. Otherwise the last page of the document would stay in + the input tray. This fixes also a side effect as the set of + even pages reducing to a zero page job if the job consists + of only one page, making Poppler's pdftops error out (Ubuntu + bug #1340435). + - cups-browsed: Do not mark a discovered printer as already + provided by another server when the other server's queue has + "disappeared" status. This queue can be from the same server + before it changed its name. + - cups-browsed: Do not create a local queue pointing to a + remote raw queue (Ubuntu bug #1335211). + - foomatic-rip, imagetoraster, pdftoraster, rastertopclx, + rastertopdf: Added colord "device_inhibit" support for + color-managed filters. + - foomatic-rip: Let it also build correctly on systems which + already provide the strlcat() and strlcpy() functions, like + Mac OS X. Thanks to Matt Broughton for reporting this + (bug #1215). + - bannertopdf: Added support for PPD-less printing, especially + one gets a useful test page with PPD-less queues now. + - bannertopdf: Fixed "Printer Location" and "Driver Version" + entries on the test page/the banners. + - bannertopdf: Added new PDF template files which contain the + text strings appropriate to the banners, before the banners + were all equal, without text. Thanks to Johannes Meixner + from SUSE/Novell for this fix (Bug #1209). + - bannertopdf: Fixed Makefile to mark it dependent on + libfontembed.la. Thanks to Tim Waugh from Red Hat for the + patch (Red Hat bug #1106101). + - pstopdf: Use "grep -E" instead of "grep -P" as the latter + generates executable code and executes it, requiring + "execmem" privileges which could be not available in some + security policies. Thanks to Tim Waugh from Red Hat for the + patch (Red Hat bug #1079534). + - foomatic-rip: NetBSD does not provide a mkstemps() function, + use appropriate workaround then (Bug #1211). + - cups-browsed: Reorder inclusion of headers for compatibility + with NetBSD (Bug #1212). + - pdftoraster: Fixed segfault caused by introduction of + "no-color-management" option (Bug #1214). + - libcupsfilters: Let cupsRasterParseIPPOptions() also accept + "pwg-raster-document-type" settings with hyphen between + color space name and color depth. + CHANGES IN V1.0.54 - pdftoraster: Support for output in the color spaces 18 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/README new/cups-filters-1.0.55/README --- old/cups-filters-1.0.54/README 2014-06-06 16:25:51.000000000 +0200 +++ new/cups-filters-1.0.55/README 2014-07-27 19:47:35.000000000 +0200 @@ -1,4 +1,4 @@ -README - OpenPrinting CUPS Filters v1.0.54 - 2014-06-06 +README - OpenPrinting CUPS Filters v1.0.55 - 2014-07-27 ------------------------------------------------------- Looking for compile instructions? Read the file "INSTALL.txt" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/classified new/cups-filters-1.0.55/banners/classified --- old/cups-filters-1.0.54/banners/classified 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/classified 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template classified.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/confidential new/cups-filters-1.0.55/banners/confidential --- old/cups-filters-1.0.54/banners/confidential 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/confidential 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template confidential.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/secret new/cups-filters-1.0.55/banners/secret --- old/cups-filters-1.0.54/banners/secret 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/secret 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template secret.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/standard new/cups-filters-1.0.55/banners/standard --- old/cups-filters-1.0.54/banners/standard 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/standard 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template standard.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/topsecret new/cups-filters-1.0.55/banners/topsecret --- old/cups-filters-1.0.54/banners/topsecret 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/topsecret 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template topsecret.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/banners/unclassified new/cups-filters-1.0.55/banners/unclassified --- old/cups-filters-1.0.54/banners/unclassified 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/banners/unclassified 2014-06-14 19:58:26.000000000 +0200 @@ -1,4 +1,4 @@ #PDF-BANNER -Template default.pdf +Template unclassified.pdf Show printer-name printer-info printer-location printer-make-and-model printer-driver-name printer-driver-version paper-size imageable-area job-id options time-at-creation time-at-processing diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/config.h.in new/cups-filters-1.0.55/config.h.in --- old/cups-filters-1.0.54/config.h.in 2014-06-06 16:28:20.000000000 +0200 +++ new/cups-filters-1.0.55/config.h.in 2014-07-27 19:50:46.000000000 +0200 @@ -129,6 +129,12 @@ /* Define to 1 if you have the <string.h> header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strlcat' function. */ +#undef HAVE_STRLCAT + +/* Define to 1 if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY + /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/configure.ac new/cups-filters-1.0.55/configure.ac --- old/cups-filters-1.0.54/configure.ac 2014-06-06 16:26:23.000000000 +0200 +++ new/cups-filters-1.0.55/configure.ac 2014-07-27 19:48:22.000000000 +0200 @@ -7,7 +7,7 @@ # ==================== m4_define([cups_filters_version_major],[1]) m4_define([cups_filters_version_minor],[0]) -m4_define([cups_filters_version_micro],[54]) +m4_define([cups_filters_version_micro],[55]) m4_define([cups_filters_version],[cups_filters_version_major.cups_filters_version_minor.cups_filters_version_micro]) # ============= @@ -169,6 +169,8 @@ # ====================== # Check system functions # ====================== +AC_CHECK_FUNCS(strlcat) +AC_CHECK_FUNCS(strlcpy) AC_CHECK_FUNCS(sigaction) AC_CHECK_FUNCS(waitpid wait3) AC_CHECK_FUNCS(strtoll) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/cupsfilters/raster.c new/cups-filters-1.0.55/cupsfilters/raster.c --- old/cups-filters-1.0.54/cupsfilters/raster.c 2013-12-11 22:21:56.000000000 +0100 +++ new/cups-filters-1.0.55/cupsfilters/raster.c 2014-06-06 19:34:23.000000000 +0200 @@ -763,14 +763,14 @@ bitspercolor = 8; if (!strncasecmp(val, "AdobeRgb", 8)) { - if (*(val + 8) == '_') + if (*(val + 8) == '_' || *(val + 8) == '-') ptr = val + 9; colorspace = 20; numcolors = 3; } else if (!strncasecmp(val, "Black", 5)) { - if (*(val + 5) == '_') + if (*(val + 5) == '_' || *(val + 5) == '-') ptr = val + 6; bitspercolor = 1; colorspace = 3; @@ -778,7 +778,7 @@ } else if (!strncasecmp(val, "Cmyk", 4)) { - if (*(val + 4) == '_') + if (*(val + 4) == '_' || *(val + 4) == '-') ptr = val + 5; colorspace = 6; numcolors = 4; @@ -787,7 +787,7 @@ { ptr = val + 6; numcolors = strtol(ptr, (char **)&ptr, 10); - if (*ptr == '_') + if (*ptr == '_' || *ptr == '-') { ptr ++; colorspace = 47 + numcolors; @@ -800,21 +800,21 @@ } else if (!strncasecmp(val, "Sgray", 5)) { - if (*(val + 5) == '_') + if (*(val + 5) == '_' || *(val + 5) == '-') ptr = val + 6; colorspace = 18; numcolors = 1; } else if (!strncasecmp(val, "Srgb", 4)) { - if (*(val + 4) == '_') + if (*(val + 4) == '_' || *(val + 4) == '-') ptr = val + 5; colorspace = 19; numcolors = 3; } else if (!strncasecmp(val, "Rgb", 3)) { - if (*(val + 3) == '_') + if (*(val + 3) == '_' || *(val + 3) == '-') ptr = val + 4; colorspace = 1; numcolors = 3; Files old/cups-filters-1.0.54/data/classified.pdf and new/cups-filters-1.0.55/data/classified.pdf differ Files old/cups-filters-1.0.54/data/confidential.pdf and new/cups-filters-1.0.55/data/confidential.pdf differ Files old/cups-filters-1.0.54/data/secret.pdf and new/cups-filters-1.0.55/data/secret.pdf differ Files old/cups-filters-1.0.54/data/standard.pdf and new/cups-filters-1.0.55/data/standard.pdf differ Files old/cups-filters-1.0.54/data/topsecret.pdf and new/cups-filters-1.0.55/data/topsecret.pdf differ Files old/cups-filters-1.0.54/data/unclassified.pdf and new/cups-filters-1.0.55/data/unclassified.pdf differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/bannertopdf.c new/cups-filters-1.0.55/filter/bannertopdf.c --- old/cups-filters-1.0.54/filter/bannertopdf.c 2014-02-27 16:33:34.000000000 +0100 +++ new/cups-filters-1.0.55/filter/bannertopdf.c 2014-06-16 23:45:47.000000000 +0200 @@ -28,6 +28,12 @@ #include <cups/cups.h> #include <cups/ppd.h> +#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 6) +#define HAVE_CUPS_1_7 1 +#endif +#ifdef HAVE_CUPS_1_7 +#include <cups/pwg.h> +#endif /* HAVE_CUPS_1_7 */ #include "banner.h" #include "pdf.h" @@ -71,8 +77,14 @@ 756.0, /* top */ }; const ppd_size_t *pagesize; +#ifdef HAVE_CUPS_1_7 + pwg_media_t *size_found; /* page size found for given name */ + const char *val; /* Pointer into value */ + char *ptr1, *ptr2, /* Pointer into string */ + s[255]; /* Temporary string */ +#endif /* HAVE_CUPS_1_7 */ - if (!(pagesize = ppdPageSize(ppd, NULL))) + if (!ppd || !(pagesize = ppdPageSize(ppd, NULL))) pagesize = &defaultsize; *width = pagesize->width; @@ -90,20 +102,72 @@ media_limits[3] = get_float_option("page-top", noptions, options, fabs(pagesize->top)); + +#ifdef HAVE_CUPS_1_7 + if (!ppd) { + if ((val = cupsGetOption("media-size", noptions, options)) != NULL || + (val = cupsGetOption("MediaSize", noptions, options)) != NULL || + (val = cupsGetOption("page-size", noptions, options)) != NULL || + (val = cupsGetOption("PageSize", noptions, options)) != NULL || + (val = cupsGetOption("media", noptions, options)) != NULL) { + for (ptr1 = (char *)val; *ptr1;) { + for (ptr2 = s; *ptr1 && *ptr1 != ',' && (ptr2 - s) < (sizeof(s) - 1);) + *ptr2++ = *ptr1++; + *ptr2++ = '\0'; + if (*ptr1 == ',') + ptr1 ++; + size_found = NULL; + if ((size_found = pwgMediaForPWG(s)) == NULL) + if ((size_found = pwgMediaForPPD(s)) == NULL) + size_found = pwgMediaForLegacy(s); + if (size_found != NULL) { + *width = size_found->width * 72.0 / 2540.0; + *length = size_found->length * 72.0 / 2540.0; + media_limits[2] += (*width - 612.0); + media_limits[3] += (*length - 792.0); + } + } + } + if ((val = cupsGetOption("media-left-margin", noptions, options)) + != NULL) + media_limits[0] = atol(val) * 72.0 / 2540.0; + if ((val = cupsGetOption("media-bottom-margin", noptions, options)) + != NULL) + media_limits[1] = atol(val) * 72.0 / 2540.0; + if ((val = cupsGetOption("media-right-margin", noptions, options)) + != NULL) + media_limits[2] = *width - atol(val) * 72.0 / 2540.0; + if ((val = cupsGetOption("media-top-margin", noptions, options)) + != NULL) + media_limits[3] = *length - atol(val) * 72.0 / 2540.0; + } +#endif /* HAVE_CUPS_1_7 */ } -static int duplex_marked(ppd_file_t *ppd) +static int duplex_marked(ppd_file_t *ppd, + int noptions, + cups_option_t *options) { + const char *val; /* Pointer into value */ return - ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") || + (ppd && + (ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") || ppdIsMarked(ppd, "Duplex", "DuplexTumble") || ppdIsMarked(ppd, "JCLDuplex", "DuplexNoTumble") || ppdIsMarked(ppd, "JCLDuplex", "DuplexTumble") || ppdIsMarked(ppd, "EFDuplex", "DuplexNoTumble") || ppdIsMarked(ppd, "EFDuplex", "DuplexTumble") || ppdIsMarked(ppd, "KD03Duplex", "DuplexNoTumble") || - ppdIsMarked(ppd, "KD03Duplex", "DuplexTumble"); + ppdIsMarked(ppd, "KD03Duplex", "DuplexTumble"))) || + ((val = cupsGetOption("Duplex", noptions, options)) + != NULL && + (!strcasecmp(val, "DuplexNoTumble") || + !strcasecmp(val, "DuplexTumble"))) || + ((val = cupsGetOption("sides", noptions, options)) + != NULL && + (!strcasecmp(val, "two-sided-long-edge") || + !strcasecmp(val, "two-sided-short-edge"))); } @@ -198,6 +262,7 @@ int noptions, cups_option_t *options) { + ppd_attr_t *attr; opt_t *opt = NULL; /* Job ID */ @@ -252,7 +317,7 @@ cupsGetOption("security-context-range", noptions, options)); /* Security context current range part */ - char * full_range = cupsGetOption("security-context-range", noptions, options); + const char * full_range = cupsGetOption("security-context-range", noptions, options); if ( full_range ) { size_t cur_size = strcspn(full_range, "-"); char * cur_range = strndup(full_range, cur_size); @@ -271,14 +336,18 @@ opt = add_opt(opt, "security-context-user", cupsGetOption("security-context-user", noptions, options)); - /* Driver */ - opt = add_opt(opt, "driver", ppd->pcfilename); + if (ppd) { + /* Driver */ + opt = add_opt(opt, "driver", ppd->pcfilename); + + /* Driver version */ + opt = add_opt(opt, "driver-version", + (attr = ppdFindAttr(ppd, "FileVersion", NULL)) ? + attr->value : ""); - /* Driver version */ - opt = add_opt(opt, "driver-version", ppd->pcfilename); - - /* Make and model */ - opt = add_opt(opt, "make-and-model", ppd->nickname); + /* Make and model */ + opt = add_opt(opt, "make-and-model", ppd->nickname); + } return opt; } @@ -371,10 +440,10 @@ info_line(s, "Job UUID", cupsGetOption("job-uuid", noptions, options)); - if (banner->infos & INFO_PRINTER_DRIVER_NAME) + if (ppd && banner->infos & INFO_PRINTER_DRIVER_NAME) info_line(s, "Driver", ppd->pcfilename); - if (banner->infos & INFO_PRINTER_DRIVER_VERSION) + if (ppd && banner->infos & INFO_PRINTER_DRIVER_VERSION) info_line(s, "Driver Version", (attr = ppdFindAttr(ppd, "FileVersion", NULL)) ? attr->value : ""); @@ -382,9 +451,9 @@ info_line(s, "Description", getenv("PRINTER_INFO")); if (banner->infos & INFO_PRINTER_LOCATION) - info_line(s, "Driver Version", getenv("PRINTER_INFO")); + info_line(s, "Printer Location", getenv("PRINTER_LOCATION")); - if (banner->infos & INFO_PRINTER_MAKE_AND_MODEL) + if (ppd && banner->infos & INFO_PRINTER_MAKE_AND_MODEL) info_line(s, "Make and Model", ppd->nickname); if (banner->infos & INFO_PRINTER_NAME) @@ -436,7 +505,7 @@ } copies = get_int_option("number-up", noptions, options, 1); - if (duplex_marked(ppd)) + if (duplex_marked(ppd, noptions, options)) copies *= 2; if (copies > 1) @@ -465,14 +534,14 @@ } ppd = ppdOpenFile(getenv("PPD")); - if (!ppd) { - fprintf(stderr, "Error: could not open PPD file '%s'\n", getenv("PPD")); - return 1; - } + if (!ppd) + fprintf(stderr, "DEBUG: Could not open PPD file '%s'\n", getenv("PPD")); noptions = cupsParseOptions(argv[5], 0, &options); - ppdMarkDefaults(ppd); - cupsMarkOptions(ppd, noptions, options); + if (ppd) { + ppdMarkDefaults(ppd); + cupsMarkOptions(ppd, noptions, options); + } banner = banner_new_from_file(argc == 7 ? argv[6] : "-", &noptions, &options); if (!banner) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/foomaticrip.c new/cups-filters-1.0.55/filter/foomatic-rip/foomaticrip.c --- old/cups-filters-1.0.54/filter/foomatic-rip/foomaticrip.c 2014-06-06 10:49:59.000000000 +0200 +++ new/cups-filters-1.0.55/filter/foomatic-rip/foomaticrip.c 2014-06-23 12:48:30.000000000 +0200 @@ -142,9 +142,10 @@ int pdfconvertedtops; -/* no-color-management flag */ -int cm_off = 0; +/* cm-calibration flag */ +int cm_calibrate = 0; +int device_inhibited = 0; /* These variables were in 'dat' before */ char colorprofile [128]; @@ -320,10 +321,15 @@ _log("Pondering option '%s'\n", key); /* "profile" option to supply a color correction profile to a CUPS raster driver */ - if (!strcmp(key, "profile") && !cm_off) { + if (!strcmp(key, "profile")) { strlcpy(colorprofile, value, 128); continue; } + /* option to set color calibration mode */ + if (!strcmp(key, "cm-calibration")) { + cm_calibrate = 1; + continue; + } /* Solaris options that have no reason to be */ if (!strcmp(key, "nobanner") || !strcmp(key, "dest") || !strcmp(key, "protocol")) continue; @@ -416,6 +422,15 @@ } free(cmdlineopts); + /* We 'clear' the profile if cm-calibration mode was specified */ + if (cm_calibrate) { + colorprofile[0] = '\0'; + device_inhibited = 1; + } + + _log("CM Color Calibration Mode in CUPS: %s\n", cm_calibrate ? + "Activated" : "Off"); + _log("Options from the PPD file:\n"); cmdlineopts = strdup(job->optstr->data); for (nextopt = extract_next_option(cmdlineopts, &pagerange, &key, &value); @@ -701,7 +716,7 @@ char *p, *filename; const char *path; FILE *ppdfh = NULL; - char tmp[1024], gstoraster[256]; + char tmp[1024], gstoraster[256], tmpstr[1024]; int havefilter, havegstoraster; dstr_t *filelist; list_t * arglist; @@ -740,7 +755,7 @@ debug = 1; if (debug) { -#ifdef __UCLIBC__ +#if defined(__UCLIBC__) || defined(__NetBSD__) sprintf(tmp, "%s-log-XXXXXX", LOG_FILE); int fd = mkstemp (tmp); #else @@ -781,6 +796,9 @@ spooler = SPOOLER_CUPS; } + snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); + device_inhibited = colord_get_inhibit_for_device_id (tmpstr); + /* CUPS calls foomatic-rip only with 5 or 6 positional parameters, not with named options, like for example "-p <string>". */ if (spooler != SPOOLER_CUPS) { @@ -806,9 +824,11 @@ while ((str = arglist_get_value(arglist, "-o"))) { strncpy_omit(tmp, str, 1024, omit_shellescapes); dstrcatf(job->optstr, "%s ", tmp); - /* if "-o no-color-management" was passed, we raise a flag */ - if (!strcmp(tmp, "no-color-management")) - cm_off = 1; + /* if "-o cm-calibration" was passed, we raise a flag */ + if (!strcmp(tmp, "cm-calibration")) { + cm_calibrate = 1; + device_inhibited = 1; + } arglist_remove(arglist, "-o"); /* We print without spooler */ spooler = SPOOLER_DIRECT; @@ -828,6 +848,9 @@ } + _log("'CM Color Calibration' Mode in SPOOLER-LESS: %s\n", cm_calibrate ? + "Activated" : "Off"); + /* spooler specific initialization */ switch (spooler) { @@ -947,23 +970,26 @@ const char **qualifier = NULL; const char *icc_profile = NULL; - qualifier = get_ppd_qualifier(); - _log("INFO: Using qualifer: '%s.%s.%s'\n", - qualifier[0], qualifier[1], qualifier[2]); + if (!device_inhibited) { + qualifier = get_ppd_qualifier(); + _log("INFO: Using qualifer: '%s.%s.%s'\n", + qualifier[0], qualifier[1], qualifier[2]); /* ask colord for the profile */ - icc_profile = colord_get_profile_for_device_id ((const char *) getenv("PRINTER"), - qualifier); - /* fall back to PPD */ - if (icc_profile == NULL) { - _log("INFO: need to look in PPD for matching qualifer\n"); - icc_profile = get_icc_profile_for_qualifier(qualifier); + icc_profile = colord_get_profile_for_device_id ((const char *) getenv("PRINTER"), + qualifier); + + /* fall back to PPD */ + if (icc_profile == NULL) { + _log("INFO: need to look in PPD for matching qualifer\n"); + icc_profile = get_icc_profile_for_qualifier(qualifier); + } } /* ICC profile is specified for Ghostscript unless - "no-color-management" option was passed in foomatic-rip */ - if (icc_profile != NULL && !cm_off) + "cm-calibration" option was passed in foomatic-rip */ + if (icc_profile != NULL) snprintf(cmd, sizeof(cmd), "-sOutputICCProfile='%s'", icc_profile); else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/util.c new/cups-filters-1.0.55/filter/foomatic-rip/util.c --- old/cups-filters-1.0.54/filter/foomatic-rip/util.c 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/filter/foomatic-rip/util.c 2014-06-20 21:23:39.000000000 +0200 @@ -164,6 +164,7 @@ #endif #ifndef __OpenBSD__ +#ifndef HAVE_STRLCPY size_t strlcpy(char *dest, const char *src, size_t size) { char *pdest = dest; @@ -182,7 +183,9 @@ while (*psrc++); return (psrc - src -1); } +#endif /* ! HAVE_STRLCPY */ +#ifndef HAVE_STRLCAT size_t strlcat(char *dest, const char *src, size_t size) { char *pdest = dest; @@ -203,6 +206,7 @@ return len + (psrc - src); } +#endif /* ! HAVE_STRLCAT */ #endif /* ! __OpenBSD__ */ void strrepl(char *str, const char *chars, char repl) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/foomatic-rip/util.h new/cups-filters-1.0.55/filter/foomatic-rip/util.h --- old/cups-filters-1.0.54/filter/foomatic-rip/util.h 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/filter/foomatic-rip/util.h 2014-06-20 21:20:39.000000000 +0200 @@ -70,8 +70,12 @@ /* Copy at most size-1 characters from src to dest dest will always be \0 terminated (unless size == 0) returns strlen(src) */ +#ifndef HAVE_STRLCPY size_t strlcpy(char *dest, const char *src, size_t size); +#endif /* ! HAVE_STRLCPY */ +#ifndef HAVE_STRLCAT size_t strlcat(char *dest, const char *src, size_t size); +#endif /* ! HAVE_STRLCAT */ /* Replace all occurences of each of the characters in 'chars' by 'repl' */ void strrepl(char *str, const char *chars, char repl); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/gstopxl new/cups-filters-1.0.55/filter/gstopxl --- old/cups-filters-1.0.54/filter/gstopxl 2014-06-06 16:28:31.000000000 +0200 +++ new/cups-filters-1.0.55/filter/gstopxl 2014-07-27 19:50:54.000000000 +0200 @@ -208,11 +208,11 @@ cat >"$ifile" -echo INFO: Starting GPL Ghostscript `gs --version`... 1>&2 -echo DEBUG: Running gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" 1>&2 +echo INFO: Starting GPL Ghostscript `/usr/bin/gs --version`... 1>&2 +echo DEBUG: Running /usr/bin/gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" 1>&2 # Now run Ghostscript... -gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" +/usr/bin/gs $gsopts $ppd_opts -sOUTPUTFILE="%stdout" -c "$ps_code" -f "$ifile" # # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/gstoraster.c new/cups-filters-1.0.55/filter/gstoraster.c --- old/cups-filters-1.0.54/filter/gstoraster.c 2014-06-06 10:49:59.000000000 +0200 +++ new/cups-filters-1.0.55/filter/gstoraster.c 2014-06-18 14:04:59.000000000 +0200 @@ -545,6 +545,7 @@ int n; int num_options; int status = 1; + int cm_calibrate = 0; ppd_file_t *ppd = NULL; struct sigaction sa; #ifdef HAVE_CUPS_1_7 @@ -621,12 +622,14 @@ goto out; } - /* support colord and the "no-color-management" option */ + /* support colord and the "cm-calibration" option */ snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); device_inhibited = colord_get_inhibit_for_device_id (tmpstr); - t = cupsGetOption("no-color-management", num_options, options); - if (t != NULL) + t = cupsGetOption("cm-calibration", num_options, options); + if (t != NULL) { device_inhibited = 1; + cm_calibrate = 1; + } if (device_inhibited) fprintf(stderr, "DEBUG: Device is inhibited, no CM performed\n"); if (ppd) @@ -648,6 +651,9 @@ fprintf(stderr, "DEBUG: Using ICC Profile '%s'\n", icc_profile); } + fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ? + "Calibration Mode/Enabled" : "Calibration Mode/Off"); + /* Ghostscript parameters */ gs_args = cupsArrayNew(NULL, NULL); if (!gs_args) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/imagetoraster.c new/cups-filters-1.0.55/filter/imagetoraster.c --- old/cups-filters-1.0.54/filter/imagetoraster.c 2014-06-06 10:49:59.000000000 +0200 +++ new/cups-filters-1.0.55/filter/imagetoraster.c 2014-06-23 12:48:30.000000000 +0200 @@ -36,6 +36,7 @@ */ #include "common.h" +#include <cupsfilters/colord.h> #include <cupsfilters/image-private.h> #include <unistd.h> #include <math.h> @@ -191,8 +192,9 @@ int plane, /* Current color plane */ num_planes; /* Number of color planes */ char filename[1024]; /* Name of file to print */ - int cm_off; /* Is color management off? */ - + int cm_calibrate; /* Are we color calibrating the device? */ + int device_inhibited; + char tmpstr[1024]; /* * Make sure status messages are not buffered... @@ -217,6 +219,8 @@ return (1); } + cm_calibrate = 0; + /* * See if we need to use the imagetops and pstoraster filters instead... */ @@ -493,11 +497,17 @@ else resolution = ""; - /* support the "no-color-management" option */ - if ((cupsGetOption("no-color-management", num_options, options)) == NULL) - cm_off = 1; - else - cm_off = 0; + snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); + device_inhibited = colord_get_inhibit_for_device_id (tmpstr); + + /* support the "cm-calibration" option */ + if ((cupsGetOption("cm-calibration", num_options, options)) != NULL) { + cm_calibrate = 1; + device_inhibited = 1; + } + + fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ? + "Calibration Mode/Enabled" : "Calibration Mode/Off"); /* * Choose the appropriate colorspace... @@ -612,7 +622,7 @@ */ if ((val = cupsGetOption("profile", num_options, options)) != NULL && - !cm_off) + !device_inhibited) { profile = &userprofile; sscanf(val, "%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f", @@ -636,8 +646,7 @@ userprofile.matrix[2][1] *= 0.001f; userprofile.matrix[2][2] *= 0.001f; } - else if (ppd != NULL && - !cm_off) + else if (ppd != NULL && !device_inhibited) { fprintf(stderr, "DEBUG: Searching for profile \"%s/%s\"...\n", resolution, media_type); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pdftopdf/pdftopdf_processor.cc new/cups-filters-1.0.55/filter/pdftopdf/pdftopdf_processor.cc --- old/cups-filters-1.0.54/filter/pdftopdf/pdftopdf_processor.cc 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/filter/pdftopdf/pdftopdf_processor.cc 2014-07-27 19:39:40.000000000 +0200 @@ -328,7 +328,7 @@ } } - if ( (param.evenDuplex)&&(outputno&1) ) { + if ( (param.evenDuplex || !param.oddPages) && (outputno & 1) ) { // need to output empty page to not confuse duplex proc.add_page(proc.new_page(param.page.width,param.page.height),param.reverse); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pdftoraster.cxx new/cups-filters-1.0.55/filter/pdftoraster.cxx --- old/cups-filters-1.0.54/filter/pdftoraster.cxx 2014-06-06 12:40:02.000000000 +0200 +++ new/cups-filters-1.0.55/filter/pdftoraster.cxx 2014-06-23 12:48:30.000000000 +0200 @@ -53,6 +53,7 @@ #include <cups/raster.h> #include <cupsfilters/image.h> #include <cupsfilters/raster.h> +#include <cupsfilters/colord.h> #include <splash/SplashTypes.h> #include <splash/SplashBitmap.h> #include <strings.h> @@ -188,7 +189,8 @@ cmsHTRANSFORM colorTransform = NULL; cmsCIEXYZ D65WhitePoint; int renderingIntent = INTENT_PERCEPTUAL; - bool cm_off = false; + int device_inhibited = 0; + bool cm_calibrate = false; } #if POPPLER_VERSION_MAJOR > 0 || POPPLER_VERSION_MINOR >= 19 @@ -364,6 +366,7 @@ int num_options = 0; cups_option_t *options = 0; GooString profilePath; + char tmpstr[1024]; ppd_attr_t *attr; if (argc < 6 || argc > 7) { @@ -443,10 +446,17 @@ } } } - /* support the "no-color-management" option */ - if (cupsGetOption("no-color-management", num_options, options) == NULL) - cm_off = true; - if (!cm_off) { + + snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); + device_inhibited = colord_get_inhibit_for_device_id (tmpstr); + + /* support the "cm-calibration" option */ + if (cupsGetOption("cm-calibration", num_options, options) != NULL) { + cm_calibrate = true; + device_inhibited = 1; + } + + if (!device_inhibited) { if (getColorProfilePath(ppd,&profilePath)) { /* ICCProfile is specified */ colorProfile = cmsOpenProfileFromFile(profilePath.getCString(),"r"); @@ -1316,7 +1326,8 @@ } allocLineBuf = true; - if (colorProfile != NULL && popplerColorProfile != colorProfile) { + if (colorProfile != NULL && popplerColorProfile != colorProfile + && !device_inhibited) { unsigned int bytes; switch (header.cupsColorSpace) { @@ -1372,6 +1383,9 @@ pdfError(-1,const_cast<char *>("Can't create color transform")); exit(1); } + } else if (device_inhibited) { + convertCSpace = convertCSpaceNone; + convertBits = convertBitsNoop; } else { /* select convertCSpace function */ switch (header.cupsColorSpace) { @@ -1837,6 +1851,9 @@ globalParams = new GlobalParams(); parseOpts(argc, argv); + fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ? + "Calibration Mode/Enabled" : "Calibration Mode/Off"); + if (argc == 6) { /* stdin */ int fd; @@ -1981,7 +1998,7 @@ break; } - if (!cm_off) { + if (!device_inhibited) { setPopplerColorProfile(); } @@ -1998,9 +2015,7 @@ pdfError(-1,const_cast<char *>("Can't open raster stream")); exit(1); } - if (!cm_off) { - selectConvertFunc(raster); - } + selectConvertFunc(raster); for (i = 1;i <= npages;i++) { outPage(doc,catalog,i,out,raster); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/pstopdf new/cups-filters-1.0.55/filter/pstopdf --- old/cups-filters-1.0.54/filter/pstopdf 2013-12-10 22:20:15.000000000 +0100 +++ new/cups-filters-1.0.55/filter/pstopdf 2014-06-11 15:35:00.000000000 +0200 @@ -105,7 +105,7 @@ eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=4.*/orientation="${orientation:-90}"/p')" eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=5.*/orientation="${orientation:-270}"/p')" eval "$(printf "%s" "$5" | sed -nre 's/.*(^|\s)orientation-requested=6.*/orientation="${orientation:-180}"/p')" -if printf "%s" "$5" | grep -iPq '(\s|^)landscape(=(1|on|yes|true))?(\s|$)'; then +if printf "%s" "$5" | grep -qiE '(\s|^)landscape(=(1|on|yes|true))?(\s|$)'; then if test -e "$PPD"; then eval "$(sed -nre 's/^\*LandscapeOrientation:\s*Plus90.*/orientation="${orientation:-90}"/p' "$PPD")" eval "$(sed -nre 's/^\*LandscapeOrientation:\s*Minus90.*/orientation="${orientation:-270}"/p' "$PPD")" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/rastertopclx.c new/cups-filters-1.0.55/filter/rastertopclx.c --- old/cups-filters-1.0.54/filter/rastertopclx.c 2014-06-06 10:49:59.000000000 +0200 +++ new/cups-filters-1.0.55/filter/rastertopclx.c 2014-06-23 12:48:30.000000000 +0200 @@ -118,6 +118,9 @@ { int i; /* Temporary/looping var */ int plane; /* Current plane */ + int cm_calibrate; /* Color calibration mode */ + int device_inhibited; /* Device Color Inhibited */ + char tmpstr[1024]; /* Printer String */ char s[255]; /* Temporary value */ const char *colormodel; /* Color model string */ char resolution[PPD_MAX_NAME], @@ -229,7 +232,10 @@ case CUPS_CSPACE_CMYK : colormodel = "CMYK"; break; - } + } + + cm_calibrate = 0; + device_inhibited = 0; if (header->HWResolution[0] != header->HWResolution[1]) snprintf(resolution, sizeof(resolution), "%dx%ddpi", @@ -342,8 +348,16 @@ fprintf(stderr, "DEBUG: MediaType = %s\n", header->MediaType); fprintf(stderr, "DEBUG: Resolution = %s\n", resolution); - /* support the "no-color-management" option */ - if (ppd && (cupsGetOption("no-color-management", num_options, options) == NULL)) + snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); + device_inhibited = colord_get_inhibit_for_device_id (tmpstr); + + /* support the "cm-calibration" option */ + if ((cupsGetOption("cm-calibration", num_options, options)) != NULL) { + cm_calibrate = 1; + device_inhibited = 1; + } + + if (ppd && !device_inhibited) { if (header->cupsColorSpace == CUPS_CSPACE_RGB || header->cupsColorSpace == CUPS_CSPACE_W) @@ -352,6 +366,9 @@ CMYK = cupsCMYKLoad(ppd, colormodel, header->MediaType, resolution); } + fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ? + "Calibration Mode/Enabled" : "Calibration Mode/Off"); + if (RGB) fputs("DEBUG: Loaded RGB separation from PPD.\n", stderr); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/filter/rastertopdf.cpp new/cups-filters-1.0.55/filter/rastertopdf.cpp --- old/cups-filters-1.0.54/filter/rastertopdf.cpp 2014-06-06 11:54:35.000000000 +0200 +++ new/cups-filters-1.0.55/filter/rastertopdf.cpp 2014-06-23 12:48:30.000000000 +0200 @@ -19,6 +19,7 @@ * @author Till Kamppeter <till.kamppeter@gmail.com> (c) 2014 */ +#include <config.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -31,6 +32,8 @@ #include <signal.h> #include <cups/cups.h> #include <cups/raster.h> +#include <cupsfilters/colord.h> +//#include <cupsfilters/image.h> #include <arpa/inet.h> // ntohl @@ -42,6 +45,39 @@ #include <qpdf/Pl_Flate.hh> #include <qpdf/Pl_Buffer.hh> +#ifdef USE_LCMS1 +#include <lcms.h> +#define cmsColorSpaceSignature icColorSpaceSignature +#define cmsSetLogErrorHandler cmsSetErrorHandler +#define cmsSigXYZData icSigXYZData +#define cmsSigLuvData icSigLuvData +#define cmsSigLabData icSigLabData +#define cmsSigYCbCrData icSigYCbCrData +#define cmsSigYxyData icSigYxyData +#define cmsSigRgbData icSigRgbData +#define cmsSigHsvData icSigHsvData +#define cmsSigHlsData icSigHlsData +#define cmsSigCmyData icSigCmyData +#define cmsSig3colorData icSig3colorData +#define cmsSigGrayData icSigGrayData +#define cmsSigCmykData icSigCmykData +#define cmsSig4colorData icSig4colorData +#define cmsSig2colorData icSig2colorData +#define cmsSig5colorData icSig5colorData +#define cmsSig6colorData icSig6colorData +#define cmsSig7colorData icSig7colorData +#define cmsSig8colorData icSig8colorData +#define cmsSig9colorData icSig9colorData +#define cmsSig10colorData icSig10colorData +#define cmsSig11colorData icSig11colorData +#define cmsSig12colorData icSig12colorData +#define cmsSig13colorData icSig13colorData +#define cmsSig14colorData icSig14colorData +#define cmsSig15colorData icSig15colorData +#else +#include <lcms2.h> +#endif + #define DEFAULT_PDF_UNIT 72 // 1/72 inch #define PROGRAM "rastertopdf" @@ -50,6 +86,27 @@ #define iprintf(format, ...) fprintf(stderr, "INFO: (" PROGRAM ") " format, __VA_ARGS__) +cmsHPROFILE inputColorProfile = NULL; +cmsHPROFILE outputColorProfile = NULL; +cmsHTRANSFORM colorTransform = NULL; +int renderingIntent = INTENT_PERCEPTUAL; +int device_inhibited = 0; +bool cm_calibrate = false; + +#ifdef USE_LCMS1 +static int lcmsErrorHandler(int ErrorCode, const char *ErrorText) +{ + fprintf(stderr, "ERROR: %s\n",ErrorText); + return 1; +} +#else +static void lcmsErrorHandler(cmsContext contextId, cmsUInt32Number ErrorCode, + const char *ErrorText) +{ + fprintf(stderr, "ERROR: %s\n",ErrorText); +} +#endif + void die(const char * str) { fprintf(stderr, "ERROR: (" PROGRAM ") %s\n", str); @@ -116,21 +173,49 @@ dict["/Height"]=QPDFObjectHandle::newInteger(height); dict["/BitsPerComponent"]=QPDFObjectHandle::newInteger(bpc); - if (cs==CUPS_CSPACE_K) { - dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray"); - } else if (cs==CUPS_CSPACE_RGB) { - dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB"); - } else if (cs==CUPS_CSPACE_CMYK) { - dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceCMYK"); - } else if (cs==CUPS_CSPACE_SW) { - dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray"); - } else if (cs==CUPS_CSPACE_SRGB) { - dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB"); - } else if (cs==CUPS_CSPACE_ADOBERGB) { + /* TODO Adjust for color calibration */ + if (!device_inhibited) { + switch (cs) { + case CUPS_CSPACE_CIELab: + case CUPS_CSPACE_ICC1: + case CUPS_CSPACE_ICC2: + case CUPS_CSPACE_ICC3: + case CUPS_CSPACE_ICC4: + case CUPS_CSPACE_ICC5: + case CUPS_CSPACE_ICC6: + case CUPS_CSPACE_ICC7: + case CUPS_CSPACE_ICC8: + case CUPS_CSPACE_ICC9: + case CUPS_CSPACE_ICCA: + case CUPS_CSPACE_ICCB: + case CUPS_CSPACE_ICCC: + case CUPS_CSPACE_ICCD: + case CUPS_CSPACE_ICCE: + case CUPS_CSPACE_ICCF: + case CUPS_CSPACE_CIEXYZ: + dict["/ColorSpace"]=QPDFObjectHandle::newName("/CalRGB"); + break; + case CUPS_CSPACE_K: + case CUPS_CSPACE_W: + case CUPS_CSPACE_SW: + case CUPS_CSPACE_WHITE: + dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceGray"); + break; + case CUPS_CSPACE_CMYK: + dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceCMYK"); + break; + case CUPS_CSPACE_RGB: + case CUPS_CSPACE_SRGB: + case CUPS_CSPACE_ADOBERGB: + dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB"); + break; + default: + return QPDFObjectHandle(); + } + } else if (device_inhibited) { dict["/ColorSpace"]=QPDFObjectHandle::newName("/DeviceRGB"); - } else { + } else return QPDFObjectHandle(); - } ret.replaceDict(QPDFObjectHandle::newDictionary(dict)); @@ -251,9 +336,10 @@ int bpp, int bpl, struct pdf_info * info) { // We should be at raster start - int i; + int i, pixels; unsigned cur_line = 0; unsigned char *PixelBuffer, *ptr; + unsigned char * TransformBuffer = NULL; PixelBuffer = (unsigned char *)malloc(bpl); @@ -281,20 +367,204 @@ *(ptr + 1) = swap; } } -#endif /* !ARCH_IS_BIG_ENDIAN */ - // write lines - pdf_set_line(info, cur_line, PixelBuffer); +#endif /* !ARCH_IS_BIG_ENDIAN */ + + // write lines + if (colorTransform != NULL && !device_inhibited) { + // If a profile was specified, we apply the transformation + TransformBuffer = (unsigned char *)malloc(bpl); + pixels = bpl / (info->bpp / info->bpc); + + cmsDoTransform(colorTransform, PixelBuffer, + TransformBuffer, pixels); + pdf_set_line(info, cur_line, TransformBuffer); + } else + pdf_set_line(info, cur_line, PixelBuffer); ++cur_line; } while(cur_line < height); free(PixelBuffer); + if (TransformBuffer != NULL) + free(TransformBuffer); return 0; } +static unsigned int getCMSColorSpaceType(cmsColorSpaceSignature cs) +{ + switch (cs) { + case cmsSigXYZData: + return PT_XYZ; + break; + case cmsSigLabData: + return PT_Lab; + break; + case cmsSigLuvData: + return PT_YUV; + break; + case cmsSigYCbCrData: + return PT_YCbCr; + break; + case cmsSigYxyData: + return PT_Yxy; + break; + case cmsSigRgbData: + return PT_RGB; + break; + case cmsSigGrayData: + return PT_GRAY; + break; + case cmsSigHsvData: + return PT_HSV; + break; + case cmsSigHlsData: + return PT_HLS; + break; + case cmsSigCmykData: + return PT_CMYK; + break; + case cmsSigCmyData: + return PT_CMY; + break; + case cmsSig2colorData: + case cmsSig3colorData: + case cmsSig4colorData: + case cmsSig5colorData: + case cmsSig6colorData: + case cmsSig7colorData: + case cmsSig8colorData: + case cmsSig9colorData: + case cmsSig10colorData: + case cmsSig11colorData: + case cmsSig12colorData: + case cmsSig13colorData: + case cmsSig14colorData: + case cmsSig15colorData: + default: + break; + } + return PT_RGB; +} + +int setProfile(const char * path) +{ + if (path != NULL) + inputColorProfile = cmsOpenProfileFromFile(path,"r"); + + if (inputColorProfile != NULL) + // test using sRGB Profile + outputColorProfile = cmsCreate_sRGBProfile(); + + if (inputColorProfile != NULL && outputColorProfile != NULL) + return 0; + else + return 1; +} + +/* Obtain a source profile using color qualifiers */ +int setCupsColorProfile(ppd_file_t* ppd, const char* cupsRenderingIntent, + const char * mediaType, cups_cspace_t cs, unsigned xdpi, unsigned ydpi) +{ + std::string MediaType; + std::string resolution; + std::string colorModel; + + std::string path; + ppd_attr_t *attr; + + if (ppd == NULL) { + return 1; + } + + if (cupsRenderingIntent != NULL) { + if (strcasecmp(cupsRenderingIntent,"PERCEPTUAL") != 0) { + renderingIntent = INTENT_PERCEPTUAL; + } else if (strcasecmp(cupsRenderingIntent,"RELATIVE_COLORIMETRIC") != 0) { + renderingIntent = INTENT_RELATIVE_COLORIMETRIC; + } else if (strcasecmp(cupsRenderingIntent,"SATURATION") != 0) { + renderingIntent = INTENT_SATURATION; + } else if (strcasecmp(cupsRenderingIntent,"ABSOLUTE_COLORIMETRIC") != 0) { + renderingIntent = INTENT_ABSOLUTE_COLORIMETRIC; + } + } + + // ColorModel + switch (cs) { + case CUPS_CSPACE_RGB: + colorModel = "Rgb"; + break; + case CUPS_CSPACE_SRGB: + colorModel = "Srgb"; + break; + case CUPS_CSPACE_ADOBERGB: + colorModel = "AdobeRgb"; + break; + case CUPS_CSPACE_K: + colorModel = "Sgray"; + break; + case CUPS_CSPACE_CMYK: + colorModel = "Cmyk"; + break; + default: + colorModel = ""; + break; + } + + // Resolution + resolution = xdpi + "x" + ydpi; + + // MediaType + if (mediaType != NULL) + MediaType = mediaType; + + for (attr = ppdFindAttr(ppd,"cupsICCProfile",NULL);attr != NULL; + attr = ppdFindNextAttr(ppd,"cupsICCProfile",NULL)) { + // check color model + char buf[PPD_MAX_NAME]; + char *p, *r; + + strncpy(buf,attr->spec,sizeof(buf)); + if ((p = strchr(buf,'.')) != NULL) { + *p = '\0'; + } + if (!colorModel.empty() && buf[0] != '\0' + && strcasecmp(buf,colorModel.c_str()) != 0) continue; + if (p == NULL) { + break; + } else { + p++; + if ((r = strchr(p,'.')) != 0) { + *r = '\0'; + } + } + if (!resolution.empty() && p[0] != '\0' + && strcasecmp(p,resolution.c_str()) != 0) continue; + if (r == NULL) { + break; + } else { + r++; + if ((p = strchr(r,'.')) != 0) { + *p = '\0'; + } + } + if (!MediaType.empty() || r[0] == '\0' + || strcasecmp(r,MediaType.c_str()) == 0) break; + } + if (attr != NULL) { + // matched + path = ""; + if (attr->value[0] != '/') { + path = path + CUPS_DATADIR + "/profiles/"; + } + path = path + CUPS_DATADIR + attr->value; + } + + return setProfile(path.c_str()); +} + int main(int argc, char **argv) { int fd, Page; @@ -305,17 +575,30 @@ ppd_file_t *ppd; /* PPD file */ int num_options; /* Number of options */ cups_option_t *options; /* Options */ + const char *val; /* Option value */ + char tmpstr[1024]; // Make sure status messages are not buffered... setbuf(stderr, NULL); + cmsSetLogErrorHandler(lcmsErrorHandler); + if (argc < 6 || argc > 7) { fprintf(stderr, "Usage: %s <job> <user> <job name> <copies> <option> [file]\n", argv[0]); return 1; } - num_options = cupsParseOptions(argv[5], 0, &options); + num_options = cupsParseOptions(argv[5], 0, &options); + + snprintf (tmpstr, sizeof(tmpstr), "cups-%s", getenv("PRINTER")); + device_inhibited = colord_get_inhibit_for_device_id (tmpstr); + + /* support the "cm-calibration" option */ + if (cupsGetOption("cm-calibration", num_options, options) != NULL) { + cm_calibrate = true; + device_inhibited = 1; + } // Open the PPD file... ppd = ppdOpenFile(getenv("PPD")); @@ -359,12 +642,38 @@ if (create_pdf_file(&pdf) != 0) die("Unable to create PDF file"); + fprintf(stderr, "DEBUG: Color Management: %s\n", cm_calibrate ? + "Calibration Mode/Enabled" : "Calibration Mode/Off"); + while (cupsRasterReadHeader2(ras, &header)) { // Write a status message with the page number Page ++; fprintf(stderr, "INFO: Starting page %d.\n", Page); + // Set profile from PPD and raster header + if (!device_inhibited) { + // Set user profile from command-line + if ((val = cupsGetOption("profile", num_options, options)) != NULL) { + setProfile(val); + } /* else if (setCupsColorProfile(ppd, header.cupsRenderingIntent, + header.MediaType, header.cupsColorSpace, + header.HWResolution[0], header.HWResolution[1]) != 0) { + } */ + + // TESTING create color transformation + if (inputColorProfile != NULL && outputColorProfile != NULL) { + /* TODO apply conversion by other cases (color space) */ + unsigned int bytes = header.cupsBitsPerColor/8; + unsigned int dcst = getCMSColorSpaceType(cmsGetColorSpace(inputColorProfile)); + colorTransform = cmsCreateTransform(inputColorProfile, + COLORSPACE_SH(dcst) |CHANNELS_SH(header.cupsNumColors) | BYTES_SH(bytes), + outputColorProfile, + COLORSPACE_SH(PT_RGB) | + CHANNELS_SH(3) | BYTES_SH(1), + renderingIntent,0); + } + } // Add a new page to PDF file if (add_pdf_page(&pdf, Page, header.cupsWidth, header.cupsHeight, header.cupsBitsPerPixel, header.cupsBitsPerColor, @@ -382,6 +691,16 @@ close_pdf_file(&pdf); // will output to stdout + if (inputColorProfile != NULL) { + cmsCloseProfile(inputColorProfile); + } + if (outputColorProfile != NULL && outputColorProfile != inputColorProfile) { + cmsCloseProfile(outputColorProfile); + } + if (colorTransform != NULL) { + cmsDeleteTransform(colorTransform); + } + cupsFreeOptions(num_options, options); cupsRasterClose(ras); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/cups-filters-1.0.54/utils/cups-browsed.c new/cups-filters-1.0.55/utils/cups-browsed.c --- old/cups-filters-1.0.54/utils/cups-browsed.c 2014-05-07 16:09:53.000000000 +0200 +++ new/cups-filters-1.0.55/utils/cups-browsed.c 2014-07-25 18:01:46.000000000 +0200 @@ -23,12 +23,12 @@ #include <ctype.h> #include <errno.h> -#include <ifaddrs.h> #if defined(__OpenBSD__) #include <sys/socket.h> #endif /* __OpenBSD__ */ #include <net/if.h> #include <netinet/in.h> +#include <ifaddrs.h> #include <resolv.h> #include <stdio.h> #include <sys/types.h> @@ -394,7 +394,7 @@ q = (remote_printer_t *)cupsArrayNext(remote_printers)) if (!strcasecmp(q->name, p->name)) break; - p->duplicate = q ? 1 : 0; + p->duplicate = (q && q->status != STATUS_DISAPPEARED) ? 1 : 0; if (p->duplicate) debug_printf("cups-browsed: Printer %s already available through host %s.\n", p->name, q->host); @@ -1006,6 +1006,32 @@ remote_queue = remove_bad_chars(resource + 9, 0); debug_printf("cups-browsed: Found CUPS queue: %s on host %s.\n", remote_queue, remote_host); +#ifdef HAVE_AVAHI + /* If the remote queue has a PPD file, the "product" field of the + TXT record is populated. If it has no PPD file the remote queue + is a raw queue and so we do not jknow enough about the printer + behind it for auto-creating a local queue pointing to it. */ + int raw_queue = 0; + if (txt) { + entry = avahi_string_list_find((AvahiStringList *)txt, "product"); + if (entry) { + avahi_string_list_get_pair(entry, &key, &value, NULL); + if (!key || !value || strcasecmp(key, "product") || value[0] != '(' || + value[strlen(value) - 1] != ')') { + raw_queue = 1; + } + } else + raw_queue = 1; + } else + raw_queue = 1; + if (raw_queue) { + /* The remote CUPS queue is raw, ignore it */ + debug_printf("cups-browsed: Remote CUPS queue %s on host %s is raw, ignored.\n", + remote_queue, remote_host); + free (remote_host); + return; + } +#endif /* HAVE_AVAHI */ } else if (!strncasecmp(resource, "classes/", 8)) { /* This is a remote CUPS queue, use the remote queue name for the local queue */ -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de