Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 421533

Summary: =sys-apps/portage-2.2.0_alpha110: fowners doesn't work from src_install() for existing directories
Product: Portage Development Reporter: Samuli Suominen (RETIRED) <ssuominen>
Component: Core - Ebuild SupportAssignee: Portage team <dev-portage>
Status: RESOLVED DUPLICATE    
Severity: major    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: The patch to drop the workaround for test

Description Samuli Suominen (RETIRED) gentoo-dev 2012-06-17 08:45:10 UTC
Created attachment 315567 [details, diff]
The patch to drop the workaround for test

I'm not sure when it last worked, but you can test this bug with =sys-auth/polkit-0.106-r1 by removing the `chown -R` from it's pkg_postinst() that is working around the issue.

src_install() {
default
fowners -R polkitd:root /{etc,usr/share}/polkit-1/rules.d
}

And after emerge, the owners are back to "root:root"
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2012-06-17 08:50:01 UTC
With chown -R in pkg_postinst():

drwx------ 2 polkitd root Jun 17 11:01 /etc/polkit-1/rules.d
-rw-r--r-- 1 polkitd root Jun 17 10:46 /etc/polkit-1/rules.d/50-default.rules
drwx------ 2 polkitd root Jun  8 02:32 /usr/share/polkit-1/rules.d

Without chown -R (and just fowners in src_install, only the file has correct perms:

-rw-r--r-- 1 polkitd root Jun 17 11:44 /etc/polkit-1/rules.d/50-default.rules
drwx------ 2 root root Jun 17 11:44 /etc/polkit-1/rules.d
drwx------ 2 root root Jun 17 11:44 /usr/share/polkit-1/rules.d
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2012-06-17 09:10:26 UTC
To clarify:

/etc/polkit-1/rules.d and /usr/share/polkit-1/rules.d exist as root:root and this is when trying to change them to polkitd:root

Only files inside the directories change perm, not the directories itself
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2012-06-17 10:20:02 UTC
< Tommy[D]> ssuominen: fowners does work as intended, it does change the ownership inside $D, but afterwards, those directories get copied to $ROOT, in which case you have a cp, which preserves the ownership of the original directory

no way to set permissions from ebuild without using pkg_ and ${ROOT} then, that's far from ideal... fowners/fperms in specific should always be respected, since the maintainer is intentionally/specifically setting them, maybe i'll file another PMS bug for this later
Comment 4 Zac Medico gentoo-dev 2012-06-17 15:26:46 UTC

*** This bug has been marked as a duplicate of bug 141619 ***