]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/globals.cxx
Document that property write-protection is not a security measure
[flightgear.git] / src / Main / globals.cxx
index af88f381e34bb22096f7f6520d764d3295219d1e..d41e00d5f2bff7e3bec088e73ca2cb2df72124d8 100644 (file)
@@ -273,7 +273,8 @@ void FGGlobals::set_fg_root (const std::string &root) {
                 << fg_root << "'\n***\n***");
     }
 
-    // remove /sim/fg-root before writing to prevent hijacking
+    // deliberately not a tied property, for fgValidatePath security
+    // write-protect to avoid accidents
     SGPropertyNode *n = fgGetNode("/sim", true);
     n->removeChild("fg-root", 0);
     n = n->getChild("fg-root", 0, true);
@@ -423,17 +424,20 @@ void FGGlobals::append_aircraft_path(const std::string& path)
     SG_LOG(SG_GENERAL, SG_ALERT, "aircraft path not found:" << path);
     return;
   }
-    
+
   SGPath acSubdir(dirPath);
   acSubdir.append("Aircraft");
   if (acSubdir.exists()) {
-      SG_LOG(SG_GENERAL, SG_WARN, "Specified an aircraft-dir with an 'Aircraft' subdirectory:" << dirPath
-                 << ", will instead use child directory:" << acSubdir);
+      SG_LOG(
+        SG_GENERAL,
+        SG_WARN,
+        "Specified an aircraft-dir with an 'Aircraft' subdirectory:" << dirPath
+        << ", will instead use child directory:" << acSubdir
+      );
       dirPath = acSubdir;
   }
-    
+
   std::string abspath = dirPath.realpath();
-  unsigned int index = fg_aircraft_dirs.size();  
   fg_aircraft_dirs.push_back(abspath);
 }