diff options
author | Tobias Brunner <tobias@strongswan.org> | 2013-06-24 18:22:31 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-06-25 17:16:32 +0200 |
commit | 41b8546ac0a8c95496d1812f35eefa696cf8212c (patch) | |
tree | 2029603e9d3200599d2f99bc76ad4227c681c882 /src/libhydra/plugins/kernel_pfkey | |
parent | a2eb581781ca291c9053131be7ec99013e9c83ee (diff) | |
download | strongswan-41b8546ac0a8c95496d1812f35eefa696cf8212c.tar.bz2 strongswan-41b8546ac0a8c95496d1812f35eefa696cf8212c.tar.xz |
capabilities: Only plugins that require CAP_NET_ADMIN demand it
The daemon as such does not require this capability.
Diffstat (limited to 'src/libhydra/plugins/kernel_pfkey')
-rw-r--r-- | src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c index 894175402..d2c00b0f2 100644 --- a/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c +++ b/src/libhydra/plugins/kernel_pfkey/kernel_pfkey_plugin.c @@ -62,6 +62,12 @@ plugin_t *kernel_pfkey_plugin_create() { private_kernel_pfkey_plugin_t *this; + if (!lib->caps->keep(lib->caps, CAP_NET_ADMIN)) + { /* required to open PF_KEY sockets */ + DBG1(DBG_KNL, "kernel-pfkey plugin requires CAP_NET_ADMIN capability"); + return NULL; + } + INIT(this, .public = { .plugin = { |