From 18f5ca442a84108bd065c5ea7bc924744d37955e5cf801ff4e892c4bd9be1c37 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 17 Jan 2012 20:37:43 +0000 Subject: [PATCH] - inspect-remap-outputs.patch, inspect-check-if-wrapper-executable.patch: inspect: Report if patch/tar wrapper can't be executed (quilt setup). OBS-URL: https://build.opensuse.org/package/show/devel:tools:scm/quilt?expand=0&rev=47 --- inspect-check-if-wrapper-executable.patch | 31 ++++++++++ inspect-remap-outputs.patch | 70 +++++++++++++++++++++++ quilt.changes | 7 +++ quilt.spec | 4 ++ 4 files changed, 112 insertions(+) create mode 100644 inspect-check-if-wrapper-executable.patch create mode 100644 inspect-remap-outputs.patch diff --git a/inspect-check-if-wrapper-executable.patch b/inspect-check-if-wrapper-executable.patch new file mode 100644 index 0000000..d74619d --- /dev/null +++ b/inspect-check-if-wrapper-executable.patch @@ -0,0 +1,31 @@ +inspect: Complain if wrapper script can't be executed. + +There is no guarantee that the wrapper script can be executed. +For example user can mount their temporary directories with noexec +for security reasons. Instead of failing with no explanation, +complain when this situation is detected. +--- + quilt/scripts/inspect.in | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/quilt/scripts/inspect.in ++++ b/quilt/scripts/inspect.in +@@ -317,7 +317,18 @@ cat <<-'EOF' > $tmpdir/bin/wrapper + ${0##*/} "$@" < $tmpdir/data + fi + EOF ++ + chmod 755 $tmpdir/bin/wrapper ++# If $TMPDIR is mounted with noexec, rpmbuild won't be able to execute ++# our wrapper script ++if [ ! -x $tmpdir/bin/wrapper ] ++then ++ printf "Cannot execute %s; filesystem mounted with noexec?\n" \ ++ $tmpdir/bin/wrapper >&2 ++ printf "Setting %s in ~/.quiltrc may help\n" "VARTMPDIR" >&2 ++ exit 1 ++fi ++ + ln -s wrapper $tmpdir/bin/patch + ln -s wrapper $tmpdir/bin/tar + diff --git a/inspect-remap-outputs.patch b/inspect-remap-outputs.patch new file mode 100644 index 0000000..fab5bd4 --- /dev/null +++ b/inspect-remap-outputs.patch @@ -0,0 +1,70 @@ +inspect: Leave stderr free for actual error reporting. +--- + quilt/scripts/inspect.in | 17 +++++++++-------- + 1 file changed, 9 insertions(+), 8 deletions(-) + +--- quilt-0.50.orig/quilt/scripts/inspect.in ++++ quilt-0.50/quilt/scripts/inspect.in +@@ -76,11 +76,12 @@ then + fi + + # Redirect file descriptors ++# 5 is used in verbose mode, 4 in non-verbose mode, and 2 for both (real errors) + if [ -n "$verbose" ] + then +- exec 3>&1 4>/dev/null ++ exec 3>&1 5>&2 4>/dev/null + else +- exec 3>&1 4>&2 2>/dev/null ++ exec 3>&1 4>&2 5>/dev/null + fi + + # create md5 sums, also for uncompressed files +@@ -96,7 +97,7 @@ do + esac + [ -f "$file" ] || continue + echo -n "." >&4 +- echo "md5sum < $file" >&2 ++ echo "md5sum < $file" >&5 + set -- $(md5sum < "$file") + echo "$1 $basename" + +@@ -118,25 +119,25 @@ do + case "$filetype" in + compress*|gzip*) + echo -n "g" >&4 +- echo "gzip -cd $file | md5sum" >&2 ++ echo "gzip -cd $file | md5sum" >&5 + set -- $(gzip -cd "$file" | md5sum) + echo "$1 $basename" + ;; + bzip2*) + echo -n "b" >&4 +- echo "bzip2 -cd $file | md5sum" >&2 ++ echo "bzip2 -cd $file | md5sum" >&5 + set -- $(bzip2 -cd "$file" | md5sum) + echo "$1 $basename" + ;; + xz*|XZ*) + echo -n "x" >&4 +- echo "xz -cd $file | md5sum" >&2 ++ echo "xz -cd $file | md5sum" >&5 + set -- $(xz -cd "$file" | md5sum) + echo "$1 $basename" + ;; + lzma*) + echo -n "l" >&4 +- echo "lzma -cd $file | md5sum" >&2 ++ echo "lzma -cd $file | md5sum" >&5 + set -- $(lzma -cd "$file" | md5sum) + echo "$1 $basename" + ;; +@@ -339,7 +340,7 @@ rpmbuild --eval "%define _sourcedir $sou + --eval "%define __tar $tmpdir/bin/tar" \ + --eval "$DEFINE_FUZZ" \ + --nodeps \ +- -bp "$specdir/$specfile" < /dev/null >&2 ++ -bp "$specdir/$specfile" < /dev/null >&5 2>&5 + status=$? + echo >&4 + exit $status diff --git a/quilt.changes b/quilt.changes index 958e973..98010e8 100644 --- a/quilt.changes +++ b/quilt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 17 21:34:30 CET 2012 - jdelvare@suse.de + +- inspect-remap-outputs.patch, + inspect-check-if-wrapper-executable.patch: inspect: Report if + patch/tar wrapper can't be executed (quilt setup). + ------------------------------------------------------------------- Fri Dec 16 14:41:39 CET 2011 - jdelvare@suse.de diff --git a/quilt.spec b/quilt.spec index c47998b..a9277d9 100644 --- a/quilt.spec +++ b/quilt.spec @@ -44,6 +44,8 @@ Patch6: mail-fix-delivery-address-checking.patch Patch7: fix-inspect.patch Patch8: change-docdir-definition.patch Patch9: patchfns-non-exec.patch +Patch10: inspect-remap-outputs.patch +Patch11: inspect-check-if-wrapper-executable.patch Url: http://savannah.nongnu.org/projects/quilt BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -72,6 +74,8 @@ Authors: %patch7 -p1 %patch8 -p1 %patch9 -p1 +%patch10 -p1 +%patch11 -p1 %build # --with-rpmbuild=/usr/lib/rpm/rpmb: