Skip to content

Commit

Permalink
builddeb: fix file permissions before packaging
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
henning-schild authored and Michal Marek committed Jul 26, 2016
1 parent cc65e82 commit ca617dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/package/builddeb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ create_package() {
# Fix ownership and permissions
chown -R root:root "$pdir"
chmod -R go-w "$pdir"
# in case we are in a restrictive umask environment like 0077
chmod -R a+rX "$pdir"

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

0 comments on commit ca617dc

Please sign in to comment.