From: Vincent Bernat Date: Wed, 18 Mar 2015 13:21:46 +0000 (+0100) Subject: priv: use a SOCK_SEQPACKET for communication with monitor X-Git-Tag: 0.7.14~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10c20ba8877e8844a25c8055ad9d7bd80d11569a;p=thirdparty%2Flldpd.git priv: use a SOCK_SEQPACKET for communication with monitor This has the same semantics than SOCK_DGRAM but it also supports the ability to notify the other end of end-of-file events. However, it may not be widely implemented, hence the separate commit. --- diff --git a/src/daemon/priv.c b/src/daemon/priv.c index 0588fab0..f00297ee 100644 --- a/src/daemon/priv.c +++ b/src/daemon/priv.c @@ -591,7 +591,7 @@ priv_init(const char *chrootdir, int ctl, uid_t uid, gid_t gid) int pair[2]; /* Create socket pair */ - if (socketpair(AF_UNIX, SOCK_DGRAM, PF_UNSPEC, pair) < 0) + if (socketpair(AF_UNIX, SOCK_SEQPACKET, PF_UNSPEC, pair) < 0) fatal("privsep", "unable to create socket pair for privilege separation"); priv_unprivileged_fd(pair[0]);