diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-08 20:47:34 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-08 20:47:34 -0700 |
commit | 3f7f72cf339da70b13b8c8c92e6b674ad394c5aa (patch) | |
tree | 7e75b637aac7db70ceb3adfc68c98b94011f16ac | |
parent | 2b3416c9556ba85bc6f9c39b916644ffa718cab1 (diff) | |
download | portage-3f7f72cf339da70b13b8c8c92e6b674ad394c5aa.tar.gz portage-3f7f72cf339da70b13b8c8c92e6b674ad394c5aa.tar.bz2 portage-3f7f72cf339da70b13b8c8c92e6b674ad394c5aa.zip |
Bug #336503 - Use PORTAGE_TMPDIR for the emerge --sync server timestamp
tempfile, since with FEATURES=usersync, the default directory used by
the tempfile module may not be readbable by the usersync user.
-rw-r--r-- | pym/_emerge/actions.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index f7709f0cd..d9d0dffe5 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -2115,8 +2115,13 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): # --timeout option does not prevent. if True: # Temporary file for remote server timestamp comparison. - from tempfile import mkstemp - fd, tmpservertimestampfile = mkstemp() + # NOTE: If FEATURES=usersync is enabled then the tempfile + # needs to be in a directory that's readable by the usersync + # user. We assume that PORTAGE_TMPDIR will satisfy this + # requirement, since that's not necessarily true for the + # default directory used by the tempfile module. + fd, tmpservertimestampfile = \ + tempfile.mkstemp(dir=settings['PORTAGE_TMPDIR']) os.close(fd) if usersync_uid is not None: portage.util.apply_permissions(tmpservertimestampfile, |