https://github.com/openwall/john/pull/4908 https://bugs.gentoo.org/763828 From 7a843229dff28cf0851fe3130c74b38dfaf38411 Mon Sep 17 00:00:00 2001 From: Sam James Date: Fri, 3 Dec 2021 03:40:00 +0000 Subject: [PATCH 1/2] configure: check for 'strings' and respect $STRINGS variable It's possible to want a ${CHOST}-prefixed copy of strings, so add a check for 'strings' in configure.ac and respect $STRINGS within jtr_asm_magic. Signed-off-by: Sam James --- src/configure.ac | 1 + src/m4/jtr_asm_magic.m4 | 2 +- 3 files changed, 98 insertions(+), 2 deletions(-) diff --git a/src/configure.ac b/src/configure.ac index 53b6a62592..98b28be202 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -346,6 +346,7 @@ AS_IF([test -z "$AS"], [AS="$CC"]) AS_IF([test -z "$LD"], [LD="$CC"]) AS_IF([test -z "$AR"], [AC_CHECK_TOOL([AR], [ar])]) AS_IF([test -z "$STRIP"], [AC_CHECK_TOOL([STRIP], [strip])]) +AS_IF([test -z "$STRINGS"], [AC_CHECK_TOOL([STRINGS], [strings])]) dnl Check if we have this at all PKG_PROG_PKG_CONFIG diff --git a/src/m4/jtr_asm_magic.m4 b/src/m4/jtr_asm_magic.m4 index 469a944589..162736d855 100644 --- a/src/m4/jtr_asm_magic.m4 +++ b/src/m4/jtr_asm_magic.m4 @@ -19,7 +19,7 @@ EXTRA_AS_FLAGS= AC_MSG_CHECKING([for extra ASFLAGS]) CC="$CC_BACKUP" CFLAGS="$CFLAGS -O0" -AS_IF([echo "int long_ident;" > conftest.c && ${CC} -c conftest.c && strings - conftest.${OBJEXT} | ${GREP} _long_ident > conftest.out], +AS_IF([echo "int long_ident;" > conftest.c && ${CC} -c conftest.c && ${STRINGS} - conftest.${OBJEXT} | ${GREP} _long_ident > conftest.out], [JTR_LIST_ADD(EXTRA_AS_FLAGS, [-DUNDERSCORES])]) AC_LINK_IFELSE([AC_LANG_SOURCE( From 8c43ed0c2f7fdb793978d90306d6f6a118122e39 Mon Sep 17 00:00:00 2001 From: Sam James Date: Fri, 3 Dec 2021 03:46:44 +0000 Subject: [PATCH 2/2] configure: fix bashisms '==' isn't recognised by POSIX-compliant shells, so let's use = too. No functional change. Signed-off-by: Sam James --- src/configure.ac | 8 ++++---- src/m4/jtr_utility_macros.m4 | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) --- a/src/configure.ac +++ b/src/configure.ac @@ -339,7 +339,7 @@ AC_CACHE_SAVE AC_PATH_PROG([SORT], [sort]) AC_PATH_PROG([FIND], [find]) AC_PATH_PROG([PERL], [perl]) -if test "x$PERL" == x ; then +if test "x$PERL" = x ; then AC_MSG_FAILURE([No perl executable found]) fi AS_IF([test -z "$AS"], [AS="$CC"]) @@ -370,7 +370,7 @@ dnl to succeeed. dnl if ( test -e ../run/john.pot ) ; then AC_MSG_CHECKING([if potcheck.pl succeeds]) -if test "x$PERL" == x ; then +if test "x$PERL" = x ; then AC_MSG_RESULT([no Perl (unable to check)]) else $PERL ../run/potcheck.pl -validate < ../run/john.pot @@ -677,10 +677,10 @@ if test "x$enable_rexgen" != xno ; then AC_MSG_RESULT([TOO old. Rexgen not usable!]))] )] ) - if test "x$using_rexgen" == "xyes" ; then + if test "x$using_rexgen" = "xyes" ; then AC_DEFINE(HAVE_LIBREXGEN,1,[Define to 1 if you have the `rexgen' library (-lrexgen).]) else - if test "x$enable_rexgen" == "xyes" ; then + if test "x$enable_rexgen" = "xyes" ; then AC_MSG_FAILURE([rexgen not installed, or unusable version]) fi fi diff --git a/src/m4/jtr_utility_macros.m4 b/src/m4/jtr_utility_macros.m4 index 33501eeb71..6b5c58e2b7 100644 --- a/src/m4/jtr_utility_macros.m4 +++ b/src/m4/jtr_utility_macros.m4 @@ -189,11 +189,11 @@ dnl will be xno, xyes, xauto, etc. forced_fail_msg is a message that dnl will be output, and the script will abort, IF forced is xyes which dnl means the user used --enable-foobar AC_DEFUN([JTR_MSG_RESULT_FAILIF_FORCED], [ - if test "$1" == xyes; then + if test "$1" = xyes; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) - if test "$2" == xyes; then + if test "$2" = xyes; then AC_MSG_FAILURE([$3]) fi fi