package/linux-pam: fix musl build
PATCH 1/1 package/linux-pam: fix musl build
Fix the following musl build failure raised since bump to version 1.6.0 in commit 7794fa4c4e1d19a245bb0367cde94560432a2bc5:
pam_namespace.c: In function 'process_line':
pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) {
| ^~~~~~~~
pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?
40 | #include "argv_parse.h" +++ |+#include <stdint.h> 41 |
Fixes:
- http://autobuild.buildroot.org/results/f07360f33010a2cf19aace266faae14a834bd9a4
--- .../0001-pam_namespace-include-stdint-h.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/linux-pam/0001-pam_namespace-include-stdint-h.patch
package/linux-pam/0001-pam_namespace-include-stdint-h.patch new file +42 -0
@@ -0,0 +1,42 @@ +From cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13 Mon Sep 17 00:00:00 2001 +From: Jacob Heider <[email protected]> +Date: Wed, 17 Jan 2024 11:49:26 -0500 +Subject: [PATCH] pam_namespace: include stdint.h + +pam_namespace.c makes use of SIZE_MAX but doesn't include stdint.h, +resulting in the following build failures on 1.6.0: + + pam_namespace.c: In function 'process_line': + pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function) + 649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) { + | ^~~~~~~~ + pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'? + 40 | #include "argv_parse.h" + +++ |+#include <stdint.h> + 41 | + pam_namespace.c:649:41: note: each undeclared identifier is reported only once for each function it appears in + 649 | if (count > UINT_MAX || count > SIZE_MAX / sizeof(uid_t)) { + | ^~~~~~~~ + +Fixes: v1.6.0~100 ("pam_namespace: validate amount of uids in config") +Resolves: https://github.com/linux-pam/linux-pam/issues/733 + +Upstream: https://github.com/linux-pam/linux-pam/commit/cc9d40b7cdbd3e15ccaa324a0dda1680ef9dea13 +SIgned-off-by: Fabrice Fontaine <[email protected]> +--- + modules/pam_namespace/pam_namespace.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c +index f72d67189..b16731c22 100644 +--- a/modules/pam_namespace/pam_namespace.c ++++ b/modules/pam_namespace/pam_namespace.c +@@ -34,6 +34,8 @@ + + #define _ATFILE_SOURCE + ++#include "config.h" ++#include <stdint.h> + #include "pam_cc_compat.h" + #include "pam_inline.h" + #include "pam_namespace.h"
Signature · 6 lines
2.43.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni via buildroot
AppliedQuoted 12 lines · On Tue, 6 Feb 2024 19:03:41 +0100 Fabrice Fontaine…
Fix the following musl build failure raised since bump to version 1.6.0 in commit
7794fa4c4e1d19a245bb0367cde94560432a2bc5:
pam_namespace.c: In function 'process_line':
pam_namespace.c:649:41: error: 'SIZE_MAX' undeclared (first use in this function)
649 | if (count >UINT_MAX|| count >SIZE_MAX/sizeof(uid_t)) {
| ^~~~~~~~
pam_namespace.c:41:1: note: 'SIZE_MAX' is defined in header '<stdint.h>'; did you forget to '#include <stdint.h>'?40 | #include "argv_parse.h" +++ |+#include <stdint.h> 41 |
Quoted 8 lines
Fixes:
- http://autobuild.buildroot.org/results/f07360f33010a2cf19aace266faae14a834bd9a4Signed-off-by Fabrice Fontaine <[email protected]>--- .../0001-pam_namespace-include-stdint-h.patch | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 package/linux-pam/0001-pam_namespace-include-stdint-h.patch
Applied to master, thanks.
Thomas
Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot