Lines 737-743
METHOD(plugin_t, destroy, void,
Link Here
|
737 |
*/ |
737 |
*/ |
738 |
plugin_t *smp_plugin_create() |
738 |
plugin_t *smp_plugin_create() |
739 |
{ |
739 |
{ |
740 |
struct sockaddr_un unix_addr = { AF_UNIX, IPSEC_PIDDIR "/charon.xml"}; |
740 |
struct sockaddr_un unix_addr; |
741 |
private_smp_t *this; |
741 |
private_smp_t *this; |
742 |
mode_t old; |
742 |
mode_t old; |
743 |
|
743 |
|
Lines 766-771
plugin_t *smp_plugin_create()
Link Here
|
766 |
return NULL; |
766 |
return NULL; |
767 |
} |
767 |
} |
768 |
|
768 |
|
|
|
769 |
strlcpy(unix_addr.sun_path, IPSEC_PIDDIR "/charon.xml", |
770 |
sizeof(unix_addr.sun_path)); |
771 |
unix_addr.sun_len = sizeof(unix_addr); |
772 |
unix_addr.sun_family = PF_LOCAL; |
773 |
|
769 |
unlink(unix_addr.sun_path); |
774 |
unlink(unix_addr.sun_path); |
770 |
old = umask(S_IRWXO); |
775 |
old = umask(S_IRWXO); |
771 |
if (bind(this->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0) |
776 |
if (bind(this->socket, (struct sockaddr *)&unix_addr, sizeof(unix_addr)) < 0) |