From 8ae3a147ed28e22a72e27768616f4367d8a92024 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Tue, 9 Sep 2025 14:08:08 +0200 Subject: [PATCH] package/policycoreutils: fix build with musl due to getpass() policycoreutils uses getpass(), which with musl is only defined with some feature macro defined, such as _GNU_SOURCE. So let's pick-up an upstream fix to address this issue. There are no autobuilder failures, the issue was most likely hidden by other failures with musl affecting the SELinux stack. Signed-off-by: Thomas Petazzoni Signed-off-by: Julien Olivain (cherry picked from commit fc472cc8c75406ae10d2cbb3d0a8e10889f692a6) [thomas: fix patch] Signed-off-by: Thomas Perale --- ...oreutils-run_init-define-_GNU_SOURCE.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 package/policycoreutils/0003-policycoreutils-run_init-define-_GNU_SOURCE.patch diff --git a/package/policycoreutils/0003-policycoreutils-run_init-define-_GNU_SOURCE.patch b/package/policycoreutils/0003-policycoreutils-run_init-define-_GNU_SOURCE.patch new file mode 100644 index 0000000000..367d7157c9 --- /dev/null +++ b/package/policycoreutils/0003-policycoreutils-run_init-define-_GNU_SOURCE.patch @@ -0,0 +1,39 @@ +From f338b2e7d2bbf70cb811eb1331162e33deb4ce6c Mon Sep 17 00:00:00 2001 +From: Robert Marko +Date: Thu, 1 May 2025 21:59:13 +0200 +Subject: [PATCH] policycoreutils: run_init: define _GNU_SOURCE + +Trying to compile run_init with musl will fail with: +run_init.c: In function 'authenticate_via_shadow_passwd': +run_init.c:206:40: error: implicit declaration of function 'getpass' [-Wimplicit-function-declaration] + 206 | if (!(unencrypted_password_s = getpass(PASSWORD_PROMPT))) { + +This is because getpass in musl is guarded only for _GNU_SOURCE, so +define _GNU_SOURCE for run_init. + +Signed-off-by: Robert Marko +Acked-by: James Carter +Upstream: 50bafc3d9c08cf26c3b0f61e29157a0ea8efbf4a +Signed-off-by: Thomas Petazzoni +[thomas: fix filename] +Signed-off-by: Thomas Perale +--- + policycoreutils/run_init/run_init.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/run_init/run_init.c b/run_init/run_init.c +index ce499781..4531a8ba 100644 +--- a/run_init/run_init.c ++++ b/run_init/run_init.c +@@ -37,6 +37,8 @@ + * + *************************************************************************/ + ++#define _GNU_SOURCE ++ + #include + #include /* for malloc(), realloc(), free() */ + #include /* for getpwuid() */ +-- +2.51.0 +