]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
more travis fixes
authorAlan T. DeKok <aland@freeradius.org>
Fri, 2 Nov 2018 14:58:34 +0000 (10:58 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 2 Nov 2018 14:58:34 +0000 (10:58 -0400)
src/lib/util/socket.c

index c335810a8c6adf3d1a53d05d0297ce42ec4a04ab..18664b838bcb9d2b3f9dd63d1c24b4c2534912f5 100644 (file)
@@ -874,16 +874,15 @@ int fr_socket_bind(int sockfd, fr_ipaddr_t const *src_ipaddr, uint16_t *src_port
        if (src_port) my_port = *src_port;
 
 #ifdef HAVE_CAPABILITY_H
-       if (src_port && (*src_port < 1024)) {   /* Super special service ports */
+       /*
+        *      If we're binding to a special port as non-root, then
+        *      check capabilities.  If we're root, we already have
+        *      equivalent capabilities so we don't need to check.
+        */
+       if (src_port && (*src_port < 1024) && (geteuid() != 0)) {
                cap_t                   caps;
                cap_flag_value_t        state;
 
-               /*
-                *      If we're root, we already have equivalent
-                *      capabilities so we don't need to check.
-                */
-               if (geteuid() == 0) goto skip_cap;
-
                caps = cap_get_proc();
                if (!caps) {
                        fr_strerror_printf_push("Failed getting process capabilities: %s", fr_syserror(errno));