diff --git a/lib/Makefile.am b/lib/Makefile.am index 2120578ff..5b2b269f3 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -136,10 +136,6 @@ libshadow_la_SOURCES = \ pam_defs.h \ pam_pass.c \ pam_pass_non_interactive.c \ - pass/agetpass.c \ - pass/agetpass.h \ - pass/areadpass.c \ - pass/areadpass.h \ pass/getpassa.c \ pass/getpassa.h \ pass/passzero.c \ diff --git a/lib/pass/agetpass.c b/lib/pass/agetpass.c deleted file mode 100644 index ce0f30c35..000000000 --- a/lib/pass/agetpass.c +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include - -#include "pass/agetpass.h" diff --git a/lib/pass/agetpass.h b/lib/pass/agetpass.h deleted file mode 100644 index c3035fe93..000000000 --- a/lib/pass/agetpass.h +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#ifndef SHADOW_INCLUDE_LIB_AGETPASS_H_ -#define SHADOW_INCLUDE_LIB_AGETPASS_H_ - - -#include - -#include -#include - -#include "pass/areadpass.h" - - -// Similar to getpass(3), but free of its problems. -#define agetpass(prompt) areadpass(prompt, RPP_REQUIRE_TTY) -#define agetpass_stdin() areadpass(NULL, RPP_STDIN) - - -#endif // include guard diff --git a/lib/pass/areadpass.c b/lib/pass/areadpass.c deleted file mode 100644 index 3c3bfaa6e..000000000 --- a/lib/pass/areadpass.c +++ /dev/null @@ -1,44 +0,0 @@ -// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#include - -#include "pass/areadpass.h" - -#include -#include - -#include "alloc/malloc.h" -#include "pass/passzero.h" -#include "pass/readpass.h" - - -char * -areadpass(const char *prompt, int flags) -{ - char *pass; - size_t len; - - pass = MALLOC(PASS_MAX + 2, char); - if (pass == NULL) - return NULL; - - if (readpass(prompt, pass, flags) == NULL) - goto fail; - - return pass; - -fail: - free(pass); - return NULL; -} - - -void -erase_pass(char pass[PASS_MAX + 2]) -{ - if (pass != NULL) - passzero(pass); - free(pass); -} diff --git a/lib/pass/areadpass.h b/lib/pass/areadpass.h deleted file mode 100644 index 0c65051a8..000000000 --- a/lib/pass/areadpass.h +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-FileCopyrightText: 2022-2025, Alejandro Colomar -// SPDX-License-Identifier: BSD-3-Clause - - -#ifndef SHADOW_INCLUDE_LIB_PASS_AREADPASS_H_ -#define SHADOW_INCLUDE_LIB_PASS_AREADPASS_H_ - - -#include - -#include "attr.h" -#include "readpass.h" - - -void erase_pass(char pass[PASS_MAX + 2]); -ATTR_MALLOC(erase_pass) -char *areadpass(const char *prompt, int flags); - - -#endif // include guard