Bug #201090 - When portage creates a temp PORTAGE_BIN_PATH, put it
authorZac Medico <zmedico@gentoo.org>
Mon, 3 Dec 2007 20:53:29 +0000 (20:53 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 3 Dec 2007 20:53:29 +0000 (20:53 -0000)
inside PORTAGE_TMPDIR since, unlike /tmp, it can't be mounted with
the "noexec" option.

svn path=/main/trunk/; revision=8828

pym/portage/dbapi/vartree.py

index d75029dc69925d2c6db55b565dd5c7fe37052658..54b8d135e0d1fb0f6f1d09177bac657861567e98 100644 (file)
@@ -2407,7 +2407,10 @@ class dblink(object):
                        base_path_orig = os.path.dirname(settings["PORTAGE_BIN_PATH"])
                        from tempfile import mkdtemp
                        import shutil
-                       base_path_tmp = mkdtemp()
+                       # Make the temp directory inside PORTAGE_TMPDIR since, unlike
+                       # /tmp, it can't be mounted with the "noexec" option.
+                       base_path_tmp = mkdtemp("", "._portage_reinstall_.",
+                               settings["PORTAGE_TMPDIR"])
                        from portage.process import atexit_register
                        atexit_register(shutil.rmtree, base_path_tmp)
                        dir_perms = 0755