Simplify Nasal security code
This commit is contained in:
parent
0a256038d3
commit
0ec47c9802
3 changed files with 9 additions and 7 deletions
|
@ -472,6 +472,7 @@ void FGGlobals::append_aircraft_path(const SGPath& path)
|
|||
}
|
||||
|
||||
fg_aircraft_dirs.push_back(dirPath.realpath());
|
||||
extra_read_allowed_paths.push_back(dirPath.realpath());
|
||||
}
|
||||
|
||||
void FGGlobals::append_aircraft_paths(const PathList& paths)
|
||||
|
|
|
@ -258,7 +258,13 @@ public:
|
|||
void set_catalog_aircraft_path(const SGPath& path);
|
||||
|
||||
PathList get_aircraft_paths() const;
|
||||
|
||||
/**
|
||||
* Add an aircraft directory
|
||||
*
|
||||
* This also makes the path Nasal-readable:
|
||||
* to avoid can-read-any-file security holes, do NOT call this on paths
|
||||
* obtained from the property tree or other Nasal-writable places
|
||||
*/
|
||||
void append_aircraft_path(const SGPath& path);
|
||||
void append_aircraft_paths(const PathList& path);
|
||||
|
||||
|
|
|
@ -93,12 +93,7 @@ void fgInitAllowedPaths()
|
|||
read_allowed_paths.clear();
|
||||
write_allowed_paths.clear();
|
||||
|
||||
const PathList& aircraft_paths = globals->get_aircraft_paths();
|
||||
const PathList& other_read_paths = globals->get_extra_read_allowed_paths();
|
||||
// not plain fg_scenery, to avoid making
|
||||
// /sim/terrasync/scenery-dir a security hole
|
||||
PathList read_paths = aircraft_paths;
|
||||
read_paths.insert(read_paths.end(), other_read_paths.begin(), other_read_paths.end());
|
||||
PathList read_paths = globals->get_extra_read_allowed_paths();
|
||||
read_paths.push_back(globals->get_fg_root());
|
||||
read_paths.push_back(globals->get_fg_home());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue