[SRU L, K, J, F, B][PATCH 1/1] UBUNTU: [Debian] autoreconstruct - fix restoration of execute permissions
Roxana Nicolescu
roxana.nicolescu at canonical.com
Thu Apr 6 17:49:05 UTC 2023
BugLink: http://bugs.launchpad.net/bugs/2015498
Debian source package diffs cannot represent that a file should be
executable.
gen-auto-reconstruct detects the situations where a file has changed
its permissions and restores the execute permissions in the
reconstruct script, assuming the file has always had execute permission.
This does not work in case a file removed the execute permission because
the script will change it back.
The script now adds either `chmod +x` or `chmod -x` based on the actual
permission change.
Signed-off-by: Andy Whitcroft <apw at canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu at canonical.com>
---
debian/scripts/misc/gen-auto-reconstruct | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/debian/scripts/misc/gen-auto-reconstruct b/debian/scripts/misc/gen-auto-reconstruct
index 43ec90345055..a50ceb619f17 100755
--- a/debian/scripts/misc/gen-auto-reconstruct
+++ b/debian/scripts/misc/gen-auto-reconstruct
@@ -50,7 +50,12 @@ fi
new=$( printf "0%s" $new )
changed=$(( (old ^ new) & 0111 ))
if [ "$changed" -ne 0 ]; then
- echo "chmod +x '$name'"
+ added=$(( new & 0111 ))
+ if [ "$added" -ne 0 ]; then
+ echo "chmod +x '$name'"
+ else
+ echo "chmod -x '$name'"
+ fi
fi
done
--
2.34.1
More information about the kernel-team
mailing list