diff options
author | Patrick J Volkerding <volkerdi@slackware.com> | 2022-01-29 06:17:05 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2022-01-29 17:59:50 +0100 |
commit | 730d3ea742358a7ffbb6ad5e024c33dc7a77a11c (patch) | |
tree | f23af3763d69c38c600589a7113975cc5e208b00 /source | |
parent | 131d525a4725408e03739c47eab762874f77fd55 (diff) | |
download | current-730d3ea742358a7ffbb6ad5e024c33dc7a77a11c.tar.gz |
Sat Jan 29 06:17:05 UTC 202220220129061705
a/rpm2tgz-1.2.2-x86_64-5.txz: Rebuilt.
rpm2targz: when extracting the cpio archive from inside the RPM, use
--no-absolute-filenames to protect against a poorly made RPM scribbling all
over system files/directories. Thanks to Sl4ck3ver.
Support -i option to ignore non-zero exit value from rpm2cpio.
This allows repackaging some malformed RPMs.
Thanks to ricky_cardo for the sample malformed RPM.
Diffstat (limited to 'source')
-rwxr-xr-x | source/a/plzip/plzip.SlackBuild | 2 | ||||
-rw-r--r-- | source/a/rpm2tgz/patches/0010-no-absolute-filenames-extracting-cpio.patch | 11 | ||||
-rw-r--r-- | source/a/rpm2tgz/patches/0011-ignore-rpm2cpio-error-code.patch | 44 | ||||
-rw-r--r-- | source/a/rpm2tgz/rpm2targz | 2 | ||||
-rwxr-xr-x | source/a/rpm2tgz/rpm2tgz.SlackBuild | 11 | ||||
-rwxr-xr-x | source/ap/sudo/sudo.SlackBuild | 4 | ||||
-rwxr-xr-x | source/x/mesa/mesa.SlackBuild | 4 |
7 files changed, 70 insertions, 8 deletions
diff --git a/source/a/plzip/plzip.SlackBuild b/source/a/plzip/plzip.SlackBuild index aefb1204..035d8d1d 100755 --- a/source/a/plzip/plzip.SlackBuild +++ b/source/a/plzip/plzip.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=plzip VERSION=${VERSION:-$(echo $PKGNAM-*.tar.lz | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-3} +BUILD=${BUILD:-1} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/a/rpm2tgz/patches/0010-no-absolute-filenames-extracting-cpio.patch b/source/a/rpm2tgz/patches/0010-no-absolute-filenames-extracting-cpio.patch new file mode 100644 index 00000000..77901223 --- /dev/null +++ b/source/a/rpm2tgz/patches/0010-no-absolute-filenames-extracting-cpio.patch @@ -0,0 +1,11 @@ +--- ./rpm2targz.orig 2022-01-28 23:26:57.686681986 -0600 ++++ ./rpm2targz 2022-01-28 23:28:18.872683802 -0600 +@@ -175,7 +175,7 @@ + fi + mkdir -p $DEST + ( cd $DEST +- cpio -i -m -d < $ofn 1> /dev/null 2> /dev/null ++ cpio -i -m -d --no-absolute-filenames < $ofn 1> /dev/null 2> /dev/null + rm -f $ofn + find . -type d -perm 700 -exec chmod 755 {} \; + ) diff --git a/source/a/rpm2tgz/patches/0011-ignore-rpm2cpio-error-code.patch b/source/a/rpm2tgz/patches/0011-ignore-rpm2cpio-error-code.patch new file mode 100644 index 00000000..61f5a04b --- /dev/null +++ b/source/a/rpm2tgz/patches/0011-ignore-rpm2cpio-error-code.patch @@ -0,0 +1,44 @@ +--- ./rpm2targz.orig 2022-01-28 23:51:56.398715512 -0600 ++++ ./rpm2targz 2022-01-28 23:53:21.350717413 -0600 +@@ -50,6 +50,7 @@ + echo " as documention to /usr/doc/\$PRGNAM-\$VERSION/" + echo " -d attempt a wellformed slack-desc from the rpm meta data" + echo " -c reset all directory permissions to 755 and ownership to root:root." ++ echo " -i continue to repackage even if rpm2cpio reports an error" + echo + else + echo "Usage: $0 <file.rpm>" +@@ -99,7 +100,7 @@ + usage + fi + +-ARGS=$(getopt "hsSndrc" $* ) ++ARGS=$(getopt "hisSndrc" $* ) + set -- ${ARGS} + for i; do + case "$1" in +@@ -127,6 +128,10 @@ + CHOWN="true" + shift + ;; ++ -i) ++ IGNOREERROR="true" ++ shift ++ ;; + --) + shift + break +@@ -160,8 +165,11 @@ + ofn=$TMPDIR/$(basename $i .rpm).cpio + if which rpm2cpio 1> /dev/null 2> /dev/null ; then + rpm2cpio $i > $ofn 2> /dev/null +- if [ ! $? = 0 ]; then +- echo "ERROR: rpm2cpio failed. (maybe $i is not an RPM?)" ++ ERRORCODE=$? ++ if [ ! $ERRORCODE = 0 -a ! "$IGNOREERROR" = "true" ]; then ++ echo "ERROR: rpm2cpio failed (returned error code $ERRORCODE). Maybe $i is not an RPM?" ++ echo "If you wish to try again, you may ignore the error code and force $0 to try to" ++ echo "create a package by adding this option: -i" + rm -rf $TMPDIR + continue + fi diff --git a/source/a/rpm2tgz/rpm2targz b/source/a/rpm2tgz/rpm2targz index 5c91c64a..3778cdc2 100644 --- a/source/a/rpm2tgz/rpm2targz +++ b/source/a/rpm2tgz/rpm2targz @@ -1,7 +1,7 @@ #!/bin/sh # Copyright 1997, 1998 Patrick Volkerding, Moorhead, MN USA # Copyright 2002, 2004 Slackware Linux, Inc., Concord, CA USA -# Copyright 2006, 2009 Patrick Volkerding, Sebeka, MN USA +# Copyright 2006, 2009, 2022 Patrick Volkerding, Sebeka, MN USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is diff --git a/source/a/rpm2tgz/rpm2tgz.SlackBuild b/source/a/rpm2tgz/rpm2tgz.SlackBuild index 1bb9ec11..00ebb5bc 100755 --- a/source/a/rpm2tgz/rpm2tgz.SlackBuild +++ b/source/a/rpm2tgz/rpm2tgz.SlackBuild @@ -1,6 +1,6 @@ #!/bin/bash -# Copyright 2008, 2009, 2010, 2018 Patrick J. Volkerding, Sebeka, Minnesota, USA +# Copyright 2008, 2009, 2010, 2018, 2022 Patrick J. Volkerding, Sebeka, Minnesota, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=rpm2tgz VERSION=1.2.2 -BUILD=${BUILD:-4} +BUILD=${BUILD:-5} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -78,6 +78,13 @@ cat $CWD/rpm2targz > $PKG/usr/bin/rpm2targz zcat $CWD/patches/0007-Add-support-for-.txz-packages-and-rpm2txz-symlink.patch.gz | patch -p1 || exit 1 zcat $CWD/patches/0008-Avoid-none-values-in-slack-desc.patch.gz | patch -p1 || exit 1 zcat $CWD/patches/0009-Add-c-option-just-as-makepkg-c-y.patch.gz | patch -p1 || exit 1 + # Make sure that if someone created an RPM with absolute filenames that we + # don't allow it to write all over the / directory when we're just trying + # to extract it to make the .tgz: + zcat $CWD/patches/0010-no-absolute-filenames-extracting-cpio.patch.gz | patch -p1 || exit 1 + # Allow ignoring rpm2cpio error code. Some RPMs can be extracted, but + # throw an error anyway. + zcat $CWD/patches/0011-ignore-rpm2cpio-error-code.patch.gz | patch -p1 || exit 1 ) || exit 1 ( cd $PKG/usr/bin ; ln -sf rpm2targz rpm2tgz ) diff --git a/source/ap/sudo/sudo.SlackBuild b/source/ap/sudo/sudo.SlackBuild index a1d65af6..42b9895d 100755 --- a/source/ap/sudo/sudo.SlackBuild +++ b/source/ap/sudo/sudo.SlackBuild @@ -127,8 +127,8 @@ mv $PKG/etc/sudoers $PKG/etc/sudoers.new rm -r $PKG/usr/doc/sudo-$VERSION mkdir -p $PKG/usr/doc/sudo-$VERSION cp -a \ - INSTALL NEWS README* \ - doc/{CONTRIBUTORS,HISTORY,LICENSE,TROUBLESHOOTING,UPGRADE} \ + INSTALL* LICENSE* NEWS* README* \ + docs/{CONTRIB*,HISTORY*,SECURITY*,TROUBLESHOOTING*,UPGRADE*} \ $PKG/usr/doc/sudo-$VERSION chmod 644 $PKG/usr/doc/sudo-$VERSION/* diff --git a/source/x/mesa/mesa.SlackBuild b/source/x/mesa/mesa.SlackBuild index 47c0bcb9..10cc1467 100755 --- a/source/x/mesa/mesa.SlackBuild +++ b/source/x/mesa/mesa.SlackBuild @@ -25,7 +25,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=mesa VERSION=${VERSION:-$(echo $PKGNAM-[0-9]*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} DEMOVERS=${DEMOVERS:-8.4.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} BUILD_DEMOS=${BUILD_DEMOS:-YES} NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} @@ -183,7 +183,7 @@ if [ "$BUILD_DEMOS" = "YES" ]; then make install DESTDIR=$PKG/cruft || exit 1 # Install gears and glinfo, as well as a few other demos: mkdir -p $PKG/usr/bin - for demo in gears glinfo glthreads glxcontexts glxdemo glxgears \ + for demo in eglinfo gears glinfo glthreads glxcontexts glxdemo glxgears \ glxgears_fbconfig glxheads glxinfo glxpbdemo glxpixmap ; do mv --verbose $PKG/cruft/usr/bin/$demo $PKG/usr/bin done |