]> granicus.if.org Git - sudo/commitdiff
added more _PASSWD_LEN stuff -- now uses PASS_MAX too
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 22 Feb 1996 21:27:28 +0000 (21:27 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 22 Feb 1996 21:27:28 +0000 (21:27 +0000)
compat.h

index 6e78dc5e09a04840df37626fb27e4c96d6bd7f78..0b2edc92d87f8d9866542efba680245ad9f120f6 100644 (file)
--- 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 */
 
 #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 */
 
 /*