summaryrefslogtreecommitdiffstats
path: root/fsset.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-08-24 20:16:54 +0000
committerJeremy Katz <katzj@redhat.com>2006-08-24 20:16:54 +0000
commit0d67085632ee9bd64eabad776f208fa250fe4a84 (patch)
tree99e294c1a675454878a146ecf0b9e49fb5b3f81c /fsset.py
parentbafe7b1a8184a23a14efe35f083c2fcb190cdc24 (diff)
downloadanaconda-0d67085632ee9bd64eabad776f208fa250fe4a84.tar.gz
anaconda-0d67085632ee9bd64eabad776f208fa250fe4a84.tar.xz
anaconda-0d67085632ee9bd64eabad776f208fa250fe4a84.zip
2006-08-24 Jeremy Katz <katzj@redhat.com>
* fsset.py (FileSystemType.mount): Reset file context on mountpoints (#202525) * packages.py (setFileCons): Use new parameter to resetFileContext * isys/isys.py (resetFileContext): Allow passing a rootpath * isys/isys.c (doResetFileContext): Likewise.
Diffstat (limited to 'fsset.py')
-rw-r--r--fsset.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/fsset.py b/fsset.py
index 40e454818..c0e18bb89 100644
--- a/fsset.py
+++ b/fsset.py
@@ -187,11 +187,17 @@ class FileSystemType:
self.maxLabelChars = 16
self.packages = []
- def mount(self, device, mountpoint, readOnly=0, bindMount=0):
+ def mount(self, device, mountpoint, readOnly=0, bindMount=0,
+ instroot=""):
if not self.isMountable():
return
- iutil.mkdirChain(mountpoint)
- isys.mount(device, mountpoint, fstype = self.getName(),
+ iutil.mkdirChain("%s/%s" %(instroot, mountpoint))
+ if flags.selinux:
+ log.info("setting SELinux context for mountpoint %s" %(mountpoint,))
+ isys.resetFileContext(mountpoint, instroot)
+
+ isys.mount(device, "%s/%s" %(instroot, mountpoint),
+ fstype = self.getName(),
readOnly = readOnly, bindMount = bindMount)
def umount(self, device, path):
@@ -775,7 +781,8 @@ class swapFileSystem(FileSystemType):
self.supported = 1
self.maxLabelChars = 15
- def mount(self, device, mountpoint, readOnly=0, bindMount=0):
+ def mount(self, device, mountpoint, readOnly=0, bindMount=0,
+ instroot = None):
pagesize = resource.getpagesize()
buf = None
if pagesize > 2048:
@@ -1020,13 +1027,18 @@ class AutoFileSystem(PsudoFileSystem):
def __init__(self):
PsudoFileSystem.__init__(self, "auto")
- def mount(self, device, mountpoint, readOnly=0, bindMount=0):
+ def mount(self, device, mountpoint, readOnly=0, bindMount=0,
+ instroot = None):
errNum = 0
errMsg = "cannot mount auto filesystem on %s of this type" % device
if not self.isMountable():
return
- iutil.mkdirChain(mountpoint)
+ iutil.mkdirChain("%s/%s" %(instroot, mountpoint))
+ if flags.selinux:
+ log.info("setting SELinux context for mountpoint %s" %(mountpoint,))
+ isys.resetFileContext(mountpoint, instroot)
+
for fs in getFStoTry (device):
try:
isys.mount (device, mountpoint, fstype = fs, readOnly =