Skip to content

Commit

Permalink
Support PHP 7.x and 8.x and drop internal libcrack library
Browse files Browse the repository at this point in the history
Recent cracklib versions have different dictionary format
from what the internal libcrack	code have been using. Drop the
internal libcrack copy and link to the external cracklib.

Add support for	PHP 7.x and 8.x and drop support for PHP 4.x and
5.x at the same	time.

Dropped the notion of a "default open dictionary" which was always
the last opened one and just complicated things. Instead, made the
argument to crack_opendict() optional so the global configuration
"crack.default_dictionary" can be used.

Reordered the arguments to crack_check() so the dictionary
resource became the first argument and mandatory.

Signed-off-by: Zoltán Böszörményi <[email protected]>
  • Loading branch information
zboszor committed Mar 26, 2022
1 parent f7e0287 commit 1433d53
Show file tree
Hide file tree
Showing 22 changed files with 129 additions and 3,065 deletions.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
*~
Makefile
Makefile.fragments
Makefile.objects
autom4te.cache
build
config.h
config.h.in
config.log
config.nice
config.status
configure
configure.ac
libtool
run-tests.php
modules/
.libs
*.la
*.lo

tests/*.diff
tests/*.exp
tests/*.log
tests/*.out
tests/*.php
tests/*.sh
17 changes: 1 addition & 16 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ PHP_ARG_WITH(crack, for cracklib support,

if test "$PHP_CRACK" != "no"; then

if test "$PHP_CRACK" != "yes"; then
AC_MSG_ERROR(Only the bundled library is supported right now)

for i in $PHP_CRACK/lib $PHP_CRACK/cracklib /usr/local/lib /usr/lib; do
test -f $i/libcrack.$SHLIB_SUFFIX_NAME -o -f $i/libcrack.a && CRACK_LIBDIR=$i && break
done
Expand All @@ -33,17 +30,5 @@ if test "$PHP_CRACK" != "no"; then
PHP_SUBST(CRACK_SHARED_LIBADD)
AC_DEFINE(HAVE_CRACK, 1, [ Define to 1 if we are building with the crack library. ])
AC_DEFINE(HAVE_CRACK_BUNDLED, 0, [ Define to 1 to build against the bundled crack library. ])
else
# use bundled library
PHP_CRACK_CFLAGS="-I@ext_srcdir@/libcrack/include"

sources="libcrack/src/fascist.c libcrack/src/packlib.c libcrack/src/rules.c"

PHP_NEW_EXTENSION(crack, crack.c $sources, $ext_shared, , $PHP_CRACK_CFLAGS)
AC_DEFINE(HAVE_CRACK, 1, [ Define to 1 if we are building with the crack library. ])
AC_DEFINE(HAVE_CRACK_BUNDLED, 1, [ Define to 1 to build against the bundled crack library. ])

PHP_ADD_BUILD_DIR($ext_builddir/libcrack)
PHP_ADD_BUILD_DIR($ext_builddir/libcrack/src)
fi

fi
Loading

0 comments on commit 1433d53

Please sign in to comment.