Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/util/
Date: Tue, 06 Oct 2015 20:24:15
Message-Id: 1444162987.597987aac1677e132b80ed2404697acf0188af7a.zmedico@gentoo
1 commit: 597987aac1677e132b80ed2404697acf0188af7a
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Tue Oct 6 20:14:54 2015 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Tue Oct 6 20:23:07 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=597987aa
7
8 apply_secpass_permissions: avoid accessing portage.data.secpass when possible
9
10 This fixes PermissionDenied errors triggered when portage config files
11 and repos have restricted access permissions.
12
13 Fixes: b7baeeec3ab6 ("unpack: use chmod-lite helper for bug 554084")
14
15 pym/portage/util/__init__.py | 4 +++-
16 1 file changed, 3 insertions(+), 1 deletion(-)
17
18 diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
19 index 2b7ff8d..b739257 100644
20 --- a/pym/portage/util/__init__.py
21 +++ b/pym/portage/util/__init__.py
22 @@ -1241,7 +1241,9 @@ def apply_secpass_permissions(filename, uid=-1, gid=-1, mode=-1, mask=-1,
23
24 all_applied = True
25
26 - if portage.data.secpass < 2:
27 + # Avoid accessing portage.data.secpass when possible, since
28 + # it triggers config loading (undesirable for chmod-lite).
29 + if (uid != -1 or gid != -1) and portage.data.secpass < 2:
30
31 if uid != -1 and \
32 uid != stat_cached.st_uid: