summaryrefslogtreecommitdiffstats
path: root/upgrade.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2007-10-10 17:26:06 +0000
committerJeremy Katz <katzj@redhat.com>2007-10-10 17:26:06 +0000
commit6b6b0fb456ca93b95e162ea7abeb752c219aa595 (patch)
tree68bc6ea5f408760dec9503d8eaea7ef874b49aa0 /upgrade.py
parent3a7c12cad9bd80b06cdf341e1a9d2c590a4a68cb (diff)
downloadanaconda-6b6b0fb456ca93b95e162ea7abeb752c219aa595.tar.gz
anaconda-6b6b0fb456ca93b95e162ea7abeb752c219aa595.tar.xz
anaconda-6b6b0fb456ca93b95e162ea7abeb752c219aa595.zip
2007-10-10 Jeremy Katz <katzj@redhat.com>
* upgrade.py (upgradeMountFilesystems): Check to see if we should disable selinux based on whether the system has been booting with selinux disabled (#242510)
Diffstat (limited to 'upgrade.py')
-rw-r--r--upgrade.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/upgrade.py b/upgrade.py
index 81ccb39e2..5a608441d 100644
--- a/upgrade.py
+++ b/upgrade.py
@@ -21,6 +21,7 @@ import sys
import os.path
import partedUtils
import string
+import selinux
import lvm
from flags import flags
from fsset import *
@@ -359,6 +360,16 @@ def upgradeMountFilesystems(anaconda):
anaconda.id.fsset.turnOnSwap(anaconda.rootPath, upgrading=True)
anaconda.id.fsset.mkDevRoot(anaconda.rootPath)
+ # if they've been booting with selinux disabled, then we should
+ # disable it during the install as well (#242510)
+ try:
+ if os.path.exists(anaconda.rootPath + "/.autorelabel"):
+ ctx = selinux.getfilecon(anaconda.rootPath + "/.autorelabel")[1]
+ if not ctx or ctx == "unlabeled":
+ flags.selinux = False
+ except Exception, e:
+ log.warning("error checking selinux state: %s" %(e,))
+
def setSteps(anaconda):
dispatch = anaconda.dispatch
dispatch.setStepList(