systemd-fix-page-size.patch 2.0 KB

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