]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blame - cracklib/patches/cracklib-2.8.15-inttypes.patch
Merge branch 'master' of ssh://git.ipfire.org/pub/git/ipfire-3.x
[people/amarx/ipfire-3.x.git] / cracklib / patches / cracklib-2.8.15-inttypes.patch
CommitLineData
71e6a8ef
MT
1Don't depend on a consumer of <packer.h> to be using autoconf, and to be
2checking for for the presence of <inttypes.h> and <stdint.h>, and including
3its own "config.h" before including <packer.h>, in order for this to be
4correct on 64-bit machines.
5
6diff -up cracklib-2.8.15/configure.in cracklib-2.8.15/configure.in
7--- cracklib-2.8.15/configure.in 2009-11-18 18:58:21.000000000 -0500
8+++ cracklib-2.8.15/configure.in 2009-12-01 15:16:35.000000000 -0500
9@@ -26,6 +26,19 @@ AC_CHECK_HEADERS(zlib.h, AC_DEFINE(HAVE_
10
11 AC_SEARCH_LIBS(gzopen, z)
12
13+if test x$ac_cv_header_inttypes_h = xyes ; then
14+ CRACKLIB_INTEGER_TYPES1="#include <inttypes.h>"
15+ CRACKLIB_INTEGER_TYPES2=
16+elif test x$ac_cv_header_stdint_h = xyes ; then
17+ CRACKLIB_INTEGER_TYPES1="#include <stdint.h>"
18+ CRACKLIB_INTEGER_TYPES2=
19+else
20+ CRACKLIB_INTEGER_TYPES1="typedef unsigned int uint32_t;"
21+ CRACKLIB_INTEGER_TYPES2="typedef unsigned short uint16_t;"
22+fi
23+AC_SUBST(CRACKLIB_INTEGER_TYPES1)
24+AC_SUBST(CRACKLIB_INTEGER_TYPES2)
25+
26 dnl Cygwin workaround
27 AC_MSG_CHECKING(if LINE_MAX is defined)
28 AC_EGREP_CPP(yes,
29@@ -92,5 +105,6 @@ AC_SUBST(CROSS_COMPILING, $cross_compili
30
31 AC_OUTPUT(util/Makefile lib/Makefile doc/Makefile python/Makefile Makefile \
32 python/setup.py \
33+ lib/packer.h \
34 po/Makefile.in m4/Makefile dicts/Makefile cracklib.spec)
35
36diff -up cracklib-2.8.15/lib/packer.h.in cracklib-2.8.15/lib/packer.h.in
37--- cracklib-2.8.15/lib/packer.h.in 2009-12-01 15:15:38.000000000 -0500
38+++ cracklib-2.8.15/lib/packer.h.in 2009-12-01 15:15:38.000000000 -0500
39@@ -30,17 +30,8 @@
40 #define _(String) (String)
41 #endif
42
43-#if defined(HAVE_INTTYPES_H)
44-#include <inttypes.h>
45-#else
46-#if defined(HAVE_STDINT_H)
47-#include <stdint.h>
48-#else
49-typedef unsigned int uint32_t;
50-typedef unsigned short uint16_t;
51-#endif
52-#endif
53-
54+@CRACKLIB_INTEGER_TYPES1@
55+@CRACKLIB_INTEGER_TYPES2@
56
57 struct pi_header
58 {
59@@ -83,6 +74,9 @@ typedef struct {
60 int dummy;
61 } PWDICT;
62
63+@CRACKLIB_INTEGER_TYPES1@
64+@CRACKLIB_INTEGER_TYPES2@
65+
66 #endif
67
68 extern PWDICT *PWOpen(const char *prefix, char *mode);