FS#5908 - add permissions checking for makepkg or pacman

Attached to Project: Pacman
Opened by Roman Kyrylych (Romashka) - Tuesday, 28 November 2006, 10:57 GMT
Last edited by Aaron Griffin (phrakture) - Thursday, 06 December 2007, 22:15 GMT
Task Type Feature Request
Category General
Status Closed
Assigned To Aaron Griffin (phrakture)
Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 0.7.2 Gimmick
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

When installing package pacman is overwriting directories' and files' permissions.
This can lead to bad situations (I had one in past days) when PKGBUILD produces directory tree with wrorng permissions.
This often happen when creating packages for software that comes in rpm or binary form.
For example rpms have all directories readable and browsable only for root! So when user forgets to do find $startdir/pkg -type d -exec chmod 755 {} \; after unpacking rpm with rpmextract bad things may happen. For example I broke my system twice in past days because I forget to chmod +x /etc and /usr dirs for one rpm-based package (my fault).

So, to avoid such things for home-made packages or packages installed with AUR autoinstalling tools (yaourt, aurbuild, qpkg, aur-install) it will be nice to have the following feature(s):
1) pacman should check permissions for all files and (especially) directories that are overwritten by package and warn user if there are some differences. I know this may be hard to implament, I don't know if libarchive have something that makes this support easier. And I don't know how this will affect package installing speed.
AND/ORr
2) makepkg should make sure that $startdir/pkg/* directories have correct parmissions set. This is much easier IMO, and it doesn't costs much to implement.
AND
3) namcap should check for such issues too. Currently it show warnings about "directory has no word readable bit set" and wrong owner/group, but for _executable_ bit for directories.
Closed by  Aaron Griffin (phrakture)
Thursday, 06 December 2007, 22:15 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in git
Comment by Jason Chu (jason) - Tuesday, 24 July 2007, 18:39 GMT
I've added a check to namcap 2.0 for directories with the world executable bit.
Comment by Roman Kyrylych (Romashka) - Wednesday, 25 July 2007, 07:22 GMT
Cool, thanks!
BTW, where can we get the namcap-2.0-1 package for testing? ;-)

So, now that namcap does this check - will it still be useful to have similar checks in pacman/makepkg?
I think yes, but I'm not sure if this won't complicate things.
If no - then we can close this FR as implemented.
Opinions?
Comment by Jason Chu (jason) - Wednesday, 25 July 2007, 14:58 GMT
You can get namcap 2.0 from the git repo if you want. It's not yet released.

http://projects.archlinux.org/git/namcap.git

Loading...