From c11d9e080fc0c10a0a7aa7b1e4db2428c0ccdc13 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 9 Oct 2015 11:21:57 +0200 Subject: [PATCH] Revert "sd_pid_notify_with_fds: fix computing msg_controllen" It causes connection errors from various services on boot. https://github.com/systemd/systemd/issues/1505 Closes: #801354 --- debian/changelog | 7 +++++ ...tify_with_fds-fix-computing-msg_cont.patch | 30 +++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 38 insertions(+) create mode 100644 debian/patches/Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch diff --git a/debian/changelog b/debian/changelog index 742704ae2..9e24c6129 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +systemd (227-2) UNRELEASED; urgency=medium + + * Revert "sd_pid_notify_with_fds: fix computing msg_controllen", it causes + connection errors from various services on boot. (Closes: #801354) + + -- Martin Pitt Fri, 09 Oct 2015 11:21:14 +0200 + systemd (227-1) unstable; urgency=medium * New upstream release. diff --git a/debian/patches/Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch b/debian/patches/Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch new file mode 100644 index 000000000..1b6267c84 --- /dev/null +++ b/debian/patches/Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch @@ -0,0 +1,30 @@ +From: Martin Pitt +Date: Fri, 9 Oct 2015 11:19:38 +0200 +Subject: Revert "sd_pid_notify_with_fds: fix computing msg_controllen" + +This causes connection errors from various services on boot. + +This reverts commit a5bd3c32abb00ad945282568fd1a97c180b68047. + +https://github.com/systemd/systemd/issues/1505 +Closes: #801354 +--- + src/libsystemd/sd-daemon/sd-daemon.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c +index 4375181..6514d69 100644 +--- a/src/libsystemd/sd-daemon/sd-daemon.c ++++ b/src/libsystemd/sd-daemon/sd-daemon.c +@@ -449,9 +449,8 @@ _public_ int sd_pid_notify_with_fds(pid_t pid, int unset_environment, const char + have_pid = pid != 0 && pid != getpid(); + + if (n_fds > 0 || have_pid) { +- /* CMSG_SPACE(0) may return value different then zero, which results in miscalculated controllen. */ +- msghdr.msg_controllen = (n_fds ? CMSG_SPACE(sizeof(int) * n_fds) : 0) + +- CMSG_SPACE(sizeof(struct ucred)) * have_pid; ++ msghdr.msg_controllen = CMSG_SPACE(sizeof(int) * n_fds) + ++ CMSG_SPACE(sizeof(struct ucred) * have_pid); + msghdr.msg_control = alloca(msghdr.msg_controllen); + + cmsg = CMSG_FIRSTHDR(&msghdr); diff --git a/debian/patches/series b/debian/patches/series index b698280a8..2775d4e35 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -35,3 +35,4 @@ syslog-Increase-max_dgram_qlen-by-pulling-in-systemd.patch fsckd-daemon-for-inter-fsckd-communication.patch Skip-filesystem-check-if-already-done-by-the-initram.patch Revert-core-one-step-back-again-for-nspawn-we-actual.patch +Revert-sd_pid_notify_with_fds-fix-computing-msg_cont.patch