From: Arran Cudbard-Bell Date: Fri, 5 Jun 2020 23:22:06 +0000 (-0500) Subject: Be more verbose X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e5fce60807c51c0d70ddd563b8d0df00a5596bd;p=thirdparty%2Ffreeradius-server.git Be more verbose --- diff --git a/src/lib/util/socket.c b/src/lib/util/socket.c index a30d4d942a0..681d11be480 100644 --- a/src/lib/util/socket.c +++ b/src/lib/util/socket.c @@ -886,7 +886,14 @@ int fr_socket_bind(int sockfd, fr_ipaddr_t const *src_ipaddr, uint16_t *src_port * check capabilities. If we're root, we already have * equivalent capabilities so we don't need to check. */ - if (src_port && (*src_port < 1024) && (fr_cap_set(CAP_NET_BIND_SERVICE) < 0) && (geteuid() != 0)) return -1; + { + uid_t uid = geteuid(); + + if (src_port && (*src_port < 1024) && (fr_cap_set(CAP_NET_BIND_SERVICE) < 0) && (uid != 0)) { + fr_strerror_printf_push("Alternatively execute the proces as user 0 (root), currently %u", uid); + return -1; + } + } #endif /*