From 12ee8e241eb38308be8c1e4dd57ac7d8c02f3297 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 17 Mar 2005 13:37:04 -0800 Subject: - (tim) [configure.ac] Bug 998. Make path for --with-opensc optional. Make --without-opensc work. --- configure.ac | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index e48028b7b..c23094777 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.250 2005/03/07 09:21:37 tim Exp $ +# $Id: configure.ac,v 1.251 2005/03/17 21:37:04 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -2324,23 +2324,28 @@ AC_ARG_WITH(sectok, ) # Check whether user wants OpenSC support +OPENSC_CONFIG="no" AC_ARG_WITH(opensc, - AC_HELP_STRING([--with-opensc=PFX], - [Enable smartcard support using OpenSC]), - opensc_config_prefix="$withval", opensc_config_prefix="") -if test x$opensc_config_prefix != x ; then - OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config - AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) - if test "$OPENSC_CONFIG" != "no"; then - LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` - LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` - CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" - LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" - AC_DEFINE(SMARTCARD) - AC_DEFINE(USE_OPENSC) - SCARD_MSG="yes, using OpenSC" - fi -fi + [--with-opensc[[=PFX]] Enable smartcard support using OpenSC (optionally in PATH)], + [ + if test "x$withval" != "xno" ; then + if test "x$withval" != "xyes" ; then + OPENSC_CONFIG=$withval/bin/opensc-config + else + AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no) + fi + if test "$OPENSC_CONFIG" != "no"; then + LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags` + LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` + CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" + LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" + AC_DEFINE(SMARTCARD) + AC_DEFINE(USE_OPENSC) + SCARD_MSG="yes, using OpenSC" + fi + fi + ] +) # Check libraries needed by DNS fingerprint support AC_SEARCH_LIBS(getrrsetbyname, resolv, -- cgit v1.2.3 From 8bb561b5009dec1a763b6978aebbb26323982219 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 17 Mar 2005 16:23:19 -0800 Subject: - (tim) [configure.ac] portability changes on test statements. Some shells have problems with -a operator. --- ChangeLog | 4 +++- configure.ac | 23 +++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index def867ebc..b508e8b77 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20050317 - (tim) [configure.ac] Bug 998. Make path for --with-opensc optional. Make --without-opensc work. + - (tim) [configure.ac] portability changes on test statements. Some shells + have problems with -a operator. 20050314 - (dtucker) OpenBSD CVS Sync @@ -2368,4 +2370,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3721 2005/03/17 21:37:04 tim Exp $ +$Id: ChangeLog,v 1.3722 2005/03/18 00:23:19 tim Exp $ diff --git a/configure.ac b/configure.ac index c23094777..ca41ecc77 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.251 2005/03/17 21:37:04 tim Exp $ +# $Id: configure.ac,v 1.252 2005/03/18 00:23:19 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -794,7 +794,8 @@ AC_ARG_WITH(tcp-wrappers, saved_LIBS="$LIBS" saved_LDFLAGS="$LDFLAGS" saved_CPPFLAGS="$CPPFLAGS" - if test -n "${withval}" -a "${withval}" != "yes"; then + if test -n "${withval}" && \ + test "${withval}" != "yes"; then if test -d "${withval}/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" @@ -1090,7 +1091,8 @@ main() ) fi -if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then +if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ + test "x$check_for_hpux_broken_getaddrinfo" = "x1"; then AC_MSG_CHECKING(if getaddrinfo seems to work) AC_TRY_RUN( [ @@ -1158,7 +1160,8 @@ main(void) ) fi -if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_aix_broken_getaddrinfo" = "x1"; then +if test "x$ac_cv_func_getaddrinfo" = "xyes" && \ + test "x$check_for_aix_broken_getaddrinfo" = "x1"; then AC_MSG_CHECKING(if getaddrinfo seems to work) AC_TRY_RUN( [ @@ -1492,7 +1495,7 @@ AC_ARG_WITH(rand-helper, ) # Which randomness source do we use? -if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then +if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then # OpenSSL only AC_DEFINE(OPENSSL_PRNG_ONLY) RAND_MSG="OpenSSL internal ONLY" @@ -2030,9 +2033,9 @@ fi AC_CHECK_TYPES(struct timespec) # We need int64_t or else certian parts of the compile will fail. -if test "x$ac_cv_have_int64_t" = "xno" -a \ - "x$ac_cv_sizeof_long_int" != "x8" -a \ - "x$ac_cv_sizeof_long_long_int" = "x0" ; then +if test "x$ac_cv_have_int64_t" = "xno" && \ + test "x$ac_cv_sizeof_long_int" != "x8" && \ + test "x$ac_cv_sizeof_long_long_int" = "x0" ; then echo "OpenSSH requires int64_t support. Contact your vendor or install" echo "an alternative compiler (I.E., GCC) before continuing." echo "" @@ -2682,8 +2685,8 @@ if test "x$etc_default_login" != "xno"; then fi dnl BSD systems use /etc/login.conf so --with-default-path= has no effect -if test $ac_cv_func_login_getcapbool = "yes" -a \ - $ac_cv_header_login_cap_h = "yes" ; then +if test $ac_cv_func_login_getcapbool = "yes" && \ + test $ac_cv_header_login_cap_h = "yes" ; then external_path_file=/etc/login.conf fi -- cgit v1.2.3 From 35cc69dcb49394f8ce5950e42adc90866901256d Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 17 Mar 2005 16:44:25 -0800 Subject: - (tim) [configure.ac] make some configure options a little more error proof. --- ChangeLog | 3 ++- configure.ac | 36 +++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index b508e8b77..d4e5eee29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Make --without-opensc work. - (tim) [configure.ac] portability changes on test statements. Some shells have problems with -a operator. + - (tim) [configure.ac] make some configure options a little more error proof. 20050314 - (dtucker) OpenBSD CVS Sync @@ -2370,4 +2371,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3722 2005/03/18 00:23:19 tim Exp $ +$Id: ChangeLog,v 1.3723 2005/03/18 00:44:25 tim Exp $ diff --git a/configure.ac b/configure.ac index ca41ecc77..b3f7b5f22 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.252 2005/03/18 00:23:19 tim Exp $ +# $Id: configure.ac,v 1.253 2005/03/18 00:44:26 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -472,7 +472,8 @@ esac AC_ARG_WITH(cflags, [ --with-cflags Specify additional flags to pass to compiler], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then CFLAGS="$CFLAGS $withval" fi ] @@ -480,7 +481,8 @@ AC_ARG_WITH(cflags, AC_ARG_WITH(cppflags, [ --with-cppflags Specify additional flags to pass to preprocessor] , [ - if test "x$withval" != "xno"; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then CPPFLAGS="$CPPFLAGS $withval" fi ] @@ -488,7 +490,8 @@ AC_ARG_WITH(cppflags, AC_ARG_WITH(ldflags, [ --with-ldflags Specify additional flags to pass to linker], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then LDFLAGS="$LDFLAGS $withval" fi ] @@ -496,7 +499,8 @@ AC_ARG_WITH(ldflags, AC_ARG_WITH(libs, [ --with-libs Specify additional libraries to link with], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then LIBS="$LIBS $withval" fi ] @@ -795,7 +799,7 @@ AC_ARG_WITH(tcp-wrappers, saved_LDFLAGS="$LDFLAGS" saved_CPPFLAGS="$CPPFLAGS" if test -n "${withval}" && \ - test "${withval}" != "yes"; then + test "x${withval}" != "xyes"; then if test -d "${withval}/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" @@ -1585,7 +1589,8 @@ entropy_timeout=200 AC_ARG_WITH(entropy-timeout, [ --with-entropy-timeout Specify entropy gathering command timeout (msec)], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then entropy_timeout=$withval fi ] @@ -1596,7 +1601,8 @@ SSH_PRIVSEP_USER=sshd AC_ARG_WITH(privsep-user, [ --with-privsep-user=user Specify non-privileged user for privilege separation], [ - if test -n "$withval"; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then SSH_PRIVSEP_USER=$withval fi ] @@ -2490,7 +2496,8 @@ PRIVSEP_PATH=/var/empty AC_ARG_WITH(privsep-path, [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], [ - if test "x$withval" != "$no" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then PRIVSEP_PATH=$withval fi ] @@ -2500,7 +2507,8 @@ AC_SUBST(PRIVSEP_PATH) AC_ARG_WITH(xauth, [ --with-xauth=PATH Specify path to xauth program ], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then xauth_path=$withval fi ], @@ -2781,7 +2789,8 @@ fi AC_ARG_WITH(superuser-path, [ --with-superuser-path= Specify different path for super-user], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval") superuser_path=$withval fi @@ -2837,7 +2846,8 @@ fi AC_ARG_WITH(pid-dir, [ --with-pid-dir=PATH Specify location of ssh.pid file], [ - if test "x$withval" != "xno" ; then + if test -n "$withval" && test "x$withval" != "xno" && \ + test "x${withval}" != "xyes"; then piddir=$withval if test ! -d $piddir ; then AC_MSG_WARN([** no $piddir directory on this system **]) @@ -2919,7 +2929,7 @@ AC_ARG_WITH(lastlog, [ if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_LASTLOG) - else + elif test -n "$withval" && test "x${withval}" != "xyes"; then conf_lastlog_location=$withval fi ] -- cgit v1.2.3 From eae17cc80ec1083a06eaa062547b926d01b91798 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 17 Mar 2005 16:52:20 -0800 Subject: - (tim) [configure.ac] remove trailing white space. --- ChangeLog | 3 ++- configure.ac | 60 ++++++++++++++++++++++++++++++------------------------------ 2 files changed, 32 insertions(+), 31 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index d4e5eee29..e3e8e13f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - (tim) [configure.ac] portability changes on test statements. Some shells have problems with -a operator. - (tim) [configure.ac] make some configure options a little more error proof. + - (tim) [configure.ac] remove trailing white space. 20050314 - (dtucker) OpenBSD CVS Sync @@ -2371,4 +2372,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3723 2005/03/18 00:44:25 tim Exp $ +$Id: ChangeLog,v 1.3724 2005/03/18 00:52:20 tim Exp $ diff --git a/configure.ac b/configure.ac index b3f7b5f22..9dce893a1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.253 2005/03/18 00:44:26 tim Exp $ +# $Id: configure.ac,v 1.254 2005/03/18 00:52:21 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -75,7 +75,7 @@ if test -z "$LD" ; then LD=$CC fi AC_SUBST(LD) - + AC_C_INLINE if test "$GCC" = "yes" || test "$GCC" = "egcs"; then CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" @@ -84,7 +84,7 @@ fi AC_ARG_WITH(rpath, [ --without-rpath Disable auto-added -R linker paths], [ - if test "x$withval" = "xno" ; then + if test "x$withval" = "xno" ; then need_dash_r="" fi if test "x$withval" = "xyes" ; then @@ -274,7 +274,7 @@ mips-sony-bsd|mips-sony-newsos4) ;; *-*-netbsd*) check_for_libcrypt_before=1 - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then need_dash_r=1 fi ;; @@ -297,7 +297,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(BROKEN_SAVED_UIDS) ;; *-*-solaris*) - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then need_dash_r=1 fi AC_DEFINE(PAM_SUN_CODEBASE) @@ -476,7 +476,7 @@ AC_ARG_WITH(cflags, test "x${withval}" != "xyes"; then CFLAGS="$CFLAGS $withval" fi - ] + ] ) AC_ARG_WITH(cppflags, [ --with-cppflags Specify additional flags to pass to preprocessor] , @@ -494,7 +494,7 @@ AC_ARG_WITH(ldflags, test "x${withval}" != "xyes"; then LDFLAGS="$LDFLAGS $withval" fi - ] + ] ) AC_ARG_WITH(libs, [ --with-libs Specify additional libraries to link with], @@ -503,7 +503,7 @@ AC_ARG_WITH(libs, test "x${withval}" != "xyes"; then LIBS="$LIBS $withval" fi - ] + ] ) AC_MSG_CHECKING(compiler and flags for sanity) @@ -734,7 +734,7 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} AC_MSG_RESULT(no) AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) ], - [ + [ AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME]) AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME) ] @@ -763,7 +763,7 @@ AC_ARG_WITH(skey, AC_DEFINE(SKEY) LIBS="-lskey $LIBS" SKEY_MSG="yes" - + AC_MSG_CHECKING([for s/key support]) AC_TRY_RUN( [ @@ -1474,7 +1474,7 @@ int main(void) { exit(RAND_status() == 1 ? 0 : 1); } [ AC_MSG_WARN([cross compiling: assuming yes]) # This is safe, since all recent OpenSSL versions will - # complain at runtime if not seeded correctly. + # complain at runtime if not seeded correctly. OPENSSL_SEEDS_ITSELF=yes ] ) @@ -1496,7 +1496,7 @@ AC_ARG_WITH(rand-helper, USE_RAND_HELPER=yes fi ], -) +) # Which randomness source do we use? if test ! -z "$OPENSSL_SEEDS_ITSELF" && test -z "$USE_RAND_HELPER" ; then @@ -1593,7 +1593,7 @@ AC_ARG_WITH(entropy-timeout, test "x${withval}" != "xyes"; then entropy_timeout=$withval fi - ] + ] ) AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout) @@ -1605,7 +1605,7 @@ AC_ARG_WITH(privsep-user, test "x${withval}" != "xyes"; then SSH_PRIVSEP_USER=$withval fi - ] + ] ) AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER") AC_SUBST(SSH_PRIVSEP_USER) @@ -2437,7 +2437,7 @@ AC_ARG_WITH(kerberos5, AC_DEFINE(HEIMDAL) K5LIBS="-lkrb5 -ldes" K5LIBS="$K5LIBS -lcom_err -lasn1" - AC_CHECK_LIB(roken, net_write, + AC_CHECK_LIB(roken, net_write, [K5LIBS="$K5LIBS -lroken"]) ], [ AC_MSG_RESULT(no) @@ -2456,7 +2456,7 @@ AC_ARG_WITH(kerberos5, $K5LIBS) ], $K5LIBS) - + AC_CHECK_HEADER(gssapi.h, , [ unset ac_cv_header_gssapi_h CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi" @@ -2626,7 +2626,7 @@ AC_ARG_WITH(md5-passwords, AC_ARG_WITH(shadow, [ --without-shadow Disable shadow password support], [ - if test "x$withval" = "xno" ; then + if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_SHADOW) disable_shadow=yes fi @@ -2661,7 +2661,7 @@ else AC_ARG_WITH(ipaddr-display, [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then AC_DEFINE(IPADDR_IN_DISPLAY) DISPLAY_HACK_MSG="yes" fi @@ -2707,7 +2707,7 @@ AC_ARG_WITH(default-path, AC_MSG_WARN([ --with-default-path=PATH has no effect on this system. Edit /etc/login.conf instead.]) - elif test "x$withval" != "xno" ; then + elif test "x$withval" != "xno" ; then if test ! -z "$external_path_file" ; then AC_MSG_WARN([ --with-default-path=PATH will only be used if PATH is not defined in @@ -2748,11 +2748,11 @@ main() { FILE *fd; int rc; - + fd = fopen(DATA,"w"); if(fd == NULL) exit(1); - + if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0) exit(1); @@ -2826,7 +2826,7 @@ BSD_AUTH_MSG=no AC_ARG_WITH(bsd-auth, [ --with-bsd-auth Enable BSD auth support], [ - if test "x$withval" != "xno" ; then + if test "x$withval" != "xno" ; then AC_DEFINE(BSD_AUTH) BSD_AUTH_MSG=yes fi @@ -2836,7 +2836,7 @@ AC_ARG_WITH(bsd-auth, # Where to place sshd.pid piddir=/var/run # make sure the directory exists -if test ! -d $piddir ; then +if test ! -d $piddir ; then piddir=`eval echo ${sysconfdir}` case $piddir in NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;; @@ -2849,7 +2849,7 @@ AC_ARG_WITH(pid-dir, if test -n "$withval" && test "x$withval" != "xno" && \ test "x${withval}" != "xyes"; then piddir=$withval - if test ! -d $piddir ; then + if test ! -d $piddir ; then AC_MSG_WARN([** no $piddir directory on this system **]) fi fi @@ -2927,7 +2927,7 @@ AC_ARG_ENABLE(pututxline, AC_ARG_WITH(lastlog, [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], [ - if test "x$withval" = "xno" ; then + if test "x$withval" = "xno" ; then AC_DEFINE(DISABLE_LASTLOG) elif test -n "$withval" && test "x${withval}" != "xyes"; then conf_lastlog_location=$withval @@ -2996,7 +2996,7 @@ fi if test -n "$conf_lastlog_location"; then AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location") -fi +fi dnl utmp detection AC_MSG_CHECKING([if your system defines UTMP_FILE]) @@ -3026,7 +3026,7 @@ if test -z "$conf_utmp_location"; then fi if test -n "$conf_utmp_location"; then AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location") -fi +fi dnl wtmp detection AC_MSG_CHECKING([if your system defines WTMP_FILE]) @@ -3056,7 +3056,7 @@ if test -z "$conf_wtmp_location"; then fi if test -n "$conf_wtmp_location"; then AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location") -fi +fi dnl utmpx detection - I don't know any system so perverse as to require @@ -3084,7 +3084,7 @@ if test -z "$conf_utmpx_location"; then fi else AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location") -fi +fi dnl wtmpx detection AC_MSG_CHECKING([if your system defines WTMPX_FILE]) @@ -3109,7 +3109,7 @@ if test -z "$conf_wtmpx_location"; then fi else AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location") -fi +fi if test ! -z "$blibpath" ; then -- cgit v1.2.3 From 86a5f8dd0afd10c8b844c81b04b436dd2bb852a3 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 21 Mar 2005 09:55:17 +1100 Subject: - (dtucker) [configure.ac] Prevent configure --with-zlib from adding -Iyes and -Lyes to CFLAGS and LIBS. Pointed out by peter at slagheap.net, with & ok tim@ --- ChangeLog | 7 ++++++- configure.ac | 11 +++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index e3e8e13f9..8008bede9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20050321 + - (dtucker) [configure.ac] Prevent configure --with-zlib from adding -Iyes + and -Lyes to CFLAGS and LIBS. Pointed out by peter at slagheap.net, + with & ok tim@ + 20050317 - (tim) [configure.ac] Bug 998. Make path for --with-opensc optional. Make --without-opensc work. @@ -2372,4 +2377,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3724 2005/03/18 00:52:20 tim Exp $ +$Id: ChangeLog,v 1.3725 2005/03/20 22:55:17 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 9dce893a1..d77138505 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.254 2005/03/18 00:52:21 tim Exp $ +# $Id: configure.ac,v 1.255 2005/03/20 22:55:17 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -587,10 +587,9 @@ AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME)) dnl zlib is required AC_ARG_WITH(zlib, [ --with-zlib=PATH Use zlib in PATH], - [ - if test "x$withval" = "xno" ; then - AC_MSG_ERROR([*** zlib is required ***]) - fi + [ if test "x$withval" = "xno" ; then + AC_MSG_ERROR([*** zlib is required ***]) + elif test "x$withval" != "xyes"; then if test -d "$withval/lib"; then if test -n "${need_dash_r}"; then LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}" @@ -609,7 +608,7 @@ AC_ARG_WITH(zlib, else CPPFLAGS="-I${withval} ${CPPFLAGS}" fi - ] + fi ] ) AC_CHECK_LIB(z, deflate, , -- cgit v1.2.3 From 1df61452ea479323b22bd6f522e7d1f09fca5fe6 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 21 Mar 2005 09:58:07 +1100 Subject: - (dtucker) [configure.ac] Make configure error out if the user specifies --with-libedit but the required libs can't be found, rather than silently ignoring and continuing. ok tim@ --- ChangeLog | 5 ++++- configure.ac | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 8008bede9..f115e5ecb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ - (dtucker) [configure.ac] Prevent configure --with-zlib from adding -Iyes and -Lyes to CFLAGS and LIBS. Pointed out by peter at slagheap.net, with & ok tim@ + - (dtucker) [configure.ac] Make configure error out if the user specifies + --with-libedit but the required libs can't be found, rather than silently + ignoring and continuing. ok tim@ 20050317 - (tim) [configure.ac] Bug 998. Make path for --with-opensc optional. @@ -2377,4 +2380,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3725 2005/03/20 22:55:17 dtucker Exp $ +$Id: ChangeLog,v 1.3726 2005/03/20 22:58:07 dtucker Exp $ diff --git a/configure.ac b/configure.ac index d77138505..f105e20da 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.255 2005/03/20 22:55:17 dtucker Exp $ +# $Id: configure.ac,v 1.256 2005/03/20 22:58:08 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -850,13 +850,18 @@ LIBEDIT_MSG="no" AC_ARG_WITH(libedit, [ --with-libedit[[=PATH]] Enable libedit support for sftp], [ if test "x$withval" != "xno" ; then + if test "x$withval" != "xyes"; then + CPPFLAGS="$CPPFLAGS -I$withval/include" + LDFLAGS="$LDFLAGS -L$withval/lib" + fi AC_CHECK_LIB(edit, el_init, [ AC_DEFINE(USE_LIBEDIT, [], [Use libedit for sftp]) LIBEDIT="-ledit -lcurses" LIBEDIT_MSG="yes" AC_SUBST(LIBEDIT) ], - [], [-lcurses] + [ AC_MSG_ERROR(libedit not found) ], + [ -lcurses ] ) fi ] ) -- cgit v1.2.3 From e66519d94207187a71d274ab70a6647318ed877d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 21 Mar 2005 22:46:34 +1100 Subject: - (dtucker) [configure.ac openbsd-compat/port-aix.h] Prevent redefinitions of setauthdb on AIX 5.3, reported by anders.liljegren at its.uu.se. --- ChangeLog | 4 +++- configure.ac | 4 ++-- openbsd-compat/port-aix.h | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index f115e5ecb..ef5602e34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ - (dtucker) [configure.ac] Make configure error out if the user specifies --with-libedit but the required libs can't be found, rather than silently ignoring and continuing. ok tim@ + - (dtucker) [configure.ac openbsd-compat/port-aix.h] Prevent redefinitions + of setauthdb on AIX 5.3, reported by anders.liljegren at its.uu.se. 20050317 - (tim) [configure.ac] Bug 998. Make path for --with-opensc optional. @@ -2380,4 +2382,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3726 2005/03/20 22:58:07 dtucker Exp $ +$Id: ChangeLog,v 1.3727 2005/03/21 11:46:34 dtucker Exp $ diff --git a/configure.ac b/configure.ac index f105e20da..95ace7983 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.256 2005/03/20 22:58:08 dtucker Exp $ +# $Id: configure.ac,v 1.257 2005/03/21 11:46:34 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -123,7 +123,7 @@ case "$host" in ]) dnl Check for various auth function declarations in headers. AC_CHECK_DECLS([authenticate, loginrestrictions, loginsuccess, - passwdexpired], , , [#include ]) + passwdexpired, setauthdb], , , [#include ]) dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2) AC_CHECK_DECLS(loginfailed, [AC_MSG_CHECKING(if loginfailed takes 4 arguments) diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h index a05ce9703..9e3dce4dd 100644 --- a/openbsd-compat/port-aix.h +++ b/openbsd-compat/port-aix.h @@ -1,4 +1,4 @@ -/* $Id: port-aix.h,v 1.24 2005/02/16 11:49:31 dtucker Exp $ */ +/* $Id: port-aix.h,v 1.25 2005/03/21 11:46:34 dtucker Exp $ */ /* * @@ -47,7 +47,9 @@ /* These should be in the system headers but are not. */ int usrinfo(int, char *, int); +#if (HAVE_DECL_SETAUTHDB == 0) int setauthdb(const char *, char *); +#endif /* these may or may not be in the headers depending on the version */ #if (HAVE_DECL_AUTHENTICATE == 0) int authenticate(char *, char *, int *, char **); -- cgit v1.2.3 From 9d2562cf201e82d14d10abdd34009d8ab16a9d25 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 5 Apr 2005 19:22:45 +1000 Subject: - (dtucker) [configure.ac] Define HAVE_SO_PEERCRED if we have it. ok djm@ --- ChangeLog | 5 ++++- configure.ac | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 185306576..622380440 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20050405 + - (dtucker) [configure.ac] Define HAVE_SO_PEERCRED if we have it. ok djm@ + 20050403 - (djm) OpenBSD CVS Sync - deraadt@cvs.openbsd.org 2005/03/31 18:39:21 @@ -2420,4 +2423,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3737 2005/04/03 02:44:23 dtucker Exp $ +$Id: ChangeLog,v 1.3738 2005/04/05 09:22:45 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 95ace7983..d879e7d41 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.257 2005/03/21 11:46:34 dtucker Exp $ +# $Id: configure.ac,v 1.258 2005/04/05 09:22:45 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1020,7 +1020,9 @@ if test "x$ac_cv_func_getpeereid" != "xyes" ; then [#include #include ], [int i = SO_PEERCRED;], - [AC_MSG_RESULT(yes)], + [ AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_SO_PEERCRED, [], [Have PEERCRED socket option]) + ], [AC_MSG_RESULT(no) NO_PEERCHECK=1] ) -- cgit v1.2.3 From 2f97b8b08857ab99edca506bc90ceefe65ff6566 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 11 Apr 2005 19:00:18 -0700 Subject: - (tim) [configure.ac] UnixWare needs PASSWD_NEEDS_USERNAME --- ChangeLog | 5 ++++- configure.ac | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index ca5545539..49c841bb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20050411 + - (tim) [configure.ac] UnixWare needs PASSWD_NEEDS_USERNAME + 20050405 - (dtucker) [configure.ac] Define HAVE_SO_PEERCRED if we have it. ok djm@ - (dtucker) [auth-sia.c] Constify sys_auth_passwd, fixes build error on @@ -2427,4 +2430,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3740 2005/04/05 11:00:47 dtucker Exp $ +$Id: ChangeLog,v 1.3741 2005/04/12 02:00:18 tim Exp $ diff --git a/configure.ac b/configure.ac index d879e7d41..8d8688bfb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.258 2005/04/05 09:22:45 dtucker Exp $ +# $Id: configure.ac,v 1.259 2005/04/12 02:00:18 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -361,6 +361,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) AC_DEFINE(BROKEN_SETREGID) + AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) ;; # UnixWare 7.x, OpenUNIX 8 *-*-sysv5*) @@ -368,6 +369,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) AC_DEFINE(BROKEN_SETREGID) + AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) ;; *-*-sysv*) ;; -- cgit v1.2.3 From 2f0b5c4869bab45bccb8472590bbd3edb44c092a Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 24 Apr 2005 17:52:22 +1000 Subject: - (dtucker) [INSTALL configure.ac] Make zlib version check test for 1.1.4 or 1.2.1.2 or higher. With tim@, ok djm@ --- ChangeLog | 10 +++++++++- INSTALL | 4 ++-- configure.ac | 29 ++++++++++++++++++++--------- 3 files changed, 31 insertions(+), 12 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index a865fce6d..d2d2f347f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050424 + - (dtucker) [INSTALL configure.ac] Make zlib version check test for 1.1.4 or + 1.2.1.2 or higher. With tim@, ok djm@ + 20050423 - (tim) [config.guess] Add support for OpenServer 6. @@ -5,6 +9,10 @@ - (dtucker) [session.c] Bug #1024: Don't check pam_session_is_open if UseLogin is set as PAM is not used to establish credentials in that case. Found by Michael Selvesteen, ok djm@ + - (dtucker) [auth-pam.c] Since people don't seem to be getting the message, + USE_POSIX_THREADS is now known as UNSUPPORTED_POSIX_THREADS_HACK. + USE_POSIX_THREADS will now generate an error so we don't silently change + behaviour. ok djm@ 20050419 - (dtucker) [INSTALL] Reference README.privsep for the privilege separation @@ -2444,4 +2452,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3746 2005/04/24 01:17:29 tim Exp $ +$Id: ChangeLog,v 1.3747 2005/04/24 07:52:22 dtucker Exp $ diff --git a/INSTALL b/INSTALL index 7de5cb496..753d2d061 100644 --- a/INSTALL +++ b/INSTALL @@ -3,7 +3,7 @@ You will need working installations of Zlib and OpenSSL. -Zlib 1.1.4 or greater: +Zlib 1.1.4 or 1.2.1.2 or greater (ealier 1.2.x versions have problems): http://www.gzip.org/zlib/ OpenSSL 0.9.6 or greater: @@ -225,4 +225,4 @@ Please refer to the "reporting bugs" section of the webpage at http://www.openssh.com/ -$Id: INSTALL,v 1.69 2005/04/19 05:40:51 dtucker Exp $ +$Id: INSTALL,v 1.70 2005/04/24 07:52:23 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 8d8688bfb..20c8f1587 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.259 2005/04/12 02:00:18 tim Exp $ +# $Id: configure.ac,v 1.260 2005/04/24 07:52:23 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -643,29 +643,40 @@ AC_ARG_WITH(zlib-version-check, ] ) -AC_MSG_CHECKING(for zlib 1.1.4 or greater) +AC_MSG_CHECKING(for possibly buggy zlib) AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include #include int main() { - int a, b, c, v; - if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3) + int a=0, b=0, c=0, d=0, n, v; + n = sscanf(ZLIB_VERSION, "%d.%d.%d.%d", &a, &b, &c, &d); + if (n != 3 && n != 4) exit(1); - v = a*1000000 + b*1000 + c; - if (v >= 1001004) + v = a*1000000 + b*10000 + c*100 + d; + fprintf(stderr, "found zlib version %s (%d)\n", ZLIB_VERSION, v); + + /* 1.1.4 is OK */ + if (a == 1 && b == 1 && c >= 4) + exit(0); + + /* 1.2.1.2 and up are OK */ + if (v >= 1020102) exit(0); + exit(2); } ]])], - AC_MSG_RESULT(yes), - [ AC_MSG_RESULT(no) + AC_MSG_RESULT(no), + [ AC_MSG_RESULT(yes) if test -z "$zlib_check_nonfatal" ; then AC_MSG_ERROR([*** zlib too old - check config.log *** Your reported zlib version has known security problems. It's possible your vendor has fixed these problems without changing the version number. If you are sure this is the case, you can disable the check by running "./configure --without-zlib-version-check". -If you are in doubt, upgrade zlib to version 1.1.4 or greater.]) +If you are in doubt, upgrade zlib to version 1.2.1.2 or greater. +See http://www.gzip.org/zlib/ for details.]) else AC_MSG_WARN([zlib version may have security problems]) fi -- cgit v1.2.3 From 84ce9b455d04e7f145d43ef8dac2ddc59e41802d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 26 May 2005 20:12:15 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/getrrsetbyname.c] Bug #1033: Provide templates for _getshort and _getlong if missing to prevent compiler warnings on Linux. --- ChangeLog | 11 +++++++---- configure.ac | 3 ++- openbsd-compat/getrrsetbyname.c | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 4dec60c1b..148199a55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -98,9 +98,12 @@ - (dtucker) [regress/reexec.sh] Add ${EXEEXT} so this test also works on Cygwin. - (dtucker) [auth-pam.c] Bug #1033: Fix warnings building with PAM on Linux: - warning: dereferencing type-punned pointer will break strict-aliasing rules - warning: passing arg 3 of `pam_get_item' from incompatible pointer type - The type-punned pointer fix is based on a patch from SuSE's rpm. ok djm@ + warning: dereferencing type-punned pointer will break strict-aliasing rules + warning: passing arg 3 of `pam_get_item' from incompatible pointer type + The type-punned pointer fix is based on a patch from SuSE's rpm. ok djm@ + - (dtucker) [configure.ac openbsd-compat/getrrsetbyname.c] Bug #1033: Provide + templates for _getshort and _getlong if missing to prevent compiler warnings + on Linux. 20050524 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] @@ -2600,4 +2603,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3788 2005/05/26 09:59:48 dtucker Exp $ +$Id: ChangeLog,v 1.3789 2005/05/26 10:12:15 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 20c8f1587..fd8218aea 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.260 2005/04/24 07:52:23 dtucker Exp $ +# $Id: configure.ac,v 1.261 2005/05/26 10:12:15 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -2402,6 +2402,7 @@ int main() AC_MSG_RESULT(no)]) ]) AC_CHECK_FUNCS(_getshort _getlong) + AC_CHECK_DECLS([_getshort, _getlong]) AC_CHECK_MEMBER(HEADER.ad, [AC_DEFINE(HAVE_HEADER_AD)],, [#include ]) diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 4e869c4df..2016ffe31 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c @@ -144,6 +144,8 @@ _getshort(msgp) GETSHORT(u, msgp); return (u); } +#elif defined(HAVE_DECL__GETSHORT) && (HAVE_DECL__GETSHORT == 0) +u_int16_t _getshort(register const u_char *); #endif #ifndef HAVE__GETLONG @@ -156,6 +158,8 @@ _getlong(msgp) GETLONG(u, msgp); return (u); } +#elif defined(HAVE_DECL__GETLONG) && (HAVE_DECL__GETLONG == 0) +u_int32_t _getlong(register const u_char *); #endif int -- cgit v1.2.3 From de3cb0a3dc1bd98762afa3d71f3ffcdb76029fad Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 26 May 2005 20:48:25 +1000 Subject: - (djm) [configure.ac openbsd-compat/Makefile.in] [openbsd-compat/openbsd-compat.h openbsd-compat/strtonum.c] Add strtonum(3) from OpenBSD libc, new code needs it. Unfortunately Linux forces us to do a bizarre dance with compiler options to get LLONG_MIN/MAX; Spotted by and ok dtucker@ --- ChangeLog | 7 ++++- configure.ac | 13 ++++++-- openbsd-compat/Makefile.in | 4 +-- openbsd-compat/openbsd-compat.h | 6 +++- openbsd-compat/strtonum.c | 69 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 openbsd-compat/strtonum.c (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 148199a55..935132567 100644 --- a/ChangeLog +++ b/ChangeLog @@ -104,6 +104,11 @@ - (dtucker) [configure.ac openbsd-compat/getrrsetbyname.c] Bug #1033: Provide templates for _getshort and _getlong if missing to prevent compiler warnings on Linux. + - (djm) [configure.ac openbsd-compat/Makefile.in] + [openbsd-compat/openbsd-compat.h openbsd-compat/strtonum.c] + Add strtonum(3) from OpenBSD libc, new code needs it. + Unfortunately Linux forces us to do a bizarre dance with compiler + options to get LLONG_MIN/MAX; Spotted by and ok dtucker@ 20050524 - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec] @@ -2603,4 +2608,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3789 2005/05/26 10:12:15 dtucker Exp $ +$Id: ChangeLog,v 1.3790 2005/05/26 10:48:25 djm Exp $ diff --git a/configure.ac b/configure.ac index fd8218aea..58a3ff47d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.261 2005/05/26 10:12:15 dtucker Exp $ +# $Id: configure.ac,v 1.262 2005/05/26 10:48:25 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -79,6 +79,15 @@ AC_SUBST(LD) AC_C_INLINE if test "$GCC" = "yes" || test "$GCC" = "egcs"; then CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" + + # Check for -std=gnu99 support (needed for LLONG_MIN/MAX on Linux) + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -std=gnu99" + AC_MSG_CHECKING(whether cc accepts -std=gnu99 option) + AC_TRY_COMPILE([], [return(0);], [AC_MSG_RESULT(yes)], + [AC_MSG_RESULT(no) + CFLAGS="$saved_CFLAGS"], + ) fi AC_ARG_WITH(rpath, @@ -922,7 +931,7 @@ AC_CHECK_FUNCS(\ setdtablesize setegid setenv seteuid setgroups setlogin setpcred \ setproctitle setregid setreuid setrlimit \ setsid setvbuf sigaction sigvec snprintf socketpair strerror \ - strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \ + strlcat strlcpy strmode strnvis strtonum strtoul sysconf tcgetpgrp \ truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \ ) diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 0f34f2240..8368aa2ce 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.31 2004/08/15 08:41:00 djm Exp $ +# $Id: Makefile.in,v 1.32 2005/05/26 10:48:25 djm Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -16,7 +16,7 @@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ LDFLAGS=-L. @LDFLAGS@ -OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtoul.o vis.o +OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoul.o vis.o COMPAT=bsd-arc4random.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o xmmap.o xcrypt.o diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 89d1454e0..a4cfa6c4d 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.26 2004/08/15 08:41:00 djm Exp $ */ +/* $Id: openbsd-compat.h,v 1.27 2005/05/26 10:48:25 djm Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -152,6 +152,10 @@ int openpty(int *, int *, char *, struct termios *, struct winsize *); int snprintf(char *, size_t, const char *, ...); #endif +#ifndef HAVE_STRTONUM +long long strtonum(const char *, long long, long long, const char **); +#endif + #ifndef HAVE_VSNPRINTF int vsnprintf(char *, size_t, const char *, va_list); #endif diff --git a/openbsd-compat/strtonum.c b/openbsd-compat/strtonum.c new file mode 100644 index 000000000..b681ed83b --- /dev/null +++ b/openbsd-compat/strtonum.c @@ -0,0 +1,69 @@ +/* OPENBSD ORIGINAL: lib/libc/stdlib/strtonum.c */ + +/* $OpenBSD: strtonum.c,v 1.6 2004/08/03 19:38:01 millert Exp $ */ + +/* + * Copyright (c) 2004 Ted Unangst and Todd Miller + * All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include "includes.h" +#ifndef HAVE_STRTONUM +#include + +#define INVALID 1 +#define TOOSMALL 2 +#define TOOLARGE 3 + +long long +strtonum(const char *numstr, long long minval, long long maxval, + const char **errstrp) +{ + long long ll = 0; + char *ep; + int error = 0; + struct errval { + const char *errstr; + int err; + } ev[4] = { + { NULL, 0 }, + { "invalid", EINVAL }, + { "too small", ERANGE }, + { "too large", ERANGE }, + }; + + ev[0].err = errno; + errno = 0; + if (minval > maxval) + error = INVALID; + else { + ll = strtoll(numstr, &ep, 10); + if (numstr == ep || *ep != '\0') + error = INVALID; + else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) + error = TOOSMALL; + else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) + error = TOOLARGE; + } + if (errstrp != NULL) + *errstrp = ev[error].errstr; + errno = ev[error].err; + if (error) + ll = 0; + + return (ll); +} + +#endif /* HAVE_STRTONUM */ -- cgit v1.2.3 From 2be1cbb7be25d32bc5741c96cc4d6951bd91fc30 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 27 May 2005 21:13:40 +1000 Subject: - (dtucker) [acconfig.h configure.ac defines.h includes.h sshpty.c openbsd-compat/bsd-misc.c] Add support for Ultrix. No, that's not a typo. Required changes from Bernhard Simon, integrated by me. ok djm@ --- ChangeLog | 5 ++++- acconfig.h | 5 +---- configure.ac | 14 ++++++++++---- defines.h | 10 +++++++++- includes.h | 4 ++++ openbsd-compat/bsd-misc.c | 20 +++++++++++++++++++- sshpty.c | 4 ++-- 7 files changed, 49 insertions(+), 13 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index c1f32524b..7705b9025 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 20050527 - (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by David Leach; ok dtucker@ + - (dtucker) [acconfig.h configure.ac defines.h includes.h sshpty.c + openbsd-compat/bsd-misc.c] Add support for Ultrix. No, that's not a typo. + Required changes from Bernhard Simon, integrated by me. ok djm@ 20050525 - (djm) [mpaux.c mpaux.h Makefile.in] Remove old mpaux.[ch] code, it has not @@ -2612,4 +2615,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3791 2005/05/27 09:36:56 djm Exp $ +$Id: ChangeLog,v 1.3792 2005/05/27 11:13:40 dtucker Exp $ diff --git a/acconfig.h b/acconfig.h index 5721f65fb..bb2e62d23 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.181 2005/02/25 23:07:38 dtucker Exp $ */ +/* $Id: acconfig.h,v 1.182 2005/05/27 11:13:41 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -119,9 +119,6 @@ /* Define if you are on NeXT */ #undef HAVE_NEXT -/* Define if you are on NEWS-OS */ -#undef HAVE_NEWS4 - /* Define if you want to enable PAM support */ #undef USE_PAM diff --git a/configure.ac b/configure.ac index 58a3ff47d..a936d2bfd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.262 2005/05/26 10:48:25 djm Exp $ +# $Id: configure.ac,v 1.263 2005/05/27 11:13:41 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -278,7 +278,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) esac ;; mips-sony-bsd|mips-sony-newsos4) - AC_DEFINE(HAVE_NEWS4) + AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) SONY=1 ;; *-*-netbsd*) @@ -477,6 +477,12 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(MISSING_HOWMANY) AC_DEFINE(MISSING_FD_MASK) ;; + +*-*-ultrix*) + AC_DEFINE(BROKEN_GETGROUPS, [], [getgroups(0,NULL) will return -1]) + AC_DEFINE(BROKEN_MMAP, [], [Ultrix mmap can't map files]) + AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) + AC_CHECK_HEADERS(sys/syslog.h) esac # Allow user to specify flags @@ -929,8 +935,8 @@ AC_CHECK_FUNCS(\ mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \ pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \ setdtablesize setegid setenv seteuid setgroups setlogin setpcred \ - setproctitle setregid setreuid setrlimit \ - setsid setvbuf sigaction sigvec snprintf socketpair strerror \ + setproctitle setregid setreuid setrlimit setsid setvbuf \ + sigaction sigvec snprintf socketpair strdup strerror \ strlcat strlcpy strmode strnvis strtonum strtoul sysconf tcgetpgrp \ truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \ ) diff --git a/defines.h b/defines.h index d75d458f4..3a11e6d65 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.120 2005/05/27 09:36:56 djm Exp $ */ +/* $Id: defines.h,v 1.121 2005/05/27 11:13:41 dtucker Exp $ */ /* Constants */ @@ -668,4 +668,12 @@ struct winsize { /** end of login recorder definitions */ +#ifdef BROKEN_GETGROUPS +# define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b))) +#endif + +#if defined(HAVE_MMAP) && defined(BROKEN_MMAP) +# undef HAVE_MMAP +#endif + #endif /* _DEFINES_H */ diff --git a/includes.h b/includes.h index 1625f8e30..89ae26d06 100644 --- a/includes.h +++ b/includes.h @@ -181,6 +181,10 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } # include #endif +#if defined(HAVE_SYS_SYSLOG_H) +# include +#endif + /* * On HP-UX 11.11, shadow.h and prot.h provide conflicting declarations * of getspnam when _INCLUDE__STDC__ is defined, so we unset it here. diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 41f92cce9..6ba9bd986 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c @@ -18,7 +18,7 @@ #include "includes.h" #include "xmalloc.h" -RCSID("$Id: bsd-misc.c,v 1.26 2005/02/25 23:07:38 dtucker Exp $"); +RCSID("$Id: bsd-misc.c,v 1.27 2005/05/27 11:13:41 dtucker Exp $"); #ifndef HAVE___PROGNAME char *__progname; @@ -212,3 +212,21 @@ mysignal(int sig, mysig_t act) return (signal(sig, act)); #endif } + +#ifndef HAVE_STRDUP +char * +strdup(const char *str) +{ + size_t len; + char *cp; + + len = strlen(str) + 1; + cp = malloc(len); + if (cp != NULL) + if (strlcpy(cp, str, len) != len) { + free(cp); + return NULL; + } + return cp; +} +#endif diff --git a/sshpty.c b/sshpty.c index efd1dfefa..36788c4d7 100644 --- a/sshpty.c +++ b/sshpty.c @@ -128,10 +128,10 @@ pty_make_controlling_tty(int *ttyfd, const char *tty) if (ioctl(*ttyfd, TIOCSCTTY, NULL) < 0) error("ioctl(TIOCSCTTY): %.100s", strerror(errno)); #endif /* TIOCSCTTY */ -#ifdef HAVE_NEWS4 +#ifdef NEED_SETPGRP if (setpgrp(0,0) < 0) error("SETPGRP %s",strerror(errno)); -#endif /* HAVE_NEWS4 */ +#endif /* NEED_SETPGRP */ #ifdef USE_VHANGUP old = signal(SIGHUP, SIG_IGN); vhangup(); -- cgit v1.2.3 From 0c9653f57e10e1a555905c7de906dbcac91ede93 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 28 May 2005 15:58:14 +1000 Subject: - (dtucker) [configure.ac] For AC_CHECK_HEADERS() and AC_CHECK_FUNCS() have one entry per line to make it easier to merge changes. ok djm@ --- ChangeLog | 6 ++- configure.ac | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 145 insertions(+), 26 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 7705b9025..6f11a62a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050528 + - (dtucker) [configure.ac] For AC_CHECK_HEADERS() and AC_CHECK_FUNCS() have + one entry per line to make it easier to merge changes. ok djm@ + 20050527 - (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by David Leach; ok dtucker@ @@ -2615,4 +2619,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3792 2005/05/27 11:13:40 dtucker Exp $ +$Id: ChangeLog,v 1.3793 2005/05/28 05:58:14 dtucker Exp $ diff --git a/configure.ac b/configure.ac index a936d2bfd..af14953b6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.263 2005/05/27 11:13:41 dtucker Exp $ +# $Id: configure.ac,v 1.264 2005/05/28 05:58:14 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -537,17 +537,64 @@ int main(){exit(0);} [ AC_MSG_WARN([cross compiling: not checking compiler sanity]) ] ) -# Checks for header files. -AC_CHECK_HEADERS(bstring.h crypt.h dirent.h endian.h features.h \ - floatingpoint.h getopt.h glob.h ia.h lastlog.h limits.h login.h \ - login_cap.h maillock.h ndir.h netdb.h netgroup.h \ - netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \ - rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ - strings.h sys/dir.h sys/strtio.h sys/audit.h sys/bitypes.h \ - sys/bsdtty.h sys/cdefs.h sys/mman.h sys/ndir.h sys/prctl.h \ - sys/pstat.h sys/select.h sys/stat.h sys/stream.h \ - sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h sys/un.h \ - time.h tmpdir.h ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h) +dnl Checks for header files. +AC_CHECK_HEADERS( \ + bstring.h \ + crypt.h \ + dirent.h \ + endian.h \ + features.h \ + floatingpoint.h \ + getopt.h \ + glob.h \ + ia.h \ + lastlog.h \ + limits.h \ + login.h \ + login_cap.h \ + maillock.h \ + ndir.h \ + netdb.h \ + netgroup.h \ + netinet/in_systm.h \ + pam/pam_appl.h \ + paths.h \ + pty.h \ + readpassphrase.h \ + rpc/types.h \ + security/pam_appl.h \ + shadow.h \ + stddef.h \ + stdint.h \ + strings.h \ + sys/audit.h \ + sys/bitypes.h \ + sys/bsdtty.h \ + sys/cdefs.h \ + sys/dir.h \ + sys/mman.h \ + sys/ndir.h \ + sys/prctl.h \ + sys/pstat.h \ + sys/select.h \ + sys/stat.h \ + sys/stream.h \ + sys/stropts.h \ + sys/strtio.h \ + sys/sysmacros.h \ + sys/time.h \ + sys/timers.h \ + sys/un.h \ + time.h \ + tmpdir.h \ + ttyent.h \ + usersec.h \ + util.h \ + utime.h \ + utmp.h \ + utmpx.h \ + vis.h\ +) # sys/ptms.h requires sys/stream.h to be included first on Solaris AC_CHECK_HEADERS(sys/ptms.h, [], [], [ @@ -926,19 +973,87 @@ AC_ARG_WITH(audit, ) dnl Checks for library functions. Please keep in alphabetical order -AC_CHECK_FUNCS(\ - arc4random __b64_ntop b64_ntop __b64_pton b64_pton bcopy \ - bindresvport_sa clock closefrom dirfd fchdir fchmod fchown \ - freeaddrinfo futimes getaddrinfo getcwd getgrouplist getnameinfo \ - getopt getpeereid _getpty getrlimit getttyent glob inet_aton \ - inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ - mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \ - pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \ - setdtablesize setegid setenv seteuid setgroups setlogin setpcred \ - setproctitle setregid setreuid setrlimit setsid setvbuf \ - sigaction sigvec snprintf socketpair strdup strerror \ - strlcat strlcpy strmode strnvis strtonum strtoul sysconf tcgetpgrp \ - truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \ +AC_CHECK_FUNCS( \ + arc4random \ + b64_ntop \ + __b64_ntop \ + b64_pton \ + __b64_pton \ + bcopy \ + bindresvport_sa \ + clock \ + closefrom \ + dirfd \ + fchdir \ + fchmod \ + fchown \ + freeaddrinfo \ + futimes \ + getaddrinfo \ + getcwd \ + getgrouplist \ + getnameinfo \ + getopt \ + getpeereid \ + _getpty \ + getrlimit \ + getttyent \ + glob \ + inet_aton \ + inet_ntoa \ + inet_ntop \ + innetgr \ + login_getcapbool \ + md5_crypt \ + memmove \ + mkdtemp \ + mmap \ + ngetaddrinfo \ + nsleep \ + ogetaddrinfo \ + openlog_r \ + openpty \ + prctl \ + pstat \ + readpassphrase \ + realpath \ + recvmsg \ + rresvport_af \ + sendmsg \ + setdtablesize \ + setegid \ + setenv \ + seteuid \ + setgroups \ + setlogin \ + setpcred \ + setproctitle \ + setregid \ + setreuid \ + setrlimit \ + setsid \ + setvbuf \ + sigaction \ + sigvec \ + snprintf \ + socketpair \ + strdup \ + strerror \ + strlcat \ + strlcpy \ + strmode \ + strnvis \ + strtonum \ + strtoul \ + sysconf \ + tcgetpgrp \ + truncate \ + unsetenv \ + updwtmpx \ + utimes \ + vhangup \ + vsnprintf \ + waitpid \ ) # IRIX has a const char return value for gai_strerror() -- cgit v1.2.3 From e910be1c4248953f46c46f66507c5eaf3f9c5d02 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 28 May 2005 16:01:18 +1000 Subject: missing space --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index af14953b6..05b8041ae 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.264 2005/05/28 05:58:14 dtucker Exp $ +# $Id: configure.ac,v 1.265 2005/05/28 06:01:18 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -593,7 +593,7 @@ AC_CHECK_HEADERS( \ utime.h \ utmp.h \ utmpx.h \ - vis.h\ + vis.h \ ) # sys/ptms.h requires sys/stream.h to be included first on Solaris -- cgit v1.2.3 From 390b6d5dbf879e5daaa924c91cb1448a5748b558 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 28 May 2005 16:54:36 +1000 Subject: - (dtucker) [configure.ac] strsep() may be defined in string.h, so check for its presence and include it in the strsep check. --- ChangeLog | 4 +++- configure.ac | 12 ++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 6f11a62a1..131a90351 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20050528 - (dtucker) [configure.ac] For AC_CHECK_HEADERS() and AC_CHECK_FUNCS() have one entry per line to make it easier to merge changes. ok djm@ + - (dtucker) [configure.ac] strsep() may be defined in string.h, so check + for its presence and include it in the strsep check. 20050527 - (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by @@ -2619,4 +2621,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3793 2005/05/28 05:58:14 dtucker Exp $ +$Id: ChangeLog,v 1.3794 2005/05/28 06:54:36 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 05b8041ae..7767e9080 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.265 2005/05/28 06:01:18 dtucker Exp $ +# $Id: configure.ac,v 1.266 2005/05/28 06:54:36 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -566,6 +566,7 @@ AC_CHECK_HEADERS( \ shadow.h \ stddef.h \ stdint.h \ + string.h \ strings.h \ sys/audit.h \ sys/bitypes.h \ @@ -1074,8 +1075,15 @@ str = gai_strerror(0);],[ AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP)) dnl Make sure prototypes are defined for these before using them. -AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)]) AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)]) +AC_CHECK_DECL(strsep, + [AC_CHECK_FUNCS(strsep)], + [], + [ +#ifdef HAVE_STRING_H +# include +#endif + ]) dnl tcsendbreak might be a macro AC_CHECK_DECL(tcsendbreak, -- cgit v1.2.3 From 7d2171b2cd9633bfc7a8fb64a327630dc1a4ad9c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 28 May 2005 16:57:00 +1000 Subject: - (dtucker) [configure.ac] getpgrp may be defined in unistd.h, so check for its presence before doing AC_FUNC_GETPGRP. --- ChangeLog | 4 +++- configure.ac | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 131a90351..2cce70628 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ one entry per line to make it easier to merge changes. ok djm@ - (dtucker) [configure.ac] strsep() may be defined in string.h, so check for its presence and include it in the strsep check. + - (dtucker) [configure.ac] getpgrp may be defined in unistd.h, so check for + its presence before doing AC_FUNC_GETPGRP. 20050527 - (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by @@ -2621,4 +2623,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3794 2005/05/28 06:54:36 dtucker Exp $ +$Id: ChangeLog,v 1.3795 2005/05/28 06:57:00 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 7767e9080..863531f7e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.266 2005/05/28 06:54:36 dtucker Exp $ +# $Id: configure.ac,v 1.267 2005/05/28 06:57:00 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -589,6 +589,7 @@ AC_CHECK_HEADERS( \ time.h \ tmpdir.h \ ttyent.h \ + unistd.h \ usersec.h \ util.h \ utime.h \ -- cgit v1.2.3 From fd33328a253f2db759e4728935a323b44ea2159d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 28 May 2005 18:31:42 +1000 Subject: - (dtucker) [configure.ac] Merge HP-UX blocks into a common block with minor version-specific variations as required. --- ChangeLog | 4 +++- configure.ac | 68 +++++++++++++++++++++++++++--------------------------------- 2 files changed, 33 insertions(+), 39 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 2cce70628..6d734d4cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ for its presence and include it in the strsep check. - (dtucker) [configure.ac] getpgrp may be defined in unistd.h, so check for its presence before doing AC_FUNC_GETPGRP. + - (dtucker) [configure.ac] Merge HP-UX blocks into a common block with minor + version-specific variations as required. 20050527 - (djm) [defines.h] Use our realpath if we have to define PATH_MAX, spotted by @@ -2623,4 +2625,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3795 2005/05/28 06:57:00 dtucker Exp $ +$Id: ChangeLog,v 1.3796 2005/05/28 08:31:42 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 863531f7e..73d81d438 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.267 2005/05/28 06:57:00 dtucker Exp $ +# $Id: configure.ac,v 1.268 2005/05/28 08:31:42 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -190,26 +190,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) AC_DEFINE(BROKEN_SETREGID) AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1) ;; -*-*-hpux10.26) - if test -z "$GCC"; then - CFLAGS="$CFLAGS -Ae" - fi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" - IPADDR_IN_DISPLAY=yes - AC_DEFINE(HAVE_SECUREWARE) - AC_DEFINE(USE_PIPES) - AC_DEFINE(LOGIN_NO_ENDOPT) - AC_DEFINE(LOGIN_NEEDS_UTMPX) - AC_DEFINE(LOCKED_PASSWD_STRING, "*") - AC_DEFINE(SPT_TYPE,SPT_PSTAT) - LIBS="$LIBS -lsec -lsecpw" - AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) - disable_ptmx_check=yes - ;; -*-*-hpux10*) - if test -z "$GCC"; then - CFLAGS="$CFLAGS -Ae" - fi +*-*-hpux*) + # first we define all of the options common to all HP-UX releases CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" IPADDR_IN_DISPLAY=yes AC_DEFINE(USE_PIPES) @@ -218,23 +200,33 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) AC_DEFINE(LOCKED_PASSWD_STRING, "*") AC_DEFINE(SPT_TYPE,SPT_PSTAT) LIBS="$LIBS -lsec" - AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) - ;; -*-*-hpux11*) - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" - IPADDR_IN_DISPLAY=yes - AC_DEFINE(PAM_SUN_CODEBASE) - AC_DEFINE(USE_PIPES) - AC_DEFINE(LOGIN_NO_ENDOPT) - AC_DEFINE(LOGIN_NEEDS_UTMPX) - AC_DEFINE(DISABLE_UTMP) - AC_DEFINE(LOCKED_PASSWD_STRING, "*") - AC_DEFINE(SPT_TYPE,SPT_PSTAT) - AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) - check_for_hpux_broken_getaddrinfo=1 - check_for_conflicting_getspnam=1 - LIBS="$LIBS -lsec" - AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) + AC_CHECK_LIB(xnet, t_error, , + AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) + + # next, we define all of the options specific to major releases + case "$host" in + *-*-hpux10*) + if test -z "$GCC"; then + CFLAGS="$CFLAGS -Ae" + fi + ;; + *-*-hpux11*) + AC_DEFINE(PAM_SUN_CODEBASE) + AC_DEFINE(DISABLE_UTMP) + AC_DEFINE(USE_BTMP, 1, [Use btmp to log bad logins]) + check_for_hpux_broken_getaddrinfo=1 + check_for_conflicting_getspnam=1 + ;; + esac + + # lastly, we define options specific to minor releases + case "$host" in + *-*-hpux10.26) + AC_DEFINE(HAVE_SECUREWARE) + disable_ptmx_check=yes + LIBS="$LIBS -lsecpw" + ;; + esac ;; *-*-irix5*) PATH="$PATH:/usr/etc" -- cgit v1.2.3 From d886e1ca2c52c7998f54d03db824626cbbdfb85f Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 1 Jun 2005 18:57:45 +1000 Subject: - (dtucker) [configure.ac] Look for _getshort and _getlong in arpa/nameser.h. --- ChangeLog | 6 +++++- configure.ac | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index bb8660c7b..9c2573f78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050601 + - (dtucker) [configure.ac] Look for _getshort and _getlong in + arpa/nameser.h. + 20050531 - (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at vintela.com. @@ -2645,4 +2649,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3802 2005/05/31 06:59:16 dtucker Exp $ +$Id: ChangeLog,v 1.3803 2005/06/01 08:57:45 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 73d81d438..362faa1d1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.268 2005/05/28 08:31:42 dtucker Exp $ +# $Id: configure.ac,v 1.269 2005/06/01 08:57:45 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -2533,7 +2533,8 @@ int main() AC_MSG_RESULT(no)]) ]) AC_CHECK_FUNCS(_getshort _getlong) - AC_CHECK_DECLS([_getshort, _getlong]) + AC_CHECK_DECLS([_getshort, _getlong], , , + [#include ]) AC_CHECK_MEMBER(HEADER.ad, [AC_DEFINE(HAVE_HEADER_AD)],, [#include ]) -- cgit v1.2.3 From 81eb5d5e10d4c3ce0f0cc91fab7efbb22fb97f07 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 1 Jun 2005 21:39:33 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoll.c] Add strtoll to the compat library, from OpenBSD. --- ChangeLog | 5 +- configure.ac | 3 +- openbsd-compat/Makefile.in | 4 +- openbsd-compat/strtoll.c | 151 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 openbsd-compat/strtoll.c (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 9c2573f78..1f9684d75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 20050601 - (dtucker) [configure.ac] Look for _getshort and _getlong in arpa/nameser.h. + - (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoll.c] + Add strtoll to the compat library, from OpenBSD. + 20050531 - (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at @@ -2649,4 +2652,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3803 2005/06/01 08:57:45 dtucker Exp $ +$Id: ChangeLog,v 1.3804 2005/06/01 11:39:33 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 362faa1d1..e94663790 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.269 2005/06/01 08:57:45 dtucker Exp $ +# $Id: configure.ac,v 1.270 2005/06/01 11:39:33 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1038,6 +1038,7 @@ AC_CHECK_FUNCS( \ strmode \ strnvis \ strtonum \ + strtoll \ strtoul \ sysconf \ tcgetpgrp \ diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 8368aa2ce..30d2410bc 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.32 2005/05/26 10:48:25 djm Exp $ +# $Id: Makefile.in,v 1.33 2005/06/01 11:39:34 dtucker Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -16,7 +16,7 @@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ LDFLAGS=-L. @LDFLAGS@ -OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoul.o vis.o +OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoll.o strtoul.o vis.o COMPAT=bsd-arc4random.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o xmmap.o xcrypt.o diff --git a/openbsd-compat/strtoll.c b/openbsd-compat/strtoll.c new file mode 100644 index 000000000..60c276f8a --- /dev/null +++ b/openbsd-compat/strtoll.c @@ -0,0 +1,151 @@ +/* OPENBSD ORIGINAL: lib/libc/stdlib/strtoll.c */ + +/*- + * Copyright (c) 1992 The Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * 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. + */ + +#include "includes.h" +#ifndef HAVE_STRTOLL + +#if defined(LIBC_SCCS) && !defined(lint) +static const char rcsid[] = "$OpenBSD: strtoll.c,v 1.4 2005/03/30 18:51:49 pat Exp $"; +#endif /* LIBC_SCCS and not lint */ + +#include + +#include +#include +#include +#include + +/* + * Convert a string to a long long. + * + * Ignores `locale' stuff. Assumes that the upper and lower case + * alphabets and digits are each contiguous. + */ +long long +strtoll(const char *nptr, char **endptr, int base) +{ + const char *s; + long long acc, cutoff; + int c; + int neg, any, cutlim; + + /* + * Skip white space and pick up leading +/- sign if any. + * If base is 0, allow 0x for hex and 0 for octal, else + * assume decimal; if base is already 16, allow 0x. + */ + s = nptr; + do { + c = (unsigned char) *s++; + } while (isspace(c)); + if (c == '-') { + neg = 1; + c = *s++; + } else { + neg = 0; + if (c == '+') + c = *s++; + } + if ((base == 0 || base == 16) && + c == '0' && (*s == 'x' || *s == 'X')) { + c = s[1]; + s += 2; + base = 16; + } + if (base == 0) + base = c == '0' ? 8 : 10; + + /* + * Compute the cutoff value between legal numbers and illegal + * numbers. That is the largest legal value, divided by the + * base. An input number that is greater than this value, if + * followed by a legal input character, is too big. One that + * is equal to this value may be valid or not; the limit + * between valid and invalid numbers is then based on the last + * digit. For instance, if the range for long longs is + * [-9223372036854775808..9223372036854775807] and the input base + * is 10, cutoff will be set to 922337203685477580 and cutlim to + * either 7 (neg==0) or 8 (neg==1), meaning that if we have + * accumulated a value > 922337203685477580, or equal but the + * next digit is > 7 (or 8), the number is too big, and we will + * return a range error. + * + * Set any if any `digits' consumed; make it negative to indicate + * overflow. + */ + cutoff = neg ? LLONG_MIN : LLONG_MAX; + cutlim = cutoff % base; + cutoff /= base; + if (neg) { + if (cutlim > 0) { + cutlim -= base; + cutoff += 1; + } + cutlim = -cutlim; + } + for (acc = 0, any = 0;; c = (unsigned char) *s++) { + if (isdigit(c)) + c -= '0'; + else if (isalpha(c)) + c -= isupper(c) ? 'A' - 10 : 'a' - 10; + else + break; + if (c >= base) + break; + if (any < 0) + continue; + if (neg) { + if (acc < cutoff || (acc == cutoff && c > cutlim)) { + any = -1; + acc = LLONG_MIN; + errno = ERANGE; + } else { + any = 1; + acc *= base; + acc -= c; + } + } else { + if (acc > cutoff || (acc == cutoff && c > cutlim)) { + any = -1; + acc = LLONG_MAX; + errno = ERANGE; + } else { + any = 1; + acc *= base; + acc += c; + } + } + } + if (endptr != 0) + *endptr = (char *) (any ? s - 1 : nptr); + return (acc); +} +#endif /* HAVE_STRTOLL */ -- cgit v1.2.3 From 4dbacffe7bd6160c66c89093969eba469fb90b55 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Wed, 1 Jun 2005 20:09:28 -0700 Subject: - (tim) [configure.ac] set TEST_SHELL for OpenServer 6 --- ChangeLog | 3 ++- configure.ac | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 4ef54244a..67d44780c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ fix -O for cases where no ControlPath has been specified or socket at ControlPath is not contactable; spotted by and ok avsm@ - (tim) [config.guess config.sub] Update to '2005-05-27' version. + - (tim) [configure.ac] set TEST_SHELL for OpenServer 6 20050531 - (dtucker) [contrib/aix/pam.conf] Correct comments. From davidl at @@ -2666,4 +2667,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3808 2005/06/02 02:57:45 tim Exp $ +$Id: ChangeLog,v 1.3809 2005/06/02 03:09:28 tim Exp $ diff --git a/configure.ac b/configure.ac index e94663790..61132acd0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.270 2005/06/01 11:39:33 dtucker Exp $ +# $Id: configure.ac,v 1.271 2005/06/02 03:09:28 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -371,6 +371,11 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(BROKEN_SETREUID) AC_DEFINE(BROKEN_SETREGID) AC_DEFINE(PASSWD_NEEDS_USERNAME, 1, [must supply username to passwd]) + case "$host" in + *-*-sysv5SCO_SV*) # SCO OpenServer 6.x + TEST_SHELL=/u95/bin/sh + ;; + esac ;; *-*-sysv*) ;; -- cgit v1.2.3 From fcc7ff1de8db0647357a5846e4d629f4ca54a6b9 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 2 Jun 2005 20:28:29 -0700 Subject: - (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h. Take AC_CHECK_HEADERS test out of ultrix section. It caused other platforms to skip builtin standard includes tests. (first AC_CHECK_HEADERS test must be run on all platforms) Add missing ;; to case statement. OK dtucker@ --- ChangeLog | 8 +++++++- configure.ac | 8 +++++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 67d44780c..a24199236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20050602 + - (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h. + Take AC_CHECK_HEADERS test out of ultrix section. It caused other platforms + to skip builtin standard includes tests. (first AC_CHECK_HEADERS test + must be run on all platforms) Add missing ;; to case statement. OK dtucker@ + 20050601 - (dtucker) [configure.ac] Look for _getshort and _getlong in arpa/nameser.h. @@ -2667,4 +2673,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3809 2005/06/02 03:09:28 tim Exp $ +$Id: ChangeLog,v 1.3810 2005/06/03 03:28:29 tim Exp $ diff --git a/configure.ac b/configure.ac index 61132acd0..bca35a633 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.271 2005/06/02 03:09:28 tim Exp $ +# $Id: configure.ac,v 1.272 2005/06/03 03:28:29 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -479,7 +479,8 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(BROKEN_GETGROUPS, [], [getgroups(0,NULL) will return -1]) AC_DEFINE(BROKEN_MMAP, [], [Ultrix mmap can't map files]) AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) - AC_CHECK_HEADERS(sys/syslog.h) + AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix]) + ;; esac # Allow user to specify flags @@ -2540,7 +2541,8 @@ int main() ]) AC_CHECK_FUNCS(_getshort _getlong) AC_CHECK_DECLS([_getshort, _getlong], , , - [#include ]) + [#include + #include ]) AC_CHECK_MEMBER(HEADER.ad, [AC_DEFINE(HAVE_HEADER_AD)],, [#include ]) -- cgit v1.2.3 From 67b3703da3c4a1f766b25dbe31aa2fed4a2ad656 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 3 Jun 2005 17:58:31 +1000 Subject: - (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't defined, and check that it helps before keeping it in CFLAGS. Some old gcc's don't set an error code when encountering an unknown value in -std. Found and tested by tim@. --- ChangeLog | 8 +++++++- configure.ac | 24 +++++++++++++++--------- 2 files changed, 22 insertions(+), 10 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index a24199236..e6287c18a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +20050603 + - (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't + defined, and check that it helps before keeping it in CFLAGS. Some old + gcc's don't set an error code when encountering an unknown value in -std. + Found and tested by tim@. + 20050602 - (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h. Take AC_CHECK_HEADERS test out of ultrix section. It caused other platforms @@ -2673,4 +2679,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3810 2005/06/03 03:28:29 tim Exp $ +$Id: ChangeLog,v 1.3811 2005/06/03 07:58:31 dtucker Exp $ diff --git a/configure.ac b/configure.ac index bca35a633..cd795caf4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.272 2005/06/03 03:28:29 tim Exp $ +# $Id: configure.ac,v 1.273 2005/06/03 07:58:31 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -77,17 +77,23 @@ fi AC_SUBST(LD) AC_C_INLINE + +AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include ]) + if test "$GCC" = "yes" || test "$GCC" = "egcs"; then CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" - # Check for -std=gnu99 support (needed for LLONG_MIN/MAX on Linux) - saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -std=gnu99" - AC_MSG_CHECKING(whether cc accepts -std=gnu99 option) - AC_TRY_COMPILE([], [return(0);], [AC_MSG_RESULT(yes)], - [AC_MSG_RESULT(no) - CFLAGS="$saved_CFLAGS"], - ) + if test -z "$have_llong_max"; then + # retry LLONG_MAX with -std=gnu99, needed on some Linuxes + unset ac_cv_have_decl_LLONG_MAX + saved_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -std=gnu99" + AC_CHECK_DECL(LLONG_MAX, + [have_llong_max=1], + [CFLAGS="$saved_CFLAGS"], + [#include ] + ) + fi fi AC_ARG_WITH(rpath, -- cgit v1.2.3 From 6a45f3dab42f00733070ca386bc841d73afa3b24 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 3 Jun 2005 19:33:10 +1000 Subject: - (dtucker) [configure.ac] Point configure's reporting address at the openssh-unix-dev list. ok tim@ djm@ --- ChangeLog | 4 +++- configure.ac | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index e6287c18a..2046df86c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ defined, and check that it helps before keeping it in CFLAGS. Some old gcc's don't set an error code when encountering an unknown value in -std. Found and tested by tim@. + - (dtucker) [configure.ac] Point configure's reporting address at the + openssh-unix-dev list. ok tim@ djm@ 20050602 - (tim) [configure.ac] Some platforms need sys/types.h for arpa/nameser.h. @@ -2679,4 +2681,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3811 2005/06/03 07:58:31 dtucker Exp $ +$Id: ChangeLog,v 1.3812 2005/06/03 09:33:10 dtucker Exp $ diff --git a/configure.ac b/configure.ac index cd795caf4..00fc858ef 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.273 2005/06/03 07:58:31 dtucker Exp $ +# $Id: configure.ac,v 1.274 2005/06/03 09:33:10 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -14,7 +14,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -AC_INIT(OpenSSH, Portable) +AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org) AC_CONFIG_SRCDIR([ssh.c]) AC_CONFIG_HEADER(config.h) -- cgit v1.2.3 From 431f022263a59595dd7894181515832828a950f9 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 7 Jun 2005 17:53:40 +1000 Subject: - (dtucker) [configure.ac] Continue the hunt for LLONG_MIN and LLONG_MAX: in today's episode we attempt to coax it from limits.h where it may be hiding, failing that we take the DIY approach. Tested by tim@ --- ChangeLog | 7 ++++++- configure.ac | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 71 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 2046df86c..efebb2820 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20050607 + - (dtucker) [configure.ac] Continue the hunt for LLONG_MIN and LLONG_MAX: + in today's episode we attempt to coax it from limits.h where it may be + hiding, failing that we take the DIY approach. Tested by tim@ + 20050603 - (dtucker) [configure.ac] Only try gcc -std=gnu99 if LLONG_MAX isn't defined, and check that it helps before keeping it in CFLAGS. Some old @@ -2681,4 +2686,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3812 2005/06/03 09:33:10 dtucker Exp $ +$Id: ChangeLog,v 1.3813 2005/06/07 07:53:40 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 00fc858ef..62a11fa1e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.274 2005/06/03 09:33:10 dtucker Exp $ +# $Id: configure.ac,v 1.275 2005/06/07 07:53:40 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -96,6 +96,70 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then fi fi +if test -z "$have_llong_max"; then + AC_MSG_CHECKING([for max value of long long]) + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include +/* Why is this so damn hard? */ +#ifdef __GNUC__ +# undef __GNUC__ +#endif +#define __USE_ISOC99 +#include +#define DATA "conftest.llminmax" +int main(void) { + FILE *f; + long long i, llmin, llmax = 0; + + if((f = fopen(DATA,"w")) == NULL) + exit(1); + +#if defined(LLONG_MIN) && defined(LLONG_MAX) + fprintf(stderr, "Using system header for LLONG_MIN and LLONG_MAX\n"); + llmin = LLONG_MIN; + llmax = LLONG_MAX; +#else + fprintf(stderr, "Calculating LLONG_MIN and LLONG_MAX\n"); + /* This will work on one's complement and two's complement */ + for (i = 1; i > llmax; i <<= 1, i++) + llmax = i; + llmin = llmax + 1LL; /* wrap */ +#endif + + /* Sanity check */ + if (llmin + 1 < llmin || llmin - 1 < llmin || llmax + 1 > llmax + || llmax - 1 > llmax) { + fprintf(f, "unknown unknown\n"); + exit(2); + } + + if (fprintf(f ,"%lld %lld", llmin, llmax) < 0) + exit(3); + + exit(0); +} + ]])], + [ + llong_min=`$AWK '{print $1}' conftest.llminmax` + llong_max=`$AWK '{print $2}' conftest.llminmax` + AC_MSG_RESULT($llong_max) + AC_DEFINE_UNQUOTED(LLONG_MAX, [${llong_max}LL], + [max value of long long calculated by configure]) + AC_MSG_CHECKING([for min value of long long]) + AC_MSG_RESULT($llong_min) + AC_DEFINE_UNQUOTED(LLONG_MIN, [${llong_min}LL], + [min value of long long calculated by configure]) + ], + [ + AC_MSG_RESULT(not found) + ], + [ + AC_MSG_WARN([cross compiling: not checking]) + ] + ) +fi + AC_ARG_WITH(rpath, [ --without-rpath Disable auto-added -R linker paths], [ -- cgit v1.2.3 From 52c8afeec57cd8f04e08816e1f4563e689f70f83 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 19 Jun 2005 10:19:43 +1000 Subject: - (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable, tested and fixes tim@ --- ChangeLog | 4 +++- configure.ac | 3 ++- loginrec.c | 4 ++-- loginrec.h | 4 ++-- ssh-rand-helper.c | 10 +++++----- 5 files changed, 14 insertions(+), 11 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index d65980b44..04dce8489 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ polish dtucker@) - djm@cvs.openbsd.org 2005/06/17 02:44:33 [auth1.c] make this -Wsign-compare clean; ok avsm@ markus@ + - (djm) [loginrec.c ssh-rand-helper.c] Fix -Wsign-compare for portable, + tested and fixes tim@ 20050617 - (djm) OpenBSD CVS Sync @@ -2747,4 +2749,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3826 2005/06/18 21:36:10 djm Exp $ +$Id: ChangeLog,v 1.3827 2005/06/19 00:19:43 djm Exp $ diff --git a/configure.ac b/configure.ac index 62a11fa1e..027b2a4e1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.275 2005/06/07 07:53:40 dtucker Exp $ +# $Id: configure.ac,v 1.276 2005/06/19 00:19:43 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -82,6 +82,7 @@ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include ]) if test "$GCC" = "yes" || test "$GCC" = "egcs"; then CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" + CFLAGS="$CFLAGS -Wsign-compare" if test -z "$have_llong_max"; then # retry LLONG_MAX with -std=gnu99, needed on some Linuxes diff --git a/loginrec.c b/loginrec.c index 361ac4cb7..2543617ba 100644 --- a/loginrec.c +++ b/loginrec.c @@ -165,7 +165,7 @@ # include #endif -RCSID("$Id: loginrec.c,v 1.67 2005/02/15 11:19:28 dtucker Exp $"); +RCSID("$Id: loginrec.c,v 1.68 2005/06/19 00:19:43 djm Exp $"); /** ** prototypes for helper functions in this file @@ -534,7 +534,7 @@ getlast_entry(struct logininfo *li) * sure dst has enough space, if not just copy src (ugh) */ char * -line_fullname(char *dst, const char *src, int dstsize) +line_fullname(char *dst, const char *src, u_int dstsize) { memset(dst, '\0', dstsize); if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) diff --git a/loginrec.h b/loginrec.h index d1a12a853..8e3390178 100644 --- a/loginrec.h +++ b/loginrec.h @@ -35,7 +35,7 @@ #include #include -/* RCSID("$Id: loginrec.h,v 1.9 2005/02/02 06:10:11 dtucker Exp $"); */ +/* RCSID("$Id: loginrec.h,v 1.10 2005/06/19 00:19:44 djm Exp $"); */ /** ** you should use the login_* calls to work around platform dependencies @@ -128,7 +128,7 @@ struct logininfo *login_get_lastlog(struct logininfo *li, const int uid); unsigned int login_get_lastlog_time(const int uid); /* produce various forms of the line filename */ -char *line_fullname(char *dst, const char *src, int dstsize); +char *line_fullname(char *dst, const char *src, u_int dstsize); char *line_stripname(char *dst, const char *src, int dstsize); char *line_abbrevname(char *dst, const char *src, int dstsize); diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c index d7d8d0f3b..aab51fdf7 100644 --- a/ssh-rand-helper.c +++ b/ssh-rand-helper.c @@ -39,7 +39,7 @@ #include "pathnames.h" #include "log.h" -RCSID("$Id: ssh-rand-helper.c,v 1.23 2005/02/16 02:32:30 dtucker Exp $"); +RCSID("$Id: ssh-rand-helper.c,v 1.24 2005/06/19 00:19:44 djm Exp $"); /* Number of bytes we write out */ #define OUTPUT_SEED_SIZE 48 @@ -123,7 +123,7 @@ get_random_bytes_prngd(unsigned char *buf, int len, unsigned short tcp_port, char *socket_path) { int fd, addr_len, rval, errors; - char msg[2]; + u_char msg[2]; struct sockaddr_storage addr; struct sockaddr_in *addr_in = (struct sockaddr_in *)&addr; struct sockaddr_un *addr_un = (struct sockaddr_un *)&addr; @@ -135,8 +135,8 @@ get_random_bytes_prngd(unsigned char *buf, int len, if (socket_path != NULL && strlen(socket_path) >= sizeof(addr_un->sun_path)) fatal("Random pool path is too long"); - if (len > 255) - fatal("Too many bytes to read from PRNGD"); + if (len <= 0 || len > 255) + fatal("Too many bytes (%d) to read from PRNGD", len); memset(&addr, '\0', sizeof(addr)); @@ -190,7 +190,7 @@ reopen: goto done; } - if (atomicio(read, fd, buf, len) != len) { + if (atomicio(read, fd, buf, len) != (size_t)len) { if (errno == EPIPE && errors < 10) { close(fd); errors++; -- cgit v1.2.3 From 893c602ef05e2a11d76a945ac19c75bcc029c515 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 7 Jul 2005 20:33:36 +1000 Subject: - (dtucker) [acconfig.h auth-krb5.c configure.ac gss-serv-krb5.c] Remove calls to krb5_init_ets, which has not been required since krb-1.1.x and most Kerberos versions no longer export in their public API. From sxw at inf.ed.ac.uk, ok djm@ --- ChangeLog | 6 +++++- acconfig.h | 5 +---- auth-krb5.c | 3 --- configure.ac | 3 +-- gss-serv-krb5.c | 3 --- 5 files changed, 7 insertions(+), 13 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 5e4d01470..f76094f78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,10 @@ - (dtucker) [auth-krb5.c] There's no guarantee that snprintf will set errno in the case where the buffer is insufficient, so always return ENOMEM. Also pointed out by sxw at inf.ed.ac.uk. + - (dtucker) [acconfig.h auth-krb5.c configure.ac gss-serv-krb5.c] Remove + calls to krb5_init_ets, which has not been required since krb-1.1.x and + most Kerberos versions no longer export in their public API. From sxw + at inf.ed.ac.uk, ok djm@ 20050706 - (djm) OpenBSD CVS Sync @@ -2791,4 +2795,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3837 2005/07/07 10:09:35 dtucker Exp $ +$Id: ChangeLog,v 1.3838 2005/07/07 10:33:36 dtucker Exp $ diff --git a/acconfig.h b/acconfig.h index bb2e62d23..79b5e8191 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.182 2005/05/27 11:13:41 dtucker Exp $ */ +/* $Id: acconfig.h,v 1.183 2005/07/07 10:33:36 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -202,9 +202,6 @@ /* Define if you don't want to use lastlog in session.c */ #undef NO_SSH_LASTLOG -/* Define if have krb5_init_ets */ -#undef KRB5_INIT_ETS - /* Define if you don't want to use utmp */ #undef DISABLE_UTMP diff --git a/auth-krb5.c b/auth-krb5.c index 6ae4f5fc4..c7367b49a 100644 --- a/auth-krb5.c +++ b/auth-krb5.c @@ -54,9 +54,6 @@ krb5_init(void *context) problem = krb5_init_context(&authctxt->krb5_ctx); if (problem) return (problem); -#ifdef KRB5_INIT_ETS - krb5_init_ets(authctxt->krb5_ctx); -#endif } return (0); } diff --git a/configure.ac b/configure.ac index 027b2a4e1..e7475a9e5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.276 2005/06/19 00:19:43 djm Exp $ +# $Id: configure.ac,v 1.277 2005/07/07 10:33:36 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -2717,7 +2717,6 @@ AC_ARG_WITH(kerberos5, LIBS="$LIBS $K5LIBS" AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS)) - AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS)) ] ) diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c index c642a83fe..4f02621dd 100644 --- a/gss-serv-krb5.c +++ b/gss-serv-krb5.c @@ -65,9 +65,6 @@ ssh_gssapi_krb5_init(void) logit("Cannot initialize krb5 context"); return 0; } -#ifdef KRB5_INIT_ETS - krb5_init_ets(krb_context); -#endif return 1; } -- cgit v1.2.3 From 4a42257b06fed3f2ec60ca27175d7db76761aebc Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 14 Jul 2005 17:22:11 +1000 Subject: - (dtucker) [configure.ac defines.h] Define __sentinel__ to nothing if the compiler doesn't understand it to prevent warnings. If any mainstream compiler versions acquire it we can test for those versions. Based on discussion with djm@. --- ChangeLog | 6 +++++- configure.ac | 5 ++++- defines.h | 6 +++++- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 152287c58..9ab5e94e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,10 @@ - dtucker@cvs.openbsd.org 2005/07/14 04:00:43 [misc.h] use __sentinel__ attribute; ok deraadt@ djm@ markus@ + - (dtucker) [configure.ac defines.h] Define __sentinel__ to nothing if the + compiler doesn't understand it to prevent warnings. If any mainstream + compiler versions acquire it we can test for those versions. Based on + discussion with djm@. 20050707 - dtucker [auth-krb5.c auth.h gss-serv-krb5.c] Move KRB5CCNAME generation for @@ -2821,4 +2825,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3844 2005/07/14 07:07:21 dtucker Exp $ +$Id: ChangeLog,v 1.3845 2005/07/14 07:22:11 dtucker Exp $ diff --git a/configure.ac b/configure.ac index e7475a9e5..e3d696cdd 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.277 2005/07/07 10:33:36 dtucker Exp $ +# $Id: configure.ac,v 1.278 2005/07/14 07:22:11 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -368,6 +368,9 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(USE_PIPES) AC_DEFINE(BROKEN_SAVED_UIDS) ;; +*-*-openbsd*) + AC_DEFINE(HAVE_ATTRIBUTE__SENTINEL__, 1, [OpenBSD's gcc has sentinel]) + ;; *-*-solaris*) if test "x$withval" != "xno" ; then need_dash_r=1 diff --git a/defines.h b/defines.h index 3a11e6d65..f7029abb4 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.121 2005/05/27 11:13:41 dtucker Exp $ */ +/* $Id: defines.h,v 1.122 2005/07/14 07:22:11 dtucker Exp $ */ /* Constants */ @@ -436,6 +436,10 @@ struct winsize { # define __dead __attribute__((noreturn)) #endif +#if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__) +# define __sentinel__ +#endif + /* *-*-nto-qnx doesn't define this macro in the system headers */ #ifdef MISSING_HOWMANY # define howmany(x,y) (((x)+((y)-1))/(y)) -- cgit v1.2.3 From 41097edcf6e7912350af27e3390e4ff94fefefc5 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 25 Jul 2005 15:24:21 +1000 Subject: - (dtucker) [configure.ac] Update zlib version check for CAN-2005-2096. --- ChangeLog | 5 ++++- configure.ac | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 21e20138b..98788e90d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20050725 + - (dtucker) [configure.ac] Update zlib version check for CAN-2005-2096. + 20050717 - OpenBSD CVS Sync - djm@cvs.openbsd.org 2005/07/16 01:35:24 @@ -2858,4 +2861,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3853 2005/07/17 07:53:31 djm Exp $ +$Id: ChangeLog,v 1.3854 2005/07/25 05:24:21 dtucker Exp $ diff --git a/configure.ac b/configure.ac index e3d696cdd..2041bf298 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.278 2005/07/14 07:22:11 dtucker Exp $ +# $Id: configure.ac,v 1.279 2005/07/25 05:24:21 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -796,8 +796,8 @@ int main() if (a == 1 && b == 1 && c >= 4) exit(0); - /* 1.2.1.2 and up are OK */ - if (v >= 1020102) + /* 1.2.3 and up are OK */ + if (v >= 1020300) exit(0); exit(2); -- cgit v1.2.3 From ac1910f1a523b8e5d4c6a764a419244a91e5f390 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 26 Jul 2005 12:00:42 +1000 Subject: - (dtucker) [configure.ac] Update zlib warning message too, pointed out by tim@. --- ChangeLog | 6 +++++- configure.ac | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 98788e90d..78a67e6b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050726 + - (dtucker) [configure.ac] Update zlib warning message too, pointed out by + tim@. + 20050725 - (dtucker) [configure.ac] Update zlib version check for CAN-2005-2096. @@ -2861,4 +2865,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3854 2005/07/25 05:24:21 dtucker Exp $ +$Id: ChangeLog,v 1.3855 2005/07/26 02:00:42 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 2041bf298..df3712dcb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.279 2005/07/25 05:24:21 dtucker Exp $ +# $Id: configure.ac,v 1.280 2005/07/26 02:00:42 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -811,7 +811,7 @@ Your reported zlib version has known security problems. It's possible your vendor has fixed these problems without changing the version number. If you are sure this is the case, you can disable the check by running "./configure --without-zlib-version-check". -If you are in doubt, upgrade zlib to version 1.2.1.2 or greater. +If you are in doubt, upgrade zlib to version 1.2.3 or greater. See http://www.gzip.org/zlib/ for details.]) else AC_MSG_WARN([zlib version may have security problems]) -- cgit v1.2.3 From dd352b675be9af7571ea04635435bf138732f931 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 2 Aug 2005 17:21:29 +1000 Subject: - (dtucker) [configure.ac] Enable -Wuninitialized by default when compiling with gcc. ok djm@ --- ChangeLog | 4 +++- configure.ac | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 63339593a..969cd5968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ - dtucker@cvs.openbsd.org 2005/07/27 10:39:03 [scp.c hostfile.c sftp-client.c] Silence bogus -Wuninitialized warnings; ok djm@ + - (dtucker) [configure.ac] Enable -Wuninitialized by default when compiling + with gcc. ok djm@ 20050726 - (dtucker) [configure.ac] Update zlib warning message too, pointed out by @@ -2885,4 +2887,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3858 2005/08/02 07:07:07 dtucker Exp $ +$Id: ChangeLog,v 1.3859 2005/08/02 07:21:29 dtucker Exp $ diff --git a/configure.ac b/configure.ac index df3712dcb..6e2f5c1f5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.280 2005/07/26 02:00:42 dtucker Exp $ +# $Id: configure.ac,v 1.281 2005/08/02 07:21:29 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -81,7 +81,7 @@ AC_C_INLINE AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include ]) if test "$GCC" = "yes" || test "$GCC" = "egcs"; then - CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized" + CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" CFLAGS="$CFLAGS -Wsign-compare" if test -z "$have_llong_max"; then -- cgit v1.2.3 From 7da23cb5d307a98bb7a58445a845fab7abc35024 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 3 Aug 2005 00:20:15 +1000 Subject: - (dtucker) [configure.ac] Add a --with-Werror option to configure for adding -Werror to CFLAGS when all of the configure tests are done. ok djm@ --- ChangeLog | 4 +++- configure.ac | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 969cd5968..b45ebb49b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ Silence bogus -Wuninitialized warnings; ok djm@ - (dtucker) [configure.ac] Enable -Wuninitialized by default when compiling with gcc. ok djm@ + - (dtucker) [configure.ac] Add a --with-Werror option to configure for + adding -Werror to CFLAGS when all of the configure tests are done. ok djm@ 20050726 - (dtucker) [configure.ac] Update zlib warning message too, pointed out by @@ -2887,4 +2889,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3859 2005/08/02 07:21:29 dtucker Exp $ +$Id: ChangeLog,v 1.3860 2005/08/02 14:20:15 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 6e2f5c1f5..93297bbd8 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.281 2005/08/02 07:21:29 dtucker Exp $ +# $Id: configure.ac,v 1.282 2005/08/02 14:20:15 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -594,6 +594,17 @@ AC_ARG_WITH(libs, fi ] ) +AC_ARG_WITH(Werror, + [ --with-Werror Build main code with -Werror], + [ + if test -n "$withval" && test "x$withval" != "xno"; then + werror_flags="-Werror" + if "x${withval}" != "xyes"; then + werror_flags="$withval" + fi + fi + ] +) AC_MSG_CHECKING(compiler and flags for sanity) AC_RUN_IFELSE( @@ -3358,6 +3369,10 @@ if test "$ac_cv_lib_pam_pam_set_item" = yes ; then LIBS=`echo $LIBS | sed 's/-ldl //'` fi +dnl Adding -Werror to CFLAGS early prevents configure tests from running. +dnl Add now. +CFLAGS="$CFLAGS $werror_flags" + AC_EXEEXT AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openbsd-compat/Makefile \ scard/Makefile ssh_prng_cmds survey.sh]) -- cgit v1.2.3 From 8bc6b900ed8609d67e75bc7266b9b533a703eb4a Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Tue, 9 Aug 2005 10:09:53 -0700 Subject: - (tim) [configure.ac] Allow --with-audit=no. OK dtucker@ Report by skeleten AT shillest.net --- ChangeLog | 6 +++++- configure.ac | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index c0c2dbc05..6a27ad629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050809 + - (tim) [configure.ac] Allow --with-audit=no. OK dtucker@ + Report by skeleten AT shillest.net + 20050803 - (dtucker) [openbsd-compat/fake-rfc2553.h] Check for EAI_* defines individually and use a value less likely to collide with real values from @@ -2896,4 +2900,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3862 2005/08/03 05:36:21 dtucker Exp $ +$Id: ChangeLog,v 1.3863 2005/08/09 17:09:53 tim Exp $ diff --git a/configure.ac b/configure.ac index 93297bbd8..a6fae9ff0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.282 2005/08/02 14:20:15 dtucker Exp $ +# $Id: configure.ac,v 1.283 2005/08/09 17:09:54 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1051,6 +1051,8 @@ AC_ARG_WITH(audit, AC_MSG_RESULT(debug) AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module) ;; + no) + ;; *) AC_MSG_ERROR([Unknown audit module $withval]) ;; -- cgit v1.2.3 From c7572b26611241cb86319193693b940f5dbf47c9 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 10 Aug 2005 20:34:15 +1000 Subject: - (dtucker) [configure.ac] Test libedit library and headers for compatibility. Report from skeleten AT shillest.net, ok djm@ --- ChangeLog | 6 +++++- configure.ac | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 6a27ad629..37539b728 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050810 + - (dtucker) [configure.ac] Test libedit library and headers for compatibility. + Report from skeleten AT shillest.net, ok djm@ + 20050809 - (tim) [configure.ac] Allow --with-audit=no. OK dtucker@ Report by skeleten AT shillest.net @@ -2900,4 +2904,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3863 2005/08/09 17:09:53 tim Exp $ +$Id: ChangeLog,v 1.3864 2005/08/10 10:34:15 dtucker Exp $ diff --git a/configure.ac b/configure.ac index a6fae9ff0..60dbd0c34 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.283 2005/08/09 17:09:54 tim Exp $ +# $Id: configure.ac,v 1.284 2005/08/10 10:34:15 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1023,6 +1023,20 @@ AC_ARG_WITH(libedit, [ AC_MSG_ERROR(libedit not found) ], [ -lcurses ] ) + AC_MSG_CHECKING(if libedit version is compatible) + AC_TRY_COMPILE([#include ], + [ +int main(void) +{ + int i = H_SETSIZE; + el_init("", NULL, NULL, NULL); + exit(0); +} + ], + [ AC_MSG_RESULT(yes) ], + [ AC_MSG_RESULT(no) + AC_MSG_ERROR(libedit version is not compatible) ] + ) fi ] ) -- cgit v1.2.3 From 73f671a0902163c342ec5f1948f7fdad6905adee Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 10 Aug 2005 21:52:36 +1000 Subject: - (dtucker) [LICENCE configure.ac defines.h openbsd-compat/realpath.c] Sync current (thread-safe) version of realpath.c from OpenBSD (which is in turn based on FreeBSD's). ok djm@ --- ChangeLog | 5 +- LICENCE | 1 + configure.ac | 3 +- defines.h | 6 +- openbsd-compat/realpath.c | 266 ++++++++++++++++++++++------------------------ 5 files changed, 140 insertions(+), 141 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 37539b728..f62f121df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 20050810 - (dtucker) [configure.ac] Test libedit library and headers for compatibility. Report from skeleten AT shillest.net, ok djm@ + - (dtucker) [LICENCE configure.ac defines.h openbsd-compat/realpath.c] + Sync current (thread-safe) version of realpath.c from OpenBSD (which is + in turn based on FreeBSD's). ok djm@ 20050809 - (tim) [configure.ac] Allow --with-audit=no. OK dtucker@ @@ -2904,4 +2907,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3864 2005/08/10 10:34:15 dtucker Exp $ +$Id: ChangeLog,v 1.3865 2005/08/10 11:52:36 dtucker Exp $ diff --git a/LICENCE b/LICENCE index ae03eb3a7..5def839e5 100644 --- a/LICENCE +++ b/LICENCE @@ -255,6 +255,7 @@ OpenSSH contains no GPL code. Damien Miller Eric P. Allman The Regents of the University of California + Constantin S. Svintsoff * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/configure.ac b/configure.ac index 60dbd0c34..a62ee8c43 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.284 2005/08/10 10:34:15 dtucker Exp $ +# $Id: configure.ac,v 1.285 2005/08/10 11:52:36 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1085,7 +1085,6 @@ AC_CHECK_FUNCS( \ clock \ closefrom \ dirfd \ - fchdir \ fchmod \ fchown \ freeaddrinfo \ diff --git a/defines.h b/defines.h index f7029abb4..39d18e3d3 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.122 2005/07/14 07:22:11 dtucker Exp $ */ +/* $Id: defines.h,v 1.123 2005/08/10 11:52:36 dtucker Exp $ */ /* Constants */ @@ -62,6 +62,10 @@ enum # endif /* PATH_MAX */ #endif /* MAXPATHLEN */ +#ifndef MAXSYMLINKS +# define MAXSYMLINKS 5 +#endif + #ifndef STDIN_FILENO # define STDIN_FILENO 0 #endif diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c index 7f73bd998..8430bec24 100644 --- a/openbsd-compat/realpath.c +++ b/openbsd-compat/realpath.c @@ -1,11 +1,7 @@ /* OPENBSD ORIGINAL: lib/libc/stdlib/realpath.c */ /* - * Copyright (c) 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Jan-Simon Pendry. + * Copyright (c) 2003 Constantin S. Svintsoff * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -15,14 +11,14 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. + * 3. The names of the authors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) @@ -36,169 +32,165 @@ #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: realpath.c,v 1.11 2004/11/30 15:12:59 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ - #include #include #include -#include #include #include #include /* - * MAXSYMLINKS - */ -#ifndef MAXSYMLINKS -#define MAXSYMLINKS 5 -#endif - -/* - * char *realpath(const char *path, char resolved_path[MAXPATHLEN]); + * char *realpath(const char *path, char resolved[PATH_MAX]); * * Find the real name of path, by removing all ".", ".." and symlink * components. Returns (resolved) on success, or (NULL) on failure, * in which case the path which caused trouble is left in (resolved). */ char * -realpath(const char *path, char *resolved) +realpath(const char *path, char resolved[PATH_MAX]) { struct stat sb; - int fd, n, needslash, serrno; - char *p, *q, wbuf[MAXPATHLEN]; - int symlinks = 0; - - /* Save the starting point. */ -#ifndef HAVE_FCHDIR - char start[MAXPATHLEN]; - /* this is potentially racy but without fchdir we have no option */ - if (getcwd(start, sizeof(start)) == NULL) { - resolved[0] = '.'; + char *p, *q, *s; + size_t left_len, resolved_len; + unsigned symlinks; + int serrno, slen; + char left[PATH_MAX], next_token[PATH_MAX], symlink[PATH_MAX]; + + serrno = errno; + symlinks = 0; + if (path[0] == '/') { + resolved[0] = '/'; resolved[1] = '\0'; - return (NULL); + if (path[1] == '\0') + return (resolved); + resolved_len = 1; + left_len = strlcpy(left, path + 1, sizeof(left)); + } else { + if (getcwd(resolved, PATH_MAX) == NULL) { + strlcpy(resolved, ".", PATH_MAX); + return (NULL); + } + resolved_len = strlen(resolved); + left_len = strlcpy(left, path, sizeof(left)); } -#endif - if ((fd = open(".", O_RDONLY)) < 0) { - resolved[0] = '.'; - resolved[1] = '\0'; + if (left_len >= sizeof(left) || resolved_len >= PATH_MAX) { + errno = ENAMETOOLONG; return (NULL); } - /* Convert "." -> "" to optimize away a needless lstat() and chdir() */ - if (path[0] == '.' && path[1] == '\0') - path = ""; - /* - * Find the dirname and basename from the path to be resolved. - * Change directory to the dirname component. - * lstat the basename part. - * if it is a symlink, read in the value and loop. - * if it is a directory, then change to that directory. - * get the current directory name and append the basename. + * Iterate over path components in `left'. */ - if (strlcpy(resolved, path, MAXPATHLEN) >= MAXPATHLEN) { - serrno = ENAMETOOLONG; - goto err2; - } -loop: - q = strrchr(resolved, '/'); - if (q != NULL) { - p = q + 1; - if (q == resolved) - q = "/"; - else { - do { - --q; - } while (q > resolved && *q == '/'); - q[1] = '\0'; - q = resolved; + while (left_len != 0) { + /* + * Extract the next path component and adjust `left' + * and its length. + */ + p = strchr(left, '/'); + s = p ? p : left + left_len; + if (s - left >= sizeof(next_token)) { + errno = ENAMETOOLONG; + return (NULL); } - if (chdir(q) < 0) - goto err1; - } else - p = resolved; - - /* Deal with the last component. */ - if (*p != '\0' && lstat(p, &sb) == 0) { - if (S_ISLNK(sb.st_mode)) { - if (++symlinks > MAXSYMLINKS) { - errno = ELOOP; - goto err1; + memcpy(next_token, left, s - left); + next_token[s - left] = '\0'; + left_len -= s - left; + if (p != NULL) + memmove(left, s + 1, left_len + 1); + if (resolved[resolved_len - 1] != '/') { + if (resolved_len + 1 >= PATH_MAX) { + errno = ENAMETOOLONG; + return (NULL); } - if ((n = readlink(p, resolved, MAXPATHLEN-1)) < 0) - goto err1; - resolved[n] = '\0'; - goto loop; + resolved[resolved_len++] = '/'; + resolved[resolved_len] = '\0'; } - if (S_ISDIR(sb.st_mode)) { - if (chdir(p) < 0) - goto err1; - p = ""; + if (next_token[0] == '\0') + continue; + else if (strcmp(next_token, ".") == 0) + continue; + else if (strcmp(next_token, "..") == 0) { + /* + * Strip the last path component except when we have + * single "/" + */ + if (resolved_len > 1) { + resolved[resolved_len - 1] = '\0'; + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } + continue; } - } - - /* - * Save the last component name and get the full pathname of - * the current directory. - */ - if (strlcpy(wbuf, p, sizeof(wbuf)) >= sizeof(wbuf)) { - errno = ENAMETOOLONG; - goto err1; - } - if (getcwd(resolved, MAXPATHLEN) == NULL) - goto err1; - - /* - * Join the two strings together, ensuring that the right thing - * happens if the last component is empty, or the dirname is root. - */ - if (resolved[0] == '/' && resolved[1] == '\0') - needslash = 0; - else - needslash = 1; - if (*wbuf) { - if (strlen(resolved) + strlen(wbuf) + needslash >= MAXPATHLEN) { + /* + * Append the next path component and lstat() it. If + * lstat() fails we still can return successfully if + * there are no more path components left. + */ + resolved_len = strlcat(resolved, next_token, PATH_MAX); + if (resolved_len >= PATH_MAX) { errno = ENAMETOOLONG; - goto err1; + return (NULL); } - if (needslash) { - if (strlcat(resolved, "/", MAXPATHLEN) >= MAXPATHLEN) { - errno = ENAMETOOLONG; - goto err1; + if (lstat(resolved, &sb) != 0) { + if (errno == ENOENT && p == NULL) { + errno = serrno; + return (resolved); } + return (NULL); } - if (strlcat(resolved, wbuf, MAXPATHLEN) >= MAXPATHLEN) { - errno = ENAMETOOLONG; - goto err1; - } - } + if (S_ISLNK(sb.st_mode)) { + if (symlinks++ > MAXSYMLINKS) { + errno = ELOOP; + return (NULL); + } + slen = readlink(resolved, symlink, sizeof(symlink) - 1); + if (slen < 0) + return (NULL); + symlink[slen] = '\0'; + if (symlink[0] == '/') { + resolved[1] = 0; + resolved_len = 1; + } else if (resolved_len > 1) { + /* Strip the last path component. */ + resolved[resolved_len - 1] = '\0'; + q = strrchr(resolved, '/') + 1; + *q = '\0'; + resolved_len = q - resolved; + } - /* Go back to where we came from. */ -#ifdef HAVE_FCHDIR - if (fchdir(fd) < 0) { -#else - if (chdir(start) < 0) { -#endif - serrno = errno; - goto err2; + /* + * If there are any path components left, then + * append them to symlink. The result is placed + * in `left'. + */ + if (p != NULL) { + if (symlink[slen - 1] != '/') { + if (slen + 1 >= sizeof(symlink)) { + errno = ENAMETOOLONG; + return (NULL); + } + symlink[slen] = '/'; + symlink[slen + 1] = 0; + } + left_len = strlcat(symlink, left, sizeof(left)); + if (left_len >= sizeof(left)) { + errno = ENAMETOOLONG; + return (NULL); + } + } + left_len = strlcpy(left, symlink, sizeof(left)); + } } - /* It's okay if the close fails, what's an fd more or less? */ - (void)close(fd); + /* + * Remove trailing slash except when the resolved pathname + * is a single "/". + */ + if (resolved_len > 1 && resolved[resolved_len - 1] == '/') + resolved[resolved_len - 1] = '\0'; return (resolved); - -err1: serrno = errno; -#ifdef HAVE_FCHDIR - (void)fchdir(fd); -#else - chdir(start); -#endif -err2: (void)close(fd); - errno = serrno; - return (NULL); } #endif /* !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) */ -- cgit v1.2.3 From c1819c831f044905298ca91cf5848aba3177be00 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 15 Aug 2005 17:48:40 -0700 Subject: - (tim) [configure.ac] corrections to libedit tests. Report and patches by skeleten AT shillest.net --- ChangeLog | 6 ++++-- configure.ac | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index e1c550829..1eba83b1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20050815 - - (tim) wrap el_end() in #ifdef USE_LIBEDIT + - (tim) [sftp.c] wrap el_end() in #ifdef USE_LIBEDIT + - (tim) [configure.ac] corrections to libedit tests. Report and patches + by skeleten AT shillest.net 20050812 - (djm) OpenBSD CVS Sync @@ -2935,4 +2937,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3872 2005/08/15 21:52:50 tim Exp $ +$Id: ChangeLog,v 1.3873 2005/08/16 00:48:40 tim Exp $ diff --git a/configure.ac b/configure.ac index a62ee8c43..849112829 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.285 2005/08/10 11:52:36 dtucker Exp $ +# $Id: configure.ac,v 1.286 2005/08/16 00:48:41 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -1024,15 +1024,16 @@ AC_ARG_WITH(libedit, [ -lcurses ] ) AC_MSG_CHECKING(if libedit version is compatible) - AC_TRY_COMPILE([#include ], - [ + AC_COMPILE_IFELSE( + [AC_LANG_SOURCE([[ +#include int main(void) { int i = H_SETSIZE; el_init("", NULL, NULL, NULL); exit(0); } - ], + ]])], [ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(no) AC_MSG_ERROR(libedit version is not compatible) ] @@ -1066,6 +1067,7 @@ AC_ARG_WITH(audit, AC_DEFINE(SSH_AUDIT_EVENTS, [], Use audit debugging module) ;; no) + AC_MSG_RESULT(no) ;; *) AC_MSG_ERROR([Unknown audit module $withval]) -- cgit v1.2.3 From 93e7e8f345367136b4c3881c6eb3d756a43fe148 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 23 Aug 2005 08:06:55 +1000 Subject: - (dtucker) [configure.ac defines.h includes.h sftp.c] Add support for LynxOS, patch from Olli Savia (ops at iki.fi). ok djm@ --- ChangeLog | 6 +++++- configure.ac | 8 +++++++- defines.h | 19 ++++++++++++++++++- includes.h | 1 + sftp.c | 2 +- 5 files changed, 32 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index e77dd1f4d..f9db29ad5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050821 + - (dtucker) [configure.ac defines.h includes.h sftp.c] Add support for + LynxOS, patch from Olli Savia (ops at iki.fi). ok djm@ + 20050816 - (djm) [ttymodes.c] bugzilla #1054: Fix encoding of _POSIX_VDISABLE, from Jacob Nevins; ok dtucker@ @@ -2941,4 +2945,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3874 2005/08/16 11:32:09 djm Exp $ +$Id: ChangeLog,v 1.3875 2005/08/22 22:06:55 dtucker Exp $ diff --git a/configure.ac b/configure.ac index 849112829..619a4e76a 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.286 2005/08/16 00:48:41 tim Exp $ +# $Id: configure.ac,v 1.287 2005/08/22 22:06:56 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -555,6 +555,12 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(NEED_SETPRGP, [], [Need setpgrp to acquire controlling tty]) AC_DEFINE(HAVE_SYS_SYSLOG_H, 1, [Force use of sys/syslog.h on Ultrix]) ;; + +*-*-lynxos) + CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" + AC_DEFINE(MISSING_HOWMANY) + AC_DEFINE(BROKEN_SETVBUF, 1, [LynxOS has broken setvbuf() implementation]) + ;; esac # Allow user to specify flags diff --git a/defines.h b/defines.h index 39d18e3d3..3103f8743 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.123 2005/08/10 11:52:36 dtucker Exp $ */ +/* $Id: defines.h,v 1.124 2005/08/22 22:06:56 dtucker Exp $ */ /* Constants */ @@ -579,6 +579,23 @@ struct winsize { # define SSH_SYSFDMAX 10000 #endif +#if defined(__Lynx__) + /* + * LynxOS defines these in param.h which we do not want to include since + * it will also pull in a bunch of kernel definitions. + */ +# define ALIGNBYTES (sizeof(int) - 1) +# define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES) + /* Missing prototypes on LynxOS */ + int snprintf (char *, size_t, const char *, ...); + int mkstemp (char *); + char *crypt (const char *, const char *); + int seteuid (uid_t); + int setegid (gid_t); + char *mkdtemp (char *); + int rresvport_af (int *, sa_family_t); + int innetgr (const char *, const char *, const char *, const char *); +#endif /* * Define this to use pipes instead of socketpairs for communicating with the diff --git a/includes.h b/includes.h index 89ae26d06..9408fec9a 100644 --- a/includes.h +++ b/includes.h @@ -21,6 +21,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } #include "config.h" +#include #include #include #include diff --git a/sftp.c b/sftp.c index 9f6c88fb5..f98ed7d27 100644 --- a/sftp.c +++ b/sftp.c @@ -1295,7 +1295,7 @@ interactive_loop(int fd_in, int fd_out, char *file1, char *file2) xfree(dir); } -#if HAVE_SETVBUF +#if defined(HAVE_SETVBUF) && !defined(BROKEN_SETVBUF) setvbuf(stdout, NULL, _IOLBF, 0); setvbuf(infile, NULL, _IOLBF, 0); #else -- cgit v1.2.3 From 3db1e3fc685cb0c570b4e17a60e0e041fa48b32f Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Tue, 23 Aug 2005 17:11:26 -0700 Subject: - (tim) [configure.ac ] Not all gcc's support -Wsign-compare --- ChangeLog | 3 ++- configure.ac | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 5d6982ff4..dd64f1374 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - (dtucker) [regress/test-exec.sh] Do not prepend an extra "/" to a fully- qualified sshd pathname since some systems (eg Cygwin) may consider "/foo" and "//foo" to be different. Spotted by vinschen at redhat.com. + - (tim) [configure.ac ] Not all gcc's support -Wsign-compare 20050821 - (dtucker) [configure.ac defines.h includes.h sftp.c] Add support for @@ -2950,4 +2951,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3876 2005/08/23 13:32:05 dtucker Exp $ +$Id: ChangeLog,v 1.3877 2005/08/24 00:11:26 tim Exp $ diff --git a/configure.ac b/configure.ac index 619a4e76a..f1588c693 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.287 2005/08/22 22:06:56 dtucker Exp $ +# $Id: configure.ac,v 1.288 2005/08/24 00:11:26 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -82,7 +82,13 @@ AC_CHECK_DECL(LLONG_MAX, have_llong_max=1, , [#include ]) if test "$GCC" = "yes" || test "$GCC" = "egcs"; then CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wuninitialized" - CFLAGS="$CFLAGS -Wsign-compare" + GCC_VER=`$CC --version` + case $GCC_VER in + 1.*) ;; + 2.8* | 2.9*) CFLAGS="$CFLAGS -Wsign-compare" ;; + 2.*) ;; + *) CFLAGS="$CFLAGS -Wsign-compare" ;; + esac if test -z "$have_llong_max"; then # retry LLONG_MAX with -std=gnu99, needed on some Linuxes -- cgit v1.2.3 From 2291c00ab2aef934391c23227645121719df4c4b Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Fri, 26 Aug 2005 13:15:19 -0700 Subject: - (tim) [CREDITS LICENCE auth.c configure.ac defines.h includes.h session.c openbsd-compat/Makefile.in openbsd-compat/openbsd-compat.h openbsd-compat/xcrypt.c] New files [openssh/openbsd-compat/port-uw.c openssh/openbsd-compat/port-uw.h] Support long passwords (> 8-char) on UnixWare 7 from Dhiraj Gulati and Ahsan Rashid. Cleanup and testing by tim@. Feedback and OK dtucker@ --- CREDITS | 4 +- ChangeLog | 10 +++- LICENCE | 1 + auth.c | 4 ++ configure.ac | 6 ++- defines.h | 6 ++- includes.h | 4 ++ openbsd-compat/Makefile.in | 4 +- openbsd-compat/openbsd-compat.h | 3 +- openbsd-compat/port-uw.c | 115 ++++++++++++++++++++++++++++++++++++++++ openbsd-compat/port-uw.h | 30 +++++++++++ openbsd-compat/xcrypt.c | 4 ++ session.c | 5 ++ 13 files changed, 189 insertions(+), 7 deletions(-) create mode 100644 openbsd-compat/port-uw.c create mode 100644 openbsd-compat/port-uw.h (limited to 'configure.ac') diff --git a/CREDITS b/CREDITS index 2a77b8729..82b9f2210 100644 --- a/CREDITS +++ b/CREDITS @@ -3,6 +3,7 @@ Tatu Ylonen - Creator of SSH Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt, and Dug Song - Creators of OpenSSH +Ahsan Rashid - UnixWare long passwords Alain St-Denis - Irix fix Alexandre Oliva - AIX fixes Andre Lucas - new login code, many fixes @@ -32,6 +33,7 @@ David Del Piero - bug fixes David Hesprich - Configure fixes David Rankin - libwrap, AIX, NetBSD fixes Dag-Erling Smørgrav - Challenge-Response PAM code. +Dhiraj Gulati - UnixWare long passwords Ed Eden - configure fixes Garrick James - configure fixes Gary E. Miller - SCO support @@ -98,5 +100,5 @@ Apologies to anyone I have missed. Damien Miller -$Id: CREDITS,v 1.79 2004/05/26 23:59:31 dtucker Exp $ +$Id: CREDITS,v 1.80 2005/08/26 20:15:20 tim Exp $ diff --git a/ChangeLog b/ChangeLog index 5c9182c23..d0ef8312e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +20050826 + - (tim) [CREDITS LICENCE auth.c configure.ac defines.h includes.h session.c + openbsd-compat/Makefile.in openbsd-compat/openbsd-compat.h + openbsd-compat/xcrypt.c] New files [openssh/openbsd-compat/port-uw.c + openssh/openbsd-compat/port-uw.h] Support long passwords (> 8-char) + on UnixWare 7 from Dhiraj Gulati and Ahsan Rashid. Cleanup and testing + by tim@. Feedback and OK dtucker@ + 20050823 - (dtucker) [regress/test-exec.sh] Do not prepend an extra "/" to a fully- qualified sshd pathname since some systems (eg Cygwin) may consider "/foo" @@ -2953,4 +2961,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3878 2005/08/24 00:18:21 tim Exp $ +$Id: ChangeLog,v 1.3879 2005/08/26 20:15:19 tim Exp $ diff --git a/LICENCE b/LICENCE index 5def839e5..ac3634f22 100644 --- a/LICENCE +++ b/LICENCE @@ -204,6 +204,7 @@ OpenSSH contains no GPL code. William Jones Darren Tucker Sun Microsystems + The SCO Group * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions diff --git a/auth.c b/auth.c index 82fe8f06b..d62d8ff22 100644 --- a/auth.c +++ b/auth.c @@ -97,7 +97,11 @@ allowed_user(struct passwd * pw) /* grab passwd field for locked account check */ #ifdef USE_SHADOW if (spw != NULL) +#ifdef HAVE_LIBIAF + passwd = get_iaf_password(pw); +#else passwd = spw->sp_pwdp; +#endif /* HAVE_LIBIAF */ #else passwd = pw->pw_passwd; #endif diff --git a/configure.ac b/configure.ac index f1588c693..c9c8218d3 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.288 2005/08/24 00:11:26 tim Exp $ +# $Id: configure.ac,v 1.289 2005/08/26 20:15:20 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -446,6 +446,8 @@ mips-sony-bsd|mips-sony-newsos4) ;; # UnixWare 7.x, OpenUNIX 8 *-*-sysv5*) + check_for_libcrypt_later=1 + AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) AC_DEFINE(USE_PIPES) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) @@ -643,6 +645,7 @@ AC_CHECK_HEADERS( \ getopt.h \ glob.h \ ia.h \ + iaf.h \ lastlog.h \ limits.h \ login.h \ @@ -1721,6 +1724,7 @@ if test "x$check_for_libcrypt_later" = "x1"; then AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") fi +AC_CHECK_LIB(iaf, ia_openinfo) ### Configure cryptographic random number support diff --git a/defines.h b/defines.h index 670fc3fe5..8d3617d06 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.125 2005/08/24 00:18:21 tim Exp $ */ +/* $Id: defines.h,v 1.126 2005/08/26 20:15:20 tim Exp $ */ /* Constants */ @@ -688,6 +688,10 @@ struct winsize { # define CUSTOM_SYS_AUTH_PASSWD 1 #endif +#ifdef UNIXWARE_LONG_PASSWORDS +# define CUSTOM_SYS_AUTH_PASSWD 1 +#endif + /* HP-UX 11.11 */ #ifdef BTMP_FILE # define _PATH_BTMP BTMP_FILE diff --git a/includes.h b/includes.h index 9408fec9a..fa65aa38d 100644 --- a/includes.h +++ b/includes.h @@ -169,6 +169,10 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "\100(#)" msg } # include #endif +#ifdef HAVE_IAF_H +# include +#endif + #ifdef HAVE_TMPDIR_H # include #endif diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index c6e08867c..6f5ee2845 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.34 2005/06/09 11:45:11 dtucker Exp $ +# $Id: Makefile.in,v 1.35 2005/08/26 20:15:20 tim Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -20,7 +20,7 @@ OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgroupl COMPAT=bsd-arc4random.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o -PORTS=port-irix.o port-aix.o +PORTS=port-irix.o port-aix.o port-uw.o .c.o: $(CC) $(CFLAGS) $(CPPFLAGS) -c $< diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index e66f5ec55..ba68bc27e 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.29 2005/06/17 11:15:21 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.30 2005/08/26 20:15:20 tim Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -173,5 +173,6 @@ char *shadow_pw(struct passwd *pw); #include "bsd-cygwin_util.h" #include "port-irix.h" #include "port-aix.h" +#include "port-uw.h" #endif /* _OPENBSD_COMPAT_H */ diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c new file mode 100644 index 000000000..cbc3f686b --- /dev/null +++ b/openbsd-compat/port-uw.c @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2005 The SCO Group. All rights reserved. + * Copyright (c) 2005 Tim Rice. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. + */ + +#include "includes.h" + +#ifdef UNIXWARE_LONG_PASSWORDS +#ifdef HAVE_CRYPT_H +#include +#endif +#include "packet.h" +#include "buffer.h" +#include "log.h" +#include "servconf.h" +#include "auth.h" +#include "auth-options.h" + +int nischeck(char *); + +int +sys_auth_passwd(Authctxt *authctxt, const char *password) +{ + struct passwd *pw = authctxt->pw; + char *encrypted_password; + char *salt; + + /* Just use the supplied fake password if authctxt is invalid */ + char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; + + /* Check for users with no password. */ + if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0) + return (1); + + salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx"; + if (nischeck(pw->pw_name)) + return(strcmp(crypt(password, salt), pw_password) == 0); + else + return(strcmp(bigcrypt(password, salt), pw_password) == 0); +} + +int +nischeck(char *namep) +{ + char password_file[] = "/etc/passwd"; + FILE *fd; + struct passwd *ent = NULL; + + if ((fd = fopen (password_file, "r")) == NULL) { + /* + * If the passwd file has dissapeared we are in a bad state. + * However, returning 0 will send us back through the + * authentication scheme that has checked the ia database for + * passwords earlier. + */ + return(0); + } + + /* + * fgetpwent() only reads from password file, so we know for certain + * that the user is local. + */ + while (ent = fgetpwent(fd)) { + if (strcmp (ent->pw_name, namep) == 0) { + /* Local user */ + fclose (fd); + return(0); + } + } + + fclose (fd); + return (1); +} + +#endif /* UNIXWARE_LONG_PASSWORDS */ + +#ifdef HAVE_LIBIAF +char * +get_iaf_password(struct passwd *pw) +{ + char *pw_password = NULL; + + uinfo_t uinfo; + if (!ia_openinfo(pw->pw_name,&uinfo)) { + ia_get_logpwd(uinfo, &pw_password); + if (pw_password == NULL) + fatal("Unable to get the shadow passwd"); + ia_closeinfo(uinfo); + return pw_password; + } + else + fatal("Unable to open the shadow passwd file"); +} +#endif /* HAVE_LIBIAF */ + diff --git a/openbsd-compat/port-uw.h b/openbsd-compat/port-uw.h new file mode 100644 index 000000000..f16bb5e5c --- /dev/null +++ b/openbsd-compat/port-uw.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2005 Tim Rice. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. + */ + +#include "includes.h" + +#ifdef HAVE_LIBIAF +char * get_iaf_password(struct passwd *pw); +#endif /* HAVE_LIBIAF */ + diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index c3cea3c86..453203270 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c @@ -91,7 +91,11 @@ shadow_pw(struct passwd *pw) struct spwd *spw = getspnam(pw->pw_name); if (spw != NULL) +#ifdef HAVE_LIBIAF + pw_password = get_iaf_password(pw); +#else pw_password = spw->sp_pwdp; +#endif /* HAVE_LIBIAF */ # endif # if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) struct passwd_adjunct *spw; diff --git a/session.c b/session.c index 95084aec6..98bd3121c 100644 --- a/session.c +++ b/session.c @@ -1334,6 +1334,11 @@ do_setusercontext(struct passwd *pw) # ifdef _AIX aix_usrinfo(pw); # endif /* _AIX */ +# ifdef HAVE_LIBIAF + if (set_id(pw->pw_name) != 0) { + exit(1); + } +# endif /* Permanently switch to the desired uid. */ permanently_set_uid(pw); #endif -- cgit v1.2.3 From 2016865b954c83ddcdc76ebeef3a5fe3dfd6d9d2 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 29 Aug 2005 17:17:37 -0700 Subject: - (tim) [configure.ac] ia_openinfo() seems broken on OSR6. Limit UW long password support to 7.x for now. --- ChangeLog | 6 +++++- configure.ac | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index d0ef8312e..9f92885b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20050829 + - (tim) [configure.ac] ia_openinfo() seems broken on OSR6. Limit UW long + password support to 7.x for now. + 20050826 - (tim) [CREDITS LICENCE auth.c configure.ac defines.h includes.h session.c openbsd-compat/Makefile.in openbsd-compat/openbsd-compat.h @@ -2961,4 +2965,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3879 2005/08/26 20:15:19 tim Exp $ +$Id: ChangeLog,v 1.3880 2005/08/30 00:17:37 tim Exp $ diff --git a/configure.ac b/configure.ac index c9c8218d3..d20ec1507 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.289 2005/08/26 20:15:20 tim Exp $ +# $Id: configure.ac,v 1.290 2005/08/30 00:17:38 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -446,8 +446,6 @@ mips-sony-bsd|mips-sony-newsos4) ;; # UnixWare 7.x, OpenUNIX 8 *-*-sysv5*) - check_for_libcrypt_later=1 - AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) AC_DEFINE(USE_PIPES) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) @@ -457,6 +455,10 @@ mips-sony-bsd|mips-sony-newsos4) *-*-sysv5SCO_SV*) # SCO OpenServer 6.x TEST_SHELL=/u95/bin/sh ;; + *-*-sysv5*) + check_for_libcrypt_later=1 + AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) + ;; esac ;; *-*-sysv*) -- cgit v1.2.3 From eb456545fd5365297ede22d28afbedcc1eb3d482 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Tue, 30 Aug 2005 07:12:02 -0700 Subject: - (tim) [configure.ac] Back out last change. It needs to be done differently. --- ChangeLog | 5 ++++- configure.ac | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 9f92885b1..3b3ec2bcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20050830 + - (tim) [configure.ac] Back out last change. It needs to be done differently. + 20050829 - (tim) [configure.ac] ia_openinfo() seems broken on OSR6. Limit UW long password support to 7.x for now. @@ -2965,4 +2968,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3880 2005/08/30 00:17:37 tim Exp $ +$Id: ChangeLog,v 1.3881 2005/08/30 14:12:02 tim Exp $ diff --git a/configure.ac b/configure.ac index d20ec1507..2834c5802 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.290 2005/08/30 00:17:38 tim Exp $ +# $Id: configure.ac,v 1.291 2005/08/30 14:12:02 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -446,6 +446,8 @@ mips-sony-bsd|mips-sony-newsos4) ;; # UnixWare 7.x, OpenUNIX 8 *-*-sysv5*) + check_for_libcrypt_later=1 + AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) AC_DEFINE(USE_PIPES) AC_DEFINE(SETEUID_BREAKS_SETUID) AC_DEFINE(BROKEN_SETREUID) @@ -455,10 +457,6 @@ mips-sony-bsd|mips-sony-newsos4) *-*-sysv5SCO_SV*) # SCO OpenServer 6.x TEST_SHELL=/u95/bin/sh ;; - *-*-sysv5*) - check_for_libcrypt_later=1 - AC_DEFINE(UNIXWARE_LONG_PASSWORDS, 1, [Support passwords > 8 chars]) - ;; esac ;; *-*-sysv*) -- cgit v1.2.3 From 66fd217e8e57f0c86179d77dc14e42efd3098320 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Wed, 31 Aug 2005 09:59:49 -0700 Subject: - (tim) [configure.ac auth.c defines.h session.c openbsd-compat/port-uw.c openbsd-compat/port-uw.h openbsd-compat/xcrypt.c] libiaf cleanup. Disable libiaf bits for OpenServer6. Free memory allocated by ia_get_logpwd(). Feedback and OK dtucker@ --- ChangeLog | 8 ++++++-- auth.c | 7 +++++-- configure.ac | 3 ++- defines.h | 4 ++-- openbsd-compat/port-uw.c | 35 +++++++++++++++++++++++++++-------- openbsd-compat/port-uw.h | 4 ++-- openbsd-compat/xcrypt.c | 9 +++++---- session.c | 4 ++-- 8 files changed, 51 insertions(+), 23 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 139934ca1..8f3ffeda0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -20050830 +20050831 - (djm) OpenBSD CVS Sync - djm@cvs.openbsd.org 2005/08/30 22:08:05 [gss-serv.c sshconnect2.c] @@ -11,6 +11,10 @@ [version.h] 4.2 - (dtucker) [README] Update release note URL to 4.2 + - (tim) [configure.ac auth.c defines.h session.c openbsd-compat/port-uw.c + openbsd-compat/port-uw.h openbsd-compat/xcrypt.c] libiaf cleanup. Disable + libiaf bits for OpenServer6. Free memory allocated by ia_get_logpwd(). + Feedback and OK dtucker@ 20050830 - (tim) [configure.ac] Back out last change. It needs to be done differently. @@ -2982,4 +2986,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3885 2005/08/31 14:05:56 dtucker Exp $ +$Id: ChangeLog,v 1.3886 2005/08/31 16:59:49 tim Exp $ diff --git a/auth.c b/auth.c index d62d8ff22..2dc5c2be6 100644 --- a/auth.c +++ b/auth.c @@ -97,11 +97,11 @@ allowed_user(struct passwd * pw) /* grab passwd field for locked account check */ #ifdef USE_SHADOW if (spw != NULL) -#ifdef HAVE_LIBIAF +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) passwd = get_iaf_password(pw); #else passwd = spw->sp_pwdp; -#endif /* HAVE_LIBIAF */ +#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ #else passwd = pw->pw_passwd; #endif @@ -123,6 +123,9 @@ allowed_user(struct passwd * pw) if (strstr(passwd, LOCKED_PASSWD_SUBSTR)) locked = 1; #endif +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) + free(passwd); +#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ if (locked) { logit("User %.100s not allowed because account is locked", pw->pw_name); diff --git a/configure.ac b/configure.ac index 2834c5802..1e4df2e33 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.291 2005/08/30 14:12:02 tim Exp $ +# $Id: configure.ac,v 1.292 2005/08/31 16:59:49 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -456,6 +456,7 @@ mips-sony-bsd|mips-sony-newsos4) case "$host" in *-*-sysv5SCO_SV*) # SCO OpenServer 6.x TEST_SHELL=/u95/bin/sh + AC_DEFINE(BROKEN_LIBIAF, 1, [ia_uinfo routines not supported by OS yet]) ;; esac ;; diff --git a/defines.h b/defines.h index 8d3617d06..408b988b5 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.126 2005/08/26 20:15:20 tim Exp $ */ +/* $Id: defines.h,v 1.127 2005/08/31 16:59:49 tim Exp $ */ /* Constants */ @@ -688,7 +688,7 @@ struct winsize { # define CUSTOM_SYS_AUTH_PASSWD 1 #endif -#ifdef UNIXWARE_LONG_PASSWORDS +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) # define CUSTOM_SYS_AUTH_PASSWD 1 #endif diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c index cbc3f686b..d881ff028 100644 --- a/openbsd-compat/port-uw.c +++ b/openbsd-compat/port-uw.c @@ -25,7 +25,7 @@ #include "includes.h" -#ifdef UNIXWARE_LONG_PASSWORDS +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) #ifdef HAVE_CRYPT_H #include #endif @@ -44,6 +44,7 @@ sys_auth_passwd(Authctxt *authctxt, const char *password) struct passwd *pw = authctxt->pw; char *encrypted_password; char *salt; + int result; /* Just use the supplied fake password if authctxt is invalid */ char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; @@ -52,13 +53,27 @@ sys_auth_passwd(Authctxt *authctxt, const char *password) if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0) return (1); + /* Encrypt the candidate password using the proper salt. */ salt = (pw_password[0] && pw_password[1]) ? pw_password : "xx"; - if (nischeck(pw->pw_name)) - return(strcmp(crypt(password, salt), pw_password) == 0); +#ifdef UNIXWARE_LONG_PASSWORDS + if (!nischeck(pw->pw_name)) + encrypted_password = bigcrypt(password, salt); else - return(strcmp(bigcrypt(password, salt), pw_password) == 0); +#endif /* UNIXWARE_LONG_PASSWORDS */ + encrypted_password = xcrypt(password, salt); + + /* + * Authentication is accepted if the encrypted passwords + * are identical. + */ + result = (strcmp(encrypted_password, pw_password) == 0); + + if (authctxt->valid) + free(pw_password); + return(result); } +#ifdef UNIXWARE_LONG_PASSWORDS int nischeck(char *namep) { @@ -94,7 +109,11 @@ nischeck(char *namep) #endif /* UNIXWARE_LONG_PASSWORDS */ -#ifdef HAVE_LIBIAF +/* + NOTE: ia_get_logpwd() allocates memory for arg 2 + functions that call shadow_pw() will need to free + */ + char * get_iaf_password(struct passwd *pw) { @@ -104,12 +123,12 @@ get_iaf_password(struct passwd *pw) if (!ia_openinfo(pw->pw_name,&uinfo)) { ia_get_logpwd(uinfo, &pw_password); if (pw_password == NULL) - fatal("Unable to get the shadow passwd"); + fatal("ia_get_logpwd: Unable to get the shadow passwd"); ia_closeinfo(uinfo); return pw_password; } else - fatal("Unable to open the shadow passwd file"); + fatal("ia_openinfo: Unable to open the shadow passwd file"); } -#endif /* HAVE_LIBIAF */ +#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ diff --git a/openbsd-compat/port-uw.h b/openbsd-compat/port-uw.h index f16bb5e5c..3589b2e44 100644 --- a/openbsd-compat/port-uw.h +++ b/openbsd-compat/port-uw.h @@ -24,7 +24,7 @@ #include "includes.h" -#ifdef HAVE_LIBIAF +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) char * get_iaf_password(struct passwd *pw); -#endif /* HAVE_LIBIAF */ +#endif diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index 453203270..9afa0b9f2 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c @@ -91,12 +91,13 @@ shadow_pw(struct passwd *pw) struct spwd *spw = getspnam(pw->pw_name); if (spw != NULL) -#ifdef HAVE_LIBIAF - pw_password = get_iaf_password(pw); -#else pw_password = spw->sp_pwdp; -#endif /* HAVE_LIBIAF */ # endif + +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) + return(get_iaf_password(pw)); +#endif + # if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) struct passwd_adjunct *spw; if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL) diff --git a/session.c b/session.c index 98bd3121c..db8722f47 100644 --- a/session.c +++ b/session.c @@ -1334,11 +1334,11 @@ do_setusercontext(struct passwd *pw) # ifdef _AIX aix_usrinfo(pw); # endif /* _AIX */ -# ifdef HAVE_LIBIAF +#if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) if (set_id(pw->pw_name) != 0) { exit(1); } -# endif +#endif /* HAVE_LIBIAF && !BROKEN_LIBIAF */ /* Permanently switch to the desired uid. */ permanently_set_uid(pw); #endif -- cgit v1.2.3