diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-01-14 03:56:53 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-01-14 03:56:53 +0000 |
commit | 82001426fe423b57f709c418c8e03d1fdce8e1b1 (patch) | |
tree | 44874345cde4bfafec9bb8f1fd7a5257b1212559 | |
parent | c25c3d3752eb825387662f87331dafdabc547011 (diff) | |
download | portage-82001426fe423b57f709c418c8e03d1fdce8e1b1.tar.gz portage-82001426fe423b57f709c418c8e03d1fdce8e1b1.tar.bz2 portage-82001426fe423b57f709c418c8e03d1fdce8e1b1.zip |
Use a new 'usersync' feature to control dropping of privileges for --sync,
since it's fairly common for people to have inconsistent permissions between
$PORTDIR and contained files/directories. (trunk r12496)
svn path=/main/branches/2.1.6/; revision=12506
-rw-r--r-- | man/make.conf.5 | 4 | ||||
-rw-r--r-- | pym/_emerge/__init__.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/man/make.conf.5 b/man/make.conf.5 index b2d447eb9..9526a6315 100644 --- a/man/make.conf.5 +++ b/man/make.conf.5 @@ -356,6 +356,10 @@ portage:portage without a sandbox (unless \fIusersandbox\fR is also used). .B usersandbox Enable the sandbox in the compile phase, when running without root privs (\fIuserpriv\fR). .TP +.B usersync +Drop privileges to the owner of \fBPORTDIR\fR for \fBemerge(1) --sync\fR +operations. +.TP .B webrsync-gpg Enable GPG verification when using \fIemerge\-webrsync\fR. .RE diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 130bf7ecf..48a1e911a 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -11892,7 +11892,8 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): spawn_kwargs = {} spawn_kwargs["env"] = settings.environ() - if portage.data.secpass >= 2 and \ + if 'usersync' in settings.features and \ + portage.data.secpass >= 2 and \ (st.st_uid != os.getuid() and st.st_mode & 0700 or \ st.st_gid != os.getgid() and st.st_mode & 0070): try: |