diff --git a/lib/agetpass.c b/lib/agetpass.c index 7b4fad34d1..0635dd314c 100644 --- a/lib/agetpass.c +++ b/lib/agetpass.c @@ -1,7 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2022-2023, Alejandro Colomar - * SPDX-License-Identifier: BSD-3-Clause - */ +// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause #include @@ -10,7 +8,4 @@ extern inline void erase_pass(char *pass); -extern inline char *agetpass(const char *prompt); -extern inline char *agetpass_stdin(); - extern inline char *agetpass_internal(const char *prompt, int flags); diff --git a/lib/agetpass.h b/lib/agetpass.h index 5e5c523245..ea37ca0c5c 100644 --- a/lib/agetpass.h +++ b/lib/agetpass.h @@ -1,8 +1,5 @@ -/* - * SPDX-FileCopyrightText: 2022, Alejandro Colomar - * - * SPDX-License-Identifier: BSD-3-Clause - */ +// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar +// SPDX-License-Identifier: BSD-3-Clause #ifndef SHADOW_INCLUDE_LIB_AGETPASS_H_ @@ -23,12 +20,12 @@ #endif /* WITH_LIBBSD */ -inline void erase_pass(char *pass); - // Similar to getpass(3), but free of its problems. -inline char *agetpass(const char *prompt); -inline char *agetpass_stdin(); +#define agetpass(prompt) agetpass_internal(prompt, RPP_REQUIRE_TTY) +#define agetpass_stdin() agetpass_internal(NULL, RPP_STDIN) + +inline void erase_pass(char *pass); ATTR_MALLOC(erase_pass) inline char *agetpass_internal(const char *prompt, int flags); @@ -67,17 +64,6 @@ agetpass_internal(const char *prompt, int flags) return NULL; } -inline char * -agetpass(const char *prompt) -{ - return agetpass_internal(prompt, RPP_REQUIRE_TTY); -} - -inline char * -agetpass_stdin() -{ - return agetpass_internal(NULL, RPP_STDIN); -} inline void erase_pass(char *pass)