From c70b1d12d141958c126a724d5e6b2a303876070d Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Thu, 29 Aug 2024 15:10:02 +0000 Subject: [PATCH 1/5] fix config.m4 --- config.m4 | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/config.m4 b/config.m4 index f1fcb05..1b1d407 100644 --- a/config.m4 +++ b/config.m4 @@ -12,40 +12,34 @@ if test "$PHP_XPASS" != "no"; then PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" - old_LDFLAGS=$LDFLAGS; LDFLAGS="$LIBXCRYPT_LIBS $LDFLAGS" + old_LIBS="$LIBS"; LIBS="$LIBXCRYPT_LIBS" AC_MSG_CHECKING([for yescrypt]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include -#include -#include - -int main(void) { - char salt[8]; - salt[0]='$'; salt[1]='y'; salt[2]='$'; salt[3]=0; - return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; -}]])],[ - AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ]) - AC_MSG_RESULT([available]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ + struct crypt_data data; + memset(&data, 0, sizeof(data)); + char *result = crypt_r("password", "$y$", &data); + return (result != NULL && strncmp(result, "$y$", 3) == 0) ? 0 : 1; + ]])], [ + AC_MSG_RESULT([available]) + AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [Define if libxcrypt supports SHA512]) ], [ - AC_MSG_RESULT([missing]) + AC_MSG_RESULT([missing]) ]) AC_MSG_CHECKING([for sha512 algo]) - AC_RUN_IFELSE([AC_LANG_SOURCE([[ -#include -#include -#include -#include -#include - -int main(void) { - char salt[8]; - salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]=0; - return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; -}]])],[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + ]], [[ + struct crypt_data data; + memset(&data, 0, sizeof(data)); + char *result = crypt_r("password", "$6$salt", &data); + return (result != NULL && strncmp(result, "$6$", 3) == 0) ? 0 : 1; + ]])],[ AC_DEFINE([HAVE_CRYPT_SHA512], [1], [ Have sha512 hash support ]) AC_MSG_RESULT([available]) ], [ From 726dadd2fba68a8629d0162597b1e28abd69f1a6 Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Thu, 29 Aug 2024 15:21:50 +0000 Subject: [PATCH 2/5] fix message --- config.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index 1b1d407..6e589a7 100644 --- a/config.m4 +++ b/config.m4 @@ -25,7 +25,7 @@ if test "$PHP_XPASS" != "no"; then return (result != NULL && strncmp(result, "$y$", 3) == 0) ? 0 : 1; ]])], [ AC_MSG_RESULT([available]) - AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [Define if libxcrypt supports SHA512]) + AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ]) ], [ AC_MSG_RESULT([missing]) ]) From 3a848daaef391a126a1ed732bee8dddd57e67a91 Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Fri, 30 Aug 2024 15:21:45 +0000 Subject: [PATCH 3/5] fix --- config.m4 | 50 ++++++++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/config.m4 b/config.m4 index 6e589a7..bb99429 100644 --- a/config.m4 +++ b/config.m4 @@ -12,34 +12,39 @@ if test "$PHP_XPASS" != "no"; then PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" - old_LIBS="$LIBS"; LIBS="$LIBXCRYPT_LIBS" + old_LDFLAGS=$LDFLAGS; LDFLAGS="$LIBXCRYPT_LIBS $LDFLAGS" + old_LIBS=$LIBS; LIBS="$LIBS $LIBXCRYPT_LIBS" AC_MSG_CHECKING([for yescrypt]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - struct crypt_data data; - memset(&data, 0, sizeof(data)); - char *result = crypt_r("password", "$y$", &data); - return (result != NULL && strncmp(result, "$y$", 3) == 0) ? 0 : 1; - ]])], [ - AC_MSG_RESULT([available]) - AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ]) + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include + +int main(void) { + char salt[8]; + salt[0]='$'; salt[1]='y'; salt[2]='$'; salt[3]=0; + return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; +}]])],[ + AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ]) + AC_MSG_RESULT([available]) ], [ - AC_MSG_RESULT([missing]) + AC_MSG_RESULT([missing]) ]) AC_MSG_CHECKING([for sha512 algo]) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - struct crypt_data data; - memset(&data, 0, sizeof(data)); - char *result = crypt_r("password", "$6$salt", &data); - return (result != NULL && strncmp(result, "$6$", 3) == 0) ? 0 : 1; - ]])],[ + AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +#include +#include +#include + +int main(void) { + char salt[8]; + salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]=0; + return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; +}]])],[ AC_DEFINE([HAVE_CRYPT_SHA512], [1], [ Have sha512 hash support ]) AC_MSG_RESULT([available]) ], [ @@ -48,6 +53,7 @@ if test "$PHP_XPASS" != "no"; then CFLAGS=$old_CFLAGS LDFLAGS=$old_LDFLAGS + LIBS=$old_LIBS PHP_SUBST([XPASS_SHARED_LIBADD]) From be9c7e66b2fed54e9676602497c109093aea520b Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Sat, 31 Aug 2024 16:59:30 +0900 Subject: [PATCH 4/5] fix twice option --- config.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.m4 b/config.m4 index bb99429..0fd41ef 100644 --- a/config.m4 +++ b/config.m4 @@ -12,7 +12,7 @@ if test "$PHP_XPASS" != "no"; then PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" - old_LDFLAGS=$LDFLAGS; LDFLAGS="$LIBXCRYPT_LIBS $LDFLAGS" + old_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS" old_LIBS=$LIBS; LIBS="$LIBS $LIBXCRYPT_LIBS" AC_MSG_CHECKING([for yescrypt]) From 42cf2242e6d66d05285fc7cc9f86eb283ce58f09 Mon Sep 17 00:00:00 2001 From: Go Kudo Date: Sun, 1 Sep 2024 20:06:35 +0900 Subject: [PATCH 5/5] fix unused LDFLAGS definition --- config.m4 | 2 -- 1 file changed, 2 deletions(-) diff --git a/config.m4 b/config.m4 index 0fd41ef..d73dcb7 100644 --- a/config.m4 +++ b/config.m4 @@ -12,7 +12,6 @@ if test "$PHP_XPASS" != "no"; then PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" - old_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS" old_LIBS=$LIBS; LIBS="$LIBS $LIBXCRYPT_LIBS" AC_MSG_CHECKING([for yescrypt]) @@ -52,7 +51,6 @@ int main(void) { ]) CFLAGS=$old_CFLAGS - LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS PHP_SUBST([XPASS_SHARED_LIBADD])