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
 

-- 
Jean Delvare
Suse L3

_______________________________________________
Quilt-dev mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/quilt-dev

Reply via email to