Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 58611 - portage.py(mergeme) failes to change permission/ownership of a directory ${ROOT}/dir if ${IMAGE}/dir has different ownership/permissions.
Summary: portage.py(mergeme) failes to change permission/ownership of a directory ${RO...
Status: RESOLVED WONTFIX
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-27 18:38 UTC by Daniel Black (RETIRED)
Modified: 2017-01-27 22:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Black (RETIRED) gentoo-dev 2004-07-27 18:38:42 UTC
portage.py(line 6581 (current cvs))

If a user has a dir:
drwxr-xr-x  2 root root 4096 Jul 28 10:02 /var/spool/wwwoffle/prevtime4
and an ebuild creates a dir:
drwxr-xr-x  2 wwwoffle wwwoffle 4096 Jul 28 10:02 /var/tmp/portage/wwwoffle-2.8b/image/var/spool/wwwoffle/prevtime4

The merging of the ebuild fails to change the ownership, group and permissions of the destination directory.

wwwoffle-2.8b works around this with a evil pkg_postinst.
Comment 1 Nicholas Jones (RETIRED) gentoo-dev 2004-07-31 19:10:18 UTC
I don't think this is something portage can legitimately do.
Portage shouldn't modify your directory permissions.
Comment 2 Daniel Black (RETIRED) gentoo-dev 2004-08-01 16:15:32 UTC
More food for reconsideration:

A version bumped ebuild will not be able to change the permissions on a directory even if the directory was created by a previous ebuild with different ownership/permissions? This introduces an inconsistency with the way portage handles directories different from files. If an ebuild creates a file, and the file exists in the ${ROOT} directory, it will be overwriten regardless of its permissions/ownership. How is a directory different?

So to legitimately update the directory you would need to emerge -C the previous version and reemerge the update to get the correct permissions directories? If a security fix requires a permission/ownership change on a directory, is a "emerge security" going to be able to fix it (without using pkg_postinst?
Comment 3 SpanKY gentoo-dev 2004-08-10 19:34:47 UTC
the permissions shouldnt get changed by an incoming ebuild ... the problem is that, how is portage to know which permissions are the correct set ?

some users like to tweak permissions on their dirs; they'd get pissed if portage kept turning around and resetting them on them ...

so yes, the only real way to work around bum initial permissions is to have pkg_postinst do it up for you :/