Skip to content

Commit cafa934

Browse files
lib/: PASS_MAX: Move definition to where it's used
Signed-off-by: Alejandro Colomar <[email protected]>
1 parent d7f32b7 commit cafa934

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

lib/agetpass.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@
2020
#include "memzero.h"
2121

2222

23+
/*
24+
* Maximum password length
25+
*
26+
* Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE)
27+
* currently set to 512.
28+
*/
29+
#ifndef PASS_MAX
30+
# define PASS_MAX (BUFSIZ - 1)
31+
#endif
32+
33+
2334
// Similar to getpass(3), but free of its problems.
2435
#define agetpass(prompt) agetpass_(prompt, RPP_REQUIRE_TTY)
2536
#define agetpass_stdin() agetpass_(NULL, RPP_STDIN)

lib/defines.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,14 +203,4 @@
203203
# define shadow_getenv(name) getenv(name)
204204
#endif
205205

206-
/*
207-
* Maximum password length
208-
*
209-
* Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE)
210-
* currently set to 512.
211-
*/
212-
#if !defined(PASS_MAX)
213-
#define PASS_MAX BUFSIZ - 1
214-
#endif
215-
216206
#endif /* _DEFINES_H_ */

0 commit comments

Comments
 (0)