From 68e831132128d8987462b44808fcd078ea7d83bb Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Fri, 28 Jun 2002 00:37:33 +0000 Subject: - (bal) FreeBSD needs to detect if mmap() is supported. Bug #303 --- configure.ac | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index ad5d5cde9..7ef77e5b1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.72 2002/06/25 22:35:16 tim Exp $ +# $Id: configure.ac,v 1.73 2002/06/28 00:37:33 mouring Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -582,6 +582,7 @@ AC_MSG_CHECKING([for mmap anon shared]) AC_TRY_RUN( [ #include +#include #include #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) #define MAP_ANON MAP_ANONYMOUS -- cgit v1.2.3 From e958ed3624deeca53519b8a870e6d545d6a8fd3d Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Fri, 5 Jul 2002 07:12:33 -0700 Subject: [configure.ac] AIX 4.2.1 has authenticate() in libs. Reported by Darren Tucker --- ChangeLog | 6 +++++- configure.ac | 9 +++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index a70207b60..964abb810 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20020705 + - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs. + Reported by Darren Tucker + 20020704 - (bal) Limit data to TTY for AIX only (Newer versions can't handle the faster data rate) Bug #124 @@ -1274,4 +1278,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2335 2002/07/04 19:33:49 mouring Exp $ +$Id: ChangeLog,v 1.2336 2002/07/05 14:12:33 tim Exp $ diff --git a/configure.ac b/configure.ac index 7ef77e5b1..4b48be389 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.73 2002/06/28 00:37:33 mouring Exp $ +# $Id: configure.ac,v 1.74 2002/07/05 14:12:34 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -71,7 +71,12 @@ case "$host" in ) LDFLAGS="$saved_LDFLAGS" fi - AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) + AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], + [AC_CHECK_LIB(s,authenticate, + [ AC_DEFINE(WITH_AIXAUTHENTICATE) + LIBS="$LIBS -ls" + ]) + ]) AC_DEFINE(BROKEN_GETADDRINFO) AC_DEFINE(BROKEN_REALPATH) dnl AIX handles lastlog as part of its login message -- cgit v1.2.3 From 9dd30817ef4314bd2fdc688c0d40fd6ca7208acc Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 7 Jul 2002 13:43:36 -0700 Subject: [acconfig.h configure.ac sshd.c] s/BROKEN_FD_PASSING/DISABLE_FD_PASSING/ --- ChangeLog | 4 +++- acconfig.h | 6 +++--- configure.ac | 8 ++++---- sshd.c | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index d94a6e342..10dc20a1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20020707 - (tim) [Makefile.in] use umask instead of chmod on $(PRIVSEP_PATH) + - (tim) [acconfig.h configure.ac sshd.c] + s/BROKEN_FD_PASSING/DISABLE_FD_PASSING/ 20020705 - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs. @@ -1283,4 +1285,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2338 2002/07/07 20:30:45 tim Exp $ +$Id: ChangeLog,v 1.2339 2002/07/07 20:43:36 tim Exp $ diff --git a/acconfig.h b/acconfig.h index 3e51d6112..d809d059d 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.141 2002/06/25 22:35:16 tim Exp $ */ +/* $Id: acconfig.h,v 1.142 2002/07/07 20:43:36 tim Exp $ */ #ifndef _CONFIG_H #define _CONFIG_H @@ -358,8 +358,8 @@ /* Define if you have the `mmap' function that supports MAP_ANON|SHARED */ #undef HAVE_MMAP_ANON_SHARED -/* Define if sendmsg()/recvmsg() has problems passing file descriptors */ -#undef BROKEN_FD_PASSING +/* Define if your platform needs to skip post auth file descriptor passing */ +#undef DISABLE_FD_PASSING @BOTTOM@ diff --git a/configure.ac b/configure.ac index 4b48be389..0f5ab9187 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.74 2002/07/05 14:12:34 tim Exp $ +# $Id: configure.ac,v 1.75 2002/07/07 20:43:36 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -91,7 +91,7 @@ case "$host" in AC_DEFINE(IPV4_DEFAULT) AC_DEFINE(IP_TOS_IS_BROKEN) AC_DEFINE(NO_X11_UNIX_SOCKETS) - AC_DEFINE(BROKEN_FD_PASSING) + AC_DEFINE(DISABLE_FD_PASSING) AC_DEFINE(SETGROUPS_NOOP) ;; *-*-dgux*) @@ -272,7 +272,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(USE_PIPES) AC_DEFINE(HAVE_SECUREWARE) AC_DEFINE(DISABLE_SHADOW) - AC_DEFINE(BROKEN_FD_PASSING) + AC_DEFINE(DISABLE_FD_PASSING) AC_CHECK_FUNCS(getluid setluid) MANTYPE=man ;; @@ -280,7 +280,7 @@ mips-sony-bsd|mips-sony-newsos4) no_libsocket=1 no_libnsl=1 AC_DEFINE(USE_PIPES) - AC_DEFINE(BROKEN_FD_PASSING) + AC_DEFINE(DISABLE_FD_PASSING) LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib" LIBS="$LIBS -lgen -lrsc" ;; diff --git a/sshd.c b/sshd.c index 5e5fc4716..c04f55f4b 100644 --- a/sshd.c +++ b/sshd.c @@ -624,7 +624,7 @@ privsep_postauth(Authctxt *authctxt) /* XXX - Remote port forwarding */ x_authctxt = authctxt; -#ifdef BROKEN_FD_PASSING +#ifdef DISABLE_FD_PASSING if (1) { #else if (authctxt->pw->pw_uid == 0 || options.use_login) { -- cgit v1.2.3 From cbb9066d2d697e51f5e6df6681827f17756d154a Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 8 Jul 2002 19:17:10 -0700 Subject: [configure.ac] fix libc89 utimes test. Mention default path for --with-privsep-path= --- ChangeLog | 4 +++- configure.ac | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index abc99c38a..860d9805e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ - (tim) [openssh/contrib/solaris/buildpkg.sh] add PKG_INSTALL_ROOT to work in a jumpstart environment. patch by kbrint@rufus.net - (tim) [Makefile.in] workaround for broken pakadd on some systems. + - (tim) [configure.ac] fix libc89 utimes test. Mention default path for + --with-privsep-path= 20020707 - (tim) [Makefile.in] use umask instead of chmod on $(PRIVSEP_PATH) @@ -1314,4 +1316,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2350 2002/07/09 02:10:05 tim Exp $ +$Id: ChangeLog,v 1.2351 2002/07/09 02:17:10 tim Exp $ diff --git a/configure.ac b/configure.ac index 0f5ab9187..aa9a5d215 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.75 2002/07/07 20:43:36 tim Exp $ +# $Id: configure.ac,v 1.76 2002/07/09 02:17:10 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -424,7 +424,8 @@ AC_CHECK_FUNC(strcasecmp, [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ] ) AC_CHECK_FUNC(utimes, - [], [ AC_CHECK_LIB(c89, utimes, LIBS="$LIBS -lc89") ] + [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES) + LIBS="$LIBS -lc89"]) ] ) dnl Checks for libutil functions @@ -1825,7 +1826,7 @@ LIBS="$LIBS $KLIBS $K5LIBS" PRIVSEP_PATH=/var/empty AC_ARG_WITH(privsep-path, - [ --with-privsep-path=xxx Path for privilege separation chroot ], + [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)], [ if test "x$withval" != "$no" ; then PRIVSEP_PATH=$withval -- cgit v1.2.3 From 99a4e14fe0615c0f8a404aec0db42feb98451eb9 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 9 Jul 2002 14:06:40 +0000 Subject: - (bal) NO_IPPORT_RESERVED_CONCEPT used instead of CYGWIN so other platforms lacking that concept can share it. Patch by vinschen@redhat.com --- ChangeLog | 6 +++++- acconfig.h | 5 ++++- configure.ac | 3 ++- readconf.c | 2 +- serverloop.c | 7 +++++-- 5 files changed, 17 insertions(+), 6 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 860d9805e..a6d472a74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20020709 + - (bal) NO_IPPORT_RESERVED_CONCEPT used instead of CYGWIN so other platforms + lacking that concept can share it. Patch by vinschen@redhat.com + 20020708 - (tim) [openssh/contrib/solaris/buildpkg.sh] add PKG_INSTALL_ROOT to work in a jumpstart environment. patch by kbrint@rufus.net @@ -1316,4 +1320,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2351 2002/07/09 02:17:10 tim Exp $ +$Id: ChangeLog,v 1.2352 2002/07/09 14:06:40 mouring Exp $ diff --git a/acconfig.h b/acconfig.h index d809d059d..147295510 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.142 2002/07/07 20:43:36 tim Exp $ */ +/* $Id: acconfig.h,v 1.143 2002/07/09 14:06:40 mouring Exp $ */ #ifndef _CONFIG_H #define _CONFIG_H @@ -310,6 +310,9 @@ /* Define if X11 doesn't support AF_UNIX sockets on that system */ #undef NO_X11_UNIX_SOCKETS +/* Define if the concept of ports only accessible to superusers isn't known */ +#undef NO_IPPORT_RESERVED_CONCEPT + /* Needed for SCO and NeXT */ #undef BROKEN_SAVED_UIDS diff --git a/configure.ac b/configure.ac index aa9a5d215..120709876 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.76 2002/07/09 02:17:10 tim Exp $ +# $Id: configure.ac,v 1.77 2002/07/09 14:06:40 mouring Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -91,6 +91,7 @@ case "$host" in AC_DEFINE(IPV4_DEFAULT) AC_DEFINE(IP_TOS_IS_BROKEN) AC_DEFINE(NO_X11_UNIX_SOCKETS) + AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) AC_DEFINE(DISABLE_FD_PASSING) AC_DEFINE(SETGROUPS_NOOP) ;; diff --git a/readconf.c b/readconf.c index 80d99fef1..bae06be12 100644 --- a/readconf.c +++ b/readconf.c @@ -199,7 +199,7 @@ add_local_forward(Options *options, u_short port, const char *host, u_short host_port) { Forward *fwd; -#ifndef HAVE_CYGWIN +#ifndef NO_IPPORT_RESERVED_CONCEPT extern uid_t original_real_uid; if (port < IPPORT_RESERVED && original_real_uid != 0) fatal("Privileged ports can only be forwarded by root."); diff --git a/serverloop.c b/serverloop.c index 134921355..912f62501 100644 --- a/serverloop.c +++ b/serverloop.c @@ -972,8 +972,11 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt) /* check permissions */ if (!options.allow_tcp_forwarding || - no_port_forwarding_flag || - (listen_port < IPPORT_RESERVED && pw->pw_uid != 0)) { + no_port_forwarding_flag +#ifndef NO_IPPORT_RESERVED_CONCEPT + || (listen_port < IPPORT_RESERVED && pw->pw_uid != 0) +#endif + ) { success = 0; packet_send_debug("Server has disabled port forwarding."); } else { -- cgit v1.2.3 From 4796a291f1d1ce781f6f840ff1fa7f28d19963b1 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Fri, 12 Jul 2002 18:11:24 -0700 Subject: [configure.ac] remove unused filepriv line --- ChangeLog | 3 ++- configure.ac | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 246860551..24cffde6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 20020712 - (tim) [Makefile.in] quiet down install-files: and check-user: + - (tim) [configure.ac] remove unused filepriv line 20020710 - (tim) [contrib/cygwin/ssh-host-config] explicitely sets the permissions @@ -1348,4 +1349,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2360 2002/07/12 16:04:06 tim Exp $ +$Id: ChangeLog,v 1.2361 2002/07/13 01:11:24 tim Exp $ diff --git a/configure.ac b/configure.ac index 120709876..0c60c5e61 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.77 2002/07/09 14:06:40 mouring Exp $ +# $Id: configure.ac,v 1.78 2002/07/13 01:11:25 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -17,7 +17,6 @@ AC_PATH_PROGS(PERL, perl5 perl) AC_SUBST(PERL) AC_PATH_PROG(ENT, ent) AC_SUBST(ENT) -AC_PATH_PROGS(FILEPRIV, filepriv, true, /sbin:/usr/sbin) AC_PATH_PROG(TEST_MINUS_S_SH, bash) AC_PATH_PROG(TEST_MINUS_S_SH, ksh) AC_PATH_PROG(TEST_MINUS_S_SH, sh) -- cgit v1.2.3 From 40017b0e7aa236ca1144563dea986a95684f1599 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Sun, 14 Jul 2002 13:36:49 -0700 Subject: (bal/tim) [acconfig.h configure.ac monitor_mm.c servconf.c openbsd-compat/Makefile.in] support compression on platforms that have no/broken MAP_ANON. Moved code to openbsd-compat/xmmap.c Based on patch from nalin@redhat.com of code extracted from Owl's package --- ChangeLog | 6 ++++- acconfig.h | 5 +--- configure.ac | 27 +------------------ monitor_mm.c | 10 ++----- openbsd-compat/Makefile.in | 4 +-- openbsd-compat/xmmap.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++ servconf.c | 2 +- 7 files changed, 77 insertions(+), 42 deletions(-) create mode 100644 openbsd-compat/xmmap.c (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 632b41da0..67cc57cbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 20020714 - (tim) [Makefile.in] replace "id sshd" with "sshd -t" + - (bal/tim) [acconfig.h configure.ac monitor_mm.c servconf.c + openbsd-compat/Makefile.in] support compression on platforms that + have no/broken MAP_ANON. Moved code to openbsd-compat/xmmap.c + Based on patch from nalin@redhat.com of code extracted from Owl's package 20020712 - (tim) [Makefile.in] quiet down install-files: and check-user: @@ -1352,4 +1356,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2362 2002/07/14 17:02:20 tim Exp $ +$Id: ChangeLog,v 1.2363 2002/07/14 20:36:49 tim Exp $ diff --git a/acconfig.h b/acconfig.h index 147295510..f8fc650d7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.143 2002/07/09 14:06:40 mouring Exp $ */ +/* $Id: acconfig.h,v 1.144 2002/07/14 20:36:50 tim Exp $ */ #ifndef _CONFIG_H #define _CONFIG_H @@ -358,9 +358,6 @@ /* Path that unprivileged child will chroot() to in privep mode */ #undef PRIVSEP_PATH -/* Define if you have the `mmap' function that supports MAP_ANON|SHARED */ -#undef HAVE_MMAP_ANON_SHARED - /* Define if your platform needs to skip post auth file descriptor passing */ #undef DISABLE_FD_PASSING diff --git a/configure.ac b/configure.ac index 0c60c5e61..1fb3056e6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.78 2002/07/13 01:11:25 tim Exp $ +# $Id: configure.ac,v 1.79 2002/07/14 20:36:50 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -583,31 +583,6 @@ AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \ truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty) -if test $ac_cv_func_mmap = yes ; then -AC_MSG_CHECKING([for mmap anon shared]) -AC_TRY_RUN( - [ -#include -#include -#include -#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) -#define MAP_ANON MAP_ANONYMOUS -#endif -main() { char *p; -p = (char *) mmap(NULL, 10, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, -1, 0); -if (p == (char *)-1) - exit(1); -exit(0); -} - ], - [ - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_MMAP_ANON_SHARED) - ], - [ AC_MSG_RESULT(no) ] -) -fi - dnl IRIX and Solaris 2.5.1 have dirname() in libgen AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ AC_CHECK_LIB(gen, dirname,[ diff --git a/monitor_mm.c b/monitor_mm.c index f72a180ea..fb5f2c82c 100644 --- a/monitor_mm.c +++ b/monitor_mm.c @@ -91,15 +91,9 @@ mm_create(struct mm_master *mmalloc, size_t size) */ mm->mmalloc = mmalloc; -#ifdef HAVE_MMAP_ANON_SHARED - address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, - -1, 0); + address = xmmap(size); if (address == MAP_FAILED) fatal("mmap(%lu): %s", (u_long)size, strerror(errno)); -#else - fatal("%s: UsePrivilegeSeparation=yes and Compression=yes not supported", - __func__); -#endif mm->address = address; mm->size = size; @@ -137,7 +131,7 @@ mm_destroy(struct mm_master *mm) mm_freelist(mm->mmalloc, &mm->rb_free); mm_freelist(mm->mmalloc, &mm->rb_allocated); -#ifdef HAVE_MMAP_ANON_SHARED +#ifdef HAVE_MMAP if (munmap(mm->address, mm->size) == -1) fatal("munmap(%p, %lu): %s", mm->address, (u_long)mm->size, strerror(errno)); diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 3e09cfefe..c365ae18f 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.21 2002/02/19 20:27:57 mouring Exp $ +# $Id: Makefile.in,v 1.22 2002/07/14 20:36:51 tim Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@ OPENBSD=base64.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.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 -COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o +COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o xmmap.o PORTS=port-irix.o port-aix.o diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c new file mode 100644 index 000000000..a6b7d3bdf --- /dev/null +++ b/openbsd-compat/xmmap.c @@ -0,0 +1,65 @@ +/* + * 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_SYS_MMAN_H +#include +#endif + +void *xmmap(size_t size) +{ + void *address; + +#ifdef HAVE_MMAP +# ifdef MAP_ANON + address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_ANON|MAP_SHARED, + -1, 0); +# else + address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED, + open("/dev/zero", O_RDWR), 0); +# endif + +#define MM_SWAP_TEMPLATE "/var/run/sshd.mm.XXXXXXXX" + if (address == MAP_FAILED) { + char tmpname[sizeof(MM_SWAP_TEMPLATE)] = MM_SWAP_TEMPLATE; + int tmpfd; + + tmpfd = mkstemp(tmpname); + if (tmpfd == -1) + fatal("mkstemp(\"%s\"): %s", + MM_SWAP_TEMPLATE, strerror(errno)); + unlink(tmpname); + ftruncate(tmpfd, size); + address = mmap(NULL, size, PROT_WRITE|PROT_READ, MAP_SHARED, + tmpfd, 0); + close(tmpfd); + } + + return (address); +#else + fatal("%s: UsePrivilegeSeparation=yes and Compression=yes not supported", + __func__); +#endif /* HAVE_MMAP */ + +} + diff --git a/servconf.c b/servconf.c index f311ae48d..bdf39afb8 100644 --- a/servconf.c +++ b/servconf.c @@ -257,7 +257,7 @@ fill_default_server_options(ServerOptions *options) if (use_privsep == -1) use_privsep = 1; -#if !defined(HAVE_MMAP_ANON_SHARED) +#ifndef HAVE_MMAP if (use_privsep && options->compression == 1) { error("This platform does not support both privilege " "separation and compression"); -- cgit v1.2.3 From e22be3b11ea1e5cb349665a3cbc57bc564f39ad7 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Wed, 17 Jul 2002 19:20:07 -0700 Subject: [configure.ac] change how we do paths in AC_PATH_PROGS tests for autoconf 2.53. Based on a patch by jrj@purdue.edu --- ChangeLog | 4 +++- configure.ac | 12 +++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 7984d15b0..6aeb6f18f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 20020717 - (bal) aixbff package updated by dtucker@zip.com.au + - (tim) [configure.ac] change how we do paths in AC_PATH_PROGS tests + for autoconf 2.53. Based on a patch by jrj@purdue.edu 20020716 - (tim) [contrib/solaris/opensshd.in] Only kill sshd if .pid file found @@ -1380,4 +1382,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2372 2002/07/18 01:04:50 mouring Exp $ +$Id: ChangeLog,v 1.2373 2002/07/18 02:20:07 tim Exp $ diff --git a/configure.ac b/configure.ac index 1fb3056e6..f94f6c848 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.79 2002/07/14 20:36:50 tim Exp $ +# $Id: configure.ac,v 1.80 2002/07/18 02:20:08 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -1818,7 +1818,12 @@ AC_ARG_WITH(xauth, fi ], [ - AC_PATH_PROG(xauth_path, xauth,,$PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin) + TestPath="$PATH" + TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin" + TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11" + TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin" + TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" + AC_PATH_PROG(xauth_path, xauth, , $TestPath) if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then xauth_path="/usr/openwin/bin/xauth" fi @@ -1872,7 +1877,8 @@ AC_ARG_WITH(mantype, ] ) if test -z "$MANTYPE"; then - AC_PATH_PROGS(NROFF, nroff awf, /bin/false, /usr/bin:/usr/ucb) + TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" + AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath) if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then MANTYPE=doc elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then -- cgit v1.2.3 From 907881ec8e6077a57c9b9f01c8a30db13cf52b69 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 18 Jul 2002 11:44:50 -0700 Subject: [configure.ac] Bug 267 rework int64_t test. --- ChangeLog | 3 ++- configure.ac | 40 +++++++++++----------------------------- 2 files changed, 13 insertions(+), 30 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 25fe3eac2..5c2c9d8fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - (tim) [defines.h] Bug 313 patch by dirk.meyer@dinoex.sub.org - (tim) [monitor_mm.c] add missing declaration for xmmap(). Reported by ayamura@ayamura.org + - (tim) [configure.ac] Bug 267 rework int64_t test. 20020717 - (bal) aixbff package updated by dtucker@zip.com.au @@ -1387,4 +1388,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2375 2002/07/18 18:34:29 tim Exp $ +$Id: ChangeLog,v 1.2376 2002/07/18 18:44:50 tim Exp $ diff --git a/configure.ac b/configure.ac index f94f6c848..281e2f63f 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.80 2002/07/18 02:20:08 tim Exp $ +# $Id: configure.ac,v 1.81 2002/07/18 18:44:50 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -1038,7 +1038,16 @@ fi AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ AC_TRY_COMPILE( - [ #include ], + [ +#include +#ifdef HAVE_STDINT_H +# include +#endif +#include +#ifdef HAVE_SYS_BITYPES_H +# include +#endif + ], [ int64_t a; a = 1;], [ ac_cv_have_int64_t="yes" ], [ ac_cv_have_int64_t="no" ] @@ -1046,33 +1055,6 @@ AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [ ]) if test "x$ac_cv_have_int64_t" = "xyes" ; then AC_DEFINE(HAVE_INT64_T) - have_int64_t=1 -fi - -if test -z "$have_int64_t" ; then - AC_MSG_CHECKING([for int64_t type in sys/socket.h]) - AC_TRY_COMPILE( - [ #include ], - [ int64_t a; a = 1], - [ - AC_DEFINE(HAVE_INT64_T) - AC_MSG_RESULT(yes) - ], - [ AC_MSG_RESULT(no) ] - ) -fi - -if test -z "$have_int64_t" ; then - AC_MSG_CHECKING([for int64_t type in sys/bitypes.h]) - AC_TRY_COMPILE( - [ #include ], - [ int64_t a; a = 1], - [ - AC_DEFINE(HAVE_INT64_T) - AC_MSG_RESULT(yes) - ], - [ AC_MSG_RESULT(no) ] - ) fi AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [ -- cgit v1.2.3 From f028f1e460f60b233b99e73ad9aa88eabdc5dafd Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Fri, 19 Jul 2002 12:41:10 -0700 Subject: [configure.ac] test for libxnet on HP. Patch by dtucker@zip.com.au --- ChangeLog | 3 ++- configure.ac | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 0ec31832a..ce1cc2e03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 20020719 - (tim) [contrib/solaris/buildpkg.sh] create privsep user/group if needed. Patch by dtucker@zip.com.au + - (tim) [configure.ac] test for libxnet on HP. Patch by dtucker@zip.com.au 20020718 - (tim) [defines.h] Bug 313 patch by dirk.meyer@dinoex.sub.org @@ -1393,4 +1394,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2378 2002/07/19 18:57:57 tim Exp $ +$Id: ChangeLog,v 1.2379 2002/07/19 19:41:10 tim Exp $ diff --git a/configure.ac b/configure.ac index 281e2f63f..c055c578b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.81 2002/07/18 18:44:50 tim Exp $ +# $Id: configure.ac,v 1.82 2002/07/19 19:41:11 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -113,7 +113,8 @@ case "$host" in AC_DEFINE(DISABLE_SHADOW) AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) - LIBS="$LIBS -lxnet -lsec -lsecpw" + 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*) @@ -128,7 +129,8 @@ case "$host" in AC_DEFINE(DISABLE_SHADOW) AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) - LIBS="$LIBS -lxnet -lsec" + 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" @@ -140,7 +142,8 @@ case "$host" in AC_DEFINE(DISABLE_SHADOW) AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) - LIBS="$LIBS -lxnet -lsec" + LIBS="$LIBS -lsec" + AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) ;; *-*-irix5*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" -- cgit v1.2.3 From 232ccf775459210ee79873d4411328bff6b8d66a Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Mon, 22 Jul 2002 23:34:25 +0000 Subject: - (bal) [configure.ac defines.h loginrec.c sshd.c sshpty.c] Partial sync with Cray (mostly #ifdef renaming). Patch by wendyp@cray.com. --- ChangeLog | 4 +++- configure.ac | 15 ++++++++++++--- defines.h | 10 +++++----- loginrec.c | 6 +++--- sshd.c | 2 +- sshpty.c | 4 ++-- 6 files changed, 26 insertions(+), 15 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 24796c4a2..4199bd21b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20020722 - (bal) AIX tty data limiting patch fix by leigh@solinno.co.uk - (stevesk) [xmmap.c] missing prototype for fatal() + - (bal) [configure.ac defines.h loginrec.c sshd.c sshpty.c] Partial sync + with Cray (mostly #ifdef renaming). Patch by wendyp@cray.com. 20020721 - (stevesk) [auth-pam.c] merge cosmetic changes from solar's @@ -1412,4 +1414,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2388 2002/07/22 16:20:29 stevesk Exp $ +$Id: ChangeLog,v 1.2389 2002/07/22 23:34:25 mouring Exp $ diff --git a/configure.ac b/configure.ac index c055c578b..c8aa7e184 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.82 2002/07/19 19:41:11 tim Exp $ +# $Id: configure.ac,v 1.83 2002/07/22 23:34:25 mouring Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -279,13 +279,22 @@ mips-sony-bsd|mips-sony-newsos4) AC_CHECK_FUNCS(getluid setluid) MANTYPE=man ;; +*-*-unicosmk*) + no_libsocket=1 + no_libnsl=1 + AC_DEFINE(USE_PIPES) + AC_DEFINE(DISABLE_FD_PASSING) + LDFLAGS="$LDFLAGS" + LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" + MANTYPE=cat *-*-unicos*) no_libsocket=1 no_libnsl=1 AC_DEFINE(USE_PIPES) AC_DEFINE(DISABLE_FD_PASSING) - LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib" - LIBS="$LIBS -lgen -lrsc" + LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" + LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" + MANTYPE=cat ;; *-dec-osf*) AC_MSG_CHECKING(for Digital Unix SIA) diff --git a/defines.h b/defines.h index d8e9c757a..57d416143 100644 --- a/defines.h +++ b/defines.h @@ -1,7 +1,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.93 2002/07/18 16:31:52 tim Exp $ */ +/* $Id: defines.h,v 1.94 2002/07/22 23:34:25 mouring Exp $ */ /* Constants */ @@ -124,7 +124,7 @@ typedef char int8_t; # if (SIZEOF_SHORT_INT == 2) typedef short int int16_t; # else -# ifdef _CRAY +# if defined(_CRAY) && !defined(_CRAYSV2) # if (SIZEOF_SHORT_INT == 4) typedef short int16_t; # else @@ -137,7 +137,7 @@ typedef long int16_t; # if (SIZEOF_INT == 4) typedef int int32_t; # else -# ifdef _CRAY +# if defined(_CRAY) && !defined(_CRAYSV2) typedef long int32_t; # else # error "32 bit int type not found." @@ -161,7 +161,7 @@ typedef unsigned char u_int8_t; # if (SIZEOF_SHORT_INT == 2) typedef unsigned short int u_int16_t; # else -# ifdef _CRAY +# if defined(_CRAY) && !defined(_CRAYSV2) # if (SIZEOF_SHORT_INT == 4) typedef unsigned short u_int16_t; # else @@ -174,7 +174,7 @@ typedef unsigned long u_int16_t; # if (SIZEOF_INT == 4) typedef unsigned int u_int32_t; # else -# ifdef _CRAY +# if defined(_CRAY) && !defined(_CRAYSV2) typedef unsigned long u_int32_t; # else # error "32 bit int type not found." diff --git a/loginrec.c b/loginrec.c index df4abeb79..6dc608a4e 100644 --- a/loginrec.c +++ b/loginrec.c @@ -163,7 +163,7 @@ #include "log.h" #include "atomicio.h" -RCSID("$Id: loginrec.c,v 1.42 2002/07/14 22:50:51 tim Exp $"); +RCSID("$Id: loginrec.c,v 1.43 2002/07/22 23:34:25 mouring Exp $"); #ifdef HAVE_UTIL_H # include @@ -622,13 +622,13 @@ construct_utmp(struct logininfo *li, switch (li->type) { case LTYPE_LOGIN: ut->ut_type = USER_PROCESS; -#ifdef _CRAY +#if defined(_CRAY) && !defined(_CRAYSV2) cray_set_tmpdir(ut); #endif break; case LTYPE_LOGOUT: ut->ut_type = DEAD_PROCESS; -#ifdef _CRAY +#if defined(_CRAY) && !defined(_CRAYSV2) cray_retain_utmp(ut, li->pid); #endif break; diff --git a/sshd.c b/sshd.c index c04f55f4b..8f9d3c392 100644 --- a/sshd.c +++ b/sshd.c @@ -934,7 +934,7 @@ main(int ac, char **av) SYSLOG_FACILITY_AUTH : options.log_facility, !inetd_flag); -#ifdef _CRAY +#if defined(_CRAY) && !defined(_CRAYSV2) /* Cray can define user privs drop all prives now! * Not needed on PRIV_SU systems! */ diff --git a/sshpty.c b/sshpty.c index 64ac4e599..e3027ca2e 100644 --- a/sshpty.c +++ b/sshpty.c @@ -162,7 +162,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) } return 1; #else /* HAVE_DEV_PTS_AND_PTC */ -#ifdef _CRAY +#if defined(_CRAY) && !defined(_CRAYSV2) char buf[64]; int i; int highpty; @@ -268,7 +268,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) void *old; #endif /* USE_VHANGUP */ -#ifdef _CRAY +#if defined(_CRAY) && !defined(_CRAYSV2) if (setsid() < 0) error("setsid: %.100s", strerror(errno)); -- cgit v1.2.3 From 762104ede03f5ed71dadc77466aa1948531d8704 Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 23 Jul 2002 00:00:05 +0000 Subject: - (bal) [configure.ac] Missing ;; from cray patch. --- ChangeLog | 3 ++- configure.ac | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 4199bd21b..a249f0a45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ - (stevesk) [xmmap.c] missing prototype for fatal() - (bal) [configure.ac defines.h loginrec.c sshd.c sshpty.c] Partial sync with Cray (mostly #ifdef renaming). Patch by wendyp@cray.com. + - (bal) [configure.ac] Missing ;; from cray patch. 20020721 - (stevesk) [auth-pam.c] merge cosmetic changes from solar's @@ -1414,4 +1415,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2389 2002/07/22 23:34:25 mouring Exp $ +$Id: ChangeLog,v 1.2390 2002/07/23 00:00:05 mouring Exp $ diff --git a/configure.ac b/configure.ac index c8aa7e184..25d72e6c7 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.83 2002/07/22 23:34:25 mouring Exp $ +# $Id: configure.ac,v 1.84 2002/07/23 00:00:06 mouring Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -287,6 +287,7 @@ mips-sony-bsd|mips-sony-newsos4) LDFLAGS="$LDFLAGS" LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" MANTYPE=cat + ;; *-*-unicos*) no_libsocket=1 no_libnsl=1 -- cgit v1.2.3 From d730b780716d3955066f9fcc89aa377b31079cff Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Tue, 13 Aug 2002 18:52:10 -0700 Subject: [configure.ac] Display OpenSSL header/library version. Patch by dtucker@zip.com.au --- ChangeLog | 6 +++++- configure.ac | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 70 insertions(+), 2 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 74ce05354..9e002568a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20020813 + - (tim) [configure.ac] Display OpenSSL header/library version. + Patch by dtucker@zip.com.au + 20020731 - (bal) OpenBSD CVS Sync - markus@cvs.openbsd.org 2002/07/24 16:11:18 @@ -1490,4 +1494,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2413 2002/08/01 01:28:38 mouring Exp $ +$Id: ChangeLog,v 1.2414 2002/08/14 01:52:10 tim Exp $ diff --git a/configure.ac b/configure.ac index 25d72e6c7..615fec2a5 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.84 2002/07/23 00:00:06 mouring Exp $ +# $Id: configure.ac,v 1.85 2002/08/14 01:52:11 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -764,6 +764,70 @@ AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL), ] ) +# Determine OpenSSL header version +AC_MSG_CHECKING([OpenSSL header version]) +AC_TRY_RUN( + [ +#include +#include +#include +#define DATA "conftest.sslincver" +int main(void) { + FILE *fd; + int rc; + + fd = fopen(DATA,"w"); + if(fd == NULL) + exit(1); + + if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0) + exit(1); + + exit(0); +} + ], + [ + ssl_header_ver=`cat conftest.sslincver` + AC_MSG_RESULT($ssl_header_ver) + ], + [ + AC_MSG_RESULT(not found) + AC_MSG_ERROR(OpenSSL version header not found.) + ] +) + +# Determine OpenSSL library version +AC_MSG_CHECKING([OpenSSL library version]) +AC_TRY_RUN( + [ +#include +#include +#include +#include +#define DATA "conftest.ssllibver" +int main(void) { + FILE *fd; + int rc; + + fd = fopen(DATA,"w"); + if(fd == NULL) + exit(1); + + if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0) + exit(1); + + exit(0); +} + ], + [ + ssl_library_ver=`cat conftest.ssllibver` + AC_MSG_RESULT($ssl_library_ver) + ], + [ + AC_MSG_RESULT(not found) + AC_MSG_ERROR(OpenSSL library not found.) + ] +) # Sanity check OpenSSL headers AC_MSG_CHECKING([whether OpenSSL's headers match the library]) -- cgit v1.2.3 From fc93d4bd31788a89341991dd500f40e6ed50cd4e Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Wed, 4 Sep 2002 23:26:29 +1000 Subject: - (djm) Patch from itojun@ for Darwin OS: test getaddrinfo, reorder libcrypt --- ChangeLog | 3 ++- configure.ac | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 39d89308d..48afa6322 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ 20020903 + - (djm) Patch from itojun@ for Darwin OS: test getaddrinfo, reorder libcrypt - (djm) Fix Redhat RPM build dependancy test - (djm) OpenBSD CVS Sync - markus@cvs.openbsd.org 2002/08/12 10:46:35 @@ -1596,4 +1597,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2443 2002/09/04 07:19:04 djm Exp $ +$Id: ChangeLog,v 1.2444 2002/09/04 13:26:29 djm Exp $ diff --git a/configure.ac b/configure.ac index 615fec2a5..9d3593aa4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.85 2002/08/14 01:52:11 tim Exp $ +# $Id: configure.ac,v 1.86 2002/09/04 13:26:30 djm Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -98,7 +98,16 @@ case "$host" in AC_DEFINE(IP_TOS_IS_BROKEN) ;; *-*-darwin*) - AC_DEFINE(BROKEN_GETADDRINFO) + AC_MSG_CHECKING(if we have working getaddrinfo) + AC_TRY_RUN([#include +main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) + exit(0); + else + exit(1); +}], [AC_MSG_RESULT(working)], + [AC_MSG_RESULT(buggy) + AC_DEFINE(BROKEN_GETADDRINFO)], + [AC_MSG_RESULT(assume it is working)]) ;; *-*-hpux10.26) if test -z "$GCC"; then @@ -175,6 +184,7 @@ mips-sony-bsd|mips-sony-newsos4) SONY=1 ;; *-*-netbsd*) + check_for_libcrypt_before=1 need_dash_r=1 ;; *-*-freebsd*) @@ -718,6 +728,12 @@ if test "x$PAM_MSG" = "xyes" ; then ) fi +# Some systems want crypt() from libcrypt, *not* the version in OpenSSL, +# because the system crypt() is more featureful. +if test "x$check_for_libcrypt_before" = "x1"; then + AC_CHECK_LIB(crypt, crypt) +fi + # Search for OpenSSL saved_CPPFLAGS="$CPPFLAGS" saved_LDFLAGS="$LDFLAGS" -- cgit v1.2.3 From 771721fa31623a821d46a82e04b39cdc217a9c3a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 12 Sep 2002 10:32:59 +1000 Subject: - (djm) Added getpeereid() replacement. Properly implemented for systems with SO_PEERCRED support. Faked for systems which lack it. --- ChangeLog | 4 ++- configure.ac | 4 +-- openbsd-compat/Makefile.in | 4 +-- openbsd-compat/bsd-getpeereid.c | 56 +++++++++++++++++++++++++++++++++++++++++ openbsd-compat/bsd-getpeereid.h | 14 +++++++++++ openbsd-compat/openbsd-compat.h | 3 ++- 6 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 openbsd-compat/bsd-getpeereid.c create mode 100644 openbsd-compat/bsd-getpeereid.h (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index 7b0053d25..a10e69f41 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 20020912 + - (djm) Added getpeereid() replacement. Properly implemented for systems + with SO_PEERCRED support. Faked for systems which lack it. - (djm) OpenBSD CVS Sync - markus@cvs.openbsd.org 2002/09/08 20:24:08 [hostfile.h] @@ -1646,4 +1648,4 @@ - (stevesk) entropy.c: typo in debug message - (djm) ssh-keygen -i needs seeded RNG; report from markus@ -$Id: ChangeLog,v 1.2458 2002/09/11 23:54:25 djm Exp $ +$Id: ChangeLog,v 1.2459 2002/09/12 00:32:59 djm Exp $ diff --git a/configure.ac b/configure.ac index 9d3593aa4..84e6adec4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.86 2002/09/04 13:26:30 djm Exp $ +# $Id: configure.ac,v 1.87 2002/09/12 00:33:00 djm Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -596,7 +596,7 @@ AC_ARG_WITH(tcp-wrappers, dnl Checks for library functions. AC_CHECK_FUNCS(arc4random b64_ntop bcopy bindresvport_sa \ clock fchmod fchown freeaddrinfo futimes gai_strerror \ - getaddrinfo getcwd getgrouplist getnameinfo getopt \ + getaddrinfo getcwd getgrouplist getnameinfo getopt getpeereid\ getrlimit getrusage getttyent glob inet_aton inet_ntoa \ inet_ntop innetgr login_getcapbool md5_crypt memmove \ mkdtemp mmap ngetaddrinfo openpty ogetaddrinfo readpassphrase \ diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index c365ae18f..5229e7e20 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.22 2002/07/14 20:36:51 tim Exp $ +# $Id: Makefile.in,v 1.23 2002/09/12 00:33:02 djm Exp $ sysconfdir=@sysconfdir@ piddir=@piddir@ @@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@ OPENBSD=base64.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.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 -COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o xmmap.o +COMPAT=bsd-arc4random.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-snprintf.o bsd-waitpid.o fake-getaddrinfo.o fake-getnameinfo.o xmmap.o PORTS=port-irix.o port-aix.o diff --git a/openbsd-compat/bsd-getpeereid.c b/openbsd-compat/bsd-getpeereid.c new file mode 100644 index 000000000..c7876823d --- /dev/null +++ b/openbsd-compat/bsd-getpeereid.c @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2002 Damien Miller. 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" + +RCSID("$Id: bsd-getpeereid.c,v 1.1 2002/09/12 00:33:02 djm Exp $"); + +#if !defined(HAVE_GETPEEREID) + +#if defined(SO_PEERCRED) +int +getpeereid(int s, uid_t *euid, gid_t *gid) +{ + struct ucred cred; + size_t len = sizeof(cred); + + if (getsockopt(s, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0) + return (-1); + *euid = cred.uid; + *gid = cred.gid; + + return (0); +} +#else +int +getpeereid(int s, uid_t *euid, gid_t *gid) +{ + *euid = geteuid(); + *gid = getgid(); + + return (0); +} +#endif /* defined(SO_PEERCRED) */ + +#endif /* !defined(HAVE_GETPEEREID) */ diff --git a/openbsd-compat/bsd-getpeereid.h b/openbsd-compat/bsd-getpeereid.h new file mode 100644 index 000000000..2e9f077f9 --- /dev/null +++ b/openbsd-compat/bsd-getpeereid.h @@ -0,0 +1,14 @@ +/* $Id: bsd-getpeereid.h,v 1.1 2002/09/12 00:33:02 djm Exp $ */ + +#ifndef _BSD_GETPEEREID_H +#define _BSD_GETPEEREID_H + +#include "config.h" + +#include /* For uid_t, gid_t */ + +#ifndef HAVE_GETPEEREID +int getpeereid(int , uid_t *, gid_t *); +#endif /* HAVE_GETPEEREID */ + +#endif /* _BSD_GETPEEREID_H */ diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index 11918443d..ae18afd34 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h @@ -1,4 +1,4 @@ -/* $Id: openbsd-compat.h,v 1.16 2002/02/19 20:27:57 mouring Exp $ */ +/* $Id: openbsd-compat.h,v 1.17 2002/09/12 00:33:02 djm Exp $ */ #ifndef _OPENBSD_H #define _OPENBSD_H @@ -29,6 +29,7 @@ /* Home grown routines */ #include "bsd-arc4random.h" +#include "bsd-getpeereid.h" #include "bsd-misc.h" #include "bsd-snprintf.h" #include "bsd-waitpid.h" -- cgit v1.2.3 From 2c961cecb008de61eb0fdd220f406d08a788ee55 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Mon, 23 Sep 2002 16:54:10 -0700 Subject: [configure.ac] s/return/exit/ patch by dtucker@zip.com.au From autoconf guidelines: "Test programs should exit, not return, from main, because on some systems (old Suns, at least) the argument to return in main is ignored." --- ChangeLog | 5 ++++- configure.ac | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index e99748ece..1f9ef0251 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +20020923 + - (tim) [configure.ac] s/return/exit/ patch by dtucker@zip.com.au + 20020922 - (djm) OpenBSD CVS Sync - stevesk@cvs.openbsd.org 2002/09/19 14:53:14 @@ -693,4 +696,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2475 2002/09/21 15:26:51 djm Exp $ +$Id: ChangeLog,v 1.2476 2002/09/23 23:54:10 tim Exp $ diff --git a/configure.ac b/configure.ac index 84e6adec4..f88d993e6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.87 2002/09/12 00:33:00 djm Exp $ +# $Id: configure.ac,v 1.88 2002/09/23 23:54:12 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -497,7 +497,7 @@ AC_TRY_RUN( [ #include #include -int main(void){struct dirent d;return(sizeof(d.d_name)<=sizeof(char));} +int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));} ], [AC_MSG_RESULT(yes)], [ @@ -528,7 +528,7 @@ AC_ARG_WITH(skey, [ #include #include -int main() { char *ff = skey_keyinfo(""); ff=""; return 0; } +int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); } ], [AC_MSG_RESULT(yes)], [ @@ -668,7 +668,7 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then AC_TRY_RUN( [ #include -int main(void){char b[5];snprintf(b,5,"123456789");return(b[4]!='\0');} +int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} ], [AC_MSG_RESULT(yes)], [ @@ -851,7 +851,7 @@ AC_TRY_RUN( [ #include #include -int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } +int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); } ], [ AC_MSG_RESULT(yes) @@ -877,7 +877,7 @@ AC_TRY_RUN( [ #include #include -int main(void) { return(RAND_status() == 1 ? 0 : 1); } +int main(void) { exit(RAND_status() == 1 ? 0 : 1); } ], [ OPENSSL_SEEDS_ITSELF=yes -- cgit v1.2.3 From 81ed518b9b888502cc57b23c02c47634ca508748 Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Wed, 25 Sep 2002 17:38:46 -0700 Subject: Cray fixes (bug 367) based on patch from Wendy Palm @ cray. This does not include the deattack.c fixes. --- ChangeLog | 4 +++- acconfig.h | 5 ++++- auth1.c | 9 +++++++++ auth2.c | 11 +++++++++++ configure.ac | 7 ++++--- defines.h | 14 +++++++------- includes.h | 8 ++++++++ loginrec.c | 6 +++--- openbsd-compat/bsd-cray.c | 4 ++-- openbsd-compat/bsd-cray.h | 4 ++-- serverloop.c | 2 ++ session.c | 27 ++++++++++++++++++++++++++- sshd.c | 2 +- sshpty.c | 8 ++++---- 14 files changed, 86 insertions(+), 25 deletions(-) (limited to 'configure.ac') diff --git a/ChangeLog b/ChangeLog index a42c010af..24074d183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20020925 - (bal) Fix issue where successfull login does not clear failure counts in AIX. Patch by dtucker@zip.com.au ok by djm + - (tim) Cray fixes (bug 367) based on patch from Wendy Palm @ cray. + This does not include the deattack.c fixes. 20020923 - (djm) OpenBSD CVS Sync @@ -719,4 +721,4 @@ save auth method before monitor_reset_key_state(); bugzilla bug #284; ok provos@ -$Id: ChangeLog,v 1.2481 2002/09/25 23:14:14 mouring Exp $ +$Id: ChangeLog,v 1.2482 2002/09/26 00:38:46 tim Exp $ diff --git a/acconfig.h b/acconfig.h index f8fc650d7..3e058f3ea 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,4 +1,4 @@ -/* $Id: acconfig.h,v 1.144 2002/07/14 20:36:50 tim Exp $ */ +/* $Id: acconfig.h,v 1.145 2002/09/26 00:38:48 tim Exp $ */ #ifndef _CONFIG_H #define _CONFIG_H @@ -150,6 +150,9 @@ /* Define if you don't want to use lastlog */ #undef DISABLE_LASTLOG +/* Define if you don't want to use lastlog in session.c */ +#undef NO_SSH_LASTLOG + /* Define if you don't want to use utmp */ #undef DISABLE_UTMP diff --git a/auth1.c b/auth1.c index 4d2b92a22..676c8a667 100644 --- a/auth1.c +++ b/auth1.c @@ -304,6 +304,15 @@ do_authloop(Authctxt *authctxt) fatal("INTERNAL ERROR: authenticated invalid user %s", authctxt->user); +#ifdef _UNICOS + if (type == SSH_CMSG_AUTH_PASSWORD && !authenticated) + cray_login_failure(authctxt->user, IA_UDBERR); + if (authenticated && cray_access_denied(authctxt->user)) { + authenticated = 0; + fatal("Access denied for user %s.",authctxt->user); + } +#endif /* _UNICOS */ + #ifdef HAVE_CYGWIN if (authenticated && !check_nt_auth(type == SSH_CMSG_AUTH_PASSWORD, pw)) { diff --git a/auth2.c b/auth2.c index 1cb9769ff..17c58552a 100644 --- a/auth2.c +++ b/auth2.c @@ -216,6 +216,13 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) authenticated = 0; #endif /* USE_PAM */ +#ifdef _UNICOS + if (authenticated && cray_access_denied(authctxt->user)) { + authenticated = 0; + fatal("Access denied for user %s.",authctxt->user); + } +#endif /* _UNICOS */ + /* Log before sending the reply */ auth_log(authctxt, authenticated, method, " ssh2"); @@ -235,6 +242,10 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method) if (authctxt->failures++ > AUTH_FAIL_MAX) { packet_disconnect(AUTH_FAIL_MSG, authctxt->user); } +#ifdef _UNICOS + if (strcmp(method, "password") == 0) + cray_login_failure(authctxt->user, IA_UDBERR); +#endif /* _UNICOS */ methods = authmethods_get(); packet_start(SSH2_MSG_USERAUTH_FAILURE); packet_put_cstring(methods); diff --git a/configure.ac b/configure.ac index f88d993e6..5fe50e56b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -# $Id: configure.ac,v 1.88 2002/09/23 23:54:12 tim Exp $ +# $Id: configure.ac,v 1.89 2002/09/26 00:38:47 tim Exp $ AC_INIT AC_CONFIG_SRCDIR([ssh.c]) @@ -303,6 +303,7 @@ mips-sony-bsd|mips-sony-newsos4) no_libnsl=1 AC_DEFINE(USE_PIPES) AC_DEFINE(DISABLE_FD_PASSING) + AC_DEFINE(NO_SSH_LASTLOG) LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" MANTYPE=cat @@ -376,14 +377,14 @@ AC_ARG_WITH(libs, # Checks for header files. AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ - getopt.h glob.h lastlog.h limits.h login.h \ + getopt.h glob.h ia.h lastlog.h limits.h login.h \ login_cap.h maillock.h netdb.h netgroup.h \ netinet/in_systm.h paths.h pty.h readpassphrase.h \ rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ sys/mman.h sys/select.h sys/stat.h \ sys/stropts.h sys/sysmacros.h sys/time.h \ - sys/un.h time.h ttyent.h usersec.h \ + sys/un.h time.h tmpdir.h ttyent.h usersec.h \ util.h utime.h utmp.h utmpx.h) # Checks for libraries. diff --git a/defines.h b/defines.h index 42b12e9a4..ab19a077c 100644 --- a/defines.h +++ b/defines.h @@ -1,7 +1,7 @@ #ifndef _DEFINES_H #define _DEFINES_H -/* $Id: defines.h,v 1.95 2002/08/21 02:54:12 mouring Exp $ */ +/* $Id: defines.h,v 1.96 2002/09/26 00:38:48 tim Exp $ */ /* Constants */ @@ -124,7 +124,7 @@ typedef char int8_t; # if (SIZEOF_SHORT_INT == 2) typedef short int int16_t; # else -# if defined(_CRAY) && !defined(_CRAYSV2) +# ifdef _UNICOS # if (SIZEOF_SHORT_INT == 4) typedef short int16_t; # else @@ -132,16 +132,16 @@ typedef long int16_t; # endif # else # error "16 bit int type not found." -# endif /* _CRAY */ +# endif /* _UNICOS */ # endif # if (SIZEOF_INT == 4) typedef int int32_t; # else -# if defined(_CRAY) && !defined(_CRAYSV2) +# ifdef _UNICOS typedef long int32_t; # else # error "32 bit int type not found." -# endif /* _CRAY */ +# endif /* _UNICOS */ # endif #endif @@ -161,7 +161,7 @@ typedef unsigned char u_int8_t; # if (SIZEOF_SHORT_INT == 2) typedef unsigned short int u_int16_t; # else -# if defined(_CRAY) && !defined(_CRAYSV2) +# ifdef _UNICOS # if (SIZEOF_SHORT_INT == 4) typedef unsigned short u_int16_t; # else @@ -174,7 +174,7 @@ typedef unsigned long u_int16_t; # if (SIZEOF_INT == 4) typedef unsigned int u_int32_t; # else -# if defined(_CRAY) && !defined(_CRAYSV2) +# ifdef _UNICOS typedef unsigned long u_int32_t; # else # error "32 bit int type not found." diff --git a/includes.h b/includes.h index f6aa2ae67..d7b875c52 100644 --- a/includes.h +++ b/includes.h @@ -149,6 +149,14 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg } # include #endif +#ifdef HAVE_IA_H +# include +#endif + +#ifdef HAVE_TMPDIR_H +# include +#endif + #include /* For OPENSSL_VERSION_NUMBER */ #include "defines.h" diff --git a/loginrec.c b/loginrec.c index 6dc608a4e..02c3106a3 100644 --- a/loginrec.c +++ b/loginrec.c @@ -163,7 +163,7 @@ #include "log.h" #include "atomicio.h" -RCSID("$Id: loginrec.c,v 1.43 2002/07/22 23:34:25 mouring Exp $"); +RCSID("$Id: loginrec.c,v 1.44 2002/09/26 00:38:49 tim Exp $"); #ifdef HAVE_UTIL_H # include @@ -622,13 +622,13 @@ construct_utmp(struct logininfo *li, switch (li->type) { case LTYPE_LOGIN: ut->ut_type = USER_PROCESS; -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS cray_set_tmpdir(ut); #endif break; case LTYPE_LOGOUT: ut->ut_type = DEAD_PROCESS; -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS cray_retain_utmp(ut, li->pid); #endif break; diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index 8a14b0807..edb3112b3 100644 --- a/openbsd-compat/bsd-cray.c +++ b/openbsd-compat/bsd-cray.c @@ -1,5 +1,5 @@ /* - * $Id: bsd-cray.c,v 1.7 2002/07/23 21:00:18 mouring Exp $ + * $Id: bsd-cray.c,v 1.8 2002/09/26 00:38:51 tim Exp $ * * bsd-cray.c * @@ -34,7 +34,7 @@ * on UNICOS systems. * */ -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS #include #include diff --git a/openbsd-compat/bsd-cray.h b/openbsd-compat/bsd-cray.h index 0b75b2268..8868b4364 100644 --- a/openbsd-compat/bsd-cray.h +++ b/openbsd-compat/bsd-cray.h @@ -1,5 +1,5 @@ /* - * $Id: bsd-cray.h,v 1.4 2002/07/23 21:00:18 mouring Exp $ + * $Id: bsd-cray.h,v 1.5 2002/09/26 00:38:51 tim Exp $ * * bsd-cray.h * @@ -37,7 +37,7 @@ #ifndef _BSD_CRAY_H #define _BSD_CRAY_H -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS void cray_init_job(struct passwd *); /* init cray job */ void cray_job_termination_handler(int); /* process end of job signal */ void cray_login_failure(char *username, int errcode); diff --git a/serverloop.c b/serverloop.c index 5112de680..58e20dfb9 100644 --- a/serverloop.c +++ b/serverloop.c @@ -144,7 +144,9 @@ sigchld_handler(int sig) int save_errno = errno; debug("Received SIGCHLD."); child_terminated = 1; +#ifndef _UNICOS mysignal(SIGCHLD, sigchld_handler); +#endif notify_parent(); errno = save_errno; } diff --git a/session.c b/session.c index 0ccd2006d..9074525a4 100644 --- a/session.c +++ b/session.c @@ -512,10 +512,17 @@ do_exec_no_pty(Session *s, const char *command) perror("dup2 stderr"); #endif /* USE_PIPES */ +#ifdef _UNICOS + cray_init_job(s->pw); /* set up cray jid and tmpdir */ +#endif + /* Do processing for the child (exec command etc). */ do_child(s, command); /* NOTREACHED */ } +#ifdef _UNICOS + signal(WJSIGNAL, cray_job_termination_handler); +#endif /* _UNICOS */ #ifdef HAVE_CYGWIN if (is_winnt) cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); @@ -603,8 +610,12 @@ do_exec_pty(Session *s, const char *command) /* record login, etc. similar to login(1) */ #ifndef HAVE_OSF_SIA - if (!(options.use_login && command == NULL)) + if (!(options.use_login && command == NULL)) { +#ifdef _UNICOS + cray_init_job(s->pw); /* set up cray jid and tmpdir */ +#endif /* _UNICOS */ do_login(s, command); + } # ifdef LOGIN_NEEDS_UTMPX else do_pre_login(s); @@ -615,6 +626,9 @@ do_exec_pty(Session *s, const char *command) do_child(s, command); /* NOTREACHED */ } +#ifdef _UNICOS + signal(WJSIGNAL, cray_job_termination_handler); +#endif /* _UNICOS */ #ifdef HAVE_CYGWIN if (is_winnt) cygwin_set_impersonation_token(INVALID_HANDLE_VALUE); @@ -755,6 +769,7 @@ do_login(Session *s, const char *command) printf("%s\n", aixloginmsg); #endif /* WITH_AIXAUTHENTICATE */ +#ifndef NO_SSH_LASTLOG if (options.print_lastlog && s->last_login_time != 0) { time_string = ctime(&s->last_login_time); if (strchr(time_string, '\n')) @@ -765,6 +780,7 @@ do_login(Session *s, const char *command) printf("Last login: %s from %s\r\n", time_string, s->hostname); } +#endif /* NO_SSH_LASTLOG */ do_motd(); } @@ -1024,6 +1040,11 @@ do_setup_env(Session *s, const char *shell) child_set_env(&env, &envsize, "SSH_ORIGINAL_COMMAND", original_command); +#ifdef _UNICOS + if (cray_tmpdir[0] != '\0') + child_set_env(&env, &envsize, "TMPDIR", cray_tmpdir); +#endif /* _UNICOS */ + #ifdef _AIX { char *cp; @@ -1275,6 +1296,10 @@ do_child(Session *s, const char *command) if (options.use_login && command != NULL) options.use_login = 0; +#ifdef _UNICOS + cray_setup(pw->pw_uid, pw->pw_name, command); +#endif /* _UNICOS */ + /* * Login(1) does this as well, and it needs uid 0 for the "-h" * switch, so we let login(1) to this for us. diff --git a/sshd.c b/sshd.c index 17f001669..37026dc2e 100644 --- a/sshd.c +++ b/sshd.c @@ -940,7 +940,7 @@ main(int ac, char **av) SYSLOG_FACILITY_AUTH : options.log_facility, !inetd_flag); -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS /* Cray can define user privs drop all prives now! * Not needed on PRIV_SU systems! */ diff --git a/sshpty.c b/sshpty.c index e3027ca2e..28d0e310c 100644 --- a/sshpty.c +++ b/sshpty.c @@ -162,7 +162,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) } return 1; #else /* HAVE_DEV_PTS_AND_PTC */ -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS char buf[64]; int i; int highpty; @@ -268,7 +268,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) void *old; #endif /* USE_VHANGUP */ -#if defined(_CRAY) && !defined(_CRAYSV2) +#ifdef _UNICOS if (setsid() < 0) error("setsid: %.100s", strerror(errno)); @@ -290,7 +290,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) error("%.100s: %.100s", ttyname, strerror(errno)); close(*ttyfd); *ttyfd = fd; -#else /* _CRAY */ +#else /* _UNICOS */ /* First disconnect from the old controlling tty. */ #ifdef TIOCNOTTY @@ -345,7 +345,7 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname) strerror(errno)); else close(fd); -#endif /* _CRAY */ +#endif /* _UNICOS */ } /* Changes the window size associated with the pty. */ -- cgit v1.2.3