]> git.mxchange.org Git - flightgear.git/commitdiff
Nasal security: allow reading explicit --terrasync-dir
authorRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 21 Feb 2016 20:25:02 +0000 (20:25 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 21 Feb 2016 20:25:02 +0000 (20:25 +0000)
(but not /sim/terrasync/scenery-dir - https://bugs.debian.org/780716 )
Needed for animated jetways:
https://sourceforge.net/p/flightgear/mailman/message/34870606/

src/Main/options.cxx

index 3c412ca6806abd738f0e970d3ef3e74ceee35da6..3c4b36f36f6a0e90323f1715dcb40f8dd7a491d1 100644 (file)
@@ -855,6 +855,14 @@ fgOptFgScenery( const char *arg )
     return FG_OPTIONS_OK;
 }
 
+static int
+fgOptTerrasyncDir( const char *arg )
+{
+    globals->append_fg_scenery(arg, true);
+    fgSetString("/sim/terrasync/scenery-dir", arg);
+    return FG_OPTIONS_OK;
+}
+
 static int
 fgOptFov( const char *arg )
 {
@@ -1620,7 +1628,7 @@ struct OptionDesc {
     {"materials-file",               true,  OPTION_STRING, "/sim/rendering/materials-file", false, "", 0 },
     {"disable-terrasync",            false, OPTION_BOOL,   "/sim/terrasync/enabled", false, "", 0 },
     {"enable-terrasync",             false, OPTION_BOOL,   "/sim/terrasync/enabled", true, "", 0 },
-    {"terrasync-dir",                true,  OPTION_STRING, "/sim/terrasync/scenery-dir", false, "", 0 },
+    {"terrasync-dir",                true,  OPTION_FUNC,   "", false, "", fgOptTerrasyncDir },
     {"download-dir",                 true,  OPTION_STRING, "/sim/paths/download-dir", false, "", 0 },
     {"geometry",                     true,  OPTION_FUNC,   "", false, "", fgOptGeometry },
     {"bpp",                          true,  OPTION_FUNC,   "", false, "", fgOptBpp },