Skip to content

Commit ca617dc

Browse files
henning-schildMichal Marek
authored andcommitted
builddeb: fix file permissions before packaging
Builddep is not very explicit about file permissions. Actually the file permissions in the package are largely influenced by the umask of the user cloning the git and building the package. If that umask does not set go+r the resulting linux-headers package will prevent non-root users from building out-of-tree modules. And that is probably just one unexpected effect. Being a packaging/install tool builddep should make sure the file permissions are set correctly and not just derived from a value that is never checked. This patch sets ugo read permissions for all packaged files and derives the executable bit for directories and executables from the file-owner. Signed-off-by: Henning Schild <henning.schild@siemens.com> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent cc65e82 commit ca617dc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/package/builddeb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ create_package() {
2626
# Fix ownership and permissions
2727
chown -R root:root "$pdir"
2828
chmod -R go-w "$pdir"
29+
# in case we are in a restrictive umask environment like 0077
30+
chmod -R a+rX "$pdir"
2931

3032
# Create the package
3133
dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir"

0 commit comments

Comments
 (0)