summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-08-14 05:30:38 +0000
committerZac Medico <zmedico@gentoo.org>2009-08-14 05:30:38 +0000
commita5832535ef4e08143bfe93399f68fd22ba24f183 (patch)
tree49b7665e04f36366af25d171aa079812021399c1
parent19caf9be975b650c6778a28432ccb11a9c429f84 (diff)
downloadportage-a5832535ef4e08143bfe93399f68fd22ba24f183.tar.gz
portage-a5832535ef4e08143bfe93399f68fd22ba24f183.tar.bz2
portage-a5832535ef4e08143bfe93399f68fd22ba24f183.zip
Use portage's selinux wrapper module for mkdir calls.
svn path=/main/trunk/; revision=14020
-rw-r--r--pym/portage/dbapi/vartree.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 0b4cf2bde..18c387ee7 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -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])