From 3f7f72cf339da70b13b8c8c92e6b674ad394c5aa Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 8 Sep 2010 20:47:34 -0700 Subject: 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. --- pym/_emerge/actions.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pym/_emerge/actions.py') 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, -- cgit v1.2.3-1-g7c22