From 22c0098be76a59ff95da58a4cf49e387c81081e0 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Mon, 4 Nov 2013 12:06:13 +0100 Subject: owfd: dhcp: print warning if not running as euid=0 DHCP and interface-setup requires CAP_NET_ADMIN. As we don't want to deal with libcap and capability-setup, we simply let the caller take care of it. To avoid mis-use, we print a warning for euid!=0, in case users run it from the command-line (debugging, etc). Signed-off-by: David Herrmann --- src/dhcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dhcp.c b/src/dhcp.c index f564569..7eb93e6 100644 --- a/src/dhcp.c +++ b/src/dhcp.c @@ -118,6 +118,9 @@ static int owfd_dhcp_setup(struct owfd_dhcp *dhcp) sigset_t mask; struct sigaction sig; + if (geteuid()) + log_warning("not running as uid=0, dhcp might not work"); + dhcp->ifindex = if_name_to_index(dhcp->config.interface); if (dhcp->ifindex < 0) { r = -EINVAL; -- cgit v1.2.3