capabilities: Some plugins don't actually require capabilities at runtime

This commit is contained in:
Tobias Brunner
2013-07-18 15:25:35 +02:00
parent 027676f750
commit dfc9902013
13 changed files with 17 additions and 14 deletions
+3 -2
View File
@@ -107,13 +107,14 @@ plugin_t *dhcp_plugin_create()
{
private_dhcp_plugin_t *this;
if (!lib->caps->keep(lib->caps, CAP_NET_BIND_SERVICE))
if (!lib->caps->check(lib->caps, CAP_NET_BIND_SERVICE))
{ /* required to bind DHCP socket (port 68) */
DBG1(DBG_NET, "dhcp plugin requires CAP_NET_BIND_SERVICE capability");
return NULL;
}
else if (!lib->caps->keep(lib->caps, CAP_NET_RAW))
{ /* required to open DHCP receive socket (AF_PACKET) */
{ /* required to open DHCP receive socket (AF_PACKET). according to
* capabilities(7) it is also required to use the socket */
DBG1(DBG_NET, "dhcp plugin requires CAP_NET_RAW capability");
return NULL;
}