Line 0
Link Here
|
|
|
1 |
--- src/libcharon/plugins/smp/smp.c.orig 2013-11-01 10:40:35 UTC |
2 |
+++ src/libcharon/plugins/smp/smp.c |
3 |
@@ -737,7 +737,7 @@ METHOD(plugin_t, destroy, void, |
4 |
*/ |
5 |
plugin_t *smp_plugin_create() |
6 |
{ |
7 |
- struct sockaddr_un unix_addr = { AF_UNIX, IPSEC_PIDDIR "/charon.xml"}; |
8 |
+ struct sockaddr_un unix_addr; |
9 |
private_smp_t *this; |
10 |
mode_t old; |
11 |
|
12 |
@@ -766,6 +766,11 @@ plugin_t *smp_plugin_create() |
13 |
return NULL; |
14 |
} |
15 |
|
16 |
+ strlcpy(unix_addr.sun_path, IPSEC_PIDDIR "/charon.xml", |
17 |
+ sizeof(unix_addr.sun_path)); |
18 |
+ unix_addr.sun_len = sizeof(unix_addr); |
19 |
+ unix_addr.sun_family = PF_LOCAL; |
20 |
+ |
21 |
unlink(unix_addr.sun_path); |
22 |
old = umask(S_IRWXO); |
23 |
if (bind(this->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0) |