Comment 0 for bug 2015498

Revision history for this message
Roxana Nicolescu (roxanan) wrote :

SRU justification

[Impact]

Debian source package diffs cannot represent that a file should
be executable.
gen-auto-reconstruct detects when a commit adds a script that is supposed to be invoked during the build and restores the execute permissions in the reconstruct script by adding `chmod +x $file`.

But, if a file removes its execute permission, this will change it back.
This happened in the last jammy release (version 5.15.0-70.77) where a commit from upstream
removed the execute permission for a header file but then our scripts brought it back.

[Fix]
Andy proposed the following fix
https://dpaste.com/6SJ8YR3BM
Basically it checks if the permission was added or removed and uses either +x or -x.

[Test plan]
Easily tested with jammy-kvm, latest release where a rebase picked this commit
"treewide: fix up files incorrectly marked executable" where `drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h` changed its permission from 755 to 644 (removed execute).
When debian packages are prepared, you'll notice the file has changed its permission back to 755.
With the fix, it should be the same.

[Regression potential]
Low, it is a small fix. Scripts will still have execute permission.