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