Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#9632 - kernel26 doesn't set correct file permissions if compiled from abs

Attached to Project: Arch Linux
Opened by Heiko Baums (cyberpatrol) - Wednesday, 20 February 2008, 19:06 GMT
Last edited by Roman Kyrylych (Romashka) - Wednesday, 20 February 2008, 20:03 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

If kernel26 is compiled from abs some file permissions in /usr/src/linux-2.6.24-ARCH may not be set correctly. This can lead to not be able to install third party modules like nvidia from abs.

The problem is that the command cp is used many times in the PKGBUILD for kernel26.

When installing a package from abs by makepkg I'm doing this as an unprivileged user as suggested. For my unprivileged user I set umask 077 because he usually only writes to his own home directory and other users shouldn't be able to read the contents of his home directory.

The problem with cp is that the target files get the current user's standard file permissions set by umask. So in my case the target files get the file permissions 600.

When I install kernel26 from abs many files in the directory /usr/src/linux-2.6.24-ARCH have the file permissions 600 which should be 644. This is why other packages can't read those files.

When I now try to compile nvidia from abs I'm getting this error message:

*** Unable to determine the target kernel version. ***

make: *** [select_makefile] Fehler 1
install: Calling stat for �nvidia.ko� not possible: no such file or directory
==> ERROR: Build failed.
Aborting ...
Error: Makepkg was unable to build nvidia-fbcondecor package.

This error doesn't occur when the files in /usr/src/linux-2.6.24-ARCH have the correct file permissions 644.

So the cp commands in the kernel26 PKGBUILD should be replaced by the command `install -o root -g root -m644`. Then the file permissions are set correctly independent from the user's umask settings.

Another workaround would be adding the command `chmod -R a+r $startdir/pkg/` at the end of the PKGBUILD.

I guess the reason why this problem doesn't occur when the kernel26 binary package is installed by pacman is that the contributor who compiles the kernel26 for the core repository has set umask 022 for his user.

This bug also affects other kernel packages especially from AUR which are based on this PKGBUILD from the official kernel26 from core.


Additional info:
* package version(s)
kernel26 2.6.24.1 and probably other versions
* config and/or log files etc.


Steps to reproduce:

umask 077
cd /var/abs/core/base/kernel26
makepkg [-ci]
ls -l /usr/src/linux-2.6.24-ARCH/include/video (for example, other directories are also affected)

Optional after the installation above:
cd /var/abs/extra/x11/nvidia
makepkg [-ci]
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Wednesday, 20 February 2008, 20:03 GMT
Reason for closing:  Not a bug
Additional comments about closing:  it's a bug in makepkg,
version 3.1.2 should set umask 022 correctly (not just for some operations)

Loading...