[PATCH] Do not crash on .autorelabel when using read only rescue mount (#568367)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We cannot touch /.autorelabel when / is mounted read only. So we ought to better catch the exception and just issue a warning to the logs.
---
 rescue.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/rescue.py b/rescue.py
index b48e27d..cad8a73 100644
--- a/rescue.py
+++ b/rescue.py
@@ -386,8 +386,13 @@ def runRescue(anaconda):
                     except Exception, e:
                         log.error("error mounting selinuxfs: %s" %(e,))
 
-                    fd = open("%s/.autorelabel" % anaconda.rootPath, "w+")
-                    fd.close()
+                    # we have to catch the exception
+                    # because we support read-only mounting (#568367)
+                    try:
+                        fd = open("%s/.autorelabel" % anaconda.rootPath, "w+")
+                        fd.close()
+                    except Exception, e:
+                        log.warning("error touching /.autorelabel")
 
                 # set a library path to use mounted fs
                 libdirs = os.environ["LD_LIBRARY_PATH"].split(":")
-- 
1.6.6.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux