Skip to content

Commit c11d9e0

Browse files
committed
Revert "sd_pid_notify_with_fds: fix computing msg_controllen"
It causes connection errors from various services on boot. systemd/systemd#1505 Closes: #801354
1 parent e78fd4b commit c11d9e0

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
systemd (227-2) UNRELEASED; urgency=medium
2+
3+
* Revert "sd_pid_notify_with_fds: fix computing msg_controllen", it causes
4+
connection errors from various services on boot. (Closes: #801354)
5+
6+
-- Martin Pitt <mpitt@debian.org> Fri, 09 Oct 2015 11:21:14 +0200
7+
18
systemd (227-1) unstable; urgency=medium
29

310
* New upstream release.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
From: Martin Pitt <martin.pitt@ubuntu.com>
2+
Date: Fri, 9 Oct 2015 11:19:38 +0200
3+
Subject: Revert "sd_pid_notify_with_fds: fix computing msg_controllen"
4+
5+
This causes connection errors from various services on boot.
6+
7+
This reverts commit a5bd3c32abb00ad945282568fd1a97c180b68047.
8+
9+
https://github.com/systemd/systemd/issues/1505
10+
Closes: #801354
11+
---
12+
src/libsystemd/sd-daemon/sd-daemon.c | 5 ++---
13+
1 file changed, 2 insertions(+), 3 deletions(-)
14+
15+
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
16+
index 4375181..6514d69 100644
17+
--- a/src/libsystemd/sd-daemon/sd-daemon.c
18+
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
19+
@@ -449,9 +449,8 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char
20+
have_pid = pid != 0 && pid != getpid();
21+
22+
if (n_fds > 0 || have_pid) {
23+
- /* CMSG_SPACE(0) may return value different then zero, which results in miscalculated controllen. */
24+
- msghdr.msg_controllen = (n_fds ? CMSG_SPACE(sizeof(int) * n_fds) : 0) +
25+
- CMSG_SPACE(sizeof(struct ucred)) * have_pid;
26+
+ msghdr.msg_controllen = CMSG_SPACE(sizeof(int) * n_fds) +
27+
+ CMSG_SPACE(sizeof(struct ucred) * have_pid);
28+
msghdr.msg_control = alloca(msghdr.msg_controllen);
29+
30+
cmsg = CMSG_FIRSTHDR(&msghdr);

debian/patches/series

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ syslog-Increase-max_dgram_qlen-by-pulling-in-systemd.patch
3535
fsckd-daemon-for-inter-fsckd-communication.patch
3636
Skip-filesystem-check-if-already-done-by-the-initram.patch
3737
Revert-core-one-step-back-again-for-nspawn-we-actual.patch
38+
Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch

0 commit comments

Comments
 (0)