1 commit 7264278fbbdc1dc6c30fedc902d1337594aa6ff6
2 Author: Lennart Poettering <lennart@poettering.net>
3 Date: Wed Mar 21 23:47:44 2012 +0100
5 journal: PAGE_SIZE is not known on ppc and other archs
7 Let's use NAME_MAX, as suggested by Dan Walsh
9 diff --git a/src/journal/journald.c b/src/journal/journald.c
10 index d27cb60..87390bd 100644
11 --- a/src/journal/journald.c
12 +++ b/src/journal/journald.c
14 #include <sys/ioctl.h>
15 #include <linux/sockios.h>
16 #include <sys/statvfs.h>
17 -#include <sys/user.h>
19 #include <systemd/sd-journal.h>
20 #include <systemd/sd-login.h>
21 @@ -2149,10 +2148,20 @@ static int process_event(Server *s, struct epoll_event *ev) {
24 struct cmsghdr cmsghdr;
26 + /* We use NAME_MAX space for the
27 + * SELinux label here. The kernel
28 + * currently enforces no limit, but
29 + * according to suggestions from the
30 + * SELinux people this will change and
31 + * it will probably be identical to
32 + * NAME_MAX. For now we use that, but
33 + * this should be updated one day when
34 + * the final limit is known.*/
35 uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
36 CMSG_SPACE(sizeof(struct timeval)) +
37 - CMSG_SPACE(sizeof(int)) +
38 - CMSG_SPACE(PAGE_SIZE)]; /* selinux label */
39 + CMSG_SPACE(sizeof(int)) + /* fd */
40 + CMSG_SPACE(NAME_MAX)]; /* selinux label */