Use portage's selinux wrapper module for mkdir calls.
authorZac Medico <zmedico@gentoo.org>
Fri, 14 Aug 2009 05:30:38 +0000 (05:30 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Aug 2009 05:30:38 +0000 (05:30 -0000)
svn path=/main/trunk/; revision=14020

pym/portage/dbapi/vartree.py

index 0b4cf2bde77cd56ff4ebd5306d47262058dc9fa3..18c387ee7c50cc950e92b1a1dfdb9c2d53898b21 100644 (file)
@@ -38,6 +38,7 @@ from portage import listdir, dep_expand, digraph, flatten, key_expand, \
 # This is a special version of the os module, wrapped for unicode support.
 from portage import os
 from portage import _unicode_encode
+from portage import selinux
 
 from portage.cache.mappings import slot_dict_class
 
@@ -3857,9 +3858,7 @@ class dblink(object):
                                                        level=logging.ERROR, noiselevel=-1)
                                                #now create our directory
                                                if self.settings.selinux_enabled():
-                                                       import selinux
-                                                       sid = selinux.get_sid(mysrc)
-                                                       selinux.secure_mkdir(mydest,sid)
+                                                       selinux.mkdir(mydest, mysrc)
                                                else:
                                                        os.mkdir(mydest)
                                                if bsd_chflags:
@@ -3870,9 +3869,7 @@ class dblink(object):
                                else:
                                        #destination doesn't exist
                                        if self.settings.selinux_enabled():
-                                               import selinux
-                                               sid = selinux.get_sid(mysrc)
-                                               selinux.secure_mkdir(mydest, sid)
+                                               selinux.mkdir(mydest, mysrc)
                                        else:
                                                os.mkdir(mydest)
                                        os.chmod(mydest, mystat[0])