summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-04-03 19:24:12 +0200
committerLennart Poettering <lennart@poettering.net>2012-04-03 19:24:12 +0200
commit3338b9595b69a4a6de43bbd0f49b941eba7f6b0e (patch)
treec6a6081bfbfc15ef49df9d4f18b3d7e745d383c9 /src/log.c
parentba8d3790e85ce6bacb2e567e0ba48ceb8e66770e (diff)
fix a couple of AF_UNIX connect() calls
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 949936762a..5b1721184e 100644
--- a/src/log.c
+++ b/src/log.c
@@ -151,7 +151,7 @@ static int log_open_syslog(void) {
goto fail;
}
- if (connect(syslog_fd, &sa.sa, sizeof(sa)) < 0) {
+ if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) {
close_nointr_nofail(syslog_fd);
/* Some legacy syslog systems still use stream
@@ -163,7 +163,7 @@ static int log_open_syslog(void) {
goto fail;
}
- if (connect(syslog_fd, &sa.sa, sizeof(sa)) < 0) {
+ if (connect(syslog_fd, &sa.sa, offsetof(struct sockaddr_un, sun_path) + strlen(sa.un.sun_path)) < 0) {
r = -errno;
goto fail;
}