SHA256
1
0
forked from pool/strongswan

Accepting request 19857 from network

Copy from network/strongswan based on submit request 19857 from user mtomaschewski

OBS-URL: https://build.opensuse.org/request/show/19857
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/strongswan?expand=0&rev=16
This commit is contained in:
OBS User autobuild 2009-09-04 00:27:18 +00:00 committed by Git OBS Bridge
parent 3ce3e4b5e0
commit cf3fca2b32
3 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From: Marius Tomaschewski <mt@suse.de>
Date: Wed, 2 Sep 2009 13:49:39 +0200
Subject: [PATCH] Fixed load_secrets to acquire/release lock in level 0 only
The write_lock call fails with EDEADLK and unlocks in the
next recursion level.
diff --git a/src/charon/plugins/stroke/stroke_cred.c b/src/charon/plugins/stroke/stroke_cred.c
index 31bcfe9f486f4dac0ae30bc5846ed3d818526dbb..68df7f0b6d709c396d7a572ca4d0198ef12b2446 100644
--- a/src/charon/plugins/stroke/stroke_cred.c
+++ b/src/charon/plugins/stroke/stroke_cred.c
@@ -722,9 +722,10 @@ static void load_secrets(private_stroke_cred_t *this, char *file, int level)
fclose(fd);
src = chunk;
- this->lock->write_lock(this->lock);
if (level == 0)
{
+ this->lock->write_lock(this->lock);
+
/* flush secrets on non-recursive invocation */
while (this->shared->remove_last(this->shared,
(void**)&shared) == SUCCESS)
@@ -1019,7 +1020,10 @@ static void load_secrets(private_stroke_cred_t *this, char *file, int level)
}
}
error:
- this->lock->unlock(this->lock);
+ if (level == 0)
+ {
+ this->lock->unlock(this->lock);
+ }
chunk_clear(&chunk);
}
--
1.6.0.2

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Sep 3 23:44:37 CEST 2009 - mt@suse.de
- Applied patch fixing locking in ipsec.secrets inclusion.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Aug 31 16:06:13 CEST 2009 - mt@suse.de Mon Aug 31 16:06:13 CEST 2009 - mt@suse.de

View File

@ -22,7 +22,7 @@ Name: strongswan
%define upstream_version 4.3.4 %define upstream_version 4.3.4
%define strongswan_docdir %{_docdir}/%{name} %define strongswan_docdir %{_docdir}/%{name}
Version: 4.3.4 Version: 4.3.4
Release: 1 Release: 2
License: GPL v2 or later License: GPL v2 or later
Group: Productivity/Networking/Security Group: Productivity/Networking/Security
Summary: StrongSwan -- OpenSource IPsec-based VPN Solution Summary: StrongSwan -- OpenSource IPsec-based VPN Solution
@ -38,6 +38,7 @@ Source1: http://download.strongswan.org/strongswan-%{upstream_version}.ta
Source2: %{name}.init.in Source2: %{name}.init.in
Source3: %{name}-%{version}-rpmlintrc Source3: %{name}-%{version}-rpmlintrc
Patch1: %{name}_modprobe_syslog.patch Patch1: %{name}_modprobe_syslog.patch
Patch2: %{name}-4.3.4-load_secrets-lock-fix.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: bison flex gmp-devel gperf pkg-config BuildRequires: bison flex gmp-devel gperf pkg-config
BuildRequires: libcap-devel BuildRequires: libcap-devel
@ -129,6 +130,7 @@ Authors:
%prep %prep
%setup -q -n %{name}-%{upstream_version} %setup -q -n %{name}-%{upstream_version}
%patch1 -p0 %patch1 -p0
%patch2 -p1
sed -e 's|@libexecdir@|%_libexecdir|g' \ sed -e 's|@libexecdir@|%_libexecdir|g' \
< $RPM_SOURCE_DIR/strongswan.init.in \ < $RPM_SOURCE_DIR/strongswan.init.in \
> strongswan.init > strongswan.init