]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Use the correct variable sizes for int8/int16/int32 in CrackLib
authorRuss Allbery <rra@stanford.edu>
Sun, 14 Mar 2010 23:42:34 +0000 (16:42 -0700)
committerRuss Allbery <rra@stanford.edu>
Sun, 14 Mar 2010 23:42:34 +0000 (16:42 -0700)
Fix variable sizes in the embedded CrackLib on 64-bit platforms.  This
may fix interoperability problems with databases created on platforms
with a different native integer size.  Thanks, Karl Lehnberger and
Benj Carson.

NEWS
configure.ac
cracklib/packer.c
cracklib/packer.h

diff --git a/NEWS b/NEWS
index 145ac36a6760e03c901d16d7697fb9bfa33278af..bab435d4b84d0b1fdb377760464c3e2843ae9a5a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,12 @@
                     User-Visible krb5-strength Changes
 
+krb5-strength 1.1 (unreleased)
+
+    Fix variable sizes in the embedded CrackLib on 64-bit platforms.  This
+    may fix interoperability problems with databases created on platforms
+    with a different native integer size.  Thanks, Karl Lehnberger and
+    Benj Carson.
+
 krb5-strength 1.0 (2010-02-16)
 
     Add heimdal-strength, a program that checks password strength using
index 4723dbe01db3533a7ce1bf4c5a15f9ff8b4e1002..18fe4913b1e265c940cd9ded4b96ff5fbef0b914 100644 (file)
@@ -25,6 +25,9 @@ AC_HEADER_STDBOOL
 AC_CHECK_HEADERS([sys/bittypes.h])
 AC_CHECK_DECLS([snprintf, vsnprintf])
 AC_TYPE_LONG_LONG_INT
+AC_TYPE_UINT8_T
+AC_TYPE_UINT16_T
+AC_TYPE_UINT32_T
 RRA_FUNC_SNPRINTF
 AC_REPLACE_FUNCS([asprintf strlcat strlcpy])
 
index a9456ff09a7993abcc0679ee0a9eb7249089c3f9..11ee9376ddf8b468ee2395c2c8c1949e0b976984 100644 (file)
@@ -11,6 +11,8 @@
  *
  * 2009-10-14  Russ Allbery <rra@stanford.edu>
  *   - Add ANSI C protototypes for all functions.
+ * 2010-03-14  Russ Allbery <rra@stanford.edu>
+ *   - Use unsigned long instead of int32 to avoid printf warnings.
  */
 
 #include "packer.h"
@@ -18,8 +20,8 @@
 int
 main(int argc, char *argv[])
 {
-    int32 readed;
-    int32 wrote;
+    unsigned long readed;
+    unsigned long wrote;
     PWDICT *pwp;
     char buffer[STRINGSIZE];
 
index 9f10b82d90e3a04f9e5cd35e26d6c4e794b24c15..1bf32da427cd6de49a6d23a2e4269ef933e3feda 100644 (file)
  *   - Add ANSI C prototypes and prototype additional functions.
  * 2009-10-14  Russ Allbery <rra@stanford.edu>
  *   - Prototype changes for const cleanliness.
+ * 2010-03-14  Russ Allbery <rra@stanford.edu>
+ *   - Fix int8, int16, and int32 definitions.
  */
 
-#include <stdio.h>
+#include <config.h>
+#include <portable/system.h>
+
 #include <ctype.h>
 
 #define STRINGSIZE     1024
 #define TRUNCSTRINGSIZE        (STRINGSIZE/4)
 
-typedef unsigned char int8;
-typedef unsigned short int int16;
-typedef unsigned long int int32;
+typedef uint8_t int8;
+typedef uint16_t int16;
+typedef uint32_t int32;
 #ifndef NUMWORDS
 #define NUMWORDS       16
 #endif