blob: dda08c5a4007ad40c153f1f2e2f6ab91aa62a816 [file] [log] [blame]
Zbigniew Jędrzejewski-Szmek3a5d9b72016-09-29 17:04:15 -04001From 2e9b525caa9e3126e54f0d9506d0c36d7d533997 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek20fa8482016-09-29 05:34:51 -04002From: Jorge Niedbalski <jorge.niedbalski@canonical.com>
3Date: Wed, 28 Sep 2016 18:25:50 -0300
4Subject: [PATCH] If the notification message length is 0, ignore the message
5 (#4237)
6
7Fixes #4234.
8
9Signed-off-by: Jorge Niedbalski <jnr@metaklass.org>
Zbigniew Jędrzejewski-Szmek3a5d9b72016-09-29 17:04:15 -040010(cherry picked from commit 531ac2b2349da02acc9c382849758e07eb92b020)
Zbigniew Jędrzejewski-Szmek20fa8482016-09-29 05:34:51 -040011---
12 src/core/manager.c | 4 ++++
13 1 file changed, 4 insertions(+)
14
15diff --git a/src/core/manager.c b/src/core/manager.c
16index 4d84a0b37e..a085ed899a 100644
17--- a/src/core/manager.c
18+++ b/src/core/manager.c
19@@ -1648,6 +1648,10 @@ static int manager_dispatch_notify_fd(sd_event_source *source, int fd, uint32_t
20
21 return -errno;
22 }
23+ if (n == 0) {
24+ log_debug("Got zero-length notification message. Ignoring.");
25+ return 0;
26+ }
27
28 CMSG_FOREACH(cmsg, &msghdr) {
29 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {