diff options
Diffstat (limited to 'source/ap')
-rwxr-xr-x | source/ap/cups-browsed/cups-browsed.SlackBuild | 153 | ||||
-rw-r--r-- | source/ap/cups-browsed/cups-browsed.url | 1 | ||||
-rw-r--r-- | source/ap/cups-browsed/doinst.sh (renamed from source/ap/cups-filters/doinst.sh) | 0 | ||||
-rw-r--r-- | source/ap/cups-browsed/slack-desc | 19 | ||||
-rw-r--r-- | source/ap/cups-filters/CVE-2023-24805.patch | 167 | ||||
-rwxr-xr-x | source/ap/cups-filters/cups-filters.SlackBuild | 32 | ||||
-rw-r--r-- | source/ap/cups-filters/cups-filters.url | 2 | ||||
-rw-r--r-- | source/ap/cups-filters/slack-desc | 2 | ||||
-rwxr-xr-x | source/ap/cups/cups.SlackBuild | 8 |
9 files changed, 195 insertions, 189 deletions
diff --git a/source/ap/cups-browsed/cups-browsed.SlackBuild b/source/ap/cups-browsed/cups-browsed.SlackBuild new file mode 100755 index 000000000..3823d256e --- /dev/null +++ b/source/ap/cups-browsed/cups-browsed.SlackBuild @@ -0,0 +1,153 @@ +#!/bin/bash + +# Copyright 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PKGNAM=cups-browsed +VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} +BUILD=${BUILD:-1} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$(uname -m)" in + i?86) ARCH=i586 ;; + arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) ARCH=$(uname -m) ;; + esac + export ARCH +fi + +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PKGNAM-$VERSION-$ARCH-$BUILD.txz" + exit 0 +fi + +NUMJOBS=${NUMJOBS:-" -j $(expr $(nproc) + 1) "} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "s390" ]; then + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +elif [ "$ARCH" = "armv7hl" ]; then + SLKCFLAGS="-O3 -march=armv7-a -mfpu=vfpv3-d16" + LIBDIRSUFFIX="" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +TMP=${TMP:-/tmp} +PKG=$TMP/package-$PKGNAM + +rm -rf $PKG +mkdir -p $TMP $PKG + +cd $TMP +rm -rf $PKGNAM-$VERSION +tar xvf $CWD/$PKGNAM-$VERSION.tar.?z || exit 1 +cd $PKGNAM-$VERSION || exit 1 + +chown -R root:root . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \+ -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \+ + +# Configure, build, and install: +if [ ! -r configure ]; then + if [ -x ./autogen.sh ]; then + NOCONFIGURE=1 ./autogen.sh + else + autoreconf -vif + fi +fi +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --with-cups-rundir=/run/cups \ + --docdir=/usr/doc/$PKGNAM-$VERSION \ + --mandir=/usr/man \ + --disable-static \ + --build=$ARCH-slackware-linux || exit 1 +make $NUMJOBS || make || exit 1 +make install DESTDIR=$PKG || exit 1 + +# Don't ship .la files: +rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la + +mkdir -p $PKG/etc/rc.d +mv $PKG/etc/init.d/cups-browsed $PKG/etc/rc.d/rc.cups-browsed +chmod 0644 $PKG/etc/rc.d/rc.cups-browsed +rm -rf $PKG/etc/init.d $PKG/etc/rc{0,2,3,5}.d + +find $PKG/etc -type f -exec mv {} {}.new \; + +# Strip binaries: +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null + +# Compress manual pages: +find $PKG/usr/man -type f -exec gzip -9 {} \+ +for i in $( find $PKG/usr/man -type l ) ; do + ln -s $( readlink $i ).gz $i.gz + rm $i +done + +# Add a documentation directory: +mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION +cp -a \ + AUTHORS* CHANGES* CONTRIBUTING* COPYING* ChangeLog* DEVELOPING* INSTALL* LICENSE* NEWS* NOTICE* README* \ + $PKG/usr/doc/${PKGNAM}-$VERSION + +# If there's a CHANGES.md file, installing at least part of the recent history +# is useful, but don't let it get totally out of control: +if [ -r CHANGES.md ]; then + DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION) + cat CHANGES.md | head -n 1000 > $DOCSDIR/CHANGES.md + touch -r CHANGES.md $DOCSDIR/CHANGES.md +fi + +# Nope: +rm -f $PKG/usr/doc/${PKGNAM}-$VERSION/CHANGES-1.x* + +mkdir -p $PKG/install +zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz diff --git a/source/ap/cups-browsed/cups-browsed.url b/source/ap/cups-browsed/cups-browsed.url new file mode 100644 index 000000000..8c533178f --- /dev/null +++ b/source/ap/cups-browsed/cups-browsed.url @@ -0,0 +1 @@ +https://github.com/OpenPrinting/cups-browsed diff --git a/source/ap/cups-filters/doinst.sh b/source/ap/cups-browsed/doinst.sh index 35b624517..35b624517 100644 --- a/source/ap/cups-filters/doinst.sh +++ b/source/ap/cups-browsed/doinst.sh diff --git a/source/ap/cups-browsed/slack-desc b/source/ap/cups-browsed/slack-desc new file mode 100644 index 000000000..5bf3c02a0 --- /dev/null +++ b/source/ap/cups-browsed/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +cups-browsed: cups-browsed (CUPS printer queue browser) +cups-browsed: +cups-browsed: The cups-browsed daemon is used to browse the network for remote CUPS +cups-browsed: queues and IPP network printers and automatically create local queues +cups-browsed: pointing to them. +cups-browsed: +cups-browsed: Homepage: http://www.openprinting.org +cups-browsed: +cups-browsed: +cups-browsed: +cups-browsed: diff --git a/source/ap/cups-filters/CVE-2023-24805.patch b/source/ap/cups-filters/CVE-2023-24805.patch deleted file mode 100644 index e84312a82..000000000 --- a/source/ap/cups-filters/CVE-2023-24805.patch +++ /dev/null @@ -1,167 +0,0 @@ ---- ./backend/beh.c.orig 2023-01-24 19:38:24.000000000 -0600 -+++ ./backend/beh.c 2023-05-19 13:08:27.724167656 -0500 -@@ -22,12 +22,14 @@ - #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 +215,44 @@ - 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 called CUPS 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, -+ wait_pid, -+ wait_status, -+ 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 +260,26 @@ - 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]; -+ 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); -+ exit (CUPS_BACKEND_FAILED); -+ } - - /* - * Overwrite the device URI and run the actual backend... -@@ -253,17 +288,41 @@ - 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%s\"...\n", -+ backend_path, backend_argv[1], backend_argv[2], backend_argv[3], -+ backend_argv[4], backend_argv[5], -+ (backend_argv[6] && backend_argv[6][0] ? " " : ""), -+ (backend_argv[6] && backend_argv[6][0] ? backend_argv[6] : "")); - fprintf(stderr, - "DEBUG: beh: Using device URI: %s\n", - uri); - -- retval = system(cmdline) >> 8; -+ if ((pid = fork()) == 0) -+ { -+ retval = execv(backend_path, backend_argv); -+ -+ if (retval == -1) -+ fprintf(stderr, "ERROR: Unable to execute backend: %s\n", -+ strerror(errno)); -+ exit (CUPS_BACKEND_FAILED); -+ } -+ else if (pid < 0) -+ { -+ fprintf(stderr, "ERROR: Unable to fork for backend\n"); -+ return (CUPS_BACKEND_FAILED); -+ } -+ -+ while ((wait_pid = wait(&wait_status)) < 0 && errno == EINTR); - -- if (retval == -1) -- fprintf(stderr, "ERROR: Unable to execute backend command line: %s\n", -- strerror(errno)); -+ 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 @@ - 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); diff --git a/source/ap/cups-filters/cups-filters.SlackBuild b/source/ap/cups-filters/cups-filters.SlackBuild index 6d3f26413..e9cb6e17d 100755 --- a/source/ap/cups-filters/cups-filters.SlackBuild +++ b/source/ap/cups-filters/cups-filters.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=cups-filters VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-5} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -78,7 +78,7 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \+ -zcat $CWD/CVE-2023-24805.patch.gz | patch -p1 --verbose || exit 1 +# We "--disable-avahi" because this package can't even use it. if [ ! -r configure ]; then if [ -x ./autogen.sh ]; then @@ -88,19 +88,20 @@ if [ ! -r configure ]; then fi fi CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS -std=c++17 -fpermissive" \ +CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --infodir=/usr/info \ + --runstatedir=/run \ --sysconfdir=/etc \ --localstatedir=/var \ --docdir=/usr/doc/$PKGNAM-$VERSION \ - --with-test-font-path=/usr/share/fonts/TTF/DejaVuSans.ttf \ - --without-php \ + --disable-avahi \ --disable-mutool \ --disable-static \ + --with-browseremoteprotocols=cups \ --build=$ARCH-slackware-linux || exit 1 make $NUMJOBS || exit 1 @@ -115,30 +116,25 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr find $PKG/usr/man -type f -exec gzip -9 {} \+ for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -mkdir -p $PKG/etc/rc.d -mv $PKG/etc/init.d/cups-browsed $PKG/etc/rc.d/rc.cups-browsed -chmod 0644 $PKG/etc/rc.d/rc.cups-browsed -rm -rf $PKG/etc/init.d $PKG/etc/rc{0,2,3,5}.d - -find $PKG/etc -type f -exec mv {} {}.new \; - # Add a documentation directory: mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION cp -a \ - AUTHORS COPYING* INSTALL ChangeLog NEWS README* THANKS TODO \ + AUTHORS* CHANGES* CONTRIBUTING* COPYING* ChangeLog* DEVELOPING* INSTALL* LICENSE* NEWS* NOTICE* README* \ $PKG/usr/doc/${PKGNAM}-$VERSION -# If there's a ChangeLog, installing at least part of the recent history +# If there's a CHANGES.md, installing at least part of the recent history # is useful, but don't let it get totally out of control: -if [ -r ChangeLog ]; then +if [ -r CHANGES.md ]; then DOCSDIR=$(echo $PKG/usr/doc/*-$VERSION) - cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog - touch -r ChangeLog $DOCSDIR/ChangeLog + cat CHANGES.md | head -n 1000 > $DOCSDIR/CHANGES.md + touch -r CHANGES.md $DOCSDIR/CHANGES.md fi +# Nope: +rm -f $PKG/usr/doc/${PKGNAM}-$VERSION/CHANGES-1.x* + mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc -zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz diff --git a/source/ap/cups-filters/cups-filters.url b/source/ap/cups-filters/cups-filters.url index 7b1d5cdfa..54e28aa53 100644 --- a/source/ap/cups-filters/cups-filters.url +++ b/source/ap/cups-filters/cups-filters.url @@ -1 +1 @@ -http://www.openprinting.org/download/cups-filters/ +https://github.com/OpenPrinting/cups-filters diff --git a/source/ap/cups-filters/slack-desc b/source/ap/cups-filters/slack-desc index 9c2590f3b..6f6344b63 100644 --- a/source/ap/cups-filters/slack-desc +++ b/source/ap/cups-filters/slack-desc @@ -13,7 +13,7 @@ cups-filters: once part of the core CUPS distribution but is no longer included. cups-filters: In addition it contains additional filters and software developed cups-filters: independently. cups-filters: -cups-filters: +cups-filters: Homepage: http://www.openprinting.org cups-filters: cups-filters: cups-filters: diff --git a/source/ap/cups/cups.SlackBuild b/source/ap/cups/cups.SlackBuild index 506e7edc6..28f47c1cf 100755 --- a/source/ap/cups/cups.SlackBuild +++ b/source/ap/cups/cups.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2010, 2011, 2012, 2015, 2017, 2018, 2019, 2021, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2008, 2009, 2010, 2011, 2012, 2015, 2017, 2018, 2019, 2021, 2022, 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=cups VERSION=${VERSION:-$(echo $PKGNAM-2*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-2} +BUILD=${BUILD:-3} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -98,6 +98,7 @@ CXXFLAGS="$SLKCFLAGS" \ --enable-cdsassl=no \ --docdir=/usr/doc \ --mandir=/usr/man \ + --with-rundir=/run/cups \ $PAM_OPTIONS \ $SHADOW_OPTIONS \ --build=$ARCH-slackware-linux || exit 1 @@ -105,6 +106,9 @@ CXXFLAGS="$SLKCFLAGS" \ make $NUMJOBS || exit 1 make BUILDROOT=$PKG install || exit 1 +# These files are lost with a restart, so don't package them: +rm -r $PKG/run + if [ ! -z "$PAM_OPTIONS" ]; then # Allow pam config files to be edited by root: chmod 644 $PKG/etc/pam.d/* |