X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fglobals.cxx;h=d41e00d5f2bff7e3bec088e73ca2cb2df72124d8;hb=16784d590a315e876a7b18076569620640ffbdf6;hp=af88f381e34bb22096f7f6520d764d3295219d1e;hpb=32f57d0dc168d2b11e19b39d369a9d6a877d0fec;p=flightgear.git diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index af88f381e..d41e00d5f 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -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); }