From 10c20ba8877e8844a25c8055ad9d7bd80d11569a Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Wed, 18 Mar 2015 14:21:46 +0100 Subject: [PATCH] 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. --- src/daemon/priv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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]); -- 2.39.5