From: Todd C. Miller Date: Thu, 22 Feb 1996 21:27:28 +0000 (+0000) Subject: added more _PASSWD_LEN stuff -- now uses PASS_MAX too X-Git-Tag: SUDO_1_5_0~265 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7c0d81ee37a9b2a0280259755f24b43396f7d762;p=sudo added more _PASSWD_LEN stuff -- now uses PASS_MAX too --- diff --git a/compat.h b/compat.h index 6e78dc5e0..0b2edc92d 100644 --- a/compat.h +++ b/compat.h @@ -30,9 +30,9 @@ /* Deal with ansi stuff reasonably. */ #ifndef __P # if defined (__cplusplus) || defined (__STDC__) -# define __P(args) args +# define __P(args) args # else -# define __P(args) () +# define __P(args) () # endif #endif /* __P */ @@ -85,21 +85,35 @@ #endif /* S_IRWXU */ /* - * For alternate password schemes we need longer passwords + * We need to know how long the longest password may be. + * For alternate password schemes we need longer passwords. + * This is a bit, ummm, gross but necesary. */ #if defined(HAVE_KERB4) || defined(HAVE_DCE) || defined(HAVE_SKEY) # undef _PASSWD_LEN -# define _PASSWD_LEN 256 +# define _PASSWD_LEN 256 +#else +# ifndef _PASSWD_LEN +# ifdef PASS_MAX +# define _PASSWD_LEN PASS_MAX +# else +# ifdef HAVE_C2_SECURITY +# define _PASSWD_LEN 24 +# else +# define _PASSWD_LEN 8 +# endif /* HAVE_C2_SECURITY */ +# endif /* PASS_MAX */ +# endif /* !_PASSWD_LEN */ #endif /* HAVE_KERB4 || HAVE_DCE || HAVE_SKEY */ /* * Some OS's lack these */ #ifndef UID_NO_CHANGE -# define UID_NO_CHANGE ((uid_t) -1) +# define UID_NO_CHANGE ((uid_t) -1) #endif /* UID_NO_CHANGE */ #ifndef GID_NO_CHANGE -# define GID_NO_CHANGE ((gid_t) -1) +# define GID_NO_CHANGE ((gid_t) -1) #endif /* GID_NO_CHANGE */ /*