Source: xdg-utils Followup-For: Bug #981422 Hello The attached commit suggests a third option. If you call the scripts with an explicit interpreter, they need no execution rights in the first place.
>From 5a48d85ad66d60e9be0085e98fdc6ab830cf2e9f Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Wed, 31 Mar 2021 17:05:29 +0200 Subject: autotests: in test-lib.sh, call tty{on,off} with an explicit interpreter
Explicit interpreters are usually discouraged so the calling code is not broken by changes in the implementation, but in this case, autotests/tty{on,off} are private helpers for autotests/test-lib.sh. With an explicit interpreter, the scripts do not need execution rights. Closes: #981422. diff --git a/autotests/test-lib.sh b/autotests/test-lib.sh index 87cab44..a16eb93 100644 --- a/autotests/test-lib.sh +++ b/autotests/test-lib.sh @@ -200,9 +200,9 @@ run() { local trace= if [ "$DETACH" = 0 ]; then - trace="./ttyon" + trace="/usr/bin/perl ttyon" elif [ "$DETACH" = 1 ]; then - trace="./ttyoff" + trace="/usr/bin/perl ttyoff" fi trace="$trace ${SHELL:-/bin/sh}" if [ "$TRACE" = 1 ]; then diff --git a/autotests/ttyoff b/autotests/ttyoff old mode 100755 new mode 100644 diff --git a/autotests/ttyon b/autotests/ttyon old mode 100755 new mode 100644 diff --git a/debian/rules b/debian/rules index 50c1d53..59b7c05 100755 --- a/debian/rules +++ b/debian/rules @@ -26,8 +26,6 @@ override_dh_auto_clean: override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) -# Fix perms of new files from the patch. - chmod +x autotests/ttyon autotests/ttyoff # Use automated tests that do not require a user action. make autotest endif diff --git a/debian/tests/entry b/debian/tests/entry index 4c1e834..7ba19b7 100755 --- a/debian/tests/entry +++ b/debian/tests/entry @@ -13,6 +13,5 @@ fi BASH_XTRACEFD=1 set -x -debian/rules patch ./configure make autotest SHELL="${1:-/bin/sh}"