-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib/agetpass.*: agetpass(), agetpass_stdin(): Re-implement as macros
Signed-off-by: Alejandro Colomar <[email protected]>
- Loading branch information
1 parent
55c4128
commit 5a7b086
Showing
2 changed files
with
8 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022-2023, Alejandro Colomar <[email protected]> | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar <[email protected]> | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
|
||
#include <config.h> | ||
|
@@ -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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2022, Alejandro Colomar <[email protected]> | ||
* | ||
* SPDX-License-Identifier: BSD-3-Clause | ||
*/ | ||
// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar <[email protected]> | ||
// 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) | ||
|