quilt/inspect-check-if-wrapper-executable.patch
Jean Delvare 79c956ee44 - 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
2012-01-17 20:37:43 +00:00

32 lines
947 B
Diff

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