diff options
Diffstat (limited to 'net-print/cups-filters')
-rw-r--r-- | net-print/cups-filters/Manifest | 7 | ||||
-rw-r--r-- | net-print/cups-filters/cups-filters-1.28.15-r1.ebuild | 130 | ||||
-rw-r--r-- | net-print/cups-filters/cups-filters-1.28.16-r3.ebuild | 144 | ||||
-rw-r--r-- | net-print/cups-filters/cups-filters-1.28.17-r2.ebuild (renamed from net-print/cups-filters/cups-filters-1.28.17-r1.ebuild) | 3 | ||||
-rw-r--r-- | net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch | 225 |
5 files changed, 229 insertions, 280 deletions
diff --git a/net-print/cups-filters/Manifest b/net-print/cups-filters/Manifest index 5cd3bcd4f35f..b29b5d973909 100644 --- a/net-print/cups-filters/Manifest +++ b/net-print/cups-filters/Manifest @@ -1,10 +1,7 @@ AUX cups-browsed.init.d-r2 150 BLAKE2B c2098766ae08b38dead0a5bab2e30e1728ab93aa98e74edb6e20f8a885b62189f1368a041c4430ad24a1b92f0ae9cb317ac3390767db0a54ca1532022d44b0bd SHA512 c8a74ad0e5cfd3b565c12eeca50a55b7a6aa3ac92c689fc6632e2a6df5033e6fa7f16ce6c9c2cbf607ad4bd09453ab7d47448cdd04ad8c7e35f0e584b6d96d38 +AUX cups-filters-1.28.17-CVE-2023-24805.patch 7284 BLAKE2B fb7a6ec5a872381e2319a836e2bbb7f31d3635fd5fd38b44db28616cd18d0332d2ca8af36028a8ba8b0f405f144065779bffb15c1f07dbb6ee6118e01583185a SHA512 108282a8414591187789d87d8da22d261fda0e2cb0dae2e6fcbde320cee0b6fb79c2f616947ee297a58237f3c630b593d4f5b668cf8df2d5cb5c755cb0470211 AUX cups-filters-1.28.17-c++17.patch 1066 BLAKE2B 149001a37c5799210a7cbc6c79ab1b87917f937c4f9d61c1955d18588e0b6c27e17430613f4c35e50cabf485ad381bc8e1f4c6f8a4afa14a7e9ab5e1f9acf291 SHA512 f78038c6e173490a9096ae1c7e22476e33187317738db680c43333738c7dad29d441d7c78ed2d8adc389444ef5c4694002e403f5e54855216d4000ac791752b0 -DIST cups-filters-1.28.15.tar.xz 1511452 BLAKE2B 2ed495f063197955456c07c6c06747093997afce53c15e19d081f2e53e6af9a76a41094d2356a1cd7533c3bb63bfb6257792b71ee14121a0daf5863b3b5cd76f SHA512 cc8d43bba6edb2b839f3be5fcbcdeb7633ed0f0f0c2737bcc6957cf95fb4ded8ee412358cc95fdbf289ae897dd0b7f32e689f02d191a8f15930eb4d2deefd74c -DIST cups-filters-1.28.16.tar.xz 1512496 BLAKE2B a75a9e09688670332a9fd9a8e4d9004650c6b0fb571a1f48a02e8e4af56d08b7d312d65fdbd66caf82907005dd336de90e2c8bbb46b1ba13d86d8715340f8ce6 SHA512 0369f96a8ae5e33bf75c8765947d5ad7285b3532e9d9b0ded7e206798834c9ade3a2ac3f1d16e0fdd43346f2bc7852c541130e935cbb20f9c1239a53118d1239 DIST cups-filters-1.28.17.tar.xz 1516052 BLAKE2B 87258391901d55d9e59b06d54603d014e54d224a373529bd70fcd38cded9dc96c88ca73bcea63d7633c065caea3f9e3274cd450aec5f1bd90130d9a88c0d3421 SHA512 320544a48206165581adafb28dbef58f39c66bebd3641be3d180a692605349d9e6af6d464044db9f7bda17a67f4a079370d8cc880cd7873d684b2209882deb35 -EBUILD cups-filters-1.28.15-r1.ebuild 3287 BLAKE2B bcc2f0b85f735c1a7c10c1e32a9bd3c6fb975c22e00a33bb082188f9136cb77319d461dc40706b61b601376469b4a16be7826f05fe86f6092330fe8c5bf26f2b SHA512 d0d2117ea64feacc1eb3e6683099f8f79dbe47b060de4dce9e31f784db6b9668d1d993c641747c8ce52d03fcf757f7999e1344aeb636ca725a1e342436c008e8 -EBUILD cups-filters-1.28.16-r3.ebuild 3572 BLAKE2B 79f2d5c3416a3e7057babe51899bf91590cda9e860593d9c6cc0b4d3ee60a01451a8198e501df620de9a25c5d6b523a4ac6013905700dbfe55c0ac5c0e7bad39 SHA512 fd03ca153effb3abaa814a9fcefc0d1f53fb9d0f8bb829076bd88452a35b9d968c4c31f9519e4004a3d38d6c8c204d3294ff7aadf10eded3f9932f5ef194aef9 -EBUILD cups-filters-1.28.17-r1.ebuild 3630 BLAKE2B 5813fd8521b41a4508cc446b1baeebe78d11c776cafb7ac56e3b7a27e7e03f3135e36870ee1ff9335543fec95c521215da7eb8b122f36c7ca84f7964958b3a3a SHA512 3d954324a6be3a955ef15835eba6e52e7c33771e62ef8be7bfda79e5d6464dd0e48f451c9262c737d689dc1b8e89ee25f9a0495b8ebd964667b2237886640a53 +EBUILD cups-filters-1.28.17-r2.ebuild 3679 BLAKE2B 37eae257260279789ec287fc09addef1c1cd61493d50dbed6cef872cdf7e7dd6c2a607ba6fece4333f3795ac2f0e75ba4dc46e5db42f970b2050f7cd03fc5a29 SHA512 3804388f561003ab80ee280bed04ccbd6e8febae84132d8311d9d7016d58618f9ced7860781531156e305da52efc8e57df9ec08965e04d63425307f08e7f6aca EBUILD cups-filters-1.28.17.ebuild 3657 BLAKE2B ab7d43196ae1fa0c19f945cd5cd5858b9fd956270f8fb02fedc514c451ed6beb8be5181dbcda7a5038aef863eaf7b88b1f5d18744c014c7b09383c17e2dba61b SHA512 a511251105363682cbc5caf7699ca1fe3930f972212eb8342c398e224eaa898a5fe122fcd5ab1f2aafa3339e3fd0637542a44c2881621a791c04e164055e6cec MISC metadata.xml 513 BLAKE2B b265a1645fe0da46a309086d9495564020ea15b7546237dc040589cba2e5d79540860301f8f72484081b726066414ad0414963b7c7c2ce3f08af898502c32521 SHA512 b9234992f05d59bffafb31f3d035e554389f250d8f3b951bb507e300f7cd3a6806406df60b1cae038ab330b3513934ec1250dcf0c9bfdba1bb033e6545727597 diff --git a/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild b/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild deleted file mode 100644 index b39191e35f49..000000000000 --- a/net-print/cups-filters/cups-filters-1.28.15-r1.ebuild +++ /dev/null @@ -1,130 +0,0 @@ -# Copyright 1999-2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -GENTOO_DEPEND_ON_PERL=no -inherit perl-module systemd flag-o-matic - -DESCRIPTION="Cups filters" -HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters" -SRC_URI="https://www.openprinting.org/download/${PN}/${P}.tar.xz" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" - -LICENSE="MIT GPL-2" -SLOT="0" -IUSE="dbus +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf" - -RESTRICT="!test? ( test )" - -RDEPEND=" - >=app-text/poppler-0.32[cxx,jpeg?,lcms,tiff?,utils] - >=app-text/qpdf-8.3.0:= - dev-libs/glib:2 - media-libs/fontconfig - media-libs/freetype:2 - media-libs/lcms:2 - >=net-print/cups-1.7.3 - !<=net-print/cups-1.5.9999 - sys-devel/bc - sys-libs/zlib - dbus? ( sys-apps/dbus ) - foomatic? ( !net-print/foomatic-filters ) - jpeg? ( media-libs/libjpeg-turbo:= ) - ldap? ( net-nds/openldap:= ) - pdf? ( app-text/mupdf:= ) - perl? ( dev-lang/perl:= ) - png? ( media-libs/libpng:= ) - postscript? ( >=app-text/ghostscript-gpl-9.09[cups] ) - tiff? ( media-libs/tiff:= ) - zeroconf? ( net-dns/avahi[dbus] ) -" -DEPEND="${RDEPEND}" -BDEPEND=" - dev-util/gdbus-codegen - >=sys-devel/gettext-0.18.3 - virtual/pkgconfig - test? ( media-fonts/dejavu ) -" - -src_configure() { - # (As of 1.28.15, still defaults upstream to c++0x, so it's still needed, - # probably.) - # Bug #626800 - append-cxxflags -std=c++11 - - local myeconfargs=( - --enable-imagefilters - --localstatedir="${EPREFIX}"/var - --with-browseremoteprotocols=DNSSD,CUPS - --with-cups-rundir="${EPREFIX}"/run/cups - --with-fontdir="fonts/conf.avail" - --with-pdftops=pdftops - --with-rcdir=no - --without-php - --disable-static - $(use_enable dbus) - $(use_enable foomatic) - $(use_enable ldap) - $(use_enable pclm) - $(use_enable pdf mutool) - $(use_enable postscript ghostscript) - $(use_enable zeroconf avahi) - $(use_with jpeg) - $(use_with png) - $(use_with tiff) - ) - - econf "${myeconfargs[@]}" -} - -src_compile() { - default - - if use perl; then - pushd "${S}/scripting/perl" > /dev/null || die - perl-module_src_configure - perl-module_src_compile - popd > /dev/null || die - fi -} - -src_test() { - emake check -} - -src_install() { - default - - if use perl; then - pushd "${S}/scripting/perl" > /dev/null || die - perl-module_src_install - perl_delete_localpod - popd > /dev/null || die - fi - - if use postscript; then - # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831 - dosym gstoraster /usr/libexec/cups/filter/pstoraster - dosym gstopxl /usr/libexec/cups/filter/pstopxl - fi - - find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die - - cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die - - if ! use zeroconf ; then - sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die - sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die - fi - - doinitd "${T}"/cups-browsed - systemd_dounit "${S}"/utils/cups-browsed.service -} - -pkg_postinst() { - if ! use foomatic ; then - ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely" - ewarn "necessary. net-print/foomatic-filters as a replacement is deprecated and unmaintained." - fi -} diff --git a/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild b/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild deleted file mode 100644 index 9092975eb895..000000000000 --- a/net-print/cups-filters/cups-filters-1.28.16-r3.ebuild +++ /dev/null @@ -1,144 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -GENTOO_DEPEND_ON_PERL=no -inherit perl-module systemd flag-o-matic - -DESCRIPTION="Cups filters" -HOMEPAGE="https://wiki.linuxfoundation.org/openprinting/cups-filters" -SRC_URI="https://www.openprinting.org/download/${PN}/${P}.tar.xz" - -LICENSE="MIT GPL-2" -SLOT="0" -IUSE="dbus exif +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf" -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~mips ppc ppc64 ~riscv ~s390 sparc x86" - -RESTRICT="!test? ( test )" - -RDEPEND=" - >=app-text/poppler-0.32[cxx,jpeg?,lcms,tiff?,utils] - >=app-text/qpdf-8.3.0:= - dev-libs/glib:2 - media-libs/fontconfig - media-libs/freetype:2 - media-libs/lcms:2 - >=net-print/cups-1.7.3 - !<=net-print/cups-1.5.9999 - sys-devel/bc - sys-libs/zlib - exif? ( media-libs/libexif ) - dbus? ( sys-apps/dbus ) - foomatic? ( !net-print/foomatic-filters ) - jpeg? ( media-libs/libjpeg-turbo:= ) - ldap? ( net-nds/openldap:= ) - pdf? ( app-text/mupdf:= ) - perl? ( dev-lang/perl:= ) - png? ( media-libs/libpng:= ) - postscript? ( >=app-text/ghostscript-gpl-9.09[cups] ) - tiff? ( media-libs/tiff:= ) - zeroconf? ( net-dns/avahi[dbus] ) -" -DEPEND="${RDEPEND}" -BDEPEND=" - dev-util/gdbus-codegen - >=sys-devel/gettext-0.18.3 - virtual/pkgconfig - test? ( media-fonts/dejavu ) -" - -src_configure() { - # (As of 1.28.15, still defaults upstream to c++0x, so it's still needed, - # probably.) - # Bug #626800 - append-cxxflags -std=c++11 - - local myeconfargs=( - --enable-imagefilters - --localstatedir="${EPREFIX}"/var - --with-browseremoteprotocols=DNSSD,CUPS - --with-cups-rundir="${EPREFIX}"/run/cups - --with-fontdir="fonts/conf.avail" - --with-pdftops=pdftops - --with-rcdir=no - --without-php - - $(use_enable exif) - $(use_enable dbus) - $(use_enable foomatic) - $(use_enable ldap) - $(use_enable pclm) - $(use_enable pdf mutool) - $(use_enable postscript ghostscript) - $(use_enable zeroconf avahi) - $(use_with jpeg) - $(use_with png) - $(use_with tiff) - ) - - econf "${myeconfargs[@]}" - - if use perl; then - pushd "${S}"/scripting/perl > /dev/null || die - perl-module_src_configure - popd > /dev/null || die - fi -} - -src_compile() { - default - - if use perl; then - pushd "${S}"/scripting/perl > /dev/null || die - perl-module_src_compile - popd > /dev/null || die - fi -} - -src_test() { - # Avoid perl-module_src_test - default - - if use perl; then - pushd "${S}/scripting/perl" > /dev/null || die - perl-module_src_test - popd > /dev/null || die - fi -} - -src_install() { - default - - if use perl; then - pushd "${S}"/scripting/perl > /dev/null || die - perl-module_src_install - perl_delete_localpod - popd > /dev/null || die - fi - - if use postscript; then - # workaround: some printer drivers still require pstoraster and pstopxl, bug #383831 - dosym gstoraster /usr/libexec/cups/filter/pstoraster - dosym gstopxl /usr/libexec/cups/filter/pstopxl - fi - - find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die - - cp "${FILESDIR}"/cups-browsed.init.d-r2 "${T}"/cups-browsed || die - - if ! use zeroconf ; then - sed -i -e 's:need cupsd avahi-daemon:need cupsd:g' "${T}"/cups-browsed || die - sed -i -e 's:cups\.service avahi-daemon\.service:cups.service:g' "${S}"/utils/cups-browsed.service || die - fi - - doinitd "${T}"/cups-browsed - systemd_dounit "${S}"/utils/cups-browsed.service -} - -pkg_postinst() { - if ! use foomatic ; then - ewarn "You are disabling the foomatic code in cups-filters. Please do that ONLY if absolutely" - ewarn "necessary. net-print/foomatic-filters as a replacement is deprecated and unmaintained." - fi -} diff --git a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild b/net-print/cups-filters/cups-filters-1.28.17-r2.ebuild index 13b7dac3fc7b..7c81cc28cae0 100644 --- a/net-print/cups-filters/cups-filters-1.28.17-r1.ebuild +++ b/net-print/cups-filters/cups-filters-1.28.17-r2.ebuild @@ -16,7 +16,7 @@ SRC_URI=" LICENSE="MIT GPL-2" SLOT="0" IUSE="dbus exif +foomatic jpeg ldap pclm pdf perl png +postscript test tiff zeroconf" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +KEYWORDS="~alpha ~amd64 arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" RESTRICT="!test? ( test )" @@ -53,6 +53,7 @@ BDEPEND=" PATCHES=( "${FILESDIR}"/${PN}-1.28.17-c++17.patch + "${FILESDIR}"/${PN}-1.28.17-CVE-2023-24805.patch ) src_configure() { diff --git a/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch b/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch new file mode 100644 index 000000000000..58b562504d0d --- /dev/null +++ b/net-print/cups-filters/files/cups-filters-1.28.17-CVE-2023-24805.patch @@ -0,0 +1,225 @@ +Modified version from: + + https://packages.debian.org/de/sid/cups-filters + + From: Thorsten Alteholz <debian@alteholz.de> + Date: Fri, 19 May 2023 10:49:35 +0200 + Subject: fix CVE-2023-24805 + +Original patch: + +https://github.com/OpenPrinting/cups-filters/commit/8f274035756c04efeb77eb654e9d4c4447287d65 + +From 8f274035756c04efeb77eb654e9d4c4447287d65 Mon Sep 17 00:00:00 2001 +From: Till Kamppeter <till.kamppeter@gmail.com> +Date: Wed, 17 May 2023 11:12:37 +0200 +Subject: [PATCH] Merge pull request from GHSA-gpxc-v2m8-fr3x + +* beh backend: Use execv() instead of system() - CVE-2023-24805 + +With execv() command line arguments are passed as separate strings and +not the full command line in a single string. This prevents arbitrary +command execution by escaping the quoting of the arguments in a job +with forged job title. + +* beh backend: Extra checks against odd/forged input - CVE-2023-24805 + +- Do not allow '/' in the scheme of the URI (= backend executable + name), to assure that only backends inside /usr/lib/cups/backend/ + are used. + +- Pre-define scheme buffer to empty string, to be defined for case of + uri being NULL. + +- URI must have ':', to split off scheme, otherwise error. + +- Check return value of snprintf() to create call path for backend, to + error out on truncation of a too long scheme or on complete failure + due to a completely odd scheme. + +* beh backend: Further improvements - CVE-2023-24805 + +- Use strncat() instead of strncpy() for getting scheme from URI, the latter + does not require setting terminating zero byte in case of truncation. + +- Also exclude "." or ".." as scheme, as directories are not valid CUPS + backends. + +- Do not use fprintf() in sigterm_handler(), to not interfere with a + fprintf() which could be running in the main process when + sigterm_handler() is triggered. + +- Use "static volatile int" for global variable job_canceled. + +--- + backend/beh.c | 107 +++++++++++++++++++++++++++++++++++++++++++++------------- + 1 file changed, 84 insertions(+), 23 deletions(-) + +diff --git a/backend/beh.c b/backend/beh.c +index 225fd27..8d51235 100644 +--- a/backend/beh.c ++++ b/backend/beh.c +@@ -22,12 +22,13 @@ + #include "backend-private.h" + #include <cups/array.h> + #include <ctype.h> ++#include <sys/wait.h> + + /* + * Local globals... + */ + +-static int job_canceled = 0; /* Set to 1 on SIGTERM */ ++static volatile int job_canceled = 0; /* Set to 1 on SIGTERM */ + + /* + * Local functions... +@@ -213,21 +214,40 @@ call_backend(char *uri, /* I - URI of final destination */ + char **argv, /* I - Command-line arguments */ + char *filename) { /* I - File name of input data */ + const char *cups_serverbin; /* Location of programs */ ++ char *backend_argv[8]; /* Arguments for backend */ + char scheme[1024], /* Scheme from URI */ + *ptr, /* Pointer into scheme */ +- cmdline[65536]; /* Backend command line */ +- int retval; ++ backend_path[2048]; /* Backend path */ ++ int pid = 0, /* Process ID of backend */ ++ wait_pid, /* Process ID from wait() */ ++ wait_status, /* Status from child */ ++ retval = 0; ++ int bytes; + + /* + * Build the backend command line... + */ + +- strncpy(scheme, uri, sizeof(scheme) - 1); +- if (strlen(uri) > 1023) +- scheme[1023] = '\0'; ++ scheme[0] = '\0'; ++ strncat(scheme, uri, sizeof(scheme) - 1); + if ((ptr = strchr(scheme, ':')) != NULL) + *ptr = '\0'; +- ++ else { ++ fprintf(stderr, ++ "ERROR: beh: Invalid URI, no colon (':') to mark end of scheme part.\n"); ++ exit (CUPS_BACKEND_FAILED); ++ } ++ if (strchr(scheme, '/')) { ++ fprintf(stderr, ++ "ERROR: beh: Invalid URI, scheme contains a slash ('/').\n"); ++ exit (CUPS_BACKEND_FAILED); ++ } ++ if (!strcmp(scheme, ".") || !strcmp(scheme, "..")) { ++ fprintf(stderr, ++ "ERROR: beh: Invalid URI, scheme (\"%s\") is a directory.\n", ++ scheme); ++ exit (CUPS_BACKEND_FAILED); ++ } + if ((cups_serverbin = getenv("CUPS_SERVERBIN")) == NULL) + cups_serverbin = CUPS_SERVERBIN; + +@@ -235,16 +255,29 @@ call_backend(char *uri, /* I - URI of final destination */ + fprintf(stderr, + "ERROR: beh: Direct output into a file not supported.\n"); + exit (CUPS_BACKEND_FAILED); +- } else +- snprintf(cmdline, sizeof(cmdline), +- "%s/backend/%s '%s' '%s' '%s' '%s' '%s' %s", +- cups_serverbin, scheme, argv[1], argv[2], argv[3], +- /* Apply number of copies only if beh was called with a +- file name and not with the print data in stdin, as +- backends should handle copies only if they are called +- with a file name */ +- (argc == 6 ? "1" : argv[4]), +- argv[5], filename); ++ } ++ ++ backend_argv[0] = uri; ++ backend_argv[1] = argv[1]; ++ backend_argv[2] = argv[2]; ++ backend_argv[3] = argv[3]; ++ /* Apply number of copies only if beh was called with a file name ++ and not with the print data in stdin, as backends should handle ++ copies only if they are called with a file name */ ++ backend_argv[4] = (argc == 6 ? "1" : argv[4]); ++ backend_argv[5] = argv[5]; ++ backend_argv[6] = filename; ++ backend_argv[7] = NULL; ++ ++ bytes = snprintf(backend_path, sizeof(backend_path), ++ "%s/backend/%s", cups_serverbin, scheme); ++ if (bytes < 0 || bytes >= sizeof(backend_path)) ++ { ++ fprintf(stderr, ++ "ERROR: beh: Invalid scheme (\"%s\"), could not determing backend path.\n", ++ scheme); ++ return (CUPS_BACKEND_FAILED); ++ } + + /* + * Overwrite the device URI and run the actual backend... +@@ -253,18 +286,44 @@ call_backend(char *uri, /* I - URI of final destination */ + setenv("DEVICE_URI", uri, 1); + + fprintf(stderr, +- "DEBUG: beh: Executing backend command line \"%s\"...\n", +- cmdline); ++ "DEBUG: beh: Executing backend command line \"%s '%s' '%s' '%s' '%s' '%s' %s\"...\n", ++ backend_path, backend_argv[1], backend_argv[2], backend_argv[3], ++ backend_argv[4], backend_argv[5], backend_argv[6]); + fprintf(stderr, + "DEBUG: beh: Using device URI: %s\n", + uri); + +- retval = system(cmdline) >> 8; ++ if ((pid = fork()) == 0) { ++ /* ++ * Child comes here... ++ */ ++ ++ /* Run the backend */ ++ execv(backend_path, backend_argv); + +- if (retval == -1) + fprintf(stderr, "ERROR: Unable to execute backend command line: %s\n", + strerror(errno)); + ++ exit(1); ++ } else if (pid < 0) { ++ /* ++ * Unable to fork! ++ */ ++ ++ return (CUPS_BACKEND_FAILED); ++ } ++ ++ while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR); ++ ++ if (wait_pid >= 0 && wait_status) { ++ if (WIFEXITED(wait_status)) ++ retval = WEXITSTATUS(wait_status); ++ else if (WTERMSIG(wait_status) != SIGTERM) ++ retval = WTERMSIG(wait_status); ++ else ++ retval = 0; ++ } ++ + return (retval); + } + +@@ -277,8 +336,10 @@ static void + sigterm_handler(int sig) { /* I - Signal number (unused) */ + (void)sig; + +- fprintf(stderr, +- "DEBUG: beh: Job canceled.\n"); ++ const char * const msg = "DEBUG: beh: Job canceled.\n"; ++ /* The if() is to eliminate the return value and silence the warning ++ about an unused return value. */ ++ if (write(2, msg, strlen(msg))); + + if (job_canceled) + _exit(CUPS_BACKEND_OK); |