[arch-commits] Commit in flightgear/trunk (PKGBUILD sec-fix.patch)
Sergej Pupykin
spupykin at archlinux.org
Mon Dec 19 15:04:51 UTC 2016
Date: Monday, December 19, 2016 @ 15:04:50
Author: spupykin
Revision: 200313
upgpkg: flightgear 2016.4.3-2
upd
Added:
flightgear/trunk/sec-fix.patch
Modified:
flightgear/trunk/PKGBUILD
---------------+
PKGBUILD | 13 ++++++++++---
sec-fix.patch | 42 ++++++++++++++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2016-12-19 14:44:30 UTC (rev 200312)
+++ PKGBUILD 2016-12-19 15:04:50 UTC (rev 200313)
@@ -6,7 +6,7 @@
pkgname=flightgear
pkgver=2016.4.3
_pkgver=${pkgver%.*}
-pkgrel=1
+pkgrel=2
pkgdesc="An open-source, multi-platform flight simulator"
arch=(i686 x86_64)
depends=('libxmu' 'libxi' 'zlib' 'openscenegraph' 'subversion' 'libxrandr' 'glu' 'openal')
@@ -15,9 +15,16 @@
license=("GPL")
url="http://www.flightgear.org/"
options=('!makeflags')
-source=("http://downloads.sourceforge.net/project/flightgear/release-${_pkgver}/${pkgname}-${pkgver}.tar.bz2")
-sha256sums=('35a9c439265e4a9caf794458bb42917d93280b2e561cc7b9a02aaba1226d2822')
+source=("http://downloads.sourceforge.net/project/flightgear/release-${_pkgver}/${pkgname}-${pkgver}.tar.bz2"
+ sec-fix.patch)
+sha256sums=('35a9c439265e4a9caf794458bb42917d93280b2e561cc7b9a02aaba1226d2822'
+ 'c45d9596ee8269594ee600e3fe1de10422f202c2ce4b3fb733062ce92f37b11b')
+prepare() {
+ cd "$srcdir"/flightgear-$pkgver
+ patch -p1 -i $srcdir/sec-fix.patch
+}
+
build() {
cd "$srcdir"/flightgear-$pkgver
cmake \
Added: sec-fix.patch
===================================================================
--- sec-fix.patch (rev 0)
+++ sec-fix.patch 2016-12-19 15:04:50 UTC (rev 200313)
@@ -0,0 +1,42 @@
+--- a/src/Autopilot/route_mgr.cxx
++++ b/src/Autopilot/route_mgr.cxx
+@@ -44,6 +44,7 @@
+ #include <simgear/timing/sg_time.hxx>
+ #include <simgear/sg_inlines.h>
+
++#include <Main/globals.hxx>
+ #include "Main/fg_props.hxx"
+ #include "Navaids/positioned.hxx"
+ #include <Navaids/waypoint.hxx>
+@@ -54,6 +55,8 @@
+ #include "Airports/runways.hxx"
+ #include <GUI/new_gui.hxx>
+ #include <GUI/dialog.hxx>
++#include <Main/util.hxx> // fgValidatePath()
++#include <GUI/MessageBox.hxx>
+
+ #define RM "/autopilot/route-manager/"
+
+@@ -709,7 +712,21 @@
+ mgr->loadRoute(path);
+ } else if (!strcmp(s, "@SAVE")) {
+ SGPath path(mgr->_pathNode->getStringValue());
+- mgr->saveRoute(path);
++ SGPath authorizedPath = fgValidatePath(path, true /* write */);
++
++ if (!authorizedPath.isNull()) {
++ mgr->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);
++ }
+ } else if (!strcmp(s, "@NEXT")) {
+ mgr->jumpToIndex(mgr->currentIndex() + 1);
+ } else if (!strcmp(s, "@PREVIOUS")) {
More information about the arch-commits
mailing list