ldpd: add missing privilege dropping on error path

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
Renato Westphal 2016-12-19 14:07:28 -02:00
parent 9c0b0e6753
commit 07bc383384

View 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);
}