policycoreutils: run_init: define _GNU_SOURCE
PATCH 1/1 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.
--- policycoreutils/run_init/run_init.c | 2 ++ 1 file changed, 2 insertions(+)
policycoreutils/run_init/run_init.c +2 -0
@@ -37,6 +37,8 @@* *************************************************************************/ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> /* for malloc(), realloc(), free() */ #include <pwd.h> /* for getpwuid() */
Signature · 1 line
2.49.0
Quoted 10 lines · Robert Marko
Trying to compile
run_initwith 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_SOURCEforrun_init.Signed-off-by Robert Marko <[email protected]>
Quoted 21 lines
--- policycoreutils/run_init/run_init.c | 2 ++ 1 file changed, 2 insertions(+)policycoreutils/run_init/run_init.c +2
-1@@ -37,6 +37,8 @@* *************************************************************************/ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> /* for malloc(), realloc(), free() */ #include <pwd.h> /* for getpwuid() */ --2.49.0
Quoted 8 lines · James Carter
Quoted 6 lines · Robert Marko
Trying to compile
run_initwith 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))) {
Quoted 7 lines
Quoted 4 lines
This is because getpass in musl is guarded only for
_GNU_SOURCE, so define_GNU_SOURCEforrun_init.Signed-off-by Robert Marko <[email protected]>Acked-by James Carter <[email protected]>
Merged.
Thanks,
Jim
Quoted 21 lines
Quoted 21 lines
--- policycoreutils/run_init/run_init.c | 2 ++ 1 file changed, 2 insertions(+)policycoreutils/run_init/run_init.c +2
-1@@ -37,6 +37,8 @@* *************************************************************************/ +#define _GNU_SOURCE +#include <stdio.h> #include <stdlib.h> /* for malloc(), realloc(), free() */ #include <pwd.h> /* for getpwuid() */ --2.49.0