Call fgInitAllowedPaths() earlier: after Options::processOptions()
Call fgInitAllowedPaths() right after Options::processOptions() (which, among other things, determines $FG_ROOT and processes --allow-nasal-read). This way, fgInitAllowedPaths() can be used in much more code, such as when initializing subsystems.
This commit is contained in:
parent
41045f3bf3
commit
c7a2aef599
3 changed files with 10 additions and 4 deletions
|
@ -1145,6 +1145,11 @@ void fgStartNewReset()
|
|||
|
||||
flightgear::Options::sharedInstance()->processOptions();
|
||||
|
||||
// Rebuild the lists of allowed paths for cases where a path comes from an
|
||||
// untrusted source, such as the global property tree (this uses $FG_HOME
|
||||
// and other paths set by Options::processOptions()).
|
||||
fgInitAllowedPaths();
|
||||
|
||||
const auto& resMgr = simgear::EmbeddedResourceManager::instance();
|
||||
// The language was (re)set in processOptions()
|
||||
const string locale = globals->get_locale()->getPreferredLanguage();
|
||||
|
|
|
@ -541,6 +541,11 @@ int fgMainInit( int argc, char **argv )
|
|||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Set the lists of allowed paths for cases where a path comes from an
|
||||
// untrusted source, such as the global property tree (this uses $FG_HOME
|
||||
// and other paths set by Options::processOptions()).
|
||||
fgInitAllowedPaths();
|
||||
|
||||
const auto& resMgr = simgear::EmbeddedResourceManager::createInstance();
|
||||
initFlightGearEmbeddedResources();
|
||||
// The language was set in processOptions()
|
||||
|
|
|
@ -911,10 +911,6 @@ void FGNasalSys::init()
|
|||
.member("simulatedTime", &TimerObj::isSimTime, &f_timerObj_setSimTime)
|
||||
.member("isRunning", &TimerObj::isRunning);
|
||||
|
||||
|
||||
// Set allowed paths for Nasal I/O
|
||||
fgInitAllowedPaths();
|
||||
|
||||
// Now load the various source files in the Nasal directory
|
||||
simgear::Dir nasalDir(SGPath(globals->get_fg_root(), "Nasal"));
|
||||
loadScriptDirectory(nasalDir);
|
||||
|
|
Loading…
Add table
Reference in a new issue