]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
priv: use a SOCK_SEQPACKET for communication with monitor
authorVincent Bernat <vincent@bernat.im>
Wed, 18 Mar 2015 13:21:46 +0000 (14:21 +0100)
committerVincent Bernat <vincent@bernat.im>
Wed, 18 Mar 2015 13:21:46 +0000 (14:21 +0100)
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.

src/daemon/priv.c

index 0588fab06c4cb0af14aaacb7b6e5891b633d4c5c..f00297ee14b26f7a2782cebd64c8f7402f30dc24 100644 (file)
@@ -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]);