]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
builddeb: fix file permissions before packaging
authorHenning Schild <henning.schild@siemens.com>
Fri, 22 Jul 2016 12:46:52 +0000 (14:46 +0200)
committerMichal Marek <mmarek@suse.com>
Tue, 26 Jul 2016 20:26:46 +0000 (22:26 +0200)
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>
scripts/package/builddeb

index 202d6e7db8597cd9e359081e2833247286987bc0..116ef00c0b8260b12652fa9c7d195cf0b0303bcd 100755 (executable)
@@ -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"