summaryrefslogtreecommitdiffstats
path: root/pym/portage_selinux.py
diff options
context:
space:
mode:
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]