Revert a hunk from r2834 because PORTAGE_SANDBOX_T is used incorrectly where PORTAGE_...
authorZac Medico <zmedico@gentoo.org>
Thu, 16 Mar 2006 06:39:10 +0000 (06:39 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 16 Mar 2006 06:39:10 +0000 (06:39 -0000)
svn path=/main/trunk/; revision=2906

pym/portage.py

index 2aace4c45a8f047991d14bfca27bba5aa4fc15f9..cf76952d056ea0c904e1a08aa86e63c2280e50a0 100644 (file)
@@ -1928,9 +1928,14 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                                        myfetch=string.replace(locfetch,"${URI}",loc)
                                        myfetch=string.replace(myfetch,"${FILE}",myfile)
                                        try:
-                                               myret = spawn(myfetch, mysettings, free=1,
-                                                       droppriv=("userfetch" in mysettings.features),
-                                                       sesandbox=selinux_enabled)
+                                               if selinux_enabled:
+                                                       con = selinux.getcontext()
+                                                       con = string.replace(con, mysettings["PORTAGE_T"], mysettings["PORTAGE_FETCH_T"])
+                                                       selinux.setexec(con)
+                                                       myret = spawn(myfetch, mysettings, free=1, droppriv=("userfetch" in mysettings.features))
+                                                       selinux.setexec(None)
+                                               else:
+                                                       myret = spawn(myfetch, mysettings, free=1, droppriv=("userfetch" in mysettings.features))
                                        finally:
                                                #if root, -always- set the perms.
                                                if os.path.exists(mysettings["DISTDIR"]+"/"+myfile) and (fetched != 1 or os.getuid() == 0) \