summaryrefslogtreecommitdiffstats
path: root/pym/portage_selinux.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-05-27 04:53:11 +0000
committerZac Medico <zmedico@gentoo.org>2006-05-27 04:53:11 +0000
commitfdc974f5da4dd94dce7df1408b8cb4d62256e10f (patch)
tree246de0db5dacc11813c63ad1e17e7ca7b15450f8 /pym/portage_selinux.py
parent2d5a2b8eaa2822f946b4c41b40a9d2bdfcbf51dd (diff)
downloadportage-fdc974f5da4dd94dce7df1408b8cb4d62256e10f.tar.gz
portage-fdc974f5da4dd94dce7df1408b8cb4d62256e10f.tar.bz2
portage-fdc974f5da4dd94dce7df1408b8cb4d62256e10f.zip
Remove dependence on a patched version of libselinux for bug #122517.
svn path=/main/trunk/; revision=3430
Diffstat (limited to 'pym/portage_selinux.py')
-rw-r--r--pym/portage_selinux.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pym/portage_selinux.py b/pym/portage_selinux.py
new file mode 100644
index 000000000..4cc265a52
--- /dev/null
+++ b/pym/portage_selinux.py
@@ -0,0 +1,17 @@
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+import selinux
+from selinux import is_selinux_enabled
+from selinux_aux import setexec, secure_symlink, secure_rename, \
+ secure_copy, secure_mkdir
+
+def getcontext():
+ return selinux.getcon()[1]
+
+def get_sid(filename):
+ return selinux.getfilecon(filename)[1]
+
+def get_lsid(filename):
+ return selinux.lgetfilecon(filename)[1]