teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame systemd-PAGE_SIZE.patch

e6be2e
From 7264278fbbdc1dc6c30fedc902d1337594aa6ff6 Mon Sep 17 00:00:00 2001
e6be2e
From: Lennart Poettering <lennart@poettering.net>
e6be2e
Date: Wed, 21 Mar 2012 22:47:44 +0000
e6be2e
Subject: journal: PAGE_SIZE is not known on ppc and other archs
e6be2e
e6be2e
Let's use NAME_MAX, as suggested by Dan Walsh
e6be2e
---
e6be2e
diff --git a/src/journal/journald.c b/src/journal/journald.c
e6be2e
index d27cb60..87390bd 100644
e6be2e
--- a/src/journal/journald.c
e6be2e
+++ b/src/journal/journald.c
e6be2e
@@ -29,7 +29,6 @@
e6be2e
 #include <sys/ioctl.h>
e6be2e
 #include <linux/sockios.h>
e6be2e
 #include <sys/statvfs.h>
e6be2e
-#include <sys/user.h>
e6be2e
 
e6be2e
 #include <systemd/sd-journal.h>
e6be2e
 #include <systemd/sd-login.h>
e6be2e
@@ -2149,10 +2148,20 @@ static int process_event(Server *s, struct epoll_event *ev) {
e6be2e
                         size_t label_len = 0;
e6be2e
                         union {
e6be2e
                                 struct cmsghdr cmsghdr;
e6be2e
+
e6be2e
+                                /* We use NAME_MAX space for the
e6be2e
+                                 * SELinux label here. The kernel
e6be2e
+                                 * currently enforces no limit, but
e6be2e
+                                 * according to suggestions from the
e6be2e
+                                 * SELinux people this will change and
e6be2e
+                                 * it will probably be identical to
e6be2e
+                                 * NAME_MAX. For now we use that, but
e6be2e
+                                 * this should be updated one day when
e6be2e
+                                 * the final limit is known.*/
e6be2e
                                 uint8_t buf[CMSG_SPACE(sizeof(struct ucred)) +
e6be2e
                                             CMSG_SPACE(sizeof(struct timeval)) +
e6be2e
-                                            CMSG_SPACE(sizeof(int)) +
e6be2e
-                                            CMSG_SPACE(PAGE_SIZE)]; /* selinux label */
e6be2e
+                                            CMSG_SPACE(sizeof(int)) + /* fd */
e6be2e
+                                            CMSG_SPACE(NAME_MAX)]; /* selinux label */
e6be2e
                         } control;
e6be2e
                         ssize_t n;
e6be2e
                         int v;
e6be2e
--
e6be2e
cgit v0.9.0.2-2-gbebe