From 76e1b450542f66a4e3bf3acc289176318722f7cb Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 16 Sep 2011 19:57:12 -0400 Subject: [PATCH] Use PAM by default on AIX 6 and higher. Fix some square brackets in case statements that needed to be doubled up. While here, use $OSMAJOR when it makes sense. --HG-- branch : 1.7 --- configure | 34 ++++++++++++++++++---------------- configure.in | 34 ++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 32 deletions(-) diff --git a/configure b/configure index c4ef12bbb..21e0906d9 100755 --- a/configure +++ b/configure @@ -13756,9 +13756,14 @@ rm -f core conftest.err conftest.$ac_objext \ fi LDFLAGS="$O_LDFLAGS" - # Use authenticate(3) as the default authentication method - if test X"$with_aixauth" = X""; then - for ac_func in authenticate + # On AIX 6 and higher default to PAM, else default to LAM + if test $OSMAJOR -ge 6; then + if test X"$with_pam" = X""; then + AUTH_EXCL_DEF="PAM" + fi + else + if test X"$with_aixauth" = X""; then + for ac_func in authenticate do : ac_fn_c_check_func "$LINENO" "authenticate" "ac_cv_func_authenticate" if test "x$ac_cv_func_authenticate" = xyes; then : @@ -13769,6 +13774,7 @@ _ACEOF fi done + fi fi # AIX analog of nsswitch.conf, enabled by default @@ -13787,10 +13793,10 @@ fi with_netsvc="/etc/netsvc.conf" fi - # LDR_PRELOAD is supported in AIX 5.3 and later - case "$OSREV" in - 1-4.*) with_noexec=no ;; - esac + # LDR_PRELOAD is only supported in AIX 5.3 and later + if test $OSMAJOR -lt 5; then + with_noexec=no + fi # AIX-specific functions for ac_func in getuserattr setauthdb @@ -13844,7 +13850,7 @@ $as_echo "$sudo_cv_var_hpccbundled" >&6; } # Build PA-RISC1.1 objects for better portability case "$host_cpu" in - hppa2-9*) + hppa[2-9]*) _CFLAGS="$CFLAGS" if test -n "$GCC"; then portable_flag="-march=1.1" @@ -13888,7 +13894,7 @@ $as_echo "$sudo_cv_var_daportable" >&6; } esac case "$host" in - *-*-hpux1-8.*) + *-*-hpux[1-8].*) $as_echo "#define BROKEN_SYSLOG 1" >>confdefs.h @@ -14231,20 +14237,16 @@ done CHECKSHADOW="false" # OpenBSD >= 3.0 supports BSD auth if test -z "$with_bsdauth"; then - case "$OSREV" in - 0-2.*) - ;; - *) + if test "$OSMAJOR" -ge 3; then AUTH_EXCL_DEF="BSD_AUTH" - ;; - esac + fi fi : ${with_logincap='maybe'} ;; *-*-*netbsd*) # NetBSD has a real setreuid(2) starting with 1.3.2 case "$OSREV" in - 0.9*|1.012*|1.3|1.3.1) + 0.9*|1.[012]*|1.3|1.3.1) SKIP_SETREUID=yes ;; esac diff --git a/configure.in b/configure.in index 930821033..e3982583a 100644 --- a/configure.in +++ b/configure.in @@ -1492,9 +1492,15 @@ case "$host" in fi LDFLAGS="$O_LDFLAGS" - # Use authenticate(3) as the default authentication method - if test X"$with_aixauth" = X""; then - AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"]) + # On AIX 6 and higher default to PAM, else default to LAM + if test $OSMAJOR -ge 6; then + if test X"$with_pam" = X""; then + AUTH_EXCL_DEF="PAM" + fi + else + if test X"$with_aixauth" = X""; then + AC_CHECK_FUNCS(authenticate, [AUTH_EXCL_DEF="AIX_AUTH"]) + fi fi # AIX analog of nsswitch.conf, enabled by default @@ -1509,10 +1515,10 @@ case "$host" in with_netsvc="/etc/netsvc.conf" fi - # LDR_PRELOAD is supported in AIX 5.3 and later - case "$OSREV" in - [1-4].*) with_noexec=no ;; - esac + # LDR_PRELOAD is only supported in AIX 5.3 and later + if test $OSMAJOR -lt 5; then + with_noexec=no + fi # AIX-specific functions AC_CHECK_FUNCS(getuserattr setauthdb) @@ -1549,7 +1555,7 @@ case "$host" in # Build PA-RISC1.1 objects for better portability case "$host_cpu" in - hppa[2-9]*) + hppa[[2-9]]*) _CFLAGS="$CFLAGS" if test -n "$GCC"; then portable_flag="-march=1.1" @@ -1573,7 +1579,7 @@ case "$host" in esac case "$host" in - *-*-hpux[1-8].*) + *-*-hpux[[1-8]].*) AC_DEFINE(BROKEN_SYSLOG) # Not sure if setuid binaries are safe in < 9.x @@ -1795,20 +1801,16 @@ case "$host" in CHECKSHADOW="false" # OpenBSD >= 3.0 supports BSD auth if test -z "$with_bsdauth"; then - case "$OSREV" in - [0-2].*) - ;; - *) + if test "$OSMAJOR" -ge 3; then AUTH_EXCL_DEF="BSD_AUTH" - ;; - esac + fi fi : ${with_logincap='maybe'} ;; *-*-*netbsd*) # NetBSD has a real setreuid(2) starting with 1.3.2 case "$OSREV" in - 0.9*|1.[012]*|1.3|1.3.1) + 0.9*|1.[[012]]*|1.3|1.3.1) SKIP_SETREUID=yes ;; esac -- 2.40.0