summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2012-01-23 14:01:07 +0100
committerJean Delvare <jdelvare@suse.de>2012-01-23 14:01:07 +0100
commite8e69a32ee8cbd37e95305301958745f28353055 (patch)
tree876a526a833b912782c248288517161e1c074055
parent6e4e7b56321cbb74c6327cecd1d1ecaecc320ebe (diff)
downloadquilt-e8e69a32ee8cbd37e95305301958745f28353055.tar.gz
inspect: Complain if wrapper script can't be executed
There is no guarantee that the wrapper script can be executed. For example users can mount their temporary directories with noexec for security reasons. Instead of failing with no explanation, complain when this situation is detected.
-rw-r--r--quilt.changes1
-rw-r--r--quilt/scripts/inspect.in11
2 files changed, 12 insertions, 0 deletions
diff --git a/quilt.changes b/quilt.changes
index ce06ad4..5af8340 100644
--- a/quilt.changes
+++ b/quilt.changes
@@ -2,6 +2,7 @@
Mon Jan 23 13:56:57 CET 2012 - jdelvare@suse.de
- scripts/inspect.in: Leave stderr free for actual error reporting.
+- scripts/inspect.in: Complain if wrapper script can't be executed.
-------------------------------------------------------------------
Mon Jan 23 10:20:16 CET 2012 - mquinson@debian.org
diff --git a/quilt/scripts/inspect.in b/quilt/scripts/inspect.in
index 9b8bc2e..dea5bac 100644
--- 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