aboutsummaryrefslogtreecommitdiff
path: root/games/flightgear/files
diff options
context:
space:
mode:
authorGanael LAPLANCHE <martymac@FreeBSD.org>2017-09-29 16:06:29 +0000
committerGanael LAPLANCHE <martymac@FreeBSD.org>2017-09-29 16:06:29 +0000
commit250805c2593c74af1ff07434aeba31d0afcaba47 (patch)
tree662202327b69a97dc79fd99e005243c5db2034e6 /games/flightgear/files
parent488300b39c1d8037a697d87de37890af0a6ec92c (diff)
downloadports-250805c2593c74af1ff07434aeba31d0afcaba47.tar.gz
ports-250805c2593c74af1ff07434aeba31d0afcaba47.zip
Notes
Diffstat (limited to 'games/flightgear/files')
-rw-r--r--games/flightgear/files/patch-CVE-2017-13709.txt129
-rw-r--r--games/flightgear/files/patch-CVE-2017-8921.txt28
-rw-r--r--games/flightgear/files/patch-INPUT-CMakeLists.txt11
-rw-r--r--games/flightgear/files/patch-src-Main-CMakeLists.txt13
-rw-r--r--games/flightgear/files/patch-utils-fgpanel-CMakeLists.txt11
5 files changed, 0 insertions, 192 deletions
diff --git a/games/flightgear/files/patch-CVE-2017-13709.txt b/games/flightgear/files/patch-CVE-2017-13709.txt
deleted file mode 100644
index 48edddc00d34..000000000000
--- a/games/flightgear/files/patch-CVE-2017-13709.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-Backport of commits 0ba2ac31 and 1ad2bf44
-
-Fixes CVE-2017-13709.
-
---- src/Main/fg_init.cxx.orig
-+++ src/Main/fg_init.cxx
-@@ -1090,7 +1090,12 @@ void fgStartNewReset()
- fgInitGeneral(); // all of this?
-
- 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();
-+
- // PRESERVED properties over-write state from options, intentionally
- if ( copyProperties(preserved, globals->get_props()) ) {
- SG_LOG( SG_GENERAL, SG_INFO, "Preserved state restored successfully" );
---- src/Main/main.cxx.orig
-+++ src/Main/main.cxx
-@@ -536,7 +536,12 @@ int fgMainInit( int argc, char **argv )
- } else if (configResult == flightgear::FG_OPTIONS_EXIT) {
- 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();
-+
- // Initialize the Window/Graphics environment.
- fgOSInit(&argc, argv);
- _bootstrap_OSInit++;
---- src/Scripting/NasalSys.cxx.orig
-+++ src/Scripting/NasalSys.cxx
-@@ -909,10 +909,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);
---- src/Main/logger.cxx.orig
-+++ src/Main/logger.cxx
-@@ -9,12 +9,17 @@
-
- #include "logger.hxx"
-
--#include <fstream>
-+#include <ios>
- #include <string>
-+#include <cstdlib>
-
- #include <simgear/debug/logstream.hxx>
-+#include <simgear/io/iostreams/sgstream.hxx>
-+#include <simgear/misc/sg_path.hxx>
-
- #include "fg_props.hxx"
-+#include "globals.hxx"
-+#include "util.hxx"
-
- using std::string;
- using std::endl;
-@@ -59,6 +64,25 @@ FGLogger::init ()
- child->setStringValue("filename", filename.c_str());
- }
-
-+ // Security: the path comes from the global Property Tree; it *must* be
-+ // validated before we overwrite the file.
-+ const SGPath authorizedPath = fgValidatePath(SGPath::fromUtf8(filename),
-+ /* write */ true);
-+
-+ if (authorizedPath.isNull()) {
-+ const string propertyPath = child->getChild("filename")
-+ ->getPath(/* simplify */ true);
-+ const string msg =
-+ "The FGLogger logging system, via the '" + propertyPath + "' property, "
-+ "was asked to write to '" + filename + "', however this path is not "
-+ "authorized for writing anymore for security reasons. " +
-+ "Please choose another location, for instance in the $FG_HOME/Export "
-+ "folder (" + (globals->get_fg_home() / "Export").utf8Str() + ").";
-+
-+ SG_LOG(SG_GENERAL, SG_ALERT, msg);
-+ exit(EXIT_FAILURE);
-+ }
-+
- string delimiter = child->getStringValue("delimiter");
- if (delimiter.empty()) {
- delimiter = ",";
-@@ -68,7 +92,8 @@ FGLogger::init ()
- log.interval_ms = child->getLongValue("interval-ms");
- log.last_time_ms = globals->get_sim_time_sec() * 1000;
- log.delimiter = delimiter.c_str()[0];
-- log.output = new std::ofstream(filename.c_str());
-+ // Security: use the return value of fgValidatePath()
-+ log.output = new sg_ofstream(authorizedPath, std::ios_base::out);
- if (!log.output) {
- SG_LOG(SG_GENERAL, SG_ALERT, "Cannot write log to " << filename);
- continue;
---- src/Main/logger.hxx.orig
-+++ src/Main/logger.hxx
-@@ -6,10 +6,10 @@
- #ifndef __LOGGER_HXX
- #define __LOGGER_HXX 1
-
--#include <iosfwd>
- #include <vector>
-
- #include <simgear/compiler.h>
-+#include <simgear/io/iostreams/sgstream.hxx>
- #include <simgear/structure/subsystem_mgr.hxx>
- #include <simgear/props/props.hxx>
-
-@@ -39,7 +39,7 @@ private:
- Log ();
- virtual ~Log ();
- std::vector<SGPropertyNode_ptr> nodes;
-- std::ostream * output;
-+ sg_ofstream * output;
- long interval_ms;
- double last_time_ms;
- char delimiter;
diff --git a/games/flightgear/files/patch-CVE-2017-8921.txt b/games/flightgear/files/patch-CVE-2017-8921.txt
deleted file mode 100644
index f348bf580084..000000000000
--- a/games/flightgear/files/patch-CVE-2017-8921.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Fix for CVE-2017-8921 (backport of commit faf872e7)
-
---- src/Autopilot/route_mgr.cxx.orig
-+++ src/Autopilot/route_mgr.cxx
-@@ -74,7 +74,22 @@ static bool commandSaveFlightPlan(const SGPropertyNode* arg)
- {
- FGRouteMgr* self = (FGRouteMgr*) globals->get_subsystem("route-manager");
- SGPath path = SGPath::fromUtf8(arg->getStringValue("path"));
-- return self->saveRoute(path);
-+ SGPath authorizedPath = fgValidatePath(path, true /* write */);
-+
-+ if (!authorizedPath.isNull()) {
-+ return self->saveRoute(authorizedPath);
-+ } else {
-+ std::string msg =
-+ "The route manager was asked to write the flightplan to '" +
-+ path.utf8Str() + "', but this path is not authorized for writing. " +
-+ "Please choose another location, for instance in the $FG_HOME/Export "
-+ "folder (" + (globals->get_fg_home() / "Export").utf8Str() + ").";
-+
-+ SG_LOG(SG_AUTOPILOT, SG_ALERT, msg);
-+ modalMessageBox("FlightGear", "Unable to write to the specified file",
-+ msg);
-+ return false;
-+ }
- }
-
- static bool commandActivateFlightPlan(const SGPropertyNode* arg)
diff --git a/games/flightgear/files/patch-INPUT-CMakeLists.txt b/games/flightgear/files/patch-INPUT-CMakeLists.txt
deleted file mode 100644
index 88bdafa73f3c..000000000000
--- a/games/flightgear/files/patch-INPUT-CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
---- CMakeLists.txt.orig 2017-06-30 11:44:05.757902000 +0200
-+++ CMakeLists.txt 2017-06-30 11:49:07.188128000 +0200
-@@ -226,7 +226,7 @@
- if(EVENT_INPUT)
- if(APPLE)
- add_definitions(-DWITH_EVENTINPUT)
-- elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
-+ elseif(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD")
- if(NOT UDEV_FOUND)
- message(WARNING "UDev not found, event input is disabled!")
- set(EVENT_INPUT 0)
diff --git a/games/flightgear/files/patch-src-Main-CMakeLists.txt b/games/flightgear/files/patch-src-Main-CMakeLists.txt
deleted file mode 100644
index 8f3478a644a9..000000000000
--- a/games/flightgear/files/patch-src-Main-CMakeLists.txt
+++ /dev/null
@@ -1,13 +0,0 @@
---- src/Main/CMakeLists.txt.orig 2017-02-22 17:29:45.000000000 +0000
-+++ src/Main/CMakeLists.txt 2017-02-28 12:42:12.797102000 +0000
-@@ -157,6 +157,10 @@
- target_link_libraries(fgfs Qt5::Widgets fglauncher)
- endif()
-
-+if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-+ target_link_libraries(fgfs execinfo)
-+endif()
-+
- if (APPLE)
- install(TARGETS fgfs BUNDLE DESTINATION .)
- else()
diff --git a/games/flightgear/files/patch-utils-fgpanel-CMakeLists.txt b/games/flightgear/files/patch-utils-fgpanel-CMakeLists.txt
deleted file mode 100644
index 683029191bcc..000000000000
--- a/games/flightgear/files/patch-utils-fgpanel-CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
---- utils/fgpanel/CMakeLists.txt.orig 2017-03-03 06:18:49.698586000 +0000
-+++ utils/fgpanel/CMakeLists.txt 2017-03-03 06:24:25.570507000 +0000
-@@ -19,7 +19,7 @@
- )
-
- include_directories(
-- /usr/include/freetype2
-+ ${FREETYPE_INCLUDE_DIRS}
- ${PNG_INCLUDE_DIR}
- )
-