From 0bd5d2a61eb77f4fe20da14757c0863f4718d9111c41cdac32892566d4315e03 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 22 May 2008 02:41:53 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/strongswan?expand=0&rev=4 --- strongswan.changes | 6 ++++++ strongswan.spec | 7 ++++++- strongswan_crash_badcfg_reload.dif | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 strongswan_crash_badcfg_reload.dif diff --git a/strongswan.changes b/strongswan.changes index c137913..aa65fac 100644 --- a/strongswan.changes +++ b/strongswan.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon May 19 16:17:16 CEST 2008 - mt@suse.de + +- Applied fix (strongswan_crash_badcfg_reload.dif) to avoid + a crash after reloading with bad config (bnc#392062). + ------------------------------------------------------------------- Wed Apr 23 14:28:41 CEST 2008 - mt@suse.de diff --git a/strongswan.spec b/strongswan.spec index 7e8662b..5d24569 100644 --- a/strongswan.spec +++ b/strongswan.spec @@ -15,7 +15,7 @@ Name: strongswan %define upstream_version 4.2.1 %define strongswan_docdir %{_docdir}/%{name} Version: 4.2.1 -Release: 1 +Release: 8 License: GPL v2 or later Group: Productivity/Networking/Security Summary: StrongSwan -- OpenSource IPsec-based VPN Solution @@ -32,6 +32,7 @@ Source2: %{name}.init.in Source3: %{name}-%{version}-rpmlintrc Patch1: %{name}_modprobe_syslog.dif Patch2: %{name}-%{upstream_version}.dif +Patch3: %{name}_crash_badcfg_reload.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison flex gmp-devel gperf pkg-config %if 0%{?suse_version} >= 1030 @@ -128,6 +129,7 @@ Authors: %setup -q -n %{name}-%{upstream_version} %patch1 -p0 %patch2 -p0 +%patch3 -p0 sed -e 's|@libexecdir@|%_libexecdir|g' \ < $RPM_SOURCE_DIR/strongswan.init.in \ > strongswan.init @@ -258,6 +260,9 @@ fi %{_mandir}/man8/starter.8* %changelog +* Mon May 19 2008 mt@suse.de +- Applied fix (strongswan_crash_badcfg_reload.dif) to avoid + a crash after reloading with bad config (bnc#392062). * Wed Apr 23 2008 mt@suse.de - Updated to 4.2.1 release. A lot of code refactoring in the 4.2 release provides much more modularity and therefore much more diff --git a/strongswan_crash_badcfg_reload.dif b/strongswan_crash_badcfg_reload.dif new file mode 100644 index 0000000..4480567 --- /dev/null +++ b/strongswan_crash_badcfg_reload.dif @@ -0,0 +1,21 @@ +--- src/starter/starter.c ++++ src/starter/starter.c 2008/05/20 08:42:39 +@@ -390,7 +390,7 @@ + ); + new_cfg = confread_load(CONFIG_FILE); + +- if (new_cfg->err + new_cfg->non_fatal_err == 0) ++ if (new_cfg && new_cfg->err + new_cfg->non_fatal_err == 0) + { + /* Switch to new config. New conn will be loaded below */ + if (!starter_cmp_defaultroute(&new_cfg->defaultroute +@@ -484,7 +484,8 @@ + else + { + plog("can't reload config file due to errors -- keeping old one"); +- confread_free(new_cfg); ++ if(new_cfg) ++ confread_free(new_cfg); + } + _action_ &= ~FLAG_ACTION_UPDATE; + last_reload = time(NULL);