From: Zac Medico Date: Thu, 9 Sep 2010 03:47:34 +0000 (-0700) Subject: Bug #336503 - Use PORTAGE_TMPDIR for the emerge --sync server timestamp X-Git-Tag: v2.2_rc79~33 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3f7f72cf339da70b13b8c8c92e6b674ad394c5aa;p=portage.git 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. --- 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,