xref: /OK3568_Linux_fs/buildroot/package/linux-pam/0001-configure-test-a-o-is-not-POSIX.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 7c54428db5b639f05093459b1ba3b77456c5a548 Mon Sep 17 00:00:00 2001
2From: "Issam E. Maghni" <issam.e.maghni@mailbox.org>
3Date: Wed, 16 Dec 2020 18:48:28 -0500
4Subject: [PATCH] configure: test -a|o is not POSIX
5
6Fixes `test: too many arguments` when building Linux-PAM using sbase.
7This is due to a non-POSIX syntax test ... -a ... and test ... -o ....
8
9> The XSI extensions specifying the -a and -o binary primaries and the
10> '(' and ')' operators have been marked obsolescent.
11
12See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
13
14[Retrieved from:
15https://github.com/linux-pam/linux-pam/commit/7c54428db5b639f05093459b1ba3b77456c5a548]
16Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
17---
18 configure.ac | 12 ++++++------
19 1 file changed, 6 insertions(+), 6 deletions(-)
20
21diff --git a/configure.ac b/configure.ac
22index 5eade7cd3..e325bdd3c 100644
23--- a/configure.ac
24+++ b/configure.ac
25@@ -346,7 +346,7 @@ if test x"$WITH_LIBAUDIT" != xno ; then
26 			     [HAVE_AUDIT_TTY_STATUS=""],
27 			     [#include <libaudit.h>])]
28         )
29-        if test -n "$LIBAUDIT" -a "$ac_cv_header_libaudit_h" != "no" ; then
30+        if test -n "$LIBAUDIT" && test "$ac_cv_header_libaudit_h" != "no" ; then
31             AC_DEFINE([HAVE_LIBAUDIT], 1, [Define to 1 if audit support should be compiled in.])
32         fi
33         if test -n "$HAVE_AUDIT_TTY_STATUS" ; then
34@@ -373,12 +373,12 @@ esac
35 AC_CHECK_FUNCS(crypt_r crypt_gensalt_r)
36 LIBS=$BACKUP_LIBS
37 AC_SUBST(LIBCRYPT)
38-if test "$LIBCRYPT" = "-lxcrypt" -a "$ac_cv_header_xcrypt_h" = "yes" ; then
39+if test "$LIBCRYPT" = "-lxcrypt" && test "$ac_cv_header_xcrypt_h" = "yes" ; then
40 	AC_DEFINE([HAVE_LIBXCRYPT], 1, [Define to 1 if xcrypt support should be compiled in.])
41 fi
42
43 AC_ARG_WITH([randomdev], AS_HELP_STRING([--with-randomdev=(<path>|yes|no)],[use specified random device instead of /dev/urandom or 'no' to disable]), opt_randomdev=$withval)
44-if test "$opt_randomdev" = yes -o -z "$opt_randomdev"; then
45+if test "$opt_randomdev" = yes || test -z "$opt_randomdev"; then
46        opt_randomdev="/dev/urandom"
47 elif test "$opt_randomdev" = no; then
48        opt_randomdev=
49@@ -395,7 +395,7 @@ AC_ARG_ENABLE([db],
50 AC_ARG_WITH([db-uniquename],
51 	AS_HELP_STRING([--with-db-uniquename=extension],[Unique name for db libraries and functions.]))
52 if test x"$WITH_DB" != xno ; then
53-        if test x"$WITH_DB" = xyes -o x"$WITH_DB" = xdb ; then
54+        if test x"$WITH_DB" = xyes || test x"$WITH_DB" = xdb ; then
55               old_libs=$LIBS
56               LIBS="$LIBS -ldb$with_db_uniquename"
57               AC_CHECK_FUNCS([db_create$with_db_uniquename db_create dbm_store$with_db_uniquename dbm_store],
58@@ -572,7 +572,7 @@ fi
59
60 AC_PATH_PROG([FO2PDF], [fop])
61
62-AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_docu != xno -a x$enable_doc != xno)
63+AM_CONDITIONAL(ENABLE_REGENERATE_MAN, test x$enable_docu != xno && test x$enable_doc != xno)
64 AM_CONDITIONAL(ENABLE_GENERATE_PDF, test -n "$FO2PDF")
65
66
67@@ -625,7 +625,7 @@ esac
68 AM_CONDITIONAL([COND_BUILD_PAM_KEYINIT], [test "$have_key_syscalls" = 1])
69 AM_CONDITIONAL([COND_BUILD_PAM_LASTLOG], [test "$ac_cv_func_logwtmp" = yes])
70 AM_CONDITIONAL([COND_BUILD_PAM_NAMESPACE], [test "$ac_cv_func_unshare" = yes])
71-AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes -o "$ac_cv_func_ruserok" = yes])
72+AM_CONDITIONAL([COND_BUILD_PAM_RHOSTS], [test "$ac_cv_func_ruserok_af" = yes || test "$ac_cv_func_ruserok" = yes])
73 AM_CONDITIONAL([COND_BUILD_PAM_SELINUX], [test -n "$LIBSELINUX"])
74 AM_CONDITIONAL([COND_BUILD_PAM_SEPERMIT], [test -n "$LIBSELINUX"])
75 AM_CONDITIONAL([COND_BUILD_PAM_SETQUOTA], [test "$ac_cv_func_quotactl" = yes])
76