Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/openpam/dist merge openpam ximenia



details:   https://anonhg.NetBSD.org/src/rev/646cb09c52a3
branches:  trunk
changeset: 377205:646cb09c52a3
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jun 30 21:46:20 2023 +0000

description:
merge openpam ximenia

diffstat:

 external/bsd/openpam/dist/bin/pamtest/pamtest.1                      |     6 +-
 external/bsd/openpam/dist/bin/pamtest/pamtest.c                      |     4 +-
 external/bsd/openpam/dist/bin/su/su.1                                |     6 +-
 external/bsd/openpam/dist/bin/su/su.c                                |     4 +-
 external/bsd/openpam/dist/config.guess                               |   665 ++-
 external/bsd/openpam/dist/config.sub                                 |  1692 ++++-----
 external/bsd/openpam/dist/doc/man/openpam.3                          |     7 +-
 external/bsd/openpam/dist/doc/man/openpam_borrow_cred.3              |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_free_data.3                |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_free_envlist.3             |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_get_feature.3              |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_get_option.3               |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_log.3                      |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_nullconv.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_readline.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_readlinev.3                |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_readword.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_restore_cred.3             |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_set_feature.3              |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_set_option.3               |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_straddch.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_subst.3                    |     5 +-
 external/bsd/openpam/dist/doc/man/openpam_ttyconv.3                  |     5 +-
 external/bsd/openpam/dist/doc/man/pam.3                              |     7 +-
 external/bsd/openpam/dist/doc/man/pam.conf.5                         |     6 +-
 external/bsd/openpam/dist/doc/man/pam_acct_mgmt.3                    |     5 +-
 external/bsd/openpam/dist/doc/man/pam_authenticate.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/pam_chauthtok.3                    |     5 +-
 external/bsd/openpam/dist/doc/man/pam_close_session.3                |     5 +-
 external/bsd/openpam/dist/doc/man/pam_conv.3                         |     6 +-
 external/bsd/openpam/dist/doc/man/pam_end.3                          |     5 +-
 external/bsd/openpam/dist/doc/man/pam_error.3                        |     5 +-
 external/bsd/openpam/dist/doc/man/pam_get_authtok.3                  |     5 +-
 external/bsd/openpam/dist/doc/man/pam_get_data.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_get_item.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_get_user.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_getenv.3                       |     5 +-
 external/bsd/openpam/dist/doc/man/pam_getenvlist.3                   |     5 +-
 external/bsd/openpam/dist/doc/man/pam_info.3                         |     5 +-
 external/bsd/openpam/dist/doc/man/pam_open_session.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/pam_prompt.3                       |     5 +-
 external/bsd/openpam/dist/doc/man/pam_putenv.3                       |     5 +-
 external/bsd/openpam/dist/doc/man/pam_set_data.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_set_item.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_setcred.3                      |     5 +-
 external/bsd/openpam/dist/doc/man/pam_setenv.3                       |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_acct_mgmt.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_authenticate.3              |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_chauthtok.3                 |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_close_session.3             |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_open_session.3              |     5 +-
 external/bsd/openpam/dist/doc/man/pam_sm_setcred.3                   |     5 +-
 external/bsd/openpam/dist/doc/man/pam_start.3                        |     5 +-
 external/bsd/openpam/dist/doc/man/pam_strerror.3                     |     5 +-
 external/bsd/openpam/dist/doc/man/pam_verror.3                       |     5 +-
 external/bsd/openpam/dist/doc/man/pam_vinfo.3                        |     5 +-
 external/bsd/openpam/dist/doc/man/pam_vprompt.3                      |     5 +-
 external/bsd/openpam/dist/include/security/openpam.h                 |     4 +-
 external/bsd/openpam/dist/include/security/openpam_attr.h            |     6 +-
 external/bsd/openpam/dist/include/security/openpam_version.h         |    10 +-
 external/bsd/openpam/dist/include/security/pam_appl.h                |     4 +-
 external/bsd/openpam/dist/include/security/pam_constants.h           |     4 +-
 external/bsd/openpam/dist/include/security/pam_modules.h             |     4 +-
 external/bsd/openpam/dist/include/security/pam_types.h               |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_asprintf.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_asprintf.h              |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_borrow_cred.c           |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_check_owner_perms.c     |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_configure.c             |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_constants.c             |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_constants.h             |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_cred.h                  |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_ctype.h                 |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_debug.h                 |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_dispatch.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_dlfunc.h                |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_dynamic.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_features.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_features.h              |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_findenv.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_free_data.c             |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_free_envlist.c          |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_get_feature.c           |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_get_option.c            |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_impl.h                  |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_load.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_log.c                   |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_nullconv.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_readline.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_readlinev.c             |     8 +-
 external/bsd/openpam/dist/lib/libpam/openpam_readword.c              |     7 +-
 external/bsd/openpam/dist/lib/libpam/openpam_restore_cred.c          |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_set_feature.c           |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_set_option.c            |     9 +-
 external/bsd/openpam/dist/lib/libpam/openpam_static.c                |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_straddch.c              |     8 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlcat.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlcat.h               |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlcmp.h               |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlcpy.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlcpy.h               |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlset.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_strlset.h               |     4 +-
 external/bsd/openpam/dist/lib/libpam/openpam_subst.c                 |    11 +-
 external/bsd/openpam/dist/lib/libpam/openpam_ttyconv.c               |    18 +-
 external/bsd/openpam/dist/lib/libpam/openpam_vasprintf.c             |     6 +-
 external/bsd/openpam/dist/lib/libpam/openpam_vasprintf.h             |     4 +-
 external/bsd/openpam/dist/lib/libpam/pam_acct_mgmt.c                 |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_authenticate.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_authenticate_secondary.c    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_chauthtok.c                 |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_close_session.c             |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_end.c                       |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_error.c                     |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_authtok.c               |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_data.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_item.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_mapped_authtok.c        |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_mapped_username.c       |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_get_user.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_getenv.c                    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_getenvlist.c                |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_info.c                      |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_open_session.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_prompt.c                    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_putenv.c                    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_set_data.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_set_item.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_set_mapped_authtok.c        |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_set_mapped_username.c       |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_setcred.c                   |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_setenv.c                    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_acct_mgmt.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_authenticate.c           |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_authenticate_secondary.c |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_chauthtok.c              |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_close_session.c          |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_get_mapped_authtok.c     |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_get_mapped_username.c    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_open_session.c           |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_set_mapped_authtok.c     |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_set_mapped_username.c    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_sm_setcred.c                |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_start.c                     |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_strerror.c                  |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_verror.c                    |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_vinfo.c                     |     6 +-
 external/bsd/openpam/dist/lib/libpam/pam_vprompt.c                   |     6 +-
 external/bsd/openpam/dist/misc/coverage.sh.in                        |    33 -
 external/bsd/openpam/dist/misc/gendoc.pl                             |     2 -
 external/bsd/openpam/dist/mkpkgng.in                                 |   177 -
 external/bsd/openpam/dist/modules/pam_deny/pam_deny.c                |     4 +-
 external/bsd/openpam/dist/modules/pam_permit/pam_permit.c            |     4 +-
 external/bsd/openpam/dist/modules/pam_unix/pam_unix.c                |     4 +-
 external/bsd/openpam/dist/t/t_openpam_readlinev.c                    |     2 -
 external/bsd/openpam/dist/t/t_openpam_readword.c                     |     2 -
 156 files changed, 1462 insertions(+), 1943 deletions(-)

diffs (truncated from 7358 to 300 lines):

diff -r 282742ce0387 -r 646cb09c52a3 external/bsd/openpam/dist/bin/pamtest/pamtest.1
--- a/external/bsd/openpam/dist/bin/pamtest/pamtest.1   Fri Jun 30 21:44:22 2023 +0000
+++ b/external/bsd/openpam/dist/bin/pamtest/pamtest.1   Fri Jun 30 21:46:20 2023 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pamtest.1,v 1.9 2019/12/15 17:08:21 christos Exp $
+.\"    $NetBSD: pamtest.1,v 1.10 2023/06/30 21:46:20 christos Exp $
 .\"
 .\"-
 .\" Copyright (c) 2011-2017 Dag-Erling Smørgrav
@@ -28,9 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $OpenPAM: pamtest.1 947 2019-02-24 20:18:17Z des $
-.\"
-.Dd February 24, 2019
+.Dd June 27, 2023
 .Dt PAMTEST 1
 .Os
 .Sh NAME
diff -r 282742ce0387 -r 646cb09c52a3 external/bsd/openpam/dist/bin/pamtest/pamtest.c
--- a/external/bsd/openpam/dist/bin/pamtest/pamtest.c   Fri Jun 30 21:44:22 2023 +0000
+++ b/external/bsd/openpam/dist/bin/pamtest/pamtest.c   Fri Jun 30 21:46:20 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pamtest.c,v 1.7 2017/05/06 19:50:09 christos Exp $     */
+/*     $NetBSD: pamtest.c,v 1.8 2023/06/30 21:46:20 christos Exp $     */
 
 /*-
  * Copyright (c) 2011 Dag-Erling Smørgrav
@@ -27,8 +27,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $OpenPAM: pamtest.c 938 2017-04-30 21:34:42Z des $
  */
 
 #ifdef HAVE_CONFIG_H
diff -r 282742ce0387 -r 646cb09c52a3 external/bsd/openpam/dist/bin/su/su.1
--- a/external/bsd/openpam/dist/bin/su/su.1     Fri Jun 30 21:44:22 2023 +0000
+++ b/external/bsd/openpam/dist/bin/su/su.1     Fri Jun 30 21:46:20 2023 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: su.1,v 1.9 2019/12/15 17:08:21 christos Exp $
+.\"    $NetBSD: su.1,v 1.10 2023/06/30 21:46:20 christos Exp $
 .\"
 .\"-
 .\" Copyright (c) 2011-2017 Dag-Erling Smørgrav
@@ -28,9 +28,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.\" $OpenPAM: su.1 947 2019-02-24 20:18:17Z des $
-.\"
-.Dd February 24, 2019
+.Dd June 27, 2023
 .Dt SU 1
 .Os
 .Sh NAME
diff -r 282742ce0387 -r 646cb09c52a3 external/bsd/openpam/dist/bin/su/su.c
--- a/external/bsd/openpam/dist/bin/su/su.c     Fri Jun 30 21:44:22 2023 +0000
+++ b/external/bsd/openpam/dist/bin/su/su.c     Fri Jun 30 21:46:20 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: su.c,v 1.7 2017/05/06 19:50:09 christos Exp $  */
+/*     $NetBSD: su.c,v 1.8 2023/06/30 21:46:20 christos Exp $  */
 
 /*-
  * Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -33,8 +33,6 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $OpenPAM: su.c 938 2017-04-30 21:34:42Z des $
  */
 
 #ifdef HAVE_CONFIG_H
diff -r 282742ce0387 -r 646cb09c52a3 external/bsd/openpam/dist/config.guess
--- a/external/bsd/openpam/dist/config.guess    Fri Jun 30 21:44:22 2023 +0000
+++ b/external/bsd/openpam/dist/config.guess    Fri Jun 30 21:46:20 2023 +0000
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2017 Free Software Foundation, Inc.
+#   Copyright 1992-2018 Free Software Foundation, Inc.
 
-timestamp='2017-01-01'
+timestamp='2018-08-29'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2017-01-01'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,7 +27,7 @@ timestamp='2017-01-01'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 #
 # Please send patches to <config-patches%gnu.org@localhost>.
 
@@ -39,7 +39,7 @@ Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2017 Free Software Foundation, Inc.
+Copyright 1992-2018 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,34 +94,39 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 1 2 13 15
+trap 'exitcode=$?; test -z "$tmp" || rm -fr "$tmp"; exit $exitcode' 0
+
+set_cc_for_build() {
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+       { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      break
+                  fi
+              done
+              if test x"$CC_FOR_BUILD" = x ; then
+                  CC_FOR_BUILD=no_compiler_found
+              fi
+              ;;
+       ,,*)   CC_FOR_BUILD=$CC ;;
+       ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi%noc.rutgers.edu@localhost 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
@@ -132,14 +135,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case "$UNAME_SYSTEM" in
 Linux|GNU|GNU/*)
        # If the system lacks a compiler, then just pick glibc.
        # We could probably try harder.
        LIBC=gnu
 
-       eval $set_cc_for_build
-       cat <<-EOF > $dummy.c
+       set_cc_for_build
+       cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
        LIBC=uclibc
@@ -149,13 +152,20 @@ Linux|GNU|GNU/*)
        LIBC=gnu
        #endif
        EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
+
+       # If ldd exists, use it to detect musl libc.
+       if command -v ldd >/dev/null && \
+               ldd --version 2>&1 | grep -q ^musl
+       then
+           LIBC=musl
+       fi
        ;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -169,31 +179,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
        # portion of the name.  We always set it to "unknown".
        sysctl="sysctl -n hw.machine_arch"
        UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-           /sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || \
+           "/sbin/$sysctl" 2>/dev/null || \
+           "/usr/sbin/$sysctl" 2>/dev/null || \
            echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
-           aarch64eb) machine=aarch64_be-unknown ;;
+       case "$UNAME_MACHINE_ARCH" in
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-               machine=${arch}${endian}-unknown
+               arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine="${arch}${endian}"-unknown
                ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -209,10 +218,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
                ;;
        esac
        # Determine ABI tags.
-       case "${UNAME_MACHINE_ARCH}" in
+       case "$UNAME_MACHINE_ARCH" in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
                ;;
        esac
        # The OS release
@@ -220,46 +229,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in



Home | Main Index | Thread Index | Old Index