From b5835c38b4fb86262a1ebb24da34d7531c204c6d Mon Sep 17 00:00:00 2001
From: "Rebecca N. Palmer" <rebecca_palmer@zoho.com>
Date: Fri, 13 Mar 2015 18:14:51 +0000
Subject: [PATCH] Disable system.fgfsrc

Together with the preceding few commits, this is intended
to make security independent of the data package
---
 src/Main/options.cxx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/Main/options.cxx b/src/Main/options.cxx
index 9d24361cf..5a2e4b46b 100644
--- a/src/Main/options.cxx
+++ b/src/Main/options.cxx
@@ -1940,18 +1940,27 @@ void Options::init(int argc, char **argv, const SGPath& appDataPath)
 // setup FG_ROOT
   setupRoot(argc, argv);
   
-// system.fgfsrc handling
+// system.fgfsrc is disabled, as we no longer allow anything in fgdata to set
+// fg-root/fg-home/fg-aircraft and hence control what files Nasal can access
   if( ! hostname.empty() ) {
     config.set(globals->get_fg_root());
     config.append( "system.fgfsrc" );
     config.concat( "." );
     config.concat( hostname );
-    readConfig(config);
+    if (config.exists()) {
+      flightgear::fatalMessageBox("Unsupported configuration",
+        "You have a system.fgfsrc." + hostname +" file, which is no longer processed for security reasons",
+        "If you created this file intentionally, please move it to ~/.fgfsrc" );
+    }
   }
 
   config.set(globals->get_fg_root());
   config.append( "system.fgfsrc" );
-  readConfig(config);
+  if (config.exists()) {
+    flightgear::fatalMessageBox("Unsupported configuration",
+      "You have a system.fgfsrc file, which is no longer processed for security reasons",
+      "If you created this file intentionally, please move it to ~/.fgfsrc" );
+  }
 }
 
 void Options::initPaths()