Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 428262 - pkg_pretend() make calls cause 'Permission denied' errors with distcc
Summary: pkg_pretend() make calls cause 'Permission denied' errors with distcc
Status: CONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-27 07:06 UTC by Michał Górny
Modified: 2022-02-16 19:21 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-07-27 07:06:52 UTC
When emerging a package which used make in pkg_pretend() (to get kernel version), I get a lot of the following errors:

distcc[30129] (dcc_open_lockfile) ERROR: failed to creat /tmp/portage/.distcc/lock/cpu_localhost_0: Permission denied
distcc[30129] (dcc_lock_one) ERROR: failed to lock

/tmp/portage/.distcc/
├── [drwxrwsr-x root     portage ]  lock
│   └── [-rw-r--r-- root     portage ]  cpu_localhost_0
└── [drwxrwsr-x root     portage ]  state

Looking at the:

 * Adjusting permissions for FEATURES=userpriv: '/tmp/portage/.distcc'
 * Adjusting permissions for FEATURES=userpriv: '/tmp/portage/.distcc/lock'
 * Adjusting permissions for FEATURES=userpriv: '/tmp/portage/.distcc/state'

I guess that portage adjusts the permissions for directories only, assuming there are no files inside yet. As the earlier make call created the cpu_localhost_0 file, it lacks g+w.

The simplest solution would be to simply adjust the permissions recursively. An alternative might be to disable distcc during pkg_pretend() but same problem is likely to appear when ebuilds use RESTRICT=userpriv.
Comment 1 Zac Medico gentoo-dev 2012-09-04 00:16:11 UTC
Looking at the code, it already uses the apply_recursive_permissions function when you see that "Adjusting permissions" message, which should do files like cpu_localhost_0 as well. The relevant code is in the _prepare_features_dirs function inside /usr/lib/portage/pym/portage/package/ebuild/prepare_build_dirs.py.