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

Bug 559136

Summary: sys-apps/portage : emerge --sync doesn't honor FEATURES="usersync" when using the git sync method
Product: Portage Development Reporter: Raymond Jennings <shentino>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: RESOLVED WORKSFORME    
Severity: normal CC: esigra, om
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 240187, 941607    

Description Raymond Jennings 2015-08-30 00:31:39 UTC
Just tested, and the git process spawned to do a git sync is running as root, not as portage.

Reproducible: Always
Comment 1 ephemer0l 2015-08-30 03:56:06 UTC
Poking through the wiki, it looks like a workaround would be to set 

'sync-user = root:portage' in your /../../repos.conf/gentoo.conf.
Comment 2 ephemer0l 2015-08-30 03:58:30 UTC
err, maybe 'sync-user = portage' in your /../../repos.conf/gentoo.conf would be better...
Comment 3 Zac Medico gentoo-dev 2015-09-01 16:27:01 UTC
Looking at the code, the rsync module uses self.spawn_kwargs which is supposed to make it drop privileges, but it only if you first chown the repository to whatever user you want it to sync as:

https://gitweb.gentoo.org/proj/portage.git/tree/pym/portage/sync/controller.py?h=v2.2.20.1#n276

So, you should run chown -R on the repository for the user that you want it to drop privileges to.
Comment 4 Raymond Jennings 2016-08-26 02:42:01 UTC
pebcak.

I have a hunch this would be better if it were documented in a man page or something but it doesn't appear to be an actual bug in the code.