Skip to content

Commit b7c072b

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

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lib/agetpass.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@
1313
#include <limits.h>
1414
#include <readpassphrase.h>
1515
#include <stddef.h>
16+
#include <stdio.h>
1617
#include <string.h>
1718

1819
#include "alloc/malloc.h"
1920
#include "attr.h"
2021
#include "string/memset/memzero.h"
2122

2223

24+
/*
25+
* Maximum password length
26+
*
27+
* Consider that there is also limit in PAM (PAM_MAX_RESP_SIZE)
28+
* currently set to 512.
29+
*/
30+
#ifndef PASS_MAX
31+
# define PASS_MAX (BUFSIZ - 1)
32+
#endif
33+
34+
2335
// Similar to getpass(3), but free of its problems.
2436
#define agetpass(prompt) agetpass_(prompt, RPP_REQUIRE_TTY)
2537
#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)