diff options
author | David Herrmann <dh.herrmann@gmail.com> | 2013-11-04 12:06:13 +0100 |
---|---|---|
committer | David Herrmann <dh.herrmann@gmail.com> | 2013-11-04 12:06:13 +0100 |
commit | 22c0098be76a59ff95da58a4cf49e387c81081e0 (patch) | |
tree | 79f985ff321f1665b2df7b1756d51553d6612cc0 | |
parent | 2bc07f98daabd3778b79b1c7eaf9f7e9d840d0ce (diff) |
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 <dh.herrmann@gmail.com>
-rw-r--r-- | src/dhcp.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |