0001-pam_namespace-include-stdint-h.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13 Mon Sep 17 00:00:00 2001
  2. From: Jacob Heider <jacob@pkgx.dev>
  3. Date: Wed, 17 Jan 2024 11:49:26 -0500
  4. Subject: [PATCH] pam_namespace: include stdint.h
  5. pam_namespace.c makes use of SIZE_MAX but doesn't include stdint.h,
  6. resulting in the following build failures on 1.6.0:
  7. pam_namespace.c: In function 'process_line':
  8. pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
  9. 649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
  10. | ^~~~~~~~
  11. pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
  12. 40 | #include "argv_parse.h"
  13. +++ |+#include <stdint.h>
  14. 41 |
  15. pam_namespace.c:649:41: note: each undeclared identifier is reported only once for each function it appears in
  16. 649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
  17. | ^~~~~~~~
  18. Fixes: v1.6.0~100 ("pam_namespace: validate amount of uids in config")
  19. Resolves: https://github.com/linux-pam/linux-pam/issues/733
  20. Upstream: https://github.com/linux-pam/linux-pam/commit/cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13
  21. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  22. ---
  23. modules/pam_namespace/pam_namespace.c | 2 ++
  24. 1 file changed, 2 insertions(+)
  25. diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
  26. index f72d67189..b16731c22 100644
  27. --- a/modules/pam_namespace/pam_namespace.c
  28. +++ b/modules/pam_namespace/pam_namespace.c
  29. @@ -34,6 +34,8 @@
  30. #define _ATFILE_SOURCE
  31. +#include "config.h"
  32. +#include <stdint.h>
  33. #include "pam_cc_compat.h"
  34. #include "pam_inline.h"
  35. #include "pam_namespace.h"