From c04f75f10d14f0034917999b5c29a707083d8d9d Mon Sep 17 00:00:00 2001 From: damien Date: Wed, 17 May 2000 12:53:33 +0000 Subject: [PATCH] - Several patches from SAKAI Kiyotaka - INSTALL typo and URL fix - Makefile fix - Solaris fixes - Checking for ssize_t and memmove. Based on patch from SAKAI Kiyotaka --- CREDITS | 4 ++++ ChangeLog | 6 ++++++ INSTALL | 8 ++++---- Makefile.in | 6 +++--- acconfig.h | 1 + bsd-login.c | 4 ++++ configure.in | 16 +++++++++++++++- defines.h | 13 +++++++++++++ packet.c | 4 ++++ scp.c | 2 ++ ssh-agent.c | 1 + 11 files changed, 57 insertions(+), 8 deletions(-) diff --git a/CREDITS b/CREDITS index b8f231c6..7ca3f788 100644 --- a/CREDITS +++ b/CREDITS @@ -34,6 +34,7 @@ jonchen (email unknown) - the original author of PAM support of SSH Juergen Keil - scp bugfixing Kees Cook - scp fixes Kiyokazu SUTO - Bugfixes +Lutz Jaenicke - Bugfixes Marc G. Fournier - Solaris patches Matt Richards - AIX patches Nalin Dahyabhai - PAM environment patch @@ -41,7 +42,10 @@ Niels Kristian Bech Jensen - Assorted patches Peter Kocks - Makefile fixes Phil Hands - Debian scripts, assorted patches Phil Karn - Autoconf fix +SAKAI Kiyotaka - Multiple bugfixes +Simon Wilkinson - PAM fixes Thomas Neumann - Shadow passwords +Tom Bertelson's - AIX auth fixes Tor-Ake Fransson - AIX support Tudor Bosman - MD5 password support diff --git a/ChangeLog b/ChangeLog index e14392af..8cefa0fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,12 @@ enable nonblocking IO for sshd w/ proto 1, too; split out common code [aux.c] missing include + - Several patches from SAKAI Kiyotaka + - INSTALL typo and URL fix + - Makefile fix + - Solaris fixes + - Checking for ssize_t and memmove. Based on patch from SAKAI Kiyotaka + 20000513 - Fix for non-recognised DSA keys from Arkadiusz Miskiewicz diff --git a/INSTALL b/INSTALL index bf7bc138..dc8cee03 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ You will need working installations of Zlib and OpenSSL. Zlib: -http://www.cdrom.com/pub/infozip/zlib/ +http://www.freesoftware.com/pub/infozip/zlib/ OpenSSL 0.9.5a or greater: http://www.openssl.org/ @@ -90,7 +90,7 @@ need a working installation of GNOME, including the development headers, for this to work. --with-random=/some/file allows you to specify an alternate source of -random numbers (the default is /dev/urandom). Unless you are absolutly +random numbers (the default is /dev/urandom). Unless you are absolutely sure of what you are doing, it is best to leave this alone. --with-egd-pool=/some/file allows you to enable Entropy Gathering @@ -152,7 +152,7 @@ are installed. real (AF_INET) IPv4 addresses. Works around some quirks on Linux. If you need to pass special options to the compiler or linker, you -can specify these as enviornment variables before running ./configure. +can specify these as environment variables before running ./configure. For example: CFLAGS="-O -m486" LFLAGS="-s" LIBS="-lrubbish" LD="/usr/foo/ld" ./configure @@ -186,5 +186,5 @@ for sshd, ssh and ssh-agent. If you experience problems compiling, installing or running OpenSSH. Please refer to the "reporting bugs" section of the webpage at -http://violet.ibs.com.au/openssh/ +http://www.openssh.com/ diff --git a/Makefile.in b/Makefile.in index 3aeced93..0dc71c6c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -90,11 +90,11 @@ $(MANPAGES) $(CONFIGFILES):: $(FIXPATHSCMD) $(srcdir)/$@ clean: - rm -f *.o *.a $(TARGETS) config.status config.cache config.log - rm -f *.out ssh_prng_cmds core + rm -f *.o *.a $(TARGETS) config.cache config.log + rm -f *.out core distclean: clean - rm -f Makefile config.h core *~ + rm -f Makefile config.h config.status ssh_prng_cmds *~ mrproper: distclean diff --git a/acconfig.h b/acconfig.h index 4f5f48f3..9a2c1af5 100644 --- a/acconfig.h +++ b/acconfig.h @@ -117,6 +117,7 @@ #undef HAVE_UINTXX_T #undef HAVE_SOCKLEN_T #undef HAVE_SIZE_T +#undef HAVE_SSIZE_T #undef HAVE_STRUCT_SOCKADDR_STORAGE #undef HAVE_STRUCT_ADDRINFO #undef HAVE_STRUCT_IN6_ADDR diff --git a/bsd-login.c b/bsd-login.c index 910f9ff9..6a80928e 100644 --- a/bsd-login.c +++ b/bsd-login.c @@ -73,6 +73,7 @@ struct utmp * utp; int t = 0; struct utmp * u; +#ifdef HAVE_TYPE_IN_UTMP setutent(); while((u = getutent()) != NULL) { @@ -91,6 +92,7 @@ struct utmp * utp; } endutent(); +#endif return(-1); } @@ -128,6 +130,7 @@ login(utp) /* If no tty was found... */ if (tty == -1) { /* ... append it to utmp on login */ +#ifdef HAVE_TYPE_IN_UTMP if (utp->ut_type == USER_PROCESS) { if ((fd = open(_PATH_UTMP, O_WRONLY|O_APPEND, 0)) >= 0) { (void)write(fd, utp, sizeof(struct utmp)); @@ -138,6 +141,7 @@ login(utp) /* Between login and logout */ log("No tty slot found at logout"); } +#endif } else { /* Otherwise, tty was found - update at its location */ #if defined(HAVE_HOST_IN_UTMP) diff --git a/configure.in b/configure.in index 62456ace..548d2727 100644 --- a/configure.in +++ b/configure.in @@ -135,7 +135,7 @@ fi AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h netinet/in_systm.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) # Checks for library functions. -AC_CHECK_FUNCS(arc4random b64_ntop bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf vhangup _getpty __b64_ntop) +AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_af clock freeaddrinfo gai_strerror getaddrinfo getnameinfo getrusage innetgr md5_crypt memmove mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf vhangup _getpty __b64_ntop) AC_CHECK_FUNC(login, [AC_DEFINE(HAVE_LOGIN)], @@ -381,6 +381,20 @@ if test "x$ac_cv_have_size_t" = "xyes" ; then AC_DEFINE(HAVE_SIZE_T) fi +AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [ + AC_TRY_COMPILE( + [ +#include + ], + [ ssize_t foo; foo = 1235; ], + [ ac_cv_have_ssize_t="yes" ], + [ ac_cv_have_ssize_t="no" ] + ) +]) +if test "x$ac_cv_have_ssize_t" = "xyes" ; then + AC_DEFINE(HAVE_SSIZE_T) +fi + AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ AC_TRY_COMPILE( diff --git a/defines.h b/defines.h index 9490e77e..5eddf2e1 100644 --- a/defines.h +++ b/defines.h @@ -150,6 +150,11 @@ typedef unsigned int size_t; # define HAVE_SIZE_T #endif /* HAVE_SIZE_T */ +#ifndef HAVE_SSIZE_T +typedef int ssize_t; +# define HAVE_SSIZE_T +#endif /* HAVE_SSIZE_T */ + #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS) # define ss_family __ss_family #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */ @@ -216,6 +221,10 @@ typedef unsigned int size_t; # define _PATH_DEVNULL "/dev/null" #endif +#ifndef MAIL_DIRECTORY +# define MAIL_DIRECTORY "/var/spool/mail" +#endif + #ifndef MAILDIR # define MAILDIR MAIL_DIRECTORY #endif @@ -280,4 +289,8 @@ typedef unsigned int size_t; # undef HAVE_GETADDRINFO #endif /* defined(BROKEN_GETADDRINFO) && defined(HAVE_GETADDRINFO) */ +#if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) +# define memmove(s1, s2, n) bcopy((s2), (s1), (n)) +#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */ + #endif /* _DEFINES_H */ diff --git a/packet.c b/packet.c index 7bc6cada..d4b16ba7 100644 --- a/packet.c +++ b/packet.c @@ -1237,10 +1237,12 @@ packet_set_interactive(int interactive, int keepalives) * Set IP options for an interactive connection. Use * IPTOS_LOWDELAY and TCP_NODELAY. */ +#ifdef IP_TOS int lowdelay = IPTOS_LOWDELAY; if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *) &lowdelay, sizeof(lowdelay)) < 0) error("setsockopt IPTOS_LOWDELAY: %.100s", strerror(errno)); +#endif if (setsockopt(connection_in, IPPROTO_TCP, TCP_NODELAY, (void *) &on, sizeof(on)) < 0) error("setsockopt TCP_NODELAY: %.100s", strerror(errno)); @@ -1249,10 +1251,12 @@ packet_set_interactive(int interactive, int keepalives) * Set IP options for a non-interactive connection. Use * IPTOS_THROUGHPUT. */ +#ifdef IP_TOS int throughput = IPTOS_THROUGHPUT; if (setsockopt(connection_in, IPPROTO_IP, IP_TOS, (void *) &throughput, sizeof(throughput)) < 0) error("setsockopt IPTOS_THROUGHPUT: %.100s", strerror(errno)); +#endif } } diff --git a/scp.c b/scp.c index df6a691e..7a85f900 100644 --- a/scp.c +++ b/scp.c @@ -1235,7 +1235,9 @@ progressmeter(int flag) struct sigaction sa; sa.sa_handler = updateprogressmeter; sigemptyset(&sa.sa_mask); +#ifdef SA_RESTART sa.sa_flags = SA_RESTART; +#endif sigaction(SIGALRM, &sa, NULL); alarmtimer(1); } else if (flag == 1) { diff --git a/ssh-agent.c b/ssh-agent.c index 30d99b95..7bfa2904 100644 --- a/ssh-agent.c +++ b/ssh-agent.c @@ -507,6 +507,7 @@ main(int ac, char **av) struct sockaddr_un sunaddr; pid_t pid; char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid]; + extern int optind; /* check if RSA support exists */ if (rsa_alive() == 0) { -- 2.45.2