summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2007-10-18 20:27:32 +0000
committerPeter Jones <pjones@redhat.com>2007-10-18 20:27:32 +0000
commitd32c58af29e8ca27fa53726b9e37ba664d44d225 (patch)
treed4756b19b26f55764e020b58a64d881f000d78df /fsset.py
parentcfa0b4b12266e8e44f13bc458204b3a11abd9a80 (diff)
downloadanaconda-d32c58af29e8ca27fa53726b9e37ba664d44d225.tar.gz
anaconda-d32c58af29e8ca27fa53726b9e37ba664d44d225.tar.xz
anaconda-d32c58af29e8ca27fa53726b9e37ba664d44d225.zip
- fix selinux labels on $MOUNTPOINT/ and $MOUNTPOINT/lost+found (#335621)
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)