From ce1c9574fcfaf753a062276867335c1e237f725c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 18 Apr 2013 21:36:19 +1000 Subject: - (dtucker) [configure.ac] Use -Qunused-arguments to suppress warnings from unused argument warnings (in particular, -fno-builtin-memset) from clang. --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5db4b623b..9777d597f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.519 2013/03/22 01:49:15 dtucker Exp $ +# $Id: configure.ac,v 1.520 2013/04/18 11:36:20 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.519 $) +AC_REVISION($Revision: 1.520 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -137,6 +137,7 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) + OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) AC_MSG_CHECKING([gcc version]) GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` -- cgit v1.2.3 From 6332da2ae88db623d7da8070dd807efa26d9dfe8 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Tue, 23 Apr 2013 14:25:52 +1000 Subject: - (djm) [auth.c configure.ac misc.c monitor.c monitor_wrap.c] Support platforms, such as Android, that lack struct passwd.pw_gecos. Report and initial patch from Nathan Osman bz#2086; feedback tim@ ok dtucker@ --- ChangeLog | 5 +++++ auth.c | 4 +++- configure.ac | 54 +++++++++++------------------------------------------- misc.c | 8 +++++--- monitor.c | 4 +++- monitor_wrap.c | 4 +++- 6 files changed, 30 insertions(+), 49 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index cfd95e449..3fd81aa35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +20130423 + - (djm) [auth.c configure.ac misc.c monitor.c monitor_wrap.c] Support + platforms, such as Android, that lack struct passwd.pw_gecos. Report + and initial patch from Nathan Osman bz#2086; feedback tim@ ok dtucker@ + 20130418 - (djm) [config.guess config.sub] Update to last versions before they switch to GPL3. ok dtucker@ diff --git a/auth.c b/auth.c index 6128fa460..666c493dc 100644 --- a/auth.c +++ b/auth.c @@ -721,10 +721,12 @@ fakepw(void) fake.pw_name = "NOUSER"; fake.pw_passwd = "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK"; +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS fake.pw_gecos = "NOUSER"; +#endif fake.pw_uid = privsep_pw == NULL ? (uid_t)-1 : privsep_pw->pw_uid; fake.pw_gid = privsep_pw == NULL ? (gid_t)-1 : privsep_pw->pw_gid; -#ifdef HAVE_PW_CLASS_IN_PASSWD +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS fake.pw_class = ""; #endif fake.pw_dir = "/nonexist"; diff --git a/configure.ac b/configure.ac index 9777d597f..c30d547d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.520 2013/04/18 11:36:20 dtucker Exp $ +# $Id: configure.ac,v 1.521 2013/04/23 04:25:53 djm Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.520 $) +AC_REVISION($Revision: 1.521 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -3303,9 +3303,16 @@ OSSH_CHECK_HEADER_FOR_FIELD([ut_time], [utmpx.h], [HAVE_TIME_IN_UTMPX]) OSSH_CHECK_HEADER_FOR_FIELD([ut_tv], [utmpx.h], [HAVE_TV_IN_UTMPX]) AC_CHECK_MEMBERS([struct stat.st_blksize]) +AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_class, +struct passwd.pw_change, struct passwd.pw_expire], +[], [], [[ +#include +#include +]]) + AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [state], [Define if we don't have struct __res_state in resolv.h])], -[ +[[ #include #if HAVE_SYS_TYPES_H # include @@ -3313,7 +3320,7 @@ AC_CHECK_MEMBER([struct __res_state.retrans], [], [AC_DEFINE([__res_state], [sta #include #include #include -]) +]]) AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage], ac_cv_have_ss_family_in_struct_ss, [ @@ -3343,45 +3350,6 @@ if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then [Fields in struct sockaddr_storage]) fi -AC_CACHE_CHECK([for pw_class field in struct passwd], - ac_cv_have_pw_class_in_struct_passwd, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], - [[ struct passwd p; p.pw_class = 0; ]])], - [ ac_cv_have_pw_class_in_struct_passwd="yes" ], - [ ac_cv_have_pw_class_in_struct_passwd="no" - ]) -]) -if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then - AC_DEFINE([HAVE_PW_CLASS_IN_PASSWD], [1], - [Define if your password has a pw_class field]) -fi - -AC_CACHE_CHECK([for pw_expire field in struct passwd], - ac_cv_have_pw_expire_in_struct_passwd, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], - [[ struct passwd p; p.pw_expire = 0; ]])], - [ ac_cv_have_pw_expire_in_struct_passwd="yes" ], - [ ac_cv_have_pw_expire_in_struct_passwd="no" - ]) -]) -if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then - AC_DEFINE([HAVE_PW_EXPIRE_IN_PASSWD], [1], - [Define if your password has a pw_expire field]) -fi - -AC_CACHE_CHECK([for pw_change field in struct passwd], - ac_cv_have_pw_change_in_struct_passwd, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], - [[ struct passwd p; p.pw_change = 0; ]])], - [ ac_cv_have_pw_change_in_struct_passwd="yes" ], - [ ac_cv_have_pw_change_in_struct_passwd="no" - ]) -]) -if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then - AC_DEFINE([HAVE_PW_CHANGE_IN_PASSWD], [1], - [Define if your password has a pw_change field]) -fi - dnl make sure we're using the real structure members and not defines AC_CACHE_CHECK([for msg_accrights field in struct msghdr], ac_cv_have_accrights_in_msghdr, [ diff --git a/misc.c b/misc.c index a7a23dcc6..9e287433a 100644 --- a/misc.c +++ b/misc.c @@ -206,16 +206,18 @@ pwcopy(struct passwd *pw) copy->pw_name = xstrdup(pw->pw_name); copy->pw_passwd = xstrdup(pw->pw_passwd); +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS copy->pw_gecos = xstrdup(pw->pw_gecos); +#endif copy->pw_uid = pw->pw_uid; copy->pw_gid = pw->pw_gid; -#ifdef HAVE_PW_EXPIRE_IN_PASSWD +#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE copy->pw_expire = pw->pw_expire; #endif -#ifdef HAVE_PW_CHANGE_IN_PASSWD +#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE copy->pw_change = pw->pw_change; #endif -#ifdef HAVE_PW_CLASS_IN_PASSWD +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS copy->pw_class = xstrdup(pw->pw_class); #endif copy->pw_dir = xstrdup(pw->pw_dir); diff --git a/monitor.c b/monitor.c index 8006b833c..6560740b6 100644 --- a/monitor.c +++ b/monitor.c @@ -778,8 +778,10 @@ mm_answer_pwnamallow(int sock, Buffer *m) buffer_put_string(m, pwent, sizeof(struct passwd)); buffer_put_cstring(m, pwent->pw_name); buffer_put_cstring(m, "*"); +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS buffer_put_cstring(m, pwent->pw_gecos); -#ifdef HAVE_PW_CLASS_IN_PASSWD +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS buffer_put_cstring(m, pwent->pw_class); #endif buffer_put_cstring(m, pwent->pw_dir); diff --git a/monitor_wrap.c b/monitor_wrap.c index ea654a73f..3304f5bf2 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -259,8 +259,10 @@ mm_getpwnamallow(const char *username) fatal("%s: struct passwd size mismatch", __func__); pw->pw_name = buffer_get_string(&m, NULL); pw->pw_passwd = buffer_get_string(&m, NULL); +#ifdef HAVE_STRUCT_PASSWD_PW_GECOS pw->pw_gecos = buffer_get_string(&m, NULL); -#ifdef HAVE_PW_CLASS_IN_PASSWD +#endif +#ifdef HAVE_STRUCT_PASSWD_PW_CLASS pw->pw_class = buffer_get_string(&m, NULL); #endif pw->pw_dir = buffer_get_string(&m, NULL); -- cgit v1.2.3 From abbc7a7c02e45787d023f50a30f62d7a3e14fe9e Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 10 May 2013 13:54:23 +1000 Subject: - (dtucker) [configure.ac] Enable -Wsizeof-pointer-memaccess if the compiler supports it. Mentioned by Colin Watson in bz#2100, ok djm. --- ChangeLog | 4 ++++ configure.ac | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 9865d41b2..dbc9679bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20130510 + - (dtucker) [configure.ac] Enable -Wsizeof-pointer-memaccess if the compiler + supports it. Mentioned by Colin Watson in bz#2100, ok djm. + 20130423 - (djm) [auth.c configure.ac misc.c monitor.c monitor_wrap.c] Support platforms, such as Android, that lack struct passwd.pw_gecos. Report diff --git a/configure.ac b/configure.ac index c30d547d9..93c50e085 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.521 2013/04/23 04:25:53 djm Exp $ +# $Id: configure.ac,v 1.522 2013/05/10 03:54:23 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.521 $) +AC_REVISION($Revision: 1.522 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -134,6 +134,7 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) OSSH_CHECK_CFLAG_COMPILE([-Wsign-compare]) OSSH_CHECK_CFLAG_COMPILE([-Wformat-security]) + OSSH_CHECK_CFLAG_COMPILE([-Wsizeof-pointer-memaccess]) OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) -- cgit v1.2.3 From c54e3e0741a27119b3badd8ff92b1988b7e9bd50 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Fri, 10 May 2013 18:53:14 +1000 Subject: - (dtucker) [configure.ac] Add -Werror to the -Qunused-arguments test so we don't get a warning on compilers that *don't* support it. Add -Wno-unknown-warning-option. Move both to the start of the list for maximum noise suppression. Tested with gcc 4.6.3, gcc 2.95.4 and clang 2.9. --- ChangeLog | 4 ++++ configure.ac | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index d03a43527..94a23fb1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,10 @@ in to use it when we're using our own getopt. - (dtucker) [kex.c] Only include sha256 and ECC key exchange methods when the underlying libraries support them. + - (dtucker) [configure.ac] Add -Werror to the -Qunused-arguments test so + we don't get a warning on compilers that *don't* support it. Add + -Wno-unknown-warning-option. Move both to the start of the list for + maximum noise suppression. Tested with gcc 4.6.3, gcc 2.95.4 and clang 2.9. 20130423 - (djm) [auth.c configure.ac misc.c monitor.c monitor_wrap.c] Support diff --git a/configure.ac b/configure.ac index 93c50e085..6bcbef638 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.522 2013/05/10 03:54:23 dtucker Exp $ +# $Id: configure.ac,v 1.523 2013/05/10 08:53:14 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.522 $) +AC_REVISION($Revision: 1.523 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -129,6 +129,10 @@ AC_ARG_WITH([stackprotect], if test "$GCC" = "yes" || test "$GCC" = "egcs"; then + OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments -Werror], + [-Qunused-arguments]) + OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option -Werror], + [-Wno-unknown-warning-option]) OSSH_CHECK_CFLAG_COMPILE([-Wall]) OSSH_CHECK_CFLAG_COMPILE([-Wpointer-arith]) OSSH_CHECK_CFLAG_COMPILE([-Wuninitialized]) @@ -138,7 +142,6 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then OSSH_CHECK_CFLAG_COMPILE([-Wpointer-sign], [-Wno-pointer-sign]) OSSH_CHECK_CFLAG_COMPILE([-Wunused-result], [-Wno-unused-result]) OSSH_CHECK_CFLAG_COMPILE([-fno-strict-aliasing]) - OSSH_CHECK_CFLAG_COMPILE([-Qunused-arguments]) OSSH_CHECK_CFLAG_COMPILE([-D_FORTIFY_SOURCE=2]) AC_MSG_CHECKING([gcc version]) GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'` -- cgit v1.2.3 From e194ba4111ffd47cd1f4c8be1ddc8a4cb673d005 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 16 May 2013 20:47:31 +1000 Subject: - (dtucker) [configure.ac readconf.c servconf.c openbsd-compat/openbsd-compat.h] Add compat bits for scan_scaled. --- ChangeLog | 2 ++ configure.ac | 7 ++++--- openbsd-compat/openbsd-compat.h | 6 +++++- readconf.c | 2 ++ servconf.c | 2 ++ 5 files changed, 15 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 845a6a28d..1779aa748 100644 --- a/ChangeLog +++ b/ChangeLog @@ -50,6 +50,8 @@ - dtucker@cvs.openbsd.org 2013/05/16 09:12:31 [readconf.c servconf.c] switch RekeyLimit traffic volume parsing to scan_scaled. ok djm@ + - (dtucker) [configure.ac readconf.c servconf.c + openbsd-compat/openbsd-compat.h] Add compat bits for scan_scaled. 20130510 - (dtucker) [configure.ac] Enable -Wsizeof-pointer-memaccess if the compiler diff --git a/configure.ac b/configure.ac index 6bcbef638..7d8adfcbc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.523 2013/05/10 08:53:14 dtucker Exp $ +# $Id: configure.ac,v 1.524 2013/05/16 10:47:32 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.523 $) +AC_REVISION($Revision: 1.524 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -1175,12 +1175,13 @@ AC_CHECK_FUNCS([utimes], dnl Checks for libutil functions AC_CHECK_HEADERS([bsd/libutil.h libutil.h]) AC_SEARCH_LIBS([fmt_scaled], [util bsd]) +AC_SEARCH_LIBS([scan_scaled], [util bsd]) AC_SEARCH_LIBS([login], [util bsd]) AC_SEARCH_LIBS([logout], [util bsd]) AC_SEARCH_LIBS([logwtmp], [util bsd]) AC_SEARCH_LIBS([openpty], [util bsd]) AC_SEARCH_LIBS([updwtmp], [util bsd]) -AC_CHECK_FUNCS([fmt_scaled login logout openpty updwtmp logwtmp]) +AC_CHECK_FUNCS([fmt_scaled scan_scaled login logout openpty updwtmp logwtmp]) AC_FUNC_STRFTIME diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 94d172aaa..3dbf1f244 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.56 2013/05/10 08:08:49 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.57 2013/05/16 10:47:32 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -111,6 +111,10 @@ char *dirname(const char *path); int fmt_scaled(long long number, char *result); #endif +#ifndef HAVE_SCAN_SCALED +int scan_scaled(char *, long long *); +#endif + #if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA) char *inet_ntoa(struct in_addr in); #endif diff --git a/readconf.c b/readconf.c index dccf3ba16..cbc1981ab 100644 --- a/readconf.c +++ b/readconf.c @@ -30,7 +30,9 @@ #include #include #include +#ifdef HAVE_UTIL_H #include +#endif #include "xmalloc.h" #include "ssh.h" diff --git a/servconf.c b/servconf.c index 145239342..b2123c6c7 100644 --- a/servconf.c +++ b/servconf.c @@ -30,7 +30,9 @@ #include #include #include +#ifdef HAVE_UTIL_H #include +#endif #include "openbsd-compat/sys-queue.h" #include "xmalloc.h" -- cgit v1.2.3 From efdf5342143a887013a1daae583167dadf6752a7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 30 May 2013 08:29:08 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null implementation of endgrent for platforms that don't have it (eg Android). Loosely based on a patch from Nathan Osman, ok djm --- ChangeLog | 4 ++++ configure.ac | 5 +++-- openbsd-compat/bsd-misc.h | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 50054ef01..ef4dc7050 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ + 20130529 + - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null + implementation of endgrent for platforms that don't have it (eg Android). + Loosely based on a patch from Nathan Osman, ok djm 20130517 - (dtucker) OpenBSD CVS Sync - djm@cvs.openbsd.org 2013/03/07 00:20:34 diff --git a/configure.ac b/configure.ac index 7d8adfcbc..13c055849 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.524 2013/05/16 10:47:32 dtucker Exp $ +# $Id: configure.ac,v 1.525 2013/05/29 22:29:09 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.524 $) +AC_REVISION($Revision: 1.525 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -1531,6 +1531,7 @@ AC_CHECK_FUNCS([ \ clock \ closefrom \ dirfd \ + endgrent \ fchmod \ fchown \ freeaddrinfo \ diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 430066376..9ebd83c3a 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -1,4 +1,4 @@ -/* $Id: bsd-misc.h,v 1.23 2013/03/14 23:34:27 djm Exp $ */ +/* $Id: bsd-misc.h,v 1.24 2013/05/29 22:29:09 dtucker Exp $ */ /* * Copyright (c) 1999-2004 Damien Miller @@ -110,4 +110,8 @@ int isblank(int); pid_t getpgid(pid_t); #endif +#ifndef HAVE_ENDGRENT +# define endgrent() {} +#endif + #endif /* _BSD_MISC_H */ -- cgit v1.2.3 From c0c3373216801797053e123b5f62d35bf41b3611 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 2 Jun 2013 06:28:03 +1000 Subject: - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to using openssl's DES_crpyt function on platorms that don't have a native one, eg Android. Based on a patch from Nathan Osman. --- ChangeLog | 8 +++++++- configure.ac | 5 +++-- openbsd-compat/xcrypt.c | 7 ++++++- 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index ef4dc7050..58efd7b1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ - 20130529 +20130601 + - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to + using openssl's DES_crpyt function on platorms that don't have a native + one, eg Android. Based on a patch from Nathan Osman. + +20130529 - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null implementation of endgrent for platforms that don't have it (eg Android). Loosely based on a patch from Nathan Osman, ok djm + 20130517 - (dtucker) OpenBSD CVS Sync - djm@cvs.openbsd.org 2013/03/07 00:20:34 diff --git a/configure.ac b/configure.ac index 13c055849..c70c504f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.525 2013/05/29 22:29:09 dtucker Exp $ +# $Id: configure.ac,v 1.526 2013/06/01 20:28:04 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.525 $) +AC_REVISION($Revision: 1.526 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -2388,6 +2388,7 @@ fi if test "x$check_for_libcrypt_later" = "x1"; then AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"]) fi +AC_CHECK_FUNCS([crypt DES_crypt]) # Search for SHA256 support in libc and/or OpenSSL AC_CHECK_FUNCS([SHA256_Update EVP_sha256], [TEST_SSH_SHA256=yes], diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index 6291e2884..c8aea461d 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c @@ -55,7 +55,12 @@ # if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) # include "md5crypt.h" -# endif +# endif + +# if !defined(HAVE_CRYPT) && defined(HAVE_DES_CRYPT) +# include +# define crypt DES_crypt +# endif char * xcrypt(const char *password, const char *salt) -- cgit v1.2.3 From c7aad0058c957afeb26a3f703e8cb0eddeb62365 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 2 Jun 2013 07:18:47 +1000 Subject: - (dtucker) [configure.ac defines.h] Test for fd_mask, howmany and NFDBITS rather than trying to enumerate the plaforms that don't have them. Based on a patch from Nathan Osman, with help from tim@. --- ChangeLog | 3 +++ configure.ac | 39 +++++++++++++++++++++++++++++++++------ defines.h | 24 +++++++++++------------- 3 files changed, 47 insertions(+), 19 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 58efd7b1c..3fe13dfad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,9 @@ - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to using openssl's DES_crpyt function on platorms that don't have a native one, eg Android. Based on a patch from Nathan Osman. + - (dtucker) [configure.ac defines.h] Test for fd_mask, howmany and NFDBITS + rather than trying to enumerate the plaforms that don't have them. + Based on a patch from Nathan Osman, with help from tim@. 20130529 - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null diff --git a/configure.ac b/configure.ac index c70c504f9..d35a19bcc 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.526 2013/06/01 20:28:04 dtucker Exp $ +# $Id: configure.ac,v 1.527 2013/06/01 21:18:48 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.526 $) +AC_REVISION($Revision: 1.527 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -979,9 +979,6 @@ mips-sony-bsd|mips-sony-newsos4) *-*-nto-qnx*) AC_DEFINE([USE_PIPES]) AC_DEFINE([NO_X11_UNIX_SOCKETS]) - AC_DEFINE([MISSING_NFDBITS], [1], [Define on *nto-qnx systems]) - AC_DEFINE([MISSING_HOWMANY], [1], [Define on *nto-qnx systems]) - AC_DEFINE([MISSING_FD_MASK], [1], [Define on *nto-qnx systems]) AC_DEFINE([DISABLE_LASTLOG]) AC_DEFINE([SSHD_ACQUIRES_CTTY]) AC_DEFINE([BROKEN_SHADOW_EXPIRE], [1], [QNX shadow support is broken]) @@ -1002,7 +999,6 @@ mips-sony-bsd|mips-sony-newsos4) *-*-lynxos) CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__" - AC_DEFINE([MISSING_HOWMANY]) AC_DEFINE([BROKEN_SETVBUF], [1], [LynxOS has broken setvbuf() implementation]) ;; esac @@ -1703,6 +1699,37 @@ AC_CHECK_DECLS([offsetof], , , [ #include ]) +# extra bits for select(2) +AC_CHECK_DECLS([howmany, NFDBITS], [], [], [[ +#include +#include +#ifdef HAVE_SYS_SYSMACROS_H +#include +#endif +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + ]]) +AC_CHECK_TYPES([fd_mask], [], [], [[ +#include +#include +#ifdef HAVE_SYS_SELECT_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + ]]) + AC_CHECK_FUNCS([setresuid], [ dnl Some platorms have setresuid that isn't implemented, test for this AC_MSG_CHECKING([if setresuid seems to work]) diff --git a/defines.h b/defines.h index 64515c2ff..d5ce52f32 100644 --- a/defines.h +++ b/defines.h @@ -25,7 +25,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.171 2013/03/07 09:06:13 dtucker Exp $ */ +/* $Id: defines.h,v 1.172 2013/06/01 21:18:48 dtucker Exp $ */ /* Constants */ @@ -171,11 +171,6 @@ enum # define MAP_FAILED ((void *)-1) #endif -/* *-*-nto-qnx doesn't define this constant in the system headers */ -#ifdef MISSING_NFDBITS -# define NFDBITS (8 * sizeof(unsigned long)) -#endif - /* SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but including rpc/rpc.h breaks Solaris 6 @@ -355,11 +350,19 @@ struct winsize { }; #endif -/* *-*-nto-qnx does not define this type in the system headers */ -#ifdef MISSING_FD_MASK +/* bits needed for select that may not be in the system headers */ +#ifndef HAVE_FD_MASK typedef unsigned long int fd_mask; #endif +#if defined(HAVE_DECL_NFDBITS) && HAVE_DECL_NFDBITS == 0 +# define NFDBITS (8 * sizeof(unsigned long)) +#endif + +#if defined(HAVE_DECL_HOWMANY) && HAVE_DECL_HOWMANY == 0 +# define howmany(x,y) (((x)+((y)-1))/(y)) +#endif + /* Paths */ #ifndef _PATH_BSHELL @@ -484,11 +487,6 @@ struct winsize { # define __nonnull__(x) #endif -/* *-*-nto-qnx doesn't define this macro in the system headers */ -#ifdef MISSING_HOWMANY -# define howmany(x,y) (((x)+((y)-1))/(y)) -#endif - #ifndef OSSH_ALIGNBYTES #define OSSH_ALIGNBYTES (sizeof(int) - 1) #endif -- cgit v1.2.3 From a710891659202c82545e84725d4e5cd77aef567c Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 2 Jun 2013 08:18:31 +1000 Subject: - (dtucker) [configure.ac misc.c] Look for clock_gettime in librt and fall back to time(NULL) if we can't find it anywhere. --- ChangeLog | 2 ++ configure.ac | 7 +++++-- misc.c | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 7f4323e07..50ce1b736 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,8 @@ openbsd-compat/getrrsetbyname-ldns.c openbsd-compat/port-aix.c openbsd-compat/port-linux.c] Replace portable-specific instances of xfree with the equivalent calls to free. + - (dtucker) [configure.ac misc.c] Look for clock_gettime in librt and fall + back to time(NULL) if we can't find it anywhere. 20130529 - (dtucker) [configure.ac openbsd-compat/bsd-misc.h] bz#2087: Add a null diff --git a/configure.ac b/configure.ac index d35a19bcc..1b64d11ae 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.527 2013/06/01 21:18:48 dtucker Exp $ +# $Id: configure.ac,v 1.528 2013/06/01 22:18:32 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.527 $) +AC_REVISION($Revision: 1.528 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -1648,6 +1648,9 @@ const char *gai_strerror(int); AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1], [Some systems put nanosleep outside of libc])]) +AC_SEARCH_LIBS([clock_gettime], [rt], + [AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])]) + dnl Make sure prototypes are defined for these before using them. AC_CHECK_DECL([getrusage], [AC_CHECK_FUNCS([getrusage])]) AC_CHECK_DECL([strsep], diff --git a/misc.c b/misc.c index cd45e9ecc..fd745444e 100644 --- a/misc.c +++ b/misc.c @@ -857,12 +857,16 @@ ms_to_timeval(struct timeval *tv, int ms) time_t monotime(void) { +#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC) struct timespec ts; if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) fatal("clock_gettime: %s", strerror(errno)); return (ts.tv_sec); +#else + return time(NULL); +#endif } void -- cgit v1.2.3 From ef4901c3eb98c7ab1342c3cd8f2638da1f4b0678 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 3 Jun 2013 01:59:13 +1000 Subject: - (dtucker) [configure.ac] sys/un.h needs sys/socket.h on some platforms to prevent noise from configure. Patch from Nathan Osman. --- ChangeLog | 2 ++ configure.ac | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 03a2e3ad2..aaba117bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,8 @@ - dtucker@cvs.openbsd.org 2013/06/02 13:35:58 [ssh-agent.c] Make parent_alive_interval time_t to avoid signed/unsigned comparison + - (dtucker) [configure.ac] sys/un.h needs sys/socket.h on some platforms + to prevent noise from configure. Patch from Nathan Osman. 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/configure.ac b/configure.ac index 1b64d11ae..135242721 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.528 2013/06/01 22:18:32 dtucker Exp $ +# $Id: configure.ac,v 1.529 2013/06/02 15:59:13 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.528 $) +AC_REVISION($Revision: 1.529 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -348,7 +348,6 @@ AC_CHECK_HEADERS([ \ sys/sysmacros.h \ sys/time.h \ sys/timers.h \ - sys/un.h \ time.h \ tmpdir.h \ ttyent.h \ @@ -386,6 +385,11 @@ AC_CHECK_HEADERS([sys/mount.h], [], [], [ #include ]) +# Android requires sys/socket.h to be included before sys/un.h +AC_CHECK_HEADERS([sys/un.h], [], [], [ +#include +]) + # Messages for features tested for in target-specific section SIA_MSG="no" SPC_MSG="no" -- cgit v1.2.3 From 898ac935e56a7ac5d8b686c590fdb8b7aca27e59 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 3 Jun 2013 02:03:25 +1000 Subject: - (dtucker) [configure.ac] bz#2111: don't try to use lastlog on Android. Patch from Nathan Osman. --- ChangeLog | 4 +++- configure.ac | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index aaba117bf..329560a68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,9 @@ [ssh-agent.c] Make parent_alive_interval time_t to avoid signed/unsigned comparison - (dtucker) [configure.ac] sys/un.h needs sys/socket.h on some platforms - to prevent noise from configure. Patch from Nathan Osman. + to prevent noise from configure. Patch from Nathan Osman. (bz#2114). + - (dtucker) [configure.ac] bz#2111: don't try to use lastlog on Android. + Patch from Nathan Osman. 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/configure.ac b/configure.ac index 135242721..d6c57864c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.529 2013/06/02 15:59:13 dtucker Exp $ +# $Id: configure.ac,v 1.530 2013/06/02 16:03:26 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.529 $) +AC_REVISION($Revision: 1.530 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -491,6 +491,10 @@ case "$host" in AC_DEFINE([PTY_ZEROREAD], [1], [read(1) can return 0 for a non-closed fd]) AC_DEFINE([PLATFORM_SYS_DIR_UID], 2, [System dirs owned by bin (uid 2)]) ;; +*-*-android*) + AC_DEFINE([DISABLE_UTMP], [1], [Define if you don't want to use utmp]) + AC_DEFINE([DISABLE_WTMP], [1], [Define if you don't want to use wtmp]) + ;; *-*-cygwin*) check_for_libcrypt_later=1 LIBS="$LIBS /usr/lib/textreadmode.o" -- cgit v1.2.3 From 5ab9b63468100757479534edeb53f788a61fe08b Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 2 Jun 2013 14:05:48 -0700 Subject: - (tim) [configure.ac regress/Makefile] With rev 1.47 of test-exec.sh we need a shell that can handle "[ file1 -nt file2 ]". Rather than keep dealing with shell portability issues in regression tests, we let configure find us a capable shell on those platforms with an old /bin/sh. --- ChangeLog | 4 ++++ configure.ac | 10 ++++++---- regress/Makefile | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 329560a68..ccbb790b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,10 @@ to prevent noise from configure. Patch from Nathan Osman. (bz#2114). - (dtucker) [configure.ac] bz#2111: don't try to use lastlog on Android. Patch from Nathan Osman. + - (tim) [configure.ac regress/Makefile] With rev 1.47 of test-exec.sh we + need a shell that can handle "[ file1 -nt file2 ]". Rather than keep + dealing with shell portability issues in regression tests, we let + configure find us a capable shell on those platforms with an old /bin/sh. 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/configure.ac b/configure.ac index d6c57864c..b8a610d5c 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.530 2013/06/02 16:03:26 dtucker Exp $ +# $Id: configure.ac,v 1.531 2013/06/02 21:05:49 tim Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.530 $) +AC_REVISION($Revision: 1.531 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -812,6 +812,7 @@ mips-sony-bsd|mips-sony-newsos4) SP_MSG="yes" ], ) ], ) + TEST_SHELL=$SHELL # let configure find us a capable shell ;; *-*-sunos4*) CPPFLAGS="$CPPFLAGS -DSUNOS4" @@ -855,6 +856,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE([BROKEN_SETREGID]) AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd]) AC_DEFINE([LOCKED_PASSWD_STRING], ["*LK*"]) + TEST_SHELL=$SHELL # let configure find us a capable shell ;; # UnixWare 7.x, OpenUNIX 8 *-*-sysv5*) @@ -866,10 +868,10 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE([BROKEN_SETREUID]) AC_DEFINE([BROKEN_SETREGID]) AC_DEFINE([PASSWD_NEEDS_USERNAME]) + TEST_SHELL=$SHELL # let configure find us a capable shell case "$host" in *-*-sysv5SCO_SV*) # SCO OpenServer 6.x maildir=/var/spool/mail - TEST_SHELL=/u95/bin/sh AC_DEFINE([BROKEN_LIBIAF], [1], [ia_uinfo routines not supported by OS yet]) AC_DEFINE([BROKEN_UPDWTMPX]) @@ -910,7 +912,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE([PASSWD_NEEDS_USERNAME]) AC_CHECK_FUNCS([getluid setluid]) MANTYPE=man - TEST_SHELL=ksh + TEST_SHELL=$SHELL # let configure find us a capable shell SKIP_DISABLE_LASTLOG_DEFINE=yes ;; *-*-unicosmk*) diff --git a/regress/Makefile b/regress/Makefile index b19c7ae22..ab2a6ae7b 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -155,14 +155,14 @@ t-exec: ${LTESTS:=.sh} @if [ "x$?" = "x" ]; then exit 0; fi; \ for TEST in ""$?; do \ echo "run test $${TEST}" ... 1>&2; \ - (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ + (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ done t-exec-interop: ${INTEROP_TESTS:=.sh} @if [ "x$?" = "x" ]; then exit 0; fi; \ for TEST in ""$?; do \ echo "run test $${TEST}" ... 1>&2; \ - (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ + (env SUDO="${SUDO}" TEST_ENV=${TEST_ENV} ${TEST_SHELL} ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \ done # Not run by default -- cgit v1.2.3 From 0b43ffe143a5843703c3755fa040b8684fb04134 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Mon, 3 Jun 2013 09:30:44 +1000 Subject: - (dtucker) [configure.ac] Some platforms need sys/types.h before sys/un.h. --- ChangeLog | 1 + configure.ac | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 4345d9956..4b1536bfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ - (tim) [aclocal.m4] Enhance OSSH_CHECK_CFLAG_COMPILE to check stderr. feedback and ok dtucker - (tim) [regress/sftp-chroot.sh] skip if no sudo. ok dtucker + - (dtucker) [configure.ac] Some platforms need sys/types.h before sys/un.h. 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/configure.ac b/configure.ac index b8a610d5c..6f82c3fbf 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.531 2013/06/02 21:05:49 tim Exp $ +# $Id: configure.ac,v 1.532 2013/06/02 23:30:45 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.531 $) +AC_REVISION($Revision: 1.532 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -388,6 +388,7 @@ AC_CHECK_HEADERS([sys/mount.h], [], [], [ # Android requires sys/socket.h to be included before sys/un.h AC_CHECK_HEADERS([sys/un.h], [], [], [ #include +#include ]) # Messages for features tested for in target-specific section -- cgit v1.2.3 From 16cac190ebb9b5612cccea63a7c22ac33bc9a07a Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 4 Jun 2013 12:55:24 +1000 Subject: - (dtucker) [configure.ac] Some other platforms need sys/types.h before sys/socket.h. --- ChangeLog | 2 ++ configure.ac | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 4b1536bfa..555fede35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,6 +20,8 @@ feedback and ok dtucker - (tim) [regress/sftp-chroot.sh] skip if no sudo. ok dtucker - (dtucker) [configure.ac] Some platforms need sys/types.h before sys/un.h. + - (dtucker) [configure.ac] Some other platforms need sys/types.h before + sys/socket.h. 20130601 - (dtucker) [configure.ac openbsd-compat/xcrypt.c] bz#2112: fall back to diff --git a/configure.ac b/configure.ac index 6f82c3fbf..2cd910cf9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.532 2013/06/02 23:30:45 dtucker Exp $ +# $Id: configure.ac,v 1.533 2013/06/04 02:55:24 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.532 $) +AC_REVISION($Revision: 1.533 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -387,8 +387,8 @@ AC_CHECK_HEADERS([sys/mount.h], [], [], [ # Android requires sys/socket.h to be included before sys/un.h AC_CHECK_HEADERS([sys/un.h], [], [], [ -#include #include +#include ]) # Messages for features tested for in target-specific section -- cgit v1.2.3 From ae133d4b31af05bb232d797419f498f3ae7e9f2d Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Thu, 6 Jun 2013 08:30:20 +1000 Subject: - (dtucker) [configure.ac sftp.c openbsd-compat/openbsd-compat.h] Cater for platforms that don't have multibyte character support (specifically, mblen). --- ChangeLog | 3 +++ configure.ac | 6 ++++-- openbsd-compat/openbsd-compat.h | 7 ++++++- sftp.c | 4 +++- 4 files changed, 16 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 90ce8610f..66e07fc63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,9 @@ - dtucker@cvs.openbsd.org 2013/06/05 22:00:28 [readconf.c] plug another memleak. bz#1967, from Zhenbo Xu, detected by Melton, ok djm + - (dtucker) [configure.ac sftp.c openbsd-compat/openbsd-compat.h] Cater for + platforms that don't have multibyte character support (specifically, + mblen). 20130602 - (tim) [Makefile.in] Make Solaris, UnixWare, & OpenServer linkers happy diff --git a/configure.ac b/configure.ac index 2cd910cf9..bce5d7b17 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.533 2013/06/04 02:55:24 dtucker Exp $ +# $Id: configure.ac,v 1.534 2013/06/05 22:30:21 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.533 $) +AC_REVISION($Revision: 1.534 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -310,6 +310,7 @@ AC_CHECK_HEADERS([ \ ia.h \ iaf.h \ limits.h \ + locale.h \ login.h \ maillock.h \ ndir.h \ @@ -1563,6 +1564,7 @@ AC_CHECK_FUNCS([ \ inet_ntop \ innetgr \ login_getcapbool \ + mblen \ md5_crypt \ memmove \ mkdtemp \ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 3dbf1f244..392fa38dc 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.57 2013/05/16 10:47:32 dtucker Exp $ */ +/* $Id: openbsd-compat.h,v 1.58 2013/06/05 22:30:21 dtucker Exp $ */ /* * Copyright (c) 1999-2003 Damien Miller. All rights reserved. @@ -207,6 +207,11 @@ unsigned long long strtoull(const char *, char **, int); long long strtonum(const char *, long long, long long, const char **); #endif +/* multibyte character support */ +#ifndef HAVE_MBLEN +# define mblen(x, y) 1 +#endif + #if !defined(HAVE_VASPRINTF) || !defined(HAVE_VSNPRINTF) # include #endif diff --git a/sftp.c b/sftp.c index 0c90fd1e4..f50a4bb6a 100644 --- a/sftp.c +++ b/sftp.c @@ -38,7 +38,9 @@ #ifdef HAVE_LIBGEN_H #include #endif -#include +#ifdef HAVE_LOCALE_H +# include +#endif #ifdef USE_LIBEDIT #include #else -- cgit v1.2.3 From 6d8bd57448b45b42809da32857d7804444349ee7 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Tue, 11 Jun 2013 11:26:10 +1000 Subject: - (dtucker) [Makefile.in configure.ac fixalgorithms] Remove unsupported algorithms (Ciphers, MACs and HostKeyAlgorithms) from man pages. --- ChangeLog | 2 ++ Makefile.in | 9 ++++++--- configure.ac | 24 ++++++++++++++++++++---- fixalgorithms | 26 ++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 7 deletions(-) create mode 100755 fixalgorithms (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index a9a8cbce1..a7ab9a693 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ on a broken network, the backgrounded mux master will exit when the Control Persist time expires rather than hanging around indefinitely. bz#1917, also reported and tested by tedu@. ok djm@ markus@. + - (dtucker) [Makefile.in configure.ac fixalgorithms] Remove unsupported + algorithms (Ciphers, MACs and HostKeyAlgorithms) from man pages. 20130605 - (dtucker) [myproposal.h] Enable sha256 kex methods based on the presence of diff --git a/Makefile.in b/Makefile.in index d6f6a7924..92c95a928 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.339 2013/06/05 19:12:35 dtucker Exp $ +# $Id: Makefile.in,v 1.340 2013/06/11 01:26:10 dtucker Exp $ # uncomment if you run a non bourne compatable shell. Ie. csh #SHELL = @SH@ @@ -121,6 +121,8 @@ PATHSUBS = \ -e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g' FIXPATHSCMD = $(SED) $(PATHSUBS) +FIXALGORITHMSCMD= $(SHELL) $(srcdir)/fixalgorithms $(SED) \ + @UNSUPPORTED_ALGORITHMS@ all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) @@ -184,9 +186,10 @@ $(MANPAGES): $(MANPAGES_IN) manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \ fi; \ if test "$(MANTYPE)" = "man"; then \ - $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \ + $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) | \ + $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \ else \ - $(FIXPATHSCMD) $${manpage} > $@; \ + $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) > $@; \ fi $(CONFIGFILES): $(CONFIGFILES_IN) diff --git a/configure.ac b/configure.ac index bce5d7b17..e6ec2768f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.534 2013/06/05 22:30:21 dtucker Exp $ +# $Id: configure.ac,v 1.535 2013/06/11 01:26:10 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.534 $) +AC_REVISION($Revision: 1.535 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -2394,6 +2394,8 @@ AC_LINK_IFELSE( ], [ AC_MSG_RESULT([no]) + unsupported_algorithms="$unsupported_cipers \ + aes128-gcm@openssh.com aes256-gcm@openssh.com" ] ) @@ -2434,8 +2436,15 @@ fi AC_CHECK_FUNCS([crypt DES_crypt]) # Search for SHA256 support in libc and/or OpenSSL -AC_CHECK_FUNCS([SHA256_Update EVP_sha256], [TEST_SSH_SHA256=yes], - [TEST_SSH_SHA256=no]) +AC_CHECK_FUNCS([SHA256_Update EVP_sha256], + [TEST_SSH_SHA256=yes], + [TEST_SSH_SHA256=no + unsupported_algorithms="$unsupported_algorithms \ + hmac-sha2-256 hmac-sha2-512 \ + diffie-hellman-group-exchange-sha256 \ + hmac-sha2-256-etm@openssh.com hmac-sha2-512-etm@openssh.com" + ] +) AC_SUBST([TEST_SSH_SHA256]) # Check complete ECC support in OpenSSL @@ -2466,6 +2475,12 @@ AC_LINK_IFELSE( AC_MSG_RESULT([no]) TEST_SSH_ECC=no COMMENT_OUT_ECC="#no ecc#" + unsupported_algorithms="$unsupported_algorithms \ + ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 \ + ecdsa-sha2-nistp256-cert-v01@openssh.com \ + ecdsa-sha2-nistp384-cert-v01@openssh.com \ + ecdsa-sha2-nistp521-cert-v01@openssh.com \ + ecdsa-sha2-nistp256 ecdsa-sha2-nistp384 ecdsa-sha2-nistp521" ] ) AC_SUBST([TEST_SSH_ECC]) @@ -4541,6 +4556,7 @@ else fi AC_CHECK_DECL([BROKEN_GETADDRINFO], [TEST_SSH_IPV6=no]) AC_SUBST([TEST_SSH_IPV6], [$TEST_SSH_IPV6]) +AC_SUBST([UNSUPPORTED_ALGORITHMS], [$unsupported_algorithms]) AC_EXEEXT AC_CONFIG_FILES([Makefile buildpkg.sh opensshd.init openssh.xml \ diff --git a/fixalgorithms b/fixalgorithms new file mode 100755 index 000000000..115dce81c --- /dev/null +++ b/fixalgorithms @@ -0,0 +1,26 @@ +#!/bin/sh +# +# fixciphers - remove unsupported ciphers from man pages. +# Usage: fixpaths /path/to/sed cipher1 [cipher2] outfile +# +# Author: Darren Tucker (dtucker at zip com.au). Placed in the public domain. + +die() { + echo $* + exit -1 +} + +SED=$1 +shift + +for c in $*; do + subs="$subs -e /.Dq.$c.*$/d" + subs="$subs -e s/$c,//g" +done + +# now remove any entirely empty lines +subs="$subs -e /^$/d" + +${SED} $subs + +exit 0 -- cgit v1.2.3 From f3ab2c5f9cf4aed44971eded3ac9eeb1344b2be5 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sun, 4 Aug 2013 21:48:41 +1000 Subject: - (dtucker) [auth-krb5.c configure.ac openbsd-compat/bsd-misc.h] Add support for building with older Heimdal versions. ok djm. --- ChangeLog | 4 ++++ auth-krb5.c | 9 +++++++++ configure.ac | 9 +++++++-- openbsd-compat/bsd-misc.h | 10 +++++++++- 4 files changed, 29 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index fdce70566..997c5b54d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20130804 + - (dtucker) [auth-krb5.c configure.ac openbsd-compat/bsd-misc.h] Add support + for building with older Heimdal versions. ok djm. + 20130801 - (djm) [channels.c channels.h] bz#2135: On Solaris, isatty() on a non- blocking connecting socket will clear any stored errno that might diff --git a/auth-krb5.c b/auth-krb5.c index 43ee9272f..7c83f597f 100644 --- a/auth-krb5.c +++ b/auth-krb5.c @@ -97,8 +97,12 @@ auth_krb5_password(Authctxt *authctxt, const char *password) goto out; #ifdef HEIMDAL +# ifdef HAVE_KRB5_CC_NEW_UNIQUE problem = krb5_cc_new_unique(authctxt->krb5_ctx, krb5_mcc_ops.prefix, NULL, &ccache); +# else + problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops, &ccache); +# endif if (problem) goto out; @@ -117,8 +121,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password) if (problem) goto out; +# ifdef HAVE_KRB5_CC_NEW_UNIQUE problem = krb5_cc_new_unique(authctxt->krb5_ctx, krb5_fcc_ops.prefix, NULL, &authctxt->krb5_fwd_ccache); +# else + problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops, + &authctxt->krb5_fwd_ccache); +# endif if (problem) goto out; diff --git a/configure.ac b/configure.ac index e6ec2768f..4a1b50331 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.535 2013/06/11 01:26:10 dtucker Exp $ +# $Id: configure.ac,v 1.536 2013/08/04 11:48:41 dtucker Exp $ # # Copyright (c) 1999-2004 Damien Miller # @@ -15,7 +15,7 @@ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. AC_INIT([OpenSSH], [Portable], [openssh-unix-dev@mindrot.org]) -AC_REVISION($Revision: 1.535 $) +AC_REVISION($Revision: 1.536 $) AC_CONFIG_SRCDIR([ssh.c]) AC_LANG([C]) @@ -3806,6 +3806,11 @@ AC_ARG_WITH([kerberos5], # include #endif ]]) + saved_LIBS="$LIBS" + LIBS="$LIBS $K5LIBS" + AC_CHECK_FUNCS([krb5_cc_new_unique krb5_get_error_message krb5_free_error_message]) + LIBS="$saved_LIBS" + fi ] ) diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h index 9ebd83c3a..65c18ec2f 100644 --- a/openbsd-compat/bsd-misc.h +++ b/openbsd-compat/bsd-misc.h @@ -1,4 +1,4 @@ -/* $Id: bsd-misc.h,v 1.24 2013/05/29 22:29:09 dtucker Exp $ */ +/* $Id: bsd-misc.h,v 1.25 2013/08/04 11:48:41 dtucker Exp $ */ /* * Copyright (c) 1999-2004 Damien Miller @@ -114,4 +114,12 @@ pid_t getpgid(pid_t); # define endgrent() {} #endif +#ifndef HAVE_KRB5_GET_ERROR_MESSAGE +# define krb5_get_error_message krb5_get_err_text +#endif + +#ifndef HAVE_KRB5_FREE_ERROR_MESSAGE +# define krb5_free_error_message(a,b) while(0) +#endif + #endif /* _BSD_MISC_H */ -- cgit v1.2.3