Skip to content

Commit

Permalink
fetch: remove secpass import (bug 601252)
Browse files Browse the repository at this point in the history
Refer to the portage.secpass.data attribute directly rather than via
import value, since the value will change after fork and os.setuid
calls when the fetch function is called with dropped privileges as
discussed in bug 601252.

Bug: https://bugs.gentoo.org/601252
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Feb 15, 2020
1 parent 9b07545 commit d8d02bd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/portage/package/ebuild/fetch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2010-2019 Gentoo Authors
# Copyright 2010-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

from __future__ import print_function
Expand Down Expand Up @@ -46,7 +46,7 @@
checksum_str)
from portage.const import BASH_BINARY, CUSTOM_MIRRORS_FILE, \
GLOBAL_CONFIG_PATH
from portage.data import portage_gid, portage_uid, secpass, userpriv_groups
from portage.data import portage_gid, portage_uid, userpriv_groups
from portage.exception import FileNotFound, OperationNotPermitted, \
PortageException, TryAgain
from portage.localization import _
Expand Down Expand Up @@ -882,7 +882,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,

if not has_space_superuser:
has_space = False
elif secpass < 2:
elif portage.data.secpass < 2:
has_space = False
elif userfetch:
has_space = False
Expand Down

0 comments on commit d8d02bd

Please sign in to comment.