]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ldpd: add missing privilege dropping on error path
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 19 Dec 2016 16:07:28 +0000 (14:07 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Wed, 4 Jan 2017 00:03:28 +0000 (22:03 -0200)
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ldpd/socket.c

index 1bb08374019a93873b13a1d9a6a32a34682a5294..eaea9973a015d237b40b6c84b80f96fe15a2e9e9 100644 (file)
@@ -85,6 +85,8 @@ ldp_create_socket(int af, enum socket_type type)
        if (ldpd_privs.change(ZPRIVS_RAISE))
                log_warn("%s: could not raise privs", __func__);
        if (sock_set_reuse(fd, 1) == -1) {
+               if (ldpd_privs.change(ZPRIVS_LOWER))
+                       log_warn("%s: could not lower privs", __func__);
                close(fd);
                return (-1);
        }