summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
Diffstat (limited to 'fsset.py')
-rw-r--r--fsset.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/fsset.py b/fsset.py
index d881557d1..95b45acb7 100644
--- a/fsset.py
+++ b/fsset.py
@@ -160,6 +160,8 @@ labelFactory = LabelFactory()
class FileSystemType:
kernelFilesystems = {}
+ lostAndFoundContext = None
+
def __init__(self):
self.deviceArguments = {}
self.formattable = 0
@@ -192,6 +194,15 @@ class FileSystemType:
fstype = self.getName(),
readOnly = readOnly, bindMount = bindMount)
+ if flags.selinux:
+ ret = isys.resetFileContext(mountpoint, instroot)
+ log.info("set SELinux context for newly mounted filesystem root at %s to %s" %(mountpoint, ret))
+ if FileSystemType.lostAndFoundContext is None:
+ FileSystemType.lostAndFoundContext = \
+ isys.matchPathContext("/lost+found")
+ isys.setFileContext("%s/lost+found" % (mountpoint,),
+ FileSystemType.lostAndFoundContext, instroot)
+
def umount(self, device, path):
isys.umount(path, removeDir = 0)