[systemd-commits] src/sd-daemon.c
Lennart Poettering
lennart at kemper.freedesktop.org
Sun Jul 11 14:49:28 PDT 2010
src/sd-daemon.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
New commits:
commit a013bd94cc0137c20236f3db2fa156ada9373e59
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Jul 11 23:49:02 2010 +0200
sd-daemon: fix abstract namespace sockaddr for notification socket
diff --git a/src/sd-daemon.c b/src/sd-daemon.c
index 5df70e3..3bb258d 100644
--- a/src/sd-daemon.c
+++ b/src/sd-daemon.c
@@ -381,7 +381,11 @@ int sd_notify(int unset_environment, const char *state) {
memset(&msghdr, 0, sizeof(msghdr));
msghdr.msg_name = &sockaddr;
- msghdr.msg_namelen = sizeof(struct sockaddr_un);
+ msghdr.msg_namelen = sizeof(sa_family_t) + strlen(e);
+
+ if (msghdr.msg_namelen > sizeof(struct sockaddr_un))
+ msghdr.msg_namelen = sizeof(struct sockaddr_un);
+
msghdr.msg_iov = &iovec;
msghdr.msg_iovlen = 1;
msghdr.msg_control = &control;
More information about the systemd-commits
mailing list