From 1154d3267c0f01b51fec5a7491235d57e870b7cb Mon Sep 17 00:00:00 2001 From: Alejandro Colomar Date: Mon, 20 Jan 2025 00:35:24 +0100 Subject: [PATCH] lib/: PASS_MAX: Move definition to where it's used Signed-off-by: Alejandro Colomar --- lib/agetpass.h | 11 +++++++++++ lib/defines.h | 10 ---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/agetpass.h b/lib/agetpass.h index 41a6477cdd..589c7bbf39 100644 --- a/lib/agetpass.h +++ b/lib/agetpass.h @@ -20,6 +20,17 @@ #include "string/memset/memzero.h" +/* + * Maximum password length + * + * Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE) + * currently set to 512. + */ +#ifndef PASS_MAX +# define PASS_MAX (BUFSIZ - 1) +#endif + + // Similar to getpass(3), but free of its problems. #define agetpass(prompt) agetpass_(prompt, RPP_REQUIRE_TTY) #define agetpass_stdin() agetpass_(NULL, RPP_STDIN) diff --git a/lib/defines.h b/lib/defines.h index 8c55dddbc1..9986c0cab7 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -203,14 +203,4 @@ # define shadow_getenv(name) getenv(name) #endif -/* - * Maximum password length - * - * Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE) - * currently set to 512. - */ -#if !defined(PASS_MAX) -#define PASS_MAX BUFSIZ - 1 -#endif - #endif /* _DEFINES_H_ */