Skip to content

Commit

Permalink
lib/: PASS_MAX: Move definition to where it's used
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Colomar <[email protected]>
  • Loading branch information
alejandro-colomar committed Jan 19, 2025
1 parent 0f1c7c3 commit 1154d32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
11 changes: 11 additions & 0 deletions lib/agetpass.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 0 additions & 10 deletions lib/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_ */

0 comments on commit 1154d32

Please sign in to comment.