]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus/bus-socket: restore recvmsg_safe() during auth
authorMike Yuan <me@yhndnzj.com>
Tue, 27 Jan 2026 18:01:18 +0000 (19:01 +0100)
committerMike Yuan <me@yhndnzj.com>
Wed, 28 Jan 2026 02:07:01 +0000 (03:07 +0100)
At auth stage we reject any fds, hence either way the connection
would fail. Let's play it safe and check for MSG_(C)TRUNC still.

src/libsystemd/sd-bus/bus-socket.c

index 45f74cc7c71177efb8cca06cb67d269a36fdaa7e..e1ef6b81897d0178171f04b62192fefe604c1ee4 100644 (file)
@@ -657,7 +657,7 @@ static int bus_socket_read_auth(sd_bus *b) {
                         .msg_controllen = sizeof(control),
                 };
 
-                k = RET_NERRNO(recvmsg(b->input_fd, &mh, MSG_DONTWAIT|MSG_CMSG_CLOEXEC));
+                k = recvmsg_safe(b->input_fd, &mh, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
                 if (k == -ENOTSOCK) {
                         b->prefer_readv = true;
                         k = readv(b->input_fd, &iov, 1);