|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56611 Extension fails to load dictionaries on 64bit systems
Submitted: 2005-10-24 07:20 UTC Modified: 2008-07-17 06:14 UTC
From: Assigned: skettler (profile)
Status: Closed Package: crack (PECL)
PHP Version: 5_1 CVS-2005-10-24 (dev) OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-10-24 07:20 UTC]
Tere is a 32/64 bit size problem on AMD 64 systems.

The version of cracklib bundled in the pecl package improperly defines the following types in libcrack/src/cracklib.h:47:

typedef unsigned char int8;
typedef unsigned short int int16;
typedef unsigned long int32;

This results in int32 being 64 bits on an x86-64 machine because longs are 8 bytes long.  I changed this to:

typedef unsigned char int8;
typedef unsigned short int int16;
typedef unsigned int int32;

So that int32 is now actually 32 bits long.

It looks like the upstream version of crack does not suffer from these problems; it contains the following, which would work as well:

typedef u_int8_t int8;
typedef u_int16_t int16;
typedef u_int32_t int32;

Which are defined in sys/types.h.

I came across this problem becuase the pecl version of crack could not read the magic number at the beginning of the dictionary that I had created with the Debian version of crack_mkdict (I kept on receiving "magic mismatch" errors).


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-10-31 17:02 UTC]
Fixed in current CVS, but additional cross-platform tests needed before releasing new version.
 [2006-08-04 14:38 UTC] gersonsm at gmail dot com
Must copy libcrack/src/packlib.c together.
 [2006-08-11 00:22 UTC] james at advmm dot com
Same issue experienced on Intel x86_64 system (running FC5).
Fixed as above by replacing:

typedef unsigned long int int32;


typedef unsigned int int32;

in libcrack/src/cracklib.h, before installing extension (installed manually - '# pecl install crack' failed).
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Sep 27 23:03:36 2021 UTC