1
0
Fork 0

Nasal security: allow reading more directories

--aircraft-dir, and --download-dir / Aircraft,AI,Liveries (see
https://sourceforge.net/p/flightgear/mailman/message/35417419/
for why not all --download-dir)
This commit is contained in:
Rebecca N. Palmer 2016-10-30 21:06:08 +00:00
parent 194a6f8974
commit 06b6c4f513

View file

@ -868,7 +868,10 @@ static int
fgOptDownloadDir( const char *arg ) fgOptDownloadDir( const char *arg )
{ {
SGPath p = SGPath::fromLocal8Bit(arg); SGPath p = SGPath::fromLocal8Bit(arg);
//globals->append_read_allowed_paths(p); globals->append_read_allowed_paths(p / "Aircraft");
globals->append_read_allowed_paths(p / "AI");
globals->append_read_allowed_paths(p / "Liveries");
// p / TerraSync is allowed later if in use
fgSetString("/sim/paths/download-dir", p.utf8Str()); fgSetString("/sim/paths/download-dir", p.utf8Str());
return FG_OPTIONS_OK; return FG_OPTIONS_OK;
} }
@ -2089,6 +2092,7 @@ void Options::initAircraft()
if (isOptionSet("aircraft-dir")) { if (isOptionSet("aircraft-dir")) {
SGPath aircraftDirPath = SGPath::fromLocal8Bit(valueForOption("aircraft-dir").c_str()); SGPath aircraftDirPath = SGPath::fromLocal8Bit(valueForOption("aircraft-dir").c_str());
globals->append_read_allowed_paths(aircraftDirPath);
// Set this now, so it's available in FindAndCacheAircraft. Use realpath() // Set this now, so it's available in FindAndCacheAircraft. Use realpath()
// as in FGGlobals::append_aircraft_path(), otherwise fgValidatePath() // as in FGGlobals::append_aircraft_path(), otherwise fgValidatePath()