Skip to content

Commit dc01d71

Browse files
committed
_drop_privs_userfetch: ensure cwd is accessible
The cwd needs to be accessible in order for the multiprocessing spawn start method to succeed: File "/usr/lib/python3.14/multiprocessing/spawn.py", line 235, in prepare os.chdir(data['dir']) ~~~~~~~~^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied: '/root' Bug: https://bugs.gentoo.org/965138 Signed-off-by: Zac Medico <[email protected]>
1 parent f212d2b commit dc01d71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/portage/package/ebuild/fetch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ def _drop_privs_userfetch(settings):
120120
os.setuid(int(spawn_kwargs["uid"]))
121121
os.umask(spawn_kwargs["umask"])
122122
portage.data.secpass = 1
123+
try:
124+
os.chdir(settings.get("HOME", "/"))
125+
except Exception:
126+
os.chdir("/")
123127

124128

125129
def _spawn_fetch(settings, args, **kwargs):

0 commit comments

Comments
 (0)