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

svn path=/main/branches/2.1.2/; revision=8829

pym/portage.py

index 6582a3738061b29630bb4def51a7b5e071533c7a..b23cf04724f2ef721e7e12463b14fc0a8182e752 100644 (file)
@@ -9233,7 +9233,10 @@ class dblink:
                        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_exec import atexit_register
                        atexit_register(shutil.rmtree, base_path_tmp)
                        dir_perms = 0755