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..ca26506b74 --- /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 +--- + 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 +