Skip to content

policycoreutils: run_init: define _GNU_SOURCE#493

Closed
tpetazzoni wants to merge 1 commit intoSELinuxProject:mainfrom
tpetazzoni:policycoreutils-getpass
Closed

policycoreutils: run_init: define _GNU_SOURCE#493
tpetazzoni wants to merge 1 commit intoSELinuxProject:mainfrom
tpetazzoni:policycoreutils-getpass

Conversation

@tpetazzoni
Copy link
Contributor

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.

[Thomas: taken from OpenWrt at
https://git.infobricfleet.com/gtu/openwrt/-/blob/e56845fae3c05463a57ba8e0e104d6d8d8cd96ed/package/utils/policycoreutils/patches/0001-policycoreutils-run_init-define-_GNU_SOURCE.patch]

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 <[email protected]>
[Thomas: taken from OpenWrt at
https://git.infobricfleet.com/gtu/openwrt/-/blob/e56845fae3c05463a57ba8e0e104d6d8d8cd96ed/package/utils/policycoreutils/patches/0001-policycoreutils-run_init-define-_GNU_SOURCE.patch]
Signed-off-by: Thomas Petazzoni <[email protected]>
@tpetazzoni
Copy link
Contributor Author

This is already fixed in main, closing.

@tpetazzoni tpetazzoni closed this Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants