]> andersk Git - gssapi-openssh.git/commitdiff
Import of OpenSSH 3.5p1 OPENSSH_3_5P1
authorjbasney <jbasney>
Fri, 18 Oct 2002 13:12:31 +0000 (13:12 +0000)
committerjbasney <jbasney>
Fri, 18 Oct 2002 13:12:31 +0000 (13:12 +0000)
147 files changed:
openssh/CREDITS
openssh/ChangeLog
openssh/INSTALL
openssh/Makefile.in
openssh/TODO
openssh/acconfig.h
openssh/auth-bsdauth.c
openssh/auth-krb4.c
openssh/auth-krb5.c
openssh/auth-options.c
openssh/auth-options.h
openssh/auth-pam.c
openssh/auth-pam.h
openssh/auth-passwd.c
openssh/auth-skey.c
openssh/auth.c
openssh/auth.h
openssh/auth1.c
openssh/auth2-chall.c
openssh/auth2-none.c
openssh/auth2-pam.c
openssh/auth2.c
openssh/authfd.c
openssh/authfd.h
openssh/autom4te-2.53.cache/output.0
openssh/autom4te-2.53.cache/traces.0
openssh/canohost.c
openssh/channels.c
openssh/channels.h
openssh/cipher.c
openssh/clientloop.c
openssh/compat.c
openssh/compat.h
openssh/config.guess
openssh/config.sub
openssh/configure.ac
openssh/contrib/Makefile [new file with mode: 0644]
openssh/contrib/README
openssh/contrib/aix/buildbff.sh
openssh/contrib/caldera/openssh.spec
openssh/contrib/cygwin/README
openssh/contrib/cygwin/ssh-host-config
openssh/contrib/gnome-ssh-askpass1.c [new file with mode: 0644]
openssh/contrib/gnome-ssh-askpass2.c [new file with mode: 0644]
openssh/contrib/redhat/openssh.spec
openssh/contrib/solaris/buildpkg.sh
openssh/contrib/solaris/opensshd.in
openssh/contrib/suse/openssh.spec
openssh/defines.h
openssh/dh.c
openssh/hostfile.c
openssh/hostfile.h
openssh/includes.h
openssh/kex.h
openssh/key.c
openssh/log.c
openssh/log.h
openssh/loginrec.c
openssh/monitor.c
openssh/monitor.h
openssh/monitor_fdpass.c
openssh/monitor_mm.c
openssh/monitor_mm.h
openssh/monitor_wrap.c
openssh/monitor_wrap.h
openssh/msg.c
openssh/msg.h
openssh/openbsd-compat/Makefile.in
openssh/openbsd-compat/base64.c
openssh/openbsd-compat/bindresvport.c
openssh/openbsd-compat/bsd-cray.c
openssh/openbsd-compat/bsd-cray.h
openssh/openbsd-compat/bsd-getpeereid.c [new file with mode: 0644]
openssh/openbsd-compat/bsd-getpeereid.h [new file with mode: 0644]
openssh/openbsd-compat/bsd-misc.c
openssh/openbsd-compat/dirname.c
openssh/openbsd-compat/getcwd.c
openssh/openbsd-compat/getopt.c
openssh/openbsd-compat/glob.c
openssh/openbsd-compat/glob.h
openssh/openbsd-compat/inet_ntoa.c
openssh/openbsd-compat/inet_ntop.c
openssh/openbsd-compat/mktemp.c
openssh/openbsd-compat/openbsd-compat.h
openssh/openbsd-compat/port-aix.c
openssh/openbsd-compat/port-aix.h
openssh/openbsd-compat/readpassphrase.c
openssh/openbsd-compat/readpassphrase.h
openssh/openbsd-compat/realpath.c
openssh/openbsd-compat/rresvport.c
openssh/openbsd-compat/setenv.c
openssh/openbsd-compat/sigact.c
openssh/openbsd-compat/strlcat.c
openssh/openbsd-compat/strlcpy.c
openssh/openbsd-compat/strsep.c
openssh/openbsd-compat/sys-queue.h [new file with mode: 0644]
openssh/openbsd-compat/sys-tree.h [new file with mode: 0644]
openssh/openbsd-compat/xmmap.c [new file with mode: 0644]
openssh/openbsd-compat/xmmap.h [new file with mode: 0644]
openssh/packet.c
openssh/radix.c
openssh/readconf.c
openssh/rijndael.c
openssh/scard.h
openssh/servconf.c
openssh/servconf.h
openssh/serverloop.c
openssh/session.c
openssh/session.h
openssh/sftp-client.c
openssh/sftp-client.h
openssh/sftp-common.c
openssh/sftp-common.h
openssh/sftp-glob.c
openssh/sftp-glob.h
openssh/sftp-int.c
openssh/sftp-server.c
openssh/sftp.1
openssh/sftp.c
openssh/ssh-add.c
openssh/ssh-agent.c
openssh/ssh-dss.c
openssh/ssh-keygen.c
openssh/ssh-keyscan.c
openssh/ssh-keysign.8
openssh/ssh-keysign.c
openssh/ssh-rand-helper.c
openssh/ssh-rsa.c
openssh/ssh.1
openssh/ssh.c
openssh/ssh.h
openssh/ssh_config
openssh/ssh_config.5
openssh/ssh_prng_cmds.in
openssh/sshconnect.c
openssh/sshconnect1.c
openssh/sshconnect2.c
openssh/sshd.8
openssh/sshd.c
openssh/sshd_config
openssh/sshd_config.5
openssh/sshlogin.c
openssh/sshlogin.h
openssh/sshpty.c
openssh/uidswap.c
openssh/uuencode.c
openssh/version.h

index 1acb3f837a70ab1513d75625de724b09bb0e04a1..487a41d8cd96189f6dc7f7ac106ab2032a7e4ccd 100644 (file)
@@ -76,6 +76,7 @@ Phill Camp <P.S.S.Camp@ukc.ac.uk> - login code fix
 Rip Loomis <loomisg@cist.saic.com> - Solaris package support, fixes
 SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp> - Multiple bugfixes
 Simon Wilkinson <sxw@dcs.ed.ac.uk> - PAM fixes, Compat with MIT KrbV
+Solar Designer <solar@openwall.com> - many patches and technical assistance
 Svante Signell <svante.signell@telia.com> - Bugfixes
 Thomas Neumann <tom@smart.ruhr.de> - Shadow passwords
 Tim Rice <tim@multitalents.net> - Portability & SCO fixes
index 53a2e3880dd075e593de4244f10db3c16c872814..0ce0bd5bc822f42da9b2c73051e8bda7fbae90a6 100644 (file)
@@ -1,3 +1,599 @@
+20021003
+ - (djm) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2002/10/01 20:34:12
+     [ssh-agent.c]
+     allow root to access the agent, since there is no protection from root.
+   - markus@cvs.openbsd.org 2002/10/01 13:24:50
+     [version.h]
+     OpenSSH 3.5
+ - (djm) Bump RPM spec version numbers
+ - (djm) Bug #406 s/msg_send/ssh_msh_send/ for Mac OS X 1.2
+
+20020930
+ - (djm) Tidy contrib/, add Makefile for GNOME passphrase dialogs, 
+   tweak README
+ - (djm) OpenBSD CVS Sync
+   - mickey@cvs.openbsd.org 2002/09/27 10:42:09
+     [compat.c compat.h sshd.c]
+     add a generic match for a prober, such as sie big brother; 
+     idea from stevesk@; markus@ ok
+   - stevesk@cvs.openbsd.org 2002/09/27 15:46:21
+     [ssh.1]
+     clarify compression level protocol 1 only; ok markus@ deraadt@
+
+20020927
+ - (djm) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2002/09/25 11:17:16
+     [sshd_config]
+     sync LoginGraceTime with default
+   - markus@cvs.openbsd.org 2002/09/25 15:19:02
+     [sshd.c]
+     typo; pilot@monkey.org
+   - markus@cvs.openbsd.org 2002/09/26 11:38:43
+     [auth1.c auth.h auth-krb4.c monitor.c monitor.h monitor_wrap.c]
+     [monitor_wrap.h]
+     krb4 + privsep; ok dugsong@, deraadt@
+
+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
+   - stevesk@cvs.openbsd.org 2002/09/23 20:46:27
+     [canohost.c]
+     change get_peer_ipaddr() and get_local_ipaddr() to not return NULL for
+     non-sockets; fixes a problem passing NULL to snprintf(). ok markus@
+   - markus@cvs.openbsd.org 2002/09/23 22:11:05
+     [monitor.c]
+     only call auth_krb5 if kerberos is enabled; ok deraadt@
+   - markus@cvs.openbsd.org 2002/09/24 08:46:04
+     [monitor.c]
+     only call kerberos code for authctxt->valid
+   - todd@cvs.openbsd.org 2002/09/24 20:59:44
+     [sshd.8]
+     tweak the example $HOME/.ssh/rc script to not show on any cmdline the
+     sensitive data it handles. This fixes bug # 402 as reported by
+     kolya@mit.edu (Nickolai Zeldovich).
+     ok markus@ and stevesk@
+
+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
+     [compat.c]
+   - markus@cvs.openbsd.org 2002/09/19 15:51:23
+     [ssh-add.c]
+     typo; cd@kalkatraz.de
+   - stevesk@cvs.openbsd.org 2002/09/19 16:03:15
+     [serverloop.c]
+     log IP address also; ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/20 18:41:29
+     [auth.c]
+     log illegal user here for missing privsep case (ssh2).
+     this is executed in the monitor. ok markus@
+
+20020919
+ - (djm) OpenBSD CVS Sync
+   - stevesk@cvs.openbsd.org 2002/09/12 19:11:52
+     [ssh-agent.c]
+     %u for uid print; ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/12 19:50:36
+     [session.c ssh.1]
+     add SSH_CONNECTION and deprecate SSH_CLIENT; bug #384.  ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/13 19:23:09
+     [channels.c sshconnect.c sshd.c]
+     remove use of SO_LINGER, it should not be needed. error check
+     SO_REUSEADDR. fixup comments. ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/16 19:55:33
+     [session.c]
+     log when _PATH_NOLOGIN exists; ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/16 20:12:11
+     [sshd_config.5]
+     more details on X11Forwarding security issues and threats; ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/16 22:03:13
+     [sshd.8]
+     reference moduli(5) in FILES /etc/moduli.
+   - itojun@cvs.openbsd.org 2002/09/17 07:47:02
+     [channels.c]
+     don't quit while creating X11 listening socket.
+     http://mail-index.netbsd.org/current-users/2002/09/16/0005.html
+     got from portable.  markus ok
+   - djm@cvs.openbsd.org 2002/09/19 01:58:18
+     [ssh.c sshconnect.c]
+     bugzilla.mindrot.org #223 - ProxyCommands don't exit.
+     Patch from dtucker@zip.com.au; ok markus@
+
+20020912
+ - (djm) Made GNOME askpass programs return non-zero if cancel button is 
+   pressed.
+ - (djm) Added getpeereid() replacement. Properly implemented for systems
+   with SO_PEERCRED support. Faked for systems which lack it.
+ - (djm) Sync sys/tree.h with OpenBSD -current. Rename tree.h and 
+   fake-queue.h to sys-tree.h and sys-queue.h
+ - (djm) OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2002/09/08 20:24:08
+     [hostfile.h]
+     no comma at end of enumerator list
+   - itojun@cvs.openbsd.org 2002/09/09 06:48:06
+     [auth1.c auth.h auth-krb5.c monitor.c monitor.h]
+     [monitor_wrap.c monitor_wrap.h]
+     kerberos support for privsep.  confirmed to work by lha@stacken.kth.se
+     patch from markus
+   - markus@cvs.openbsd.org 2002/09/09 14:54:15
+     [channels.c kex.h key.c monitor.c monitor_wrap.c radix.c uuencode.c]
+     signed vs unsigned from -pedantic; ok henning@
+   - markus@cvs.openbsd.org 2002/09/10 20:24:47
+     [ssh-agent.c]
+     check the euid of the connecting process with getpeereid(2); 
+     ok provos deraadt stevesk
+   - stevesk@cvs.openbsd.org 2002/09/11 17:55:03
+     [ssh.1]
+     add agent and X11 forwarding warning text from ssh_config.5; ok markus@
+   - stevesk@cvs.openbsd.org 2002/09/11 18:27:26
+     [authfd.c authfd.h ssh.c]
+     don't connect to agent to test for presence if we've previously
+     connected; ok markus@
+   - djm@cvs.openbsd.org 2002/09/11 22:41:50
+     [sftp.1 sftp-client.c sftp-client.h sftp-common.c sftp-common.h]
+     [sftp-glob.c sftp-glob.h sftp-int.c sftp-server.c]
+     support for short/long listings and globbing in "ls"; ok markus@
+   - djm@cvs.openbsd.org 2002/09/12 00:13:06
+     [sftp-int.c]
+     zap unused var introduced in last commit
+
+20020911
+ - (djm) Sync openbsd-compat with OpenBSD -current
+
+20020910
+ - (djm) Bug #365: Read /.ssh/environment properly under CygWin. 
+   Patch from Mark Bradshaw <bradshaw@staff.crosswalk.com>
+ - (djm) Bug #138: Make protocol 1 blowfish work with old OpenSSL. 
+   Patch from Robert Halubek <rob@adso.com.pl>
+
+20020905 
+ - (djm) OpenBSD CVS Sync
+   - stevesk@cvs.openbsd.org 2002/09/04 18:52:42
+     [servconf.c sshd.8 sshd_config.5]
+     default LoginGraceTime to 2m; 1m may be too short for slow systems.
+     ok markus@
+ - (djm) Merge openssh-TODO.patch from Redhat (null) beta
+ - (djm) Add gnome-ssh-askpass2.c (gtk2) by merge with patch from 
+    Nalin Dahyabhai <nalin@redhat.com>
+ - (djm) Add support for building gtk2 password requestor from Redhat beta
+
+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
+     [ssh-agent.c]
+     make ssh-agent setgid, disallow ptrace.
+   - espie@cvs.openbsd.org 2002/08/21 11:20:59
+     [sshd.8]
+     `RSA' updated to refer to `public key', where it matters.
+     okay markus@
+   - stevesk@cvs.openbsd.org 2002/08/21 19:38:06
+     [servconf.c sshd.8 sshd_config sshd_config.5]
+     change LoginGraceTime default to 1 minute; ok mouring@ markus@
+   - stevesk@cvs.openbsd.org 2002/08/21 20:10:28
+     [ssh-agent.c]
+     raise listen backlog; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/22 19:27:53
+     [ssh-agent.c]
+     use common close function; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/22 19:38:42
+     [clientloop.c]
+     format with current EscapeChar; bugzilla #388 from wknox@mitre.org.
+     ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/22 20:57:19
+     [ssh-agent.c]
+     shutdown(SHUT_RDWR) not needed before close here; ok markus@
+   - markus@cvs.openbsd.org 2002/08/22 21:33:58
+     [auth1.c auth2.c]
+     auth_root_allowed() is handled by the monitor in the privsep case,
+     so skip this for use_privsep, ok stevesk@, fixes bugzilla #387/325
+   - markus@cvs.openbsd.org 2002/08/22 21:45:41
+     [session.c]
+     send signal name (not signal number) in "exit-signal" message; noticed
+     by galb@vandyke.com
+   - stevesk@cvs.openbsd.org 2002/08/27 17:13:56
+     [ssh-rsa.c]
+     RSA_public_decrypt() returns -1 on error so len must be signed; 
+     ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/27 17:18:40
+     [ssh_config.5]
+     some warning text for ForwardAgent and ForwardX11; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/29 15:57:25
+     [monitor.c session.c sshlogin.c sshlogin.h]
+     pass addrlen with sockaddr *; from Hajimu UMEMOTO <ume@FreeBSD.org>
+     NOTE: there are also p-specific parts to this patch. ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/29 16:02:54
+     [ssh.1 ssh.c]
+     deprecate -P as UsePrivilegedPort defaults to no now; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/29 16:09:02
+     [ssh_config.5]
+     more on UsePrivilegedPort and setuid root; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/29 19:49:42
+     [ssh.c]
+     shrink initial privilege bracket for setuid case; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/29 22:54:10
+     [ssh_config.5 sshd_config.5]
+     state XAuthLocation is a full pathname
+
+20020820
+ - OpenBSD CVS Sync
+   - millert@cvs.openbsd.org 2002/08/02 14:43:15
+     [monitor.c monitor_mm.c]
+     Change mm_zalloc() sanity checks to be more in line with what
+     we do in calloc() and add a check to monitor_mm.c.
+     OK provos@ and markus@
+   - marc@cvs.openbsd.org 2002/08/02 16:00:07
+     [ssh.1 sshd.8]
+     note that .ssh/environment is only read when
+     allowed (PermitUserEnvironment in sshd_config).
+     OK markus@
+   - markus@cvs.openbsd.org 2002/08/02 21:23:41
+     [ssh-rsa.c]
+     diff is u_int (2x); ok deraadt/provos
+   - markus@cvs.openbsd.org 2002/08/02 22:20:30
+     [ssh-rsa.c]
+     replace RSA_verify with our own version and avoid the OpenSSL ASN.1 parser
+     for authentication; ok deraadt/djm
+   - aaron@cvs.openbsd.org 2002/08/08 13:50:23
+     [sshconnect1.c]
+     Use & to test if bits are set, not &&; markus@ ok.
+   - stevesk@cvs.openbsd.org 2002/08/08 23:54:52
+     [auth.c]
+     typo in comment
+   - stevesk@cvs.openbsd.org 2002/08/09 17:21:42
+     [sshd_config.5]
+     use Op for mdoc conformance; from esr@golux.thyrsus.com
+     ok aaron@
+   - stevesk@cvs.openbsd.org 2002/08/09 17:41:12
+     [sshd_config.5]
+     proxy vs. fake display
+   - stevesk@cvs.openbsd.org 2002/08/12 17:30:35
+     [ssh.1 sshd.8 sshd_config.5]
+     more PermitUserEnvironment; ok markus@
+   - stevesk@cvs.openbsd.org 2002/08/17 23:07:14
+     [ssh.1]
+     ForwardAgent has defaulted to no for over 2 years; be more clear here.
+   - stevesk@cvs.openbsd.org 2002/08/17 23:55:01
+     [ssh_config.5]
+     ordered list here
+ - (bal) [defines.h] Some platforms don't have SIZE_T_MAX.  So assign 
+   it to ULONG_MAX.
+
+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
+     [hostfile.c hostfile.h sshconnect.c]
+     print out all known keys for a host if we get a unknown host key,
+     see discussion at http://marc.theaimsgroup.com/?t=101069210100016&r=1&w=4
+
+     the ssharp mitm tool attacks users in a similar way, so i'd like to
+     pointed out again:
+        A MITM attack is always possible if the ssh client prints:
+        The authenticity of host 'bla' can't be established.
+     (protocol version 2 with pubkey authentication allows you to detect
+     MITM attacks)
+   - mouring@cvs.openbsd.org 2002/07/25 01:16:59
+     [sftp.c]
+     FallBackToRsh does not exist anywhere else.  Remove it from here.
+     OK deraadt.
+   - markus@cvs.openbsd.org 2002/07/29 18:57:30
+     [sshconnect.c]
+     print file:line
+   - markus@cvs.openbsd.org 2002/07/30 17:03:55
+     [auth-options.c servconf.c servconf.h session.c sshd_config sshd_config.5]
+     add PermitUserEnvironment (off by default!); from dot@dotat.at;
+     ok provos, deraadt
+
+20020730
+ - (bal) [uidswap.c] SCO compile correction by gert@greenie.muc.de
+
+20020728
+ - (stevesk) [auth-pam.c] should use PAM_MSG_MEMBER(); from solar
+ - (stevesk) [CREDITS] solar
+ - (stevesk) [ssh-rand-helper.c] RAND_bytes() and SHA1_Final() unsigned
+   char arg.
+
+20020725
+ - (djm) Remove some cruft from INSTALL
+ - (djm) Latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config/
+
+20020723
+ - (bal) [bsd-cray.c bsd-cray.h] Part 2 of Cray merger. 
+ - (bal) sync ID w/ ssh-agent.c
+ - (bal) OpenBSD Sync
+   - markus@cvs.openbsd.org 2002/07/19 15:43:33
+     [log.c log.h session.c sshd.c]
+     remove fatal cleanups after fork; based on discussions with and code
+     from solar.
+   - stevesk@cvs.openbsd.org 2002/07/19 17:42:40
+     [ssh.c]
+     display a warning from ssh when XAuthLocation does not exist or xauth
+     returned no authentication data. ok markus@
+   - stevesk@cvs.openbsd.org 2002/07/21 18:32:20
+     [auth-options.c]
+     unneeded includes
+   - stevesk@cvs.openbsd.org 2002/07/21 18:34:43
+     [auth-options.h]
+     remove invalid comment
+   - markus@cvs.openbsd.org 2002/07/22 11:03:06
+     [session.c]
+     fallback to _PATH_STDPATH on setusercontext+LOGIN_SETPATH errors;
+   - stevesk@cvs.openbsd.org 2002/07/22 17:32:56
+     [monitor.c]
+     u_int here; ok provos@
+   - stevesk@cvs.openbsd.org 2002/07/23 16:03:10
+     [sshd.c]
+     utmp_len is unsigned; display error consistent with other options.
+     ok markus@
+   - stevesk@cvs.openbsd.org 2002/07/15 17:15:31
+     [uidswap.c]
+     little more debugging; ok markus@
+
+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.
+ - (bal) [configure.ac]  Missing ;; from cray patch.
+ - (bal) [monitor_mm.c openbsd-compat/xmmap.h] Move xmmap() defines
+   into it's own header.
+ - (stevesk) [auth-pam.[ch] session.c] pam_getenvlist() must be
+   freed by the caller; add free_pam_environment() and use it.
+ - (stevesk) [auth-pam.c] typo in comment
+
+20020721
+ - (stevesk) [auth-pam.c] merge cosmetic changes from solar's
+   openssh-3.4p1-owl-password-changing.diff
+ - (stevesk) [auth-pam.c] merge rest of solar's PAM patch;
+   PAM_NEW_AUTHTOK_REQD remains in #if 0 for now.
+ - (stevesk) [auth-pam.c] cast to avoid initialization type mismatch
+   warning on pam_conv struct conversation function.
+ - (stevesk) [auth-pam.h] license
+ - (stevesk) [auth-pam.h] unneeded include
+ - (stevesk) [auth-pam.[ch] ssh.h] move SSHD_PAM_SERVICE to auth-pam.h
+
+20020720
+ - (stevesk) [ssh-keygen.c] bug #231: always init/seed_rng().
+
+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
+ - (tim) [monitor_mm.c] add missing declaration for xmmap(). Reported
+   by ayamura@ayamura.org
+ - (tim) [configure.ac] Bug 267 rework int64_t test.
+ - (tim) [includes.h] Bug 267 add stdint.h
+
+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
+
+20020715
+ - (bal) OpenBSD CVS Sync
+   - itojun@cvs.openbsd.org 2002/07/12 13:29:09
+     [sshconnect.c]
+     print connect failure during debugging mode.
+   - markus@cvs.openbsd.org 2002/07/12 15:50:17
+     [cipher.c]
+     EVP_CIPH_CUSTOM_IV for our own rijndael
+ - (bal) Remove unused tty defined in do_setusercontext() pointed out by
+   dtucker@zip.com.au plus a a more KNF since I am near it.
+ - (bal) Privsep user creation support in Solaris buildpkg.sh by 
+   dtucker@zip.com.au
+
+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
+ - (tim) [ssh_prng_cmds.in] Bug 323 arp -n flag doesn't exist under Solaris.
+   report by chris@by-design.net
+ - (tim) [loginrec.c] Bug 347: Fix typo (WTMPX_FILE) report by rodney@bond.net
+ - (tim) [loginrec.c] Bug 348: add missing found = 1; to wtmpx_islogin()
+   report by rodney@bond.net
+
+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
+   on /var/empty to 755 Patch by vinschen@redhat.com
+ - (bal) OpenBSD CVS Sync
+   - itojun@cvs.openbsd.org 2002/07/09 11:56:50
+     [sshconnect.c]
+     silently try next address on connect(2).  markus ok
+   - itojun@cvs.openbsd.org 2002/07/09 11:56:27
+     [canohost.c]
+     suppress log on reverse lookup failiure, as there's no real value in
+     doing so.
+     markus ok
+   - itojun@cvs.openbsd.org 2002/07/09 12:04:02
+     [sshconnect.c]
+     ed static function (less warnings)
+   - stevesk@cvs.openbsd.org 2002/07/09 17:46:25
+     [sshd_config.5]
+     clarify no preference ordering in protocol list; ok markus@
+   - itojun@cvs.openbsd.org 2002/07/10 10:28:15
+     [sshconnect.c]
+     bark if all connection attempt fails.
+   - deraadt@cvs.openbsd.org 2002/07/10 17:53:54
+     [rijndael.c]
+     use right sizeof in memcpy; markus ok
+
+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
+ - (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)
+ - (tim) [acconfig.h configure.ac sshd.c]
+   s/BROKEN_FD_PASSING/DISABLE_FD_PASSING/
+ - (tim) [contrib/cygwin/ssh-host-config] sshd account creation fixes
+   patch from vinschen@redhat.com
+ - (bal) [realpath.c] Updated with OpenBSD tree.
+ - (bal) OpenBSD CVS Sync
+   - deraadt@cvs.openbsd.org 2002/07/04 04:15:33
+     [key.c monitor_wrap.c sftp-glob.c ssh-dss.c ssh-rsa.c]
+     patch memory leaks; grendel@zeitbombe.org
+   - deraadt@cvs.openbsd.org 2002/07/04 08:12:15
+     [channels.c packet.c]
+     blah blah minor nothing as i read and re-read and re-read...
+   - markus@cvs.openbsd.org 2002/07/04 10:41:47
+     [key.c monitor_wrap.c ssh-dss.c ssh-rsa.c]
+     don't allocate, copy, and discard if there is not interested in the data; 
+     ok deraadt@
+   - deraadt@cvs.openbsd.org 2002/07/06 01:00:49
+     [log.c]
+     KNF
+   - deraadt@cvs.openbsd.org 2002/07/06 01:01:26
+     [ssh-keyscan.c]
+     KNF, realloc fix, and clean usage
+   - stevesk@cvs.openbsd.org 2002/07/06 17:47:58
+     [ssh-keyscan.c]
+     unused variable
+ - (bal) Minor KNF on ssh-keyscan.c
+
+20020705
+ - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs.
+   Reported by Darren Tucker <dtucker@zip.com.au>
+ - (tim) [contrib/cygwin/ssh-host-config] double slash corrction
+   from vinschen@redhat.com
+
+20020704
+ - (bal) Limit data to TTY for AIX only (Newer versions can't handle the
+   faster data rate)  Bug #124
+ - (bal) glob.c defines TILDE and AIX also defines it.  #undef it first.
+   bug #265
+ - (bal) One too many nulls in ports-aix.c
+20020703
+ - (bal) Updated contrib/cygwin/  patch by vinschen@redhat.com 
+ - (bal) minor correction to utimes() replacement.  Patch by
+   onoe@sm.sony.co.jp
+ - OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2002/06/27 08:49:44
+     [dh.c ssh-keyscan.c sshconnect.c]
+     more checks for NULL pointers; from grendel@zeitbombe.org; ok deraadt@
+   - deraadt@cvs.openbsd.org 2002/06/27 09:08:00
+     [monitor.c]
+     improve mm_zalloc check; markus ok
+   - deraadt@cvs.openbsd.org 2002/06/27 10:35:47
+     [auth2-none.c monitor.c sftp-client.c]
+     use xfree()
+   - stevesk@cvs.openbsd.org 2002/06/27 19:49:08
+     [ssh-keyscan.c]
+     use convtime(); ok markus@
+   - millert@cvs.openbsd.org 2002/06/28 01:49:31
+     [monitor_mm.c]
+     tree(3) wants an int return value for its compare functions and
+     the difference between two pointers is not an int.  Just do the
+     safest thing and store the result in a long and then return 0,
+     -1, or 1 based on that result.
+   - deraadt@cvs.openbsd.org 2002/06/28 01:50:37
+     [monitor_wrap.c]
+     use ssize_t
+   - deraadt@cvs.openbsd.org 2002/06/28 10:08:25
+     [sshd.c]
+     range check -u option at invocation
+   - deraadt@cvs.openbsd.org 2002/06/28 23:05:06
+     [sshd.c]
+     gidset[2] -> gidset[1]; markus ok
+   - deraadt@cvs.openbsd.org 2002/06/30 21:54:16
+     [auth2.c session.c sshd.c]
+     lint asks that we use names that do not overlap
+   - deraadt@cvs.openbsd.org 2002/06/30 21:59:45
+     [auth-bsdauth.c auth-skey.c auth2-chall.c clientloop.c key.c
+      monitor_wrap.c monitor_wrap.h scard.h session.h sftp-glob.c ssh.c
+      sshconnect2.c sshd.c]
+     minor KNF
+   - deraadt@cvs.openbsd.org 2002/07/01 16:15:25
+     [msg.c]
+     %u
+   - markus@cvs.openbsd.org 2002/07/01 19:48:46
+     [sshconnect2.c]
+     for compression=yes, we fallback to no-compression if the server does
+     not support compression, vice versa for compression=no. ok mouring@
+   - markus@cvs.openbsd.org 2002/07/03 09:55:38
+     [ssh-keysign.c]
+     use RSA_blinding_on() for rsa hostkeys (suggested by Bill Sommerfeld)
+     in order to avoid a possible Kocher timing attack pointed out by Charles
+     Hannum; ok provos@
+   - markus@cvs.openbsd.org 2002/07/03 14:21:05
+     [ssh-keysign.8 ssh-keysign.c ssh.c ssh_config]
+     re-enable ssh-keysign's sbit, but make ssh-keysign read 
+     /etc/ssh/ssh_config and exit if HostbasedAuthentication is disabled 
+     globally. based on discussions with deraadt, itojun and sommerfeld; 
+     ok itojun@
+ - (bal) Failed password attempts don't increment counter on AIX. Bug #145
+ - (bal) Missed Makefile.in change.  keysign needs readconf.o
+ - (bal) Clean up aix_usrinfo().  Ignore TTY= period I guess.
+  
+20020702
+ - (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc & 
+   friends consistently. Spotted by Solar Designer <solar@openwall.com>
+
+20020629
+ - (bal) fix to auth2-pam.c to swap fatal() arguments,  A bit of style
+   clean up while I'm near it.
+
+20020628
+ - (stevesk) [sshd_config] PAMAuthenticationViaKbdInt no; commented
+   options should contain default value.  from solar.
+ - (bal) Cygwin uid0 fix by vinschen@redhat.com
+ - (bal) s/config.h/includes.h/ in openbsd-compat/ for *.c.  Otherwise wise
+   have issues of our fixes not propogating right (ie bcopy instead of
+   memmove).  OK tim
+ - (bal) FreeBSD needs <sys/types.h> to detect if mmap() is supported.
+   Bug #303
+
+20020627
+ - OpenBSD CVS Sync
+   - deraadt@cvs.openbsd.org 2002/06/26 14:49:36
+     [monitor.c]
+     correct %u
+   - deraadt@cvs.openbsd.org 2002/06/26 14:50:04
+     [monitor_fdpass.c]
+     use ssize_t for recvmsg() and sendmsg() return
+   - markus@cvs.openbsd.org 2002/06/26 14:51:33
+     [ssh-add.c]
+     fix exit code for -X/-x
+   - deraadt@cvs.openbsd.org 2002/06/26 15:00:32
+     [monitor_wrap.c]
+     more %u
+   - markus@cvs.openbsd.org 2002/06/26 22:27:32
+     [ssh-keysign.c]
+     bug #304, xfree(data) called to early; openssh@sigint.cs.purdue.edu
+
 20020626
  - (stevesk) [monitor.c] remove duplicate proto15 dispatch entry for PAM
  - (bal) OpenBSD CVS Sync
  - (djm) Update spec files for release 
  - (djm) Fix int overflow in auth2-pam.c, similar to one discovered by ISS
  - (djm) Release 3.4p1
+ - (tim) [contrib/caldera/openssh.spec] remove 2 configure options I put in
+   by mistake
 
 20020625
  - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-20020622
- - (djm) Update README.privsep; spotted by fries@
- - (djm) Release 3.3p1
- - (bal) getopt now can be staticly compiled on those platforms missing
-   optreset.  Patch by binder@arago.de
-
-20020621
- - (djm) Sync:
-   - djm@cvs.openbsd.org 2002/06/21 05:50:51
-     [monitor.c]
-     Don't initialise compression buffers when compression=no in sshd_config;
-     ok Niels@
-  - ID sync for auth-passwd.c
- - (djm) Warn and disable compression on platforms which can't handle both
-   useprivilegeseparation=yes and compression=yes
- - (djm) contrib/redhat/openssh.spec hacking:
-   - Merge in spec changes from seba@iq.pl (Sebastian Pachuta)
-   - Add new {ssh,sshd}_config.5 manpages
-   - Add new ssh-keysign program and remove setuid from ssh client
-
-20020620
- - (bal) Fixed AIX environment handling, use setpcred() instead of existing
-   code.  (Bugzilla Bug 261)
- - (bal) OpenBSD CVS Sync
-   - todd@cvs.openbsd.org 2002/06/14 21:35:00
-     [monitor_wrap.c]
-     spelling; from Brian Poole <raj@cerias.purdue.edu>
-   - markus@cvs.openbsd.org 2002/06/15 00:01:36
-     [authfd.c authfd.h ssh-add.c ssh-agent.c]
-     break agent key lifetime protocol and allow other contraints for key
-     usage.
-   - markus@cvs.openbsd.org 2002/06/15 00:07:38
-     [authfd.c authfd.h ssh-add.c ssh-agent.c]
-     fix stupid typo
-   - markus@cvs.openbsd.org 2002/06/15 01:27:48
-     [authfd.c authfd.h ssh-add.c ssh-agent.c]
-     remove the CONSTRAIN_IDENTITY messages and introduce a new
-     ADD_ID message with contraints instead. contraints can be
-     only added together with the private key.
-   - itojun@cvs.openbsd.org 2002/06/16 21:30:58
-     [ssh-keyscan.c]
-     use TAILQ_xx macro.  from lukem@netbsd.  markus ok
-   - deraadt@cvs.openbsd.org 2002/06/17 06:05:56
-     [scp.c]
-     make usage like man page
-   - deraadt@cvs.openbsd.org 2002/06/19 00:27:55
-     [auth-bsdauth.c auth-skey.c auth1.c auth2-chall.c auth2-none.c authfd.c
-      authfd.h monitor_wrap.c msg.c nchan.c radix.c readconf.c scp.c sftp.1
-      ssh-add.1 ssh-add.c ssh-agent.1 ssh-agent.c ssh-keygen.1 ssh-keygen.c
-      ssh-keysign.c ssh.1 sshconnect.c sshconnect.h sshconnect2.c ttymodes.c
-      xmalloc.h]
-     KNF done automatically while reading....
-   - markus@cvs.openbsd.org 2002/06/19 18:01:00
-     [cipher.c monitor.c monitor_wrap.c packet.c packet.h]
-     make the monitor sync the transfer ssh1 session key;
-     transfer keycontext only for RC4 (this is still depends on EVP
-     implementation details and is broken).
-   - stevesk@cvs.openbsd.org 2002/06/20 19:56:07
-     [ssh.1 sshd.8]
-     move configuration file options from ssh.1/sshd.8 to
-     ssh_config.5/sshd_config.5; ok deraadt@ millert@
-   - stevesk@cvs.openbsd.org 2002/06/20 20:00:05
-     [scp.1 sftp.1]
-     ssh_config(5)
-   - stevesk@cvs.openbsd.org 2002/06/20 20:03:34
-     [ssh_config sshd_config]
-     refer to config file man page
-   - markus@cvs.openbsd.org 2002/06/20 23:05:56
-     [servconf.c servconf.h session.c sshd.c]
-     allow Compression=yes/no in sshd_config
-   - markus@cvs.openbsd.org 2002/06/20 23:37:12
-     [sshd_config]
-     add Compression
-   - stevesk@cvs.openbsd.org 2002/05/25 20:40:08
-     [LICENCE]
-     missed Per Allansson (auth2-chall.c)
- - (bal) Cygwin special handling of empty passwords wrong.  Patch by
-   vinschen@redhat.com
- - (bal) Missed integrating ssh_config.5 and sshd_config.5
- - (bal) Still more Makefile.in updates for ssh{d}_config.5
-
-20020613
- - (bal) typo of setgroup for cygwin.  Patch by vinschen@redhat.com
-
-20020612
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/06/11 23:03:54
-     [ssh.c]
-     remove unused cruft.
-   - markus@cvs.openbsd.org 2002/06/12 01:09:52
-     [ssh.c]
-     ssh_connect returns 0 on success
- - (bal) Build noop setgroups() for cygwin to clean up code (For other
-   platforms without the setgroups() requirement, you MUST define
-   SETGROUPS_NOOP in the configure.ac) Based on patch by vinschen@redhat.com
- - (bal) Some platforms don't have ONLCR (Notable Mint)
-
-20020611
- - (bal) ssh-agent.c RCSD fix (|unexpand already done)
- - (bal) OpenBSD CVS Sync
-   - stevesk@cvs.openbsd.org 2002/06/09 22:15:15
-     [ssh.1]
-     update for no setuid root and ssh-keysign; ok deraadt@
-   - itojun@cvs.openbsd.org 2002/06/09 22:17:21
-     [sshconnect.c]
-     pass salen to sockaddr_ntop so that we are happy on linux/solaris
-   - stevesk@cvs.openbsd.org 2002/06/10 16:53:06
-     [auth-rsa.c ssh-rsa.c]
-     display minimum RSA modulus in error(); ok markus@
-   - stevesk@cvs.openbsd.org 2002/06/10 16:56:30
-     [ssh-keysign.8]
-     merge in stuff from my man page; ok markus@
-   - stevesk@cvs.openbsd.org 2002/06/10 17:36:23
-     [ssh-add.1 ssh-add.c]
-     use convtime() to parse and validate key lifetime.  can now
-     use '-t 2h' etc.  ok markus@ provos@
-   - stevesk@cvs.openbsd.org 2002/06/10 17:45:20
-     [readconf.c ssh.1]
-     change RhostsRSAAuthentication and RhostsAuthentication default to no
-     since ssh is no longer setuid root by default; ok markus@
-   - stevesk@cvs.openbsd.org 2002/06/10 21:21:10
-     [ssh_config]
-     update defaults for RhostsRSAAuthentication and RhostsAuthentication
-     here too (all options commented out with default value).
-   - markus@cvs.openbsd.org 2002/06/10 22:28:41
-     [channels.c channels.h session.c]
-     move creation of agent socket to session.c; no need for uidswapping
-     in channel.c.
-   - markus@cvs.openbsd.org 2002/06/11 04:14:26
-     [ssh.c sshconnect.c sshconnect.h]
-     no longer use uidswap.[ch] from the ssh client
-     run less code with euid==0 if ssh is installed setuid root
-     just switch the euid, don't switch the complete set of groups
-     (this is only needed by sshd). ok provos@
-   - mpech@cvs.openbsd.org 2002/06/11 05:46:20
-     [auth-krb4.c monitor.h serverloop.c session.c ssh-agent.c sshd.c]
-     pid_t cleanup. Markus need this now to keep hacking.
-     markus@, millert@ ok
-   - itojun@cvs.openbsd.org 2002/06/11 08:11:45
-     [canohost.c]
-     use "ntop" only after initialized
- - (bal) Cygwin fix up from swap uid clean up in ssh.c patch by
-   vinschen@redhat.com
-
-20020609
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/06/08 05:07:56
-     [ssh.c]
-     nuke ptrace comment
-   - markus@cvs.openbsd.org 2002/06/08 05:07:09
-     [ssh-keysign.c]
-     only accept 20 byte session ids
-   - markus@cvs.openbsd.org 2002/06/08 05:17:01
-     [readconf.c readconf.h ssh.1 ssh.c]
-     deprecate FallBackToRsh and UseRsh; patch from djm@
-   - markus@cvs.openbsd.org 2002/06/08 05:40:01
-     [readconf.c]
-     just warn about Deprecated options for now
-   - markus@cvs.openbsd.org 2002/06/08 05:41:18
-     [ssh_config]
-     remove FallBackToRsh/UseRsh
-   - markus@cvs.openbsd.org 2002/06/08 12:36:53
-     [scp.c]
-     remove FallBackToRsh
-   - markus@cvs.openbsd.org 2002/06/08 12:46:14
-     [readconf.c]
-     silently ignore deprecated options, since FallBackToRsh might be passed
-     by remote scp commands.
-  - itojun@cvs.openbsd.org 2002/06/08 21:15:27
-     [sshconnect.c]
-     always use getnameinfo.  (diag message only)
-   - markus@cvs.openbsd.org 2002/06/09 04:33:27
-     [sshconnect.c]
-     abort() - > fatal()
- - (bal) RCSID tag updates on channels.c, clientloop.c, nchan.c,
-   sftp-client.c, ssh-agenet.c, ssh-keygen.c and connect.h (we did unexpand
-   independant of them)
-
-20020607
- - (bal) Removed --{enable/disable}-suid-ssh
- - (bal) Missed __progname in ssh-keysign.c  patch by dtucker@zip.com.au
- - (bal) use 'LOGIN_PROGRAM'  not '/usr/bin/login' in session.c patch by
-   Bertrand.Velle@apogee-com.fr
-
-20020606
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/05/15 21:56:38
-     [servconf.c sshd.8 sshd_config]
-     re-enable privsep and disable setuid for post-3.2.2
-   - markus@cvs.openbsd.org 2002/05/16 22:02:50
-     [cipher.c kex.h mac.c]
-     fix warnings (openssl 0.9.7 requires const)
-   - stevesk@cvs.openbsd.org 2002/05/16 22:09:59
-     [session.c ssh.c]
-     don't limit xauth pathlen on client side and longer print length on
-     server when debug; ok markus@
-   - deraadt@cvs.openbsd.org 2002/05/19 20:54:52
-     [log.h]
-     extra commas in enum not 100% portable
-   - deraadt@cvs.openbsd.org 2002/05/22 23:18:25
-     [ssh.c sshd.c]
-     spelling; abishoff@arc.nasa.gov
-   - markus@cvs.openbsd.org 2002/05/23 19:24:30
-     [authfile.c authfile.h pathnames.h ssh.c sshconnect.c sshconnect.h 
-      sshconnect1.c sshconnect2.c ssh-keysign.8 ssh-keysign.c Makefile.in]
-     add /usr/libexec/ssh-keysign: a setuid helper program for hostbased 
-     authentication in protocol v2 (needs to access the hostkeys).
-   - markus@cvs.openbsd.org 2002/05/23 19:39:34
-     [ssh.c]
-     add comment about ssh-keysign
-   - markus@cvs.openbsd.org 2002/05/24 08:45:14
-     [sshconnect2.c]
-     stat ssh-keysign first, print error if stat fails;
-     some debug->error; fix comment
-   - markus@cvs.openbsd.org 2002/05/25 08:50:39
-     [sshconnect2.c]
-     execlp->execl; from stevesk
-   - markus@cvs.openbsd.org 2002/05/25 18:51:07
-     [auth.h auth2.c auth2-hostbased.c auth2-kbdint.c auth2-none.c
-      auth2-passwd.c auth2-pubkey.c Makefile.in]
-     split auth2.c into one file per method; ok provos@/deraadt@
-   - stevesk@cvs.openbsd.org 2002/05/26 20:35:10
-     [ssh.1]
-     sort ChallengeResponseAuthentication; ok markus@
-   - stevesk@cvs.openbsd.org 2002/05/28 16:45:27
-     [monitor_mm.c]
-     print strerror(errno) on mmap/munmap error; ok markus@
-   - stevesk@cvs.openbsd.org 2002/05/28 17:28:02
-     [uidswap.c]
-     format spec change/casts and some KNF; ok markus@
-   - stevesk@cvs.openbsd.org 2002/05/28 21:24:00
-     [uidswap.c]
-     use correct function name in fatal()
-   - stevesk@cvs.openbsd.org 2002/05/29 03:06:30
-     [ssh.1 sshd.8]
-     spelling
-   - markus@cvs.openbsd.org 2002/05/29 11:21:57
-     [sshd.c]
-     don't start if privsep is enabled and SSH_PRIVSEP_USER or
-     _PATH_PRIVSEP_CHROOT_DIR are missing; ok deraadt@
-   - markus@cvs.openbsd.org 2002/05/30 08:07:31
-     [cipher.c]
-     use rijndael/aes from libcrypto (openssl >= 0.9.7) instead of
-     our own implementation. allow use of AES hardware via libcrypto, 
-     ok deraadt@
-   - markus@cvs.openbsd.org 2002/05/31 10:30:33
-     [sshconnect2.c]
-     extent ssh-keysign protocol:
-     pass # of socket-fd to ssh-keysign, keysign verfies locally used
-     ip-address using this socket-fd, restricts fake local hostnames
-     to actual local hostnames; ok stevesk@
-   - markus@cvs.openbsd.org 2002/05/31 11:35:15
-     [auth.h auth2.c]
-     move Authmethod definitons to per-method file.
-   - markus@cvs.openbsd.org 2002/05/31 13:16:48
-     [key.c]
-     add comment:
-     key_verify returns 1 for a correct signature, 0 for an incorrect signature
-     and -1 on error.
-   - markus@cvs.openbsd.org 2002/05/31 13:20:50
-     [ssh-rsa.c]
-     pad received signature with leading zeros, because RSA_verify expects
-     a signature of RSA_size. the drafts says the signature is transmitted
-     unpadded (e.g. putty does not pad), reported by anakin@pobox.com
-   - deraadt@cvs.openbsd.org 2002/06/03 12:04:07
-     [ssh.h]
-     compatiblity -> compatibility
-     decriptor -> descriptor
-     authentciated -> authenticated
-     transmition -> transmission
-   - markus@cvs.openbsd.org 2002/06/04 19:42:35
-     [monitor.c]
-     only allow enabled authentication methods; ok provos@
-   - markus@cvs.openbsd.org 2002/06/04 19:53:40
-     [monitor.c]
-     save the session id (hash) for ssh2 (it will be passed with the 
-     initial sign request) and verify that this value is used during 
-     authentication; ok provos@
-   - markus@cvs.openbsd.org 2002/06/04 23:02:06
-     [packet.c]
-     remove __FUNCTION__
-   - markus@cvs.openbsd.org 2002/06/04 23:05:49
-     [cipher.c monitor.c monitor_fdpass.c monitor_mm.c monitor_wrap.c]
-     __FUNCTION__ -> __func__
-   - markus@cvs.openbsd.org 2002/06/05 16:08:07
-     [ssh-agent.1 ssh-agent.c]
-     '-a bind_address' binds the agent to user-specified unix-domain
-     socket instead of /tmp/ssh-XXXXXXXX/agent.<pid>; ok djm@ (some time ago).
-   - markus@cvs.openbsd.org 2002/06/05 16:08:07
-     [ssh-agent.1 ssh-agent.c]
-     '-a bind_address' binds the agent to user-specified unix-domain
-     socket instead of /tmp/ssh-XXXXXXXX/agent.<pid>; ok djm@ (some time ago).
-   - markus@cvs.openbsd.org 2002/06/05 16:48:54
-     [ssh-agent.c]
-     copy current request into an extra buffer and just flush this
-     request on errors, ok provos@
-   - markus@cvs.openbsd.org 2002/06/05 19:57:12
-     [authfd.c authfd.h ssh-add.1 ssh-add.c ssh-agent.c]
-     ssh-add -x for lock and -X for unlocking the agent.
-     todo: encrypt private keys with locked...
-   - markus@cvs.openbsd.org 2002/06/05 20:56:39
-     [ssh-add.c]
-     add -x/-X to usage
-   - markus@cvs.openbsd.org 2002/06/05 21:55:44
-     [authfd.c authfd.h ssh-add.1 ssh-add.c ssh-agent.c]
-     ssh-add -t life,  Set lifetime (in seconds) when adding identities; 
-     ok provos@
-   - stevesk@cvs.openbsd.org 2002/06/06 01:09:41
-     [monitor.h]
-     no trailing comma in enum; china@thewrittenword.com
-   - markus@cvs.openbsd.org 2002/06/06 17:12:44
-     [sftp-server.c]
-     discard remaining bytes of current request; ok provos@
-   - markus@cvs.openbsd.org 2002/06/06 17:30:11
-     [sftp-server.c]
-     use get_int() macro (hide iqueue)
- - (bal) Missed msg.[ch] in merge.  Required for ssh-keysign.
- - (bal) Forgot to add msg.c Makefile.in.
- - (bal) monitor_mm.c typos.
- - (bal) Refixed auth2.c.  It was never fully commited while spliting out
-   authentication to different files.
- - (bal) ssh-keysign should build and install correctly now.  Phase two
-   would be to clean out any dead wood and disable ssh setuid on install.
- - (bal) Reverse logic, use __func__ first since it's C99
-
-20020604
- - (stevesk) [channels.c] bug #164 patch from YOSHIFUJI Hideaki (changed
-   setsockopt from debug to error for now).
-
-20020527
- - (tim) [configure.ac.orig monitor_fdpass.c] Enahnce msghdr tests to address
-   build problem on Irix reported by Dave Love <d.love@dl.ac.uk>. Back out
-   last monitor_fdpass.c changes that are no longer needed with new tests.
-   Patch tested on Irix by Jan-Frode Myklebust <janfrode@parallab.uib.no>
-
-20020522
- - (djm) Fix spelling mistakes, spotted by Solar Designer i
-   <solar@openwall.com>
- - Sync scard/ (not sure when it drifted)
- - (djm) OpenBSD CVS Sync:
-   [auth.c]
-   Fix typo/thinko.  Pass in as to auth_approval(), not NULL.
-   Closes PR 2659.
- - Crank version
- - Crank RPM spec versions
-
-20020521
- - (stevesk) [sshd.c] bug 245; disable setsid() for now
- - (stevesk) [sshd.c] #ifndef HAVE_CYGWIN for setgroups()
-
-20020517
- - (tim) [configure.ac] remove extra MD5_MSG="no" line.
-
-20020515
- - (bal) CVS ID fix up on auth-passwd.c
- - (bal) OpenBSD CVS Sync
-   - deraadt@cvs.openbsd.org 2002/05/07 19:54:36
-     [ssh.h]
-     use ssh uid
-   - deraadt@cvs.openbsd.org 2002/05/08 21:06:34
-     [ssh.h]
-     move to sshd.sshd instead
-   - stevesk@cvs.openbsd.org 2002/05/11 20:24:48
-     [ssh.h]
-     typo in comment
-   - itojun@cvs.openbsd.org 2002/05/13 02:37:39
-     [auth-skey.c auth2.c]
-     less warnings.  skey_{respond,query} are public (in auth.h)
-   - markus@cvs.openbsd.org 2002/05/13 20:44:58
-     [auth-options.c auth.c auth.h]
-     move the packet_send_debug handling from auth-options.c to auth.c; 
-     ok provos@
-   - millert@cvs.openbsd.org 2002/05/13 15:53:19
-     [sshd.c]
-     Call setsid() in the child after sshd accepts the connection and forks.
-     This is needed for privsep which calls setlogin() when it changes uids.
-     Without this, there is a race where the login name of an existing 
-     connection, as returned by getlogin(), may be changed to the privsep 
-     user (sshd).  markus@ OK
-   - markus@cvs.openbsd.org 2002/05/13 21:26:49
-     [auth-rhosts.c]
-     handle debug messages during rhosts-rsa and hostbased authentication; 
-     ok provos@
-   - mouring@cvs.openbsd.org 2002/05/15 15:47:49
-     [kex.c monitor.c monitor_wrap.c sshd.c]
-     'monitor' variable clashes with at least one lame platform (NeXT).  i
-     Renamed to 'pmonitor'.  provos@
-   - deraadt@cvs.openbsd.org 2002/05/04 02:39:35
-     [servconf.c sshd.8 sshd_config]
-     enable privsep by default; provos ok
-   - millert@cvs.openbsd.org 2002/05/06 23:34:33
-     [ssh.1 sshd.8]
-     Kill/adjust r(login|exec)d? references now that those are no longer in
-     the tree.
-   - markus@cvs.openbsd.org 2002/05/15 21:02:53
-     [servconf.c sshd.8 sshd_config]
-     disable privsep and enable setuid for the 3.2.2 release
- - (bal) Fixed up PAM case.  I think.
- - (bal) Clarified openbsd-compat/*-cray.* Licence provided by Wendy
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/05/15 21:05:29
-     [version.h]
-     enter OpenSSH_3.2.2
- - (bal) Caldara, Suse, and Redhat openssh.specs updated.
-
-20020514
- - (stevesk) [README.privsep] PAM+privsep works with Solaris 8.
- - (tim) [sshpty.c] set tty modes when allocating old style bsd ptys to
-   match what newer style ptys have when allocated. Based on a patch by
-   Roger Cornelius <rac@tenzing.org>
- - (tim) [README.privsep] UnixWare 7 and OpenUNIX 8 work.
- - (tim) [README.privsep] remove reference to UnixWare 7 and OpenUNIX 8
-   from PAM-enabled pragraph. UnixWare has no PAM.
- - (tim) [contrib/caldera/openssh.spec] update version.
-
-20020513
- - (stevesk) add initial README.privsep
- - (stevesk) [configure.ac] nicer message: --with-privsep-user=user
- - (djm) Add --with-superuser-path=xxx configure option to specify 
-   what $PATH the superuser receives.
- - (djm) Bug #231: UsePrivilegeSeparation turns off Banner.
- - (djm) Add --with-privsep-path configure option
- - (djm) Update RPM spec file: different superuser path, use
-   /var/empty/sshd for privsep
- - (djm) Bug #234: missing readpassphrase declaration and defines
- - (djm) Add INSTALL warning about SSH protocol 1 blowfish w/ 
-    OpenSSL < 0.9.6
-
-20020511
- - (tim) [configure.ac] applied a rework of djm's OpenSSL search cleanup patch.
-   Now only searches system and /usr/local/ssl (OpenSSL's default install path)
-   Others must use --with-ssl-dir=....
- - (tim) [monitor_fdpass.c] fix for systems that have both
-   HAVE_ACCRIGHTS_IN_MSGHDR and HAVE_CONTROL_IN_MSGHDR. Ie. sys/socket.h 
-   has #define msg_accrights msg_control
-
-20020510
- - (stevesk) [auth.c] Shadow account and expiration cleanup.  Now
-   check for root forced expire.  Still don't check for inactive.
- - (djm) Rework RedHat RPM files. Based on spec from Nalin 
-   Dahyabhai <nalin@redhat.com> and patches from 
-   Pekka Savola <pekkas@netcore.fi>
- - (djm) Try to drop supplemental groups at daemon startup. Patch from 
-   RedHat
- - (bal) Back all the way out of auth-passwd.c changes.  Breaks too many
-   things that don't set pw->pw_passwd.
-
-20020509
- - (tim) [Makefile.in] Unbreak make -f Makefile.in distprep
-
-20020508
- - (tim) [openbsd-compat/bsd-arc4random.c] fix logic on when seed_rng() is
-   called. Report by Chris Maxwell <maxwell@cs.dal.ca>
- - (tim) [Makefile.in configure.ac] set SHELL variable in Makefile
- - (djm) Disable PAM kbd-int auth if privsep is turned on (it doesn't work)
-
-20020507
- - (tim) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
-   Add truncate() emulation to address Bug 208
-
-20020506
- - (djm) Unbreak auth-passwd.c for PAM and SIA
- - (djm) Unbreak PAM auth for protocol 1. Report from Pekka Savola 
-   <pekkas@netcore.fi>
- - (djm) Don't reinitialise PAM credentials before we have started PAM.
-   Report from Pekka Savola <pekkas@netcore.fi>
-   
-20020506
- - (bal) Fixed auth-passwd.c to resolve PermitEmptyPassword issue
-20020501
- - (djm) Import OpenBSD regression tests. Requires BSD make to run
- - (djm) Fix readpassphase compilation for systems which have it
-
-20020429
- - (tim) [contrib/caldera/openssh.spec] update fixUP to reflect changes in
-   sshd_config.
- - (tim) [contrib/cygwin/README] remove reference to regex.
-   patch from Corinna Vinschen <vinschen@redhat.com>
-
-20020426
- - (djm) Bug #137, #209: fix make problems for scard/Ssh.bin, do uudecode
-   during distprep only
- - (djm) Disable PAM password expiry until a complete fix for bug #188 
-   exists
- - (djm) Bug #180: Set ToS bits on IPv4-in-IPv6 mapped addresses. Based on 
-   patch from openssh@misc.tecq.org
-
-20020425
- - (stevesk) [defines.h] remove USE_TIMEVAL; unused
- - (stevesk) [acconfig.h auth-passwd.c configure.ac sshd.c] HP-UX 10.26
-   support.  bug #184.  most from dcole@keysoftsys.com.
-
-20020424
- - (djm) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/04/23 12:54:10
-     [version.h]
-     3.2.1
-   - djm@cvs.openbsd.org 2002/04/23 22:16:29
-     [sshd.c]
-     Improve error message; ok markus@ stevesk@
-
-20020423
- - (stevesk) [acconfig.h configure.ac session.c] LOGIN_NO_ENDOPT for HP-UX
- - (stevesk) [acconfig.h] NEED_IN_SYSTM_H unused
- - (markus) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/04/23 12:58:26
-     [radix.c]
-     send complete ticket; semerad@ss1000.ms.mff.cuni.cz
- - (djm) Trim ChangeLog to include only post-3.1 changes
- - (djm) Update RPM spec file versions
- - (djm) Redhat spec enables KrbV by default
- - (djm) Applied OpenSC smartcard updates from Markus & 
-   Antti Tapaninen <aet@cc.hut.fi>
- - (djm) Define BROKEN_REALPATH for AIX, patch from 
-   Antti Tapaninen <aet@cc.hut.fi>
- - (djm) Bug #214: Fix utmp for Irix (don't strip "tty"). Patch from 
-   Kevin Taylor <no@nowhere.org> (??) via Philipp Grau
-   <phgrau@zedat.fu-berlin.de>
- - (djm) Bug #213: Simplify CMSG_ALIGN macros to avoid symbol clashes. 
-   Reported by Doug Manton <dmanton@emea.att.com>
- - (djm) Bug #222: Fix tests for getaddrinfo on OSF/1. Spotted by
-   Robert Urban <urban@spielwiese.de>
- - (djm) Bug #206 - blibpath isn't always needed for AIX ld, avoid 
-   sizeof(long long int) == 4 breakage. Patch from Matthew Clarke
-   <Matthew_Clarke@mindlink.bc.ca>
- - (djm) Make privsep work with PAM (still experimental)
- - (djm) OpenBSD CVS Sync
-   - deraadt@cvs.openbsd.org 2002/04/20 09:02:03
-     [servconf.c]
-     No, afs requires explicit enabling
-   - markus@cvs.openbsd.org 2002/04/20 09:14:58
-     [bufaux.c bufaux.h]
-     add buffer_{get,put}_short
-   - markus@cvs.openbsd.org 2002/04/20 09:17:19
-     [radix.c]
-     rewrite using the buffer_* API, fixes overflow; ok deraadt@
-   - stevesk@cvs.openbsd.org 2002/04/21 16:19:27
-     [sshd.8 sshd_config]
-     document default AFSTokenPassing no; ok deraadt@
-   - stevesk@cvs.openbsd.org 2002/04/21 16:25:06
-     [sshconnect1.c]
-     spelling in error message; ok markus@
-   - markus@cvs.openbsd.org 2002/04/22 06:15:47
-     [radix.c]
-     fix check for overflow
-   - markus@cvs.openbsd.org 2002/04/22 16:16:53
-     [servconf.c sshd.8 sshd_config]
-     do not auto-enable KerberosAuthentication; ok djm@, provos@, deraadt@
-   - markus@cvs.openbsd.org 2002/04/22 21:04:52
-     [channels.c clientloop.c clientloop.h ssh.c]
-     request reply (success/failure) for -R style fwd in protocol v2,
-     depends on ordered replies.
-     fixes http://bugzilla.mindrot.org/show_bug.cgi?id=215; ok provos@
-
-20020421
- - (tim) [entropy.c.] Portability fix for SCO Unix 3.2v4.x (SCO OSR 3.0).
-   entropy.c needs seteuid(getuid()) for the setuid(original_uid) to 
-   succeed. Patch by gert@greenie.muc.de. This fixes one part of Bug 208
-
-20020418
- - (djm) Avoid SIGCHLD breakage when run from rsync. Fix from 
-   Sturle Sunde <sturle.sunde@usit.uio.no>
-
-20020417
- - (djm) Tell users to configure /dev/random support into OpenSSL in 
-   INSTALL
- - (djm) Fix .Nm in mdoc2man.pl from pspencer@fields.utoronto.ca
- - (tim) [configure.ac] Issue warning on --with-default-path=/some_path
-   if LOGIN_CAP is enabled. Report & testing by Tuc <tuc@ttsg.com>
-
-20020415
- - (djm) Unbreak "make install". Fix from Darren Tucker 
-   <dtucker@zip.com.au>
- - (stevesk) bsd-cygwin_util.[ch] BSD license from Corinna Vinschen
- - (tim) [configure.ac] add tests for recvmsg and sendmsg.
-   [monitor_fdpass.c] add checks for HAVE_SENDMSG and HAVE_RECVMSG for
-   systems that HAVE_ACCRIGHTS_IN_MSGHDR but no recvmsg or sendmsg.
-
-20020414
- - (djm) ssh-rand-helper improvements
-   - Add commandline debugging options
-   - Don't write binary data if stdout is a tty (use hex instead)
-   - Give it a manpage
- - (djm) Random number collection doc fixes from Ben
-
-20020413
- - (djm) Add KrbV support patch from Simon Wilkinson <simon@sxw.org.uk>
-
-20020412
- - (stevesk) [auth-sia.[ch]] add BSD license from Chris Adams
- - (tim) [configure.ac] add <sys/types.h> to msghdr tests. Change -L
-   to -h on testing for /bin being symbolic link
- - (bal) Mistaken in Cygwin scripts for ssh starting.  Patch by
-   Corinna Vinschen <vinschen@redhat.com> 
- - (bal) disable privsep if no MAP_ANON.  We can re-enable it
-   after the release when we can do more testing.
-
-20020411
- - (stevesk) [auth-sia.c] cleanup
- - (tim) [acconfig.h defines.h includes.h] put includes in includes.h and
-   defines in defines.h [rijndael.c openbsd-compat/fake-socket.h
-   openbsd-compat/inet_aton.c] include "includes.h" instead of "config.h"
-   ok stevesk@
-
-20020410
- - (stevesk) [configure.ac monitor.c] HAVE_SOCKETPAIR
- - (stevesk) [auth-sia.c] compile fix Chris Adams <cmadams@hiwaay.net>
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/04/10 08:21:47
-     [auth1.c compat.c compat.h]
-     strip '@' from username only for KerbV and known broken clients, 
-     bug #204
-   - markus@cvs.openbsd.org 2002/04/10 08:56:01
-     [version.h]
-     OpenSSH_3.2
- - Added p1 to idenify Portable release version.
-
-20020408
- - (bal) Minor OpenSC updates.  Fix up header locations and update
-   README.smartcard provided by Juha Yrjölä <jyrjola@cc.hut.fi>
-
-20020407
- - (stevesk) HAVE_CONTROL_IN_MSGHDR; not used right now.
-   Future: we may want to test if fd passing works correctly.
- - (stevesk) [monitor_fdpass.c] fatal() for UsePrivilegeSeparation=yes
-   and no fd passing support.
- - (stevesk) HAVE_MMAP and HAVE_SYS_MMAN_H and use them in
-   monitor_mm.c
- - (stevesk) remove configure support for poll.h; it was removed
-   from sshd.c a long time ago.
- - (stevesk) --with-privsep-user; default sshd
- - (stevesk) wrap munmap() with HAVE_MMAP also.
-
-20020406
- - (djm) Typo in Suse SPEC file. Fix from Carsten Grohmann 
-   <carsten.grohmann@dr-baldeweg.de>
- - (bal) Added MAP_FAILED to allow AIX and Trusted HP to compile.
- - (bal) OpenBSD CVS Sync
-   - djm@cvs.openbsd.org 2002/04/06 00:30:08
-     [sftp-client.c]
-     Fix occasional corruption on upload due to bad reuse of request 
-     id, spotted by chombier@mac.com; ok markus@
-   - mouring@cvs.openbsd.org 2002/04/06 18:24:09
-     [scp.c]
-     Fixes potental double // within path.
-     http://bugzilla.mindrot.org/show_bug.cgi?id=76
- - (bal) Slight update to OpenSC support.  Better version checking. patch
-   by Juha Yrjölä <jyrjola@cc.hut.fi> 
- - (bal) Revered out of runtime IRIX detection of joblimits.  Code is
-   incomplete.
- - (bal) Quiet down configure.ac if /bin/test does not exist.
- - (bal) We no longer use atexit()/xatexit()/on_exit()
-
-20020405
- - (bal) Patch for OpenSC SmartCard library; ok markus@; patch by
-   Juha Yrjölä <jyrjola@cc.hut.fi>
- - (bal) Minor documentation update to reflect smartcard library
-   support changes.
- - (bal) Too many <sys/queue.h> issues.  Remove all workarounds and
-   using internal version only.
- - (bal) OpenBSD CVS Sync
-   - stevesk@cvs.openbsd.org 2002/04/05 20:56:21
-     [sshd.8]
-     clarify sshrc some and handle X11UseLocalhost=yes; ok markus@
-
-20020404
- - (stevesk) [auth-pam.c auth-pam.h auth-passwd.c auth-sia.c auth-sia.h
-    auth1.c auth2.c] PAM, OSF_SIA password auth cleanup; from djm.
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/04/03 09:26:11
-     [cipher.c myproposal.h]
-     re-add rijndael-cbc@lysator.liu.se for MacSSH; ash@lab.poc.net
-
-20020402
- - (bal) Hand Sync of scp.c (reverted to upstream code)
-   - deraadt@cvs.openbsd.org 2002/03/30 17:45:46
-     [scp.c]
-     stretch banners
- - (bal) CVS ID sync of uidswap.c
- - (bal) OpenBSD CVS Sync (now for the real sync)
-   - markus@cvs.openbsd.org 2002/03/27 22:21:45
-     [ssh-keygen.c]
-     try to import keys with extra trailing === (seen with ssh.com < 
-     2.0.12)
-   - markus@cvs.openbsd.org 2002/03/28 15:34:51
-     [session.c]
-     do not call record_login twice (for use_privsep)
-   - markus@cvs.openbsd.org 2002/03/29 18:59:32
-     [session.c session.h]
-     retrieve last login time before the pty is allocated, store per 
-     session
-   - stevesk@cvs.openbsd.org 2002/03/29 19:16:22
-     [sshd.8]
-     RSA key modulus size minimum 768; ok markus@
-   - stevesk@cvs.openbsd.org 2002/03/29 19:18:33
-     [auth-rsa.c ssh-rsa.c ssh.h]
-     make RSA modulus minimum #define; ok markus@
-   - markus@cvs.openbsd.org 2002/03/30 18:51:15
-     [monitor.c serverloop.c sftp-int.c sftp.c sshd.c]
-     check waitpid for EINTR; based on patch from peter@ifm.liu.se
-   - markus@cvs.openbsd.org 2002/04/01 22:02:16
-     [sftp-client.c]
-     20480 is an upper limit for older server
-   - markus@cvs.openbsd.org 2002/04/01 22:07:17
-     [sftp-client.c]
-     fallback to stat if server does not support lstat
-   - markus@cvs.openbsd.org 2002/04/02 11:49:39
-     [ssh-agent.c]
-     check $SHELL for -k and -d, too;
-     http://bugzilla.mindrot.org/show_bug.cgi?id=199
-   - markus@cvs.openbsd.org 2002/04/02 17:37:48
-     [sftp.c]
-     always call log_init()
-   - markus@cvs.openbsd.org 2002/04/02 20:11:38
-     [ssh-rsa.c]
-     ignore SSH_BUG_SIGBLOB for ssh-rsa; #187
- - (bal) mispelling in uidswap.c (portable only)
-
-20020401
- - (stevesk) [monitor.c] PAM should work again; will *not* work with
-   UsePrivilegeSeparation=yes.
- - (stevesk) [auth1.c] fix password auth for protocol 1 when
-   !USE_PAM && !HAVE_OSF_SIA; merge issue.
-
-20020331
- - (tim) [configure.ac] use /bin/test -L to work around broken builtin on
-   Solaris 8
- - (tim) [sshconnect2.c] change uint32_t to u_int32_t
-
-20020330
- - (stevesk) [configure.ac] remove header check for sys/ttcompat.h
-   bug 167
-
-20020327
- - (bal) 'pw' should be 'authctxt->pw' in auth1.c spotted by 
-   kent@lysator.liu.se
- - (bal) OpenBSD CVS Sync
-   - markus@cvs.openbsd.org 2002/03/26 11:34:49
-     [ssh.1 sshd.8]
-     update to recent drafts
-   - markus@cvs.openbsd.org 2002/03/26 11:37:05
-     [ssh.c]
-     update Copyright
-   - markus@cvs.openbsd.org 2002/03/26 15:23:40
-     [bufaux.c]
-     do not talk about packets in bufaux
-   - rees@cvs.openbsd.org 2002/03/26 18:46:59
-     [scard.c]
-     try_AUT0 in read_pubkey too, for those paranoid few who want to 
-     acl 'sh'
-   - markus@cvs.openbsd.org 2002/03/26 22:50:39
-     [channels.h]
-     CHANNEL_EFD_OUTPUT_ACTIVE is false for CHAN_CLOSE_RCVD, too
-   - markus@cvs.openbsd.org 2002/03/26 23:13:03
-     [auth-rsa.c]
-     disallow RSA keys < 768 for protocol 1, too (rhosts-rsa and rsa auth)
-   - markus@cvs.openbsd.org 2002/03/26 23:14:51
-     [kex.c]
-     generate a new cookie for each SSH2_MSG_KEXINIT message we send out
-   - mouring@cvs.openbsd.org 2002/03/27 11:45:42
-     [monitor.c]
-     monitor_allowed_key() returns int instead of pointer.  ok markus@
-  
-20020325
- - (stevesk) import OpenBSD <sys/tree.h> as "openbsd-compat/tree.h"
- - (bal) OpenBSD CVS Sync
-   - stevesk@cvs.openbsd.org 2002/03/23 20:57:26
-     [sshd.c]
-     setproctitle() after preauth child; ok markus@
-   - markus@cvs.openbsd.org 2002/03/24 16:00:27
-     [serverloop.c]
-     remove unused debug
-   - markus@cvs.openbsd.org 2002/03/24 16:01:13
-     [packet.c]
-     debug->debug3 for extra padding
-   - stevesk@cvs.openbsd.org 2002/03/24 17:27:03
-     [kexgex.c]
-     typo; ok markus@
-   - stevesk@cvs.openbsd.org 2002/03/24 17:53:16
-     [monitor_fdpass.c]
-     minor cleanup and more error checking; ok markus@
-   - markus@cvs.openbsd.org 2002/03/24 18:05:29
-     [scard.c]
-     we need to figure out AUT0 for sc_private_encrypt, too
-   - stevesk@cvs.openbsd.org 2002/03/24 23:20:00
-     [monitor.c]
-     remove "\n" from fatal()
-   - markus@cvs.openbsd.org 2002/03/25 09:21:13
-     [auth-rsa.c]
-     return 0 (not NULL); tomh@po.crl.go.jp
-   - markus@cvs.openbsd.org 2002/03/25 09:25:06
-     [auth-rh-rsa.c]
-     rm bogus comment
-   - markus@cvs.openbsd.org 2002/03/25 17:34:27
-     [scard.c scard.h ssh-agent.c ssh-keygen.c ssh.c]
-     change sc_get_key to sc_get_keys and hide smartcard details in scard.c
-   - stevesk@cvs.openbsd.org 2002/03/25 20:12:10
-     [monitor_mm.c monitor_wrap.c]
-     ssize_t args use "%ld" and cast to (long)
-     size_t args use "%lu" and cast to (u_long)
-     ok markus@ and thanks millert@
-   - markus@cvs.openbsd.org 2002/03/25 21:04:02
-     [ssh.c]
-     simplify num_identity_files handling
-   - markus@cvs.openbsd.org 2002/03/25 21:13:51
-     [channels.c channels.h compat.c compat.h nchan.c]
-     don't send stderr data after EOF, accept this from older known 
-     (broken) sshd servers only, fixes
-     http://bugzilla.mindrot.org/show_bug.cgi?id=179
-   - stevesk@cvs.openbsd.org 2002/03/26 03:24:01
-     [monitor.h monitor_fdpass.h monitor_mm.h monitor_wrap.h]
-     $OpenBSD$
-
-20020324
- - (stevesk) [session.c] disable LOGIN_NEEDS_TERM until we are sure
-   it can be removed. only used on solaris. will no longer compile with
-   privsep shuffling.
-
-20020322
- - (stevesk) HAVE_ACCRIGHTS_IN_MSGHDR configure support
- - (stevesk) [monitor.c monitor_wrap.c] #ifdef HAVE_PW_CLASS_IN_PASSWD
- - (stevesk) configure and cpp __FUNCTION__ gymnastics to handle nielsisms
- - (stevesk) [monitor_fdpass.c] support for access rights style file
-   descriptor passing
- - (stevesk) [auth2.c] merge cleanup/sync
- - (stevesk) [defines.h] hp-ux 11 has ancillary data style fd passing, but
-   is missing CMSG_LEN() and CMSG_SPACE() macros.
- - (stevesk) [defines.h] #define MAP_ANON MAP_ANONYMOUS for HP-UX; other
-   platforms may need this--I'm not sure.  mmap() issues will need to be
-   addressed further.
- - (tim) [cipher.c] fix problem with OpenBSD sync
- - (stevesk) [LICENCE] OpenBSD sync
-
-20020321
- - (bal) OpenBSD CVS Sync
-   - itojun@cvs.openbsd.org 2002/03/08 06:10:16
-     [sftp-client.c]
-     printf type mismatch
-   - itojun@cvs.openbsd.org 2002/03/11 03:18:49
-     [sftp-client.c]
-     correct type mismatches (u_int64_t != unsigned long long)
-   - itojun@cvs.openbsd.org 2002/03/11 03:19:53
-     [sftp-client.c]
-     indent
-   - markus@cvs.openbsd.org 2002/03/14 15:24:27
-     [sshconnect1.c]
-     don't trust size sent by (rogue) server; noted by 
-     s.esser@e-matters.de
-   - markus@cvs.openbsd.org 2002/03/14 16:38:26
-     [sshd.c]
-     split out ssh1 session key decryption; ok provos@
-   - markus@cvs.openbsd.org 2002/03/14 16:56:33
-     [auth-rh-rsa.c auth-rsa.c auth.h]
-     split auth_rsa() for better readability and privsep; ok provos@
-   - itojun@cvs.openbsd.org 2002/03/15 11:00:38
-     [auth.c]
-     fix file type checking (use S_ISREG).  ok by markus
-   - markus@cvs.openbsd.org 2002/03/16 11:24:53
-     [compress.c]
-     skip inflateEnd if inflate fails; ok provos@
-   - markus@cvs.openbsd.org 2002/03/16 17:22:09
-     [auth-rh-rsa.c auth.h]
-     split auth_rhosts_rsa(), ok provos@
-   - stevesk@cvs.openbsd.org 2002/03/16 17:41:25
-     [auth-krb5.c]
-     BSD license.  from Daniel Kouril via Dug Song.  ok markus@
-   - provos@cvs.openbsd.org 2002/03/17 20:25:56
-     [auth.c auth.h auth1.c auth2.c]
-     getpwnamallow returns struct passwd * only if user valid; 
-     okay markus@
-   - provos@cvs.openbsd.org 2002/03/18 01:12:14
-     [auth.h auth1.c auth2.c sshd.c]
-     have the authentication functions return the authentication context
-     and then do_authenticated; okay millert@
-   - dugsong@cvs.openbsd.org 2002/03/18 01:30:10
-     [auth-krb4.c]
-     set client to NULL after xfree(), from Rolf Braun 
-     <rbraun+ssh@andrew.cmu.edu>
-   - provos@cvs.openbsd.org 2002/03/18 03:41:08
-     [auth.c session.c]
-     move auth_approval into getpwnamallow with help from millert@
-   - markus@cvs.openbsd.org 2002/03/18 17:13:15
-     [cipher.c cipher.h]
-     export/import cipher states; needed by ssh-privsep
-   - markus@cvs.openbsd.org 2002/03/18 17:16:38
-     [packet.c packet.h]
-     export/import cipher state, iv and ssh2 seqnr; needed by ssh-privsep
-   - markus@cvs.openbsd.org 2002/03/18 17:23:31
-     [key.c key.h]
-     add key_demote() for ssh-privsep
-   - provos@cvs.openbsd.org 2002/03/18 17:25:29
-     [bufaux.c bufaux.h]
-     buffer_skip_string and extra sanity checking; needed by ssh-privsep
-   - provos@cvs.openbsd.org 2002/03/18 17:31:54
-     [compress.c]
-     export compression streams for ssh-privsep
-   - provos@cvs.openbsd.org 2002/03/18 17:50:31
-     [auth-bsdauth.c auth-options.c auth-rh-rsa.c auth-rsa.c]
-     [auth-skey.c auth.h auth1.c auth2-chall.c auth2.c kex.c kex.h kexdh.c]
-     [kexgex.c servconf.c]
-     [session.h servconf.h serverloop.c session.c sshd.c]
-     integrate privilege separated openssh; its turned off by default 
-     for now. work done by me and markus@
-   - provos@cvs.openbsd.org 2002/03/18 17:53:08
-     [sshd.8]
-     credits for privsep
-   - provos@cvs.openbsd.org 2002/03/18 17:59:09
-     [sshd.8]
-     document UsePrivilegeSeparation
-   - stevesk@cvs.openbsd.org 2002/03/18 23:52:51
-     [servconf.c]
-     UnprivUser/UnprivGroup usable now--specify numeric user/group; ok
-     provos@
-   - stevesk@cvs.openbsd.org 2002/03/19 03:03:43
-     [pathnames.h servconf.c servconf.h sshd.c]
-     _PATH_PRIVSEP_CHROOT_DIR; ok provos@
-   - stevesk@cvs.openbsd.org 2002/03/19 05:23:08
-     [sshd.8]
-     Banner has no default.
-   - mpech@cvs.openbsd.org 2002/03/19 06:32:56
-     [sftp-int.c]
-     use xfree() after xstrdup().
-
-     markus@ ok
-   - markus@cvs.openbsd.org 2002/03/19 10:35:39
-     [auth-options.c auth.h session.c session.h sshd.c]
-     clean up prototypes
-   - markus@cvs.openbsd.org 2002/03/19 10:49:35
-     [auth-krb5.c auth-rh-rsa.c auth.c cipher.c key.c misc.h]
-     [packet.c session.c sftp-client.c sftp-glob.h sftp.c ssh-add.c ssh.c]
-     [sshconnect2.c sshd.c ttymodes.c]
-     KNF whitespace
-   - markus@cvs.openbsd.org 2002/03/19 14:27:39
-     [auth.c auth1.c auth2.c]
-     make getpwnamallow() allways call pwcopy()
-   - markus@cvs.openbsd.org 2002/03/19 15:31:47
-     [auth.c]
-     check for NULL; from provos@
-   - stevesk@cvs.openbsd.org 2002/03/20 19:12:25
-     [servconf.c servconf.h ssh.h sshd.c]
-     for unprivileged user, group do:
-     pw=getpwnam(SSH_PRIVSEP_USER); do_setusercontext(pw).  ok provos@
-   - stevesk@cvs.openbsd.org 2002/03/20 21:08:08
-     [sshd.c]
-     strerror() on chdir() fail; ok provos@
-   - markus@cvs.openbsd.org 2002/03/21 10:21:20
-     [ssh-add.c]
-     ignore errors for nonexisting default keys in ssh-add,
-     fixes http://bugzilla.mindrot.org/show_bug.cgi?id=158
-   - jakob@cvs.openbsd.org 2002/03/21 15:17:26
-     [clientloop.c ssh.1]
-     add built-in command line for adding new port forwardings on the fly.
-     based on a patch from brian wellington. ok markus@.
-   - markus@cvs.openbsd.org 2002/03/21 16:38:06
-     [scard.c]
-     make compile w/ openssl 0.9.7
-   - markus@cvs.openbsd.org 2002/03/21 16:54:53
-     [scard.c scard.h ssh-keygen.c]
-     move key upload to scard.[ch]
-   - markus@cvs.openbsd.org 2002/03/21 16:57:15
-     [scard.c]
-     remove const
-   - markus@cvs.openbsd.org 2002/03/21 16:58:13
-     [clientloop.c]
-     remove unused
-   - rees@cvs.openbsd.org 2002/03/21 18:08:15
-     [scard.c]
-     In sc_put_key(), sc_reader_id should be id.
-   - markus@cvs.openbsd.org 2002/03/21 20:51:12
-     [sshd_config]
-     add privsep (off)
-   - markus@cvs.openbsd.org 2002/03/21 21:23:34
-     [sshd.c]
-     add privsep_preauth() and remove 1 goto; ok provos@
-   - rees@cvs.openbsd.org 2002/03/21 21:54:34
-     [scard.c scard.h ssh-keygen.c]
-     Add PIN-protection for secret key.
-   - rees@cvs.openbsd.org 2002/03/21 22:44:05
-     [authfd.c authfd.h ssh-add.c ssh-agent.c ssh.c]
-     Add PIN-protection for secret key.
-   - markus@cvs.openbsd.org 2002/03/21 23:07:37
-     [clientloop.c]
-     remove unused, sync w/ cmdline patch in my tree.
-
-20020317
- - (tim) [configure.ac] Assume path given with --with-pid-dir=PATH is 
-   wanted, warn if directory does not exist. Put system directories in 
-   front of PATH for finding entorpy commands.
- - (tim) [contrib/aix/buildbff.sh contrib/aix/inventory.sh] AIX package
-   build fixes.  Patch by Darren Tucker <dtucker@zip.com.au>
-   [contrib/solaris/buildpkg.sh] add missing dirs to SYSTEM_DIR. Have
-   postinstall check for $piddir and add if necessary.
-
-20020311
- - (tim) [contrib/solaris/buildpkg.sh, contrib/solaris/README] Updated to
-   build on all platforms that support SVR4 style package tools. Now runs
-   from build dir. Parts are based on patches from Antonio Navarro, and
-   Darren Tucker.
-
-20020308
- - (djm) Revert bits of Markus' OpenSSL compat patch which was 
-   accidentally committed.
- - (djm) Add Markus' patch for compat wih OpenSSL < 0.9.6. 
-   Known issue: Blowfish for SSH1 does not work
- - (stevesk) entropy.c: typo in debug message
- - (djm) ssh-keygen -i needs seeded RNG; report from markus@
-
 $Id$
index f5b3546c2b9ef811886d35e9171b1b40a75414ae..64fa7e917c14ccef62463c293e13f7e58bd658d8 100644 (file)
@@ -10,11 +10,7 @@ OpenSSL 0.9.6 or greater:
 http://www.openssl.org/
 
 (OpenSSL 0.9.5a is partially supported, but some ciphers (SSH protocol 1 
-Blowfish included) do not work correctly.)
-
-RPMs of OpenSSL are available at http://violet.ibs.com.au/openssh/files/support.
-For Red Hat Linux 6.2, they have been released as errata.  RHL7 includes
-these.
+Blowfish) do not work correctly.)
 
 OpenSSH can utilise Pluggable Authentication Modules (PAM) if your system
 supports it. PAM is standard on Redhat and Debian Linux, Solaris and
index 67e948662ead2f094ebaf6675db51a82b51fbbde..37cf69349d260108378c87ebdb223147fcb6ef9f 100644 (file)
@@ -129,7 +129,7 @@ ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
        $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 
 
 ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
-       $(LD) -o $@ ssh-keysign.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 
+       $(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 
 
 ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
        $(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) 
@@ -198,12 +198,11 @@ distprep: catman-do
        $(AUTORECONF)
        (cd scard && $(MAKE) -f Makefile.in distprep)
 
-install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files host-key check-user
+install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files host-key check-config
 install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files
 
-check-user:
-       id $(SSH_PRIVSEP_USER) || \
-               echo "WARNING: Privilege separation user \"$(SSH_PRIVSEP_USER)\" does not exist"
+check-config:
+       -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
 
 scard-install:
        (cd scard && $(MAKE) DESTDIR=$(DESTDIR) install)
@@ -217,8 +216,7 @@ install-files: scard-install
        $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5
        $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8
        $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir)
-       $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)
-       chmod 0700 $(DESTDIR)$(PRIVSEP_PATH)
+       (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH))
        $(INSTALL) -m 0755 -s ssh $(DESTDIR)$(bindir)/ssh
        $(INSTALL) -m 0755 -s scp $(DESTDIR)$(bindir)/scp
        $(INSTALL) -m 0755 -s ssh-add $(DESTDIR)$(bindir)/ssh-add
@@ -248,23 +246,23 @@ install-files: scard-install
        @NO_SFTP@$(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
        $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
        -rm -f $(DESTDIR)$(bindir)/slogin
-       ln -s ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin
+       ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin
        -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
-       ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
+       ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
        if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \
                $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \
        fi
-       if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \
+       @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \
                $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \
        else \
                echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \
        fi
-       if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \
+       @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \
                $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \
        else \
                echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
        fi
-       if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
+       @if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
                $(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \
                if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \
                        $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \
@@ -272,7 +270,7 @@ install-files: scard-install
                        echo "$(DESTDIR)$(sysconfdir)/ssh_prng_cmds already exists, install will not overwrite"; \
                fi ; \
        fi
-       if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \
+       @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \
                if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \
                        echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
                        mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \
@@ -284,7 +282,7 @@ install-files: scard-install
        fi
 
 host-key: ssh-keygen$(EXEEXT)
-       if [ -z "$(DESTDIR)" ] ; then \
+       @if [ -z "$(DESTDIR)" ] ; then \
                if [ -f "$(DESTDIR)$(sysconfdir)/ssh_host_key" ] ; then \
                        echo "$(DESTDIR)$(sysconfdir)/ssh_host_key already exists, skipping." ; \
                else \
index d47a7fc679acc6e993231bfa2aeeeec2e00798a6..f9a83d1d387341c8ae18193b03b7e69b0fb46f90 100644 (file)
@@ -18,7 +18,7 @@ Programming:
 - Handle changing passwords for the non-PAM expired password case
 
 - Improve PAM support (a pam_lastlog module will cause sshd to exit)
-  and maybe support alternate forms of authenications like OPIE via
+  and maybe support alternate forms of authentications like OPIE via
   pam?
 
 - Rework PAM ChallengeResponseAuthentication
@@ -42,8 +42,38 @@ Programming:
   solutions break scp or leaves processes hanging around after the ssh
   connection has ended.  It seems to be linked to two things.  One
   select() under Linux is not as nice as others, and two the children
-  of the shell are not killed on exiting the shell. Redhat have an excellent
-  description of this in their RPM package.
+  of the shell are not killed on exiting the shell.
+  A short run-down of what happens:
+  - The shell starts up, and starts its own session.  As a side-effect, it
+    gets its own process group.
+  - The child forks off sleep, and because it's in the background, puts it
+    into its own process group.  The sleep command inherits a copy of the
+    shell's descriptor for the tty as its stdout.
+  - The shell exits, but doesn't SIGHUP all of its child PIDs like it probably
+    should(?)
+  - The sshd server attempts to read from the master side of the pty, and
+    while there are still process with the pty open, no EOF is produced.
+  - The sleep command exits, closes its descriptor, sshd detects the EOF, and
+    the connection gets closed.
+  Ways we've tried fixing this in sshd, and why they didn't work out:
+  - SIGHUP the sshd's process group.
+    - The shell is in its own process group.
+  - Track process group IDs of all children before we reap them (via an extra
+    field in Session structures which holds the pgid for each child pid), and
+    SIGHUP the pgid when we reap.
+    - Background commands are in yet another process group.
+  - Close the connection when the child dies.
+    - Background commands may need to write data to the connection.  Also
+      prematurely truncates output from some commands (scp server, the
+      famous "dd if=/dev/zero bs=1000 count=100" case).
+  Known workarounds:
+  - bash: shopt huponexit on
+  - tcsh: none
+  - zsh: setopt HUP (usually the default setting)
+    (taken from email from Jason Stone to openssh-unix-dev, 5 May 2001)
+  - pdksh: ?
+  This appears to affect NetKit rsh under Linux as well: it behaves the same
+  with 'sleep 20 & exit'.
 
 - Build an automated test suite
 
index 37227e7fe4c2ddee2e189ac39707d27247dc1866..cb96abdcc9339ad2fd09f846461205334ced072c 100644 (file)
 /* 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
 
 /* 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
 
 /* 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 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@
 
index 4f1b452b7a705f75b69cf7510ff86f5f66c34069..2ac27a7a20e7a0adc097cd5908a8bc0e47d8392e 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-bsdauth.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: auth-bsdauth.c,v 1.5 2002/06/30 21:59:45 deraadt Exp $");
 
 #ifdef BSD_AUTH
 #include "xmalloc.h"
@@ -69,7 +69,7 @@ bsdauth_query(void *ctx, char **name, char **infotxt,
        *name = xstrdup("");
        *infotxt = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char*));
+       *prompts = xmalloc(*numprompts * sizeof(char *));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
        (*echo_on)[0] = 0;
        (*prompts)[0] = xstrdup(challenge);
index 1cc528aa0a9dfb1ff5da92884aca8cae5c3986d6..b86ce7e49e57d557b9a6833de84d8926a6cd2677 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-krb4.c,v 1.27 2002/06/11 05:46:20 mpech Exp $");
+RCSID("$OpenBSD: auth-krb4.c,v 1.28 2002/09/26 11:38:43 markus Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -210,10 +210,9 @@ krb4_cleanup_proc(void *context)
 }
 
 int
-auth_krb4(Authctxt *authctxt, KTEXT auth, char **client)
+auth_krb4(Authctxt *authctxt, KTEXT auth, char **client, KTEXT reply)
 {
        AUTH_DAT adat = {0};
-       KTEXT_ST reply;
        Key_schedule schedule;
        struct sockaddr_in local, foreign;
        char instance[INST_SZ];
@@ -263,21 +262,16 @@ auth_krb4(Authctxt *authctxt, KTEXT auth, char **client)
 
        /* If we can't successfully encrypt the checksum, we send back an
           empty message, admitting our failure. */
-       if ((r = krb_mk_priv((u_char *) & cksum, reply.dat, sizeof(cksum) + 1,
+       if ((r = krb_mk_priv((u_char *) & cksum, reply->dat, sizeof(cksum) + 1,
            schedule, &adat.session, &local, &foreign)) < 0) {
                debug("Kerberos v4 mk_priv: (%d) %s", r, krb_err_txt[r]);
-               reply.dat[0] = 0;
-               reply.length = 0;
+               reply->dat[0] = 0;
+               reply->length = 0;
        } else
-               reply.length = r;
+               reply->length = r;
 
        /* Clear session key. */
        memset(&adat.session, 0, sizeof(&adat.session));
-
-       packet_start(SSH_SMSG_AUTH_KERBEROS_RESPONSE);
-       packet_put_string((char *) reply.dat, reply.length);
-       packet_send();
-       packet_write_wait();
        return (1);
 }
 #endif /* KRB4 */
index 308a6d5f9bad6ba997e0db05c5ba065a0fabc976..512f70b7861221f3018d67c0313ff7848dc58399 100644 (file)
@@ -28,7 +28,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-krb5.c,v 1.8 2002/03/19 10:49:35 markus Exp $");
+RCSID("$OpenBSD: auth-krb5.c,v 1.9 2002/09/09 06:48:06 itojun Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -73,18 +73,17 @@ krb5_init(void *context)
  * from the ticket
  */
 int
-auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
+auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *reply)
 {
        krb5_error_code problem;
        krb5_principal server;
-       krb5_data reply;
        krb5_ticket *ticket;
        int fd, ret;
 
        ret = 0;
        server = NULL;
        ticket = NULL;
-       reply.length = 0;
+       reply->length = 0;
 
        problem = krb5_init(authctxt);
        if (problem)
@@ -131,7 +130,7 @@ auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
 
        /* if client wants mutual auth */
        problem = krb5_mk_rep(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
-           &reply);
+           reply);
        if (problem)
                goto err;
 
@@ -144,19 +143,16 @@ auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client)
                krb5_unparse_name(authctxt->krb5_ctx, authctxt->krb5_user,
                    client);
 
-       packet_start(SSH_SMSG_AUTH_KERBEROS_RESPONSE);
-       packet_put_string((char *) reply.data, reply.length);
-       packet_send();
-       packet_write_wait();
-
        ret = 1;
  err:
        if (server)
                krb5_free_principal(authctxt->krb5_ctx, server);
        if (ticket)
                krb5_free_ticket(authctxt->krb5_ctx, ticket);
-       if (reply.length)
-               xfree(reply.data);
+       if (!ret && reply->length) {
+               xfree(reply->data);
+               memset(reply, 0, sizeof(*reply));
+       }
 
        if (problem) {
                if (authctxt->krb5_ctx != NULL)
index 2787d2948b5062e5c0dac0bf1742d9ca3451a8da..8595fdc147d804a688a6fd53a82c919969bec327 100644 (file)
@@ -10,9 +10,8 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth-options.c,v 1.24 2002/05/13 20:44:58 markus Exp $");
+RCSID("$OpenBSD: auth-options.c,v 1.26 2002/07/30 17:03:55 markus Exp $");
 
-#include "packet.h"
 #include "xmalloc.h"
 #include "match.h"
 #include "log.h"
@@ -20,7 +19,6 @@ RCSID("$OpenBSD: auth-options.c,v 1.24 2002/05/13 20:44:58 markus Exp $");
 #include "channels.h"
 #include "auth-options.h"
 #include "servconf.h"
-#include "bufaux.h"
 #include "misc.h"
 #include "monitor_wrap.h"
 #include "auth.h"
@@ -135,7 +133,8 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
                        goto next_option;
                }
                cp = "environment=\"";
-               if (strncasecmp(opts, cp, strlen(cp)) == 0) {
+               if (options.permit_user_env &&
+                   strncasecmp(opts, cp, strlen(cp)) == 0) {
                        char *s;
                        struct envstring *new_envstring;
 
index aa6270fd62ef0aab69ec8cb3396f17dc68e6a6c9..15fb21255e53d582ac88e3519d1e54f463d962ad 100644 (file)
@@ -1,10 +1,9 @@
-/*     $OpenBSD: auth-options.h,v 1.11 2002/03/04 17:27:39 stevesk Exp $       */
+/*     $OpenBSD: auth-options.h,v 1.12 2002/07/21 18:34:43 stevesk Exp $       */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
  *                    All rights reserved
- * Functions to interface with the SSH_AUTHENTICATION_FD socket.
  *
  * As far as I am concerned, the code I have written for this software
  * can be used freely for any purpose.  Any derived versions of this
index 4b4c2f9d795372a3ebd1de46cdcfe58d22f7f754..3f0f32f7f0de565b048d9b7b4fd31a8c6c598d2e 100644 (file)
 #include "includes.h"
 
 #ifdef USE_PAM
-#include "ssh.h"
 #include "xmalloc.h"
 #include "log.h"
 #include "auth.h"
+#include "auth-options.h"
 #include "auth-pam.h"
 #include "servconf.h"
 #include "canohost.h"
 
 extern char *__progname;
 
+extern int use_privsep;
+
 RCSID("$Id$");
 
 #define NEW_AUTHTOK_MSG \
-       "Warning: Your password has expired, please change it now"
+       "Warning: Your password has expired, please change it now."
+#define NEW_AUTHTOK_MSG_PRIVSEP \
+       "Your password has expired, the session cannot proceed."
 
 static int do_pam_conversation(int num_msg, const struct pam_message **msg,
        struct pam_response **resp, void *appdata_ptr);
 
 /* module-local variables */
 static struct pam_conv conv = {
-       do_pam_conversation,
+       (int (*)())do_pam_conversation,
        NULL
 };
 static char *__pam_msg = NULL;
@@ -55,7 +59,7 @@ static const char *__pampasswd = NULL;
 
 /* states for do_pam_conversation() */
 enum { INITIAL_LOGIN, OTHER } pamstate = INITIAL_LOGIN;
-/* remember whether pam_acct_mgmt() returned PAM_NEWAUTHTOK_REQD */
+/* remember whether pam_acct_mgmt() returned PAM_NEW_AUTHTOK_REQD */
 static int password_change_required = 0;
 /* remember whether the last pam_authenticate() succeeded or not */
 static int was_authenticated = 0;
@@ -100,9 +104,7 @@ static int do_pam_conversation(int num_msg, const struct pam_message **msg,
        char buf[1024];
 
        /* PAM will free this later */
-       reply = malloc(num_msg * sizeof(*reply));
-       if (reply == NULL)
-               return PAM_CONV_ERR;
+       reply = xmalloc(num_msg * sizeof(*reply));
 
        for (count = 0; count < num_msg; count++) {
                if (pamstate == INITIAL_LOGIN) {
@@ -112,11 +114,11 @@ static int do_pam_conversation(int num_msg, const struct pam_message **msg,
                         */
                        switch(PAM_MSG_MEMBER(msg, count, msg_style)) {
                        case PAM_PROMPT_ECHO_ON:
-                               free(reply);
+                               xfree(reply);
                                return PAM_CONV_ERR;
                        case PAM_PROMPT_ECHO_OFF:
                                if (__pampasswd == NULL) {
-                                       free(reply);
+                                       xfree(reply);
                                        return PAM_CONV_ERR;
                                }
                                reply[count].resp = xstrdup(__pampasswd);
@@ -124,7 +126,7 @@ static int do_pam_conversation(int num_msg, const struct pam_message **msg,
                                break;
                        case PAM_ERROR_MSG:
                        case PAM_TEXT_INFO:
-                               if ((*msg)[count].msg != NULL) {
+                               if (PAM_MSG_MEMBER(msg, count, msg) != NULL) {
                                        message_cat(&__pam_msg, 
                                            PAM_MSG_MEMBER(msg, count, msg));
                                }
@@ -132,7 +134,7 @@ static int do_pam_conversation(int num_msg, const struct pam_message **msg,
                                reply[count].resp_retcode = PAM_SUCCESS;
                                break;
                        default:
-                               free(reply);
+                               xfree(reply);
                                return PAM_CONV_ERR;
                        }
                } else {
@@ -154,14 +156,14 @@ static int do_pam_conversation(int num_msg, const struct pam_message **msg,
                                break;
                        case PAM_ERROR_MSG:
                        case PAM_TEXT_INFO:
-                               if ((*msg)[count].msg != NULL)
+                               if (PAM_MSG_MEMBER(msg, count, msg) != NULL)
                                        fprintf(stderr, "%s\n", 
                                            PAM_MSG_MEMBER(msg, count, msg));
                                reply[count].resp = xstrdup("");
                                reply[count].resp_retcode = PAM_SUCCESS;
                                break;
                        default:
-                               free(reply);
+                               xfree(reply);
                                return PAM_CONV_ERR;
                        }
                }
@@ -256,9 +258,14 @@ int do_pam_account(char *username, char *remote_user)
                        break;
 #if 0
                case PAM_NEW_AUTHTOK_REQD:
-                       message_cat(&__pam_msg, NEW_AUTHTOK_MSG);
+                       message_cat(&__pam_msg, use_privsep ?
+                           NEW_AUTHTOK_MSG_PRIVSEP : NEW_AUTHTOK_MSG);
                        /* flag that password change is necessary */
                        password_change_required = 1;
+                       /* disallow other functionality for now */
+                       no_port_forwarding_flag |= 2;
+                       no_agent_forwarding_flag |= 2;
+                       no_x11_forwarding_flag |= 2;
                        break;
 #endif
                default:
@@ -328,7 +335,7 @@ int is_pam_password_change_required(void)
  * Have user change authentication token if pam_acct_mgmt() indicated
  * it was expired.  This needs to be called after an interactive
  * session is established and the user's pty is connected to
- * stdin/stout/stderr.
+ * stdin/stdout/stderr.
  */
 void do_pam_chauthtok(void)
 {
@@ -337,11 +344,23 @@ void do_pam_chauthtok(void)
        do_pam_set_conv(&conv);
 
        if (password_change_required) {
+               if (use_privsep)
+                       fatal("Password changing is currently unsupported"
+                           " with privilege separation");
                pamstate = OTHER;
                pam_retval = pam_chauthtok(__pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
                if (pam_retval != PAM_SUCCESS)
                        fatal("PAM pam_chauthtok failed[%d]: %.200s",
                            pam_retval, PAM_STRERROR(__pamh, pam_retval));
+#if 0
+               /* XXX: This would need to be done in the parent process,
+                * but there's currently no way to pass such request. */
+               no_port_forwarding_flag &= ~2;
+               no_agent_forwarding_flag &= ~2;
+               no_x11_forwarding_flag &= ~2;
+               if (!no_port_forwarding_flag && options.allow_tcp_forwarding)
+                       channel_permit_all_opens();
+#endif
        }
 }
 
@@ -392,7 +411,7 @@ void start_pam(const char *user)
        fatal_add_cleanup(&do_pam_cleanup_proc, NULL);
 }
 
-/* Return list of PAM enviornment strings */
+/* Return list of PAM environment strings */
 char **fetch_pam_environment(void)
 {
 #ifdef HAVE_PAM_GETENVLIST
@@ -402,6 +421,16 @@ char **fetch_pam_environment(void)
 #endif /* HAVE_PAM_GETENVLIST */
 }
 
+void free_pam_environment(char **env)
+{
+       int i;
+
+       if (env != NULL) {
+               for (i = 0; env[i] != NULL; i++)
+                       xfree(env[i]);
+       }
+}
+
 /* Print any messages that have been generated during authentication */
 /* or account checking to stderr */
 void print_pam_messages(void)
index fabd3d04288f2e8c9b8ef74549aa8eff42ea0a2a..585ceb8df2ab17a365a35c7c45b187ae52ea3016 100644 (file)
@@ -1,14 +1,41 @@
 /* $Id$ */
 
+/*
+ * Copyright (c) 2000 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"
 #ifdef USE_PAM
 
-#include <pwd.h> /* For struct passwd */
+#if !defined(SSHD_PAM_SERVICE)
+# define SSHD_PAM_SERVICE              __progname
+#endif
 
 void start_pam(const char *user);
 void finish_pam(void);
 int auth_pam_password(Authctxt *authctxt, const char *password);
 char **fetch_pam_environment(void);
+void free_pam_environment(char **env);
 int do_pam_authenticate(int flags);
 int do_pam_account(char *username, char *remote_user);
 void do_pam_session(char *username, const char *ttyname);
index 17bbd2ceba0db51ed7422a2450b662a13a1a1d6e..185db7d6df95c2bce4b2f8b84337a26375b49940 100644 (file)
@@ -81,6 +81,9 @@ RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $");
 #endif /* !USE_PAM && !HAVE_OSF_SIA */
 
 extern ServerOptions options;
+#ifdef WITH_AIXAUTHENTICATE
+extern char *aixloginmsg;
+#endif
 
 /*
  * Tries to authenticate the user using password.  Returns true if
@@ -113,7 +116,7 @@ auth_password(Authctxt *authctxt, const char *password)
 #endif
 #ifdef WITH_AIXAUTHENTICATE
        char *authmsg;
-       char *loginmsg;
+       int authsuccess;
        int reenter = 1;
 #endif
 
@@ -145,7 +148,16 @@ auth_password(Authctxt *authctxt, const char *password)
        }
 #endif
 #ifdef WITH_AIXAUTHENTICATE
-       return (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0);
+       authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0);
+
+       if (authsuccess)
+               /* We don't have a pty yet, so just label the line as "ssh" */
+               if (loginsuccess(authctxt->user,
+                       get_canonical_hostname(options.verify_reverse_mapping),
+                       "ssh", &aixloginmsg) < 0)
+                               aixloginmsg = NULL;
+
+       return(authsuccess);
 #endif
 #ifdef KRB4
        if (options.kerberos_authentication == 1) {
index eb13c5cc5203805c5b1dc11c55ffcb7c05578cab..f9ea03fd1a9b2b7746406917eb102ab4e1ea487a 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth-skey.c,v 1.19 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: auth-skey.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
 
 #ifdef SKEY
 
@@ -53,7 +53,7 @@ skey_query(void *ctx, char **name, char **infotxt,
        *name  = xstrdup("");
        *infotxt  = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char*));
+       *prompts = xmalloc(*numprompts * sizeof(char *));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
        (*echo_on)[0] = 0;
 
index 066b50d6ba1dcc132182cd8d57c166988242ffab..48720da8f295a1183af029583f2878ae2bc29457 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth.c,v 1.43 2002/05/17 14:27:55 millert Exp $");
+RCSID("$OpenBSD: auth.c,v 1.45 2002/09/20 18:41:29 stevesk Exp $");
 
 #ifdef HAVE_LOGIN_H
 #include <login.h>
@@ -256,6 +256,14 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
            get_remote_ipaddr(),
            get_remote_port(),
            info);
+
+#ifdef WITH_AIXAUTHENTICATE
+       if (authenticated == 0 && strcmp(method, "password") == 0)
+           loginfailed(authctxt->user,
+               get_canonical_hostname(options.verify_reverse_mapping),
+               "ssh");
+#endif /* WITH_AIXAUTHENTICATE */
+
 }
 
 /*
@@ -392,7 +400,7 @@ check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host,
 
 /*
  * Check a given file for security. This is defined as all components
- * of the path to the file must either be owned by either the owner of
+ * of the path to the file must be owned by either the owner of
  * of the file or root and no directories must be group or world writable.
  *
  * XXX Should any specific check be done for sym links ?
@@ -476,7 +484,12 @@ getpwnamallow(const char *user)
        struct passwd *pw;
 
        pw = getpwnam(user);
-       if (pw == NULL || !allowed_user(pw))
+       if (pw == NULL) {
+               log("Illegal user %.100s from %.100s",
+                   user, get_remote_ipaddr());
+               return (NULL);
+       }
+       if (!allowed_user(pw))
                return (NULL);
 #ifdef HAVE_LOGIN_CAP
        if ((lc = login_getclass(pw->pw_class)) == NULL) {
index d98547d02ab1bbef9260f00122b31aa767ce6455..c75d75366bca2ff823691d572b28d5fa4bafc04d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: auth.h,v 1.39 2002/05/31 11:35:15 markus Exp $        */
+/*     $OpenBSD: auth.h,v 1.41 2002/09/26 11:38:43 markus Exp $        */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -113,7 +113,7 @@ int  user_key_allowed(struct passwd *, Key *);
 
 #ifdef KRB4
 #include <krb.h>
-int     auth_krb4(Authctxt *, KTEXT, char **);
+int     auth_krb4(Authctxt *, KTEXT, char **, KTEXT);
 int    auth_krb4_password(Authctxt *, const char *);
 void    krb4_cleanup_proc(void *);
 
@@ -126,7 +126,7 @@ int     auth_afs_token(Authctxt *, const char *);
 #endif /* KRB4 */
 
 #ifdef KRB5
-int    auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client);
+int    auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *);
 int    auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
 int    auth_krb5_password(Authctxt *authctxt, const char *password);
 void   krb5_cleanup_proc(void *authctxt);
index 2ebc8d039b0d7d76769d4fe7af2587e2a7720b41..9527ba004c459fb2ed77391eb5c0179895f5115d 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth1.c,v 1.41 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: auth1.c,v 1.44 2002/09/26 11:38:43 markus Exp $");
 
 #include "xmalloc.h"
 #include "rsa.h"
@@ -118,30 +118,49 @@ do_authloop(Authctxt *authctxt)
 
                                if (kdata[0] == 4) { /* KRB_PROT_VERSION */
 #ifdef KRB4
-                                       KTEXT_ST tkt;
-
+                                       KTEXT_ST tkt, reply;
                                        tkt.length = dlen;
                                        if (tkt.length < MAX_KTXT_LEN)
                                                memcpy(tkt.dat, kdata, tkt.length);
 
-                                       if (auth_krb4(authctxt, &tkt, &client_user)) {
+                                       if (PRIVSEP(auth_krb4(authctxt, &tkt,
+                                           &client_user, &reply))) {
                                                authenticated = 1;
                                                snprintf(info, sizeof(info),
                                                    " tktuser %.100s",
                                                    client_user);
+
+                                               packet_start(
+                                                   SSH_SMSG_AUTH_KERBEROS_RESPONSE);
+                                               packet_put_string((char *)
+                                                   reply.dat, reply.length);
+                                               packet_send();
+                                               packet_write_wait();
                                        }
 #endif /* KRB4 */
                                } else {
 #ifdef KRB5
-                                       krb5_data tkt;
+                                       krb5_data tkt, reply;
                                        tkt.length = dlen;
                                        tkt.data = kdata;
 
-                                       if (auth_krb5(authctxt, &tkt, &client_user)) {
+                                       if (PRIVSEP(auth_krb5(authctxt, &tkt,
+                                           &client_user, &reply))) {
                                                authenticated = 1;
                                                snprintf(info, sizeof(info),
                                                    " tktuser %.100s",
                                                    client_user);
+                                               /* Send response to client */
+                                               packet_start(
+                                                   SSH_SMSG_AUTH_KERBEROS_RESPONSE);
+                                               packet_put_string((char *)
+                                                   reply.data, reply.length);
+                                               packet_send();
+                                               packet_write_wait();
+
+                                               if (reply.length)
+                                                       xfree(reply.data);
                                        }
 #endif /* KRB5 */
                                }
@@ -292,6 +311,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)) {
@@ -301,7 +329,8 @@ do_authloop(Authctxt *authctxt)
                }
 #else
                /* Special handling for root */
-               if (authenticated && authctxt->pw->pw_uid == 0 &&
+               if (!use_privsep &&
+                   authenticated && authctxt->pw->pw_uid == 0 &&
                    !auth_root_allowed(get_authname(type)))
                        authenticated = 0;
 #endif
@@ -323,12 +352,6 @@ do_authloop(Authctxt *authctxt)
                        return;
 
                if (authctxt->failures++ > AUTH_FAIL_MAX) {
-#ifdef WITH_AIXAUTHENTICATE
-                       /* XXX: privsep */
-                       loginfailed(authctxt->user,
-                           get_canonical_hostname(options.verify_reverse_mapping),
-                           "ssh");
-#endif /* WITH_AIXAUTHENTICATE */
                        packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
                }
 
index e1440f47d7cb4e234420ec65d7732716e25f5286..0d170930795e43fca61570c323f707d3c6ed4b10 100644 (file)
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: auth2-chall.c,v 1.19 2002/06/26 13:55:37 markus Exp $");
+RCSID("$OpenBSD: auth2-chall.c,v 1.20 2002/06/30 21:59:45 deraadt Exp $");
 
 #include "ssh2.h"
 #include "auth.h"
@@ -263,7 +263,7 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
        if (nresp > 100)
                fatal("input_userauth_info_response: too many replies");
        if (nresp > 0) {
-               response = xmalloc(nresp * sizeof(char*));
+               response = xmalloc(nresp * sizeof(char *));
                for (i = 0; i < nresp; i++)
                        response[i] = packet_get_string(NULL);
        }
index 720d3c10f13c4e39920579b6eb54c8e54c48d596..c07b2dd814883e80969e780538028d4250845cb1 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2-none.c,v 1.3 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: auth2-none.c,v 1.4 2002/06/27 10:35:47 deraadt Exp $");
 
 #include "auth.h"
 #include "xmalloc.h"
@@ -61,7 +61,7 @@ auth2_read_banner(void)
        close(fd);
 
        if (n != len) {
-               free(banner);
+               xfree(banner);
                return (NULL);
        }
        banner[n] = '\0';
index b2bfa8130649958de564f64fcfebed434f1f5af0..9decbb6a43ca542a7f5ebc4682724041675d4a35 100644 (file)
@@ -116,11 +116,11 @@ do_pam_conversation_kbd_int(int num_msg, const struct pam_message **msg,
        while(context_pam2.finished == 0) {
                done = 1;
                dispatch_run(DISPATCH_BLOCK, &done, appdata_ptr);
-               if(context_pam2.finished == 0)
+               if (context_pam2.finished == 0)
                        debug("extra packet during conversation");
        }
 
-       if(context_pam2.num_received == context_pam2.num_expected) {
+       if (context_pam2.num_received == context_pam2.num_expected) {
                *resp = context_pam2.responses;
                return PAM_SUCCESS;
        } else
@@ -143,8 +143,8 @@ input_userauth_info_response_pam(int type, u_int32_t seqnr, void *ctxt)
 
        if (nresp != context_pam2.num_expected)
                fatal("%s: Received incorrect number of responses "
-                   "(expected %u, received %u)", __func__, nresp,
-                   context_pam2.num_expected);
+                   "(expected %d, received %u)", __func__, 
+                   context_pam2.num_expected, nresp);
 
        if (nresp > 100)
                fatal("%s: too many replies", __func__);
@@ -163,5 +163,4 @@ input_userauth_info_response_pam(int type, u_int32_t seqnr, void *ctxt)
 
        packet_check_eom();
 }
-
 #endif
index 6dfd91f749d829431bbbca2b5afa0f941f6eaf3d..17c58552a886b54e90dd631013ffc79a6895455d 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: auth2.c,v 1.93 2002/05/31 11:35:15 markus Exp $");
+RCSID("$OpenBSD: auth2.c,v 1.95 2002/08/22 21:33:58 markus Exp $");
 
 #include "ssh2.h"
 #include "xmalloc.h"
@@ -102,7 +102,7 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
 {
        Authctxt *authctxt = ctxt;
        u_int len;
-       int accept = 0;
+       int acceptit = 0;
        char *service = packet_get_string(&len);
        packet_check_eom();
 
@@ -111,14 +111,14 @@ input_service_request(int type, u_int32_t seq, void *ctxt)
 
        if (strcmp(service, "ssh-userauth") == 0) {
                if (!authctxt->success) {
-                       accept = 1;
+                       acceptit = 1;
                        /* now we can handle user-auth requests */
                        dispatch_set(SSH2_MSG_USERAUTH_REQUEST, &input_userauth_request);
                }
        }
        /* XXX all other service requests are denied */
 
-       if (accept) {
+       if (acceptit) {
                packet_start(SSH2_MSG_SERVICE_ACCEPT);
                packet_put_cstring(service);
                packet_send();
@@ -205,7 +205,8 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
                    authctxt->user);
 
        /* Special handling for root */
-       if (authenticated && authctxt->pw->pw_uid == 0 &&
+       if (!use_privsep &&
+           authenticated && authctxt->pw->pw_uid == 0 &&
            !auth_root_allowed(method))
                authenticated = 0;
 
@@ -215,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");
 
@@ -232,14 +240,12 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
                authctxt->success = 1;
        } else {
                if (authctxt->failures++ > AUTH_FAIL_MAX) {
-#ifdef WITH_AIXAUTHENTICATE
-                       /* XXX: privsep */
-                       loginfailed(authctxt->user,
-                           get_canonical_hostname(options.verify_reverse_mapping),
-                           "ssh");
-#endif /* WITH_AIXAUTHENTICATE */
                        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);
index 4c4552d527f0deab67941c2b2a814ae2249a58e9..f04e0858b04806e2da4c53e59dbcb702bbf8ddf3 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.56 2002/06/25 16:22:42 markus Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.57 2002/09/11 18:27:26 stevesk Exp $");
 
 #include <openssl/evp.h>
 
@@ -53,6 +53,8 @@ RCSID("$OpenBSD: authfd.c,v 1.56 2002/06/25 16:22:42 markus Exp $");
 #include "log.h"
 #include "atomicio.h"
 
+static int agent_present = 0;
+
 /* helper */
 int    decode_reply(int type);
 
@@ -61,6 +63,21 @@ int  decode_reply(int type);
     ((x == SSH_AGENT_FAILURE) || (x == SSH_COM_AGENT2_FAILURE) || \
     (x == SSH2_AGENT_FAILURE))
 
+int
+ssh_agent_present(void)
+{
+       int authfd;
+
+       if (agent_present)
+               return 1;
+       if ((authfd = ssh_get_authentication_socket()) == -1)
+               return 0;
+       else {
+               ssh_close_authentication_socket(authfd);
+               return 1;
+       }
+}
+
 /* Returns the number of the authentication fd, or -1 if there is none. */
 
 int
@@ -90,6 +107,7 @@ ssh_get_authentication_socket(void)
                close(sock);
                return -1;
        }
+       agent_present = 1;
        return sock;
 }
 
index b2767e5c1e472113827344364bdf15293233f7c1..38ee49e88523fa67b688002de056b6200c24ef48 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: authfd.h,v 1.30 2002/06/19 00:27:55 deraadt Exp $     */
+/*     $OpenBSD: authfd.h,v 1.31 2002/09/11 18:27:25 stevesk Exp $     */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -66,6 +66,7 @@ typedef struct {
        int     howmany;
 }      AuthenticationConnection;
 
+int    ssh_agent_present(void);
 int    ssh_get_authentication_socket(void);
 void   ssh_close_authentication_socket(int);
 
index 92197818276937035ee556f06265a1adab61777f..97d45354294def0be924f198b455733eb5d48bc1 100644 (file)
@@ -862,7 +862,7 @@ Optional Packages:
   --with-kerberos5=PATH   Enable Kerberos 5 support
   --with-kerberos4=PATH   Enable Kerberos 4 support
   --with-afs=PATH         Enable AFS support
-  --with-privsep-path=xxx Path for privilege separation chroot 
+  --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)
   --with-xauth=PATH       Specify path to xauth program 
   --with-mantype=man|cat|doc  Set man page type
   --with-md5-passwords    Enable use of MD5 passwords
@@ -2760,52 +2760,6 @@ echo "${ECHO_T}no" >&6
 fi
 
 
-for ac_prog in filepriv
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_FILEPRIV+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $FILEPRIV in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_FILEPRIV="$FILEPRIV" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/sbin:/usr/sbin"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_FILEPRIV="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-FILEPRIV=$ac_cv_path_FILEPRIV
-
-if test -n "$FILEPRIV"; then
-  echo "$as_me:$LINENO: result: $FILEPRIV" >&5
-echo "${ECHO_T}$FILEPRIV" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  test -n "$FILEPRIV" && break
-done
-test -n "$FILEPRIV" || FILEPRIV="true"
-
 # Extract the first word of "bash", so it can be a program name with args.
 set dummy bash; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -3622,6 +3576,72 @@ if test $ac_cv_func_authenticate = yes; then
 @%:@define WITH_AIXAUTHENTICATE 1
 _ACEOF
 
+else
+  echo "$as_me:$LINENO: checking for authenticate in -ls" >&5
+echo $ECHO_N "checking for authenticate in -ls... $ECHO_C" >&6
+if test "${ac_cv_lib_s_authenticate+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ls  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char authenticate ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+authenticate ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_s_authenticate=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_s_authenticate=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_s_authenticate" >&5
+echo "${ECHO_T}$ac_cv_lib_s_authenticate" >&6
+if test $ac_cv_lib_s_authenticate = yes; then
+   cat >>confdefs.h <<\_ACEOF
+@%:@define WITH_AIXAUTHENTICATE 1
+_ACEOF
+
+                               LIBS="$LIBS -ls"
+                       
+fi
+
+               
 fi
 
        cat >>confdefs.h <<\_ACEOF
@@ -3668,7 +3688,11 @@ _ACEOF
 _ACEOF
 
        cat >>confdefs.h <<\_ACEOF
-@%:@define BROKEN_FD_PASSING 1
+@%:@define NO_IPPORT_RESERVED_CONCEPT 1
+_ACEOF
+
+       cat >>confdefs.h <<\_ACEOF
+@%:@define DISABLE_FD_PASSING 1
 _ACEOF
 
        cat >>confdefs.h <<\_ACEOF
@@ -3683,10 +3707,49 @@ _ACEOF
 
        ;;
 *-*-darwin*)
+       echo "$as_me:$LINENO: checking if we have working getaddrinfo" >&5
+echo $ECHO_N "checking if we have working getaddrinfo... $ECHO_C" >&6
+       if test "$cross_compiling" = yes; then
+  echo "$as_me:$LINENO: result: assume it is working" >&5
+echo "${ECHO_T}assume it is working" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+#include <mach-o/dyld.h>
+main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
+               exit(0);
+       else
+               exit(1);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: working" >&5
+echo "${ECHO_T}working" >&6
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+echo "$as_me:$LINENO: result: buggy" >&5
+echo "${ECHO_T}buggy" >&6
        cat >>confdefs.h <<\_ACEOF
 @%:@define BROKEN_GETADDRINFO 1
 _ACEOF
 
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
        ;;
 *-*-hpux10.26)
        if test -z "$GCC"; then
@@ -3722,7 +3785,76 @@ _ACEOF
 @%:@define SPT_TYPE SPT_PSTAT
 _ACEOF
 
-       LIBS="$LIBS -lxnet -lsec -lsecpw"
+       LIBS="$LIBS -lsec -lsecpw"
+       
+echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5
+echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
+if test "${ac_cv_lib_xnet_t_error+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char t_error ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+t_error ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_xnet_t_error=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_xnet_t_error=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5
+echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
+if test $ac_cv_lib_xnet_t_error = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBXNET 1
+_ACEOF
+
+  LIBS="-lxnet $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
        disable_ptmx_check=yes
        ;;
 *-*-hpux10*)
@@ -3755,7 +3887,76 @@ _ACEOF
 @%:@define SPT_TYPE SPT_PSTAT
 _ACEOF
 
-       LIBS="$LIBS -lxnet -lsec"
+       LIBS="$LIBS -lsec"
+       
+echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5
+echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
+if test "${ac_cv_lib_xnet_t_error+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char t_error ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+t_error ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_xnet_t_error=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_xnet_t_error=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5
+echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
+if test $ac_cv_lib_xnet_t_error = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBXNET 1
+_ACEOF
+
+  LIBS="-lxnet $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
        ;;
 *-*-hpux11*)
        CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
@@ -3788,7 +3989,76 @@ _ACEOF
 @%:@define SPT_TYPE SPT_PSTAT
 _ACEOF
 
-       LIBS="$LIBS -lxnet -lsec"
+       LIBS="$LIBS -lsec"
+       
+echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5
+echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
+if test "${ac_cv_lib_xnet_t_error+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lxnet  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char t_error ();
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+t_error ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_xnet_t_error=yes
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+ac_cv_lib_xnet_t_error=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5
+echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
+if test $ac_cv_lib_xnet_t_error = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBXNET 1
+_ACEOF
+
+  LIBS="-lxnet $LIBS"
+
+else
+  { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
        ;;
 *-*-irix5*)
        CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -3920,6 +4190,7 @@ _ACEOF
        SONY=1
        ;;
 *-*-netbsd*)
+       check_for_libcrypt_before=1
        need_dash_r=1
        ;;
 *-*-freebsd*)
@@ -4250,7 +4521,7 @@ _ACEOF
 _ACEOF
 
        cat >>confdefs.h <<\_ACEOF
-@%:@define BROKEN_FD_PASSING 1
+@%:@define DISABLE_FD_PASSING 1
 _ACEOF
 
        
@@ -4332,6 +4603,21 @@ done
 
        MANTYPE=man
        ;;
+*-*-unicosmk*)
+       no_libsocket=1
+       no_libnsl=1
+       cat >>confdefs.h <<\_ACEOF
+@%:@define USE_PIPES 1
+_ACEOF
+
+       cat >>confdefs.h <<\_ACEOF
+@%:@define DISABLE_FD_PASSING 1
+_ACEOF
+
+       LDFLAGS="$LDFLAGS"
+       LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
+       MANTYPE=cat
+       ;;
 *-*-unicos*)
        no_libsocket=1
        no_libnsl=1
@@ -4340,11 +4626,16 @@ done
 _ACEOF
 
        cat >>confdefs.h <<\_ACEOF
-@%:@define BROKEN_FD_PASSING 1
+@%:@define DISABLE_FD_PASSING 1
+_ACEOF
+
+       cat >>confdefs.h <<\_ACEOF
+@%:@define NO_SSH_LASTLOG 1
 _ACEOF
 
-       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*)
        echo "$as_me:$LINENO: checking for Digital Unix SIA" >&5
@@ -4688,18 +4979,20 @@ done
 
 
 
+
+
 
 
 
 for ac_header in 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
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -5646,7 +5939,11 @@ fi
 echo "$as_me:$LINENO: result: $ac_cv_lib_c89_utimes" >&5
 echo "${ECHO_T}$ac_cv_lib_c89_utimes" >&6
 if test $ac_cv_lib_c89_utimes = yes; then
-  LIBS="$LIBS -lc89"
+  cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_UTIMES 1
+_ACEOF
+
+                                       LIBS="$LIBS -lc89"
 fi
  
 
@@ -6176,7 +6473,7 @@ else
 
 #include <sys/types.h>
 #include <dirent.h>
-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));}
        
 _ACEOF
 rm -f conftest$ac_exeext
@@ -6244,7 +6541,7 @@ else
 
 #include <stdio.h>
 #include <skey.h>
-int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
+int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
                                
 _ACEOF
 rm -f conftest$ac_exeext
@@ -6440,11 +6737,12 @@ fi;
 
 
 
+
 
 
 for ac_func in 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 \
@@ -6528,63 +6826,6 @@ fi
 done
 
 
-if test $ac_cv_func_mmap = yes ; then
-echo "$as_me:$LINENO: checking for mmap anon shared" >&5
-echo $ECHO_N "checking for mmap anon shared... $ECHO_C" >&6
-if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
-echo "$as_me: error: cannot run test program while cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
-
-#include <stdio.h>
-#include <sys/mman.h>
-#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);
-}
-       
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  
-               echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-               cat >>confdefs.h <<\_ACEOF
-@%:@define HAVE_MMAP_ANON_SHARED 1
-_ACEOF
-
-       
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
-( exit $ac_status )
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6  
-
-fi
-rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-
 
 for ac_func in dirname
 do
@@ -7697,7 +7938,7 @@ else
 #include "confdefs.h"
 
 #include <stdio.h>
-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');}
                
 _ACEOF
 rm -f conftest$ac_exeext
@@ -8031,20 +8272,87 @@ _ACEOF
                fi
        
 
-fi; 
-
-# Check for older PAM
-if test "x$PAM_MSG" = "xyes" ; then
-       # Check PAM strerror arguments (old PAM)
-       echo "$as_me:$LINENO: checking whether pam_strerror takes only one argument" >&5
-echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6
-       cat >conftest.$ac_ext <<_ACEOF
+fi; 
+
+# Check for older PAM
+if test "x$PAM_MSG" = "xyes" ; then
+       # Check PAM strerror arguments (old PAM)
+       echo "$as_me:$LINENO: checking whether pam_strerror takes only one argument" >&5
+echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6
+       cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <stdlib.h>
+#include <security/pam_appl.h>
+               
+#ifdef F77_DUMMY_MAIN
+#  ifdef __cplusplus
+     extern "C"
+#  endif
+   int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+(void)pam_strerror((pam_handle_t *)NULL, -1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+else
+  echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+
+                       cat >>confdefs.h <<\_ACEOF
+@%:@define HAVE_OLD_PAM 1
+_ACEOF
+
+                       echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+                       PAM_MSG="yes (old library)"
+               
+       
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+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
+       
+echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5
+echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
+if test "${ac_cv_lib_crypt_crypt+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypt  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
 
-#include <stdlib.h>
-#include <security/pam_appl.h>
-               
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char crypt ();
 #ifdef F77_DUMMY_MAIN
 #  ifdef __cplusplus
      extern "C"
@@ -8054,40 +8362,43 @@ echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C"
 int
 main ()
 {
-(void)pam_strerror((pam_handle_t *)NULL, -1);
+crypt ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
+         { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  ac_cv_lib_crypt_crypt=yes
 else
   echo "$as_me: failed program was:" >&5
 cat conftest.$ac_ext >&5
-
-                       cat >>confdefs.h <<\_ACEOF
-@%:@define HAVE_OLD_PAM 1
+ac_cv_lib_crypt_crypt=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5
+echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
+if test $ac_cv_lib_crypt_crypt = yes; then
+  cat >>confdefs.h <<_ACEOF
+@%:@define HAVE_LIBCRYPT 1
 _ACEOF
 
-                       echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-                       PAM_MSG="yes (old library)"
-               
-       
+  LIBS="-lcrypt $LIBS"
+
 fi
-rm -f conftest.$ac_objext conftest.$ac_ext
+
 fi
 
 # Search for OpenSSL
@@ -8230,6 +8541,134 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 fi
 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
 
+# Determine OpenSSL header version
+echo "$as_me:$LINENO: checking OpenSSL header version" >&5
+echo $ECHO_N "checking OpenSSL header version... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#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);
+}
+       
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+               ssl_header_ver=`cat conftest.sslincver`
+               echo "$as_me:$LINENO: result: $ssl_header_ver" >&5
+echo "${ECHO_T}$ssl_header_ver" >&6
+       
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+
+               echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+               { { echo "$as_me:$LINENO: error: OpenSSL version header not found." >&5
+echo "$as_me: error: OpenSSL version header not found." >&2;}
+   { (exit 1); exit 1; }; }
+       
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+# Determine OpenSSL library version
+echo "$as_me:$LINENO: checking OpenSSL library version" >&5
+echo $ECHO_N "checking OpenSSL library version... $ECHO_C" >&6
+if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
+echo "$as_me: error: cannot run test program while cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#include <openssl/crypto.h>
+#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);
+}
+       
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  
+               ssl_library_ver=`cat conftest.ssllibver`
+               echo "$as_me:$LINENO: result: $ssl_library_ver" >&5
+echo "${ECHO_T}$ssl_library_ver" >&6
+       
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+( exit $ac_status )
+
+               echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+               { { echo "$as_me:$LINENO: error: OpenSSL library not found." >&5
+echo "$as_me: error: OpenSSL library not found." >&2;}
+   { (exit 1); exit 1; }; }
+       
+
+fi
+rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
 # Sanity check OpenSSL headers
 echo "$as_me:$LINENO: checking whether OpenSSL's headers match the library" >&5
@@ -8245,7 +8684,7 @@ else
 
 #include <string.h>
 #include <openssl/opensslv.h>
-int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
+int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
        
 _ACEOF
 rm -f conftest$ac_exeext
@@ -8361,7 +8800,7 @@ else
 
 #include <string.h>
 #include <openssl/rand.h>
-int main(void) { return(RAND_status() == 1 ? 0 : 1); }
+int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
        
 _ACEOF
 rm -f conftest$ac_exeext
@@ -11321,7 +11760,16 @@ else
        cat >conftest.$ac_ext <<_ACEOF
 #line $LINENO "configure"
 #include "confdefs.h"
- #include <sys/types.h> 
+
+#include <sys/types.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#include <sys/socket.h>
+#ifdef HAVE_SYS_BITYPES_H
+# include <sys/bitypes.h>
+#endif
+               
 #ifdef F77_DUMMY_MAIN
 #  ifdef __cplusplus
      extern "C"
@@ -11365,109 +11813,6 @@ if test "x$ac_cv_have_int64_t" = "xyes" ; then
 @%:@define HAVE_INT64_T 1
 _ACEOF
 
-       have_int64_t=1
-fi
-       
-if test -z "$have_int64_t" ; then
-    echo "$as_me:$LINENO: checking for int64_t type in sys/socket.h" >&5
-echo $ECHO_N "checking for int64_t type in sys/socket.h... $ECHO_C" >&6
-       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
- #include <sys/socket.h> 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
- int64_t a; a = 1
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  
-                       cat >>confdefs.h <<\_ACEOF
-@%:@define HAVE_INT64_T 1
-_ACEOF
-
-                       echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-               
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6 
-       
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-fi
-
-if test -z "$have_int64_t" ; then
-    echo "$as_me:$LINENO: checking for int64_t type in sys/bitypes.h" >&5
-echo $ECHO_N "checking for int64_t type in sys/bitypes.h... $ECHO_C" >&6
-       cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-#include "confdefs.h"
- #include <sys/bitypes.h> 
-#ifdef F77_DUMMY_MAIN
-#  ifdef __cplusplus
-     extern "C"
-#  endif
-   int F77_DUMMY_MAIN() { return 1; }
-#endif
-int
-main ()
-{
- int64_t a; a = 1
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  
-                       cat >>confdefs.h <<\_ACEOF
-@%:@define HAVE_INT64_T 1
-_ACEOF
-
-                       echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-               
-else
-  echo "$as_me: failed program was:" >&5
-cat conftest.$ac_ext >&5
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6 
-       
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
 fi
 
 echo "$as_me:$LINENO: checking for u_intXX_t types" >&5
@@ -15334,6 +15679,11 @@ if test "${with_xauth+set}" = set; then
        
 else
   
+               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"
                # Extract the first word of "xauth", so it can be a program name with args.
 set dummy xauth; ac_word=$2
 echo "$as_me:$LINENO: checking for $ac_word" >&5
@@ -15347,7 +15697,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH:/usr/X/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/openwin/bin
+for as_dir in $TestPath
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -15482,6 +15832,7 @@ echo "$as_me: error: invalid man type: $withval" >&2;}
 
 fi; 
 if test -z "$MANTYPE"; then
+       TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
        for ac_prog in nroff awf
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -15497,8 +15848,7 @@ else
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/usr/bin:/usr/ucb"
-for as_dir in $as_dummy
+for as_dir in $TestPath
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
@@ -16997,7 +17347,6 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t
 s,@AR@,$AR,;t t
 s,@PERL@,$PERL,;t t
 s,@ENT@,$ENT,;t t
-s,@FILEPRIV@,$FILEPRIV,;t t
 s,@TEST_MINUS_S_SH@,$TEST_MINUS_S_SH,;t t
 s,@SH@,$SH,;t t
 s,@LOGIN_PROGRAM_FALLBACK@,$LOGIN_PROGRAM_FALLBACK,;t t
index 6eb0daac79252d70f0752eb76754b54e035f887d..3fcfab66ca8a197ac815dddc5a47069b004498f7 100644 (file)
@@ -94,283 +94,314 @@ m4trace:configure.ac:16: -1- AC_SUBST([PERL], [$ac_cv_path_PERL])
 m4trace:configure.ac:17: -1- AC_SUBST([PERL])
 m4trace:configure.ac:18: -1- AC_SUBST([ENT], [$ac_cv_path_ENT])
 m4trace:configure.ac:19: -1- AC_SUBST([ENT])
-m4trace:configure.ac:20: -1- AC_SUBST([FILEPRIV], [$ac_cv_path_FILEPRIV])
+m4trace:configure.ac:20: -1- AC_SUBST([TEST_MINUS_S_SH], [$ac_cv_path_TEST_MINUS_S_SH])
 m4trace:configure.ac:21: -1- AC_SUBST([TEST_MINUS_S_SH], [$ac_cv_path_TEST_MINUS_S_SH])
 m4trace:configure.ac:22: -1- AC_SUBST([TEST_MINUS_S_SH], [$ac_cv_path_TEST_MINUS_S_SH])
-m4trace:configure.ac:23: -1- AC_SUBST([TEST_MINUS_S_SH], [$ac_cv_path_TEST_MINUS_S_SH])
-m4trace:configure.ac:24: -1- AC_SUBST([SH], [$ac_cv_path_SH])
-m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([_FILE_OFFSET_BITS])
-m4trace:configure.ac:27: -1- AH_OUTPUT([_FILE_OFFSET_BITS], [/* Number of bits in a file offset, on hosts where this is settable. */
+m4trace:configure.ac:23: -1- AC_SUBST([SH], [$ac_cv_path_SH])
+m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([_FILE_OFFSET_BITS])
+m4trace:configure.ac:26: -1- AH_OUTPUT([_FILE_OFFSET_BITS], [/* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS])
-m4trace:configure.ac:27: -1- AC_DEFINE_TRACE_LITERAL([_LARGE_FILES])
-m4trace:configure.ac:27: -1- AH_OUTPUT([_LARGE_FILES], [/* Define for large files, on AIX-style hosts. */
+m4trace:configure.ac:26: -1- AC_DEFINE_TRACE_LITERAL([_LARGE_FILES])
+m4trace:configure.ac:26: -1- AH_OUTPUT([_LARGE_FILES], [/* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES])
-m4trace:configure.ac:35: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_PROGRAM_FALLBACK])
-m4trace:configure.ac:38: -1- AC_SUBST([LOGIN_PROGRAM_FALLBACK], [$ac_cv_path_LOGIN_PROGRAM_FALLBACK])
-m4trace:configure.ac:40: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_PROGRAM_FALLBACK])
-m4trace:configure.ac:47: -1- AC_SUBST([LD])
-m4trace:configure.ac:49: -1- AC_C_INLINE
-m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([inline])
-m4trace:configure.ac:49: -1- AH_OUTPUT([inline], [/* Define as \`__inline' if that's what the C compiler calls it, or to nothing
+m4trace:configure.ac:34: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_PROGRAM_FALLBACK])
+m4trace:configure.ac:37: -1- AC_SUBST([LOGIN_PROGRAM_FALLBACK], [$ac_cv_path_LOGIN_PROGRAM_FALLBACK])
+m4trace:configure.ac:39: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_PROGRAM_FALLBACK])
+m4trace:configure.ac:46: -1- AC_SUBST([LD])
+m4trace:configure.ac:48: -1- AC_C_INLINE
+m4trace:configure.ac:48: -1- AC_DEFINE_TRACE_LITERAL([inline])
+m4trace:configure.ac:48: -1- AH_OUTPUT([inline], [/* Define as \`__inline' if that's what the C compiler calls it, or to nothing
    if it is not supported. */
 #undef inline])
-m4trace:configure.ac:49: -1- AC_DEFINE_TRACE_LITERAL([inline])
-m4trace:configure.ac:74: -1- AC_DEFINE_TRACE_LITERAL([WITH_AIXAUTHENTICATE])
-m4trace:configure.ac:75: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_GETADDRINFO])
-m4trace:configure.ac:76: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_REALPATH])
-m4trace:configure.ac:78: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
-m4trace:configure.ac:79: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
-m4trace:configure.ac:83: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CYGWIN])
-m4trace:configure.ac:84: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:85: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:86: -1- AC_DEFINE_TRACE_LITERAL([IPV4_DEFAULT])
-m4trace:configure.ac:87: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
-m4trace:configure.ac:88: -1- AC_DEFINE_TRACE_LITERAL([NO_X11_UNIX_SOCKETS])
-m4trace:configure.ac:89: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_FD_PASSING])
-m4trace:configure.ac:90: -1- AC_DEFINE_TRACE_LITERAL([SETGROUPS_NOOP])
-m4trace:configure.ac:93: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
-m4trace:configure.ac:96: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_GETADDRINFO])
-m4trace:configure.ac:104: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
-m4trace:configure.ac:105: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:106: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
-m4trace:configure.ac:107: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
-m4trace:configure.ac:108: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:109: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:110: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
-m4trace:configure.ac:120: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:121: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
-m4trace:configure.ac:122: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
-m4trace:configure.ac:123: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:124: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:125: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
-m4trace:configure.ac:131: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
-m4trace:configure.ac:132: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:133: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
-m4trace:configure.ac:134: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
-m4trace:configure.ac:135: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:136: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:137: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
-m4trace:configure.ac:144: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_INET_NTOA])
-m4trace:configure.ac:145: -1- AC_DEFINE_TRACE_LITERAL([WITH_ABBREV_NO_TTY])
-m4trace:configure.ac:151: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_ARRAY])
-m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_PROJECT])
-m4trace:configure.ac:153: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_AUDIT])
-m4trace:configure.ac:154: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_JOBS])
-m4trace:configure.ac:155: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_INET_NTOA])
-m4trace:configure.ac:156: -1- AC_DEFINE_TRACE_LITERAL([WITH_ABBREV_NO_TTY])
-m4trace:configure.ac:161: -1- AC_DEFINE_TRACE_LITERAL([DONT_TRY_OTHER_AF])
-m4trace:configure.ac:162: -1- AC_DEFINE_TRACE_LITERAL([PAM_TTY_KLUDGE])
-m4trace:configure.ac:166: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NEWS4])
-m4trace:configure.ac:180: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NEXT])
-m4trace:configure.ac:181: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_REALPATH])
-m4trace:configure.ac:182: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:183: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SAVED_UIDS])
-m4trace:configure.ac:191: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
-m4trace:configure.ac:192: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
-m4trace:configure.ac:193: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_TERM])
-m4trace:configure.ac:194: -1- AC_DEFINE_TRACE_LITERAL([PAM_TTY_KLUDGE])
-m4trace:configure.ac:201: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:202: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
-m4trace:configure.ac:209: -1- AC_CHECK_FUNCS([getpwanam])
-m4trace:configure.ac:209: -1- AH_OUTPUT([HAVE_GETPWANAM], [/* Define to 1 if you have the \`getpwanam' function. */
+m4trace:configure.ac:48: -1- AC_DEFINE_TRACE_LITERAL([inline])
+m4trace:configure.ac:78: -1- AC_DEFINE_TRACE_LITERAL([WITH_AIXAUTHENTICATE])
+m4trace:configure.ac:78: -1- AC_CHECK_LIB([s], [authenticate], [ AC_DEFINE(WITH_AIXAUTHENTICATE)
+                               LIBS="$LIBS -ls"
+                       ])
+m4trace:configure.ac:78: -1- AC_DEFINE_TRACE_LITERAL([WITH_AIXAUTHENTICATE])
+m4trace:configure.ac:79: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_GETADDRINFO])
+m4trace:configure.ac:80: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_REALPATH])
+m4trace:configure.ac:82: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
+m4trace:configure.ac:83: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
+m4trace:configure.ac:87: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CYGWIN])
+m4trace:configure.ac:88: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:89: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:90: -1- AC_DEFINE_TRACE_LITERAL([IPV4_DEFAULT])
+m4trace:configure.ac:91: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
+m4trace:configure.ac:92: -1- AC_DEFINE_TRACE_LITERAL([NO_X11_UNIX_SOCKETS])
+m4trace:configure.ac:93: -1- AC_DEFINE_TRACE_LITERAL([NO_IPPORT_RESERVED_CONCEPT])
+m4trace:configure.ac:94: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_FD_PASSING])
+m4trace:configure.ac:95: -1- AC_DEFINE_TRACE_LITERAL([SETGROUPS_NOOP])
+m4trace:configure.ac:98: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
+m4trace:configure.ac:110: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_GETADDRINFO])
+m4trace:configure.ac:118: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
+m4trace:configure.ac:119: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:120: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
+m4trace:configure.ac:121: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
+m4trace:configure.ac:122: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:123: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:124: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
+m4trace:configure.ac:126: -1- AC_CHECK_LIB([xnet], [t_error], [], [{ { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.ac:126: -1- AH_OUTPUT([HAVE_LIBXNET], [/* Define to 1 if you have the \`xnet' library (-lxnet). */
+#undef HAVE_LIBXNET])
+m4trace:configure.ac:126: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBXNET])
+m4trace:configure.ac:135: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:136: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
+m4trace:configure.ac:137: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
+m4trace:configure.ac:138: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:139: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:140: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
+m4trace:configure.ac:142: -1- AC_CHECK_LIB([xnet], [t_error], [], [{ { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.ac:142: -1- AH_OUTPUT([HAVE_LIBXNET], [/* Define to 1 if you have the \`xnet' library (-lxnet). */
+#undef HAVE_LIBXNET])
+m4trace:configure.ac:142: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBXNET])
+m4trace:configure.ac:147: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
+m4trace:configure.ac:148: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:149: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NO_ENDOPT])
+m4trace:configure.ac:150: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
+m4trace:configure.ac:151: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:152: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:153: -1- AC_DEFINE_TRACE_LITERAL([SPT_TYPE])
+m4trace:configure.ac:155: -1- AC_CHECK_LIB([xnet], [t_error], [], [{ { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
+echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
+   { (exit 1); exit 1; }; }])
+m4trace:configure.ac:155: -1- AH_OUTPUT([HAVE_LIBXNET], [/* Define to 1 if you have the \`xnet' library (-lxnet). */
+#undef HAVE_LIBXNET])
+m4trace:configure.ac:155: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBXNET])
+m4trace:configure.ac:161: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_INET_NTOA])
+m4trace:configure.ac:162: -1- AC_DEFINE_TRACE_LITERAL([WITH_ABBREV_NO_TTY])
+m4trace:configure.ac:168: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_ARRAY])
+m4trace:configure.ac:169: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_PROJECT])
+m4trace:configure.ac:170: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_AUDIT])
+m4trace:configure.ac:171: -1- AC_DEFINE_TRACE_LITERAL([WITH_IRIX_JOBS])
+m4trace:configure.ac:172: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_INET_NTOA])
+m4trace:configure.ac:173: -1- AC_DEFINE_TRACE_LITERAL([WITH_ABBREV_NO_TTY])
+m4trace:configure.ac:178: -1- AC_DEFINE_TRACE_LITERAL([DONT_TRY_OTHER_AF])
+m4trace:configure.ac:179: -1- AC_DEFINE_TRACE_LITERAL([PAM_TTY_KLUDGE])
+m4trace:configure.ac:183: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NEWS4])
+m4trace:configure.ac:198: -1- AC_DEFINE_TRACE_LITERAL([HAVE_NEXT])
+m4trace:configure.ac:199: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_REALPATH])
+m4trace:configure.ac:200: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:201: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SAVED_UIDS])
+m4trace:configure.ac:209: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
+m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_UTMPX])
+m4trace:configure.ac:211: -1- AC_DEFINE_TRACE_LITERAL([LOGIN_NEEDS_TERM])
+m4trace:configure.ac:212: -1- AC_DEFINE_TRACE_LITERAL([PAM_TTY_KLUDGE])
+m4trace:configure.ac:219: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:220: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
+m4trace:configure.ac:227: -1- AC_CHECK_FUNCS([getpwanam])
+m4trace:configure.ac:227: -1- AH_OUTPUT([HAVE_GETPWANAM], [/* Define to 1 if you have the \`getpwanam' function. */
 #undef HAVE_GETPWANAM])
-m4trace:configure.ac:210: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
-m4trace:configure.ac:214: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:220: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:227: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:228: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
-m4trace:configure.ac:236: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:241: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:253: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SYS_TERMIO_H])
+m4trace:configure.ac:228: -1- AC_DEFINE_TRACE_LITERAL([PAM_SUN_CODEBASE])
+m4trace:configure.ac:232: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:238: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:245: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:246: -1- AC_DEFINE_TRACE_LITERAL([IP_TOS_IS_BROKEN])
 m4trace:configure.ac:254: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:255: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
-m4trace:configure.ac:256: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:257: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SAVED_UIDS])
-m4trace:configure.ac:258: -1- AC_CHECK_FUNCS([getluid setluid])
-m4trace:configure.ac:258: -1- AH_OUTPUT([HAVE_GETLUID], [/* Define to 1 if you have the \`getluid' function. */
+m4trace:configure.ac:259: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:271: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SYS_TERMIO_H])
+m4trace:configure.ac:272: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:273: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
+m4trace:configure.ac:274: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:275: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SAVED_UIDS])
+m4trace:configure.ac:276: -1- AC_CHECK_FUNCS([getluid setluid])
+m4trace:configure.ac:276: -1- AH_OUTPUT([HAVE_GETLUID], [/* Define to 1 if you have the \`getluid' function. */
 #undef HAVE_GETLUID])
-m4trace:configure.ac:258: -1- AH_OUTPUT([HAVE_SETLUID], [/* Define to 1 if you have the \`setluid' function. */
+m4trace:configure.ac:276: -1- AH_OUTPUT([HAVE_SETLUID], [/* Define to 1 if you have the \`setluid' function. */
 #undef HAVE_SETLUID])
-m4trace:configure.ac:267: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:268: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
-m4trace:configure.ac:269: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:270: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_FD_PASSING])
-m4trace:configure.ac:271: -1- AC_CHECK_FUNCS([getluid setluid])
-m4trace:configure.ac:271: -1- AH_OUTPUT([HAVE_GETLUID], [/* Define to 1 if you have the \`getluid' function. */
+m4trace:configure.ac:285: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:286: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SECUREWARE])
+m4trace:configure.ac:287: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:288: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_FD_PASSING])
+m4trace:configure.ac:289: -1- AC_CHECK_FUNCS([getluid setluid])
+m4trace:configure.ac:289: -1- AH_OUTPUT([HAVE_GETLUID], [/* Define to 1 if you have the \`getluid' function. */
 #undef HAVE_GETLUID])
-m4trace:configure.ac:271: -1- AH_OUTPUT([HAVE_SETLUID], [/* Define to 1 if you have the \`setluid' function. */
+m4trace:configure.ac:289: -1- AH_OUTPUT([HAVE_SETLUID], [/* Define to 1 if you have the \`setluid' function. */
 #undef HAVE_SETLUID])
-m4trace:configure.ac:277: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:278: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_FD_PASSING])
-m4trace:configure.ac:297: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OSF_SIA])
-m4trace:configure.ac:298: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LOGIN])
-m4trace:configure.ac:307: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
-m4trace:configure.ac:308: -1- AC_DEFINE_TRACE_LITERAL([NO_X11_UNIX_SOCKETS])
-m4trace:configure.ac:309: -1- AC_DEFINE_TRACE_LITERAL([MISSING_NFDBITS])
-m4trace:configure.ac:310: -1- AC_DEFINE_TRACE_LITERAL([MISSING_HOWMANY])
-m4trace:configure.ac:311: -1- AC_DEFINE_TRACE_LITERAL([MISSING_FD_MASK])
-m4trace:configure.ac:359: -1- AC_CHECK_HEADERS([bstring.h crypt.h endian.h floatingpoint.h \
-       getopt.h glob.h lastlog.h limits.h login.h \
+m4trace:configure.ac:295: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:296: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_FD_PASSING])
+m4trace:configure.ac:304: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:305: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_FD_PASSING])
+m4trace:configure.ac:306: -1- AC_DEFINE_TRACE_LITERAL([NO_SSH_LASTLOG])
+m4trace:configure.ac:326: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OSF_SIA])
+m4trace:configure.ac:327: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LOGIN])
+m4trace:configure.ac:336: -1- AC_DEFINE_TRACE_LITERAL([USE_PIPES])
+m4trace:configure.ac:337: -1- AC_DEFINE_TRACE_LITERAL([NO_X11_UNIX_SOCKETS])
+m4trace:configure.ac:338: -1- AC_DEFINE_TRACE_LITERAL([MISSING_NFDBITS])
+m4trace:configure.ac:339: -1- AC_DEFINE_TRACE_LITERAL([MISSING_HOWMANY])
+m4trace:configure.ac:340: -1- AC_DEFINE_TRACE_LITERAL([MISSING_FD_MASK])
+m4trace:configure.ac:388: -1- AC_CHECK_HEADERS([bstring.h crypt.h endian.h floatingpoint.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])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_BSTRING_H], [/* Define to 1 if you have the <bstring.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_BSTRING_H], [/* Define to 1 if you have the <bstring.h> header file. */
 #undef HAVE_BSTRING_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_CRYPT_H], [/* Define to 1 if you have the <crypt.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_CRYPT_H], [/* Define to 1 if you have the <crypt.h> header file. */
 #undef HAVE_CRYPT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_ENDIAN_H], [/* Define to 1 if you have the <endian.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_ENDIAN_H], [/* Define to 1 if you have the <endian.h> header file. */
 #undef HAVE_ENDIAN_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_FLOATINGPOINT_H], [/* Define to 1 if you have the <floatingpoint.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_FLOATINGPOINT_H], [/* Define to 1 if you have the <floatingpoint.h> header file. */
 #undef HAVE_FLOATINGPOINT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the <getopt.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_GETOPT_H], [/* Define to 1 if you have the <getopt.h> header file. */
 #undef HAVE_GETOPT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_GLOB_H], [/* Define to 1 if you have the <glob.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_GLOB_H], [/* Define to 1 if you have the <glob.h> header file. */
 #undef HAVE_GLOB_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_LASTLOG_H], [/* Define to 1 if you have the <lastlog.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_IA_H], [/* Define to 1 if you have the <ia.h> header file. */
+#undef HAVE_IA_H])
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_LASTLOG_H], [/* Define to 1 if you have the <lastlog.h> header file. */
 #undef HAVE_LASTLOG_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the <limits.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_LIMITS_H], [/* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_LOGIN_H], [/* Define to 1 if you have the <login.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_LOGIN_H], [/* Define to 1 if you have the <login.h> header file. */
 #undef HAVE_LOGIN_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_LOGIN_CAP_H], [/* Define to 1 if you have the <login_cap.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_LOGIN_CAP_H], [/* Define to 1 if you have the <login_cap.h> header file. */
 #undef HAVE_LOGIN_CAP_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_MAILLOCK_H], [/* Define to 1 if you have the <maillock.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_MAILLOCK_H], [/* Define to 1 if you have the <maillock.h> header file. */
 #undef HAVE_MAILLOCK_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the <netdb.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_NETDB_H], [/* Define to 1 if you have the <netdb.h> header file. */
 #undef HAVE_NETDB_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_NETGROUP_H], [/* Define to 1 if you have the <netgroup.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_NETGROUP_H], [/* Define to 1 if you have the <netgroup.h> header file. */
 #undef HAVE_NETGROUP_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_NETINET_IN_SYSTM_H], [/* Define to 1 if you have the <netinet/in_systm.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_NETINET_IN_SYSTM_H], [/* Define to 1 if you have the <netinet/in_systm.h> header file. */
 #undef HAVE_NETINET_IN_SYSTM_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_PATHS_H], [/* Define to 1 if you have the <paths.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_PATHS_H], [/* Define to 1 if you have the <paths.h> header file. */
 #undef HAVE_PATHS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_PTY_H], [/* Define to 1 if you have the <pty.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_PTY_H], [/* Define to 1 if you have the <pty.h> header file. */
 #undef HAVE_PTY_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_READPASSPHRASE_H], [/* Define to 1 if you have the <readpassphrase.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_READPASSPHRASE_H], [/* Define to 1 if you have the <readpassphrase.h> header file. */
 #undef HAVE_READPASSPHRASE_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_RPC_TYPES_H], [/* Define to 1 if you have the <rpc/types.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_RPC_TYPES_H], [/* Define to 1 if you have the <rpc/types.h> header file. */
 #undef HAVE_RPC_TYPES_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SECURITY_PAM_APPL_H], [/* Define to 1 if you have the <security/pam_appl.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SECURITY_PAM_APPL_H], [/* Define to 1 if you have the <security/pam_appl.h> header file. */
 #undef HAVE_SECURITY_PAM_APPL_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SHADOW_H], [/* Define to 1 if you have the <shadow.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SHADOW_H], [/* Define to 1 if you have the <shadow.h> header file. */
 #undef HAVE_SHADOW_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STDDEF_H], [/* Define to 1 if you have the <stddef.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STDDEF_H], [/* Define to 1 if you have the <stddef.h> header file. */
 #undef HAVE_STDDEF_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_BITYPES_H], [/* Define to 1 if you have the <sys/bitypes.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_BITYPES_H], [/* Define to 1 if you have the <sys/bitypes.h> header file. */
 #undef HAVE_SYS_BITYPES_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_BSDTTY_H], [/* Define to 1 if you have the <sys/bsdtty.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_BSDTTY_H], [/* Define to 1 if you have the <sys/bsdtty.h> header file. */
 #undef HAVE_SYS_BSDTTY_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_CDEFS_H], [/* Define to 1 if you have the <sys/cdefs.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_CDEFS_H], [/* Define to 1 if you have the <sys/cdefs.h> header file. */
 #undef HAVE_SYS_CDEFS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the <sys/mman.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_MMAN_H], [/* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the <sys/select.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the <sys/select.h> header file. */
 #undef HAVE_SYS_SELECT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_STROPTS_H], [/* Define to 1 if you have the <sys/stropts.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_STROPTS_H], [/* Define to 1 if you have the <sys/stropts.h> header file. */
 #undef HAVE_SYS_STROPTS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_SYSMACROS_H], [/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_SYSMACROS_H], [/* Define to 1 if you have the <sys/sysmacros.h> header file. */
 #undef HAVE_SYS_SYSMACROS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the <sys/time.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_UN_H], [/* Define to 1 if you have the <sys/un.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_UN_H], [/* Define to 1 if you have the <sys/un.h> header file. */
 #undef HAVE_SYS_UN_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_TIME_H], [/* Define to 1 if you have the <time.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_TIME_H], [/* Define to 1 if you have the <time.h> header file. */
 #undef HAVE_TIME_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_TTYENT_H], [/* Define to 1 if you have the <ttyent.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_TMPDIR_H], [/* Define to 1 if you have the <tmpdir.h> header file. */
+#undef HAVE_TMPDIR_H])
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_TTYENT_H], [/* Define to 1 if you have the <ttyent.h> header file. */
 #undef HAVE_TTYENT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_USERSEC_H], [/* Define to 1 if you have the <usersec.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_USERSEC_H], [/* Define to 1 if you have the <usersec.h> header file. */
 #undef HAVE_USERSEC_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_UTIL_H], [/* Define to 1 if you have the <util.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_UTIL_H], [/* Define to 1 if you have the <util.h> header file. */
 #undef HAVE_UTIL_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_UTIME_H], [/* Define to 1 if you have the <utime.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_UTIME_H], [/* Define to 1 if you have the <utime.h> header file. */
 #undef HAVE_UTIME_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_UTMP_H], [/* Define to 1 if you have the <utmp.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_UTMP_H], [/* Define to 1 if you have the <utmp.h> header file. */
 #undef HAVE_UTMP_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_UTMPX_H], [/* Define to 1 if you have the <utmpx.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_UTMPX_H], [/* Define to 1 if you have the <utmpx.h> header file. */
 #undef HAVE_UTMPX_H])
-m4trace:configure.ac:359: -1- AC_HEADER_STDC
-m4trace:configure.ac:359: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
-m4trace:configure.ac:359: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
+m4trace:configure.ac:388: -1- AC_HEADER_STDC
+m4trace:configure.ac:388: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS])
+m4trace:configure.ac:388: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS])
-m4trace:configure.ac:359: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+m4trace:configure.ac:388: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
                   inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the <string.h> header file. */
 #undef HAVE_STRING_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H])
-m4trace:configure.ac:359: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
+m4trace:configure.ac:388: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H])
-m4trace:configure.ac:362: -2- AC_CHECK_LIB([nsl], [yp_match])
-m4trace:configure.ac:362: -2- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the \`nsl' library (-lnsl). */
+m4trace:configure.ac:391: -2- AC_CHECK_LIB([nsl], [yp_match])
+m4trace:configure.ac:391: -2- AH_OUTPUT([HAVE_LIBNSL], [/* Define to 1 if you have the \`nsl' library (-lnsl). */
 #undef HAVE_LIBNSL])
-m4trace:configure.ac:362: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL])
-m4trace:configure.ac:363: -2- AC_CHECK_LIB([socket], [setsockopt])
-m4trace:configure.ac:363: -2- AH_OUTPUT([HAVE_LIBSOCKET], [/* Define to 1 if you have the \`socket' library (-lsocket). */
+m4trace:configure.ac:391: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBNSL])
+m4trace:configure.ac:392: -2- AC_CHECK_LIB([socket], [setsockopt])
+m4trace:configure.ac:392: -2- AH_OUTPUT([HAVE_LIBSOCKET], [/* Define to 1 if you have the \`socket' library (-lsocket). */
 #undef HAVE_LIBSOCKET])
-m4trace:configure.ac:363: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET])
-m4trace:configure.ac:368: -1- AC_CHECK_LIB([rpc], [innetgr], [LIBS="-lrpc -lyp -lrpc $LIBS" ], [], [-lyp -lrpc])
-m4trace:configure.ac:373: -2- AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])
-m4trace:configure.ac:415: -1- AC_CHECK_LIB([z], [deflate], [], [{ { echo "$as_me:$LINENO: error: *** zlib missing - please install first or check config.log ***" >&5
+m4trace:configure.ac:392: -2- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSOCKET])
+m4trace:configure.ac:397: -1- AC_CHECK_LIB([rpc], [innetgr], [LIBS="-lrpc -lyp -lrpc $LIBS" ], [], [-lyp -lrpc])
+m4trace:configure.ac:402: -2- AC_CHECK_LIB([gen], [getspnam], [LIBS="$LIBS -lgen"])
+m4trace:configure.ac:444: -1- AC_CHECK_LIB([z], [deflate], [], [{ { echo "$as_me:$LINENO: error: *** zlib missing - please install first or check config.log ***" >&5
 echo "$as_me: error: *** zlib missing - please install first or check config.log ***" >&2;}
    { (exit 1); exit 1; }; }])
-m4trace:configure.ac:415: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the \`z' library (-lz). */
+m4trace:configure.ac:444: -1- AH_OUTPUT([HAVE_LIBZ], [/* Define to 1 if you have the \`z' library (-lz). */
 #undef HAVE_LIBZ])
-m4trace:configure.ac:415: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
-m4trace:configure.ac:420: -1- AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"])
-m4trace:configure.ac:423: -1- AC_CHECK_LIB([c89], [utimes], [LIBS="$LIBS -lc89"])
-m4trace:configure.ac:426: -1- AC_CHECK_HEADERS([libutil.h])
-m4trace:configure.ac:426: -1- AH_OUTPUT([HAVE_LIBUTIL_H], [/* Define to 1 if you have the <libutil.h> header file. */
+m4trace:configure.ac:444: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBZ])
+m4trace:configure.ac:449: -1- AC_CHECK_LIB([resolv], [strcasecmp], [LIBS="$LIBS -lresolv"])
+m4trace:configure.ac:453: -1- AC_CHECK_LIB([c89], [utimes], [AC_DEFINE(HAVE_UTIMES)
+                                       LIBS="$LIBS -lc89"])
+m4trace:configure.ac:453: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UTIMES])
+m4trace:configure.ac:456: -1- AC_CHECK_HEADERS([libutil.h])
+m4trace:configure.ac:456: -1- AH_OUTPUT([HAVE_LIBUTIL_H], [/* Define to 1 if you have the <libutil.h> header file. */
 #undef HAVE_LIBUTIL_H])
-m4trace:configure.ac:427: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LOGIN])
-m4trace:configure.ac:428: -1- AC_CHECK_FUNCS([logout updwtmp logwtmp])
-m4trace:configure.ac:428: -1- AH_OUTPUT([HAVE_LOGOUT], [/* Define to 1 if you have the \`logout' function. */
+m4trace:configure.ac:457: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LOGIN])
+m4trace:configure.ac:458: -1- AC_CHECK_FUNCS([logout updwtmp logwtmp])
+m4trace:configure.ac:458: -1- AH_OUTPUT([HAVE_LOGOUT], [/* Define to 1 if you have the \`logout' function. */
 #undef HAVE_LOGOUT])
-m4trace:configure.ac:428: -1- AH_OUTPUT([HAVE_UPDWTMP], [/* Define to 1 if you have the \`updwtmp' function. */
+m4trace:configure.ac:458: -1- AH_OUTPUT([HAVE_UPDWTMP], [/* Define to 1 if you have the \`updwtmp' function. */
 #undef HAVE_UPDWTMP])
-m4trace:configure.ac:428: -1- AH_OUTPUT([HAVE_LOGWTMP], [/* Define to 1 if you have the \`logwtmp' function. */
+m4trace:configure.ac:458: -1- AH_OUTPUT([HAVE_LOGWTMP], [/* Define to 1 if you have the \`logwtmp' function. */
 #undef HAVE_LOGWTMP])
-m4trace:configure.ac:430: -1- AC_FUNC_STRFTIME
-m4trace:configure.ac:430: -1- AC_CHECK_FUNCS([strftime], [], [# strftime is in -lintl on SCO UNIX.
+m4trace:configure.ac:460: -1- AC_FUNC_STRFTIME
+m4trace:configure.ac:460: -1- AC_CHECK_FUNCS([strftime], [], [# strftime is in -lintl on SCO UNIX.
 AC_CHECK_LIB(intl, strftime,
              [AC_DEFINE(HAVE_STRFTIME)
 LIBS="-lintl $LIBS"])])
-m4trace:configure.ac:430: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the \`strftime' function. */
+m4trace:configure.ac:460: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the \`strftime' function. */
 #undef HAVE_STRFTIME])
-m4trace:configure.ac:430: -1- AC_CHECK_LIB([intl], [strftime], [AC_DEFINE(HAVE_STRFTIME)
+m4trace:configure.ac:460: -1- AC_CHECK_LIB([intl], [strftime], [AC_DEFINE(HAVE_STRFTIME)
 LIBS="-lintl $LIBS"])
-m4trace:configure.ac:430: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRFTIME])
-m4trace:configure.ac:448: -1- AC_DEFINE_TRACE_LITERAL([GLOB_HAS_ALTDIRFUNC])
-m4trace:configure.ac:464: -1- AC_DEFINE_TRACE_LITERAL([GLOB_HAS_GL_MATCHC])
-m4trace:configure.ac:478: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_ONE_BYTE_DIRENT_D_NAME])
-m4trace:configure.ac:511: -1- AC_DEFINE_TRACE_LITERAL([SKEY])
-m4trace:configure.ac:565: -1- AC_DEFINE_TRACE_LITERAL([LIBWRAP])
-m4trace:configure.ac:565: -1- AC_SUBST([LIBWRAP])
-m4trace:configure.ac:578: -1- AC_CHECK_FUNCS([arc4random b64_ntop bcopy bindresvport_sa \
+m4trace:configure.ac:460: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRFTIME])
+m4trace:configure.ac:478: -1- AC_DEFINE_TRACE_LITERAL([GLOB_HAS_ALTDIRFUNC])
+m4trace:configure.ac:494: -1- AC_DEFINE_TRACE_LITERAL([GLOB_HAS_GL_MATCHC])
+m4trace:configure.ac:508: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_ONE_BYTE_DIRENT_D_NAME])
+m4trace:configure.ac:541: -1- AC_DEFINE_TRACE_LITERAL([SKEY])
+m4trace:configure.ac:595: -1- AC_DEFINE_TRACE_LITERAL([LIBWRAP])
+m4trace:configure.ac:595: -1- AC_SUBST([LIBWRAP])
+m4trace:configure.ac:608: -1- 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 \
@@ -379,142 +410,143 @@ m4trace:configure.ac:578: -1- AC_CHECK_FUNCS([arc4random b64_ntop bcopy bindresv
        setrlimit setsid setpcred setvbuf sigaction sigvec snprintf \
        socketpair strerror strlcat strlcpy strmode strsep sysconf tcgetpgrp \
        truncate utimes vhangup vsnprintf waitpid __b64_ntop _getpty])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_ARC4RANDOM], [/* Define to 1 if you have the \`arc4random' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_ARC4RANDOM], [/* Define to 1 if you have the \`arc4random' function. */
 #undef HAVE_ARC4RANDOM])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_B64_NTOP], [/* Define to 1 if you have the \`b64_ntop' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_B64_NTOP], [/* Define to 1 if you have the \`b64_ntop' function. */
 #undef HAVE_B64_NTOP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the \`bcopy' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_BCOPY], [/* Define to 1 if you have the \`bcopy' function. */
 #undef HAVE_BCOPY])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_BINDRESVPORT_SA], [/* Define to 1 if you have the \`bindresvport_sa' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_BINDRESVPORT_SA], [/* Define to 1 if you have the \`bindresvport_sa' function. */
 #undef HAVE_BINDRESVPORT_SA])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_CLOCK], [/* Define to 1 if you have the \`clock' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_CLOCK], [/* Define to 1 if you have the \`clock' function. */
 #undef HAVE_CLOCK])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_FCHMOD], [/* Define to 1 if you have the \`fchmod' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_FCHMOD], [/* Define to 1 if you have the \`fchmod' function. */
 #undef HAVE_FCHMOD])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_FCHOWN], [/* Define to 1 if you have the \`fchown' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_FCHOWN], [/* Define to 1 if you have the \`fchown' function. */
 #undef HAVE_FCHOWN])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_FREEADDRINFO], [/* Define to 1 if you have the \`freeaddrinfo' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_FREEADDRINFO], [/* Define to 1 if you have the \`freeaddrinfo' function. */
 #undef HAVE_FREEADDRINFO])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_FUTIMES], [/* Define to 1 if you have the \`futimes' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_FUTIMES], [/* Define to 1 if you have the \`futimes' function. */
 #undef HAVE_FUTIMES])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GAI_STRERROR], [/* Define to 1 if you have the \`gai_strerror' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GAI_STRERROR], [/* Define to 1 if you have the \`gai_strerror' function. */
 #undef HAVE_GAI_STRERROR])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETADDRINFO], [/* Define to 1 if you have the \`getaddrinfo' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETADDRINFO], [/* Define to 1 if you have the \`getaddrinfo' function. */
 #undef HAVE_GETADDRINFO])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the \`getcwd' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETCWD], [/* Define to 1 if you have the \`getcwd' function. */
 #undef HAVE_GETCWD])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETGROUPLIST], [/* Define to 1 if you have the \`getgrouplist' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETGROUPLIST], [/* Define to 1 if you have the \`getgrouplist' function. */
 #undef HAVE_GETGROUPLIST])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETNAMEINFO], [/* Define to 1 if you have the \`getnameinfo' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETNAMEINFO], [/* Define to 1 if you have the \`getnameinfo' function. */
 #undef HAVE_GETNAMEINFO])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETOPT], [/* Define to 1 if you have the \`getopt' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETOPT], [/* Define to 1 if you have the \`getopt' function. */
 #undef HAVE_GETOPT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETRLIMIT], [/* Define to 1 if you have the \`getrlimit' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETPEEREID], [/* Define to 1 if you have the \`getpeereid' function. */
+#undef HAVE_GETPEEREID])
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETRLIMIT], [/* Define to 1 if you have the \`getrlimit' function. */
 #undef HAVE_GETRLIMIT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETRUSAGE], [/* Define to 1 if you have the \`getrusage' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETRUSAGE], [/* Define to 1 if you have the \`getrusage' function. */
 #undef HAVE_GETRUSAGE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GETTTYENT], [/* Define to 1 if you have the \`getttyent' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GETTTYENT], [/* Define to 1 if you have the \`getttyent' function. */
 #undef HAVE_GETTTYENT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_GLOB], [/* Define to 1 if you have the \`glob' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_GLOB], [/* Define to 1 if you have the \`glob' function. */
 #undef HAVE_GLOB])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_INET_ATON], [/* Define to 1 if you have the \`inet_aton' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_INET_ATON], [/* Define to 1 if you have the \`inet_aton' function. */
 #undef HAVE_INET_ATON])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_INET_NTOA], [/* Define to 1 if you have the \`inet_ntoa' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_INET_NTOA], [/* Define to 1 if you have the \`inet_ntoa' function. */
 #undef HAVE_INET_NTOA])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_INET_NTOP], [/* Define to 1 if you have the \`inet_ntop' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_INET_NTOP], [/* Define to 1 if you have the \`inet_ntop' function. */
 #undef HAVE_INET_NTOP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_INNETGR], [/* Define to 1 if you have the \`innetgr' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_INNETGR], [/* Define to 1 if you have the \`innetgr' function. */
 #undef HAVE_INNETGR])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_LOGIN_GETCAPBOOL], [/* Define to 1 if you have the \`login_getcapbool' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_LOGIN_GETCAPBOOL], [/* Define to 1 if you have the \`login_getcapbool' function. */
 #undef HAVE_LOGIN_GETCAPBOOL])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_MD5_CRYPT], [/* Define to 1 if you have the \`md5_crypt' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_MD5_CRYPT], [/* Define to 1 if you have the \`md5_crypt' function. */
 #undef HAVE_MD5_CRYPT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the \`memmove' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_MEMMOVE], [/* Define to 1 if you have the \`memmove' function. */
 #undef HAVE_MEMMOVE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_MKDTEMP], [/* Define to 1 if you have the \`mkdtemp' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_MKDTEMP], [/* Define to 1 if you have the \`mkdtemp' function. */
 #undef HAVE_MKDTEMP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_MMAP], [/* Define to 1 if you have the \`mmap' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_MMAP], [/* Define to 1 if you have the \`mmap' function. */
 #undef HAVE_MMAP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_NGETADDRINFO], [/* Define to 1 if you have the \`ngetaddrinfo' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_NGETADDRINFO], [/* Define to 1 if you have the \`ngetaddrinfo' function. */
 #undef HAVE_NGETADDRINFO])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_OPENPTY], [/* Define to 1 if you have the \`openpty' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_OPENPTY], [/* Define to 1 if you have the \`openpty' function. */
 #undef HAVE_OPENPTY])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_OGETADDRINFO], [/* Define to 1 if you have the \`ogetaddrinfo' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_OGETADDRINFO], [/* Define to 1 if you have the \`ogetaddrinfo' function. */
 #undef HAVE_OGETADDRINFO])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_READPASSPHRASE], [/* Define to 1 if you have the \`readpassphrase' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_READPASSPHRASE], [/* Define to 1 if you have the \`readpassphrase' function. */
 #undef HAVE_READPASSPHRASE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_REALPATH], [/* Define to 1 if you have the \`realpath' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_REALPATH], [/* Define to 1 if you have the \`realpath' function. */
 #undef HAVE_REALPATH])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_RECVMSG], [/* Define to 1 if you have the \`recvmsg' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_RECVMSG], [/* Define to 1 if you have the \`recvmsg' function. */
 #undef HAVE_RECVMSG])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_RRESVPORT_AF], [/* Define to 1 if you have the \`rresvport_af' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_RRESVPORT_AF], [/* Define to 1 if you have the \`rresvport_af' function. */
 #undef HAVE_RRESVPORT_AF])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SENDMSG], [/* Define to 1 if you have the \`sendmsg' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SENDMSG], [/* Define to 1 if you have the \`sendmsg' function. */
 #undef HAVE_SENDMSG])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETDTABLESIZE], [/* Define to 1 if you have the \`setdtablesize' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETDTABLESIZE], [/* Define to 1 if you have the \`setdtablesize' function. */
 #undef HAVE_SETDTABLESIZE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETEGID], [/* Define to 1 if you have the \`setegid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETEGID], [/* Define to 1 if you have the \`setegid' function. */
 #undef HAVE_SETEGID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETENV], [/* Define to 1 if you have the \`setenv' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETENV], [/* Define to 1 if you have the \`setenv' function. */
 #undef HAVE_SETENV])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETEUID], [/* Define to 1 if you have the \`seteuid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETEUID], [/* Define to 1 if you have the \`seteuid' function. */
 #undef HAVE_SETEUID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETGROUPS], [/* Define to 1 if you have the \`setgroups' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETGROUPS], [/* Define to 1 if you have the \`setgroups' function. */
 #undef HAVE_SETGROUPS])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETLOGIN], [/* Define to 1 if you have the \`setlogin' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETLOGIN], [/* Define to 1 if you have the \`setlogin' function. */
 #undef HAVE_SETLOGIN])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETPROCTITLE], [/* Define to 1 if you have the \`setproctitle' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETPROCTITLE], [/* Define to 1 if you have the \`setproctitle' function. */
 #undef HAVE_SETPROCTITLE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETRESGID], [/* Define to 1 if you have the \`setresgid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETRESGID], [/* Define to 1 if you have the \`setresgid' function. */
 #undef HAVE_SETRESGID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETREUID], [/* Define to 1 if you have the \`setreuid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETREUID], [/* Define to 1 if you have the \`setreuid' function. */
 #undef HAVE_SETREUID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETRLIMIT], [/* Define to 1 if you have the \`setrlimit' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETRLIMIT], [/* Define to 1 if you have the \`setrlimit' function. */
 #undef HAVE_SETRLIMIT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETSID], [/* Define to 1 if you have the \`setsid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETSID], [/* Define to 1 if you have the \`setsid' function. */
 #undef HAVE_SETSID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETPCRED], [/* Define to 1 if you have the \`setpcred' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETPCRED], [/* Define to 1 if you have the \`setpcred' function. */
 #undef HAVE_SETPCRED])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SETVBUF], [/* Define to 1 if you have the \`setvbuf' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SETVBUF], [/* Define to 1 if you have the \`setvbuf' function. */
 #undef HAVE_SETVBUF])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \`sigaction' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \`sigaction' function. */
 #undef HAVE_SIGACTION])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SIGVEC], [/* Define to 1 if you have the \`sigvec' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SIGVEC], [/* Define to 1 if you have the \`sigvec' function. */
 #undef HAVE_SIGVEC])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \`snprintf' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \`snprintf' function. */
 #undef HAVE_SNPRINTF])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SOCKETPAIR], [/* Define to 1 if you have the \`socketpair' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SOCKETPAIR], [/* Define to 1 if you have the \`socketpair' function. */
 #undef HAVE_SOCKETPAIR])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the \`strerror' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_STRERROR], [/* Define to 1 if you have the \`strerror' function. */
 #undef HAVE_STRERROR])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_STRLCAT], [/* Define to 1 if you have the \`strlcat' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_STRLCAT], [/* Define to 1 if you have the \`strlcat' function. */
 #undef HAVE_STRLCAT])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_STRLCPY], [/* Define to 1 if you have the \`strlcpy' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_STRLCPY], [/* Define to 1 if you have the \`strlcpy' function. */
 #undef HAVE_STRLCPY])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_STRMODE], [/* Define to 1 if you have the \`strmode' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_STRMODE], [/* Define to 1 if you have the \`strmode' function. */
 #undef HAVE_STRMODE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_STRSEP], [/* Define to 1 if you have the \`strsep' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_STRSEP], [/* Define to 1 if you have the \`strsep' function. */
 #undef HAVE_STRSEP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_SYSCONF], [/* Define to 1 if you have the \`sysconf' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_SYSCONF], [/* Define to 1 if you have the \`sysconf' function. */
 #undef HAVE_SYSCONF])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_TCGETPGRP], [/* Define to 1 if you have the \`tcgetpgrp' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_TCGETPGRP], [/* Define to 1 if you have the \`tcgetpgrp' function. */
 #undef HAVE_TCGETPGRP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_TRUNCATE], [/* Define to 1 if you have the \`truncate' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_TRUNCATE], [/* Define to 1 if you have the \`truncate' function. */
 #undef HAVE_TRUNCATE])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_UTIMES], [/* Define to 1 if you have the \`utimes' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_UTIMES], [/* Define to 1 if you have the \`utimes' function. */
 #undef HAVE_UTIMES])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_VHANGUP], [/* Define to 1 if you have the \`vhangup' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_VHANGUP], [/* Define to 1 if you have the \`vhangup' function. */
 #undef HAVE_VHANGUP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_VSNPRINTF], [/* Define to 1 if you have the \`vsnprintf' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_VSNPRINTF], [/* Define to 1 if you have the \`vsnprintf' function. */
 #undef HAVE_VSNPRINTF])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE_WAITPID], [/* Define to 1 if you have the \`waitpid' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE_WAITPID], [/* Define to 1 if you have the \`waitpid' function. */
 #undef HAVE_WAITPID])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE___B64_NTOP], [/* Define to 1 if you have the \`__b64_ntop' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE___B64_NTOP], [/* Define to 1 if you have the \`__b64_ntop' function. */
 #undef HAVE___B64_NTOP])
-m4trace:configure.ac:578: -1- AH_OUTPUT([HAVE__GETPTY], [/* Define to 1 if you have the \`_getpty' function. */
+m4trace:configure.ac:608: -1- AH_OUTPUT([HAVE__GETPTY], [/* Define to 1 if you have the \`_getpty' function. */
 #undef HAVE__GETPTY])
-m4trace:configure.ac:601: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MMAP_ANON_SHARED])
-m4trace:configure.ac:639: -1- AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS(libgen.h) ], [
+m4trace:configure.ac:645: -1- AC_CHECK_FUNCS([dirname], [AC_CHECK_HEADERS(libgen.h) ], [
        AC_CHECK_LIB(gen, dirname,[
                AC_CACHE_CHECK([for broken dirname],
                        ac_cv_have_broken_dirname, [
@@ -549,12 +581,12 @@ int main(int argc, char **argv) {
                fi
        ])
 ])
-m4trace:configure.ac:639: -1- AH_OUTPUT([HAVE_DIRNAME], [/* Define to 1 if you have the \`dirname' function. */
+m4trace:configure.ac:645: -1- AH_OUTPUT([HAVE_DIRNAME], [/* Define to 1 if you have the \`dirname' function. */
 #undef HAVE_DIRNAME])
-m4trace:configure.ac:639: -1- AC_CHECK_HEADERS([libgen.h])
-m4trace:configure.ac:639: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the <libgen.h> header file. */
+m4trace:configure.ac:645: -1- AC_CHECK_HEADERS([libgen.h])
+m4trace:configure.ac:645: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the <libgen.h> header file. */
 #undef HAVE_LIBGEN_H])
-m4trace:configure.ac:639: -1- AC_CHECK_LIB([gen], [dirname], [
+m4trace:configure.ac:645: -1- AC_CHECK_LIB([gen], [dirname], [
                AC_CACHE_CHECK([for broken dirname],
                        ac_cv_have_broken_dirname, [
                        save_LIBS="$LIBS"
@@ -587,285 +619,287 @@ int main(int argc, char **argv) {
                        AC_CHECK_HEADERS(libgen.h)
                fi
        ])
-m4trace:configure.ac:639: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DIRNAME])
-m4trace:configure.ac:639: -1- AC_CHECK_HEADERS([libgen.h])
-m4trace:configure.ac:639: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the <libgen.h> header file. */
+m4trace:configure.ac:645: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DIRNAME])
+m4trace:configure.ac:645: -1- AC_CHECK_HEADERS([libgen.h])
+m4trace:configure.ac:645: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the <libgen.h> header file. */
 #undef HAVE_LIBGEN_H])
-m4trace:configure.ac:642: -1- AC_CHECK_FUNCS([gettimeofday time])
-m4trace:configure.ac:642: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \`gettimeofday' function. */
+m4trace:configure.ac:648: -1- AC_CHECK_FUNCS([gettimeofday time])
+m4trace:configure.ac:648: -1- AH_OUTPUT([HAVE_GETTIMEOFDAY], [/* Define to 1 if you have the \`gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY])
-m4trace:configure.ac:642: -1- AH_OUTPUT([HAVE_TIME], [/* Define to 1 if you have the \`time' function. */
+m4trace:configure.ac:648: -1- AH_OUTPUT([HAVE_TIME], [/* Define to 1 if you have the \`time' function. */
 #undef HAVE_TIME])
-m4trace:configure.ac:644: -1- AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_ENDUTENT], [/* Define to 1 if you have the \`endutent' function. */
+m4trace:configure.ac:650: -1- AC_CHECK_FUNCS([endutent getutent getutid getutline pututline setutent])
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_ENDUTENT], [/* Define to 1 if you have the \`endutent' function. */
 #undef HAVE_ENDUTENT])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_GETUTENT], [/* Define to 1 if you have the \`getutent' function. */
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_GETUTENT], [/* Define to 1 if you have the \`getutent' function. */
 #undef HAVE_GETUTENT])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_GETUTID], [/* Define to 1 if you have the \`getutid' function. */
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_GETUTID], [/* Define to 1 if you have the \`getutid' function. */
 #undef HAVE_GETUTID])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_GETUTLINE], [/* Define to 1 if you have the \`getutline' function. */
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_GETUTLINE], [/* Define to 1 if you have the \`getutline' function. */
 #undef HAVE_GETUTLINE])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_PUTUTLINE], [/* Define to 1 if you have the \`pututline' function. */
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_PUTUTLINE], [/* Define to 1 if you have the \`pututline' function. */
 #undef HAVE_PUTUTLINE])
-m4trace:configure.ac:644: -1- AH_OUTPUT([HAVE_SETUTENT], [/* Define to 1 if you have the \`setutent' function. */
+m4trace:configure.ac:650: -1- AH_OUTPUT([HAVE_SETUTENT], [/* Define to 1 if you have the \`setutent' function. */
 #undef HAVE_SETUTENT])
-m4trace:configure.ac:645: -1- AC_CHECK_FUNCS([utmpname])
-m4trace:configure.ac:645: -1- AH_OUTPUT([HAVE_UTMPNAME], [/* Define to 1 if you have the \`utmpname' function. */
+m4trace:configure.ac:651: -1- AC_CHECK_FUNCS([utmpname])
+m4trace:configure.ac:651: -1- AH_OUTPUT([HAVE_UTMPNAME], [/* Define to 1 if you have the \`utmpname' function. */
 #undef HAVE_UTMPNAME])
-m4trace:configure.ac:647: -1- AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline pututxline ])
-m4trace:configure.ac:647: -1- AH_OUTPUT([HAVE_ENDUTXENT], [/* Define to 1 if you have the \`endutxent' function. */
+m4trace:configure.ac:653: -1- AC_CHECK_FUNCS([endutxent getutxent getutxid getutxline pututxline ])
+m4trace:configure.ac:653: -1- AH_OUTPUT([HAVE_ENDUTXENT], [/* Define to 1 if you have the \`endutxent' function. */
 #undef HAVE_ENDUTXENT])
-m4trace:configure.ac:647: -1- AH_OUTPUT([HAVE_GETUTXENT], [/* Define to 1 if you have the \`getutxent' function. */
+m4trace:configure.ac:653: -1- AH_OUTPUT([HAVE_GETUTXENT], [/* Define to 1 if you have the \`getutxent' function. */
 #undef HAVE_GETUTXENT])
-m4trace:configure.ac:647: -1- AH_OUTPUT([HAVE_GETUTXID], [/* Define to 1 if you have the \`getutxid' function. */
+m4trace:configure.ac:653: -1- AH_OUTPUT([HAVE_GETUTXID], [/* Define to 1 if you have the \`getutxid' function. */
 #undef HAVE_GETUTXID])
-m4trace:configure.ac:647: -1- AH_OUTPUT([HAVE_GETUTXLINE], [/* Define to 1 if you have the \`getutxline' function. */
+m4trace:configure.ac:653: -1- AH_OUTPUT([HAVE_GETUTXLINE], [/* Define to 1 if you have the \`getutxline' function. */
 #undef HAVE_GETUTXLINE])
-m4trace:configure.ac:647: -1- AH_OUTPUT([HAVE_PUTUTXLINE], [/* Define to 1 if you have the \`pututxline' function. */
+m4trace:configure.ac:653: -1- AH_OUTPUT([HAVE_PUTUTXLINE], [/* Define to 1 if you have the \`pututxline' function. */
 #undef HAVE_PUTUTXLINE])
-m4trace:configure.ac:648: -1- AC_CHECK_FUNCS([setutxent utmpxname])
-m4trace:configure.ac:648: -1- AH_OUTPUT([HAVE_SETUTXENT], [/* Define to 1 if you have the \`setutxent' function. */
+m4trace:configure.ac:654: -1- AC_CHECK_FUNCS([setutxent utmpxname])
+m4trace:configure.ac:654: -1- AH_OUTPUT([HAVE_SETUTXENT], [/* Define to 1 if you have the \`setutxent' function. */
 #undef HAVE_SETUTXENT])
-m4trace:configure.ac:648: -1- AH_OUTPUT([HAVE_UTMPXNAME], [/* Define to 1 if you have the \`utmpxname' function. */
+m4trace:configure.ac:654: -1- AH_OUTPUT([HAVE_UTMPXNAME], [/* Define to 1 if you have the \`utmpxname' function. */
 #undef HAVE_UTMPXNAME])
-m4trace:configure.ac:653: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DAEMON])
-m4trace:configure.ac:653: -1- AC_CHECK_LIB([bsd], [daemon], [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])
-m4trace:configure.ac:653: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DAEMON])
-m4trace:configure.ac:658: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE])
-m4trace:configure.ac:658: -1- AC_CHECK_LIB([ucb], [getpagesize], [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])
-m4trace:configure.ac:658: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE])
-m4trace:configure.ac:674: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SNPRINTF])
-m4trace:configure.ac:677: -1- AC_FUNC_GETPGRP
-m4trace:configure.ac:677: -1- AC_DEFINE_TRACE_LITERAL([GETPGRP_VOID])
-m4trace:configure.ac:677: -1- AH_OUTPUT([GETPGRP_VOID], [/* Define to 1 if the \`getpgrp' function requires zero arguments. */
+m4trace:configure.ac:659: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DAEMON])
+m4trace:configure.ac:659: -1- AC_CHECK_LIB([bsd], [daemon], [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])
+m4trace:configure.ac:659: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DAEMON])
+m4trace:configure.ac:664: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE])
+m4trace:configure.ac:664: -1- AC_CHECK_LIB([ucb], [getpagesize], [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])
+m4trace:configure.ac:664: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETPAGESIZE])
+m4trace:configure.ac:680: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SNPRINTF])
+m4trace:configure.ac:683: -1- AC_FUNC_GETPGRP
+m4trace:configure.ac:683: -1- AC_DEFINE_TRACE_LITERAL([GETPGRP_VOID])
+m4trace:configure.ac:683: -1- AH_OUTPUT([GETPGRP_VOID], [/* Define to 1 if the \`getpgrp' function requires zero arguments. */
 #undef GETPGRP_VOID])
-m4trace:configure.ac:705: -1- AC_CHECK_LIB([dl], [dlopen], [], [])
-m4trace:configure.ac:705: -1- AH_OUTPUT([HAVE_LIBDL], [/* Define to 1 if you have the \`dl' library (-ldl). */
+m4trace:configure.ac:711: -1- AC_CHECK_LIB([dl], [dlopen], [], [])
+m4trace:configure.ac:711: -1- AH_OUTPUT([HAVE_LIBDL], [/* Define to 1 if you have the \`dl' library (-ldl). */
 #undef HAVE_LIBDL])
-m4trace:configure.ac:705: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDL])
-m4trace:configure.ac:705: -1- AC_CHECK_LIB([pam], [pam_set_item], [], [{ { echo "$as_me:$LINENO: error: *** libpam missing" >&5
+m4trace:configure.ac:711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDL])
+m4trace:configure.ac:711: -1- AC_CHECK_LIB([pam], [pam_set_item], [], [{ { echo "$as_me:$LINENO: error: *** libpam missing" >&5
 echo "$as_me: error: *** libpam missing" >&2;}
    { (exit 1); exit 1; }; }])
-m4trace:configure.ac:705: -1- AH_OUTPUT([HAVE_LIBPAM], [/* Define to 1 if you have the \`pam' library (-lpam). */
+m4trace:configure.ac:711: -1- AH_OUTPUT([HAVE_LIBPAM], [/* Define to 1 if you have the \`pam' library (-lpam). */
 #undef HAVE_LIBPAM])
-m4trace:configure.ac:705: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBPAM])
-m4trace:configure.ac:705: -1- AC_CHECK_FUNCS([pam_getenvlist])
-m4trace:configure.ac:705: -1- AH_OUTPUT([HAVE_PAM_GETENVLIST], [/* Define to 1 if you have the \`pam_getenvlist' function. */
+m4trace:configure.ac:711: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBPAM])
+m4trace:configure.ac:711: -1- AC_CHECK_FUNCS([pam_getenvlist])
+m4trace:configure.ac:711: -1- AH_OUTPUT([HAVE_PAM_GETENVLIST], [/* Define to 1 if you have the \`pam_getenvlist' function. */
 #undef HAVE_PAM_GETENVLIST])
-m4trace:configure.ac:705: -1- AC_DEFINE_TRACE_LITERAL([USE_PAM])
-m4trace:configure.ac:705: -1- AC_SUBST([LIBPAM])
-m4trace:configure.ac:723: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OLD_PAM])
-m4trace:configure.ac:755: -2- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL])
-m4trace:configure.ac:770: -2- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL])
-m4trace:configure.ac:793: -1- AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
-m4trace:configure.ac:841: -1- AC_DEFINE_TRACE_LITERAL([OPENSSL_PRNG_ONLY])
-m4trace:configure.ac:849: -1- AC_SUBST([INSTALL_SSH_RAND_HELPER])
-m4trace:configure.ac:872: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_PORT])
-m4trace:configure.ac:922: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_SOCKET])
-m4trace:configure.ac:922: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_SOCKET])
-m4trace:configure.ac:934: -1- AC_DEFINE_TRACE_LITERAL([ENTROPY_TIMEOUT_MSEC])
-m4trace:configure.ac:945: -1- AC_DEFINE_TRACE_LITERAL([SSH_PRIVSEP_USER])
-m4trace:configure.ac:946: -1- AC_SUBST([SSH_PRIVSEP_USER])
-m4trace:configure.ac:963: -1- AC_SUBST([PROG_LS], [$ac_cv_path_PROG_LS])
-m4trace:configure.ac:963: -1- AC_SUBST([PROG_LS])
-m4trace:configure.ac:964: -1- AC_SUBST([PROG_NETSTAT], [$ac_cv_path_PROG_NETSTAT])
-m4trace:configure.ac:964: -1- AC_SUBST([PROG_NETSTAT])
-m4trace:configure.ac:965: -1- AC_SUBST([PROG_ARP], [$ac_cv_path_PROG_ARP])
-m4trace:configure.ac:965: -1- AC_SUBST([PROG_ARP])
-m4trace:configure.ac:966: -1- AC_SUBST([PROG_IFCONFIG], [$ac_cv_path_PROG_IFCONFIG])
-m4trace:configure.ac:966: -1- AC_SUBST([PROG_IFCONFIG])
-m4trace:configure.ac:967: -1- AC_SUBST([PROG_JSTAT], [$ac_cv_path_PROG_JSTAT])
-m4trace:configure.ac:967: -1- AC_SUBST([PROG_JSTAT])
-m4trace:configure.ac:968: -1- AC_SUBST([PROG_PS], [$ac_cv_path_PROG_PS])
-m4trace:configure.ac:968: -1- AC_SUBST([PROG_PS])
-m4trace:configure.ac:969: -1- AC_SUBST([PROG_SAR], [$ac_cv_path_PROG_SAR])
-m4trace:configure.ac:969: -1- AC_SUBST([PROG_SAR])
-m4trace:configure.ac:970: -1- AC_SUBST([PROG_W], [$ac_cv_path_PROG_W])
-m4trace:configure.ac:970: -1- AC_SUBST([PROG_W])
-m4trace:configure.ac:971: -1- AC_SUBST([PROG_WHO], [$ac_cv_path_PROG_WHO])
-m4trace:configure.ac:971: -1- AC_SUBST([PROG_WHO])
-m4trace:configure.ac:972: -1- AC_SUBST([PROG_LAST], [$ac_cv_path_PROG_LAST])
-m4trace:configure.ac:972: -1- AC_SUBST([PROG_LAST])
-m4trace:configure.ac:973: -1- AC_SUBST([PROG_LASTLOG], [$ac_cv_path_PROG_LASTLOG])
-m4trace:configure.ac:973: -1- AC_SUBST([PROG_LASTLOG])
-m4trace:configure.ac:974: -1- AC_SUBST([PROG_DF], [$ac_cv_path_PROG_DF])
-m4trace:configure.ac:974: -1- AC_SUBST([PROG_DF])
-m4trace:configure.ac:975: -1- AC_SUBST([PROG_VMSTAT], [$ac_cv_path_PROG_VMSTAT])
-m4trace:configure.ac:975: -1- AC_SUBST([PROG_VMSTAT])
-m4trace:configure.ac:976: -1- AC_SUBST([PROG_UPTIME], [$ac_cv_path_PROG_UPTIME])
-m4trace:configure.ac:976: -1- AC_SUBST([PROG_UPTIME])
-m4trace:configure.ac:977: -1- AC_SUBST([PROG_IPCS], [$ac_cv_path_PROG_IPCS])
-m4trace:configure.ac:977: -1- AC_SUBST([PROG_IPCS])
-m4trace:configure.ac:978: -1- AC_SUBST([PROG_TAIL], [$ac_cv_path_PROG_TAIL])
-m4trace:configure.ac:978: -1- AC_SUBST([PROG_TAIL])
-m4trace:configure.ac:995: -1- AC_SUBST([INSTALL_SSH_PRNG_CMDS])
-m4trace:configure.ac:1004: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_CHAR])
-m4trace:configure.ac:1004: -1- AH_OUTPUT([SIZEOF_CHAR], [/* The size of a \`char', as computed by sizeof. */
+m4trace:configure.ac:711: -1- AC_DEFINE_TRACE_LITERAL([USE_PAM])
+m4trace:configure.ac:711: -1- AC_SUBST([LIBPAM])
+m4trace:configure.ac:729: -1- AC_DEFINE_TRACE_LITERAL([HAVE_OLD_PAM])
+m4trace:configure.ac:735: -1- AC_CHECK_LIB([crypt], [crypt])
+m4trace:configure.ac:735: -1- AH_OUTPUT([HAVE_LIBCRYPT], [/* Define to 1 if you have the \`crypt' library (-lcrypt). */
+#undef HAVE_LIBCRYPT])
+m4trace:configure.ac:735: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBCRYPT])
+m4trace:configure.ac:767: -2- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL])
+m4trace:configure.ac:782: -2- AC_DEFINE_TRACE_LITERAL([HAVE_OPENSSL])
+m4trace:configure.ac:869: -1- AC_CHECK_LIB([crypt], [crypt], [LIBS="$LIBS -lcrypt"])
+m4trace:configure.ac:917: -1- AC_DEFINE_TRACE_LITERAL([OPENSSL_PRNG_ONLY])
+m4trace:configure.ac:925: -1- AC_SUBST([INSTALL_SSH_RAND_HELPER])
+m4trace:configure.ac:948: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_PORT])
+m4trace:configure.ac:998: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_SOCKET])
+m4trace:configure.ac:998: -1- AC_DEFINE_TRACE_LITERAL([PRNGD_SOCKET])
+m4trace:configure.ac:1010: -1- AC_DEFINE_TRACE_LITERAL([ENTROPY_TIMEOUT_MSEC])
+m4trace:configure.ac:1021: -1- AC_DEFINE_TRACE_LITERAL([SSH_PRIVSEP_USER])
+m4trace:configure.ac:1022: -1- AC_SUBST([SSH_PRIVSEP_USER])
+m4trace:configure.ac:1039: -1- AC_SUBST([PROG_LS], [$ac_cv_path_PROG_LS])
+m4trace:configure.ac:1039: -1- AC_SUBST([PROG_LS])
+m4trace:configure.ac:1040: -1- AC_SUBST([PROG_NETSTAT], [$ac_cv_path_PROG_NETSTAT])
+m4trace:configure.ac:1040: -1- AC_SUBST([PROG_NETSTAT])
+m4trace:configure.ac:1041: -1- AC_SUBST([PROG_ARP], [$ac_cv_path_PROG_ARP])
+m4trace:configure.ac:1041: -1- AC_SUBST([PROG_ARP])
+m4trace:configure.ac:1042: -1- AC_SUBST([PROG_IFCONFIG], [$ac_cv_path_PROG_IFCONFIG])
+m4trace:configure.ac:1042: -1- AC_SUBST([PROG_IFCONFIG])
+m4trace:configure.ac:1043: -1- AC_SUBST([PROG_JSTAT], [$ac_cv_path_PROG_JSTAT])
+m4trace:configure.ac:1043: -1- AC_SUBST([PROG_JSTAT])
+m4trace:configure.ac:1044: -1- AC_SUBST([PROG_PS], [$ac_cv_path_PROG_PS])
+m4trace:configure.ac:1044: -1- AC_SUBST([PROG_PS])
+m4trace:configure.ac:1045: -1- AC_SUBST([PROG_SAR], [$ac_cv_path_PROG_SAR])
+m4trace:configure.ac:1045: -1- AC_SUBST([PROG_SAR])
+m4trace:configure.ac:1046: -1- AC_SUBST([PROG_W], [$ac_cv_path_PROG_W])
+m4trace:configure.ac:1046: -1- AC_SUBST([PROG_W])
+m4trace:configure.ac:1047: -1- AC_SUBST([PROG_WHO], [$ac_cv_path_PROG_WHO])
+m4trace:configure.ac:1047: -1- AC_SUBST([PROG_WHO])
+m4trace:configure.ac:1048: -1- AC_SUBST([PROG_LAST], [$ac_cv_path_PROG_LAST])
+m4trace:configure.ac:1048: -1- AC_SUBST([PROG_LAST])
+m4trace:configure.ac:1049: -1- AC_SUBST([PROG_LASTLOG], [$ac_cv_path_PROG_LASTLOG])
+m4trace:configure.ac:1049: -1- AC_SUBST([PROG_LASTLOG])
+m4trace:configure.ac:1050: -1- AC_SUBST([PROG_DF], [$ac_cv_path_PROG_DF])
+m4trace:configure.ac:1050: -1- AC_SUBST([PROG_DF])
+m4trace:configure.ac:1051: -1- AC_SUBST([PROG_VMSTAT], [$ac_cv_path_PROG_VMSTAT])
+m4trace:configure.ac:1051: -1- AC_SUBST([PROG_VMSTAT])
+m4trace:configure.ac:1052: -1- AC_SUBST([PROG_UPTIME], [$ac_cv_path_PROG_UPTIME])
+m4trace:configure.ac:1052: -1- AC_SUBST([PROG_UPTIME])
+m4trace:configure.ac:1053: -1- AC_SUBST([PROG_IPCS], [$ac_cv_path_PROG_IPCS])
+m4trace:configure.ac:1053: -1- AC_SUBST([PROG_IPCS])
+m4trace:configure.ac:1054: -1- AC_SUBST([PROG_TAIL], [$ac_cv_path_PROG_TAIL])
+m4trace:configure.ac:1054: -1- AC_SUBST([PROG_TAIL])
+m4trace:configure.ac:1071: -1- AC_SUBST([INSTALL_SSH_PRNG_CMDS])
+m4trace:configure.ac:1080: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_CHAR])
+m4trace:configure.ac:1080: -1- AH_OUTPUT([SIZEOF_CHAR], [/* The size of a \`char', as computed by sizeof. */
 #undef SIZEOF_CHAR])
-m4trace:configure.ac:1005: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT_INT])
-m4trace:configure.ac:1005: -1- AH_OUTPUT([SIZEOF_SHORT_INT], [/* The size of a \`short int', as computed by sizeof. */
+m4trace:configure.ac:1081: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_SHORT_INT])
+m4trace:configure.ac:1081: -1- AH_OUTPUT([SIZEOF_SHORT_INT], [/* The size of a \`short int', as computed by sizeof. */
 #undef SIZEOF_SHORT_INT])
-m4trace:configure.ac:1006: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
-m4trace:configure.ac:1006: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a \`int', as computed by sizeof. */
+m4trace:configure.ac:1082: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_INT])
+m4trace:configure.ac:1082: -1- AH_OUTPUT([SIZEOF_INT], [/* The size of a \`int', as computed by sizeof. */
 #undef SIZEOF_INT])
-m4trace:configure.ac:1007: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_INT])
-m4trace:configure.ac:1007: -1- AH_OUTPUT([SIZEOF_LONG_INT], [/* The size of a \`long int', as computed by sizeof. */
+m4trace:configure.ac:1083: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_INT])
+m4trace:configure.ac:1083: -1- AH_OUTPUT([SIZEOF_LONG_INT], [/* The size of a \`long int', as computed by sizeof. */
 #undef SIZEOF_LONG_INT])
-m4trace:configure.ac:1008: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG_INT])
-m4trace:configure.ac:1008: -1- AH_OUTPUT([SIZEOF_LONG_LONG_INT], [/* The size of a \`long long int', as computed by sizeof. */
+m4trace:configure.ac:1084: -1- AC_DEFINE_TRACE_LITERAL([SIZEOF_LONG_LONG_INT])
+m4trace:configure.ac:1084: -1- AH_OUTPUT([SIZEOF_LONG_LONG_INT], [/* The size of a \`long long int', as computed by sizeof. */
 #undef SIZEOF_LONG_LONG_INT])
-m4trace:configure.ac:1025: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT])
-m4trace:configure.ac:1038: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
-m4trace:configure.ac:1054: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
-m4trace:configure.ac:1066: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT64_T])
-m4trace:configure.ac:1080: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT64_T])
-m4trace:configure.ac:1093: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT64_T])
-m4trace:configure.ac:1105: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
-m4trace:configure.ac:1119: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
-m4trace:configure.ac:1131: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT64_T])
-m4trace:configure.ac:1145: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT64_T])
-m4trace:configure.ac:1160: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINTXX_T])
-m4trace:configure.ac:1174: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINTXX_T])
-m4trace:configure.ac:1196: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
-m4trace:configure.ac:1196: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
-m4trace:configure.ac:1211: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_CHAR])
-m4trace:configure.ac:1214: -1- AC_DEFINE_TRACE_LITERAL([socklen_t])
-m4trace:configure.ac:1214: -1- AH_OUTPUT([socklen_t], [/* type to use in place of socklen_t if not defined */
+m4trace:configure.ac:1101: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT])
+m4trace:configure.ac:1114: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
+m4trace:configure.ac:1130: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
+m4trace:configure.ac:1151: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INT64_T])
+m4trace:configure.ac:1163: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
+m4trace:configure.ac:1177: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
+m4trace:configure.ac:1189: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT64_T])
+m4trace:configure.ac:1203: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INT64_T])
+m4trace:configure.ac:1218: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINTXX_T])
+m4trace:configure.ac:1232: -1- AC_DEFINE_TRACE_LITERAL([HAVE_UINTXX_T])
+m4trace:configure.ac:1254: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_INTXX_T])
+m4trace:configure.ac:1254: -1- AC_DEFINE_TRACE_LITERAL([HAVE_INTXX_T])
+m4trace:configure.ac:1269: -1- AC_DEFINE_TRACE_LITERAL([HAVE_U_CHAR])
+m4trace:configure.ac:1272: -1- AC_DEFINE_TRACE_LITERAL([socklen_t])
+m4trace:configure.ac:1272: -1- AH_OUTPUT([socklen_t], [/* type to use in place of socklen_t if not defined */
 #undef socklen_t])
-m4trace:configure.ac:1216: -1- AC_CHECK_TYPES([sig_atomic_t], [], [], [#include <signal.h>])
-m4trace:configure.ac:1216: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIG_ATOMIC_T])
-m4trace:configure.ac:1216: -1- AH_OUTPUT([HAVE_SIG_ATOMIC_T], [/* Define to 1 if the system has the type \`sig_atomic_t'. */
+m4trace:configure.ac:1274: -1- AC_CHECK_TYPES([sig_atomic_t], [], [], [#include <signal.h>])
+m4trace:configure.ac:1274: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIG_ATOMIC_T])
+m4trace:configure.ac:1274: -1- AH_OUTPUT([HAVE_SIG_ATOMIC_T], [/* Define to 1 if the system has the type \`sig_atomic_t'. */
 #undef HAVE_SIG_ATOMIC_T])
-m4trace:configure.ac:1229: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIZE_T])
-m4trace:configure.ac:1243: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SSIZE_T])
-m4trace:configure.ac:1257: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_T])
-m4trace:configure.ac:1282: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SA_FAMILY_T])
-m4trace:configure.ac:1296: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PID_T])
-m4trace:configure.ac:1310: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MODE_T])
-m4trace:configure.ac:1326: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE])
-m4trace:configure.ac:1341: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN6])
-m4trace:configure.ac:1356: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_IN6_ADDR])
-m4trace:configure.ac:1372: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_ADDRINFO])
-m4trace:configure.ac:1384: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_TIMEVAL])
-m4trace:configure.ac:1421: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SNPRINTF])
-m4trace:configure.ac:1423: -1- AC_SUBST([NO_SFTP])
-m4trace:configure.ac:1426: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HOST_IN_UTMP])
-m4trace:configure.ac:1427: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HOST_IN_UTMPX])
-m4trace:configure.ac:1428: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLEN_IN_UTMPX])
-m4trace:configure.ac:1429: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PID_IN_UTMP])
-m4trace:configure.ac:1430: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_IN_UTMP])
-m4trace:configure.ac:1431: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_IN_UTMPX])
-m4trace:configure.ac:1432: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TV_IN_UTMP])
-m4trace:configure.ac:1433: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ID_IN_UTMP])
-m4trace:configure.ac:1434: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ID_IN_UTMPX])
-m4trace:configure.ac:1435: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_IN_UTMP])
-m4trace:configure.ac:1436: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_IN_UTMPX])
-m4trace:configure.ac:1437: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_V6_IN_UTMP])
-m4trace:configure.ac:1438: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_V6_IN_UTMPX])
-m4trace:configure.ac:1439: -1- AC_DEFINE_TRACE_LITERAL([HAVE_EXIT_IN_UTMP])
-m4trace:configure.ac:1440: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_IN_UTMP])
-m4trace:configure.ac:1441: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_IN_UTMPX])
-m4trace:configure.ac:1442: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TV_IN_UTMPX])
-m4trace:configure.ac:1444: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BLKSIZE])
-m4trace:configure.ac:1444: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BLKSIZE], [/* Define to 1 if \`st_blksize' is member of \`struct stat'. */
+m4trace:configure.ac:1287: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SIZE_T])
+m4trace:configure.ac:1301: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SSIZE_T])
+m4trace:configure.ac:1315: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CLOCK_T])
+m4trace:configure.ac:1340: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SA_FAMILY_T])
+m4trace:configure.ac:1354: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PID_T])
+m4trace:configure.ac:1368: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MODE_T])
+m4trace:configure.ac:1384: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_STORAGE])
+m4trace:configure.ac:1399: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_SOCKADDR_IN6])
+m4trace:configure.ac:1414: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_IN6_ADDR])
+m4trace:configure.ac:1430: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_ADDRINFO])
+m4trace:configure.ac:1442: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_TIMEVAL])
+m4trace:configure.ac:1479: -1- AC_DEFINE_TRACE_LITERAL([BROKEN_SNPRINTF])
+m4trace:configure.ac:1481: -1- AC_SUBST([NO_SFTP])
+m4trace:configure.ac:1484: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HOST_IN_UTMP])
+m4trace:configure.ac:1485: -1- AC_DEFINE_TRACE_LITERAL([HAVE_HOST_IN_UTMPX])
+m4trace:configure.ac:1486: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYSLEN_IN_UTMPX])
+m4trace:configure.ac:1487: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PID_IN_UTMP])
+m4trace:configure.ac:1488: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_IN_UTMP])
+m4trace:configure.ac:1489: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TYPE_IN_UTMPX])
+m4trace:configure.ac:1490: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TV_IN_UTMP])
+m4trace:configure.ac:1491: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ID_IN_UTMP])
+m4trace:configure.ac:1492: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ID_IN_UTMPX])
+m4trace:configure.ac:1493: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_IN_UTMP])
+m4trace:configure.ac:1494: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_IN_UTMPX])
+m4trace:configure.ac:1495: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_V6_IN_UTMP])
+m4trace:configure.ac:1496: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ADDR_V6_IN_UTMPX])
+m4trace:configure.ac:1497: -1- AC_DEFINE_TRACE_LITERAL([HAVE_EXIT_IN_UTMP])
+m4trace:configure.ac:1498: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_IN_UTMP])
+m4trace:configure.ac:1499: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TIME_IN_UTMPX])
+m4trace:configure.ac:1500: -1- AC_DEFINE_TRACE_LITERAL([HAVE_TV_IN_UTMPX])
+m4trace:configure.ac:1502: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_BLKSIZE])
+m4trace:configure.ac:1502: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_BLKSIZE], [/* Define to 1 if \`st_blksize' is member of \`struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE])
-m4trace:configure.ac:1459: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SS_FAMILY_IN_SS])
-m4trace:configure.ac:1475: -1- AC_DEFINE_TRACE_LITERAL([HAVE___SS_FAMILY_IN_SS])
-m4trace:configure.ac:1490: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_CLASS_IN_PASSWD])
-m4trace:configure.ac:1505: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_EXPIRE_IN_PASSWD])
-m4trace:configure.ac:1520: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_CHANGE_IN_PASSWD])
-m4trace:configure.ac:1545: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ACCRIGHTS_IN_MSGHDR])
-m4trace:configure.ac:1569: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CONTROL_IN_MSGHDR])
-m4trace:configure.ac:1580: -1- AC_DEFINE_TRACE_LITERAL([HAVE___PROGNAME])
-m4trace:configure.ac:1593: -1- AC_DEFINE_TRACE_LITERAL([HAVE___FUNCTION__])
-m4trace:configure.ac:1606: -1- AC_DEFINE_TRACE_LITERAL([HAVE___func__])
-m4trace:configure.ac:1621: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_OPTRESET])
-m4trace:configure.ac:1632: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_ERRLIST])
-m4trace:configure.ac:1644: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_NERR])
-m4trace:configure.ac:1677: -1- AC_CHECK_HEADERS([sectok.h])
-m4trace:configure.ac:1677: -1- AH_OUTPUT([HAVE_SECTOK_H], [/* Define to 1 if you have the <sectok.h> header file. */
+m4trace:configure.ac:1517: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SS_FAMILY_IN_SS])
+m4trace:configure.ac:1533: -1- AC_DEFINE_TRACE_LITERAL([HAVE___SS_FAMILY_IN_SS])
+m4trace:configure.ac:1548: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_CLASS_IN_PASSWD])
+m4trace:configure.ac:1563: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_EXPIRE_IN_PASSWD])
+m4trace:configure.ac:1578: -1- AC_DEFINE_TRACE_LITERAL([HAVE_PW_CHANGE_IN_PASSWD])
+m4trace:configure.ac:1603: -1- AC_DEFINE_TRACE_LITERAL([HAVE_ACCRIGHTS_IN_MSGHDR])
+m4trace:configure.ac:1627: -1- AC_DEFINE_TRACE_LITERAL([HAVE_CONTROL_IN_MSGHDR])
+m4trace:configure.ac:1638: -1- AC_DEFINE_TRACE_LITERAL([HAVE___PROGNAME])
+m4trace:configure.ac:1651: -1- AC_DEFINE_TRACE_LITERAL([HAVE___FUNCTION__])
+m4trace:configure.ac:1664: -1- AC_DEFINE_TRACE_LITERAL([HAVE___func__])
+m4trace:configure.ac:1679: -1- AC_DEFINE_TRACE_LITERAL([HAVE_GETOPT_OPTRESET])
+m4trace:configure.ac:1690: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_ERRLIST])
+m4trace:configure.ac:1702: -1- AC_DEFINE_TRACE_LITERAL([HAVE_SYS_NERR])
+m4trace:configure.ac:1735: -1- AC_CHECK_HEADERS([sectok.h])
+m4trace:configure.ac:1735: -1- AH_OUTPUT([HAVE_SECTOK_H], [/* Define to 1 if you have the <sectok.h> header file. */
 #undef HAVE_SECTOK_H])
-m4trace:configure.ac:1677: -1- AC_CHECK_LIB([sectok], [sectok_open])
-m4trace:configure.ac:1677: -1- AH_OUTPUT([HAVE_LIBSECTOK], [/* Define to 1 if you have the \`sectok' library (-lsectok). */
+m4trace:configure.ac:1735: -1- AC_CHECK_LIB([sectok], [sectok_open])
+m4trace:configure.ac:1735: -1- AH_OUTPUT([HAVE_LIBSECTOK], [/* Define to 1 if you have the \`sectok' library (-lsectok). */
 #undef HAVE_LIBSECTOK])
-m4trace:configure.ac:1677: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSECTOK])
-m4trace:configure.ac:1677: -1- AC_DEFINE_TRACE_LITERAL([SMARTCARD])
-m4trace:configure.ac:1677: -1- AC_DEFINE_TRACE_LITERAL([USE_SECTOK])
-m4trace:configure.ac:1686: -1- AC_SUBST([OPENSC_CONFIG], [$ac_cv_path_OPENSC_CONFIG])
-m4trace:configure.ac:1692: -1- AC_DEFINE_TRACE_LITERAL([SMARTCARD])
-m4trace:configure.ac:1693: -1- AC_DEFINE_TRACE_LITERAL([USE_OPENSC])
-m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([KRB5])
-m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([HEIMDAL])
-m4trace:configure.ac:1735: -1- AC_CHECK_LIB([resolv], [dn_expand], [], [])
-m4trace:configure.ac:1735: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the \`resolv' library (-lresolv). */
+m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBSECTOK])
+m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([SMARTCARD])
+m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([USE_SECTOK])
+m4trace:configure.ac:1744: -1- AC_SUBST([OPENSC_CONFIG], [$ac_cv_path_OPENSC_CONFIG])
+m4trace:configure.ac:1750: -1- AC_DEFINE_TRACE_LITERAL([SMARTCARD])
+m4trace:configure.ac:1751: -1- AC_DEFINE_TRACE_LITERAL([USE_OPENSC])
+m4trace:configure.ac:1793: -1- AC_DEFINE_TRACE_LITERAL([KRB5])
+m4trace:configure.ac:1793: -1- AC_DEFINE_TRACE_LITERAL([HEIMDAL])
+m4trace:configure.ac:1793: -1- AC_CHECK_LIB([resolv], [dn_expand], [], [])
+m4trace:configure.ac:1793: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the \`resolv' library (-lresolv). */
 #undef HAVE_LIBRESOLV])
-m4trace:configure.ac:1735: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
-m4trace:configure.ac:1789: -1- AC_CHECK_HEADERS([krb.h])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_KRB_H], [/* Define to 1 if you have the <krb.h> header file. */
+m4trace:configure.ac:1793: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
+m4trace:configure.ac:1847: -1- AC_CHECK_HEADERS([krb.h])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_KRB_H], [/* Define to 1 if you have the <krb.h> header file. */
 #undef HAVE_KRB_H])
-m4trace:configure.ac:1789: -1- AC_CHECK_LIB([krb], [main])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_LIBKRB], [/* Define to 1 if you have the \`krb' library (-lkrb). */
+m4trace:configure.ac:1847: -1- AC_CHECK_LIB([krb], [main])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_LIBKRB], [/* Define to 1 if you have the \`krb' library (-lkrb). */
 #undef HAVE_LIBKRB])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBKRB])
-m4trace:configure.ac:1789: -1- AC_CHECK_LIB([krb4], [main])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_LIBKRB4], [/* Define to 1 if you have the \`krb4' library (-lkrb4). */
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBKRB])
+m4trace:configure.ac:1847: -1- AC_CHECK_LIB([krb4], [main])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_LIBKRB4], [/* Define to 1 if you have the \`krb4' library (-lkrb4). */
 #undef HAVE_LIBKRB4])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBKRB4])
-m4trace:configure.ac:1789: -1- AC_CHECK_LIB([des], [des_cbc_encrypt])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_LIBDES], [/* Define to 1 if you have the \`des' library (-ldes). */
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBKRB4])
+m4trace:configure.ac:1847: -1- AC_CHECK_LIB([des], [des_cbc_encrypt])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_LIBDES], [/* Define to 1 if you have the \`des' library (-ldes). */
 #undef HAVE_LIBDES])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDES])
-m4trace:configure.ac:1789: -1- AC_CHECK_LIB([des425], [des_cbc_encrypt])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_LIBDES425], [/* Define to 1 if you have the \`des425' library (-ldes425). */
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDES])
+m4trace:configure.ac:1847: -1- AC_CHECK_LIB([des425], [des_cbc_encrypt])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_LIBDES425], [/* Define to 1 if you have the \`des425' library (-ldes425). */
 #undef HAVE_LIBDES425])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDES425])
-m4trace:configure.ac:1789: -1- AC_CHECK_LIB([resolv], [dn_expand], [], [])
-m4trace:configure.ac:1789: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the \`resolv' library (-lresolv). */
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBDES425])
+m4trace:configure.ac:1847: -1- AC_CHECK_LIB([resolv], [dn_expand], [], [])
+m4trace:configure.ac:1847: -1- AH_OUTPUT([HAVE_LIBRESOLV], [/* Define to 1 if you have the \`resolv' library (-lresolv). */
 #undef HAVE_LIBRESOLV])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
-m4trace:configure.ac:1789: -1- AC_DEFINE_TRACE_LITERAL([KRB4])
-m4trace:configure.ac:1815: -1- AC_DEFINE_TRACE_LITERAL([AFS])
-m4trace:configure.ac:1829: -1- AC_SUBST([PRIVSEP_PATH])
-m4trace:configure.ac:1844: -1- AC_SUBST([xauth_path], [$ac_cv_path_xauth_path])
-m4trace:configure.ac:1848: -1- AC_SUBST([XAUTH_PATH])
-m4trace:configure.ac:1850: -1- AC_DEFINE_TRACE_LITERAL([XAUTH_PATH])
-m4trace:configure.ac:1852: -1- AC_SUBST([XAUTH_PATH])
-m4trace:configure.ac:1858: -1- AC_DEFINE_TRACE_LITERAL([MAIL_DIRECTORY])
-m4trace:configure.ac:1868: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_PTMX])
-m4trace:configure.ac:1876: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_PTS_AND_PTC])
-m4trace:configure.ac:1893: -1- AC_SUBST([NROFF], [$ac_cv_path_NROFF])
-m4trace:configure.ac:1902: -1- AC_SUBST([MANTYPE])
-m4trace:configure.ac:1908: -1- AC_SUBST([mansubdir])
-m4trace:configure.ac:1920: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MD5_PASSWORDS])
-m4trace:configure.ac:1931: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
-m4trace:configure.ac:1946: -1- AC_DEFINE_TRACE_LITERAL([HAS_SHADOW_EXPIRE])
-m4trace:configure.ac:1955: -1- AC_DEFINE_TRACE_LITERAL([IPADDR_IN_DISPLAY])
-m4trace:configure.ac:1966: -1- AC_DEFINE_TRACE_LITERAL([IPADDR_IN_DISPLAY])
-m4trace:configure.ac:2043: -1- AC_DEFINE_TRACE_LITERAL([USER_PATH])
-m4trace:configure.ac:2044: -1- AC_SUBST([user_path])
-m4trace:configure.ac:2056: -1- AC_DEFINE_TRACE_LITERAL([SUPERUSER_PATH])
-m4trace:configure.ac:2069: -1- AC_DEFINE_TRACE_LITERAL([IPV4_DEFAULT])
-m4trace:configure.ac:2092: -1- AC_DEFINE_TRACE_LITERAL([IPV4_IN_IPV6])
-m4trace:configure.ac:2092: -1- AC_DEFINE_TRACE_LITERAL([IPV4_IN_IPV6])
-m4trace:configure.ac:2104: -1- AC_DEFINE_TRACE_LITERAL([BSD_AUTH])
-m4trace:configure.ac:2128: -1- AC_DEFINE_TRACE_LITERAL([_PATH_SSH_PIDDIR])
-m4trace:configure.ac:2129: -1- AC_SUBST([piddir])
-m4trace:configure.ac:2135: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
-m4trace:configure.ac:2139: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:2143: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMPX])
-m4trace:configure.ac:2147: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
-m4trace:configure.ac:2151: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMPX])
-m4trace:configure.ac:2155: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LOGIN])
-m4trace:configure.ac:2159: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_PUTUTLINE])
-m4trace:configure.ac:2163: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_PUTUTXLINE])
-m4trace:configure.ac:2173: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
-m4trace:configure.ac:2235: -1- AC_DEFINE_TRACE_LITERAL([CONF_LASTLOG_FILE])
-m4trace:configure.ac:2260: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
-m4trace:configure.ac:2265: -1- AC_DEFINE_TRACE_LITERAL([CONF_UTMP_FILE])
-m4trace:configure.ac:2290: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
-m4trace:configure.ac:2295: -1- AC_DEFINE_TRACE_LITERAL([CONF_WTMP_FILE])
-m4trace:configure.ac:2320: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMPX])
-m4trace:configure.ac:2323: -1- AC_DEFINE_TRACE_LITERAL([CONF_UTMPX_FILE])
-m4trace:configure.ac:2345: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMPX])
-m4trace:configure.ac:2348: -1- AC_DEFINE_TRACE_LITERAL([CONF_WTMPX_FILE])
-m4trace:configure.ac:2366: -1- AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([HAVE_LIBRESOLV])
+m4trace:configure.ac:1847: -1- AC_DEFINE_TRACE_LITERAL([KRB4])
+m4trace:configure.ac:1873: -1- AC_DEFINE_TRACE_LITERAL([AFS])
+m4trace:configure.ac:1887: -1- AC_SUBST([PRIVSEP_PATH])
+m4trace:configure.ac:1907: -1- AC_SUBST([xauth_path], [$ac_cv_path_xauth_path])
+m4trace:configure.ac:1911: -1- AC_SUBST([XAUTH_PATH])
+m4trace:configure.ac:1913: -1- AC_DEFINE_TRACE_LITERAL([XAUTH_PATH])
+m4trace:configure.ac:1915: -1- AC_SUBST([XAUTH_PATH])
+m4trace:configure.ac:1921: -1- AC_DEFINE_TRACE_LITERAL([MAIL_DIRECTORY])
+m4trace:configure.ac:1931: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_PTMX])
+m4trace:configure.ac:1939: -1- AC_DEFINE_TRACE_LITERAL([HAVE_DEV_PTS_AND_PTC])
+m4trace:configure.ac:1957: -1- AC_SUBST([NROFF], [$ac_cv_path_NROFF])
+m4trace:configure.ac:1966: -1- AC_SUBST([MANTYPE])
+m4trace:configure.ac:1972: -1- AC_SUBST([mansubdir])
+m4trace:configure.ac:1984: -1- AC_DEFINE_TRACE_LITERAL([HAVE_MD5_PASSWORDS])
+m4trace:configure.ac:1995: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_SHADOW])
+m4trace:configure.ac:2010: -1- AC_DEFINE_TRACE_LITERAL([HAS_SHADOW_EXPIRE])
+m4trace:configure.ac:2019: -1- AC_DEFINE_TRACE_LITERAL([IPADDR_IN_DISPLAY])
+m4trace:configure.ac:2030: -1- AC_DEFINE_TRACE_LITERAL([IPADDR_IN_DISPLAY])
+m4trace:configure.ac:2107: -1- AC_DEFINE_TRACE_LITERAL([USER_PATH])
+m4trace:configure.ac:2108: -1- AC_SUBST([user_path])
+m4trace:configure.ac:2120: -1- AC_DEFINE_TRACE_LITERAL([SUPERUSER_PATH])
+m4trace:configure.ac:2133: -1- AC_DEFINE_TRACE_LITERAL([IPV4_DEFAULT])
+m4trace:configure.ac:2156: -1- AC_DEFINE_TRACE_LITERAL([IPV4_IN_IPV6])
+m4trace:configure.ac:2156: -1- AC_DEFINE_TRACE_LITERAL([IPV4_IN_IPV6])
+m4trace:configure.ac:2168: -1- AC_DEFINE_TRACE_LITERAL([BSD_AUTH])
+m4trace:configure.ac:2192: -1- AC_DEFINE_TRACE_LITERAL([_PATH_SSH_PIDDIR])
+m4trace:configure.ac:2193: -1- AC_SUBST([piddir])
+m4trace:configure.ac:2199: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
+m4trace:configure.ac:2203: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:2207: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMPX])
+m4trace:configure.ac:2211: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
+m4trace:configure.ac:2215: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMPX])
+m4trace:configure.ac:2219: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LOGIN])
+m4trace:configure.ac:2223: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_PUTUTLINE])
+m4trace:configure.ac:2227: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_PUTUTXLINE])
+m4trace:configure.ac:2237: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_LASTLOG])
+m4trace:configure.ac:2299: -1- AC_DEFINE_TRACE_LITERAL([CONF_LASTLOG_FILE])
+m4trace:configure.ac:2324: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMP])
+m4trace:configure.ac:2329: -1- AC_DEFINE_TRACE_LITERAL([CONF_UTMP_FILE])
+m4trace:configure.ac:2354: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMP])
+m4trace:configure.ac:2359: -1- AC_DEFINE_TRACE_LITERAL([CONF_WTMP_FILE])
+m4trace:configure.ac:2384: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_UTMPX])
+m4trace:configure.ac:2387: -1- AC_DEFINE_TRACE_LITERAL([CONF_UTMPX_FILE])
+m4trace:configure.ac:2409: -1- AC_DEFINE_TRACE_LITERAL([DISABLE_WTMPX])
+m4trace:configure.ac:2412: -1- AC_DEFINE_TRACE_LITERAL([CONF_WTMPX_FILE])
+m4trace:configure.ac:2430: -1- AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
index 00c499ca041fb96cdcc9d3cdece2e90865196ef7..a457d3c52243bbdfaa43f3593fd36642fce540e7 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: canohost.c,v 1.32 2002/06/11 08:11:45 itojun Exp $");
+RCSID("$OpenBSD: canohost.c,v 1.34 2002/09/23 20:46:27 stevesk Exp $");
 
 #include "packet.h"
 #include "xmalloc.h"
@@ -77,7 +77,9 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
        if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
            NULL, 0, NI_NAMEREQD) != 0) {
                /* Host name not found.  Use ip address. */
+#if 0
                log("Could not reverse map address %.100s.", ntop);
+#endif
                return xstrdup(ntop);
        }
 
@@ -216,18 +218,12 @@ get_socket_address(int socket, int remote, int flags)
 
        if (remote) {
                if (getpeername(socket, (struct sockaddr *)&addr, &addrlen)
-                   < 0) {
-                       debug("get_socket_ipaddr: getpeername failed: %.100s",
-                           strerror(errno));
+                   < 0)
                        return NULL;
-               }
        } else {
                if (getsockname(socket, (struct sockaddr *)&addr, &addrlen)
-                   < 0) {
-                       debug("get_socket_ipaddr: getsockname failed: %.100s",
-                           strerror(errno));
+                   < 0)
                        return NULL;
-               }
        }
        /* Get the address in ascii. */
        if (getnameinfo((struct sockaddr *)&addr, addrlen, ntop, sizeof(ntop),
@@ -241,13 +237,21 @@ get_socket_address(int socket, int remote, int flags)
 char *
 get_peer_ipaddr(int socket)
 {
-       return get_socket_address(socket, 1, NI_NUMERICHOST);
+       char *p;
+
+       if ((p = get_socket_address(socket, 1, NI_NUMERICHOST)) != NULL)
+               return p;
+       return xstrdup("UNKNOWN");
 }
 
 char *
 get_local_ipaddr(int socket)
 {
-       return get_socket_address(socket, 0, NI_NUMERICHOST);
+       char *p;
+
+       if ((p = get_socket_address(socket, 0, NI_NUMERICHOST)) != NULL)
+               return p;
+       return xstrdup("UNKNOWN");
 }
 
 char *
index 29eaee7c4d6011841ad8920592aa12cb2d080d6f..6ff9e2583012047a53739de2220a3afcf7080805 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.179 2002/06/26 08:55:02 markus Exp $");
+RCSID("$OpenBSD: channels.c,v 1.183 2002/09/17 07:47:02 itojun Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -186,6 +186,7 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
        } else {
                c->isatty = 0;
        }
+       c->wfd_isatty = isatty(c->wfd);
 
        /* enable nonblocking mode */
        if (nonblock) {
@@ -572,6 +573,7 @@ void
 channel_send_open(int id)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL) {
                log("channel_send_open: %d: bad id", id);
                return;
@@ -589,6 +591,7 @@ void
 channel_request_start(int local_id, char *service, int wantconfirm)
 {
        Channel *c = channel_lookup(local_id);
+
        if (c == NULL) {
                log("channel_request_start: %d: unknown channel id", local_id);
                return;
@@ -603,6 +606,7 @@ void
 channel_register_confirm(int id, channel_callback_fn *fn)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL) {
                log("channel_register_comfirm: %d: bad id", id);
                return;
@@ -613,6 +617,7 @@ void
 channel_register_cleanup(int id, channel_callback_fn *fn)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL) {
                log("channel_register_cleanup: %d: bad id", id);
                return;
@@ -623,6 +628,7 @@ void
 channel_cancel_cleanup(int id)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL) {
                log("channel_cancel_cleanup: %d: bad id", id);
                return;
@@ -633,6 +639,7 @@ void
 channel_register_filter(int id, channel_filter_fn *fn)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL) {
                log("channel_register_filter: %d: bad id", id);
                return;
@@ -645,6 +652,7 @@ channel_set_fds(int id, int rfd, int wfd, int efd,
     int extusage, int nonblock, u_int window_max)
 {
        Channel *c = channel_lookup(id);
+
        if (c == NULL || c->type != SSH_CHANNEL_LARVAL)
                fatal("channel_activate for non-larval channel %d.", id);
        channel_register_fds(c, rfd, wfd, efd, extusage, nonblock);
@@ -815,6 +823,7 @@ static void
 channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset)
 {
        int ret = x11_open_helper(&c->output);
+
        if (ret == 1) {
                /* Start normal processing for the channel. */
                c->type = SSH_CHANNEL_OPEN;
@@ -866,7 +875,7 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
 static int
 channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
 {
-       u_char *p, *host;
+       char *p, *host;
        int len, have, i, found;
        char username[256];
        struct {
@@ -1278,6 +1287,11 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
            buffer_len(&c->output) > 0) {
                data = buffer_ptr(&c->output);
                dlen = buffer_len(&c->output);
+#ifdef _AIX
+               /* XXX: Later AIX versions can't push as much data to tty */ 
+               if (compat20 && c->wfd_isatty && dlen > 8*1024)
+                       dlen = 8*1024;
+#endif
                len = write(c->wfd, data, dlen);
                if (len < 0 && (errno == EINTR || errno == EAGAIN))
                        return 1;
@@ -1395,6 +1409,7 @@ static void
 channel_post_output_drain_13(Channel *c, fd_set * readset, fd_set * writeset)
 {
        int len;
+
        /* Send buffered output data to the socket. */
        if (FD_ISSET(c->sock, writeset) && buffer_len(&c->output) > 0) {
                len = write(c->sock, buffer_ptr(&c->output),
@@ -1472,6 +1487,7 @@ static void
 channel_handler_init(void)
 {
        int i;
+
        for (i = 0; i < SSH_CHANNEL_MAX_TYPE; i++) {
                channel_pre[i] = NULL;
                channel_post[i] = NULL;
@@ -2006,7 +2022,6 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
        struct addrinfo hints, *ai, *aitop;
        const char *host;
        char ntop[NI_MAXHOST], strport[NI_MAXSERV];
-       struct linger linger;
 
        success = 0;
        host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
@@ -2049,13 +2064,13 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
                        continue;
                }
                /*
-                * Set socket options.  We would like the socket to disappear
-                * as soon as it has been closed for whatever reason.
+                * Set socket options.
+                * Allow local port reuse in TIME_WAIT.
                 */
-               setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
-               linger.l_onoff = 1;
-               linger.l_linger = 5;
-               setsockopt(sock, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
+               if (setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, &on,
+                   sizeof(on)) == -1)
+                       error("setsockopt SO_REUSEADDR: %s", strerror(errno));
+
                debug("Local forwarding listening on %s port %s.", ntop, strport);
 
                /* Bind the socket to the address. */
@@ -2605,6 +2620,7 @@ void
 deny_input_open(int type, u_int32_t seq, void *ctxt)
 {
        int rchan = packet_get_int();
+
        switch (type) {
        case SSH_SMSG_AGENT_OPEN:
                error("Warning: ssh server tried agent forwarding.");
index dd54114d6c013d0840c274fc09a5b0b761592c0d..bd2e92589c591648f8811a1174245783f0a04288 100644 (file)
@@ -77,6 +77,7 @@ struct Channel {
        int     efd;            /* extended fd */
        int     sock;           /* sock fd */
        int     isatty;         /* rfd is a tty */
+       int     wfd_isatty;     /* wfd is a tty */
        int     force_drain;    /* force close on iEOF */
        int     delayed;                /* fdset hack */
        Buffer  input;          /* data read from socket, to be sent over
index 6db340d7a991c46ad477c4184aa2d50b036b1723..1933d3eab4f7fd0f935e4d1cf797013657646d12 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cipher.c,v 1.60 2002/06/23 03:26:52 deraadt Exp $");
+RCSID("$OpenBSD: cipher.c,v 1.61 2002/07/12 15:50:17 markus Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -437,6 +437,18 @@ swap_bytes(const u_char *src, u_char *dst, int n)
        }
 }
 
+#ifdef SSH_OLD_EVP
+static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key,
+                         const unsigned char *iv, int enc)
+{
+       if (iv != NULL)
+               memcpy (&(ctx->oiv[0]), iv, 8);
+       memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8);
+       if (key != NULL)
+               BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx),
+                           key);
+}
+#endif
 static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL;
 
 static int
@@ -458,6 +470,9 @@ evp_ssh1_bf(void)
        memcpy(&ssh1_bf, EVP_bf_cbc(), sizeof(EVP_CIPHER));
        orig_bf = ssh1_bf.do_cipher;
        ssh1_bf.nid = NID_undef;
+#ifdef SSH_OLD_EVP
+       ssh1_bf.init = bf_ssh1_init;
+#endif
        ssh1_bf.do_cipher = bf_ssh1_cipher;
        ssh1_bf.key_len = 32;
        return (&ssh1_bf);
@@ -567,7 +582,7 @@ evp_rijndael(void)
        rijndal_cbc.do_cipher = ssh_rijndael_cbc;
 #ifndef SSH_OLD_EVP
        rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
-           EVP_CIPH_ALWAYS_CALL_INIT;
+           EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV;
 #endif
        return (&rijndal_cbc);
 }
index cd2eab77a9c057d7ac5012636f435f73089865be..2c030e71b36078f80ff3ac47a5f9f803e6bf55a5 100644 (file)
@@ -59,7 +59,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: clientloop.c,v 1.102 2002/06/24 14:33:27 markus Exp $");
+RCSID("$OpenBSD: clientloop.c,v 1.104 2002/08/22 19:38:42 stevesk Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -635,16 +635,18 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
                                snprintf(string, sizeof string,
 "%c?\r\n\
 Supported escape sequences:\r\n\
-~.  - terminate connection\r\n\
-~C  - open a command line\r\n\
-~R  - Request rekey (SSH protocol 2 only)\r\n\
-~^Z - suspend ssh\r\n\
-~#  - list forwarded connections\r\n\
-~&  - background ssh (when waiting for connections to terminate)\r\n\
-~?  - this message\r\n\
-~~  - send the escape character by typing it twice\r\n\
+%c.  - terminate connection\r\n\
+%cC  - open a command line\r\n\
+%cR  - Request rekey (SSH protocol 2 only)\r\n\
+%c^Z - suspend ssh\r\n\
+%c#  - list forwarded connections\r\n\
+%c&  - background ssh (when waiting for connections to terminate)\r\n\
+%c?  - this message\r\n\
+%c%c  - send the escape character by typing it twice\r\n\
 (Note that escapes are only recognized immediately after newline.)\r\n",
-                                        escape_char);
+                                   escape_char, escape_char, escape_char, escape_char,
+                                   escape_char, escape_char, escape_char, escape_char,
+                                   escape_char, escape_char);
                                buffer_append(berr, string, strlen(string));
                                continue;
 
@@ -1114,7 +1116,7 @@ client_input_exit_status(int type, u_int32_t seq, void *ctxt)
 static Channel *
 client_request_forwarded_tcpip(const char *request_type, int rchan)
 {
-       Channelc = NULL;
+       Channel *c = NULL;
        char *listen_address, *originator_address;
        int listen_port, originator_port;
        int sock;
@@ -1144,7 +1146,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan)
        return c;
 }
 
-static Channel*
+static Channel *
 client_request_x11(const char *request_type, int rchan)
 {
        Channel *c = NULL;
@@ -1180,7 +1182,7 @@ client_request_x11(const char *request_type, int rchan)
        return c;
 }
 
-static Channel*
+static Channel *
 client_request_agent(const char *request_type, int rchan)
 {
        Channel *c = NULL;
index 406b47c25714df1659c4593658b19fae5fa1d956..757b0e679c41f6eeaebff6497b4a2d0ba6f79375 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: compat.c,v 1.63 2002/04/10 08:21:47 markus Exp $");
+RCSID("$OpenBSD: compat.c,v 1.65 2002/09/27 10:42:09 mickey Exp $");
 
 #include "buffer.h"
 #include "packet.h"
@@ -39,13 +39,13 @@ int datafellows = 0;
 void
 enable_compat20(void)
 {
-       verbose("Enabling compatibility mode for protocol 2.0");
+       debug("Enabling compatibility mode for protocol 2.0");
        compat20 = 1;
 }
 void
 enable_compat13(void)
 {
-       verbose("Enabling compatibility mode for protocol 1.3");
+       debug("Enabling compatibility mode for protocol 1.3");
        compat13 = 1;
 }
 /* datafellows bug compatibility */
@@ -146,6 +146,8 @@ compat_datafellows(const char *version)
                  "OSU_1.5alpha3*",     SSH_BUG_PASSWORDPAD },
                { "*SSH_Version_Mapper*",
                                        SSH_BUG_SCANNER },
+               { "Probe-*",
+                                       SSH_BUG_PROBE },
                { NULL,                 0 }
        };
 
index 7afca046019b20a450b8b135ca033a558789d6a9..9299805af87b991875ac43478097c8eca2cf6f33 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: compat.h,v 1.32 2002/04/10 08:21:47 markus Exp $      */
+/*     $OpenBSD: compat.h,v 1.33 2002/09/27 10:42:09 mickey Exp $      */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Markus Friedl.  All rights reserved.
@@ -54,6 +54,7 @@
 #define SSH_BUG_DUMMYCHAN      0x00100000
 #define SSH_BUG_EXTEOF         0x00200000
 #define SSH_BUG_K5USER         0x00400000
+#define SSH_BUG_PROBE          0x00800000
 
 void     enable_compat13(void);
 void     enable_compat20(void);
index 83c544d9703394b5c4211539a34994d3f574554b..fd30ab0314cd95a2544eaaefb5ebf4291c52805c 100755 (executable)
@@ -3,7 +3,7 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
 #   2000, 2001, 2002 Free Software Foundation, Inc.
 
-timestamp='2002-01-30'
+timestamp='2002-07-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -88,30 +88,40 @@ if test $# != 0; then
   exit 1
 fi
 
+trap 'exit 1' 1 2 15
 
-dummy=dummy-$$
-trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
 
-# CC_FOR_BUILD -- compiler used by this script.
 # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
 # use `HOST_CC' if defined, but it is deprecated.
 
-set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int dummy(){}" > $dummy.c ;
-       for c in cc gcc c89 ; do
-         ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ;
-         if test $? = 0 ; then
+# This shell variable is my proudest work .. or something. --bje
+
+set_cc_for_build='tmpdir=${TMPDIR-/tmp}/config-guess-$$ ;
+(old=`umask` && umask 077 && mkdir $tmpdir && umask $old && unset old)
+   || (echo "$me: cannot create $tmpdir" >&2 && exit 1) ;
+dummy=$tmpdir/dummy ;
+files="$dummy.c $dummy.o $dummy.rel $dummy" ;
+trap '"'"'rm -f $files; rmdir $tmpdir; exit 1'"'"' 1 2 15 ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; then
             CC_FOR_BUILD="$c"; break ;
          fi ;
        done ;
-       rm -f $dummy.c $dummy.o $dummy.rel ;
+       rm -f $files ;
        if test x"$CC_FOR_BUILD" = x ; then
          CC_FOR_BUILD=no_compiler_found ;
        fi
        ;;
  ,,*)   CC_FOR_BUILD=$CC ;;
  ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac'
+esac ;
+unset files'
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
@@ -138,9 +148,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        #
        # Note: NetBSD doesn't particularly care about the vendor
        # portion of the name.  We always set it to "unknown".
-       UNAME_MACHINE_ARCH=`(uname -p) 2>/dev/null` || \
-           UNAME_MACHINE_ARCH=unknown
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
        case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
@@ -219,6 +231,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
+       eval $set_cc_for_build
        cat <<EOF >$dummy.s
        .data
 \$Lformat:
@@ -244,10 +257,9 @@ main:
        jsr \$26,exit
        .end main
 EOF
-       eval $set_cc_for_build
        $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null
        if test "$?" = 0 ; then
-               case `./$dummy` in
+               case `$dummy` in
                        0-0)
                                UNAME_MACHINE="alpha"
                                ;;
@@ -269,9 +281,12 @@ EOF
                        2-1307)
                                UNAME_MACHINE="alphaev68"
                                ;;
+                       3-1307)
+                               UNAME_MACHINE="alphaev7"
+                               ;;
                esac
        fi
-       rm -f $dummy.s $dummy
+       rm -f $dummy.s $dummy && rmdir $tmpdir
        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
        exit 0 ;;
     Alpha\ *:Windows_NT*:*)
@@ -312,6 +327,10 @@ EOF
     NILE*:*:*:dcosx)
        echo pyramid-pyramid-svr4
        exit 0 ;;
+    DRS?6000:UNIX_SV:4.2*:7*)
+       case `/usr/bin/uname -p` in
+           sparc) echo sparc-icl-nx7 && exit 0 ;;
+       esac ;;
     sun4H:SunOS:5.*:*)
        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
        exit 0 ;;
@@ -340,7 +359,7 @@ EOF
        echo m68k-sun-sunos${UNAME_RELEASE}
        exit 0 ;;
     sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
        test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
        case "`/bin/arch`" in
            sun3)
@@ -419,14 +438,17 @@ EOF
        }
 EOF
        $CC_FOR_BUILD $dummy.c -o $dummy \
-         && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
-         && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+         && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+         && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+       rm -f $dummy.c $dummy && rmdir $tmpdir
        echo mips-mips-riscos${UNAME_RELEASE}
        exit 0 ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
        exit 0 ;;
+    Night_Hawk:*:*:PowerMAX_OS)
+       echo powerpc-harris-powermax
+       exit 0 ;;
     Night_Hawk:Power_UNIX:*:*)
        echo powerpc-harris-powerunix
        exit 0 ;;
@@ -499,8 +521,8 @@ EOF
                        exit(0);
                        }
 EOF
-               $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-               rm -f $dummy.c $dummy
+               $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+               rm -f $dummy.c $dummy && rmdir $tmpdir
                echo rs6000-ibm-aix3.2.5
        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
                echo rs6000-ibm-aix3.2.4
@@ -509,7 +531,7 @@ EOF
        fi
        exit 0 ;;
     *:AIX:*:[45])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'`
+       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
        if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
@@ -598,9 +620,9 @@ EOF
                   exit (0);
               }
 EOF
-                   (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`./$dummy`
+                   (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null) && HP_ARCH=`$dummy`
                    if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi
-                   rm -f $dummy.c $dummy
+                   rm -f $dummy.c $dummy && rmdir $tmpdir
                fi ;;
        esac
        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -636,8 +658,8 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm -f $dummy.c $dummy && exit 0
-       rm -f $dummy.c $dummy
+       $CC_FOR_BUILD $dummy.c -o $dummy && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+       rm -f $dummy.c $dummy && rmdir $tmpdir
        echo unknown-hitachi-hiuxwe2
        exit 0 ;;
     9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
@@ -683,9 +705,6 @@ EOF
     C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
        echo c4-convex-bsd
         exit 0 ;;
-    CRAY*X-MP:*:*:*)
-       echo xmp-cray-unicos
-        exit 0 ;;
     CRAY*Y-MP:*:*:*)
        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
@@ -707,9 +726,6 @@ EOF
     CRAY*SV1:*:*:*)
        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
        exit 0 ;;
-    CRAY-2:*:*:*)
-       echo cray2-cray-unicos
-        exit 0 ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
         FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
@@ -726,7 +742,19 @@ EOF
        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
        exit 0 ;;
     *:FreeBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       # Determine whether the default compiler uses glibc.
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <features.h>
+       #if __GLIBC__ >= 2
+       LIBC=gnu
+       #else
+       LIBC=
+       #endif
+EOF
+       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+       rm -f $dummy.c && rmdir $tmpdir
+       echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
        exit 0 ;;
     i*:CYGWIN*:*)
        echo ${UNAME_MACHINE}-pc-cygwin
@@ -765,7 +793,7 @@ EOF
        echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit 0 ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux
+       echo ${UNAME_MACHINE}-unknown-linux-gnu
        exit 0 ;;
     m68*:Linux:*:*)
        echo ${UNAME_MACHINE}-unknown-linux-gnu
@@ -776,18 +804,18 @@ EOF
        #undef CPU
        #undef mips
        #undef mipsel
-       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) 
-       CPU=mipsel 
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=mipsel
        #else
-       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) 
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
        CPU=mips
        #else
        CPU=
        #endif
-       #endif 
+       #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
-       rm -f $dummy.c
+       rm -f $dummy.c && rmdir $tmpdir
        test x"${CPU}" != x && echo "${CPU}-pc-linux-gnu" && exit 0
        ;;
     ppc:Linux:*:*)
@@ -837,9 +865,8 @@ EOF
        # The BFD linker knows what the default object file format is, so
        # first see if it will tell us. cd to the root directory to prevent
        # problems with other programs or directories called `ld' in the path.
-       # Export LANG=C to prevent ld from outputting information in other
-       # languages.
-       ld_supported_targets=`LANG=C; export LANG; cd /; ld --help 2>&1 \
+       # Set LC_ALL=C to ensure ld outputs messages in English.
+       ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
                         | sed -ne '/supported targets:/!d
                                    s/[         ][      ]*/ /g
                                    s/.*supported targets: *//
@@ -851,7 +878,7 @@ EOF
                ;;
          a.out-i386-linux)
                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
-               exit 0 ;;               
+               exit 0 ;;
          coff-i386)
                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
                exit 0 ;;
@@ -884,7 +911,7 @@ EOF
        #endif
 EOF
        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
-       rm -f $dummy.c
+       rm -f $dummy.c && rmdir $tmpdir
        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
        ;;
@@ -923,13 +950,13 @@ EOF
                UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
                echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
-               (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
-               (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
-               (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
                        && UNAME_MACHINE=i686
-               (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
                echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
        else
@@ -964,7 +991,7 @@ EOF
        exit 0 ;;
     M68*:*:R3V[567]*:*)
        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
-    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
+    3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
@@ -1065,12 +1092,12 @@ EOF
        echo `uname -p`-apple-darwin${UNAME_RELEASE}
        exit 0 ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       if test "${UNAME_MACHINE}" = "x86pc"; then
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
-               echo i386-${UNAME_MACHINE}-nto-qnx
-       else
-               echo `uname -p`-${UNAME_MACHINE}-nto-qnx
        fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
        exit 0 ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
@@ -1247,8 +1274,8 @@ main ()
 }
 EOF
 
-$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm -f $dummy.c $dummy && exit 0
-rm -f $dummy.c $dummy
+$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && $dummy && rm -f $dummy.c $dummy && rmdir $tmpdir && exit 0
+rm -f $dummy.c $dummy && rmdir $tmpdir
 
 # Apollos put the system type in the environment.
 
index a06a480adafdfbe81925988759b3e29088d6d2e0..9ff085efaf7fcd45cacc11aff70bc30fef9099b7 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
-#   Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002 Free Software Foundation, Inc.
 
-timestamp='2001-04-20'
+timestamp='2002-07-03'
 
 # This file is (in principle) common to ALL GNU software.
 # The presence of a machine in this file suggests that SOME GNU software
@@ -29,7 +29,8 @@ timestamp='2001-04-20'
 # configuration script generated by Autoconf, you may include it under
 # the same distribution terms that you use for the rest of that program.
 
-# Please send patches to <config-patches@gnu.org>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted ChangeLog entry.
 #
 # Configuration subroutine to validate and canonicalize a configuration type.
 # Supply the specified configuration type as an argument.
@@ -117,7 +118,7 @@ esac
 # Here we must recognize all the valid KERNEL-OS combinations.
 maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
 case $maybe_os in
-  nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
+  nto-qnx* | linux-gnu* | freebsd*-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
     ;;
@@ -157,6 +158,14 @@ case $os in
                os=-vxworks
                basic_machine=$1
                ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
        -hiux*)
                os=-hiuxwe2
                ;;
@@ -215,26 +224,44 @@ esac
 case $basic_machine in
        # Recognize the basic CPU types without company name.
        # Some are omitted here because they have special meanings below.
-       tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
-               | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
-               | pyramid | mn10200 | mn10300 | tron | a29k \
-               | 580 | i960 | h8300 \
-               | x86 | ppcbe | mipsbe | mipsle | shbe | shle \
-               | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
-               | hppa64 \
-               | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
-               | alphaev6[78] \
-               | we32k | ns16k | clipper | i370 | sh | sh[34] \
-               | powerpc | powerpcle \
-               | 1750a | dsp16xx | pdp10 | pdp11 \
-               | mips16 | mips64 | mipsel | mips64el \
-               | mips64orion | mips64orionel | mipstx39 | mipstx39el \
-               | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
-               | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
-               | sparc | sparclet | sparclite | sparc64 | sparcv9 | sparcv9b \
-               | v850 | c4x \
-               | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
-               | pj | pjl | h8500)
+       1750a | 580 \
+       | a29k \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+       | c4x | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | fr30 | frv \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k \
+       | m32r | m68000 | m68k | m88k | mcore \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64orion | mips64orionel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | ns16k | ns32k \
+       | openrisc | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+       | pyramid \
+       | sh | sh[1234] | sh3e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+       | strongarm \
+       | tahoe | thumb | tic80 | tron \
+       | v850 | v850e \
+       | we32k \
+       | x86 | xscale | xstormy16 | xtensa \
+       | z8k)
                basic_machine=$basic_machine-unknown
                ;;
        m6811 | m68hc11 | m6812 | m68hc12)
@@ -242,7 +269,7 @@ case $basic_machine in
                basic_machine=$basic_machine-unknown
                os=-none
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
+       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
                ;;
 
        # We use `pc' rather than `unknown'
@@ -257,31 +284,54 @@ case $basic_machine in
                exit 1
                ;;
        # Recognize the basic CPU types with company name.
-       # FIXME: clean up the formatting here.
-       vax-* | tahoe-* | i*86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
-             | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
-             | arm-*  | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
-             | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
-             | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
-             | xmp-* | ymp-* \
-             | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
-             | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
-             | hppa2.0n-* | hppa64-* \
-             | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
-             | alphaev6[78]-* \
-             | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
-             | clipper-* | orion-* \
-             | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
-             | sparc64-* | sparcv9-* | sparcv9b-* | sparc86x-* \
-             | mips16-* | mips64-* | mipsel-* \
-             | mips64el-* | mips64orion-* | mips64orionel-* \
-             | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
-             | mipstx39-* | mipstx39el-* | mcore-* \
-             | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
-             | [cjt]90-* \
-             | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
-             | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
-             | bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
+       580-* \
+       | a29k-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* \
+       | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c54x-* \
+       | clipper-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | elxsi-* \
+       | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* \
+       | m32r-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | mcore-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipstx39 | mipstx39el \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+       | pyramid-* \
+       | romp-* | rs6000-* \
+       | sh-* | sh[1234]-* | sh3e-* | sh[34]eb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+       | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+       | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
+       | v850-* | v850e-* | vax-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+       | xtensa-* \
+       | ymp-* \
+       | z8k-*)
                ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
@@ -344,6 +394,10 @@ case $basic_machine in
                basic_machine=ns32k-sequent
                os=-dynix
                ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
        convex-c1)
                basic_machine=c1-convex
                os=-bsd
@@ -364,16 +418,8 @@ case $basic_machine in
                basic_machine=c38-convex
                os=-bsd
                ;;
-       cray | ymp)
-               basic_machine=ymp-cray
-               os=-unicos
-               ;;
-       cray2)
-               basic_machine=cray2-cray
-               os=-unicos
-               ;;
-       [cjt]90)
-               basic_machine=${basic_machine}-cray
+       cray | j90)
+               basic_machine=j90-cray
                os=-unicos
                ;;
        crds | unos)
@@ -388,6 +434,14 @@ case $basic_machine in
        decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
                basic_machine=mips-dec
                ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
                basic_machine=m68k-motorola
@@ -568,14 +622,6 @@ case $basic_machine in
                basic_machine=m68k-atari
                os=-mint
                ;;
-       mipsel*-linux*)
-               basic_machine=mipsel-unknown
-               os=-linux-gnu
-               ;;
-       mips*-linux*)
-               basic_machine=mips-unknown
-               os=-linux-gnu
-               ;;
        mips3*-*)
                basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
                ;;
@@ -590,6 +636,10 @@ case $basic_machine in
                basic_machine=m68k-rom68k
                os=-coff
                ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
        msdos)
                basic_machine=i386-pc
                os=-msdos
@@ -669,6 +719,10 @@ case $basic_machine in
                basic_machine=hppa1.1-oki
                os=-proelf
                ;;
+       or32 | or32-*)
+               basic_machine=or32-unknown
+               os=-coff
+               ;;
        OSE68000 | ose68000)
                basic_machine=m68000-ericsson
                os=-ose
@@ -694,7 +748,7 @@ case $basic_machine in
         pc532 | pc532-*)
                basic_machine=ns32k-pc532
                ;;
-       pentium | p5 | k5 | k6 | nexgen)
+       pentium | p5 | k5 | k6 | nexgen | viac3)
                basic_machine=i586-pc
                ;;
        pentiumpro | p6 | 6x86 | athlon)
@@ -703,7 +757,7 @@ case $basic_machine in
        pentiumii | pentium2)
                basic_machine=i686-pc
                ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-*)
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
                basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
        pentiumpro-* | p6-* | 6x86-* | athlon-*)
@@ -727,6 +781,16 @@ case $basic_machine in
        ppcle-* | powerpclittle-*)
                basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
                ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
        ps2)
                basic_machine=i386-ibm
                ;;
@@ -744,6 +808,12 @@ case $basic_machine in
        rtpc | rtpc-*)
                basic_machine=romp-ibm
                ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
        sa29200)
                basic_machine=a29k-amd
                os=-udi
@@ -755,7 +825,7 @@ case $basic_machine in
                basic_machine=sh-hitachi
                os=-hms
                ;;
-       sparclite-wrs)
+       sparclite-wrs | simso-wrs)
                basic_machine=sparclite-wrs
                os=-vxworks
                ;;
@@ -813,7 +883,7 @@ case $basic_machine in
        sun386 | sun386i | roadrunner)
                basic_machine=i386-sun
                ;;
-       sv1)
+        sv1)
                basic_machine=sv1-cray
                os=-unicos
                ;;
@@ -821,8 +891,16 @@ case $basic_machine in
                basic_machine=i386-sequent
                os=-dynix
                ;;
+       t3d)
+               basic_machine=alpha-cray
+               os=-unicos
+               ;;
        t3e)
-               basic_machine=t3e-cray
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
                os=-unicos
                ;;
        tic54x | c54x*)
@@ -835,6 +913,10 @@ case $basic_machine in
        tx39el)
                basic_machine=mipstx39el-unknown
                ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
        tower | tower-32)
                basic_machine=m68k-ncr
                ;;
@@ -881,13 +963,17 @@ case $basic_machine in
                basic_machine=hppa1.1-winbond
                os=-proelf
                ;;
-       xmp)
-               basic_machine=xmp-cray
-               os=-unicos
+       windows32)
+               basic_machine=i386-pc
+               os=-windows32-msvcrt
                ;;
         xps | xps100)
                basic_machine=xps100-honeywell
                ;;
+       ymp)
+               basic_machine=ymp-cray
+               os=-unicos
+               ;;
        z8k-*-coff)
                basic_machine=z8k-unknown
                os=-sim
@@ -908,13 +994,6 @@ case $basic_machine in
        op60c)
                basic_machine=hppa1.1-oki
                ;;
-       mips)
-               if [ x$os = x-linux-gnu ]; then
-                       basic_machine=mips-unknown
-               else
-                       basic_machine=mips-mips
-               fi
-               ;;
        romp)
                basic_machine=romp-ibm
                ;;
@@ -934,9 +1013,12 @@ case $basic_machine in
        we32k)
                basic_machine=we32k-att
                ;;
-       sh3 | sh4)
+       sh3 | sh4 | sh3eb | sh4eb | sh[1234]le | sh3ele)
                basic_machine=sh-unknown
                ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
        sparc | sparcv9 | sparcv9b)
                basic_machine=sparc-sun
                ;;
@@ -1018,11 +1100,14 @@ case $os in
              | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
              | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
              | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* \
              | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
              | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
              | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
              | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
+             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* | -powermax*)
        # Remember, each alternative MUST END IN *, to match a version number.
                ;;
        -qnx*)
@@ -1074,12 +1159,18 @@ case $os in
        -acis*)
                os=-aos
                ;;
+       -atheos*)
+               os=-atheos
+               ;;
        -386bsd)
                os=-bsd
                ;;
        -ctix* | -uts*)
                os=-sysv
                ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
        -ns2 )
                os=-nextstep2
                ;;
@@ -1154,6 +1245,7 @@ case $basic_machine in
        arm*-semi)
                os=-aout
                ;;
+       # This must come before the *-dec entry.
        pdp10-*)
                os=-tops20
                ;;
@@ -1184,6 +1276,9 @@ case $basic_machine in
        mips*-*)
                os=-elf
                ;;
+       or32-*)
+               os=-coff
+               ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
                os=-sysv3
                ;;
@@ -1331,7 +1426,7 @@ case $basic_machine in
                        -ptx*)
                                vendor=sequent
                                ;;
-                       -vxsim* | -vxworks*)
+                       -vxsim* | -vxworks* | -windiss*)
                                vendor=wrs
                                ;;
                        -aux*)
@@ -1346,6 +1441,9 @@ case $basic_machine in
                        -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
                                vendor=atari
                                ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
                esac
                basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
index 18f0e8a0285c3746b578bd629bcb9fbd6cc656e1..45cb28658fe37331dd93596c4eaea3ef12bd1741 100644 (file)
@@ -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)
@@ -71,7 +70,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
@@ -86,14 +90,24 @@ 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(NO_IPPORT_RESERVED_CONCEPT)
+       AC_DEFINE(DISABLE_FD_PASSING)
        AC_DEFINE(SETGROUPS_NOOP)
        ;;
 *-*-dgux*)
        AC_DEFINE(IP_TOS_IS_BROKEN)
        ;;
 *-*-darwin*)
-       AC_DEFINE(BROKEN_GETADDRINFO)
+       AC_MSG_CHECKING(if we have working getaddrinfo)
+       AC_TRY_RUN([#include <mach-o/dyld.h>
+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
@@ -108,7 +122,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*)
@@ -123,7 +138,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"
@@ -135,7 +151,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"
@@ -167,6 +184,7 @@ mips-sony-bsd|mips-sony-newsos4)
        SONY=1
        ;;
 *-*-netbsd*)
+       check_for_libcrypt_before=1
        need_dash_r=1
        ;;
 *-*-freebsd*)
@@ -267,17 +285,28 @@ 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
        ;;
+*-*-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(BROKEN_FD_PASSING)
-       LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal,-L/usr/local/lib"
-       LIBS="$LIBS -lgen -lrsc"
+       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
        ;;
 *-dec-osf*)
        AC_MSG_CHECKING(for Digital Unix SIA)
@@ -348,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.
@@ -419,7 +448,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
@@ -468,7 +498,7 @@ AC_TRY_RUN(
        [
 #include <sys/types.h>
 #include <dirent.h>
-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)], 
        [
@@ -499,7 +529,7 @@ AC_ARG_WITH(skey,
                                [
 #include <stdio.h>
 #include <skey.h>
-int main() { char *ff = skey_keyinfo(""); ff=""; return 0; }
+int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
                                ],
                                [AC_MSG_RESULT(yes)],
                                [
@@ -567,7 +597,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 \
@@ -577,30 +607,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 <stdio.h>
-#include <sys/mman.h>
-#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,[
@@ -663,7 +669,7 @@ if test "x$ac_cv_func_snprintf" = "xyes" ; then
        AC_TRY_RUN(
                [
 #include <stdio.h>
-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)], 
                [
@@ -723,6 +729,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"
@@ -769,6 +781,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 <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#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 <stdio.h>
+#include <string.h>
+#include <openssl/opensslv.h>
+#include <openssl/crypto.h>
+#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])
@@ -776,7 +852,7 @@ AC_TRY_RUN(
        [
 #include <string.h>
 #include <openssl/opensslv.h>
-int main(void) { return(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
+int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
        ],
        [
                AC_MSG_RESULT(yes)
@@ -802,7 +878,7 @@ AC_TRY_RUN(
        [
 #include <string.h>
 #include <openssl/rand.h>
-int main(void) { return(RAND_status() == 1 ? 0 : 1); }
+int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
        ],
        [
                OPENSSL_SEEDS_ITSELF=yes
@@ -1056,7 +1132,16 @@ fi
 
 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
        AC_TRY_COMPILE(
-               [ #include <sys/types.h> ], 
+               [
+#include <sys/types.h>
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#include <sys/socket.h>
+#ifdef HAVE_SYS_BITYPES_H
+# include <sys/bitypes.h>
+#endif
+               ], 
                [ int64_t a; a = 1;], 
                [ ac_cv_have_int64_t="yes" ],
                [ ac_cv_have_int64_t="no" ]
@@ -1064,33 +1149,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 <sys/socket.h> ], 
-               [ 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 <sys/bitypes.h> ], 
-               [ 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, [
@@ -1819,7 +1877,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
@@ -1836,7 +1894,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
@@ -1890,7 +1953,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
diff --git a/openssh/contrib/Makefile b/openssh/contrib/Makefile
new file mode 100644 (file)
index 0000000..2cef46f
--- /dev/null
@@ -0,0 +1,15 @@
+all:
+       @echo "Valid targets: gnome-ssh-askpass1 gnome-ssh-askpass2"
+
+gnome-ssh-askpass1: gnome-ssh-askpass1.c
+       $(CC) `gnome-config --cflags gnome gnomeui` \
+               gnome-ssh-askpass1.c -o gnome-ssh-askpass1 \
+               `gnome-config --libs gnome gnomeui`
+
+gnome-ssh-askpass2: gnome-ssh-askpass2.c
+       $(CC) `pkg-config --cflags gtk+-2.0` \
+               gnome-ssh-askpass2.c -o gnome-ssh-askpass2 \
+               `pkg-config --libs gtk+-2.0`
+
+clean:
+       rm -f *.o gnome-ssh-askpass1 gnome-ssh-askpass2 gnome-ssh-askpass
index 648bb2f3a7ba4ffd5b5125dc26ac9e4d3821e516..67dbbd27786d7fb586d376fae6ce9f5086b293ba 100644 (file)
@@ -1,30 +1,39 @@
 Other patches and addons for OpenSSH. Please send submissions to 
-djm@ibs.com.au
+djm@mindrot.org
 
-Elsewhere
----------
+Externally maintained
+---------------------
 
-http://www.imasy.or.jp/~gotoh/connect.c is a Unix and Windows 
-ProxyCommand which allows OpenSSH to make connections through a SOCKS5
-or http proxy which supports the CONNECT method (eg. Squid).
+SSH Proxy Command -- connect.c
 
-In this directory
------------------
+Shun-ichi GOTO <gotoh@imasy.or.jp> has written a very useful ProxyCommand
+which allows the use of outbound SSH from behind a SOCKS4, SOCKS5 or 
+https CONNECT style proxy server. His page for connect.c has extensive
+documentation on its use as well as compiled versions for Win32.
 
-chroot.diff: 
+http://www.taiyo.co.jp/~gotoh/ssh/connect.html
 
-Due to the fact the patch is never in sync with the rest of the tree.  It was
-removed. 
+
+X11 SSH Askpass:
+
+Jim Knoble <jmknoble@pobox.com> has written an excellent X11
+passphrase requester. This is highly recommended:
+
+http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/index.html
+
+
+In this directory
+-----------------
 
 ssh-copy-id:
 
 Phil Hands' <phil@hands.com> shell script to automate the process of adding
 your public key to a remote machine's ~/.ssh/authorized_keys file.
 
-gnome-ssh-askpass:
+gnome-ssh-askpass[12]:
 
-A GNOME passphrase requester of my own creation. Compilation instructions
-are in the top of the file.
+A GNOME and Gtk2 passphrase requesters. Use "make gnome-ssh-askpass1" or
+"make gnome-ssh-askpass2" to build.
 
 sshd.pam.generic:
 
@@ -43,19 +52,9 @@ Contributed by Mark D. Roth <roth@feep.net>
 
 redhat:
 
-RPM spec file an scripts for building Redhat packages
+RPM spec file and scripts for building Redhat packages
 
 suse:
 
-RPM spec file an scripts for building SuSE packages
-
-
-Externally maintained
----------------------
-
-X11 SSH Askpass:
-
-Jim Knoble <jmknoble@pobox.com> has written an excellent X11
-passphrase requester. This is highly recommended:
+RPM spec file and scripts for building SuSE packages
 
-http://www.ntrnet.net/~jmknoble/software/x11-ssh-askpass/index.html
index d531e53f432b022503e10ced90dd42447072ddf1..5c09c6b758697613a31c200a6e0f3f01aa2b4475 100755 (executable)
@@ -18,6 +18,16 @@ X11_FORWARDING=no
 
 umask 022
 
+startdir=`pwd`
+
+# Path to inventory.sh: same place as buildbff.sh
+if  echo $0 | egrep '^/'
+then
+       inventory=`dirname $0`/inventory.sh             # absolute path
+else
+       inventory=`pwd`/`dirname $0`/inventory.sh       # relative path
+fi
+
 #
 # We still support running from contrib/aix, but this is depreciated
 #
@@ -45,14 +55,6 @@ objdir=`pwd`
 PKGNAME=openssh
 PKGDIR=package
 
-# Path to inventory.sh: same place as buildbff.sh
-if  echo $0 | egrep '^/'
-then
-       inventory=`dirname $0`/inventory.sh             # absolute path
-else
-       inventory=`pwd`/`dirname $0`/inventory.sh       # relative path
-fi
-
 #
 # Collect local configuration settings to override defaults
 #
@@ -328,15 +330,10 @@ rm -f $PKGNAME-$VERSION.bff
 ) | backup  -i -q -f ../$PKGNAME-$VERSION.bff $filelist
 
 #
-# Move package into final location
+# Move package into final location and clean up
 #
-if [ "$contribaix" = "1" ]
-then
-       mv ../$PKGNAME-$VERSION.bff $objdir/contrib/aix
-else
-       mv ../$PKGNAME-$VERSION.bff $objdir
-fi
-
+mv ../$PKGNAME-$VERSION.bff $startdir
+cd $startdir
 rm -rf $objdir/$PKGDIR
 
 echo $0: done.
index ca6eb257b7eadcf5bcbf58276ae1c547fb7f4f1d..47bf4ab55b33a03d41d14439e931fca4ea57c11d 100644 (file)
@@ -17,7 +17,7 @@
 #old cvs stuff.  please update before use.  may be deprecated.
 %define use_stable     1
 %if %{use_stable}
-  %define version      3.4p1
+  %define version      3.5p1
   %define cvs          %{nil}
   %define release      2
 %else
@@ -181,8 +181,6 @@ CFLAGS="$RPM_OPT_FLAGS" \
             --with-pam \
             --with-tcp-wrappers \
             --with-ipv4-default \
-           --sysconfdir=%{_sysconfdir}/ssh \
-           --libexecdir=%{_libexecdir}/openssh \
            --with-privsep-path=%{_var}/empty/sshd \
            #leave this line for easy edits.
 
index 9021ba2b0322d36400228d24fae736cf435b2a2f..71ea3455fa8be4a728f076674d0456786e6990a5 100644 (file)
@@ -1,5 +1,29 @@
 This package is the actual port of OpenSSH to Cygwin 1.3.
 
+===========================================================================
+Important change since 3.4p1-2:
+
+This version adds privilege separation as default setting, see
+/usr/doc/openssh/README.privsep.  According to that document the
+privsep feature requires a non-privileged account called 'sshd'.
+
+The new ssh-host-config file which is part of this version asks
+to create 'sshd' as local user if you want to use privilege
+separation.  If you confirm, it creates that NT user and adds
+the necessary entry to /etc/passwd.
+
+On 9x/Me systems the script just sets UsePrivilegeSeparation to "no"
+since that feature doesn't make any sense on a system which doesn't
+differ between privileged and unprivileged users.
+
+The new ssh-host-config script also adds the /var/empty directory
+needed by privilege separation.  When creating the /var/empty directory
+by yourself, please note that in contrast to the README.privsep document
+the owner sshould not be "root" but the user which is running sshd.  So,
+in the standard configuration this is SYSTEM.  The ssh-host-config script
+chowns /var/empty accordingly.
+===========================================================================
+
 ===========================================================================
 Important change since 3.0.1p1-2:
 
index da60112678d0920fe761ebb6f41e8bebfaadd4e9..4df5aa96963931383706c52c55b674b632f46daa 100644 (file)
@@ -18,6 +18,11 @@ progname=$0
 auto_answer=""
 port_number=22
 
+privsep_configured=no
+privsep_used=yes
+sshd_in_passwd=no
+sshd_in_sam=no
+
 request()
 {
   if [ "${auto_answer}" = "yes" ]
@@ -90,6 +95,10 @@ do
   esac
 done
 
+# Check if running on NT
+_sys="`uname -a`"
+_nt=`expr "$_sys" : "CYGWIN_NT"`
+
 # Check for running ssh/sshd processes first. Refuse to do anything while
 # some ssh processes are still running
 
@@ -98,7 +107,7 @@ then
   echo
   echo "There are still ssh processes running. Please shut them down first."
   echo
-  #exit 1
+  exit 1
 fi
 
 # Check for ${SYSCONFDIR} directory
@@ -126,6 +135,39 @@ then
   fi
 fi
 
+# Create /var/log and /var/log/lastlog if not already existing
+
+if [ -f /var/log ]
+then
+  echo "Creating /var/log failed\!"
+else
+  if [ ! -d /var/log ]
+  then
+    mkdir -p /var/log
+  fi
+  if [ -d /var/log/lastlog ]
+  then
+    echo "Creating /var/log/lastlog failed\!"
+  elif [ ! -f /var/log/lastlog ]
+  then
+    cat /dev/null > /var/log/lastlog
+  fi
+fi
+
+# Create /var/empty file used as chroot jail for privilege separation
+if [ -f /var/empty ]
+then
+  echo "Creating /var/empty failed\!"
+else
+  mkdir -p /var/empty
+  # On NT change ownership of that dir to user "system"
+  if [ $_nt -gt 0 ]
+  then
+    chmod 755 /var/empty
+    chown system.system /var/empty
+  fi
+fi
+
 # Check for an old installation in ${OLDPREFIX} unless ${OLDPREFIX} isn't
 # the same as ${PREFIX}
 
@@ -219,9 +261,10 @@ if [ ! -f "${SYSCONFDIR}/ssh_config" ]
 then
   echo "Generating ${SYSCONFDIR}/ssh_config file"
   cat > ${SYSCONFDIR}/ssh_config << EOF
-# This is ssh client systemwide configuration file.  This file provides 
-# defaults for users, and the values can be changed in per-user configuration
-# files or on the command line.
+# This is the ssh client system-wide configuration file.  See
+# ssh_config(5) for more information.  This file provides defaults for
+# users, and the values can be changed in per-user configuration files
+# or on the command line.
 
 # Configuration data is parsed as follows:
 #  1. command line options
@@ -237,20 +280,19 @@ then
 #   ForwardAgent no
 #   ForwardX11 no
 #   RhostsAuthentication no
-#   RhostsRSAAuthentication yes
+#   RhostsRSAAuthentication no
 #   RSAAuthentication yes
 #   PasswordAuthentication yes
-#   FallBackToRsh no
-#   UseRsh no
 #   BatchMode no
 #   CheckHostIP yes
-#   StrictHostKeyChecking yes
+#   StrictHostKeyChecking ask
 #   IdentityFile ~/.ssh/identity
 #   IdentityFile ~/.ssh/id_dsa
 #   IdentityFile ~/.ssh/id_rsa
 #   Port 22
 #   Protocol 2,1
-#   Cipher blowfish
+#   Cipher 3des
+#   Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
 #   EscapeChar ~
 EOF
   if [ "$port_number" != "22" ]
@@ -271,17 +313,75 @@ then
     then
       echo "Can't overwrite. ${SYSCONFDIR}/sshd_config is write protected."
     fi
+  else
+    grep -q UsePrivilegeSeparation ${SYSCONFDIR}/sshd_config && privsep_configured=yes
   fi
 fi
 
-# Create default sshd_config from here script
+# Prior to creating or modifying sshd_config, care for privilege separation
+
+if [ "$privsep_configured" != "yes" ]
+then
+  if [ $_nt -gt 0 ]
+  then
+    echo "Privilege separation is set to yes by default since OpenSSH 3.3."
+    echo "However, this requires a non-privileged account called 'sshd'."
+    echo "For more info on privilege separation read /usr/doc/openssh/README.privsep."
+    echo
+    if request "Shall privilege separation be used?"
+    then
+      privsep_used=yes
+      grep -q '^sshd:' ${SYSCONFDIR}/passwd && sshd_in_passwd=yes
+      net user sshd >/dev/null 2>&1 && sshd_in_sam=yes
+      if [ "$sshd_in_passwd" != "yes" ]
+      then
+        if [ "$sshd_in_sam" != "yes" ]
+       then
+         echo "Warning: The following function requires administrator privileges!"
+         if request "Shall this script create a local user 'sshd' on this machine?"
+         then
+           dos_var_empty=`cygpath -w /var/empty`
+           net user sshd /add /fullname:"sshd privsep" "/homedir:$dos_var_empty" /active:no > /dev/null 2>&1 && sshd_in_sam=yes
+           if [ "$sshd_in_sam" != "yes" ]
+           then
+             echo "Warning: Creating the user 'sshd' failed!"
+           fi
+         fi
+       fi
+       if [ "$sshd_in_sam" != "yes" ]
+       then
+         echo "Warning: Can't create user 'sshd' in ${SYSCONFDIR}/passwd!"
+         echo "         Privilege separation set to 'no' again!"
+         echo "         Check your ${SYSCONFDIR}/sshd_config file!"
+         privsep_used=no
+       else
+         mkpasswd -l -u sshd | sed -e 's/bash$/false/' >> ${SYSCONFDIR}/passwd
+       fi
+      fi
+    else
+      privsep_used=no
+    fi
+  else
+    # On 9x don't use privilege separation.  Since security isn't
+    # available it just adds useless addtional processes.
+    privsep_used=no
+  fi
+fi
+
+# Create default sshd_config from here script or modify to add the
+# missing privsep configuration option
 
 if [ ! -f "${SYSCONFDIR}/sshd_config" ]
 then
   echo "Generating ${SYSCONFDIR}/sshd_config file"
   cat > ${SYSCONFDIR}/sshd_config << EOF
-# This is the sshd server system-wide configuration file.  See sshd(8)
-# for more information.
+# This is the sshd server system-wide configuration file.  See
+# sshd_config(5) for more information.
+
+# The strategy used for options in the default sshd_config shipped with
+# OpenSSH is to specify options with their default value where
+# possible, but leave them commented.  Uncommented options change a
+# default value.
 
 Port $port_number
 #Protocol 2,1
@@ -289,66 +389,77 @@ Port $port_number
 #ListenAddress ::
 
 # HostKey for protocol version 1
-HostKey /etc/ssh_host_key
+#HostKey ${SYSCONFDIR}/ssh_host_key
 # HostKeys for protocol version 2
-HostKey /etc/ssh_host_rsa_key
-HostKey /etc/ssh_host_dsa_key
+#HostKey ${SYSCONFDIR}/ssh_host_rsa_key
+#HostKey ${SYSCONFDIR}/ssh_host_dsa_key
 
 # Lifetime and size of ephemeral version 1 server ke
-KeyRegenerationInterval 3600
-ServerKeyBits 768
+#KeyRegenerationInterval 3600
+#ServerKeyBits 768
 
 # Logging
-SyslogFacility AUTH
-LogLevel INFO
 #obsoletes QuietMode and FascistLogging
+#SyslogFacility AUTH
+#LogLevel INFO
 
 # Authentication:
 
-LoginGraceTime 600
-PermitRootLogin yes
+#LoginGraceTime 600
+#PermitRootLogin yes
 # The following setting overrides permission checks on host key files
 # and directories. For security reasons set this to "yes" when running
 # NT/W2K, NTFS and CYGWIN=ntsec.
 StrictModes no
 
-RSAAuthentication yes
-PubkeyAuthentication yes
+#RSAAuthentication yes
+#PubkeyAuthentication yes
 #AuthorizedKeysFile     %h/.ssh/authorized_keys
 
 # rhosts authentication should not be used
-RhostsAuthentication no
+#RhostsAuthentication no
 # Don't read ~/.rhosts and ~/.shosts files
-IgnoreRhosts yes
-# For this to work you will also need host keys in /etc/ssh_known_hosts
-RhostsRSAAuthentication no
+#IgnoreRhosts yes
+# For this to work you will also need host keys in ${SYSCONFDIR}/ssh_known_hosts
+#RhostsRSAAuthentication no
 # similar for protocol version 2
-HostbasedAuthentication no
-# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
-#IgnoreUserKnownHosts yes
+#HostbasedAuthentication no
+# Change to yes if you don't trust ~/.ssh/known_hosts for
+# RhostsRSAAuthentication and HostbasedAuthentication
+#IgnoreUserKnownHosts no
 
 # To disable tunneled clear text passwords, change to no here!
-PasswordAuthentication yes
-PermitEmptyPasswords no
-
-X11Forwarding no
-X11DisplayOffset 10
-PrintMotd yes
-#PrintLastLog no
-KeepAlive yes
+#PasswordAuthentication yes
+#PermitEmptyPasswords no
+
+# Change to no to disable s/key passwords
+#ChallengeResponseAuthentication yes
+
+#X11Forwarding no
+#X11DisplayOffset 10
+#X11UseLocalhost yes
+#PrintMotd yes
+#PrintLastLog yes
+#KeepAlive yes
 #UseLogin no
+UsePrivilegeSeparation $privsep_used
+#Compression yes
 
-#MaxStartups 10:30:60
-#Banner /etc/issue.net
-#ReverseMappingCheck yes
+#MaxStartups 10
+# no default banner path
+#Banner /some/path
+#VerifyReverseMapping no
 
+# override default of no subsystems
 Subsystem      sftp    /usr/sbin/sftp-server
 EOF
+elif [ "$privsep_configured" != "yes" ]
+then
+  echo >> ${SYSCONFDIR}/sshd_config
+  echo "UsePrivilegeSeparation $privsep_used" >> ${SYSCONFDIR}/sshd_config
 fi
 
 # Care for services file
-_sys="`uname -a`"
-_nt=`expr "$_sys" : "CYGWIN_NT"`
 if [ $_nt -gt 0 ]
 then
   _wservices="${SYSTEMROOT}\\system32\\drivers\\etc\\services"
@@ -403,8 +514,8 @@ umount "${_services}"
 umount "${_serv_tmp}"
 
 # Care for inetd.conf file
-_inetcnf="/etc/inetd.conf"
-_inetcnf_tmp="/etc/inetd.conf.$$"
+_inetcnf="${SYSCONFDIR}/inetd.conf"
+_inetcnf_tmp="${SYSCONFDIR}/inetd.conf.$$"
 
 if [ -f "${_inetcnf}" ]
 then
@@ -442,25 +553,6 @@ then
   fi
 fi
 
-# Create /var/log and /var/log/lastlog if not already existing
-
-if [ -f /var/log ]
-then
-  echo "Creating /var/log failed\!"
-else
-  if [ ! -d /var/log ]
-  then
-    mkdir /var/log
-  fi
-  if [ -d /var/log/lastlog ]
-  then
-    echo "Creating /var/log/lastlog failed\!"
-  elif [ ! -f /var/log/lastlog ]
-  then
-    cat /dev/null > /var/log/lastlog
-  fi
-fi
-
 # On NT ask if sshd should be installed as service
 if [ $_nt -gt 0 ]
 then
@@ -477,7 +569,7 @@ then
     [ -z "${_cygwin}" ] && _cygwin="binmode ntsec tty"
     if cygrunsrv -I sshd -d "CYGWIN sshd" -p /usr/sbin/sshd -a -D -e "CYGWIN=${_cygwin}"
     then
-      chown system /etc/ssh*
+      chown system ${SYSCONFDIR}/ssh*
       echo
       echo "The service has been installed under LocalSystem account."
     fi
diff --git a/openssh/contrib/gnome-ssh-askpass1.c b/openssh/contrib/gnome-ssh-askpass1.c
new file mode 100644 (file)
index 0000000..b6b342b
--- /dev/null
@@ -0,0 +1,171 @@
+/*
+ * Copyright (c) 2000-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.
+ */
+
+/*
+ * This is a simple GNOME SSH passphrase grabber. To use it, set the 
+ * environment variable SSH_ASKPASS to point to the location of 
+ * gnome-ssh-askpass before calling "ssh-add < /dev/null". 
+ *
+ * There is only two run-time options: if you set the environment variable
+ * "GNOME_SSH_ASKPASS_GRAB_SERVER=true" then gnome-ssh-askpass will grab
+ * the X server. If you set "GNOME_SSH_ASKPASS_GRAB_POINTER=true", then the 
+ * pointer will be grabbed too. These may have some benefit to security if 
+ * you don't trust your X server. We grab the keyboard always.
+ */
+
+/*
+ * Compile with:
+ *
+ * cc `gnome-config --cflags gnome gnomeui` \
+ *    gnome-ssh-askpass1.c -o gnome-ssh-askpass \
+ *    `gnome-config --libs gnome gnomeui`
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <gnome.h>
+#include <X11/Xlib.h>
+#include <gdk/gdkx.h>
+
+void
+report_failed_grab (void)
+{
+       GtkWidget *err;
+
+       err = gnome_message_box_new("Could not grab keyboard or mouse.\n"
+               "A malicious client may be eavesdropping on your session.",
+                                   GNOME_MESSAGE_BOX_ERROR, "EXIT", NULL);
+       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
+       gtk_object_set(GTK_OBJECT(err), "type", GTK_WINDOW_POPUP, NULL);
+
+       gnome_dialog_run_and_close(GNOME_DIALOG(err));
+}
+
+int
+passphrase_dialog(char *message)
+{
+       char *passphrase;
+       char **messages;
+       int result, i, grab_server, grab_pointer;
+       GtkWidget *dialog, *entry, *label;
+
+       grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
+       grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL);
+
+       dialog = gnome_dialog_new("OpenSSH", GNOME_STOCK_BUTTON_OK,
+           GNOME_STOCK_BUTTON_CANCEL, NULL);
+
+       messages = g_strsplit(message, "\\n", 0);
+       if (messages)
+               for(i = 0; messages[i]; i++) {
+                       label = gtk_label_new(messages[i]);
+                       gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox),
+                           label, FALSE, FALSE, 0);
+               }
+
+       entry = gtk_entry_new();
+       gtk_box_pack_start(GTK_BOX(GNOME_DIALOG(dialog)->vbox), entry, FALSE, 
+           FALSE, 0);
+       gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
+       gtk_widget_grab_focus(entry);
+
+       /* Center window and prepare for grab */
+       gtk_object_set(GTK_OBJECT(dialog), "type", GTK_WINDOW_POPUP, NULL);
+       gnome_dialog_set_default(GNOME_DIALOG(dialog), 0);
+       gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
+       gtk_window_set_policy(GTK_WINDOW(dialog), FALSE, FALSE, TRUE);
+       gnome_dialog_close_hides(GNOME_DIALOG(dialog), TRUE);
+       gtk_container_set_border_width(GTK_CONTAINER(GNOME_DIALOG(dialog)->vbox),
+           GNOME_PAD);
+       gtk_widget_show_all(dialog);
+
+       /* Grab focus */
+       if (grab_server)
+               XGrabServer(GDK_DISPLAY());
+       if (grab_pointer && gdk_pointer_grab(dialog->window, TRUE, 0, 
+           NULL, NULL, GDK_CURRENT_TIME))
+               goto nograb;
+       if (gdk_keyboard_grab(dialog->window, FALSE, GDK_CURRENT_TIME))
+               goto nograbkb;
+
+       /* Make <enter> close dialog */
+       gnome_dialog_editable_enters(GNOME_DIALOG(dialog), GTK_EDITABLE(entry));
+
+       /* Run dialog */
+       result = gnome_dialog_run(GNOME_DIALOG(dialog));
+
+       /* Ungrab */
+       if (grab_server)
+               XUngrabServer(GDK_DISPLAY());
+       if (grab_pointer)
+               gdk_pointer_ungrab(GDK_CURRENT_TIME);
+       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
+       gdk_flush();
+
+       /* Report passphrase if user selected OK */
+       passphrase = gtk_entry_get_text(GTK_ENTRY(entry));
+       if (result == 0)
+               puts(passphrase);
+               
+       /* Zero passphrase in memory */
+       memset(passphrase, '\0', strlen(passphrase));
+       gtk_entry_set_text(GTK_ENTRY(entry), passphrase);
+                       
+       gnome_dialog_close(GNOME_DIALOG(dialog));
+       return (result == 0 ? 0 : -1);
+
+       /* At least one grab failed - ungrab what we got, and report
+          the failure to the user.  Note that XGrabServer() cannot
+          fail.  */
+ nograbkb:
+       gdk_pointer_ungrab(GDK_CURRENT_TIME);
+ nograb:
+       if (grab_server)
+               XUngrabServer(GDK_DISPLAY());
+       gnome_dialog_close(GNOME_DIALOG(dialog));
+       
+       report_failed_grab();
+       return (-1);
+}
+
+int
+main(int argc, char **argv)
+{
+       char *message;
+       int result;
+
+       gnome_init("GNOME ssh-askpass", "0.1", argc, argv);
+
+       if (argc == 2)
+               message = argv[1];
+       else
+               message = "Enter your OpenSSH passphrase:";
+
+       setvbuf(stdout, 0, _IONBF, 0);
+       result = passphrase_dialog(message);
+
+       return (result);
+}
diff --git a/openssh/contrib/gnome-ssh-askpass2.c b/openssh/contrib/gnome-ssh-askpass2.c
new file mode 100644 (file)
index 0000000..89a412a
--- /dev/null
@@ -0,0 +1,204 @@
+/*
+ * Copyright (c) 2000-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.
+ */
+
+/* GTK2 support by Nalin Dahyabhai <nalin@redhat.com> */
+
+/*
+ * This is a simple GNOME SSH passphrase grabber. To use it, set the 
+ * environment variable SSH_ASKPASS to point to the location of 
+ * gnome-ssh-askpass before calling "ssh-add < /dev/null". 
+ *
+ * There is only two run-time options: if you set the environment variable
+ * "GNOME_SSH_ASKPASS_GRAB_SERVER=true" then gnome-ssh-askpass will grab
+ * the X server. If you set "GNOME_SSH_ASKPASS_GRAB_POINTER=true", then the 
+ * pointer will be grabbed too. These may have some benefit to security if 
+ * you don't trust your X server. We grab the keyboard always.
+ */
+
+/*
+ * Compile with:
+ *
+ * cc `pkg-config --cflags gtk+-2.0` \
+ *    gnome-ssh-askpass2.c -o gnome-ssh-askpass \
+ *    `pkg-config --libs gtk+-2.0`
+ *
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <X11/Xlib.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
+static void
+report_failed_grab (const char *what)
+{
+       GtkWidget *err;
+
+       err = gtk_message_dialog_new(NULL, 0,
+                                    GTK_MESSAGE_ERROR,
+                                    GTK_BUTTONS_CLOSE,
+                                    "Could not grab %s. "
+                                    "A malicious client may be eavesdropping "
+                                    "on your session.", what);
+       gtk_window_set_position(GTK_WINDOW(err), GTK_WIN_POS_CENTER);
+       gtk_label_set_line_wrap(GTK_LABEL((GTK_MESSAGE_DIALOG(err))->label),
+                               TRUE);
+
+       gtk_dialog_run(GTK_DIALOG(err));
+
+       gtk_widget_destroy(err);
+}
+
+static void
+ok_dialog(GtkWidget *entry, gpointer dialog)
+{
+       g_return_if_fail(GTK_IS_DIALOG(dialog));
+       gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+}
+
+static int
+passphrase_dialog(char *message)
+{
+       const char *failed;
+       char *passphrase, *local;
+       char **messages;
+       int result, i, grab_server, grab_pointer;
+       GtkWidget *dialog, *entry, *label;
+       GdkGrabStatus status;
+
+       grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
+       grab_pointer = (getenv("GNOME_SSH_ASKPASS_GRAB_POINTER") != NULL);
+
+       dialog = gtk_message_dialog_new(NULL, 0,
+                                       GTK_MESSAGE_QUESTION,
+                                       GTK_BUTTONS_OK_CANCEL,
+                                       "%s",
+                                       message);
+
+       entry = gtk_entry_new();
+       gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, FALSE, 
+           FALSE, 0);
+       gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
+       gtk_widget_grab_focus(entry);
+       gtk_widget_show(entry);
+
+       gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH");
+       gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
+       gtk_label_set_line_wrap(GTK_LABEL((GTK_MESSAGE_DIALOG(dialog))->label),
+                               TRUE);
+
+       /* Make <enter> close dialog */
+       gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
+       g_signal_connect(G_OBJECT(entry), "activate",
+                        G_CALLBACK(ok_dialog), dialog);
+
+       /* Grab focus */
+       gtk_widget_show_now(dialog);
+       if (grab_server) {
+               gdk_x11_grab_server();
+       }
+       if (grab_pointer) {
+               status =  gdk_pointer_grab((GTK_WIDGET(dialog))->window, TRUE,
+                                          0, NULL, NULL, GDK_CURRENT_TIME);
+               if (status != GDK_GRAB_SUCCESS) {
+                       failed = "mouse";
+                       goto nograb;
+               }
+       }
+       status = gdk_keyboard_grab((GTK_WIDGET(dialog))->window, FALSE,
+                                  GDK_CURRENT_TIME);
+       if (status != GDK_GRAB_SUCCESS) {
+               failed = "keyboard";
+               goto nograbkb;
+       }
+       result = gtk_dialog_run(GTK_DIALOG(dialog));
+
+       /* Ungrab */
+       if (grab_server)
+               XUngrabServer(GDK_DISPLAY());
+       if (grab_pointer)
+               gdk_pointer_ungrab(GDK_CURRENT_TIME);
+       gdk_keyboard_ungrab(GDK_CURRENT_TIME);
+       gdk_flush();
+
+       /* Report passphrase if user selected OK */
+       passphrase = g_strdup(gtk_entry_get_text(GTK_ENTRY(entry)));
+       if (result == GTK_RESPONSE_OK) {
+               local = g_locale_from_utf8(passphrase, strlen(passphrase),
+                                          NULL, NULL, NULL);
+               if (local != NULL) {
+                       puts(local);
+                       memset(local, '\0', strlen(local));
+                       g_free(local);
+               } else {
+                       puts(passphrase);
+               }
+       }
+               
+       /* Zero passphrase in memory */
+       memset(passphrase, '\b', strlen(passphrase));
+       gtk_entry_set_text(GTK_ENTRY(entry), passphrase);
+       memset(passphrase, '\0', strlen(passphrase));
+       g_free(passphrase);
+                       
+       gtk_widget_destroy(dialog);
+       return (result == GTK_RESPONSE_OK ? 0 : -1);
+
+       /* At least one grab failed - ungrab what we got, and report
+          the failure to the user.  Note that XGrabServer() cannot
+          fail.  */
+ nograbkb:
+       gdk_pointer_ungrab(GDK_CURRENT_TIME);
+ nograb:
+       if (grab_server)
+               XUngrabServer(GDK_DISPLAY());
+       gtk_widget_destroy(dialog);
+       
+       report_failed_grab(failed);
+
+       return (-1);
+}
+
+int
+main(int argc, char **argv)
+{
+       char *message;
+       int result;
+
+       gtk_init(&argc, &argv);
+
+       if (argc > 1) {
+               message = g_strjoinv(" ", argv + 1);
+       } else {
+               message = g_strdup("Enter your OpenSSH passphrase:");
+       }
+
+       setvbuf(stdout, 0, _IONBF, 0);
+       result = passphrase_dialog(message);
+       g_free(message);
+
+       return (result);
+}
index b73fb929f83380bcb81b0ea9abe7006ca6531ffe..e7005064d408b33b5f82bfecb189a5c8f54836ec 100644 (file)
@@ -1,4 +1,4 @@
-%define ver 3.4p1
+%define ver 3.5p1
 %define rel 1
 
 # OpenSSH privilege separation requires a user & group ID
@@ -20,6 +20,9 @@
 # Do we want smartcard support (1=yes 0=no)
 %define scard 0
 
+# Use GTK2 instead of GNOME in gnome-ssh-askpass
+%define gtk2 0
+
 # Is this build for RHL 6.x?
 %define build6x 0
 
@@ -86,7 +89,7 @@ PreReq: initscripts >= 5.20
 %endif
 BuildPreReq: perl, openssl-devel, sharutils, tcp_wrappers
 BuildPreReq: /bin/login
-%if %{build6x}
+%if %{build6x}
 BuildPreReq: glibc-devel, pam
 %else
 BuildPreReq: db1-devel, /usr/include/security/pam_appl.h
@@ -95,7 +98,7 @@ BuildPreReq: db1-devel, /usr/include/security/pam_appl.h
 BuildPreReq: XFree86-devel
 %endif
 %if ! %{no_gnome_askpass}
-BuildPreReq: gnome-libs-devel
+BuildPreReq: pkgconfig
 %endif
 %if %{kerberos5}
 BuildPreReq: krb5-devel
@@ -220,11 +223,23 @@ make
 popd
 %endif
 
+# Define a variable to toggle gnome1/gtk2 building.  This is necessary
+# because RPM doesn't handle nested %if statements.
+%if %{gtk2}
+       gtk2=yes
+%else
+       gtk2=no
+%endif
+
 %if ! %{no_gnome_askpass}
 pushd contrib
-gcc $RPM_OPT_FLAGS `gnome-config --cflags gnome gnomeui` \
-        gnome-ssh-askpass.c -o gnome-ssh-askpass \
-        `gnome-config --libs gnome gnomeui`
+if [ $gtk2 = yes ] ; then
+       make gnome-ssh-askpass2
+       mv gnome-ssh-askpass2 gnome-ssh-askpass
+else
+       make gnome-ssh-askpass1
+       mv gnome-ssh-askpass1 gnome-ssh-askpass
+fi
 popd
 %endif
 
@@ -255,6 +270,10 @@ ln -s x11-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/ssh-askpass
 install -s contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome-ssh-askpass
 %endif
 
+%if ! %{scard}
+        rm -f $RPM_BUILD_ROOT/usr/share/openssh/Ssh.bin
+%endif
+
 install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
 install -m 755 contrib/redhat/gnome-ssh-askpass.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
 install -m 755 contrib/redhat/gnome-ssh-askpass.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
@@ -338,7 +357,7 @@ fi
 %attr(-,root,root) %{_bindir}/slogin
 %attr(-,root,root) %{_mandir}/man1/slogin.1*
 %if ! %{rescue}
-%attr(0755,root,root) %{_bindir}/ssh-agent
+%attr(2755,root,nobody) %{_bindir}/ssh-agent
 %attr(0755,root,root) %{_bindir}/ssh-add
 %attr(0755,root,root) %{_bindir}/ssh-keyscan
 %attr(0755,root,root) %{_bindir}/sftp
@@ -381,6 +400,12 @@ fi
 %endif
 
 %changelog
+* Wed Oct 01 2002 Damien Miller <djm@mindrot.org>
+- Install ssh-agent setgid nobody to prevent ptrace() key theft attacks
+
+* Mon Sep 30 2002 Damien Miller <djm@mindrot.org>
+- Use contrib/ Makefile for building askpass programs
+
 * Fri Jun 21 2002 Damien Miller <djm@mindrot.org>
 - Merge in spec changes from seba@iq.pl (Sebastian Pachuta)
 - Add new {ssh,sshd}_config.5 manpages
index 1be6ed8d1dcb8fadbd5a71ee67d9932dbbf7d979..c41b3f963cbaa50068879ce31c57ff74ce62e8d3 100755 (executable)
@@ -11,13 +11,18 @@ umask 022
 # Options for building the package
 # You can create a config.local with your customized options
 #
-# uncommenting TEST_DIR and using configure--prefix=/var/tmp and 
+# uncommenting TEST_DIR and using
+# configure --prefix=/var/tmp --with-privsep-path=/var/tmp/empty
+# and 
 # PKGNAME=tOpenSSH should allow testing a package without interfering
-# with a real OpenSSH package on a system.
+# with a real OpenSSH package on a system. This is not needed on systems
+# that support the -R option to pkgadd.
 #TEST_DIR=/var/tmp     # leave commented out for production build
 PKGNAME=OpenSSH
 SYSVINIT_NAME=opensshd
 MAKE=${MAKE:="make"}
+SSHDUID=67     # Default privsep uid
+SSHDGID=67     # Default privsep gid
 # uncomment these next two as needed
 #PERMIT_ROOT_LOGIN=no
 #X11_FORWARDING=yes
@@ -55,7 +60,7 @@ SYSTEM_DIR="/etc      \
 /var/tmp               \
 /tmp"
 
-# We may need to buiild as root so we make sure PATH is set up
+# We may need to build as root so we make sure PATH is set up
 # only set the path if it's not set already
 [ -d /usr/local/bin ]  &&  {
        echo $PATH | grep ":/usr/local/bin"  > /dev/null 2>&1
@@ -96,6 +101,19 @@ do
         eval $confvar=`grep "^$confvar=" Makefile | cut -d = -f 2`
 done
 
+
+## Collect value of privsep user
+for confvar in SSH_PRIVSEP_USER
+do
+        eval $confvar=`awk '/#define[ \t]'$confvar'/{print $3}' config.h`
+done
+
+## Set privsep defaults if not defined
+if [ -z "$SSH_PRIVSEP_USER" ]
+then
+        SSH_PRIVSEP_USER=sshd
+fi
+
 ## Extract common info requires for the 'info' part of the package.
 VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//'`
 
@@ -106,7 +124,8 @@ case ${UNAME_S} in
                RCS_D=yes
                DEF_MSG="(default: n)"
                ;;
-       *)      ARCH=`uname -m` ;;
+       *)      ARCH=`uname -m`
+               DEF_MSG="\n" ;;
 esac
 
 ## Setup our run level stuff while we are at it.
@@ -171,13 +190,16 @@ echo "Building postinstall file..."
 cat > postinstall << _EOF
 #! /sbin/sh
 #
-[ -f ${sysconfdir}/ssh_config ]  ||  \\
-       cp -p ${sysconfdir}/ssh_config.default ${sysconfdir}/ssh_config
-[ -f ${sysconfdir}/sshd_config ]  ||  \\
-       cp -p ${sysconfdir}/sshd_config.default ${sysconfdir}/sshd_config
-[ -f ${sysconfdir}/ssh_prng_cmds.default ]  &&  {
-       [ -f ${sysconfdir}/ssh_prng_cmds ]  ||  \\
-       cp -p ${sysconfdir}/ssh_prng_cmds.default ${sysconfdir}/ssh_prng_cmds
+[ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config ]  ||  \\
+       cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config.default \\
+               \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_config
+[ -f \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config ]  ||  \\
+       cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config.default \\
+               \${PKG_INSTALL_ROOT}${sysconfdir}/sshd_config
+[ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default ]  &&  {
+       [ -f \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds ]  ||  \\
+       cp -p \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds.default \\
+               \${PKG_INSTALL_ROOT}${sysconfdir}/ssh_prng_cmds
 }
 
 # make rc?.d dirs only if we are doing a test install
@@ -191,23 +213,75 @@ cat > postinstall << _EOF
 if [ "\${USE_SYM_LINKS}" = yes ]
 then
        [ "$RCS_D" = yes ]  &&  \
-installf ${PKGNAME} $TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
-       installf ${PKGNAME} $TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
-       installf ${PKGNAME} $TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
-       installf ${PKGNAME} $TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
+installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=../init.d/${SYSVINIT_NAME} s
 else
        [ "$RCS_D" = yes ]  &&  \
-installf ${PKGNAME} $TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
-       installf ${PKGNAME} $TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
-       installf ${PKGNAME} $TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
-       installf ${PKGNAME} $TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
+installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rcS.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc0.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc1.d/K30${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
+       installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR/etc/rc2.d/S98${SYSVINIT_NAME}=$TEST_DIR/etc/init.d/${SYSVINIT_NAME} l
 fi
 
 # If piddir doesn't exist we add it. (Ie. --with-pid-dir=/var/opt/ssh)
-[ -d $piddir ]  ||  installf ${PKGNAME} $TEST_DIR$piddir d 755 root sys
+[ -d $piddir ]  ||  installf ${PKGNAME} \${PKG_INSTALL_ROOT}$TEST_DIR$piddir d 755 root sys
 
 installf -f ${PKGNAME}
 
+# Use chroot to handle PKG_INSTALL_ROOT
+if [ ! -z "\${PKG_INSTALL_ROOT}" ]
+then
+       chroot="chroot \${PKG_INSTALL_ROOT}"
+fi
+# If this is a test build, we will skip the groupadd/useradd/passwd commands
+if [ ! -z "${TEST_DIR}" ]
+then
+       chroot=echo
+fi
+
+if egrep '^[ \t]*UsePrivilegeSeparation[ \t]+no' \${PKG_INSTALL_ROOT}/$sysconfdir/sshd_config >/dev/null
+then
+        echo "UsePrivilegeSeparation disabled in config, not creating PrivSep user"
+        echo "or group."
+else
+        echo "UsePrivilegeSeparation enabled in config (or defaulting to on)."
+
+        # create group if required
+        if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
+        then
+                echo "PrivSep group $SSH_PRIVSEP_USER already exists."
+        else
+               # Use gid of 67 if possible
+               if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/group | egrep '^'$SSHDGID'\$' >/dev/null
+               then
+                       :
+               else
+                       sshdgid="-g $SSHDGID"
+               fi
+                echo "Creating PrivSep group $SSH_PRIVSEP_USER."
+                \$chroot /usr/sbin/groupadd \$sshdgid $SSH_PRIVSEP_USER
+        fi
+
+        # Create user if required
+        if cut -f1 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
+        then
+                echo "PrivSep user $SSH_PRIVSEP_USER already exists."
+        else
+               # Use uid of 67 if possible
+               if cut -f3 -d: \${PKG_INSTALL_ROOT}/etc/passwd | egrep '^'$SSHDGID'\$' >/dev/null
+               then
+                       :
+               else
+                       sshduid="-u $SSHDUID"
+               fi
+                echo "Creating PrivSep user $SSH_PRIVSEP_USER."
+               \$chroot /usr/sbin/useradd -c 'SSHD PrivSep User' -s /bin/false -g $SSH_PRIVSEP_USER \$sshduid $SSH_PRIVSEP_USER
+               \$chroot /usr/bin/passwd -l $SSH_PRIVSEP_USER
+        fi
+fi
+
 [ "\${POST_INS_START}" = "yes" ]  &&  ${TEST_DIR}/etc/init.d/${SYSVINIT_NAME} start
 exit 0
 _EOF
index 212254dc8bcb96fc8a25205080fc96847b14d110..e7ca2489f4fa34faca5a7fb4acdbdf8f04db8225 100755 (executable)
@@ -3,11 +3,8 @@
 #
 # Stripped PRNGd out of it for the time being.
 
-AWK=/usr/bin/awk
 CAT=/usr/bin/cat
 KILL=/usr/bin/kill
-PS=/usr/bin/ps
-XARGS=/usr/bin/xargs
 
 prefix=%%openSSHDir%%
 etcdir=%%configDir%%
@@ -20,12 +17,6 @@ HOST_KEY_RSA1=$etcdir/ssh_host_key
 HOST_KEY_DSA=$etcdir/ssh_host_dsa_key
 HOST_KEY_RSA=$etcdir/ssh_host_rsa_key
 
-killproc() {
-   _procname=$1
-   _signal=$2
-   ${PS} -u root | ${AWK} '/'"$_procname"'$/ {print $1}' | ${XARGS} ${KILL}
-}
-
 
 checkkeys() {
     if [ ! -f $HOST_KEY_RSA1 ]; then
@@ -46,8 +37,7 @@ stop_service() {
     if [  ${PID:=0} -gt 1 -a  ! "X$PID" = "X "  ]; then
         ${KILL} ${PID}
     else
-        echo "Unable to read PID file, killing using alternate method"
-        killproc sshd TERM
+        echo "Unable to read PID file"
     fi
 }
 
index 126dac335cc7609727d1c52b118e54c1da798b3a..3ae1dfc809531877a32a0821aac08e0d772338f1 100644 (file)
@@ -1,6 +1,6 @@
 Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
 Name: openssh
-Version: 3.4p1
+Version: 3.5p1
 URL: http://www.openssh.com/
 Release: 1
 Source0: openssh-%{version}.tar.gz
index 3f5b28a2f447cdf991b8ef3482046563e57199fb..69d8105bef53483735f108c3d9ebc8c9dc02cbdb 100644 (file)
@@ -102,7 +102,7 @@ SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
 including rpc/rpc.h breaks Solaris 6
 */
 #ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK ((ulong)0x7f000001)
+#define INADDR_LOOPBACK ((u_long)0x7f000001)
 #endif
 
 /* Types */
@@ -124,7 +124,7 @@ typedef char int8_t;
 # if (SIZEOF_SHORT_INT == 2)
 typedef short int int16_t;
 # else
-#  ifdef _CRAY
+#  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
-#  ifdef _CRAY
+#  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
-#   ifdef _CRAY
+#   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
-#   ifdef _CRAY
+#   ifdef _UNICOS
 typedef unsigned long  u_int32_t;
 #   else
 #    error "32 bit int type not found."
@@ -216,6 +216,10 @@ typedef unsigned char u_char;
 # define HAVE_U_CHAR
 #endif /* HAVE_U_CHAR */
 
+#ifndef SIZE_T_MAX
+#define SIZE_T_MAX ULONG_MAX
+#endif /* SIZE_T_MAX */
+
 #ifndef HAVE_SIZE_T
 typedef unsigned int size_t;
 # define HAVE_SIZE_T
index 33187e02824ea54803f2e56f353caf735dda7cd7..6ec37867a0b0d1dc28c6bf1b9ae9b19fc4d1b6dd 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: dh.c,v 1.21 2002/03/06 00:23:27 markus Exp $");
+RCSID("$OpenBSD: dh.c,v 1.22 2002/06/27 08:49:44 markus Exp $");
 
 #include "xmalloc.h"
 
@@ -50,7 +50,7 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg)
        /* Ignore leading whitespace */
        if (*arg == '\0')
                arg = strdelim(&cp);
-       if (!*arg || *arg == '#')
+       if (!arg || !*arg || *arg == '#')
                return 0;
 
        /* time */
index cefff8d627650409b3efcffa1e666b17fadef4e8..dcee03448332bea19f36e2e3cf776a53bc2f87ef 100644 (file)
@@ -36,7 +36,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: hostfile.c,v 1.29 2001/12/18 10:04:21 jakob Exp $");
+RCSID("$OpenBSD: hostfile.c,v 1.30 2002/07/24 16:11:18 markus Exp $");
 
 #include "packet.h"
 #include "match.h"
@@ -91,11 +91,14 @@ hostfile_check_key(int bits, Key *key, const char *host, const char *filename, i
  * in the list of our known hosts. Returns HOST_OK if the host is known and
  * has the specified key, HOST_NEW if the host is not known, and HOST_CHANGED
  * if the host is known but used to have a different host key.
+ *
+ * If no 'key' has been specified and a key of type 'keytype' is known
+ * for the specified host, then HOST_FOUND is returned.
  */
 
-HostStatus
-check_host_in_hostfile(const char *filename, const char *host, Key *key,
-    Key *found, int *numret)
+static HostStatus
+check_host_in_hostfile_by_key_or_type(const char *filename,
+    const char *host, Key *key, int keytype, Key *found, int *numret)
 {
        FILE *f;
        char line[8192];
@@ -105,8 +108,7 @@ check_host_in_hostfile(const char *filename, const char *host, Key *key,
        HostStatus end_return;
 
        debug3("check_host_in_hostfile: filename %s", filename);
-       if (key == NULL)
-               fatal("no key to look up");
+
        /* Open the file containing the list of known hosts. */
        f = fopen(filename, "r");
        if (!f)
@@ -147,12 +149,20 @@ check_host_in_hostfile(const char *filename, const char *host, Key *key,
                 */
                if (!hostfile_read_key(&cp, &kbits, found))
                        continue;
-               if (!hostfile_check_key(kbits, found, host, filename, linenum))
-                       continue;
 
                if (numret != NULL)
                        *numret = linenum;
 
+               if (key == NULL) {
+                       /* we found a key of the requested type */
+                       if (found->type == keytype)
+                               return HOST_FOUND;
+                       continue;
+               }
+
+               if (!hostfile_check_key(kbits, found, host, filename, linenum))
+                       continue;
+
                /* Check if the current key is the same as the given key. */
                if (key_equal(key, found)) {
                        /* Ok, they match. */
@@ -177,6 +187,24 @@ check_host_in_hostfile(const char *filename, const char *host, Key *key,
        return end_return;
 }
 
+HostStatus
+check_host_in_hostfile(const char *filename, const char *host, Key *key,
+    Key *found, int *numret)
+{
+       if (key == NULL)
+               fatal("no key to look up");
+       return (check_host_in_hostfile_by_key_or_type(filename, host, key, 0,
+           found, numret));
+}
+
+int
+lookup_key_in_hostfile_by_type(const char *filename, const char *host,
+    int keytype, Key *found, int *numret)
+{
+       return (check_host_in_hostfile_by_key_or_type(filename, host, NULL,
+           keytype, found, numret) == HOST_FOUND);
+}
+
 /*
  * Appends an entry to the host file.  Returns false if the entry could not
  * be appended.
index 0244fdb53ea49f7556bfd838ff04d041200c6bcb..1df7a22f27c9c8a88f339fb1692c1f573c4997a8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: hostfile.h,v 1.10 2001/12/18 10:04:21 jakob Exp $     */
+/*     $OpenBSD: hostfile.h,v 1.12 2002/09/08 20:24:08 markus Exp $    */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
 #define HOSTFILE_H
 
 typedef enum {
-       HOST_OK, HOST_NEW, HOST_CHANGED
+       HOST_OK, HOST_NEW, HOST_CHANGED, HOST_FOUND
 }       HostStatus;
 
 int     hostfile_read_key(char **, u_int *, Key *);
 HostStatus
 check_host_in_hostfile(const char *, const char *, Key *, Key *, int *);
 int     add_host_to_hostfile(const char *, const char *, Key *);
+int    
+lookup_key_in_hostfile_by_type(const char *, const char *, int , Key *, int *);
 
 #endif
index e20d7a5191354bab6752f355a24cb7a91e2d724f..d7b875c529484c48dedc8e9f25ac9ac2e20a9e16 100644 (file)
@@ -115,6 +115,9 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #ifdef HAVE_SYS_UN_H
 # include <sys/un.h> /* For sockaddr_un */
 #endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
 #ifdef HAVE_SYS_BITYPES_H
 # include <sys/bitypes.h> /* For u_intXX_t */
 #endif
@@ -146,6 +149,14 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 # include <readpassphrase.h>
 #endif
 
+#ifdef HAVE_IA_H
+# include <ia.h>
+#endif
+
+#ifdef HAVE_TMPDIR_H
+# include <tmpdir.h>
+#endif
+
 #include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
 
 #include "defines.h"
index 12edcdc63b39533b00a3a8f0243d9bdbb0b33c90..93a529e125b676d676aa044bd189f1fbe98355d8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kex.h,v 1.31 2002/05/16 22:02:50 markus Exp $ */
+/*     $OpenBSD: kex.h,v 1.32 2002/09/09 14:54:14 markus Exp $ */
 
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -96,7 +96,7 @@ struct Newkeys {
 };
 struct Kex {
        u_char  *session_id;
-       int     session_id_len;
+       u_int   session_id_len;
        Newkeys *newkeys[MODE_MAX];
        int     we_need;
        int     server;
index fb1f8410a19000be4f34c688cf98dc68684e8b8d..9806a729a8a698b62359b0ad42d9d48e356bdaba 100644 (file)
@@ -32,7 +32,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: key.c,v 1.45 2002/06/23 03:26:19 deraadt Exp $");
+RCSID("$OpenBSD: key.c,v 1.49 2002/09/09 14:54:14 markus Exp $");
 
 #include <openssl/evp.h>
 
@@ -171,7 +171,7 @@ key_equal(Key *a, Key *b)
        return 0;
 }
 
-static u_char*
+static u_char *
 key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
 {
        const EVP_MD *md = NULL;
@@ -227,8 +227,8 @@ key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
        return retval;
 }
 
-static char*
-key_fingerprint_hex(u_chardgst_raw, u_int dgst_raw_len)
+static char *
+key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len)
 {
        char *retval;
        int i;
@@ -244,8 +244,8 @@ key_fingerprint_hex(u_char* dgst_raw, u_int dgst_raw_len)
        return retval;
 }
 
-static char*
-key_fingerprint_bubblebabble(u_chardgst_raw, u_int dgst_raw_len)
+static char *
+key_fingerprint_bubblebabble(u_char *dgst_raw, u_int dgst_raw_len)
 {
        char vowels[] = { 'a', 'e', 'i', 'o', 'u', 'y' };
        char consonants[] = { 'b', 'c', 'd', 'f', 'g', 'h', 'k', 'l', 'm',
@@ -291,7 +291,7 @@ key_fingerprint_bubblebabble(u_char* dgst_raw, u_int dgst_raw_len)
        return retval;
 }
 
-char*
+char *
 key_fingerprint(Key *k, enum fp_type dgst_type, enum fp_rep dgst_rep)
 {
        char *retval = NULL;
@@ -494,7 +494,8 @@ key_write(Key *key, FILE *f)
 {
        int n, success = 0;
        u_int len, bits = 0;
-       u_char *blob, *uu;
+       u_char *blob;
+       char *uu;
 
        if (key->type == KEY_RSA1 && key->rsa != NULL) {
                /* size of modulus 'n' */
@@ -729,7 +730,6 @@ key_to_blob(Key *key, u_char **blobp, u_int *lenp)
 {
        Buffer b;
        int len;
-       u_char *buf;
 
        if (key == NULL) {
                error("key_to_blob: key == NULL");
@@ -755,14 +755,14 @@ key_to_blob(Key *key, u_char **blobp, u_int *lenp)
                return 0;
        }
        len = buffer_len(&b);
-       buf = xmalloc(len);
-       memcpy(buf, buffer_ptr(&b), len);
-       memset(buffer_ptr(&b), 0, len);
-       buffer_free(&b);
        if (lenp != NULL)
                *lenp = len;
-       if (blobp != NULL)
-               *blobp = buf;
+       if (blobp != NULL) {
+               *blobp = xmalloc(len);
+               memcpy(*blobp, buffer_ptr(&b), len);
+       }
+       memset(buffer_ptr(&b), 0, len);
+       buffer_free(&b);
        return len;
 }
 
index c88f632c9e3638a10c43e82ba4730503446836d8..96626d7d4dab379a948b8d6ceb86a333f7246916 100644 (file)
@@ -34,7 +34,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: log.c,v 1.22 2002/02/22 12:20:34 markus Exp $");
+RCSID("$OpenBSD: log.c,v 1.24 2002/07/19 15:43:33 markus Exp $");
 
 #include "log.h"
 #include "xmalloc.h"
@@ -92,6 +92,7 @@ SyslogFacility
 log_facility_number(char *name)
 {
        int i;
+
        if (name != NULL)
                for (i = 0; log_facilities[i].name; i++)
                        if (strcasecmp(log_facilities[i].name, name) == 0)
@@ -103,6 +104,7 @@ LogLevel
 log_level_number(char *name)
 {
        int i;
+
        if (name != NULL)
                for (i = 0; log_levels[i].name; i++)
                        if (strcasecmp(log_levels[i].name, name) == 0)
@@ -116,6 +118,7 @@ void
 error(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_ERROR, fmt, args);
        va_end(args);
@@ -127,6 +130,7 @@ void
 log(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_INFO, fmt, args);
        va_end(args);
@@ -138,6 +142,7 @@ void
 verbose(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_VERBOSE, fmt, args);
        va_end(args);
@@ -149,6 +154,7 @@ void
 debug(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_DEBUG1, fmt, args);
        va_end(args);
@@ -158,6 +164,7 @@ void
 debug2(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_DEBUG2, fmt, args);
        va_end(args);
@@ -167,6 +174,7 @@ void
 debug3(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_DEBUG3, fmt, args);
        va_end(args);
@@ -215,6 +223,18 @@ fatal_remove_cleanup(void (*proc) (void *context), void *context)
            (u_long) proc, (u_long) context);
 }
 
+/* Remove all cleanups, to be called after fork() */
+void
+fatal_remove_all_cleanups(void)
+{
+       struct fatal_cleanup *cu, *next_cu;
+
+       for (cu = fatal_cleanups; cu; cu = next_cu) {
+               next_cu = cu->next;
+               xfree(cu);
+       }
+}
+
 /* Cleanup and exit */
 void
 fatal_cleanup(void)
index 3e4c3c3a7064b510c277d35df000789d8164a752..917fafa69179b3f4b797c4f7b091fdd7b722f243 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: log.h,v 1.7 2002/05/19 20:54:52 deraadt Exp $ */
+/*     $OpenBSD: log.h,v 1.8 2002/07/19 15:43:33 markus Exp $  */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -64,6 +64,7 @@ void     debug3(const char *, ...) __attribute__((format(printf, 1, 2)));
 void     fatal_cleanup(void);
 void     fatal_add_cleanup(void (*) (void *), void *);
 void     fatal_remove_cleanup(void (*) (void *), void *);
+void     fatal_remove_all_cleanups(void);
 
 void    do_log(LogLevel, const char *, va_list);
 
index 7aa102545fcaa3c260ae7daeada7f015626f31a9..0c4ceddc1d9e40831cc485872337f267bd1e67f8 100644 (file)
@@ -622,13 +622,13 @@ construct_utmp(struct logininfo *li,
        switch (li->type) {
        case LTYPE_LOGIN:
                ut->ut_type = USER_PROCESS;
-#ifdef _CRAY
+#ifdef _UNICOS
                cray_set_tmpdir(ut);
 #endif
                break;
        case LTYPE_LOGOUT:
                ut->ut_type = DEAD_PROCESS;
-#ifdef _CRAY
+#ifdef _UNICOS
                cray_retain_utmp(ut, li->pid);
 #endif
                break;
@@ -1249,7 +1249,7 @@ wtmpx_get_entry(struct logininfo *li)
        }
        if (fstat(fd, &st) != 0) {
                log("wtmpx_get_entry: couldn't stat %s: %s",
-                   WTMP_FILE, strerror(errno));
+                   WTMPX_FILE, strerror(errno));
                close(fd);
                return 0;
        }
@@ -1271,6 +1271,7 @@ wtmpx_get_entry(struct logininfo *li)
                /* Logouts are recorded as a blank username on a particular line.
                 * So, we just need to find the username in struct utmpx */
                if ( wtmpx_islogin(li, &utx) ) {
+                       found = 1;
 # ifdef HAVE_TV_IN_UTMPX
                        li->tv_sec = utx.ut_tv.tv_sec;
 # else
index 89b712f2d77f28f1dbf3992940719cae7ef22988..4ad3f3d21534d4bb02c59df252290e20e1eb47fb 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: monitor.c,v 1.18 2002/06/26 13:20:57 deraadt Exp $");
+RCSID("$OpenBSD: monitor.c,v 1.29 2002/09/26 11:38:43 markus Exp $");
 
 #include <openssl/dh.h>
 
@@ -120,6 +120,13 @@ int mm_answer_sessid(int, Buffer *);
 int mm_answer_pam_start(int, Buffer *);
 #endif
 
+#ifdef KRB4
+int mm_answer_krb4(int, Buffer *);
+#endif
+#ifdef KRB5
+int mm_answer_krb5(int, Buffer *);
+#endif
+
 static Authctxt *authctxt;
 static BIGNUM *ssh1_challenge = NULL;  /* used for ssh1 rsa auth */
 
@@ -127,8 +134,8 @@ static BIGNUM *ssh1_challenge = NULL;       /* used for ssh1 rsa auth */
 static u_char *key_blob = NULL;
 static u_int key_bloblen = 0;
 static int key_blobtype = MM_NOKEY;
-static u_char *hostbased_cuser = NULL;
-static u_char *hostbased_chost = NULL;
+static char *hostbased_cuser = NULL;
+static char *hostbased_chost = NULL;
 static char *auth_method = "unknown";
 static int session_id2_len = 0;
 static u_char *session_id2 = NULL;
@@ -198,6 +205,12 @@ struct mon_table mon_dispatch_proto15[] = {
 #endif
 #ifdef USE_PAM
     {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start},
+#endif
+#ifdef KRB4
+    {MONITOR_REQ_KRB4, MON_ONCE|MON_AUTH, mm_answer_krb4},
+#endif
+#ifdef KRB5
+    {MONITOR_REQ_KRB5, MON_ONCE|MON_AUTH, mm_answer_krb5},
 #endif
     {0, 0, NULL}
 };
@@ -455,7 +468,7 @@ mm_answer_sign(int socket, Buffer *m)
        p = buffer_get_string(m, &datlen);
 
        if (datlen != 20)
-               fatal("%s: data length incorrect: %d", __func__, datlen);
+               fatal("%s: data length incorrect: %u", __func__, datlen);
 
        /* save session id, it will be passed on the first call */
        if (session_id2_len == 0) {
@@ -469,7 +482,7 @@ mm_answer_sign(int socket, Buffer *m)
        if (key_sign(key, &signature, &siglen, p, datlen) < 0)
                fatal("%s: key_sign failed", __func__);
 
-       debug3("%s: signature %p(%d)", __func__, signature, siglen);
+       debug3("%s: signature %p(%u)", __func__, signature, siglen);
 
        buffer_clear(m);
        buffer_put_string(m, signature, siglen);
@@ -559,7 +572,7 @@ int mm_answer_auth2_read_banner(int socket, Buffer *m)
        mm_request_send(socket, MONITOR_ANS_AUTH2_READ_BANNER, m);
 
        if (banner != NULL)
-               free(banner);
+               xfree(banner);
 
        return (0);
 }
@@ -587,7 +600,8 @@ mm_answer_authpassword(int socket, Buffer *m)
 {
        static int call_count;
        char *passwd;
-       int authenticated, plen;
+       int authenticated;
+       u_int plen;
 
        passwd = buffer_get_string(m, &plen);
        /* Only authenticate if the context is valid */
@@ -750,7 +764,8 @@ int
 mm_answer_keyallowed(int socket, Buffer *m)
 {
        Key *key;
-       u_char *cuser, *chost, *blob;
+       char *cuser, *chost;
+       u_char *blob;
        u_int bloblen;
        enum mm_keytype type = 0;
        int allowed = 0;
@@ -826,7 +841,7 @@ static int
 monitor_valid_userblob(u_char *data, u_int datalen)
 {
        Buffer b;
-       u_char *p;
+       char *p;
        u_int len;
        int fail = 0;
 
@@ -879,11 +894,11 @@ monitor_valid_userblob(u_char *data, u_int datalen)
 }
 
 static int
-monitor_valid_hostbasedblob(u_char *data, u_int datalen, u_char *cuser,
-    u_char *chost)
+monitor_valid_hostbasedblob(u_char *data, u_int datalen, char *cuser,
+    char *chost)
 {
        Buffer b;
-       u_char *p;
+       char *p;
        u_int len;
        int fail = 0;
 
@@ -1001,8 +1016,8 @@ mm_record_login(Session *s, struct passwd *pw)
         * the address be 0.0.0.0.
         */
        memset(&from, 0, sizeof(from));
+       fromlen = sizeof(from);
        if (packet_connection_is_on_socket()) {
-               fromlen = sizeof(from);
                if (getpeername(packet_get_connection_in(),
                        (struct sockaddr *) & from, &fromlen) < 0) {
                        debug("getpeername: %.100s", strerror(errno));
@@ -1012,7 +1027,7 @@ mm_record_login(Session *s, struct passwd *pw)
        /* Record that there was a login on that tty from the remote host. */
        record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid,
            get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping),
-           (struct sockaddr *)&from);
+           (struct sockaddr *)&from, fromlen);
 }
 
 static void
@@ -1276,6 +1291,89 @@ mm_answer_rsa_response(int socket, Buffer *m)
        return (success);
 }
 
+#ifdef KRB4
+int
+mm_answer_krb4(int socket, Buffer *m)
+{
+       KTEXT_ST auth, reply;
+       char  *client, *p;
+       int success;
+       u_int alen;
+
+       reply.length = auth.length = 0;
+       p = buffer_get_string(m, &alen);
+       if (alen >=  MAX_KTXT_LEN)
+                fatal("%s: auth too large", __func__);
+       memcpy(auth.dat, p, alen);
+       auth.length = alen;
+       memset(p, 0, alen);
+       xfree(p);
+
+       success = options.kerberos_authentication &&
+           authctxt->valid &&
+           auth_krb4(authctxt, &auth, &client, &reply);
+
+       memset(auth.dat, 0, alen);
+       buffer_clear(m);
+       buffer_put_int(m, success);
+
+       if (success) {
+               buffer_put_cstring(m, client);
+               buffer_put_string(m, reply.dat, reply.length);
+               if (client)
+                       xfree(client);
+               if (reply.length)
+                       memset(reply.dat, 0, reply.length);
+       }
+
+       debug3("%s: sending result %d", __func__, success);
+       mm_request_send(socket, MONITOR_ANS_KRB4, m);
+
+       auth_method = "kerberos";
+
+       /* Causes monitor loop to terminate if authenticated */
+       return (success);
+}
+#endif
+
+#ifdef KRB5
+int
+mm_answer_krb5(int socket, Buffer *m)
+{
+       krb5_data tkt, reply;
+       char *client_user;
+       u_int len;
+       int success;
+
+       /* use temporary var to avoid size issues on 64bit arch */
+       tkt.data = buffer_get_string(m, &len);
+       tkt.length = len;
+
+       success = options.kerberos_authentication &&
+           authctxt->valid &&
+           auth_krb5(authctxt, &tkt, &client_user, &reply);
+
+       if (tkt.length)
+               xfree(tkt.data);
+
+       buffer_clear(m);
+       buffer_put_int(m, success);
+
+       if (success) {
+               buffer_put_cstring(m, client_user);
+               buffer_put_string(m, reply.data, reply.length);
+               if (client_user)
+                       xfree(client_user);
+               if (reply.length)
+                       xfree(reply.data);
+       }
+       mm_request_send(socket, MONITOR_ANS_KRB5, m);
+
+       return success;
+}
+#endif
+
 int
 mm_answer_term(int socket, Buffer *req)
 {
@@ -1453,10 +1551,10 @@ mm_get_keystate(struct monitor *pmonitor)
 void *
 mm_zalloc(struct mm_master *mm, u_int ncount, u_int size)
 {
-       int len = size * ncount;
+       size_t len = size * ncount;
        void *address;
 
-       if (len <= 0)
+       if (len == 0 || ncount > SIZE_T_MAX / size)
                fatal("%s: mm_zalloc(%u, %u)", __func__, ncount, size);
 
        address = mm_malloc(mm, len);
index 69114b532e36649cfc71b021cee05828129cd55b..668ac98970dd383881837b3685233731710199d3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: monitor.h,v 1.6 2002/06/11 05:46:20 mpech Exp $       */
+/*     $OpenBSD: monitor.h,v 1.8 2002/09/26 11:38:43 markus Exp $      */
 
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -49,6 +49,8 @@ enum monitor_reqtype {
        MONITOR_REQ_RSAKEYALLOWED, MONITOR_ANS_RSAKEYALLOWED,
        MONITOR_REQ_RSACHALLENGE, MONITOR_ANS_RSACHALLENGE,
        MONITOR_REQ_RSARESPONSE, MONITOR_ANS_RSARESPONSE,
+       MONITOR_REQ_KRB4, MONITOR_ANS_KRB4,
+       MONITOR_REQ_KRB5, MONITOR_ANS_KRB5,
        MONITOR_REQ_PAM_START,
        MONITOR_REQ_TERM
 };
index 0d7628fa247b3a792d90c096931679777ff5db4a..641ce721ef514b0fe85b900df5944258977a2d67 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: monitor_fdpass.c,v 1.3 2002/06/04 23:05:49 markus Exp $");
+RCSID("$OpenBSD: monitor_fdpass.c,v 1.4 2002/06/26 14:50:04 deraadt Exp $");
 
 #include <sys/uio.h>
 
@@ -38,7 +38,7 @@ mm_send_fd(int socket, int fd)
        struct msghdr msg;
        struct iovec vec;
        char ch = '\0';
-       int n;
+       ssize_t n;
 #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
        char tmp[CMSG_SPACE(sizeof(int))];
        struct cmsghdr *cmsg;
@@ -67,8 +67,8 @@ mm_send_fd(int socket, int fd)
                fatal("%s: sendmsg(%d): %s", __func__, fd,
                    strerror(errno));
        if (n != 1)
-               fatal("%s: sendmsg: expected sent 1 got %d",
-                   __func__, n);
+               fatal("%s: sendmsg: expected sent 1 got %ld",
+                   __func__, (long)n);
 #else
        fatal("%s: UsePrivilegeSeparation=yes not supported",
            __func__);
@@ -81,8 +81,9 @@ mm_receive_fd(int socket)
 #if defined(HAVE_RECVMSG) && (defined(HAVE_ACCRIGHTS_IN_MSGHDR) || defined(HAVE_CONTROL_IN_MSGHDR))
        struct msghdr msg;
        struct iovec vec;
+       ssize_t n;
        char ch;
-       int fd, n;
+       int fd;
 #ifndef HAVE_ACCRIGHTS_IN_MSGHDR
        char tmp[CMSG_SPACE(sizeof(int))];
        struct cmsghdr *cmsg;
@@ -104,8 +105,8 @@ mm_receive_fd(int socket)
        if ((n = recvmsg(socket, &msg, 0)) == -1)
                fatal("%s: recvmsg: %s", __func__, strerror(errno));
        if (n != 1)
-               fatal("%s: recvmsg: expected received 1 got %d",
-                   __func__, n);
+               fatal("%s: recvmsg: expected received 1 got %ld",
+                   __func__, (long)n);
 
 #ifdef HAVE_ACCRIGHTS_IN_MSGHDR
        if (msg.msg_accrightslen != sizeof(fd))
index c363036e6720b288e9c946f45049e87a61cc65e8..b4a6e40c90bfa7bd3a8477e2edbfbb0b8899dbe3 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: monitor_mm.c,v 1.6 2002/06/04 23:05:49 markus Exp $");
+RCSID("$OpenBSD: monitor_mm.c,v 1.8 2002/08/02 14:43:15 millert Exp $");
 
 #ifdef HAVE_SYS_MMAN_H
 #include <sys/mman.h>
 #endif
 
+#include "openbsd-compat/xmmap.h"
 #include "ssh.h"
 #include "xmalloc.h"
 #include "log.h"
@@ -38,7 +39,14 @@ RCSID("$OpenBSD: monitor_mm.c,v 1.6 2002/06/04 23:05:49 markus Exp $");
 static int
 mm_compare(struct mm_share *a, struct mm_share *b)
 {
-       return ((char *)a->address - (char *)b->address);
+       long diff = (char *)a->address - (char *)b->address;
+
+       if (diff == 0)
+               return (0);
+       else if (diff < 0)
+               return (-1);
+       else
+               return (1);
 }
 
 RB_GENERATE(mmtree, mm_share, next, mm_compare)
@@ -84,15 +92,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;
@@ -130,7 +132,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));
@@ -165,8 +167,10 @@ mm_malloc(struct mm_master *mm, size_t size)
 
        if (size == 0)
                fatal("mm_malloc: try to allocate 0 space");
+       if (size > SIZE_T_MAX - MM_MINSIZE + 1)
+               fatal("mm_malloc: size too big");
 
-       size = ((size + MM_MINSIZE - 1) / MM_MINSIZE) * MM_MINSIZE;
+       size = ((size + (MM_MINSIZE - 1)) / MM_MINSIZE) * MM_MINSIZE;
 
        RB_FOREACH(mms, mmtree, &mm->rb_free) {
                if (mms->size >= size)
index c0a66d5e7c94b0600ae3bad238a162e5fd20ef7a..a1323b9a8d252a90cef9e9e14891aeb6b4ea1da5 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifndef _MM_H_
 #define _MM_H_
-#include "openbsd-compat/tree.h"
+#include "openbsd-compat/sys-tree.h"
 
 struct mm_share {
        RB_ENTRY(mm_share) next;
index f7e332d8ed415437cc2ff7609475d139f6eaf17c..4c53bfd13b4c1ea06967e96ece09f751a8034568 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: monitor_wrap.c,v 1.11 2002/06/19 18:01:00 markus Exp $");
+RCSID("$OpenBSD: monitor_wrap.c,v 1.19 2002/09/26 11:38:43 markus Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/dh.h>
@@ -62,8 +62,8 @@ extern Buffer input, output;
 void
 mm_request_send(int socket, enum monitor_reqtype type, Buffer *m)
 {
-       u_char buf[5];
        u_int mlen = buffer_len(m);
+       u_char buf[5];
 
        debug3("%s entering: type %d", __func__, type);
 
@@ -79,8 +79,8 @@ void
 mm_request_receive(int socket, Buffer *m)
 {
        u_char buf[4];
-       ssize_t res;
        u_int msg_len;
+       ssize_t res;
 
        debug3("%s entering", __func__);
 
@@ -207,7 +207,7 @@ mm_getpwnamallow(const char *login)
        return (pw);
 }
 
-charmm_auth2_read_banner(void)
+char *mm_auth2_read_banner(void)
 {
        Buffer m;
        char *banner;
@@ -411,7 +411,7 @@ mm_newkeys_from_blob(u_char *blob, int blen)
        enc->key = buffer_get_string(&b, &enc->key_len);
        enc->iv = buffer_get_string(&b, &len);
        if (len != enc->block_size)
-               fatal("%s: bad ivlen: expected %d != %d", __func__,
+               fatal("%s: bad ivlen: expected %u != %u", __func__,
                    enc->block_size, len);
 
        if (enc->name == NULL || cipher_by_name(enc->name) != enc->cipher)
@@ -425,7 +425,7 @@ mm_newkeys_from_blob(u_char *blob, int blen)
        mac->enabled = buffer_get_int(&b);
        mac->key = buffer_get_string(&b, &len);
        if (len > mac->key_len)
-               fatal("%s: bad mac key length: %d > %d", __func__, len,
+               fatal("%s: bad mac key length: %u > %d", __func__, len,
                    mac->key_len);
        mac->key_len = len;
 
@@ -436,7 +436,7 @@ mm_newkeys_from_blob(u_char *blob, int blen)
 
        len = buffer_len(&b);
        if (len != 0)
-               error("newkeys_from_blob: remaining bytes in blob %d", len);
+               error("newkeys_from_blob: remaining bytes in blob %u", len);
        buffer_free(&b);
        return (newkey);
 }
@@ -446,7 +446,6 @@ mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp)
 {
        Buffer b;
        int len;
-       u_char *buf;
        Enc *enc;
        Mac *mac;
        Comp *comp;
@@ -484,14 +483,14 @@ mm_newkeys_to_blob(int mode, u_char **blobp, u_int *lenp)
        buffer_put_cstring(&b, comp->name);
 
        len = buffer_len(&b);
-       buf = xmalloc(len);
-       memcpy(buf, buffer_ptr(&b), len);
-       memset(buffer_ptr(&b), 0, len);
-       buffer_free(&b);
        if (lenp != NULL)
                *lenp = len;
-       if (blobp != NULL)
-               *blobp = buf;
+       if (blobp != NULL) {
+               *blobp = xmalloc(len);
+               memcpy(*blobp, buffer_ptr(&b), len);
+       }
+       memset(buffer_ptr(&b), 0, len);
+       buffer_free(&b);
        return len;
 }
 
@@ -600,7 +599,7 @@ int
 mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
 {
        Buffer m;
-       u_char *p;
+       char *p;
        int success = 0;
 
        buffer_init(&m);
@@ -705,7 +704,7 @@ mm_chall_setup(char **name, char **infotxt, u_int *numprompts,
        *name = xstrdup("");
        *infotxt = xstrdup("");
        *numprompts = 1;
-       *prompts = xmalloc(*numprompts * sizeof(char*));
+       *prompts = xmalloc(*numprompts * sizeof(char *));
        *echo_on = xmalloc(*numprompts * sizeof(u_int));
        (*echo_on)[0] = 0;
 }
@@ -937,3 +936,74 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16])
 
        return (success);
 }
+
+#ifdef KRB4
+int
+mm_auth_krb4(Authctxt *authctxt, void *_auth, char **client, void *_reply)
+{
+       KTEXT auth, reply;
+       Buffer m;
+       u_int rlen;
+       int success = 0;
+       char *p;
+
+       debug3("%s entering", __func__);
+       auth = _auth;
+       reply = _reply;
+
+       buffer_init(&m);
+       buffer_put_string(&m, auth->dat, auth->length);
+
+       mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KRB4, &m);
+       mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KRB4, &m);
+
+       success = buffer_get_int(&m);
+       if (success) {
+               *client = buffer_get_string(&m, NULL);
+               p = buffer_get_string(&m, &rlen);
+               if (rlen >= MAX_KTXT_LEN)
+                       fatal("%s: reply from monitor too large", __func__);
+               reply->length = rlen;
+               memcpy(reply->dat, p, rlen);
+               memset(p, 0, rlen);
+               xfree(p);
+       }
+       buffer_free(&m);
+       return (success); 
+}
+#endif
+
+#ifdef KRB5
+int
+mm_auth_krb5(void *ctx, void *argp, char **userp, void *resp)
+{
+       krb5_data *tkt, *reply;
+       Buffer m;
+       int success;
+
+       debug3("%s entering", __func__);
+       tkt = (krb5_data *) argp;
+       reply = (krb5_data *) resp;
+
+       buffer_init(&m);
+       buffer_put_string(&m, tkt->data, tkt->length);
+
+       mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KRB5, &m);
+       mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KRB5, &m);
+
+       success = buffer_get_int(&m);
+       if (success) {
+               u_int len;
+
+               *userp = buffer_get_string(&m, NULL);
+               reply->data = buffer_get_string(&m, &len);
+               reply->length = len;
+       } else {
+               memset(reply, 0, sizeof(*reply));
+               *userp = NULL;
+       }
+
+       buffer_free(&m);
+       return (success);
+}
+#endif
index ce721247b2095657b747e33fff7f9632486e14a8..d960a3d0b4c122d062d4296c8b428f88b542b17e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: monitor_wrap.h,v 1.5 2002/05/12 23:53:45 djm Exp $    */
+/*     $OpenBSD: monitor_wrap.h,v 1.8 2002/09/26 11:38:43 markus Exp $ */
 
 /*
  * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -44,7 +44,7 @@ DH *mm_choose_dh(int, int, int);
 int mm_key_sign(Key *, u_char **, u_int *, u_char *, u_int);
 void mm_inform_authserv(char *, char *);
 struct passwd *mm_getpwnamallow(const char *);
-charmm_auth2_read_banner(void);
+char *mm_auth2_read_banner(void);
 int mm_auth_password(struct Authctxt *, char *);
 int mm_key_allowed(enum mm_keytype, char *, char *, Key *);
 int mm_user_key_allowed(struct passwd *, Key *);
@@ -83,6 +83,16 @@ int mm_bsdauth_respond(void *, u_int, char **);
 int mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **);
 int mm_skey_respond(void *, u_int, char **);
 
+/* auth_krb */
+#ifdef KRB4
+int mm_auth_krb4(struct Authctxt *, void *, char **, void *);
+#endif
+#ifdef KRB5
+/* auth and reply are really krb5_data objects, but we don't want to
+ * include all of the krb5 headers here */
+int mm_auth_krb5(void *authctxt, void *auth, char **client, void *reply);
+#endif
+
 /* zlib allocation hooks */
 
 void *mm_zalloc(struct mm_master *, u_int, u_int);
index 7275c847dabb00ead9937ad7d101ae76994fdea2..107a3769112777ee02dca59cfbe121e7480408d0 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: msg.c,v 1.3 2002/06/24 15:49:22 itojun Exp $");
+RCSID("$OpenBSD: msg.c,v 1.4 2002/07/01 16:15:25 deraadt Exp $");
 
 #include "buffer.h"
 #include "getput.h"
@@ -31,43 +31,43 @@ RCSID("$OpenBSD: msg.c,v 1.3 2002/06/24 15:49:22 itojun Exp $");
 #include "msg.h"
 
 void
-msg_send(int fd, u_char type, Buffer *m)
+ssh_msg_send(int fd, u_char type, Buffer *m)
 {
        u_char buf[5];
        u_int mlen = buffer_len(m);
 
-       debug3("msg_send: type %u", (unsigned int)type & 0xff);
+       debug3("ssh_msg_send: type %u", (unsigned int)type & 0xff);
 
        PUT_32BIT(buf, mlen + 1);
        buf[4] = type;          /* 1st byte of payload is mesg-type */
        if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf))
-               fatal("msg_send: write");
+               fatal("ssh_msg_send: write");
        if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen)
-               fatal("msg_send: write");
+               fatal("ssh_msg_send: write");
 }
 
 int
-msg_recv(int fd, Buffer *m)
+ssh_msg_recv(int fd, Buffer *m)
 {
        u_char buf[4];
        ssize_t res;
        u_int msg_len;
 
-       debug3("msg_recv entering");
+       debug3("ssh_msg_recv entering");
 
        res = atomicio(read, fd, buf, sizeof(buf));
        if (res != sizeof(buf)) {
                if (res == 0)
                        return -1;
-               fatal("msg_recv: read: header %ld", (long)res);
+               fatal("ssh_msg_recv: read: header %ld", (long)res);
        }
        msg_len = GET_32BIT(buf);
        if (msg_len > 256 * 1024)
-               fatal("msg_recv: read: bad msg_len %d", msg_len);
+               fatal("ssh_msg_recv: read: bad msg_len %u", msg_len);
        buffer_clear(m);
        buffer_append_space(m, msg_len);
        res = atomicio(read, fd, buffer_ptr(m), msg_len);
        if (res != msg_len)
-               fatal("msg_recv: read: %ld != msg_len", (long)res);
+               fatal("ssh_msg_recv: read: %ld != msg_len", (long)res);
        return 0;
 }
index 13fa95b27eb2ac6d195dbcb981322640c9fe0f49..8980e254e0119ef4990a233e385fb21d76f0e28e 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef SSH_MSG_H
 #define SSH_MSG_H
 
-void    msg_send(int, u_char, Buffer *);
-int     msg_recv(int, Buffer *);
+void    ssh_msg_send(int, u_char, Buffer *);
+int     ssh_msg_recv(int, Buffer *);
 
 #endif
index df5711193d8b0e79d31a26200887e85c3f5bb4dc..0864ebe63136f2d2ac01f284f2d9e20f9fbf688d 100644 (file)
@@ -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-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
 
index d12b993b7cab3e188344b1ad31729b3773771432..005170b80dfd55fbb83c5f4053a80eab023f422b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: base64.c,v 1.3 1997/11/08 20:46:55 deraadt Exp $      */
+/*     $OpenBSD: base64.c,v 1.4 2002/01/02 23:00:10 deraadt Exp $      */
 
 /*
  * Copyright (c) 1996 by Internet Software Consortium.
@@ -42,7 +42,7 @@
  * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #if !defined(HAVE_B64_NTOP) && !defined(HAVE___B64_NTOP)
 
@@ -60,6 +60,7 @@
 
 #include "base64.h"
 
+/* XXX abort illegal in library */
 #define Assert(Cond) if (!(Cond)) abort()
 
 static const char Base64[] =
index 332bcb016a40ba2a15e1efeb1c4f7184d14562f9..620f980ed11037223a5442aba104ef65ce82e326 100644 (file)
@@ -29,7 +29,7 @@
  * Mountain View, California  94043
  */
 
-#include "config.h"
+#include "includes.h"
 
 #ifndef HAVE_BINDRESVPORT_SA
 
index b673d1ff7624bf427ab5b94dcd4f6f6022ddbc14..318f78547f74bd3b49878de1174cf2e4f3e62324 100644 (file)
@@ -34,8 +34,8 @@
  * on UNICOS systems.
  *
  */
+#ifdef _UNICOS
 
-#ifdef _CRAY
 #include <udb.h>
 #include <tmpdir.h>
 #include <unistd.h>
 #include <signal.h>
 #include <sys/priv.h>
 #include <sys/secparm.h>
+#include <sys/tfm.h>
 #include <sys/usrv.h>
 #include <sys/sysv.h>
 #include <sys/sectab.h>
+#include <sys/secstat.h>
 #include <sys/stat.h>
+#include <sys/session.h>
 #include <stdlib.h>
 #include <pwd.h>
 #include <fcntl.h>
 #include <errno.h>
-
+#include <ia.h>
+#include <urm.h>
+#include "ssh.h"
+#include "log.h"
+#include "servconf.h"
 #include "bsd-cray.h"
 
+#define MAXACID 80
+
+extern ServerOptions options;
+
 char cray_tmpdir[TPATHSIZ+1];              /* job TMPDIR path */
 
+struct         sysv sysv;      /* system security structure */
+struct         usrv usrv;      /* user   security structure */
+
 /*
  * Functions.
  */
@@ -65,68 +79,538 @@ void cray_retain_utmp(struct utmp *, int);
 void cray_delete_tmpdir(char *, int, uid_t);
 void cray_init_job(struct passwd *);
 void cray_set_tmpdir(struct utmp *);
+void cray_login_failure(char *, int);
+int cray_setup(uid_t, char *, const char *);
+int cray_access_denied(char *);
+
+void
+cray_login_failure(char *username, int errcode)
+{
+       struct udb      *ueptr;         /* UDB pointer for username */
+       ia_failure_t    fsent;          /* ia_failure structure */
+       ia_failure_ret_t fret;          /* ia_failure return stuff */
+       struct jtab     jtab;           /* job table structure */
+       int             jid = 0;        /* job id */
+
+       if ((jid = getjtab(&jtab)) < 0) {
+               debug("cray_login_failure(): getjtab error");
+       }
+       getsysudb();
+       if ((ueptr = getudbnam(username)) == UDB_NULL) {
+               debug("cray_login_failure(): getudbname() returned NULL");
+       }
+       endudb();
+       fsent.revision  = 0;
+       fsent.uname     = username;
+       fsent.host      = (char *)get_canonical_hostname(options.verify_reverse_mapping);
+       fsent.ttyn      = "sshd";
+       fsent.caller    = IA_SSHD;
+       fsent.flags     = IA_INTERACTIVE;
+       fsent.ueptr     = ueptr;
+       fsent.jid       = jid;
+       fsent.errcode   = errcode;
+       fsent.pwdp      = NULL;
+       fsent.exitcode  = 0;    /* dont exit in ia_failure() */
+
+       fret.revision   = 0;
+       fret.normal     = 0;
 
+       /*
+        * Call ia_failure because of an login failure.
+        */
+       ia_failure(&fsent,&fret);
+}
 
 /*
- * Orignal written by:
- *     Wayne Schroeder
- *     San Diego Supercomputer Center
- *     schroeder@sdsc.edu
-*/
-void
-cray_setup(uid_t uid, char *username)
+ *  Cray access denied
+ */
+int
+cray_access_denied(char *username)
 {
-       struct udb *p;
+       struct udb      *ueptr;         /* UDB pointer for username */
+       int             errcode;        /* IA errorcode */
+
+       errcode = 0;
+       getsysudb();
+       if ((ueptr = getudbnam(username)) == UDB_NULL) {
+               debug("cray_login_failure(): getudbname() returned NULL");
+       }
+       endudb();
+       if (ueptr && ueptr->ue_disabled)
+               errcode = IA_DISABLED;
+       if (errcode)
+               cray_login_failure(username, errcode);
+       return (errcode);
+}
+
+int
+cray_setup (uid_t uid, char *username, const char *command)
+{
+       extern struct udb *getudb();
        extern char *setlimits();
-       int i, j;
-       int accts[MAXVIDS];
-       int naccts;
-       int err;
-       char *sr;
-       int pid;
-       struct jtab jbuf;
-       int jid;
 
-       if ((jid = getjtab(&jbuf)) < 0)
-               fatal("getjtab: no jid");
-
-       err = setudb();    /* open and rewind the Cray User DataBase */
-       if (err != 0)
-               fatal("UDB open failure");
-       naccts = 0;
-       p = getudbnam(username);
-       if (p == NULL)
-               fatal("No UDB entry for %.100s", username);
-       if (uid != p->ue_uid)
-               fatal("UDB entry %.100s uid(%d) does not match uid %d",
-                   username, (int) p->ue_uid, (int) uid);
-       for (j = 0; p->ue_acids[j] != -1 && j < MAXVIDS; j++) {
-               accts[naccts] = p->ue_acids[j];
-               naccts++;
+       int err;                      /* error return */
+       time_t          system_time;    /* current system clock */
+       time_t          expiration_time; /* password expiration time */
+       int             maxattempts;    /* maximum no. of failed login attempts */
+       int             SecureSys;      /* unicos security flag */
+       int             minslevel = 0;  /* system minimum security level */
+       int             i, j;
+       int             valid_acct = -1; /* flag for reading valid acct */
+       char acct_name[MAXACID]  = { "" }; /* used to read acct name */
+       struct          jtab jtab;      /* Job table struct */
+       struct          udb ue;         /* udb entry for logging-in user */
+       struct          udb *up;        /* pointer to UDB entry */
+       struct          secstat secinfo; /* file  security attributes */
+       struct          servprov init_info; /* used for sesscntl() call */
+       int             jid;            /* job ID */
+       int             pid;            /* process ID */
+       char            *sr;            /* status return from setlimits() */
+       char            *ttyn = NULL;   /* ttyname or command name*/
+       char            hostname[MAXHOSTNAMELEN];
+       passwd_t        pwdacm,
+                       pwddialup,
+                       pwdudb,
+                       pwdwal,
+                       pwddce;         /* passwd stuff for ia_user */
+       ia_user_ret_t   uret;           /* stuff returned from ia_user */
+       ia_user_t       usent;          /* ia_user main structure */
+       int             ia_rcode;       /* ia_user return code */
+       ia_failure_t    fsent;          /* ia_failure structure */
+       ia_failure_ret_t fret;          /* ia_failure return stuff */
+       ia_success_t    ssent;          /* ia_success structure */
+       ia_success_ret_t sret;          /* ia_success return stuff */
+       int             ia_mlsrcode;    /* ia_mlsuser return code */
+       int             secstatrc;      /* [f]secstat return code */
+
+       if (SecureSys = (int)sysconf(_SC_CRAY_SECURE_SYS)) {
+               getsysv(&sysv, sizeof(struct sysv));
+               minslevel = sysv.sy_minlvl;
+               if (getusrv(&usrv) < 0) {
+                       debug("getusrv() failed, errno = %d",errno);
+                       exit(1);
+               }
        }
-       endudb();        /* close the udb */
-
-       if (naccts != 0) {
-               /* Perhaps someday we'll prompt users who have multiple accounts
-                  to let them pick one (like CRI's login does), but for now just set
-                  the account to the first entry. */
-               if (acctid(0, accts[0]) < 0)
-                       fatal("System call acctid failed, accts[0]=%d", accts[0]);
+       hostname[0] = '\0';
+       strncpy(hostname,
+          (char *)get_canonical_hostname(options.verify_reverse_mapping),
+          MAXHOSTNAMELEN);
+        /*
+         *  Fetch user's UDB entry.
+         */
+        getsysudb();
+        if ((up = getudbnam(username)) == UDB_NULL) {
+                debug("cannot fetch user's UDB entry");
+                exit(1);
+        }
+
+        /*
+         *  Prevent any possible fudging so perform a data
+         *  safety check and compare the supplied uid against
+         *  the udb's uid.
+         */
+        if (up->ue_uid != uid) {
+                debug("IA uid missmatch");
+                exit(1);
+        }
+       endudb();
+
+       if ((jid = getjtab (&jtab)) < 0) {
+               debug("getjtab");
+               return -1;
+       }
+       pid = getpid();
+       ttyn = ttyname(0);
+       if (SecureSys) {
+               if (ttyn) {
+                       secstatrc = secstat(ttyn, &secinfo);
+               } else {
+                       secstatrc = fsecstat(1, &secinfo);
+               }
+               if (secstatrc == 0) {
+                       debug("[f]secstat() successful");
+               } else {
+                       debug("[f]secstat() error, rc = %d", secstatrc);
+                       exit(1);
+               }
+       }
+       if ((ttyn == NULL) && ((char *)command != NULL))
+               ttyn = (char *)command;
+        /*
+         *  Initialize all structures to call ia_user
+         */
+        usent.revision = 0;
+        usent.uname    = username;
+        usent.host     = hostname;
+        usent.ttyn     = ttyn;
+        usent.caller   = IA_SSHD; 
+        usent.pswdlist = &pwdacm;
+        usent.ueptr    = &ue;
+        usent.flags    = IA_INTERACTIVE | IA_FFLAG;
+        pwdacm.atype   = IA_SECURID;
+        pwdacm.pwdp    = NULL;
+        pwdacm.next    = &pwdudb;
+
+        pwdudb.atype   = IA_UDB;
+        pwdudb.pwdp    = NULL;
+        pwdudb.next    = &pwddce;
+
+        pwddce.atype   = IA_DCE;
+        pwddce.pwdp    = NULL;
+        pwddce.next    = &pwddialup;
+
+        pwddialup.atype = IA_DIALUP;
+        pwddialup.pwdp  = NULL;
+        /* pwddialup.next  = &pwdwal; */
+        pwddialup.next  = NULL;
+
+        pwdwal.atype = IA_WAL;
+        pwdwal.pwdp  = NULL;
+        pwdwal.next  = NULL;
+
+        uret.revision = 0;
+        uret.pswd     = NULL;
+        uret.normal   = 0;
+
+        ia_rcode = ia_user(&usent, &uret);
+
+        switch (ia_rcode) {
+                /*
+                 *  These are acceptable return codes from ia_user()
+                 */
+                case IA_UDBWEEK:        /* Password Expires in 1 week */
+                    expiration_time = ue.ue_pwage.time + ue.ue_pwage.maxage;
+                    printf ("WARNING - your current password will expire %s\n",
+                     ctime((const time_t *)&expiration_time));
+                     break;
+                case IA_UDBEXPIRED:
+                    if (ttyname(0) != NULL) {
+                    /* Force a password change */
+                        printf("Your password has expired; Choose a new one.\n");
+                        execl("/bin/passwd", "passwd", username, 0);
+                        exit(9);
+                    }
+
+                    break;
+                case IA_NORMAL:         /* Normal Return Code */
+                     break;
+                case IA_BACKDOOR:
+                     strcpy(ue.ue_name, "root");
+                     strcpy(ue.ue_passwd, "");
+                     strcpy(ue.ue_dir, "/");
+                     strcpy(ue.ue_shell, "/bin/sh");
+                     strcpy(ue.ue_age, "");
+                     strcpy(ue.ue_comment, "");
+                     strcpy(ue.ue_loghost, "");
+                     strcpy(ue.ue_logline, "");
+                     ue.ue_uid=-1;
+                     ue.ue_nice[UDBRC_INTER]=0;
+                     for (i=0;i<MAXVIDS;i++)
+                         ue.ue_gids[i]=0;
+                     ue.ue_logfails=0;
+                     ue.ue_minlvl=minslevel; 
+                     ue.ue_maxlvl=minslevel;
+                     ue.ue_deflvl=minslevel;
+                     ue.ue_defcomps=0;
+                     ue.ue_comparts=0;
+                     ue.ue_permits=0;
+                     ue.ue_trap=0;
+                     ue.ue_disabled=0;
+                     ue.ue_logtime=0;
+                     break;
+                case IA_CONSOLE:        /* Superuser not from Console */
+               case IA_TRUSTED:        /* Trusted user */
+                    if (options.permit_root_login > PERMIT_NO)
+                       break;          /* Accept root login */
+               default:
+                /*
+                 *  These are failed return codes from ia_user()
+                 */
+                    switch (ia_rcode) 
+                      {
+                      case IA_BADAUTH:
+                        printf ("Bad authorization, access denied.\n");
+                        break;
+                      case IA_DIALUPERR:
+                        break;
+                      case IA_DISABLED:
+                        printf ("Your login has been disabled. Contact the system ");
+                        printf ("administrator for assistance.\n");
+                        break;
+                      case IA_GETSYSV:
+                        printf ("getsysv() failed - errno = %d\n", errno);
+                        break;
+                      case IA_LOCALHOST:
+                        break;
+                      case IA_MAXLOGS:
+                        printf ("Maximum number of failed login attempts exceeded.\n");
+                        printf ("Access denied.\n");
+                        break;
+                      case IA_NOPASS:
+                        break;
+                      case IA_PUBLIC:
+                        break;
+                      case IA_SECURIDERR:
+                        break;
+                      case IA_CONSOLE:
+                        break;
+                      case IA_TRUSTED:
+                        break;
+                      case IA_UDBERR:
+                        break;
+                      case IA_UDBPWDNULL:
+                        /* 
+                         * NULL password not allowed on MLS systems
+                         */
+                        if (SecureSys) {
+                          printf("NULL Password not allowed on MLS systems.\n");
+                        }
+                        break;
+                      case IA_UNKNOWN:
+                        break;
+                      case IA_UNKNOWNYP:
+                        break;
+                      case IA_WALERR:
+                        break;
+                      default:
+                        /* nothing special */
+                        ;
+                      }   /* 2. switch  (ia_rcode) */
+                    /*
+                     *  Authentication failed.
+                     */
+                    printf("sshd: Login incorrect, (0%o)\n",
+                           ia_rcode-IA_ERRORCODE);
+                    
+                    /*
+                     *  Initialize structure for ia_failure
+                     *  which will exit.
+                     */
+                    fsent.revision = 0;
+                    fsent.uname    = username;
+                    fsent.host     = hostname;
+                    fsent.ttyn     = ttyn;
+                    fsent.caller   = IA_SSHD;
+                    fsent.flags    = IA_INTERACTIVE;
+                    fsent.ueptr    = &ue;
+                    fsent.jid      = jid;
+                    fsent.errcode  = ia_rcode;
+                    fsent.pwdp     = uret.pswd;
+                    fsent.exitcode = 1;
+                    
+                    fret.revision  = 0;
+                    fret.normal    = 0;
+                    
+                    /*
+                     *  Call ia_failure because of an IA failure.
+                     *  There is no return because ia_failure exits.
+                     */
+       
+                    ia_failure(&fsent,&fret);
+
+                    exit(1); 
+       }   /* 1. switch  (ia_rcode) */
+       ia_mlsrcode = IA_NORMAL;
+       if (SecureSys) {
+               debug("calling ia_mlsuser()");
+               ia_mlsrcode = ia_mlsuser (&ue, &secinfo, &usrv, NULL, 0);
+       }
+       if (ia_mlsrcode != IA_NORMAL) {
+               printf("sshd: Login incorrect, (0%o)\n",
+               ia_mlsrcode-IA_ERRORCODE);
+               /*
+                *  Initialize structure for ia_failure
+                *  which will exit.
+               */
+               fsent.revision = 0;
+               fsent.uname    = username;
+               fsent.host     = hostname;
+               fsent.ttyn     = ttyn;
+               fsent.caller   = IA_SSHD;
+               fsent.flags    = IA_INTERACTIVE;
+               fsent.ueptr    = &ue;
+               fsent.jid      = jid;
+               fsent.errcode  = ia_mlsrcode;
+               fsent.pwdp     = uret.pswd;
+               fsent.exitcode = 1;
+               fret.revision  = 0;
+               fret.normal    = 0;
+
+               /*
+               *  Call ia_failure because of an IA failure.
+               *  There is no return because ia_failure exits.
+               */
+               ia_failure(&fsent,&fret);
+               exit(1); 
        }
 
-       /* Now set limits, including CPU time for the (interactive) job and process,
-          and set up permissions (for chown etc), etc.  This is via an internal CRI
-          routine, setlimits, used by CRI's login. */
+        /* Provide login status information */
+        if (options.print_lastlog && ue.ue_logtime != 0) {
+            printf("Last successful login was : %.*s ",
+                    19, (char *)ctime(&ue.ue_logtime));
+  
+           if (*ue.ue_loghost != '\0')
+                printf("from %.*s\n", sizeof(ue.ue_loghost), ue.ue_loghost);
+            else printf("on %.*s\n", sizeof(ue.ue_logline), ue.ue_logline);
+            if ( SecureSys && (ue.ue_logfails != 0)) 
+                printf("  followed by %d failed attempts\n", ue.ue_logfails);
+        }
+
+       
+       /*
+        * Call ia_success to process successful I/A.
+        */
+       ssent.revision = 0;
+       ssent.uname = username;
+       ssent.host = hostname;
+       ssent.ttyn = ttyn;
+       ssent.caller = IA_SSHD;
+       ssent.flags = IA_INTERACTIVE;
+       ssent.ueptr = &ue;
+       ssent.jid = jid;
+       ssent.errcode = ia_rcode;
+       ssent.us = NULL;
+       ssent.time = 1;                  /* Set ue_logtime */
+
+       sret.revision = 0;
+       sret.normal = 0;
+
+       ia_success(&ssent,&sret);
+
+        /*
+         * Query for account, iff > 1 valid acid & askacid permbit
+         */
+        if (((ue.ue_permbits & PERMBITS_ACCTID) ||
+             (ue.ue_acids[0] >= 0) && (ue.ue_acids[1] >= 0)) &&
+            ue.ue_permbits & PERMBITS_ASKACID) {
+               if (ttyname(0) != NULL) {
+                 debug("cray_setup: ttyname true case, %.100s", ttyname);
+                  while (valid_acct == -1) {
+                        printf("Account (? for available accounts)"
+                               " [%s]: ", acid2nam(ue.ue_acids[0]));
+                        gets(acct_name);
+                        switch (acct_name[0]) {
+                        case EOF:
+                                exit(0);
+                                break;
+                        case '\0':
+                                valid_acct = ue.ue_acids[0];
+                                strcpy(acct_name, acid2nam(valid_acct));
+                                break;
+                        case '?':
+                                /* Print the list 3 wide */
+                                for (i = 0, j = 0; i < MAXVIDS; i++) {
+                                        if (ue.ue_acids[i] == -1) {
+                                                printf("\n");
+                                                break;
+                                        }
+                                        if (++j == 4) {
+                                                j = 1;
+                                                printf("\n");
+                                        }
+                                        printf(" %s",
+                                               acid2nam(ue.ue_acids[i]));
+                                }
+                                if (ue.ue_permbits & PERMBITS_ACCTID)
+                                        printf("\"acctid\" permbit also allows"
+                                               " you to select any valid "
+                                               "account name.\n");
+                                printf("\n");
+                                break;
+                        default:
+                                if ((valid_acct = nam2acid(acct_name)) == -1)                                        printf("Account id not found for"
+                                               " account name \"%s\"\n\n",
+                                               acct_name);
+                                break;
+                        }
+                        /*
+                         * If an account was given, search the user's
+                         * acids array to verify they can use this account.
+                         */
+                        if ((valid_acct != -1) &&
+                            !(ue.ue_permbits & PERMBITS_ACCTID)) {
+                                for (i = 0; i < MAXVIDS; i++) {
+                                        if (ue.ue_acids[i] == -1)
+                                                break;
+                                        if (valid_acct == ue.ue_acids[i])
+                                                break;
+                                }
+                                if (i == MAXVIDS ||
+                                    ue.ue_acids[i] == -1) {
+                                        fprintf(stderr, "Cannot set"
+                                                " account name to "
+                                                "\"%s\", permission "
+                                                "denied\n\n", acct_name);
+                                        valid_acct = -1;
+                                }
+                        }
+                  }
+               } else {
+                       /*
+                        * The client isn't connected to a terminal and can't
+                        * respond to an acid prompt.  Use default acid.
+                        */
+                       debug("cray_setup: ttyname false case, %.100s", ttyname);
+                       valid_acct = ue.ue_acids[0];
+               }
+        } else {
+                /*
+                 * The user doesn't have the askacid permbit set or
+                 * only has one valid account to use.
+                 */
+                valid_acct = ue.ue_acids[0];
+        }
+        if (acctid(0, valid_acct) < 0) {
+                printf ("Bad account id: %d\n", valid_acct);
+                exit(1);
+        }
+
+/* set up shares and quotas */
+/* Now set shares, quotas, limits, including CPU time for the (interactive) 
+ * job and process, and set up permissions (for chown etc), etc.
+ */
+       if (setshares(ue.ue_uid, valid_acct, printf, 0, 0)) {
+               printf("Unable to give %d shares to <%s>(%d/%d)\n", ue.ue_shares, ue.ue_name, ue.ue_uid, valid_acct);
+               exit(1);
+        }
 
-       pid = getpid();
        sr = setlimits(username, C_PROC, pid, UDBRC_INTER);
-       if (sr != NULL)
-               fatal("%.200s", sr);
-
+       if (sr != NULL) {
+               debug("%.200s", sr);
+               exit(1);
+       }
        sr = setlimits(username, C_JOB, jid, UDBRC_INTER);
-       if (sr != NULL)
-               fatal("%.200s", sr);
+       if (sr != NULL) {
+               debug("%.200s", sr);
+               exit(1);
+       }
+       /*
+        * Place the service provider information into
+        * the session table (Unicos) or job table (Unicos/mk).
+        * There exist double defines for the job/session table in
+        * unicos/mk (jtab.h) so no need for a compile time switch.
+        */
+       bzero((char *)&init_info, sizeof(struct servprov));
+       init_info.s_sessinit.si_id  = URM_SPT_LOGIN;
+       init_info.s_sessinit.si_pid = getpid();
+       init_info.s_sessinit.si_sid = jid;
+       init_info.s_routing.seqno = 0;
+       init_info.s_routing.iadrs = 0;
+       sesscntl(0, S_SETSERVPO, (int)&init_info);
 
+       /*
+        * Set user and controlling tty security attributes.
+        */
+       if (SecureSys) {
+               if (setusrv(&usrv) == -1) {
+                       debug("setusrv() failed, errno = %d",errno);
+                       exit(1);
+               }
+       }
+
+        return(0);
 }
 
 /*
@@ -143,7 +627,6 @@ drop_cray_privs()
        int                       result;
        extern      int           priv_set_proc();
        extern      priv_proc_t*  priv_init_proc();
-       struct      usrv          usrv;
 
        /*
         * If ether of theses two flags are not set
@@ -154,9 +637,23 @@ drop_cray_privs()
        if (!sysconf(_SC_CRAY_POSIX_PRIV))
                fatal("Not POSIX_PRIV.");
 
-       debug("Dropping privileges.");
+       debug("Setting MLS labels.");;
+
+       if (sysconf(_SC_CRAY_SECURE_MAC)) {
+               usrv.sv_minlvl = SYSLOW;
+               usrv.sv_actlvl = SYSHIGH;
+               usrv.sv_maxlvl = SYSHIGH;
+       } else {
+               usrv.sv_minlvl = sysv.sy_minlvl;
+               usrv.sv_actlvl = sysv.sy_minlvl;
+               usrv.sv_maxlvl = sysv.sy_maxlvl;
+       }       
+       usrv.sv_actcmp = 0;
+       usrv.sv_valcmp = sysv.sy_valcmp;
+
+       usrv.sv_intcat = TFM_SYSTEM;
+       usrv.sv_valcat |= (TFM_SYSTEM | TFM_SYSFILE);
 
-       memset(&usrv, 0, sizeof(usrv));
        if (setusrv(&usrv) < 0)
                fatal("%s(%d): setusrv(): %s", __FILE__, __LINE__,
                    strerror(errno));
@@ -189,7 +686,6 @@ cray_retain_utmp(struct utmp *ut, int pid)
                while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) {
                        if (pid == utmp.ut_pid) {
                                ut->ut_jid = utmp.ut_jid;
-                               /* XXX: MIN_SIZEOF here? can this go in loginrec? */
                                strncpy(ut->ut_tpath, utmp.ut_tpath, sizeof(utmp.ut_tpath));
                                strncpy(ut->ut_host, utmp.ut_host, sizeof(utmp.ut_host));
                                strncpy(ut->ut_name, utmp.ut_name, sizeof(utmp.ut_name));
@@ -198,7 +694,8 @@ cray_retain_utmp(struct utmp *ut, int pid)
                }
                close(fd);
        }
-       /* XXX: error message? */
+       else
+       fatal("Unable to open utmp file");
 }
 
 /*
@@ -245,7 +742,7 @@ cray_job_termination_handler(int sig)
        char *login = NULL;
        struct jtab jtab;
 
-       debug("Received SIG JOB.");
+       debug("received signal %d",sig);
 
        if ((jid = waitjob(&jtab)) == -1 ||
            (login = uid2nam(jtab.j_uid)) == NULL)
index 8a331138e078a697ce92287188bb89213067be39..d3f01ed045362c054714ca08f63765441c7c43f9 100644 (file)
 #ifndef _BSD_CRAY_H
 #define _BSD_CRAY_H
 
-#ifdef _CRAY
-void   cray_init_job(struct passwd *);         /* init cray job */
-void   cray_job_termination_handler(int);      /* process end of job signal */
-void   cray_setup(uid_t, char *);              /* set cray limits */
+#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);
+int cray_access_denied(char *username);
 extern char   cray_tmpdir[];                   /* cray tmpdir */
+#ifndef IA_SSHD
+#define IA_SSHD IA_LOGIN
+#endif
+#ifndef MAXHOSTNAMELEN
+#define MAXHOSTNAMELEN  64
+#endif
 #endif
 
 #endif /* _BSD_CRAY_H */
diff --git a/openssh/openbsd-compat/bsd-getpeereid.c b/openssh/openbsd-compat/bsd-getpeereid.c
new file mode 100644 (file)
index 0000000..808df21
--- /dev/null
@@ -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$");
+
+#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/openssh/openbsd-compat/bsd-getpeereid.h b/openssh/openbsd-compat/bsd-getpeereid.h
new file mode 100644 (file)
index 0000000..dec841b
--- /dev/null
@@ -0,0 +1,14 @@
+/* $Id$ */
+
+#ifndef _BSD_GETPEEREID_H
+#define _BSD_GETPEEREID_H
+
+#include "config.h"
+
+#include <sys/types.h> /* For uid_t, gid_t */
+
+#ifndef HAVE_GETPEEREID
+int     getpeereid(int , uid_t *, gid_t *);
+#endif /* HAVE_GETPEEREID */
+
+#endif /* _BSD_GETPEEREID_H */
index df2b4b560db43cbaf364082ff2e9e30eba005380..f27788729bf2a6364aacee37db5dfb441acc674c 100644 (file)
@@ -93,8 +93,8 @@ int utimes(char *filename, struct timeval *tvp)
 {
        struct utimbuf ub;
 
-       ub.actime = tvp->tv_sec;
-       ub.modtime = tvp->tv_usec;
+       ub.actime = tvp[0].tv_sec;
+       ub.modtime = tvp[1].tv_sec;
        
        return(utime(filename, &ub));
 }
index 391b2dd81cfce10041ba30bcdb539ca294cb9a4b..35c7d8ec7e226a52169ab5fa3168a4003bf3854f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dirname.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $     */
+/*     $OpenBSD: dirname.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $     */
 
 /*
  * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
 #ifndef HAVE_DIRNAME
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: dirname.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: dirname.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <errno.h>
@@ -47,7 +47,7 @@ dirname(path)
 
        /* Empty or NULL string gets treated as "." */
        if (path == NULL || *path == '\0') {
-               (void)strcpy(bname, ".");
+               (void)strlcpy(bname, ".", sizeof bname);
                return(bname);
        }
 
@@ -62,7 +62,7 @@ dirname(path)
 
        /* Either the dir is "/" or there are no slashes */
        if (endp == path) {
-               (void)strcpy(bname, *endp == '/' ? "/" : ".");
+               (void)strlcpy(bname, *endp == '/' ? "/" : ".", sizeof bname);
                return(bname);
        } else {
                do {
index de3baccbbbaa4707ed9bf4b16f4aeb4af2aa4f3e..6fd8543a5f3e3c79c7b168bbb4303fe81066fe98 100644 (file)
@@ -24,7 +24,7 @@
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #if !defined(HAVE_GETCWD)
 
index f4fbc9bac3ec2746bbb37741cece0f4bd7484895..4a5cfe5f0516522349e1e26817bea76fd56563b4 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 #if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 365d4334fc5d6ced0024b242a0042f83bc6bd7b8..e928a2272c15526fe0c27f0c54a54b644575857b 100644 (file)
@@ -56,7 +56,7 @@ get_arg_max(void)
 #if 0
 static char sccsid[] = "@(#)glob.c     8.3 (Berkeley) 10/13/93";
 #else
-static char rcsid[] = "$OpenBSD: glob.c,v 1.16 2001/04/05 18:36:12 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: glob.c,v 1.20 2002/06/14 21:34:58 todd Exp $";
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -97,6 +97,7 @@ static char rcsid[] = "$OpenBSD: glob.c,v 1.16 2001/04/05 18:36:12 deraadt Exp $
 #define        RBRACKET        ']'
 #define        SEP             '/'
 #define        STAR            '*'
+#undef TILDE                   /* Some platforms may already define it */
 #define        TILDE           '~'
 #define        UNDERSCORE      '_'
 #define        LBRACE          '{'
@@ -136,32 +137,32 @@ typedef char Char;
 #define        ismeta(c)       (((c)&M_QUOTE) != 0)
 
 
-static int      compare __P((const void *, const void *));
-static int      g_Ctoc __P((const Char *, char *, u_int));
-static int      g_lstat __P((Char *, struct stat *, glob_t *));
-static DIR     *g_opendir __P((Char *, glob_t *));
-static Char    *g_strchr __P((Char *, int));
-static int      g_stat __P((Char *, struct stat *, glob_t *));
-static int      glob0 __P((const Char *, glob_t *));
-static int      glob1 __P((Char *, Char *, glob_t *, size_t *));
-static int      glob2 __P((Char *, Char *, Char *, Char *, Char *, Char *,
-                   glob_t *, size_t *));
-static int      glob3 __P((Char *, Char *, Char *, Char *, Char *, Char *,
-                   Char *, Char *, glob_t *, size_t *));
-static int      globextend __P((const Char *, glob_t *, size_t *));
+static int      compare(const void *, const void *);
+static int      g_Ctoc(const Char *, char *, u_int);
+static int      g_lstat(Char *, struct stat *, glob_t *);
+static DIR     *g_opendir(Char *, glob_t *);
+static Char    *g_strchr(Char *, int);
+static int      g_stat(Char *, struct stat *, glob_t *);
+static int      glob0(const Char *, glob_t *);
+static int      glob1(Char *, Char *, glob_t *, size_t *);
+static int      glob2(Char *, Char *, Char *, Char *, Char *, Char *,
+                   glob_t *, size_t *);
+static int      glob3(Char *, Char *, Char *, Char *, Char *, Char *,
+                   Char *, Char *, glob_t *, size_t *);
+static int      globextend(const Char *, glob_t *, size_t *);
 static const Char *
-                globtilde __P((const Char *, Char *, size_t, glob_t *));
-static int      globexp1 __P((const Char *, glob_t *));
-static int      globexp2 __P((const Char *, const Char *, glob_t *, int *));
-static int      match __P((Char *, Char *, Char *));
+                globtilde(const Char *, Char *, size_t, glob_t *);
+static int      globexp1(const Char *, glob_t *);
+static int      globexp2(const Char *, const Char *, glob_t *, int *);
+static int      match(Char *, Char *, Char *);
 #ifdef DEBUG
-static void     qprintf __P((const char *, Char *));
+static void     qprintf(const char *, Char *);
 #endif
 
 int
 glob(pattern, flags, errfunc, pglob)
        const char *pattern;
-       int flags, (*errfunc) __P((const char *, int));
+       int flags, (*errfunc)(const char *, int);
        glob_t *pglob;
 {
        const u_char *patnext;
@@ -676,7 +677,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
 
 
 /*
- * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
+ * Extend the gl_pathv member of a glob_t structure to accommodate a new item,
  * add the new item, and update gl_pathc.
  *
  * This assumes the BSD realloc, which only copies the block when its size
@@ -821,7 +822,7 @@ g_opendir(str, pglob)
        char buf[MAXPATHLEN];
 
        if (!*str)
-               strcpy(buf, ".");
+               strlcpy(buf, ".", sizeof buf);
        else {
                if (g_Ctoc(str, buf, sizeof(buf)))
                        return(NULL);
index b4c8f7aaa642f58b554f80d9cd3958c1055e078b..6421f7049a8b479bcb6218b454ea929d8ed3511e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: glob.h,v 1.5 2001/03/18 17:18:58 deraadt Exp $        */
+/*     $OpenBSD: glob.h,v 1.7 2002/02/17 19:42:21 millert Exp $        */
 /*     $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $     */
 
 /*
@@ -53,18 +53,18 @@ typedef struct {
        int gl_flags;           /* Copy of flags parameter to glob. */
        char **gl_pathv;        /* List of paths matching pattern. */
                                /* Copy of errfunc parameter to glob. */
-       int (*gl_errfunc) __P((const char *, int));
+       int (*gl_errfunc)(const char *, int);
 
        /*
         * Alternate filesystem access methods for glob; replacement
         * versions of closedir(3), readdir(3), opendir(3), stat(2)
         * and lstat(2).
         */
-       void (*gl_closedir) __P((void *));
-       struct dirent *(*gl_readdir) __P((void *));     
-       void *(*gl_opendir) __P((const char *));
-       int (*gl_lstat) __P((const char *, struct stat *));
-       int (*gl_stat) __P((const char *, struct stat *));
+       void (*gl_closedir)(void *);
+       struct dirent *(*gl_readdir)(void *);   
+       void *(*gl_opendir)(const char *);
+       int (*gl_lstat)(const char *, struct stat *);
+       int (*gl_stat)(const char *, struct stat *);
 } glob_t;
 
 /* Flags */
@@ -91,8 +91,8 @@ typedef struct {
 #define        GLOB_NOSYS      (-4)    /* Function not supported. */
 #define GLOB_ABEND     GLOB_ABORTED
 
-int    glob __P((const char *, int, int (*)(const char *, int), glob_t *));
-void   globfree __P((glob_t *));
+int    glob(const char *, int, int (*)(const char *, int), glob_t *);
+void   globfree(glob_t *);
 
 #endif /* !_GLOB_H_ */
 
index 8a8b3c846eeaf2bb3444b39704811a445279dab2..ac5f567081eb56603372060cf4491eb95cebc67d 100644 (file)
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA)
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.2 1996/08/19 08:29:16 tholo Exp $";
+static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.3 2002/06/27 10:14:01 itojun Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 /*
@@ -57,7 +57,7 @@ char *inet_ntoa(struct in_addr in)
        p = (char *)&in;
 #define        UC(b)   (((int)b)&0xff)
        (void)snprintf(b, sizeof(b),
-           "%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
+           "%u.%u.%u.%u", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
        return (b);
 }
 
index 2b8d31f8da16922e1ddce8ddcb1b525452456b62..3bea519afb8c4fa9e46bf27eb1c177e78afc220a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: inet_ntop.c,v 1.1 1997/03/13 19:07:32 downsj Exp $    */
+/*     $OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $    */
 
 /* Copyright (c) 1996 by Internet Software Consortium.
  *
@@ -16,7 +16,7 @@
  * SOFTWARE.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #ifndef HAVE_INET_NTOP
 
@@ -24,7 +24,7 @@
 #if 0
 static char rcsid[] = "$From: inet_ntop.c,v 8.7 1996/08/05 08:41:18 vixie Exp $";
 #else
-static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.1 1997/03/13 19:07:32 downsj Exp $";
+static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Exp $";
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -54,8 +54,8 @@ static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.1 1997/03/13 19:07:32 downsj Ex
  * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
  */
 
-static const char *inet_ntop4 __P((const u_char *src, char *dst, size_t size));
-static const char *inet_ntop6 __P((const u_char *src, char *dst, size_t size));
+static const char *inet_ntop4(const u_char *src, char *dst, size_t size);
+static const char *inet_ntop6(const u_char *src, char *dst, size_t size);
 
 /* char *
  * inet_ntop(af, src, dst, size)
@@ -103,13 +103,14 @@ inet_ntop4(src, dst, size)
 {
        static const char fmt[] = "%u.%u.%u.%u";
        char tmp[sizeof "255.255.255.255"];
+       int l;
 
-       if (snprintf(tmp, sizeof(tmp), fmt, src[0], src[1], src[2],
-           src[3]) > size) {
+       l = snprintf(tmp, size, fmt, src[0], src[1], src[2], src[3]);
+       if (l <= 0 || l >= size) {
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       strlcpy(dst, tmp, size);
        return (dst);
 }
 
@@ -132,10 +133,12 @@ inet_ntop6(src, dst, size)
         * Keep this in mind if you think this function should have been coded
         * to use pointer overlays.  All the world's not a VAX.
         */
-       char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+       char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"];
+       char *tp, *ep;
        struct { int base, len; } best, cur;
        u_int words[IN6ADDRSZ / INT16SZ];
        int i;
+       int advance;
 
        /*
         * Preprocess:
@@ -172,31 +175,45 @@ inet_ntop6(src, dst, size)
         * Format the result.
         */
        tp = tmp;
-       for (i = 0; i < (IN6ADDRSZ / INT16SZ); i++) {
+       ep = tmp + sizeof(tmp);
+       for (i = 0; i < (IN6ADDRSZ / INT16SZ) && tp < ep; i++) {
                /* Are we inside the best run of 0x00's? */
                if (best.base != -1 && i >= best.base &&
                    i < (best.base + best.len)) {
-                       if (i == best.base)
+                       if (i == best.base) {
+                               if (tp + 1 >= ep)
+                                       return (NULL);
                                *tp++ = ':';
+                       }
                        continue;
                }
                /* Are we following an initial run of 0x00s or any real hex? */
-               if (i != 0)
+               if (i != 0) {
+                       if (tp + 1 >= ep)
+                               return (NULL);
                        *tp++ = ':';
+               }
                /* Is this address an encapsulated IPv4? */
                if (i == 6 && best.base == 0 &&
                    (best.len == 6 || (best.len == 5 && words[5] == 0xffff))) {
-                       if (!inet_ntop4(src+12, tp, sizeof tmp - (tp - tmp)))
+                       if (!inet_ntop4(src+12, tp, (size_t)(ep - tp)))
                                return (NULL);
                        tp += strlen(tp);
                        break;
                }
-               snprintf(tp, sizeof(tmp - (tp - tmp)), "%x", words[i]);
-               tp += strlen(tp);
+               advance = snprintf(tp, ep - tp, "%x", words[i]);
+               if (advance <= 0 || advance >= ep - tp)
+                       return (NULL);
+               tp += advance;
        }
        /* Was it a trailing run of 0x00's? */
-       if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ))
+       if (best.base != -1 && (best.base + best.len) == (IN6ADDRSZ / INT16SZ)) {
+               if (tp + 1 >= ep)
+                       return (NULL);
                *tp++ = ':';
+       }
+       if (tp + 1 >= ep)
+               return (NULL);
        *tp++ = '\0';
 
        /*
@@ -206,7 +223,7 @@ inet_ntop6(src, dst, size)
                errno = ENOSPC;
                return (NULL);
        }
-       strcpy(dst, tmp);
+       strlcpy(dst, tmp, size);
        return (dst);
 }
 
index d69dc5c24a5bb75d5c5ab244d714fa1e5a57745b..d256ee448a4c1304dae65686d619ea908ddbfe85 100644 (file)
@@ -39,7 +39,7 @@
 #ifndef HAVE_MKDTEMP
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: mktemp.c,v 1.14 2002/01/02 20:18:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mktemp.c,v 1.16 2002/05/27 18:20:45 millert Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #ifdef HAVE_CYGWIN
@@ -102,11 +102,11 @@ _gettemp(path, doopen, domkdir, slen)
                return (0);
        }
        pid = getpid();
-       while (*trv == 'X' && pid != 0) {
+       while (trv >= path && *trv == 'X' && pid != 0) {
                *trv-- = (pid % 10) + '0';
                pid /= 10;
        }
-       while (*trv == 'X') {
+       while (trv >= path && *trv == 'X') {
                char c;
 
                pid = (arc4random() & 0xffff) % (26+26);
index 551bdc939aafe4ae83aa3cf75d769c7f8acbe2ae..4c11bf20cae93ffa8687bd76e1177b93108c6fcb 100644 (file)
@@ -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"
index ca0a88e692ac3a797ca3a5e2f315ed012db562cc..4c96a3171b90caa1f9b10c3a766768431442ad4f 100644 (file)
@@ -1,3 +1,28 @@
+/*
+ *
+ * Copyright (c) 2001 Gert Doering.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
 #include "includes.h"
 
 #ifdef _AIX
 #include <../xmalloc.h>
 
 /*
- * AIX has a "usrinfo" area where logname and
- * other stuff is stored - a few applications
- * actually use this and die if it's not set
+ * AIX has a "usrinfo" area where logname and other stuff is stored - 
+ * a few applications actually use this and die if it's not set
+ *
+ * NOTE: TTY= should be set, but since no one uses it and it's hard to
+ * acquire due to privsep code.  We will just drop support.
  */
 void
-aix_usrinfo(struct passwd *pw, char *tty, int ttyfd) 
+aix_usrinfo(struct passwd *pw)
 {
        u_int i;
-       char *cp=NULL;
+       char *cp;
 
-       if (ttyfd == -1)
-               tty[0] = '\0';
-       cp = xmalloc(22 + strlen(tty) + 2 * strlen(pw->pw_name));
-       i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", pw->pw_name, 0, 
-           pw->pw_name, 0, tty, 0, 0);
+       cp = xmalloc(16 + 2 * strlen(pw->pw_name));
+       i = sprintf(cp, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, 0, 
+           pw->pw_name, 0);
        if (usrinfo(SETUINFO, cp, i) == -1)
                fatal("Couldn't set usrinfo: %s", strerror(errno));
        debug3("AIX/UsrInfo: set len %d", i);
index e4d14f4ae35150944426d51c3f0e6a6dd4c5698e..79570a206b8ec24ee8d22c3c008eb1980e25ec41 100644 (file)
@@ -1,5 +1,29 @@
-#ifdef _AIX
-
-void aix_usrinfo(struct passwd *pw, char *tty, int ttyfd);
+/*
+ *
+ * Copyright (c) 2001 Gert Doering.  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.
+ *
+ */
 
+#ifdef _AIX
+void aix_usrinfo(struct passwd *pw);
 #endif /* _AIX */
index 8c2f5f8416863647c944583def02f81fa0370721..4e549b62b91e73253ac9b86f5a3431f5e130de34 100644 (file)
@@ -1,7 +1,7 @@
-/*     $OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $     */
+/*     $OpenBSD: readpassphrase.c,v 1.14 2002/06/28 01:43:58 millert Exp $     */
 
 /*
- * Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com>
+ * Copyright (c) 2000-2002 Todd C. Miller <Todd.Miller@courtesan.com>
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -28,7 +28,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.12 2001/12/15 05:41:00 millert Exp $";
+static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.14 2002/06/28 01:43:58 millert Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include "includes.h"
@@ -60,8 +60,8 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
        int input, output, save_errno;
        char ch, *p, *end;
        struct termios term, oterm;
-       struct sigaction sa, saveint, savehup, savequit, saveterm;
-       struct sigaction savetstp, savettin, savettou;
+       struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
+       struct sigaction savetstp, savettin, savettou, savepipe;
 
        /* I suppose we could alloc on demand in this case (XXX). */
        if (bufsiz == 0) {
@@ -70,11 +70,13 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
        }
 
 restart:
+       signo = 0;
        /*
         * Read and write to /dev/tty if available.  If not, read from
         * stdin and write to stderr unless a tty is required.
         */
-       if ((input = output = open(_PATH_TTY, O_RDWR)) == -1) {
+       if ((flags & RPP_STDIN) ||
+           (input = output = open(_PATH_TTY, O_RDWR)) == -1) {
                if (flags & RPP_REQUIRE_TTY) {
                        errno = ENOTTY;
                        return(NULL);
@@ -86,13 +88,15 @@ restart:
        /*
         * Catch signals that would otherwise cause the user to end
         * up with echo turned off in the shell.  Don't worry about
-        * things like SIGALRM and SIGPIPE for now.
+        * things like SIGXCPU and SIGVTALRM for now.
         */
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = 0;                /* don't restart system calls */
        sa.sa_handler = handler;
-       (void)sigaction(SIGINT, &sa, &saveint);
+       (void)sigaction(SIGALRM, &sa, &savealrm);
        (void)sigaction(SIGHUP, &sa, &savehup);
+       (void)sigaction(SIGINT, &sa, &saveint);
+       (void)sigaction(SIGPIPE, &sa, &savepipe);
        (void)sigaction(SIGQUIT, &sa, &savequit);
        (void)sigaction(SIGTERM, &sa, &saveterm);
        (void)sigaction(SIGTSTP, &sa, &savetstp);
@@ -100,7 +104,7 @@ restart:
        (void)sigaction(SIGTTOU, &sa, &savettou);
 
        /* Turn off echo if possible. */
-       if (tcgetattr(input, &oterm) == 0) {
+       if (input != STDIN_FILENO && tcgetattr(input, &oterm) == 0) {
                memcpy(&term, &oterm, sizeof(term));
                if (!(flags & RPP_ECHO_ON))
                        term.c_lflag &= ~(ECHO | ECHONL);
@@ -111,10 +115,13 @@ restart:
                (void)tcsetattr(input, _T_FLUSH, &term);
        } else {
                memset(&term, 0, sizeof(term));
+               term.c_lflag |= ECHO;
                memset(&oterm, 0, sizeof(oterm));
+               oterm.c_lflag |= ECHO;
        }
 
-       (void)write(output, prompt, strlen(prompt));
+       if (!(flags & RPP_STDIN))
+               (void)write(output, prompt, strlen(prompt));
        end = buf + bufsiz - 1;
        for (p = buf; (nr = read(input, &ch, 1)) == 1 && ch != '\n' && ch != '\r';) {
                if (p < end) {
@@ -137,13 +144,14 @@ restart:
        /* Restore old terminal settings and signals. */
        if (memcmp(&term, &oterm, sizeof(term)) != 0)
                (void)tcsetattr(input, _T_FLUSH, &oterm);
-       (void)sigaction(SIGINT, &saveint, NULL);
+       (void)sigaction(SIGALRM, &savealrm, NULL);
        (void)sigaction(SIGHUP, &savehup, NULL);
+       (void)sigaction(SIGINT, &saveint, NULL);
        (void)sigaction(SIGQUIT, &savequit, NULL);
+       (void)sigaction(SIGPIPE, &savepipe, NULL);
        (void)sigaction(SIGTERM, &saveterm, NULL);
        (void)sigaction(SIGTSTP, &savetstp, NULL);
        (void)sigaction(SIGTTIN, &savettin, NULL);
-       (void)sigaction(SIGTTOU, &savettou, NULL);
        if (input != STDIN_FILENO)
                (void)close(input);
 
@@ -152,12 +160,11 @@ restart:
         * now that we have restored the signal handlers.
         */
        if (signo) {
-               kill(getpid(), signo); 
+               kill(getpid(), signo);
                switch (signo) {
                case SIGTSTP:
                case SIGTTIN:
                case SIGTTOU:
-                       signo = 0;
                        goto restart;
                }
        }
index 9077b6e0847b9168d890948e345099a5c17d6e12..92908a48955211aa199a68415d13d4739d34d6c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: readpassphrase.h,v 1.1 2000/11/21 00:48:38 millert Exp $      */
+/*     $OpenBSD: readpassphrase.h,v 1.3 2002/06/28 12:32:22 millert Exp $      */
 
 /*
  * Copyright (c) 2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -40,8 +40,9 @@
 #define RPP_FORCELOWER  0x04           /* Force input to lower case. */
 #define RPP_FORCEUPPER  0x08           /* Force input to upper case. */
 #define RPP_SEVENBIT    0x10           /* Strip the high bit from input. */
+#define RPP_STDIN       0x20           /* Read from stdin, not /dev/tty */
 
-char *readpassphrase(const char *, char *, size_t, int);
+char * readpassphrase(const char *, char *, size_t, int);
 
 #endif /* HAVE_READPASSPHRASE */
 
index b4a05db95314ca677a9b35ab4f2a38a02a53536c..b9035ca229fbd2639acfd64e782fa504bf1ede32 100644 (file)
@@ -32,7 +32,7 @@
 #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: realpath.c,v 1.6 2002/01/12 16:24:35 millert Exp $";
+static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <sys/param.h>
@@ -69,7 +69,7 @@ realpath(const char *path, char *resolved)
        /* Save the starting point. */
        getcwd(start,MAXPATHLEN);       
        if ((fd = open(".", O_RDONLY)) < 0) {
-               (void)strcpy(resolved, ".");
+               (void)strlcpy(resolved, ".", MAXPATHLEN);
                return (NULL);
        }
        close(fd);
@@ -129,7 +129,7 @@ loop:
         * Save the last component name and get the full pathname of
         * the current directory.
         */
-       (void)strcpy(wbuf, p);
+       (void)strlcpy(wbuf, p, sizeof wbuf);
        if (getcwd(resolved, MAXPATHLEN) == 0)
                goto err1;
 
index 44eac203631251c163afba885f215a4188aec21f..9f058961de2d59285df61b9639ad8c5807c98c4c 100644 (file)
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #ifndef HAVE_RRESVPORT_AF
 
index 6c2d5cd3188a149ac2d17a87a71f51507089c2de..1dff15c73d80af774a446d23ecf7bd309cdd9e79 100644 (file)
@@ -31,7 +31,7 @@
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 #ifndef HAVE_SETENV
 
 #if defined(LIBC_SCCS) && !defined(lint)
index 806eb02b65775e68c5e8759d1238ec863ce86582..35fbab0eb9d4385c07763d880732abce8aa643c6 100644 (file)
@@ -33,7 +33,7 @@
  *     and: Eric S. Raymond <esr@snark.thyrsus.com>                         *
  ****************************************************************************/
 
-#include "config.h"
+#include "includes.h"
 #include <signal.h>
 #include "sigact.h"
 
index 6ff65c19b13f77a9c167652bccaa8fc5977cf8ce..3a9b5d1a75f0e73f684a7e852fff0de29825867c 100644 (file)
@@ -27,7 +27,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 #ifndef HAVE_STRLCAT
 
 #if defined(LIBC_SCCS) && !defined(lint)
index b5e5a552e8910397d293df479ed3ec14fe70ef43..2f87eca442839751c5155080cfa6f6685b725616 100644 (file)
@@ -27,7 +27,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 #ifndef HAVE_STRLCPY
 
 #if defined(LIBC_SCCS) && !defined(lint)
index c03649cffba2d10bd88f0dc0e8e7e646bea3a3a8..d0afc44ae0f119ba5bf137f94d9e4dbaefec1864 100644 (file)
@@ -33,7 +33,7 @@
  * SUCH DAMAGE.
  */
 
-#include "config.h"
+#include "includes.h"
 
 #if !defined(HAVE_STRSEP)
 
diff --git a/openssh/openbsd-compat/sys-queue.h b/openssh/openbsd-compat/sys-queue.h
new file mode 100644 (file)
index 0000000..176fe31
--- /dev/null
@@ -0,0 +1,584 @@
+/*     $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $      */
+/*     $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $       */
+
+/*
+ * Copyright (c) 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ *    must display the following acknowledgement:
+ *     This product includes software developed by the University of
+ *     California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *     @(#)queue.h     8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef        _FAKE_QUEUE_H_
+#define        _FAKE_QUEUE_H_
+
+/*
+ * Ignore all <sys/queue.h> since older platforms have broken/incomplete
+ * <sys/queue.h> that are too hard to work around.
+ */
+#undef SLIST_HEAD
+#undef SLIST_HEAD_INITIALIZER
+#undef SLIST_ENTRY
+#undef SLIST_FIRST
+#undef SLIST_END
+#undef SLIST_EMPTY
+#undef SLIST_NEXT
+#undef SLIST_FOREACH
+#undef SLIST_INIT
+#undef SLIST_INSERT_AFTER
+#undef SLIST_INSERT_HEAD
+#undef SLIST_REMOVE_HEAD
+#undef SLIST_REMOVE
+#undef LIST_HEAD
+#undef LIST_HEAD_INITIALIZER
+#undef LIST_ENTRY
+#undef LIST_FIRST
+#undef LIST_END
+#undef LIST_EMPTY
+#undef LIST_NEXT
+#undef LIST_FOREACH
+#undef LIST_INIT
+#undef LIST_INSERT_AFTER
+#undef LIST_INSERT_BEFORE
+#undef LIST_INSERT_HEAD
+#undef LIST_REMOVE
+#undef LIST_REPLACE
+#undef SIMPLEQ_HEAD
+#undef SIMPLEQ_HEAD_INITIALIZER
+#undef SIMPLEQ_ENTRY
+#undef SIMPLEQ_FIRST
+#undef SIMPLEQ_END
+#undef SIMPLEQ_EMPTY
+#undef SIMPLEQ_NEXT
+#undef SIMPLEQ_FOREACH
+#undef SIMPLEQ_INIT
+#undef SIMPLEQ_INSERT_HEAD
+#undef SIMPLEQ_INSERT_TAIL
+#undef SIMPLEQ_INSERT_AFTER
+#undef SIMPLEQ_REMOVE_HEAD
+#undef TAILQ_HEAD
+#undef TAILQ_HEAD_INITIALIZER
+#undef TAILQ_ENTRY
+#undef TAILQ_FIRST
+#undef TAILQ_END
+#undef TAILQ_NEXT
+#undef TAILQ_LAST
+#undef TAILQ_PREV
+#undef TAILQ_EMPTY
+#undef TAILQ_FOREACH
+#undef TAILQ_FOREACH_REVERSE
+#undef TAILQ_INIT
+#undef TAILQ_INSERT_HEAD
+#undef TAILQ_INSERT_TAIL
+#undef TAILQ_INSERT_AFTER
+#undef TAILQ_INSERT_BEFORE
+#undef TAILQ_REMOVE
+#undef TAILQ_REPLACE
+#undef CIRCLEQ_HEAD
+#undef CIRCLEQ_HEAD_INITIALIZER
+#undef CIRCLEQ_ENTRY
+#undef CIRCLEQ_FIRST
+#undef CIRCLEQ_LAST
+#undef CIRCLEQ_END
+#undef CIRCLEQ_NEXT
+#undef CIRCLEQ_PREV
+#undef CIRCLEQ_EMPTY
+#undef CIRCLEQ_FOREACH
+#undef CIRCLEQ_FOREACH_REVERSE
+#undef CIRCLEQ_INIT
+#undef CIRCLEQ_INSERT_AFTER
+#undef CIRCLEQ_INSERT_BEFORE
+#undef CIRCLEQ_INSERT_HEAD
+#undef CIRCLEQ_INSERT_TAIL
+#undef CIRCLEQ_REMOVE
+#undef CIRCLEQ_REPLACE
+
+/*
+ * This file defines five types of data structures: singly-linked lists, 
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction.  Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * Singly-linked List definitions.
+ */
+#define SLIST_HEAD(name, type)                                         \
+struct name {                                                          \
+       struct type *slh_first; /* first element */                     \
+}
+#define        SLIST_HEAD_INITIALIZER(head)                                    \
+       { NULL }
+#define SLIST_ENTRY(type)                                              \
+struct {                                                               \
+       struct type *sle_next;  /* next element */                      \
+}
+/*
+ * Singly-linked List access methods.
+ */
+#define        SLIST_FIRST(head)       ((head)->slh_first)
+#define        SLIST_END(head)         NULL
+#define        SLIST_EMPTY(head)       (SLIST_FIRST(head) == SLIST_END(head))
+#define        SLIST_NEXT(elm, field)  ((elm)->field.sle_next)
+
+#define        SLIST_FOREACH(var, head, field)                                 \
+       for((var) = SLIST_FIRST(head);                                  \
+           (var) != SLIST_END(head);                                   \
+           (var) = SLIST_NEXT(var, field))
+
+/*
+ * Singly-linked List functions.
+ */
+#define        SLIST_INIT(head) {                                              \
+       SLIST_FIRST(head) = SLIST_END(head);                            \
+}
+
+#define        SLIST_INSERT_AFTER(slistelm, elm, field) do {                   \
+       (elm)->field.sle_next = (slistelm)->field.sle_next;             \
+       (slistelm)->field.sle_next = (elm);                             \
+} while (0)
+
+#define        SLIST_INSERT_HEAD(head, elm, field) do {                        \
+       (elm)->field.sle_next = (head)->slh_first;                      \
+       (head)->slh_first = (elm);                                      \
+} while (0)
+
+#define        SLIST_REMOVE_HEAD(head, field) do {                             \
+       (head)->slh_first = (head)->slh_first->field.sle_next;          \
+} while (0)
+
+#define SLIST_REMOVE(head, elm, type, field) do {                      \
+       if ((head)->slh_first == (elm)) {                               \
+               SLIST_REMOVE_HEAD((head), field);                       \
+       }                                                               \
+       else {                                                          \
+               struct type *curelm = (head)->slh_first;                \
+               while( curelm->field.sle_next != (elm) )                \
+                       curelm = curelm->field.sle_next;                \
+               curelm->field.sle_next =                                \
+                   curelm->field.sle_next->field.sle_next;             \
+       }                                                               \
+} while (0)
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type)                                          \
+struct name {                                                          \
+       struct type *lh_first;  /* first element */                     \
+}
+
+#define LIST_HEAD_INITIALIZER(head)                                    \
+       { NULL }
+
+#define LIST_ENTRY(type)                                               \
+struct {                                                               \
+       struct type *le_next;   /* next element */                      \
+       struct type **le_prev;  /* address of previous next element */  \
+}
+
+/*
+ * List access methods
+ */
+#define        LIST_FIRST(head)                ((head)->lh_first)
+#define        LIST_END(head)                  NULL
+#define        LIST_EMPTY(head)                (LIST_FIRST(head) == LIST_END(head))
+#define        LIST_NEXT(elm, field)           ((elm)->field.le_next)
+
+#define LIST_FOREACH(var, head, field)                                 \
+       for((var) = LIST_FIRST(head);                                   \
+           (var)!= LIST_END(head);                                     \
+           (var) = LIST_NEXT(var, field))
+
+/*
+ * List functions.
+ */
+#define        LIST_INIT(head) do {                                            \
+       LIST_FIRST(head) = LIST_END(head);                              \
+} while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do {                    \
+       if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)  \
+               (listelm)->field.le_next->field.le_prev =               \
+                   &(elm)->field.le_next;                              \
+       (listelm)->field.le_next = (elm);                               \
+       (elm)->field.le_prev = &(listelm)->field.le_next;               \
+} while (0)
+
+#define        LIST_INSERT_BEFORE(listelm, elm, field) do {                    \
+       (elm)->field.le_prev = (listelm)->field.le_prev;                \
+       (elm)->field.le_next = (listelm);                               \
+       *(listelm)->field.le_prev = (elm);                              \
+       (listelm)->field.le_prev = &(elm)->field.le_next;               \
+} while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do {                                \
+       if (((elm)->field.le_next = (head)->lh_first) != NULL)          \
+               (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+       (head)->lh_first = (elm);                                       \
+       (elm)->field.le_prev = &(head)->lh_first;                       \
+} while (0)
+
+#define LIST_REMOVE(elm, field) do {                                   \
+       if ((elm)->field.le_next != NULL)                               \
+               (elm)->field.le_next->field.le_prev =                   \
+                   (elm)->field.le_prev;                               \
+       *(elm)->field.le_prev = (elm)->field.le_next;                   \
+} while (0)
+
+#define LIST_REPLACE(elm, elm2, field) do {                            \
+       if (((elm2)->field.le_next = (elm)->field.le_next) != NULL)     \
+               (elm2)->field.le_next->field.le_prev =                  \
+                   &(elm2)->field.le_next;                             \
+       (elm2)->field.le_prev = (elm)->field.le_prev;                   \
+       *(elm2)->field.le_prev = (elm2);                                \
+} while (0)
+
+/*
+ * Simple queue definitions.
+ */
+#define SIMPLEQ_HEAD(name, type)                                       \
+struct name {                                                          \
+       struct type *sqh_first; /* first element */                     \
+       struct type **sqh_last; /* addr of last next element */         \
+}
+
+#define SIMPLEQ_HEAD_INITIALIZER(head)                                 \
+       { NULL, &(head).sqh_first }
+
+#define SIMPLEQ_ENTRY(type)                                            \
+struct {                                                               \
+       struct type *sqe_next;  /* next element */                      \
+}
+
+/*
+ * Simple queue access methods.
+ */
+#define        SIMPLEQ_FIRST(head)         ((head)->sqh_first)
+#define        SIMPLEQ_END(head)           NULL
+#define        SIMPLEQ_EMPTY(head)         (SIMPLEQ_FIRST(head) == SIMPLEQ_END(head))
+#define        SIMPLEQ_NEXT(elm, field)    ((elm)->field.sqe_next)
+
+#define SIMPLEQ_FOREACH(var, head, field)                              \
+       for((var) = SIMPLEQ_FIRST(head);                                \
+           (var) != SIMPLEQ_END(head);                                 \
+           (var) = SIMPLEQ_NEXT(var, field))
+
+/*
+ * Simple queue functions.
+ */
+#define        SIMPLEQ_INIT(head) do {                                         \
+       (head)->sqh_first = NULL;                                       \
+       (head)->sqh_last = &(head)->sqh_first;                          \
+} while (0)
+
+#define SIMPLEQ_INSERT_HEAD(head, elm, field) do {                     \
+       if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)        \
+               (head)->sqh_last = &(elm)->field.sqe_next;              \
+       (head)->sqh_first = (elm);                                      \
+} while (0)
+
+#define SIMPLEQ_INSERT_TAIL(head, elm, field) do {                     \
+       (elm)->field.sqe_next = NULL;                                   \
+       *(head)->sqh_last = (elm);                                      \
+       (head)->sqh_last = &(elm)->field.sqe_next;                      \
+} while (0)
+
+#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {           \
+       if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+               (head)->sqh_last = &(elm)->field.sqe_next;              \
+       (listelm)->field.sqe_next = (elm);                              \
+} while (0)
+
+#define SIMPLEQ_REMOVE_HEAD(head, elm, field) do {                     \
+       if (((head)->sqh_first = (elm)->field.sqe_next) == NULL)        \
+               (head)->sqh_last = &(head)->sqh_first;                  \
+} while (0)
+
+/*
+ * Tail queue definitions.
+ */
+#define TAILQ_HEAD(name, type)                                         \
+struct name {                                                          \
+       struct type *tqh_first; /* first element */                     \
+       struct type **tqh_last; /* addr of last next element */         \
+}
+
+#define TAILQ_HEAD_INITIALIZER(head)                                   \
+       { NULL, &(head).tqh_first }
+
+#define TAILQ_ENTRY(type)                                              \
+struct {                                                               \
+       struct type *tqe_next;  /* next element */                      \
+       struct type **tqe_prev; /* address of previous next element */  \
+}
+
+/* 
+ * tail queue access methods 
+ */
+#define        TAILQ_FIRST(head)               ((head)->tqh_first)
+#define        TAILQ_END(head)                 NULL
+#define        TAILQ_NEXT(elm, field)          ((elm)->field.tqe_next)
+#define TAILQ_LAST(head, headname)                                     \
+       (*(((struct headname *)((head)->tqh_last))->tqh_last))
+/* XXX */
+#define TAILQ_PREV(elm, headname, field)                               \
+       (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+#define        TAILQ_EMPTY(head)                                               \
+       (TAILQ_FIRST(head) == TAILQ_END(head))
+
+#define TAILQ_FOREACH(var, head, field)                                        \
+       for((var) = TAILQ_FIRST(head);                                  \
+           (var) != TAILQ_END(head);                                   \
+           (var) = TAILQ_NEXT(var, field))
+
+#define TAILQ_FOREACH_REVERSE(var, head, field, headname)              \
+       for((var) = TAILQ_LAST(head, headname);                         \
+           (var) != TAILQ_END(head);                                   \
+           (var) = TAILQ_PREV(var, headname, field))
+
+/*
+ * Tail queue functions.
+ */
+#define        TAILQ_INIT(head) do {                                           \
+       (head)->tqh_first = NULL;                                       \
+       (head)->tqh_last = &(head)->tqh_first;                          \
+} while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do {                       \
+       if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)        \
+               (head)->tqh_first->field.tqe_prev =                     \
+                   &(elm)->field.tqe_next;                             \
+       else                                                            \
+               (head)->tqh_last = &(elm)->field.tqe_next;              \
+       (head)->tqh_first = (elm);                                      \
+       (elm)->field.tqe_prev = &(head)->tqh_first;                     \
+} while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do {                       \
+       (elm)->field.tqe_next = NULL;                                   \
+       (elm)->field.tqe_prev = (head)->tqh_last;                       \
+       *(head)->tqh_last = (elm);                                      \
+       (head)->tqh_last = &(elm)->field.tqe_next;                      \
+} while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do {             \
+       if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+               (elm)->field.tqe_next->field.tqe_prev =                 \
+                   &(elm)->field.tqe_next;                             \
+       else                                                            \
+               (head)->tqh_last = &(elm)->field.tqe_next;              \
+       (listelm)->field.tqe_next = (elm);                              \
+       (elm)->field.tqe_prev = &(listelm)->field.tqe_next;             \
+} while (0)
+
+#define        TAILQ_INSERT_BEFORE(listelm, elm, field) do {                   \
+       (elm)->field.tqe_prev = (listelm)->field.tqe_prev;              \
+       (elm)->field.tqe_next = (listelm);                              \
+       *(listelm)->field.tqe_prev = (elm);                             \
+       (listelm)->field.tqe_prev = &(elm)->field.tqe_next;             \
+} while (0)
+
+#define TAILQ_REMOVE(head, elm, field) do {                            \
+       if (((elm)->field.tqe_next) != NULL)                            \
+               (elm)->field.tqe_next->field.tqe_prev =                 \
+                   (elm)->field.tqe_prev;                              \
+       else                                                            \
+               (head)->tqh_last = (elm)->field.tqe_prev;               \
+       *(elm)->field.tqe_prev = (elm)->field.tqe_next;                 \
+} while (0)
+
+#define TAILQ_REPLACE(head, elm, elm2, field) do {                     \
+       if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != NULL)   \
+               (elm2)->field.tqe_next->field.tqe_prev =                \
+                   &(elm2)->field.tqe_next;                            \
+       else                                                            \
+               (head)->tqh_last = &(elm2)->field.tqe_next;             \
+       (elm2)->field.tqe_prev = (elm)->field.tqe_prev;                 \
+       *(elm2)->field.tqe_prev = (elm2);                               \
+} while (0)
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type)                                       \
+struct name {                                                          \
+       struct type *cqh_first;         /* first element */             \
+       struct type *cqh_last;          /* last element */              \
+}
+
+#define CIRCLEQ_HEAD_INITIALIZER(head)                                 \
+       { CIRCLEQ_END(&head), CIRCLEQ_END(&head) }
+
+#define CIRCLEQ_ENTRY(type)                                            \
+struct {                                                               \
+       struct type *cqe_next;          /* next element */              \
+       struct type *cqe_prev;          /* previous element */          \
+}
+
+/*
+ * Circular queue access methods 
+ */
+#define        CIRCLEQ_FIRST(head)             ((head)->cqh_first)
+#define        CIRCLEQ_LAST(head)              ((head)->cqh_last)
+#define        CIRCLEQ_END(head)               ((void *)(head))
+#define        CIRCLEQ_NEXT(elm, field)        ((elm)->field.cqe_next)
+#define        CIRCLEQ_PREV(elm, field)        ((elm)->field.cqe_prev)
+#define        CIRCLEQ_EMPTY(head)                                             \
+       (CIRCLEQ_FIRST(head) == CIRCLEQ_END(head))
+
+#define CIRCLEQ_FOREACH(var, head, field)                              \
+       for((var) = CIRCLEQ_FIRST(head);                                \
+           (var) != CIRCLEQ_END(head);                                 \
+           (var) = CIRCLEQ_NEXT(var, field))
+
+#define CIRCLEQ_FOREACH_REVERSE(var, head, field)                      \
+       for((var) = CIRCLEQ_LAST(head);                                 \
+           (var) != CIRCLEQ_END(head);                                 \
+           (var) = CIRCLEQ_PREV(var, field))
+
+/*
+ * Circular queue functions.
+ */
+#define        CIRCLEQ_INIT(head) do {                                         \
+       (head)->cqh_first = CIRCLEQ_END(head);                          \
+       (head)->cqh_last = CIRCLEQ_END(head);                           \
+} while (0)
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {           \
+       (elm)->field.cqe_next = (listelm)->field.cqe_next;              \
+       (elm)->field.cqe_prev = (listelm);                              \
+       if ((listelm)->field.cqe_next == CIRCLEQ_END(head))             \
+               (head)->cqh_last = (elm);                               \
+       else                                                            \
+               (listelm)->field.cqe_next->field.cqe_prev = (elm);      \
+       (listelm)->field.cqe_next = (elm);                              \
+} while (0)
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {          \
+       (elm)->field.cqe_next = (listelm);                              \
+       (elm)->field.cqe_prev = (listelm)->field.cqe_prev;              \
+       if ((listelm)->field.cqe_prev == CIRCLEQ_END(head))             \
+               (head)->cqh_first = (elm);                              \
+       else                                                            \
+               (listelm)->field.cqe_prev->field.cqe_next = (elm);      \
+       (listelm)->field.cqe_prev = (elm);                              \
+} while (0)
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) do {                     \
+       (elm)->field.cqe_next = (head)->cqh_first;                      \
+       (elm)->field.cqe_prev = CIRCLEQ_END(head);                      \
+       if ((head)->cqh_last == CIRCLEQ_END(head))                      \
+               (head)->cqh_last = (elm);                               \
+       else                                                            \
+               (head)->cqh_first->field.cqe_prev = (elm);              \
+       (head)->cqh_first = (elm);                                      \
+} while (0)
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) do {                     \
+       (elm)->field.cqe_next = CIRCLEQ_END(head);                      \
+       (elm)->field.cqe_prev = (head)->cqh_last;                       \
+       if ((head)->cqh_first == CIRCLEQ_END(head))                     \
+               (head)->cqh_first = (elm);                              \
+       else                                                            \
+               (head)->cqh_last->field.cqe_next = (elm);               \
+       (head)->cqh_last = (elm);                                       \
+} while (0)
+
+#define        CIRCLEQ_REMOVE(head, elm, field) do {                           \
+       if ((elm)->field.cqe_next == CIRCLEQ_END(head))                 \
+               (head)->cqh_last = (elm)->field.cqe_prev;               \
+       else                                                            \
+               (elm)->field.cqe_next->field.cqe_prev =                 \
+                   (elm)->field.cqe_prev;                              \
+       if ((elm)->field.cqe_prev == CIRCLEQ_END(head))                 \
+               (head)->cqh_first = (elm)->field.cqe_next;              \
+       else                                                            \
+               (elm)->field.cqe_prev->field.cqe_next =                 \
+                   (elm)->field.cqe_next;                              \
+} while (0)
+
+#define CIRCLEQ_REPLACE(head, elm, elm2, field) do {                   \
+       if (((elm2)->field.cqe_next = (elm)->field.cqe_next) ==         \
+           CIRCLEQ_END(head))                                          \
+               (head).cqh_last = (elm2);                               \
+       else                                                            \
+               (elm2)->field.cqe_next->field.cqe_prev = (elm2);        \
+       if (((elm2)->field.cqe_prev = (elm)->field.cqe_prev) ==         \
+           CIRCLEQ_END(head))                                          \
+               (head).cqh_first = (elm2);                              \
+       else                                                            \
+               (elm2)->field.cqe_prev->field.cqe_next = (elm2);        \
+} while (0)
+
+#endif /* !_FAKE_QUEUE_H_ */
diff --git a/openssh/openbsd-compat/sys-tree.h b/openssh/openbsd-compat/sys-tree.h
new file mode 100644 (file)
index 0000000..0a58710
--- /dev/null
@@ -0,0 +1,675 @@
+/*     $OpenBSD: tree.h,v 1.6 2002/06/11 22:09:52 provos Exp $ */
+/*
+ * Copyright 2002 Niels Provos <provos@citi.umich.edu>
+ * 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.
+ */
+
+#ifndef        _SYS_TREE_H_
+#define        _SYS_TREE_H_
+
+/*
+ * This file defines data structures for different types of trees:
+ * splay trees and red-black trees.
+ *
+ * A splay tree is a self-organizing data structure.  Every operation
+ * on the tree causes a splay to happen.  The splay moves the requested
+ * node to the root of the tree and partly rebalances it.
+ *
+ * This has the benefit that request locality causes faster lookups as
+ * the requested nodes move to the top of the tree.  On the other hand,
+ * every lookup causes memory writes.
+ *
+ * The Balance Theorem bounds the total access time for m operations
+ * and n inserts on an initially empty tree as O((m + n)lg n).  The
+ * amortized cost for a sequence of m accesses to a splay tree is O(lg n);
+ *
+ * A red-black tree is a binary search tree with the node color as an
+ * extra attribute.  It fulfills a set of conditions:
+ *     - every search path from the root to a leaf consists of the
+ *       same number of black nodes,
+ *     - each red node (except for the root) has a black parent,
+ *     - each leaf node is black.
+ *
+ * Every operation on a red-black tree is bounded as O(lg n).
+ * The maximum height of a red-black tree is 2lg (n+1).
+ */
+
+#define SPLAY_HEAD(name, type)                                         \
+struct name {                                                          \
+       struct type *sph_root; /* root of the tree */                   \
+}
+
+#define SPLAY_INITIALIZER(root)                                                \
+       { NULL }
+
+#define SPLAY_INIT(root) do {                                          \
+       (root)->sph_root = NULL;                                        \
+} while (0)
+
+#define SPLAY_ENTRY(type)                                              \
+struct {                                                               \
+       struct type *spe_left; /* left element */                       \
+       struct type *spe_right; /* right element */                     \
+}
+
+#define SPLAY_LEFT(elm, field)         (elm)->field.spe_left
+#define SPLAY_RIGHT(elm, field)                (elm)->field.spe_right
+#define SPLAY_ROOT(head)               (head)->sph_root
+#define SPLAY_EMPTY(head)              (SPLAY_ROOT(head) == NULL)
+
+/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */
+#define SPLAY_ROTATE_RIGHT(head, tmp, field) do {                      \
+       SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field);  \
+       SPLAY_RIGHT(tmp, field) = (head)->sph_root;                     \
+       (head)->sph_root = tmp;                                         \
+} while (0)
+       
+#define SPLAY_ROTATE_LEFT(head, tmp, field) do {                       \
+       SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field);  \
+       SPLAY_LEFT(tmp, field) = (head)->sph_root;                      \
+       (head)->sph_root = tmp;                                         \
+} while (0)
+
+#define SPLAY_LINKLEFT(head, tmp, field) do {                          \
+       SPLAY_LEFT(tmp, field) = (head)->sph_root;                      \
+       tmp = (head)->sph_root;                                         \
+       (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);         \
+} while (0)
+
+#define SPLAY_LINKRIGHT(head, tmp, field) do {                         \
+       SPLAY_RIGHT(tmp, field) = (head)->sph_root;                     \
+       tmp = (head)->sph_root;                                         \
+       (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);        \
+} while (0)
+
+#define SPLAY_ASSEMBLE(head, node, left, right, field) do {            \
+       SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \
+       SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\
+       SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \
+       SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \
+} while (0)
+
+/* Generates prototypes and inline functions */
+
+#define SPLAY_PROTOTYPE(name, type, field, cmp)                                \
+void name##_SPLAY(struct name *, struct type *);                       \
+void name##_SPLAY_MINMAX(struct name *, int);                          \
+struct type *name##_SPLAY_INSERT(struct name *, struct type *);                \
+struct type *name##_SPLAY_REMOVE(struct name *, struct type *);                \
+                                                                       \
+/* Finds the node with the same key as elm */                          \
+static __inline struct type *                                          \
+name##_SPLAY_FIND(struct name *head, struct type *elm)                 \
+{                                                                      \
+       if (SPLAY_EMPTY(head))                                          \
+               return(NULL);                                           \
+       name##_SPLAY(head, elm);                                        \
+       if ((cmp)(elm, (head)->sph_root) == 0)                          \
+               return (head->sph_root);                                \
+       return (NULL);                                                  \
+}                                                                      \
+                                                                       \
+static __inline struct type *                                          \
+name##_SPLAY_NEXT(struct name *head, struct type *elm)                 \
+{                                                                      \
+       name##_SPLAY(head, elm);                                        \
+       if (SPLAY_RIGHT(elm, field) != NULL) {                          \
+               elm = SPLAY_RIGHT(elm, field);                          \
+               while (SPLAY_LEFT(elm, field) != NULL) {                \
+                       elm = SPLAY_LEFT(elm, field);                   \
+               }                                                       \
+       } else                                                          \
+               elm = NULL;                                             \
+       return (elm);                                                   \
+}                                                                      \
+                                                                       \
+static __inline struct type *                                          \
+name##_SPLAY_MIN_MAX(struct name *head, int val)                       \
+{                                                                      \
+       name##_SPLAY_MINMAX(head, val);                                 \
+        return (SPLAY_ROOT(head));                                     \
+}
+
+/* Main splay operation.
+ * Moves node close to the key of elm to top
+ */
+#define SPLAY_GENERATE(name, type, field, cmp)                         \
+struct type *                                                          \
+name##_SPLAY_INSERT(struct name *head, struct type *elm)               \
+{                                                                      \
+    if (SPLAY_EMPTY(head)) {                                           \
+           SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL;    \
+    } else {                                                           \
+           int __comp;                                                 \
+           name##_SPLAY(head, elm);                                    \
+           __comp = (cmp)(elm, (head)->sph_root);                      \
+           if(__comp < 0) {                                            \
+                   SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\
+                   SPLAY_RIGHT(elm, field) = (head)->sph_root;         \
+                   SPLAY_LEFT((head)->sph_root, field) = NULL;         \
+           } else if (__comp > 0) {                                    \
+                   SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\
+                   SPLAY_LEFT(elm, field) = (head)->sph_root;          \
+                   SPLAY_RIGHT((head)->sph_root, field) = NULL;        \
+           } else                                                      \
+                   return ((head)->sph_root);                          \
+    }                                                                  \
+    (head)->sph_root = (elm);                                          \
+    return (NULL);                                                     \
+}                                                                      \
+                                                                       \
+struct type *                                                          \
+name##_SPLAY_REMOVE(struct name *head, struct type *elm)               \
+{                                                                      \
+       struct type *__tmp;                                             \
+       if (SPLAY_EMPTY(head))                                          \
+               return (NULL);                                          \
+       name##_SPLAY(head, elm);                                        \
+       if ((cmp)(elm, (head)->sph_root) == 0) {                        \
+               if (SPLAY_LEFT((head)->sph_root, field) == NULL) {      \
+                       (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\
+               } else {                                                \
+                       __tmp = SPLAY_RIGHT((head)->sph_root, field);   \
+                       (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\
+                       name##_SPLAY(head, elm);                        \
+                       SPLAY_RIGHT((head)->sph_root, field) = __tmp;   \
+               }                                                       \
+               return (elm);                                           \
+       }                                                               \
+       return (NULL);                                                  \
+}                                                                      \
+                                                                       \
+void                                                                   \
+name##_SPLAY(struct name *head, struct type *elm)                      \
+{                                                                      \
+       struct type __node, *__left, *__right, *__tmp;                  \
+       int __comp;                                                     \
+\
+       SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+       __left = __right = &__node;                                     \
+\
+       while ((__comp = (cmp)(elm, (head)->sph_root))) {               \
+               if (__comp < 0) {                                       \
+                       __tmp = SPLAY_LEFT((head)->sph_root, field);    \
+                       if (__tmp == NULL)                              \
+                               break;                                  \
+                       if ((cmp)(elm, __tmp) < 0){                     \
+                               SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+                               if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+                                       break;                          \
+                       }                                               \
+                       SPLAY_LINKLEFT(head, __right, field);           \
+               } else if (__comp > 0) {                                \
+                       __tmp = SPLAY_RIGHT((head)->sph_root, field);   \
+                       if (__tmp == NULL)                              \
+                               break;                                  \
+                       if ((cmp)(elm, __tmp) > 0){                     \
+                               SPLAY_ROTATE_LEFT(head, __tmp, field);  \
+                               if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+                                       break;                          \
+                       }                                               \
+                       SPLAY_LINKRIGHT(head, __left, field);           \
+               }                                                       \
+       }                                                               \
+       SPLAY_ASSEMBLE(head, &__node, __left, __right, field);          \
+}                                                                      \
+                                                                       \
+/* Splay with either the minimum or the maximum element                        \
+ * Used to find minimum or maximum element in tree.                    \
+ */                                                                    \
+void name##_SPLAY_MINMAX(struct name *head, int __comp) \
+{                                                                      \
+       struct type __node, *__left, *__right, *__tmp;                  \
+\
+       SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\
+       __left = __right = &__node;                                     \
+\
+       while (1) {                                                     \
+               if (__comp < 0) {                                       \
+                       __tmp = SPLAY_LEFT((head)->sph_root, field);    \
+                       if (__tmp == NULL)                              \
+                               break;                                  \
+                       if (__comp < 0){                                \
+                               SPLAY_ROTATE_RIGHT(head, __tmp, field); \
+                               if (SPLAY_LEFT((head)->sph_root, field) == NULL)\
+                                       break;                          \
+                       }                                               \
+                       SPLAY_LINKLEFT(head, __right, field);           \
+               } else if (__comp > 0) {                                \
+                       __tmp = SPLAY_RIGHT((head)->sph_root, field);   \
+                       if (__tmp == NULL)                              \
+                               break;                                  \
+                       if (__comp > 0) {                               \
+                               SPLAY_ROTATE_LEFT(head, __tmp, field);  \
+                               if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\
+                                       break;                          \
+                       }                                               \
+                       SPLAY_LINKRIGHT(head, __left, field);           \
+               }                                                       \
+       }                                                               \
+       SPLAY_ASSEMBLE(head, &__node, __left, __right, field);          \
+}
+
+#define SPLAY_NEGINF   -1
+#define SPLAY_INF      1
+
+#define SPLAY_INSERT(name, x, y)       name##_SPLAY_INSERT(x, y)
+#define SPLAY_REMOVE(name, x, y)       name##_SPLAY_REMOVE(x, y)
+#define SPLAY_FIND(name, x, y)         name##_SPLAY_FIND(x, y)
+#define SPLAY_NEXT(name, x, y)         name##_SPLAY_NEXT(x, y)
+#define SPLAY_MIN(name, x)             (SPLAY_EMPTY(x) ? NULL  \
+                                       : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF))
+#define SPLAY_MAX(name, x)             (SPLAY_EMPTY(x) ? NULL  \
+                                       : name##_SPLAY_MIN_MAX(x, SPLAY_INF))
+
+#define SPLAY_FOREACH(x, name, head)                                   \
+       for ((x) = SPLAY_MIN(name, head);                               \
+            (x) != NULL;                                               \
+            (x) = SPLAY_NEXT(name, head, x))
+
+/* Macros that define a red-back tree */
+#define RB_HEAD(name, type)                                            \
+struct name {                                                          \
+       struct type *rbh_root; /* root of the tree */                   \
+}
+
+#define RB_INITIALIZER(root)                                           \
+       { NULL }
+
+#define RB_INIT(root) do {                                             \
+       (root)->rbh_root = NULL;                                        \
+} while (0)
+
+#define RB_BLACK       0
+#define RB_RED         1
+#define RB_ENTRY(type)                                                 \
+struct {                                                               \
+       struct type *rbe_left;          /* left element */              \
+       struct type *rbe_right;         /* right element */             \
+       struct type *rbe_parent;        /* parent element */            \
+       int rbe_color;                  /* node color */                \
+}
+
+#define RB_LEFT(elm, field)            (elm)->field.rbe_left
+#define RB_RIGHT(elm, field)           (elm)->field.rbe_right
+#define RB_PARENT(elm, field)          (elm)->field.rbe_parent
+#define RB_COLOR(elm, field)           (elm)->field.rbe_color
+#define RB_ROOT(head)                  (head)->rbh_root
+#define RB_EMPTY(head)                 (RB_ROOT(head) == NULL)
+
+#define RB_SET(elm, parent, field) do {                                        \
+       RB_PARENT(elm, field) = parent;                                 \
+       RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL;              \
+       RB_COLOR(elm, field) = RB_RED;                                  \
+} while (0)
+
+#define RB_SET_BLACKRED(black, red, field) do {                                \
+       RB_COLOR(black, field) = RB_BLACK;                              \
+       RB_COLOR(red, field) = RB_RED;                                  \
+} while (0)
+
+#ifndef RB_AUGMENT
+#define RB_AUGMENT(x)
+#endif
+
+#define RB_ROTATE_LEFT(head, elm, tmp, field) do {                     \
+       (tmp) = RB_RIGHT(elm, field);                                   \
+       if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field))) {             \
+               RB_PARENT(RB_LEFT(tmp, field), field) = (elm);          \
+       }                                                               \
+       RB_AUGMENT(elm);                                                \
+       if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) {          \
+               if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))     \
+                       RB_LEFT(RB_PARENT(elm, field), field) = (tmp);  \
+               else                                                    \
+                       RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+               RB_AUGMENT(RB_PARENT(elm, field));                      \
+       } else                                                          \
+               (head)->rbh_root = (tmp);                               \
+       RB_LEFT(tmp, field) = (elm);                                    \
+       RB_PARENT(elm, field) = (tmp);                                  \
+       RB_AUGMENT(tmp);                                                \
+} while (0)
+
+#define RB_ROTATE_RIGHT(head, elm, tmp, field) do {                    \
+       (tmp) = RB_LEFT(elm, field);                                    \
+       if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field))) {             \
+               RB_PARENT(RB_RIGHT(tmp, field), field) = (elm);         \
+       }                                                               \
+       RB_AUGMENT(elm);                                                \
+       if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field))) {          \
+               if ((elm) == RB_LEFT(RB_PARENT(elm, field), field))     \
+                       RB_LEFT(RB_PARENT(elm, field), field) = (tmp);  \
+               else                                                    \
+                       RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
+               RB_AUGMENT(RB_PARENT(elm, field));                      \
+       } else                                                          \
+               (head)->rbh_root = (tmp);                               \
+       RB_RIGHT(tmp, field) = (elm);                                   \
+       RB_PARENT(elm, field) = (tmp);                                  \
+       RB_AUGMENT(tmp);                                                \
+} while (0)
+
+/* Generates prototypes and inline functions */
+#define RB_PROTOTYPE(name, type, field, cmp)                           \
+void name##_RB_INSERT_COLOR(struct name *, struct type *);     \
+void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
+struct type *name##_RB_REMOVE(struct name *, struct type *);           \
+struct type *name##_RB_INSERT(struct name *, struct type *);           \
+struct type *name##_RB_FIND(struct name *, struct type *);             \
+struct type *name##_RB_NEXT(struct name *, struct type *);             \
+struct type *name##_RB_MINMAX(struct name *, int);                     \
+                                                                       \
+
+/* Main rb operation.
+ * Moves node close to the key of elm to top
+ */
+#define RB_GENERATE(name, type, field, cmp)                            \
+void                                                                   \
+name##_RB_INSERT_COLOR(struct name *head, struct type *elm)            \
+{                                                                      \
+       struct type *parent, *gparent, *tmp;                            \
+       while ((parent = RB_PARENT(elm, field)) &&                      \
+           RB_COLOR(parent, field) == RB_RED) {                        \
+               gparent = RB_PARENT(parent, field);                     \
+               if (parent == RB_LEFT(gparent, field)) {                \
+                       tmp = RB_RIGHT(gparent, field);                 \
+                       if (tmp && RB_COLOR(tmp, field) == RB_RED) {    \
+                               RB_COLOR(tmp, field) = RB_BLACK;        \
+                               RB_SET_BLACKRED(parent, gparent, field);\
+                               elm = gparent;                          \
+                               continue;                               \
+                       }                                               \
+                       if (RB_RIGHT(parent, field) == elm) {           \
+                               RB_ROTATE_LEFT(head, parent, tmp, field);\
+                               tmp = parent;                           \
+                               parent = elm;                           \
+                               elm = tmp;                              \
+                       }                                               \
+                       RB_SET_BLACKRED(parent, gparent, field);        \
+                       RB_ROTATE_RIGHT(head, gparent, tmp, field);     \
+               } else {                                                \
+                       tmp = RB_LEFT(gparent, field);                  \
+                       if (tmp && RB_COLOR(tmp, field) == RB_RED) {    \
+                               RB_COLOR(tmp, field) = RB_BLACK;        \
+                               RB_SET_BLACKRED(parent, gparent, field);\
+                               elm = gparent;                          \
+                               continue;                               \
+                       }                                               \
+                       if (RB_LEFT(parent, field) == elm) {            \
+                               RB_ROTATE_RIGHT(head, parent, tmp, field);\
+                               tmp = parent;                           \
+                               parent = elm;                           \
+                               elm = tmp;                              \
+                       }                                               \
+                       RB_SET_BLACKRED(parent, gparent, field);        \
+                       RB_ROTATE_LEFT(head, gparent, tmp, field);      \
+               }                                                       \
+       }                                                               \
+       RB_COLOR(head->rbh_root, field) = RB_BLACK;                     \
+}                                                                      \
+                                                                       \
+void                                                                   \
+name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \
+{                                                                      \
+       struct type *tmp;                                               \
+       while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) &&     \
+           elm != RB_ROOT(head)) {                                     \
+               if (RB_LEFT(parent, field) == elm) {                    \
+                       tmp = RB_RIGHT(parent, field);                  \
+                       if (RB_COLOR(tmp, field) == RB_RED) {           \
+                               RB_SET_BLACKRED(tmp, parent, field);    \
+                               RB_ROTATE_LEFT(head, parent, tmp, field);\
+                               tmp = RB_RIGHT(parent, field);          \
+                       }                                               \
+                       if ((RB_LEFT(tmp, field) == NULL ||             \
+                           RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+                           (RB_RIGHT(tmp, field) == NULL ||            \
+                           RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+                               RB_COLOR(tmp, field) = RB_RED;          \
+                               elm = parent;                           \
+                               parent = RB_PARENT(elm, field);         \
+                       } else {                                        \
+                               if (RB_RIGHT(tmp, field) == NULL ||     \
+                                   RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\
+                                       struct type *oleft;             \
+                                       if ((oleft = RB_LEFT(tmp, field)))\
+                                               RB_COLOR(oleft, field) = RB_BLACK;\
+                                       RB_COLOR(tmp, field) = RB_RED;  \
+                                       RB_ROTATE_RIGHT(head, tmp, oleft, field);\
+                                       tmp = RB_RIGHT(parent, field);  \
+                               }                                       \
+                               RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+                               RB_COLOR(parent, field) = RB_BLACK;     \
+                               if (RB_RIGHT(tmp, field))               \
+                                       RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\
+                               RB_ROTATE_LEFT(head, parent, tmp, field);\
+                               elm = RB_ROOT(head);                    \
+                               break;                                  \
+                       }                                               \
+               } else {                                                \
+                       tmp = RB_LEFT(parent, field);                   \
+                       if (RB_COLOR(tmp, field) == RB_RED) {           \
+                               RB_SET_BLACKRED(tmp, parent, field);    \
+                               RB_ROTATE_RIGHT(head, parent, tmp, field);\
+                               tmp = RB_LEFT(parent, field);           \
+                       }                                               \
+                       if ((RB_LEFT(tmp, field) == NULL ||             \
+                           RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\
+                           (RB_RIGHT(tmp, field) == NULL ||            \
+                           RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\
+                               RB_COLOR(tmp, field) = RB_RED;          \
+                               elm = parent;                           \
+                               parent = RB_PARENT(elm, field);         \
+                       } else {                                        \
+                               if (RB_LEFT(tmp, field) == NULL ||      \
+                                   RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\
+                                       struct type *oright;            \
+                                       if ((oright = RB_RIGHT(tmp, field)))\
+                                               RB_COLOR(oright, field) = RB_BLACK;\
+                                       RB_COLOR(tmp, field) = RB_RED;  \
+                                       RB_ROTATE_LEFT(head, tmp, oright, field);\
+                                       tmp = RB_LEFT(parent, field);   \
+                               }                                       \
+                               RB_COLOR(tmp, field) = RB_COLOR(parent, field);\
+                               RB_COLOR(parent, field) = RB_BLACK;     \
+                               if (RB_LEFT(tmp, field))                \
+                                       RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\
+                               RB_ROTATE_RIGHT(head, parent, tmp, field);\
+                               elm = RB_ROOT(head);                    \
+                               break;                                  \
+                       }                                               \
+               }                                                       \
+       }                                                               \
+       if (elm)                                                        \
+               RB_COLOR(elm, field) = RB_BLACK;                        \
+}                                                                      \
+                                                                       \
+struct type *                                                          \
+name##_RB_REMOVE(struct name *head, struct type *elm)                  \
+{                                                                      \
+       struct type *child, *parent, *old = elm;                        \
+       int color;                                                      \
+       if (RB_LEFT(elm, field) == NULL)                                \
+               child = RB_RIGHT(elm, field);                           \
+       else if (RB_RIGHT(elm, field) == NULL)                          \
+               child = RB_LEFT(elm, field);                            \
+       else {                                                          \
+               struct type *left;                                      \
+               elm = RB_RIGHT(elm, field);                             \
+               while ((left = RB_LEFT(elm, field)))                    \
+                       elm = left;                                     \
+               child = RB_RIGHT(elm, field);                           \
+               parent = RB_PARENT(elm, field);                         \
+               color = RB_COLOR(elm, field);                           \
+               if (child)                                              \
+                       RB_PARENT(child, field) = parent;               \
+               if (parent) {                                           \
+                       if (RB_LEFT(parent, field) == elm)              \
+                               RB_LEFT(parent, field) = child;         \
+                       else                                            \
+                               RB_RIGHT(parent, field) = child;        \
+                       RB_AUGMENT(parent);                             \
+               } else                                                  \
+                       RB_ROOT(head) = child;                          \
+               if (RB_PARENT(elm, field) == old)                       \
+                       parent = elm;                                   \
+               (elm)->field = (old)->field;                            \
+               if (RB_PARENT(old, field)) {                            \
+                       if (RB_LEFT(RB_PARENT(old, field), field) == old)\
+                               RB_LEFT(RB_PARENT(old, field), field) = elm;\
+                       else                                            \
+                               RB_RIGHT(RB_PARENT(old, field), field) = elm;\
+                       RB_AUGMENT(RB_PARENT(old, field));              \
+               } else                                                  \
+                       RB_ROOT(head) = elm;                            \
+               RB_PARENT(RB_LEFT(old, field), field) = elm;            \
+               if (RB_RIGHT(old, field))                               \
+                       RB_PARENT(RB_RIGHT(old, field), field) = elm;   \
+               if (parent) {                                           \
+                       left = parent;                                  \
+                       do {                                            \
+                               RB_AUGMENT(left);                       \
+                       } while ((left = RB_PARENT(left, field)));      \
+               }                                                       \
+               goto color;                                             \
+       }                                                               \
+       parent = RB_PARENT(elm, field);                                 \
+       color = RB_COLOR(elm, field);                                   \
+       if (child)                                                      \
+               RB_PARENT(child, field) = parent;                       \
+       if (parent) {                                                   \
+               if (RB_LEFT(parent, field) == elm)                      \
+                       RB_LEFT(parent, field) = child;                 \
+               else                                                    \
+                       RB_RIGHT(parent, field) = child;                \
+               RB_AUGMENT(parent);                                     \
+       } else                                                          \
+               RB_ROOT(head) = child;                                  \
+color:                                                                 \
+       if (color == RB_BLACK)                                          \
+               name##_RB_REMOVE_COLOR(head, parent, child);            \
+       return (old);                                                   \
+}                                                                      \
+                                                                       \
+/* Inserts a node into the RB tree */                                  \
+struct type *                                                          \
+name##_RB_INSERT(struct name *head, struct type *elm)                  \
+{                                                                      \
+       struct type *tmp;                                               \
+       struct type *parent = NULL;                                     \
+       int comp = 0;                                                   \
+       tmp = RB_ROOT(head);                                            \
+       while (tmp) {                                                   \
+               parent = tmp;                                           \
+               comp = (cmp)(elm, parent);                              \
+               if (comp < 0)                                           \
+                       tmp = RB_LEFT(tmp, field);                      \
+               else if (comp > 0)                                      \
+                       tmp = RB_RIGHT(tmp, field);                     \
+               else                                                    \
+                       return (tmp);                                   \
+       }                                                               \
+       RB_SET(elm, parent, field);                                     \
+       if (parent != NULL) {                                           \
+               if (comp < 0)                                           \
+                       RB_LEFT(parent, field) = elm;                   \
+               else                                                    \
+                       RB_RIGHT(parent, field) = elm;                  \
+               RB_AUGMENT(parent);                                     \
+       } else                                                          \
+               RB_ROOT(head) = elm;                                    \
+       name##_RB_INSERT_COLOR(head, elm);                              \
+       return (NULL);                                                  \
+}                                                                      \
+                                                                       \
+/* Finds the node with the same key as elm */                          \
+struct type *                                                          \
+name##_RB_FIND(struct name *head, struct type *elm)                    \
+{                                                                      \
+       struct type *tmp = RB_ROOT(head);                               \
+       int comp;                                                       \
+       while (tmp) {                                                   \
+               comp = cmp(elm, tmp);                                   \
+               if (comp < 0)                                           \
+                       tmp = RB_LEFT(tmp, field);                      \
+               else if (comp > 0)                                      \
+                       tmp = RB_RIGHT(tmp, field);                     \
+               else                                                    \
+                       return (tmp);                                   \
+       }                                                               \
+       return (NULL);                                                  \
+}                                                                      \
+                                                                       \
+struct type *                                                          \
+name##_RB_NEXT(struct name *head, struct type *elm)                    \
+{                                                                      \
+       if (RB_RIGHT(elm, field)) {                                     \
+               elm = RB_RIGHT(elm, field);                             \
+               while (RB_LEFT(elm, field))                             \
+                       elm = RB_LEFT(elm, field);                      \
+       } else {                                                        \
+               if (RB_PARENT(elm, field) &&                            \
+                   (elm == RB_LEFT(RB_PARENT(elm, field), field)))     \
+                       elm = RB_PARENT(elm, field);                    \
+               else {                                                  \
+                       while (RB_PARENT(elm, field) &&                 \
+                           (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\
+                               elm = RB_PARENT(elm, field);            \
+                       elm = RB_PARENT(elm, field);                    \
+               }                                                       \
+       }                                                               \
+       return (elm);                                                   \
+}                                                                      \
+                                                                       \
+struct type *                                                          \
+name##_RB_MINMAX(struct name *head, int val)                           \
+{                                                                      \
+       struct type *tmp = RB_ROOT(head);                               \
+       struct type *parent = NULL;                                     \
+       while (tmp) {                                                   \
+               parent = tmp;                                           \
+               if (val < 0)                                            \
+                       tmp = RB_LEFT(tmp, field);                      \
+               else                                                    \
+                       tmp = RB_RIGHT(tmp, field);                     \
+       }                                                               \
+       return (parent);                                                \
+}
+
+#define RB_NEGINF      -1
+#define RB_INF 1
+
+#define RB_INSERT(name, x, y)  name##_RB_INSERT(x, y)
+#define RB_REMOVE(name, x, y)  name##_RB_REMOVE(x, y)
+#define RB_FIND(name, x, y)    name##_RB_FIND(x, y)
+#define RB_NEXT(name, x, y)    name##_RB_NEXT(x, y)
+#define RB_MIN(name, x)                name##_RB_MINMAX(x, RB_NEGINF)
+#define RB_MAX(name, x)                name##_RB_MINMAX(x, RB_INF)
+
+#define RB_FOREACH(x, name, head)                                      \
+       for ((x) = RB_MIN(name, head);                                  \
+            (x) != NULL;                                               \
+            (x) = name##_RB_NEXT(head, x))
+
+#endif /* _SYS_TREE_H_ */
diff --git a/openssh/openbsd-compat/xmmap.c b/openssh/openbsd-compat/xmmap.c
new file mode 100644 (file)
index 0000000..8f1d202
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * 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 <sys/mman.h>
+#endif
+
+#include "log.h"
+
+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/openssh/openbsd-compat/xmmap.h b/openssh/openbsd-compat/xmmap.h
new file mode 100644 (file)
index 0000000..c0fa04a
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+void *xmmap(size_t size);
index a5b2ab61a9c6c6d0673c17185ef99ae8f71f253f..bd347ef0f4ff90a87bc5944c934abd2717c39c37 100644 (file)
@@ -37,7 +37,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: packet.c,v 1.96 2002/06/23 21:10:02 deraadt Exp $");
+RCSID("$OpenBSD: packet.c,v 1.97 2002/07/04 08:12:15 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "buffer.h"
@@ -134,6 +134,7 @@ void
 packet_set_connection(int fd_in, int fd_out)
 {
        Cipher *none = cipher_by_name("none");
+
        if (none == NULL)
                fatal("packet_set_connection: cannot load cipher 'none'");
        connection_in = fd_in;
@@ -402,6 +403,7 @@ packet_set_encryption_key(const u_char *key, u_int keylen,
     int number)
 {
        Cipher *cipher = cipher_by_number(number);
+
        if (cipher == NULL)
                fatal("packet_set_encryption_key: unknown cipher number %d", number);
        if (keylen < 20)
@@ -443,6 +445,7 @@ void
 packet_put_char(int value)
 {
        char ch = value;
+
        buffer_append(&outgoing_packet, &ch, 1);
 }
 void
@@ -994,7 +997,8 @@ packet_read_poll2(u_int32_t *seqnr_p)
                buffer_clear(&incoming_packet);
                buffer_append(&incoming_packet, buffer_ptr(&compression_buffer),
                    buffer_len(&compression_buffer));
-               DBG(debug("input: len after de-compress %d", buffer_len(&incoming_packet)));
+               DBG(debug("input: len after de-compress %d",
+                   buffer_len(&incoming_packet)));
        }
        /*
         * get packet type, implies consume.
@@ -1102,6 +1106,7 @@ u_int
 packet_get_char(void)
 {
        char ch;
+
        buffer_get(&incoming_packet, &ch, 1);
        return (u_char) ch;
 }
@@ -1135,6 +1140,7 @@ void *
 packet_get_raw(int *length_ptr)
 {
        int bytes = buffer_len(&incoming_packet);
+
        if (length_ptr != NULL)
                *length_ptr = bytes;
        return buffer_ptr(&incoming_packet);
@@ -1207,6 +1213,7 @@ packet_disconnect(const char *fmt,...)
        char buf[1024];
        va_list args;
        static int disconnecting = 0;
+
        if (disconnecting)      /* Guard against recursive invocations. */
                fatal("packet_disconnect called recursively.");
        disconnecting = 1;
@@ -1249,6 +1256,7 @@ void
 packet_write_poll(void)
 {
        int len = buffer_len(&output);
+
        if (len > 0) {
                len = write(connection_out, buffer_ptr(&output), len);
                if (len <= 0) {
@@ -1368,6 +1376,7 @@ int
 packet_set_maxsize(int s)
 {
        static int called = 0;
+
        if (called) {
                log("packet_set_maxsize: called twice: old %d new %d",
                    max_packet_size, s);
index 580e7e07fa6a72da3829731a2aca5040b7912ea7..c680d6bf3f63dc24c853c389346d1561d2ad7d5f 100644 (file)
@@ -26,7 +26,7 @@
 #include "includes.h"
 #include "uuencode.h"
 
-RCSID("$OpenBSD: radix.c,v 1.21 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: radix.c,v 1.22 2002/09/09 14:54:15 markus Exp $");
 
 #ifdef AFS
 #include <krb.h>
@@ -93,9 +93,10 @@ int
 radix_to_creds(const char *buf, CREDENTIALS *creds)
 {
        Buffer b;
-       char c, version, *space, *p;
-       u_int endTime;
-       int len, blen, ret;
+       u_char *space;
+       char c, version, *p;
+       u_int endTime, len;
+       int blen, ret;
 
        ret = 0;
        blen = strlen(buf);
index 80d99fef1a4dda59abf31c7bfeec896cba48ded5..bae06be1269c8db2250079e84de78dcff62da08d 100644 (file)
@@ -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.");
index 448048ea6c773f59602e8a073da7ba6ee1220eb2..6965ca3b0de6a31ccdcaad488282c03d93615ec7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rijndael.c,v 1.13 2001/12/19 07:18:56 deraadt Exp $ */
+/*     $OpenBSD: rijndael.c,v 1.14 2002/07/10 17:53:54 deraadt Exp $ */
 
 /**
  * rijndael-alg-fst.c
@@ -1226,7 +1226,7 @@ rijndael_set_key(rijndael_ctx *ctx, u_char *key, int bits, int encrypt)
                memset(ctx->dk, 0, sizeof(ctx->dk));
        } else {
                ctx->decrypt = 1;
-               memcpy(ctx->dk, ctx->ek, sizeof(ctx->ek));
+               memcpy(ctx->dk, ctx->ek, sizeof(ctx->dk));
                rijndaelKeySetupDec(ctx->dk, key, bits, ctx->Nr);
        }
 }
index c0aa9ed30c284cfa4c93a09c3a47be242d9920b6..00999cb09debac04a57bf5ad73e14d856f68641a 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: scard.h,v 1.10 2002/03/25 17:34:27 markus Exp $       */
+/*     $OpenBSD: scard.h,v 1.11 2002/06/30 21:59:45 deraadt Exp $      */
 
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -33,8 +33,8 @@
 #define SCARD_ERROR_NOCARD     -2
 #define SCARD_ERROR_APPLET     -3
 
-Key    **sc_get_keys(const char*, const char*);
+Key    **sc_get_keys(const char *, const char *);
 void    sc_close(void);
-int     sc_put_key(Key *, const char*);
+int     sc_put_key(Key *, const char *);
 
 #endif
index f311ae48ddea4e5a69738ae82835db66043c2cb6..e3939df401450f718820b1bf583a16dd1ff7562b 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: servconf.c,v 1.112 2002/06/23 09:46:51 deraadt Exp $");
+RCSID("$OpenBSD: servconf.c,v 1.115 2002/09/04 18:52:42 stevesk Exp $");
 
 #if defined(KRB4)
 #include <krb.h>
@@ -101,6 +101,7 @@ initialize_server_options(ServerOptions *options)
        options->kbd_interactive_authentication = -1;
        options->challenge_response_authentication = -1;
        options->permit_empty_passwd = -1;
+       options->permit_user_env = -1;
        options->use_login = -1;
        options->compression = -1;
        options->allow_tcp_forwarding = -1;
@@ -158,7 +159,7 @@ fill_default_server_options(ServerOptions *options)
        if (options->server_key_bits == -1)
                options->server_key_bits = 768;
        if (options->login_grace_time == -1)
-               options->login_grace_time = 600;
+               options->login_grace_time = 120;
        if (options->key_regeneration_time == -1)
                options->key_regeneration_time = 3600;
        if (options->permit_root_login == PERMIT_NOT_SET)
@@ -223,6 +224,8 @@ fill_default_server_options(ServerOptions *options)
                options->challenge_response_authentication = 1;
        if (options->permit_empty_passwd == -1)
                options->permit_empty_passwd = 0;
+       if (options->permit_user_env == -1)
+               options->permit_user_env = 0;
        if (options->use_login == -1)
                options->use_login = 0;
        if (options->compression == -1)
@@ -257,7 +260,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");
@@ -291,7 +294,7 @@ typedef enum {
        sPrintMotd, sPrintLastLog, sIgnoreRhosts,
        sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost,
        sStrictModes, sEmptyPasswd, sKeepAlives,
-       sUseLogin, sAllowTcpForwarding, sCompression,
+       sPermitUserEnvironment, sUseLogin, sAllowTcpForwarding, sCompression,
        sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
        sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
        sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups,
@@ -354,6 +357,7 @@ static struct {
        { "xauthlocation", sXAuthLocation },
        { "strictmodes", sStrictModes },
        { "permitemptypasswords", sEmptyPasswd },
+       { "permituserenvironment", sPermitUserEnvironment },
        { "uselogin", sUseLogin },
        { "compression", sCompression },
        { "keepalive", sKeepAlives },
@@ -713,6 +717,10 @@ parse_flag:
                intptr = &options->permit_empty_passwd;
                goto parse_flag;
 
+       case sPermitUserEnvironment:
+               intptr = &options->permit_user_env;
+               goto parse_flag;
+
        case sUseLogin:
                intptr = &options->use_login;
                goto parse_flag;
index c94f541d0ccfe46fb00f2c28be1813e5c98a2aa4..024987dd6983cfd8a743115e9451f29a97d6cc9b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: servconf.h,v 1.58 2002/06/20 23:05:55 markus Exp $    */
+/*     $OpenBSD: servconf.h,v 1.59 2002/07/30 17:03:55 markus Exp $    */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -97,6 +97,7 @@ typedef struct {
        int     challenge_response_authentication;
        int     permit_empty_passwd;    /* If false, do not permit empty
                                         * passwords. */
+       int     permit_user_env;        /* If true, read ~/.ssh/environment */
        int     use_login;      /* If true, login(1) is used */
        int     compression;    /* If true, compression is allowed */
        int     allow_tcp_forwarding;
index 1349213554ddb1c9651faa626b3328003330d6a6..58e20dfb994e5242436cbd5eb90bde8ec34d1b59 100644 (file)
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: serverloop.c,v 1.103 2002/06/24 14:33:27 markus Exp $");
+RCSID("$OpenBSD: serverloop.c,v 1.104 2002/09/19 16:03:15 stevesk Exp $");
 
 #include "xmalloc.h"
 #include "packet.h"
 #include "buffer.h"
 #include "log.h"
 #include "servconf.h"
+#include "canohost.h"
 #include "sshpty.h"
 #include "channels.h"
 #include "compat.h"
@@ -143,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;
 }
@@ -347,14 +350,17 @@ process_input(fd_set * readset)
        if (FD_ISSET(connection_in, readset)) {
                len = read(connection_in, buf, sizeof(buf));
                if (len == 0) {
-                       verbose("Connection closed by remote host.");
+                       verbose("Connection closed by %.100s",
+                           get_remote_ipaddr());
                        connection_closed = 1;
                        if (compat20)
                                return;
                        fatal_cleanup();
                } else if (len < 0) {
                        if (errno != EINTR && errno != EAGAIN) {
-                               verbose("Read error from remote host: %.100s", strerror(errno));
+                               verbose("Read error from remote host "
+                                   "%.100s: %.100s",
+                                   get_remote_ipaddr(), strerror(errno));
                                fatal_cleanup();
                        }
                } else {
@@ -972,8 +978,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 {
index 747a00afae1b5996689d24d7f68898fd05255029..9074525a4108bff85314206f9d812a63229c80f0 100644 (file)
@@ -33,7 +33,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.142 2002/06/26 13:49:26 deraadt Exp $");
+RCSID("$OpenBSD: session.c,v 1.150 2002/09/16 19:55:33 stevesk Exp $");
 
 #include "ssh.h"
 #include "ssh1.h"
@@ -210,13 +210,6 @@ do_authenticated(Authctxt *authctxt)
                close(startup_pipe);
                startup_pipe = -1;
        }
-#ifdef WITH_AIXAUTHENTICATE
-       /* We don't have a pty yet, so just label the line as "ssh" */
-       if (loginsuccess(authctxt->user,
-           get_canonical_hostname(options.verify_reverse_mapping),
-           "ssh", &aixloginmsg) < 0)
-               aixloginmsg = NULL;
-#endif /* WITH_AIXAUTHENTICATE */
 
        /* setup the channel layer */
        if (!no_port_forwarding_flag && options.allow_tcp_forwarding)
@@ -470,6 +463,8 @@ do_exec_no_pty(Session *s, const char *command)
 
        /* Fork the child. */
        if ((pid = fork()) == 0) {
+               fatal_remove_all_cleanups();
+
                /* Child.  Reinitialize the log since the pid has changed. */
                log_init(__progname, options.log_level, options.log_facility, log_stderr);
 
@@ -517,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);
@@ -585,6 +587,7 @@ do_exec_pty(Session *s, const char *command)
 
        /* Fork the child. */
        if ((pid = fork()) == 0) {
+               fatal_remove_all_cleanups();
 
                /* Child.  Reinitialize the log because the pid has changed. */
                log_init(__progname, options.log_level, options.log_facility, log_stderr);
@@ -607,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);
@@ -619,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);
@@ -668,8 +678,8 @@ do_pre_login(Session *s)
         * the address be 0.0.0.0.
         */
        memset(&from, 0, sizeof(from));
+       fromlen = sizeof(from);
        if (packet_connection_is_on_socket()) {
-               fromlen = sizeof(from);
                if (getpeername(packet_get_connection_in(),
                    (struct sockaddr *) & from, &fromlen) < 0) {
                        debug("getpeername: %.100s", strerror(errno));
@@ -734,7 +744,7 @@ do_login(Session *s, const char *command)
                record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
                    get_remote_name_or_ip(utmp_len,
                    options.verify_reverse_mapping),
-                   (struct sockaddr *)&from);
+                   (struct sockaddr *)&from, fromlen);
 
 #ifdef USE_PAM
        /*
@@ -759,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'))
@@ -769,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();
 }
@@ -959,8 +971,10 @@ do_setup_env(Session *s, const char *shell)
                child_set_env(&env, &envsize, "LOGNAME", pw->pw_name);
                child_set_env(&env, &envsize, "HOME", pw->pw_dir);
 #ifdef HAVE_LOGIN_CAP
-               (void) setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH);
-               child_set_env(&env, &envsize, "PATH", getenv("PATH"));
+               if (setusercontext(lc, pw, pw->pw_uid, LOGIN_SETPATH) < 0)
+                       child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
+               else
+                       child_set_env(&env, &envsize, "PATH", getenv("PATH"));
 #else /* HAVE_LOGIN_CAP */
 # ifndef HAVE_CYGWIN
                /*
@@ -992,13 +1006,13 @@ do_setup_env(Session *s, const char *shell)
        if (!options.use_login) {
                while (custom_environment) {
                        struct envstring *ce = custom_environment;
-                       char *s = ce->s;
+                       char *str = ce->s;
 
-                       for (i = 0; s[i] != '=' && s[i]; i++)
+                       for (i = 0; str[i] != '=' && str[i]; i++)
                                ;
-                       if (s[i] == '=') {
-                               s[i] = 0;
-                               child_set_env(&env, &envsize, s, s + i + 1);
+                       if (str[i] == '=') {
+                               str[i] = 0;
+                               child_set_env(&env, &envsize, str, str + i + 1);
                        }
                        custom_environment = ce->next;
                        xfree(ce->s);
@@ -1006,10 +1020,16 @@ do_setup_env(Session *s, const char *shell)
                }
        }
 
+       /* SSH_CLIENT deprecated */
        snprintf(buf, sizeof buf, "%.50s %d %d",
            get_remote_ipaddr(), get_remote_port(), get_local_port());
        child_set_env(&env, &envsize, "SSH_CLIENT", buf);
 
+       snprintf(buf, sizeof buf, "%.50s %d %.50s %d",
+           get_remote_ipaddr(), get_remote_port(),
+           get_local_ipaddr(packet_get_connection_in()), get_local_port());
+       child_set_env(&env, &envsize, "SSH_CONNECTION", buf);
+
        if (s->ttyfd != -1)
                child_set_env(&env, &envsize, "SSH_TTY", s->tty);
        if (s->term)
@@ -1020,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;
@@ -1042,8 +1067,17 @@ do_setup_env(Session *s, const char *shell)
                    s->authctxt->krb5_ticket_file);
 #endif
 #ifdef USE_PAM
-       /* Pull in any environment variables that may have been set by PAM. */
-       copy_environment(fetch_pam_environment(), &env, &envsize);
+       /*
+        * Pull in any environment variables that may have
+        * been set by PAM.
+        */
+       {
+               char **p;
+
+               p = fetch_pam_environment();
+               copy_environment(p, &env, &envsize);
+               free_pam_environment(p);
+       }
 #endif /* USE_PAM */
 
        if (auth_sock_name != NULL)
@@ -1051,9 +1085,9 @@ do_setup_env(Session *s, const char *shell)
                    auth_sock_name);
 
        /* read $HOME/.ssh/environment. */
-       if (!options.use_login) {
+       if (options.permit_user_env && !options.use_login) {
                snprintf(buf, sizeof buf, "%.200s/.ssh/environment",
-                   pw->pw_dir);
+                   strcmp(pw->pw_dir, "/") ? pw->pw_dir : "");
                read_environment_file(&env, &envsize, buf);
        }
        if (debug_flag) {
@@ -1148,6 +1182,8 @@ do_nologin(struct passwd *pw)
 #endif
        if (f) {
                /* /etc/nologin exists.  Print its contents and exit. */
+               log("User %.100s not allowed because %s exists",
+                   pw->pw_name, _PATH_NOLOGIN);
                while (fgets(buf, sizeof(buf), f))
                        fputs(buf, stderr);
                fclose(f);
@@ -1159,8 +1195,6 @@ do_nologin(struct passwd *pw)
 void
 do_setusercontext(struct passwd *pw)
 {
-       char tty='\0';
-
 #ifdef HAVE_CYGWIN
        if (is_winnt) {
 #else /* HAVE_CYGWIN */
@@ -1170,9 +1204,9 @@ do_setusercontext(struct passwd *pw)
                setpcred(pw->pw_name);
 #endif /* HAVE_SETPCRED */
 #ifdef HAVE_LOGIN_CAP
-#ifdef __bsdi__
+# ifdef __bsdi__
                setpgid(0, 0);
-#endif
+# endif
                if (setusercontext(lc, pw, pw->pw_uid,
                    (LOGIN_SETALL & ~LOGIN_SETPATH)) < 0) {
                        perror("unable to set user context");
@@ -1209,8 +1243,7 @@ do_setusercontext(struct passwd *pw)
                irix_setusercontext(pw);
 #  endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
 # ifdef _AIX
-               /* XXX: Disable tty setting.  Enabled if required later */
-               aix_usrinfo(pw, &tty, -1);
+               aix_usrinfo(pw);
 # endif /* _AIX */
                /* Permanently switch to the desired uid. */
                permanently_set_uid(pw);
@@ -1263,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.
@@ -1798,6 +1835,27 @@ session_pty_cleanup(void *session)
        PRIVSEP(session_pty_cleanup2(session));
 }
 
+static char *
+sig2name(int sig)
+{
+#define SSH_SIG(x) if (sig == SIG ## x) return #x
+       SSH_SIG(ABRT);
+       SSH_SIG(ALRM);
+       SSH_SIG(FPE);
+       SSH_SIG(HUP);
+       SSH_SIG(ILL);
+       SSH_SIG(INT);
+       SSH_SIG(KILL);
+       SSH_SIG(PIPE);
+       SSH_SIG(QUIT);
+       SSH_SIG(SEGV);
+       SSH_SIG(TERM);
+       SSH_SIG(USR1);
+       SSH_SIG(USR2);
+#undef SSH_SIG
+       return "SIG@openssh.com";
+}
+
 static void
 session_exit_message(Session *s, int status)
 {
@@ -1815,7 +1873,7 @@ session_exit_message(Session *s, int status)
                packet_send();
        } else if (WIFSIGNALED(status)) {
                channel_request_start(s->chanid, "exit-signal", 0);
-               packet_put_int(WTERMSIG(status));
+               packet_put_cstring(sig2name(WTERMSIG(status)));
 #ifdef WCOREDUMP
                packet_put_char(WCOREDUMP(status));
 #else /* WCOREDUMP */
index 3bce97891fdfc3dd46e202b93f7e7e0ca0c46fdd..d3ddfab75f98644b7724986b02c26e193674dca3 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: session.h,v 1.18 2002/06/23 21:06:41 deraadt Exp $    */
+/*     $OpenBSD: session.h,v 1.19 2002/06/30 21:59:45 deraadt Exp $    */
 
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
@@ -57,7 +57,7 @@ struct Session {
 
 void    do_authenticated(Authctxt *);
 
-int     session_open(Authctxt*, int);
+int     session_open(Authctxt *, int);
 int     session_input_channel_req(Channel *, const char *);
 void    session_close_by_pid(pid_t, int);
 void    session_close_by_channel(int, void *);
index 10b7992d0939b5d4fc8fa8e2b893c6c2479bf1fc..f6a73f37940b8dabfac4b66348f9e45b9350f1da 100644 (file)
@@ -28,9 +28,9 @@
 /* XXX: copy between two remote sites */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.33 2002/06/23 09:30:14 deraadt Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.35 2002/09/11 22:41:49 djm Exp $");
 
-#include "openbsd-compat/fake-queue.h"
+#include "openbsd-compat/sys-queue.h"
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -414,12 +414,6 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
        return(0);
 }
 
-int
-do_ls(struct sftp_conn *conn, char *path)
-{
-       return(do_lsreaddir(conn, path, 1, NULL));
-}
-
 int
 do_readdir(struct sftp_conn *conn, char *path, SFTP_DIRENT ***dir)
 {
@@ -1095,7 +1089,7 @@ do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
                        debug3("In write loop, ack for %u %u bytes at %llu",
                           ack->id, ack->len, (unsigned long long)ack->offset);
                        ++ackid;
-                       free(ack);
+                       xfree(ack);
                }
                offset += len;
        }
index b0617116816bcba7c70fc1f385e3d94d2744443a..98e08ffa70d5189e6aebb9b2dd8618ae121ad271 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.h,v 1.10 2002/06/23 09:30:14 deraadt Exp $ */
+/* $OpenBSD: sftp-client.h,v 1.11 2002/09/11 22:41:50 djm Exp $ */
 
 /*
  * Copyright (c) 2001,2002 Damien Miller.  All rights reserved.
@@ -48,9 +48,6 @@ u_int sftp_proto_version(struct sftp_conn *);
 /* Close file referred to by 'handle' */
 int do_close(struct sftp_conn *, char *, u_int);
 
-/* List contents of directory 'path' to stdout */
-int do_ls(struct sftp_conn *, char *);
-
 /* Read contents of 'path' to NULL-terminated array 'dir' */
 int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***);
 
index 6bed0ab8a06d1f26c6af458df4e9a3b9885e3a7f..082345486b49c3432d473de687113ef23c823e26 100644 (file)
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-common.c,v 1.6 2002/06/23 09:30:14 deraadt Exp $");
+RCSID("$OpenBSD: sftp-common.c,v 1.7 2002/09/11 22:41:50 djm Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -65,6 +65,26 @@ stat_to_attrib(struct stat *st, Attrib *a)
        a->mtime = st->st_mtime;
 }
 
+/* Convert from filexfer attribs to struct stat */
+void
+attrib_to_stat(Attrib *a, struct stat *st)
+{
+       memset(st, 0, sizeof(*st));
+
+       if (a->flags & SSH2_FILEXFER_ATTR_SIZE)
+               st->st_size = a->size;
+       if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
+               st->st_uid = a->uid;
+               st->st_gid = a->gid;
+       }
+       if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS)
+               st->st_mode = a->perm;
+       if (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME) {
+               st->st_atime = a->atime;
+               st->st_mtime = a->mtime;
+       }
+}
+
 /* Decode attributes in buffer */
 Attrib *
 decode_attrib(Buffer *b)
@@ -149,3 +169,45 @@ fx2txt(int status)
        }
        /* NOTREACHED */
 }
+
+/*
+ * drwxr-xr-x    5 markus   markus       1024 Jan 13 18:39 .ssh
+ */
+char *
+ls_file(char *name, struct stat *st, int remote)
+{
+       int ulen, glen, sz = 0;
+       struct passwd *pw;
+       struct group *gr;
+       struct tm *ltime = localtime(&st->st_mtime);
+       char *user, *group;
+       char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1];
+
+       strmode(st->st_mode, mode);
+       if (!remote && (pw = getpwuid(st->st_uid)) != NULL) {
+               user = pw->pw_name;
+       } else {
+               snprintf(ubuf, sizeof ubuf, "%u", (u_int)st->st_uid);
+               user = ubuf;
+       }
+       if (!remote && (gr = getgrgid(st->st_gid)) != NULL) {
+               group = gr->gr_name;
+       } else {
+               snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid);
+               group = gbuf;
+       }
+       if (ltime != NULL) {
+               if (time(NULL) - st->st_mtime < (365*24*60*60)/2)
+                       sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime);
+               else
+                       sz = strftime(tbuf, sizeof tbuf, "%b %e  %Y", ltime);
+       }
+       if (sz == 0)
+               tbuf[0] = '\0';
+       ulen = MAX(strlen(user), 8);
+       glen = MAX(strlen(group), 8);
+       snprintf(buf, sizeof buf, "%s %3d %-*s %-*s %8llu %s %s", mode,
+           st->st_nlink, ulen, user, glen, group,
+           (u_int64_t)st->st_size, tbuf, name);
+       return xstrdup(buf);
+}
index 4c126bf1065d45b5225ce5512465c8c97b545517..201611cc4bcbf8052e96332b701d531c3caa806b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sftp-common.h,v 1.3 2001/06/26 17:27:24 markus Exp $  */
+/*     $OpenBSD: sftp-common.h,v 1.4 2002/09/11 22:41:50 djm Exp $     */
 
 /*
  * Copyright (c) 2001 Markus Friedl.  All rights reserved.
@@ -40,7 +40,9 @@ struct Attrib {
 
 void    attrib_clear(Attrib *);
 void    stat_to_attrib(struct stat *, Attrib *);
+void    attrib_to_stat(Attrib *, struct stat *);
 Attrib *decode_attrib(Buffer *);
 void    encode_attrib(Buffer *, Attrib *);
+char   *ls_file(char *, struct stat *, int);
 
 const char *fx2txt(int);
index 1234074c45ccc0d3f076cb0f5452517a2eef8d63..ee122a2cd586f98cace72156ba42843edff92307 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-glob.c,v 1.10 2002/02/13 00:59:23 djm Exp $");
+RCSID("$OpenBSD: sftp-glob.c,v 1.13 2002/09/11 22:41:50 djm Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -51,12 +51,14 @@ fudge_opendir(const char *path)
 
        r = xmalloc(sizeof(*r));
 
-       if (do_readdir(cur.conn, (char*)path, &r->dir))
+       if (do_readdir(cur.conn, (char *)path, &r->dir)) {
+               xfree(r);
                return(NULL);
+       }
 
        r->offset = 0;
 
-       return((void*)r);
+       return((void *)r);
 }
 
 static struct dirent *
@@ -105,31 +107,12 @@ fudge_closedir(struct SFTP_OPENDIR *od)
        xfree(od);
 }
 
-static void
-attrib_to_stat(Attrib *a, struct stat *st)
-{
-       memset(st, 0, sizeof(*st));
-
-       if (a->flags & SSH2_FILEXFER_ATTR_SIZE)
-               st->st_size = a->size;
-       if (a->flags & SSH2_FILEXFER_ATTR_UIDGID) {
-               st->st_uid = a->uid;
-               st->st_gid = a->gid;
-       }
-       if (a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS)
-               st->st_mode = a->perm;
-       if (a->flags & SSH2_FILEXFER_ATTR_ACMODTIME) {
-               st->st_atime = a->atime;
-               st->st_mtime = a->mtime;
-       }
-}
-
 static int
 fudge_lstat(const char *path, struct stat *st)
 {
        Attrib *a;
 
-       if (!(a = do_lstat(cur.conn, (char*)path, 0)))
+       if (!(a = do_lstat(cur.conn, (char *)path, 0)))
                return(-1);
 
        attrib_to_stat(a, st);
@@ -142,7 +125,7 @@ fudge_stat(const char *path, struct stat *st)
 {
        Attrib *a;
 
-       if (!(a = do_stat(cur.conn, (char*)path, 0)))
+       if (!(a = do_stat(cur.conn, (char *)path, 0)))
                return(-1);
 
        attrib_to_stat(a, st);
index 9c754912c224f3942d28319d28bc3a145e9c9a93..f879e8719b4b2eb5b8fb5ef6b611e81398039dc0 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-glob.h,v 1.7 2002/03/19 10:49:35 markus Exp $ */
+/* $OpenBSD: sftp-glob.h,v 1.8 2002/09/11 22:41:50 djm Exp $ */
 
 /*
  * Copyright (c) 2001,2002 Damien Miller.  All rights reserved.
@@ -31,8 +31,7 @@
 
 #include "sftp-client.h"
 
-int
-remote_glob(struct sftp_conn *, const char *, int,
+int remote_glob(struct sftp_conn *, const char *, int,
     int (*)(const char *, int), glob_t *);
 
 #endif
index b13e5da5d5b3e1b194faaa94ce927fa392a4df0e..6a2012910d4adade3290fbcb973a7c869f308a9d 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-/* XXX: globbed ls */
 /* XXX: recursive operations */
 
 #include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.47 2002/06/23 09:30:14 deraadt Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.49 2002/09/12 00:13:06 djm Exp $");
 
 #include "buffer.h"
 #include "xmalloc.h"
@@ -201,6 +200,25 @@ local_do_ls(const char *args)
        }
 }
 
+/* Strip one path (usually the pwd) from the start of another */
+static char *
+path_strip(char *path, char *strip)
+{
+       size_t len;
+
+       if (strip == NULL)
+               return (xstrdup(path));
+
+       len = strlen(strip);
+       if (strip != NULL && strncmp(path, strip, len) == 0) {
+               if (strip[len - 1] != '/' && path[len] == '/')
+                       len++;
+               return (xstrdup(path + len));
+       }
+
+       return (xstrdup(path));
+}
+
 static char *
 path_append(char *p1, char *p2)
 {
@@ -209,7 +227,7 @@ path_append(char *p1, char *p2)
 
        ret = xmalloc(len);
        strlcpy(ret, p1, len);
-       if (strcmp(p1, "/") != 0)
+       if (p1[strlen(p1) - 1] != '/')
                strlcat(ret, "/", len);
        strlcat(ret, p2, len);
 
@@ -273,6 +291,29 @@ parse_getput_flags(const char **cpp, int *pflag)
        return(0);
 }
 
+static int
+parse_ls_flags(const char **cpp, int *lflag)
+{
+       const char *cp = *cpp;
+
+       /* Check for flags */
+       if (cp++[0] == '-') {
+               for(; strchr(WHITESPACE, *cp) == NULL; cp++) {
+                       switch (*cp) {
+                       case 'l':
+                               *lflag = 1;
+                               break;
+                       default:
+                               error("Invalid flag -%c", *cp);
+                               return(-1);
+                       }
+               }
+               *cpp = cp + strspn(cp, WHITESPACE);
+       }
+
+       return(0);
+}
+
 static int
 get_pathname(const char **cpp, char **path)
 {
@@ -504,8 +545,129 @@ out:
 }
 
 static int
-parse_args(const char **cpp, int *pflag, unsigned long *n_arg,
-    char **path1, char **path2)
+sdirent_comp(const void *aa, const void *bb)
+{
+       SFTP_DIRENT *a = *(SFTP_DIRENT **)aa;
+       SFTP_DIRENT *b = *(SFTP_DIRENT **)bb;
+
+       return (strcmp(a->filename, b->filename));      
+}
+
+/* sftp ls.1 replacement for directories */
+static int
+do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
+{
+       int n;
+       SFTP_DIRENT **d;
+
+       if ((n = do_readdir(conn, path, &d)) != 0)
+               return (n);
+
+       /* Count entries for sort */    
+       for (n = 0; d[n] != NULL; n++)
+               ;
+
+       qsort(d, n, sizeof(*d), sdirent_comp);
+
+       for (n = 0; d[n] != NULL; n++) {
+               char *tmp, *fname;
+               
+               tmp = path_append(path, d[n]->filename);
+               fname = path_strip(tmp, strip_path);
+               xfree(tmp);
+
+               if (lflag) {
+                       char *lname;
+                       struct stat sb;
+
+                       memset(&sb, 0, sizeof(sb));
+                       attrib_to_stat(&d[n]->a, &sb);
+                       lname = ls_file(fname, &sb, 1);
+                       printf("%s\n", lname);
+                       xfree(lname);
+               } else {
+                       /* XXX - multicolumn display would be nice here */
+                       printf("%s\n", fname);
+               }
+               
+               xfree(fname);
+       }
+
+       free_sftp_dirents(d);
+       return (0);
+}
+
+/* sftp ls.1 replacement which handles path globs */
+static int
+do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path, 
+    int lflag)
+{
+       glob_t g;
+       int i;
+       Attrib *a;
+       struct stat sb;
+
+       memset(&g, 0, sizeof(g));
+
+       if (remote_glob(conn, path, GLOB_MARK|GLOB_NOCHECK|GLOB_BRACE, 
+           NULL, &g)) {
+               error("Can't ls: \"%s\" not found", path);
+               return (-1);
+       }
+
+       /*
+        * If the glob returns a single match, which is the same as the 
+        * input glob, and it is a directory, then just list its contents
+        */
+       if (g.gl_pathc == 1 && 
+           strncmp(path, g.gl_pathv[0], strlen(g.gl_pathv[0]) - 1) == 0) {
+               if ((a = do_lstat(conn, path, 1)) == NULL) {
+                       globfree(&g);
+                       return (-1);
+               }
+               if ((a->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) && 
+                   S_ISDIR(a->perm)) {
+                       globfree(&g);
+                       return (do_ls_dir(conn, path, strip_path, lflag));
+               }
+       }
+
+       for (i = 0; g.gl_pathv[i]; i++) {
+               char *fname, *lname;
+
+               fname = path_strip(g.gl_pathv[i], strip_path);
+
+               if (lflag) {
+                       /*
+                        * XXX: this is slow - 1 roundtrip per path
+                        * A solution to this is to fork glob() and 
+                        * build a sftp specific version which keeps the 
+                        * attribs (which currently get thrown away)
+                        * that the server returns as well as the filenames.
+                        */
+                       memset(&sb, 0, sizeof(sb));
+                       a = do_lstat(conn, g.gl_pathv[i], 1);
+                       if (a != NULL)
+                               attrib_to_stat(a, &sb);
+                       lname = ls_file(fname, &sb, 1);
+                       printf("%s\n", lname);
+                       xfree(lname);
+               } else {
+                       /* XXX - multicolumn display would be nice here */
+                       printf("%s\n", fname);
+               }
+               xfree(fname);
+       }
+
+       if (g.gl_pathc)
+               globfree(&g);
+
+       return (0);
+}
+
+static int
+parse_args(const char **cpp, int *pflag, int *lflag, 
+    unsigned long *n_arg, char **path1, char **path2)
 {
        const char *cmd, *cp = *cpp;
        char *cp2;
@@ -545,7 +707,7 @@ parse_args(const char **cpp, int *pflag, unsigned long *n_arg,
        }
 
        /* Get arguments and parse flags */
-       *pflag = *n_arg = 0;
+       *lflag = *pflag = *n_arg = 0;
        *path1 = *path2 = NULL;
        switch (cmdnum) {
        case I_GET:
@@ -592,6 +754,8 @@ parse_args(const char **cpp, int *pflag, unsigned long *n_arg,
                }
                break;
        case I_LS:
+               if (parse_ls_flags(&cp, lflag))
+                       return(-1);
                /* Path is optional */
                if (get_pathname(&cp, path1))
                        return(-1);
@@ -652,7 +816,7 @@ static int
 parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd)
 {
        char *path1, *path2, *tmp;
-       int pflag, cmdnum, i;
+       int pflag, lflag, cmdnum, i;
        unsigned long n_arg;
        Attrib a, *aa;
        char path_buf[MAXPATHLEN];
@@ -660,7 +824,8 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd)
        glob_t g;
 
        path1 = path2 = NULL;
-       cmdnum = parse_args(&cmd, &pflag, &n_arg, &path1, &path2);
+       cmdnum = parse_args(&cmd, &pflag, &lflag, &n_arg,
+           &path1, &path2);
 
        memset(&g, 0, sizeof(g));
 
@@ -732,22 +897,18 @@ parse_dispatch_command(struct sftp_conn *conn, const char *cmd, char **pwd)
                break;
        case I_LS:
                if (!path1) {
-                       do_ls(conn, *pwd);
+                       do_globbed_ls(conn, *pwd, *pwd, lflag);
                        break;
                }
+               
+               /* Strip pwd off beginning of non-absolute paths */
+               tmp = NULL;
+               if (*path1 != '/')
+                       tmp = *pwd;
+
                path1 = make_absolute(path1, *pwd);
-               if ((tmp = do_realpath(conn, path1)) == NULL)
-                       break;
-               xfree(path1);
-               path1 = tmp;
-               if ((aa = do_stat(conn, path1, 0)) == NULL)
-                       break;
-               if ((aa->flags & SSH2_FILEXFER_ATTR_PERMISSIONS) &&
-                   !S_ISDIR(aa->perm)) {
-                       error("Can't ls: \"%s\" is not a directory", path1);
-                       break;
-               }
-               do_ls(conn, path1);
+
+               do_globbed_ls(conn, path1, tmp, lflag);
                break;
        case I_LCHDIR:
                if (chdir(path1) == -1) {
index a5c325561efb2fe5625b4603c802caf61493793d..84264693d73aeab364eedf8d0a0232e058f77334 100644 (file)
@@ -22,7 +22,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: sftp-server.c,v 1.37 2002/06/24 17:57:20 deraadt Exp $");
+RCSID("$OpenBSD: sftp-server.c,v 1.38 2002/09/11 22:41:50 djm Exp $");
 
 #include "buffer.h"
 #include "bufaux.h"
@@ -695,48 +695,6 @@ process_opendir(void)
        xfree(path);
 }
 
-/*
- * drwxr-xr-x    5 markus   markus       1024 Jan 13 18:39 .ssh
- */
-static char *
-ls_file(char *name, struct stat *st)
-{
-       int ulen, glen, sz = 0;
-       struct passwd *pw;
-       struct group *gr;
-       struct tm *ltime = localtime(&st->st_mtime);
-       char *user, *group;
-       char buf[1024], mode[11+1], tbuf[12+1], ubuf[11+1], gbuf[11+1];
-
-       strmode(st->st_mode, mode);
-       if ((pw = getpwuid(st->st_uid)) != NULL) {
-               user = pw->pw_name;
-       } else {
-               snprintf(ubuf, sizeof ubuf, "%u", (u_int)st->st_uid);
-               user = ubuf;
-       }
-       if ((gr = getgrgid(st->st_gid)) != NULL) {
-               group = gr->gr_name;
-       } else {
-               snprintf(gbuf, sizeof gbuf, "%u", (u_int)st->st_gid);
-               group = gbuf;
-       }
-       if (ltime != NULL) {
-               if (time(NULL) - st->st_mtime < (365*24*60*60)/2)
-                       sz = strftime(tbuf, sizeof tbuf, "%b %e %H:%M", ltime);
-               else
-                       sz = strftime(tbuf, sizeof tbuf, "%b %e  %Y", ltime);
-       }
-       if (sz == 0)
-               tbuf[0] = '\0';
-       ulen = MAX(strlen(user), 8);
-       glen = MAX(strlen(group), 8);
-       snprintf(buf, sizeof buf, "%s %3d %-*s %-*s %8llu %s %s", mode,
-           st->st_nlink, ulen, user, glen, group,
-           (u_int64_t)st->st_size, tbuf, name);
-       return xstrdup(buf);
-}
-
 static void
 process_readdir(void)
 {
@@ -772,7 +730,7 @@ process_readdir(void)
                                continue;
                        stat_to_attrib(&st, &(stats[count].attrib));
                        stats[count].name = xstrdup(dp->d_name);
-                       stats[count].long_name = ls_file(dp->d_name, &st);
+                       stats[count].long_name = ls_file(dp->d_name, &st, 0);
                        count++;
                        /* send up to 100 entries in one message */
                        /* XXX check packet size instead */
index 0e6d741a9cab82bbbbd6b0f13dee9f2d1d8b1313..33ceb65964044e2a162df907f504d2414a9ddf61 100644 (file)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sftp.1,v 1.35 2002/06/20 20:00:05 stevesk Exp $
+.\" $OpenBSD: sftp.1,v 1.36 2002/09/11 22:41:50 djm Exp $
 .\"
 .\" Copyright (c) 2001 Damien Miller.  All rights reserved.
 .\"
@@ -203,12 +203,18 @@ to
 .Ar newpath .
 .It Ic lpwd
 Print local working directory.
-.It Ic ls Op Ar path
+.It Xo Ic ls
+.Op Ar flags
+.Op Ar path
+.Xc
 Display remote directory listing of either
 .Ar path
 or current directory if
 .Ar path
-is not specified.
+is not specified. If the
+.Fl l
+flag is specified, then display additional details including permissions
+and ownership information.
 .It Ic lumask Ar umask
 Set local umask to
 .Ar umask .
index fac2564ded5d0244ee0f78242477abad100cbd11..c4055b91ee47f7c2d5f19756354f4240f212d3d0 100644 (file)
@@ -24,7 +24,7 @@
 
 #include "includes.h"
 
-RCSID("$OpenBSD: sftp.c,v 1.30 2002/06/23 09:30:14 deraadt Exp $");
+RCSID("$OpenBSD: sftp.c,v 1.31 2002/07/25 01:16:59 mouring Exp $");
 
 /* XXX: short-form remote directory listings (like 'ls -C') */
 
@@ -122,7 +122,6 @@ main(int argc, char **argv)
        __progname = get_progname(argv[0]);
        args.list = NULL;
        addargs(&args, "ssh");          /* overwritten with ssh_program */
-       addargs(&args, "-oFallBackToRsh no");
        addargs(&args, "-oForwardX11 no");
        addargs(&args, "-oForwardAgent no");
        addargs(&args, "-oClearAllForwardings yes");
index 176fd85c8e89dc6e7b8bf9832377390223b429eb..9c729752a6d2b3acaae9d3669e7d807355fc3941 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-add.c,v 1.61 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: ssh-add.c,v 1.63 2002/09/19 15:51:23 markus Exp $");
 
 #include <openssl/evp.h>
 
@@ -264,7 +264,7 @@ lock_agent(AuthenticationConnection *ac, int lock)
                fprintf(stderr, "Failed to %slock agent.\n", lock ? "" : "un");
        memset(p1, 0, strlen(p1));
        xfree(p1);
-       return -1;
+       return (ret);
 }
 
 static int
@@ -290,7 +290,7 @@ usage(void)
        fprintf(stderr, "  -d          Delete identity.\n");
        fprintf(stderr, "  -D          Delete all identities.\n");
        fprintf(stderr, "  -x          Lock agent.\n");
-       fprintf(stderr, "  -x          Unlock agent.\n");
+       fprintf(stderr, "  -X          Unlock agent.\n");
        fprintf(stderr, "  -t life     Set lifetime (in seconds) when adding identities.\n");
 #ifdef SMARTCARD
        fprintf(stderr, "  -s reader   Add key in smartcard reader.\n");
index ac16bae40aa59307d76a0a0b4600fb6f6d02c19f..cca720ee2717a03606a7884cf2c33d16fab7472a 100644 (file)
@@ -34,8 +34,8 @@
  */
 
 #include "includes.h"
-#include "openbsd-compat/fake-queue.h"
-RCSID("$OpenBSD: ssh-agent.c,v 1.97 2002/06/24 14:55:38 markus Exp $");
+#include "openbsd-compat/sys-queue.h"
+RCSID("$OpenBSD: ssh-agent.c,v 1.105 2002/10/01 20:34:12 markus Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/md5.h>
@@ -106,6 +106,17 @@ extern char *__progname;
 char *__progname;
 #endif
 
+static void
+close_socket(SocketEntry *e)
+{
+       close(e->fd);
+       e->fd = -1;
+       e->type = AUTH_UNUSED;
+       buffer_free(&e->input);
+       buffer_free(&e->output);
+       buffer_free(&e->request);
+}
+
 static void
 idtab_init(void)
 {
@@ -617,13 +628,7 @@ process_message(SocketEntry *e)
        cp = buffer_ptr(&e->input);
        msg_len = GET_32BIT(cp);
        if (msg_len > 256 * 1024) {
-               shutdown(e->fd, SHUT_RDWR);
-               close(e->fd);
-               e->fd = -1;
-               e->type = AUTH_UNUSED;
-               buffer_free(&e->input);
-               buffer_free(&e->output);
-               buffer_free(&e->request);
+               close_socket(e);
                return;
        }
        if (buffer_len(&e->input) < msg_len + 4)
@@ -805,6 +810,8 @@ after_select(fd_set *readset, fd_set *writeset)
        char buf[1024];
        int len, sock;
        u_int i;
+       uid_t euid;
+       gid_t egid;
 
        for (i = 0; i < sockets_alloc; i++)
                switch (sockets[i].type) {
@@ -820,6 +827,19 @@ after_select(fd_set *readset, fd_set *writeset)
                                            strerror(errno));
                                        break;
                                }
+                               if (getpeereid(sock, &euid, &egid) < 0) {
+                                       error("getpeereid %d failed: %s",
+                                           sock, strerror(errno));
+                                       close(sock);
+                                       break;
+                               }
+                               if ((euid != 0) && (getuid() != euid)) {
+                                       error("uid mismatch: "
+                                           "peer euid %u != uid %u",
+                                           (u_int) euid, (u_int) getuid());
+                                       close(sock);
+                                       break;
+                               }
                                new_socket(AUTH_CONNECTION, sock);
                        }
                        break;
@@ -836,13 +856,7 @@ after_select(fd_set *readset, fd_set *writeset)
                                        break;
                                } while (1);
                                if (len <= 0) {
-                                       shutdown(sockets[i].fd, SHUT_RDWR);
-                                       close(sockets[i].fd);
-                                       sockets[i].fd = -1;
-                                       sockets[i].type = AUTH_UNUSED;
-                                       buffer_free(&sockets[i].input);
-                                       buffer_free(&sockets[i].output);
-                                       buffer_free(&sockets[i].request);
+                                       close_socket(&sockets[i]);
                                        break;
                                }
                                buffer_consume(&sockets[i].output, len);
@@ -856,13 +870,7 @@ after_select(fd_set *readset, fd_set *writeset)
                                        break;
                                } while (1);
                                if (len <= 0) {
-                                       shutdown(sockets[i].fd, SHUT_RDWR);
-                                       close(sockets[i].fd);
-                                       sockets[i].fd = -1;
-                                       sockets[i].type = AUTH_UNUSED;
-                                       buffer_free(&sockets[i].input);
-                                       buffer_free(&sockets[i].output);
-                                       buffer_free(&sockets[i].request);
+                                       close_socket(&sockets[i]);
                                        break;
                                }
                                buffer_append(&sockets[i].input, buf, len);
@@ -943,6 +951,10 @@ main(int ac, char **av)
        pid_t pid;
        char pidstrbuf[1 + 3 * sizeof pid];
 
+       /* drop */
+       setegid(getgid());
+       setgid(getgid());
+
        SSLeay_add_all_algorithms();
 
        __progname = get_progname(av[0]);
@@ -1052,7 +1064,7 @@ main(int ac, char **av)
 #ifdef HAVE_CYGWIN
        umask(prev_mask);
 #endif
-       if (listen(sock, 5) < 0) {
+       if (listen(sock, 128) < 0) {
                perror("listen");
                cleanup_exit(1);
        }
index dbf8465bae54612d6160c2f7e7fff0f06f4b0d01..9ba2584ddb16a2a9827280413503beaa74c6b05f 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-dss.c,v 1.15 2002/06/23 03:30:17 deraadt Exp $");
+RCSID("$OpenBSD: ssh-dss.c,v 1.17 2002/07/04 10:41:47 markus Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/evp.h>
@@ -46,7 +46,7 @@ ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
        DSA_SIG *sig;
        const EVP_MD *evp_md = EVP_sha1();
        EVP_MD_CTX md;
-       u_char *ret, digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN];
+       u_char digest[EVP_MAX_MD_SIZE], sigblob[SIGBLOB_LEN];
        u_int rlen, slen, len, dlen;
        Buffer b;
 
@@ -79,25 +79,25 @@ ssh_dss_sign(Key *key, u_char **sigp, u_int *lenp,
        DSA_SIG_free(sig);
 
        if (datafellows & SSH_BUG_SIGBLOB) {
-               ret = xmalloc(SIGBLOB_LEN);
-               memcpy(ret, sigblob, SIGBLOB_LEN);
                if (lenp != NULL)
                        *lenp = SIGBLOB_LEN;
-               if (sigp != NULL)
-                       *sigp = ret;
+               if (sigp != NULL) {
+                       *sigp = xmalloc(SIGBLOB_LEN);
+                       memcpy(*sigp, sigblob, SIGBLOB_LEN);
+               }
        } else {
                /* ietf-drafts */
                buffer_init(&b);
                buffer_put_cstring(&b, "ssh-dss");
                buffer_put_string(&b, sigblob, SIGBLOB_LEN);
                len = buffer_len(&b);
-               ret = xmalloc(len);
-               memcpy(ret, buffer_ptr(&b), len);
-               buffer_free(&b);
                if (lenp != NULL)
                        *lenp = len;
-               if (sigp != NULL)
-                       *sigp = ret;
+               if (sigp != NULL) {
+                       *sigp = xmalloc(len);
+                       memcpy(*sigp, buffer_ptr(&b), len);
+               }
+               buffer_free(&b);
        }
        return 0;
 }
index 4273c11321c8830820cd51936733b4653830ae10..3478e372376e26f2bcc92bf1de105f4d7db8bff5 100644 (file)
@@ -761,6 +761,8 @@ main(int ac, char **av)
        __progname = get_progname(av[0]);
 
        SSLeay_add_all_algorithms();
+       init_rng();
+       seed_rng();
 
        /* we need this for the home * directory.  */
        pw = getpwuid(getuid());
@@ -855,10 +857,12 @@ main(int ac, char **av)
                do_fingerprint(pw);
        if (change_passphrase)
                do_change_passphrase(pw);
-       if (convert_to_ssh2)
-               do_convert_to_ssh2(pw);
        if (change_comment)
                do_change_comment(pw);
+       if (convert_to_ssh2)
+               do_convert_to_ssh2(pw);
+       if (convert_from_ssh2)
+               do_convert_from_ssh2(pw);
        if (print_public)
                do_print_public(pw);
        if (reader_id != NULL) {
@@ -872,13 +876,8 @@ main(int ac, char **av)
 #endif /* SMARTCARD */
        }
 
-       init_rng();
-       seed_rng();
        arc4random_stir();
 
-       if (convert_from_ssh2)
-               do_convert_from_ssh2(pw);
-
        if (key_type_name == NULL) {
                printf("You must specify a key type (-t).\n");
                usage();
index 333a38e34fc4087ea10e666aa11e55cc8d237b23..8c14d6d2651cd13be7c2c9c8bd3171a90d7e4b39 100644 (file)
@@ -7,9 +7,9 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keyscan.c,v 1.36 2002/06/16 21:30:58 itojun Exp $");
+RCSID("$OpenBSD: ssh-keyscan.c,v 1.40 2002/07/06 17:47:58 stevesk Exp $");
 
-#include "openbsd-compat/fake-queue.h"
+#include "openbsd-compat/sys-queue.h"
 
 #include <openssl/bn.h>
 
@@ -116,7 +116,8 @@ Linebuf_alloc(const char *filename, void (*errfun) (const char *,...))
 
        if (!(lb = malloc(sizeof(*lb)))) {
                if (errfun)
-                       (*errfun) ("linebuf (%s): malloc failed\n", lb->filename);
+                       (*errfun) ("linebuf (%s): malloc failed\n",
+                           filename ? filename : "(stdin)");
                return (NULL);
        }
        if (filename) {
@@ -171,13 +172,14 @@ static char *
 Linebuf_getline(Linebuf * lb)
 {
        int n = 0;
+       void *p;
 
        lb->lineno++;
        for (;;) {
                /* Read a line */
                if (!fgets(&lb->buf[n], lb->size - n, lb->stream)) {
                        if (ferror(lb->stream) && lb->errfun)
-                               (*lb->errfun) ("%s: %s\n", lb->filename,
+                               (*lb->errfun)("%s: %s\n", lb->filename,
                                    strerror(errno));
                        return (NULL);
                }
@@ -190,17 +192,20 @@ Linebuf_getline(Linebuf * lb)
                }
                if (n != lb->size - 1) {
                        if (lb->errfun)
-                               (*lb->errfun) ("%s: skipping incomplete last line\n",
+                               (*lb->errfun)("%s: skipping incomplete last line\n",
                                    lb->filename);
                        return (NULL);
                }
                /* Double the buffer if we need more space */
-               if (!(lb->buf = realloc(lb->buf, (lb->size *= 2)))) {
+               lb->size *= 2;
+               if ((p = realloc(lb->buf, lb->size)) == NULL) {
+                       lb->size /= 2;
                        if (lb->errfun)
-                               (*lb->errfun) ("linebuf (%s): realloc failed\n",
+                               (*lb->errfun)("linebuf (%s): realloc failed\n",
                                    lb->filename);
                        return (NULL);
                }
+               lb->buf = p;
        }
 }
 
@@ -229,6 +234,7 @@ fdlim_set(int lim)
 #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
        struct rlimit rlfd;
 #endif
+
        if (lim <= 0)
                return (-1);
 #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_NOFILE)
@@ -411,8 +417,8 @@ tcpconnect(char *host)
 static int
 conalloc(char *iname, char *oname, int keytype)
 {
-       int s;
        char *namebase, *name, *namelist;
+       int s;
 
        namebase = namelist = xstrdup(iname);
 
@@ -476,8 +482,8 @@ contouch(int s)
 static int
 conrecycle(int s)
 {
-       int ret;
        con *c = &fdcon[s];
+       int ret;
 
        ret = conalloc(c->c_namelist, c->c_output_name, c->c_keytype);
        confree(s);
@@ -487,10 +493,10 @@ conrecycle(int s)
 static void
 congreet(int s)
 {
+       int remote_major, remote_minor, n = 0;
        char buf[256], *cp;
        char remote_version[sizeof buf];
        size_t bufsiz;
-       int remote_major, remote_minor, n = 0;
        con *c = &fdcon[s];
 
        bufsiz = sizeof(buf);
@@ -554,8 +560,8 @@ congreet(int s)
 static void
 conread(int s)
 {
-       int n;
        con *c = &fdcon[s];
+       int n;
 
        if (c->c_status == CS_CON) {
                congreet(s);
@@ -594,10 +600,10 @@ conread(int s)
 static void
 conloop(void)
 {
-       fd_set *r, *e;
        struct timeval seltime, now;
-       int i;
+       fd_set *r, *e;
        con *c;
+       int i;
 
        gettimeofday(&now, NULL);
        c = TAILQ_FIRST(&tq);
@@ -664,6 +670,7 @@ void
 fatal(const char *fmt,...)
 {
        va_list args;
+
        va_start(args, fmt);
        do_log(SYSLOG_LEVEL_FATAL, fmt, args);
        va_end(args);
@@ -676,16 +683,9 @@ fatal(const char *fmt,...)
 static void
 usage(void)
 {
-       fprintf(stderr, "Usage: %s [options] host ...\n",
+       fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-f file]\n"
+           "\t\t   [host | addrlist namelist] [...]\n",
            __progname);
-       fprintf(stderr, "Options:\n");
-       fprintf(stderr, "  -f file     Read hosts or addresses from file.\n");
-       fprintf(stderr, "  -p port     Connect to the specified port.\n");
-       fprintf(stderr, "  -t keytype  Specify the host key type.\n");
-       fprintf(stderr, "  -T timeout  Set connection timeout.\n");
-       fprintf(stderr, "  -v          Verbose; display verbose debugging messages.\n");
-       fprintf(stderr, "  -4          Use IPv4 only.\n");
-       fprintf(stderr, "  -6          Use IPv6 only.\n");
        exit(1);
 }
 
@@ -717,9 +717,11 @@ main(int argc, char **argv)
                        }
                        break;
                case 'T':
-                       timeout = atoi(optarg);
-                       if (timeout <= 0)
+                       timeout = convtime(optarg);
+                       if (timeout == -1 || timeout == 0) {
+                               fprintf(stderr, "Bad timeout '%s'\n", optarg);
                                usage();
+                       }
                        break;
                case 'v':
                        if (!debug_flag) {
index ab2cf21bab3fb37c087712ef5cb1e8bb6d241c7a..cea4a8244a63b56e332263e1509cd528bb08b867 100644 (file)
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ssh-keysign.8,v 1.2 2002/06/10 16:56:30 stevesk Exp $
+.\" $OpenBSD: ssh-keysign.8,v 1.3 2002/07/03 14:21:05 markus Exp $
 .\"
 .\" Copyright (c) 2002 Markus Friedl.  All rights reserved.
 .\"
@@ -36,6 +36,16 @@ is used by
 .Xr ssh 1
 to access the local host keys and generate the digital signature
 required during hostbased authentication with SSH protocol version 2.
+.Pp
+.Nm
+is disabled by default and can only be enabled in the
+the global client configuration file
+.Pa /etc/ssh/ssh_config
+by setting
+.Cm HostbasedAuthentication
+to
+.Dq yes .
+.Pp
 .Nm
 is not intended to be invoked by the user, but from
 .Xr ssh 1 .
@@ -46,6 +56,10 @@ and
 for more information about hostbased authentication.
 .Sh FILES
 .Bl -tag -width Ds
+.It Pa /etc/ssh/ssh_config
+Controls whether
+.Nm
+is enabled.
 .It Pa /etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_rsa_key
 These files contain the private parts of the host keys used to
 generate the digital signature.  They
@@ -58,6 +72,7 @@ must be set-uid root if hostbased authentication is used.
 .Sh SEE ALSO
 .Xr ssh 1 ,
 .Xr ssh-keygen 1 ,
+.Xr ssh_config 5 ,
 .Xr sshd 8
 .Sh AUTHORS
 Markus Friedl <markus@openbsd.org>
index 7f1d25d8c3f3ad944fa8531c0e4564ce19d15bc3..79aee17c0ca34eae4db39983fa774bab377a2e40 100644 (file)
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keysign.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: ssh-keysign.c,v 1.7 2002/07/03 14:21:05 markus Exp $");
 
 #include <openssl/evp.h>
+#include <openssl/rand.h>
+#include <openssl/rsa.h>
 
 #include "log.h"
 #include "key.h"
+#include "ssh.h"
 #include "ssh2.h"
 #include "misc.h"
 #include "xmalloc.h"
@@ -37,6 +40,9 @@ RCSID("$OpenBSD: ssh-keysign.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $");
 #include "msg.h"
 #include "canohost.h"
 #include "pathnames.h"
+#include "readconf.h"
+
+uid_t original_real_uid;       /* XXX readconf.c needs this */
 
 #ifdef HAVE___PROGNAME
 extern char *__progname;
@@ -134,12 +140,14 @@ int
 main(int argc, char **argv)
 {
        Buffer b;
+       Options options;
        Key *keys[2], *key;
        struct passwd *pw;
        int key_fd[2], i, found, version = 2, fd;
        u_char *signature, *data;
        char *host;
        u_int slen, dlen;
+       u_int32_t rnd[256];
 
        key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
        key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
@@ -155,6 +163,15 @@ main(int argc, char **argv)
        log_init("ssh-keysign", SYSLOG_LEVEL_DEBUG3, SYSLOG_FACILITY_AUTH, 0);
 #endif
 
+       /* verify that ssh-keysign is enabled by the admin */
+       original_real_uid = getuid();   /* XXX readconf.c needs this */
+       initialize_options(&options);
+       (void)read_config_file(_PATH_HOST_CONFIG_FILE, "", &options);
+       fill_default_options(&options);
+       if (options.hostbased_authentication != 1)
+               fatal("Hostbased authentication not enabled in %s",
+                   _PATH_HOST_CONFIG_FILE);
+
        if (key_fd[0] == -1 && key_fd[1] == -1)
                fatal("could not open any host key");
 
@@ -163,6 +180,9 @@ main(int argc, char **argv)
        pw = pwcopy(pw);
 
        SSLeay_add_all_algorithms();
+       for (i = 0; i < 256; i++)
+               rnd[i] = arc4random();
+       RAND_seed(rnd, sizeof(rnd));
 
        found = 0;
        for (i = 0; i < 2; i++) {
@@ -172,6 +192,13 @@ main(int argc, char **argv)
                keys[i] = key_load_private_pem(key_fd[i], KEY_UNSPEC,
                    NULL, NULL);
                close(key_fd[i]);
+               if (keys[i] != NULL && keys[i]->type == KEY_RSA) {
+                       if (RSA_blinding_on(keys[i]->rsa, NULL) != 1) {
+                               error("RSA_blinding_on failed");
+                               key_free(keys[i]);
+                               keys[i] = NULL;
+                       }
+               }
                if (keys[i] != NULL)
                        found = 1;
        }
@@ -179,8 +206,8 @@ main(int argc, char **argv)
                fatal("no hostkey found");
 
        buffer_init(&b);
-       if (msg_recv(STDIN_FILENO, &b) < 0)
-               fatal("msg_recv failed");
+       if (ssh_msg_recv(STDIN_FILENO, &b) < 0)
+               fatal("ssh_msg_recv failed");
        if (buffer_get_char(&b) != version)
                fatal("bad version");
        fd = buffer_get_int(&b);
@@ -192,7 +219,6 @@ main(int argc, char **argv)
        data = buffer_get_string(&b, &dlen);
        if (valid_request(pw, host, &key, data, dlen) < 0)
                fatal("not a valid request");
-       xfree(data);
        xfree(host);
 
        found = 0;
@@ -208,11 +234,12 @@ main(int argc, char **argv)
 
        if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
                fatal("key_sign failed");
+       xfree(data);
 
        /* send reply */
        buffer_clear(&b);
        buffer_put_string(&b, signature, slen);
-       msg_send(STDOUT_FILENO, version, &b);
+       ssh_msg_send(STDOUT_FILENO, version, &b);
 
        return (0);
 }
index da78a09a6362fedac99739681b86d84aa0f2709d..f96447b96ffd45a03f7e7d9c3bc42bc97ad3dc30 100644 (file)
@@ -63,7 +63,6 @@ RCSID("$Id$");
 # define SSH_PRNG_COMMAND_FILE   SSHDIR "/ssh_prng_cmds"
 #endif
 
-
 #ifdef HAVE___PROGNAME
 extern char *__progname;
 #else
@@ -115,7 +114,7 @@ double stir_from_programs(void);
 double stir_gettimeofday(double entropy_estimate);
 double stir_clock(double entropy_estimate);
 double stir_rusage(int who, double entropy_estimate);
-double hash_command_output(entropy_cmd_t *src, char *hash);
+double hash_command_output(entropy_cmd_t *src, unsigned char *hash);
 int get_random_bytes_prngd(unsigned char *buf, int len, 
     unsigned short tcp_port, char *socket_path);
 
@@ -274,7 +273,7 @@ timeval_diff(struct timeval *t1, struct timeval *t2)
 }
 
 double
-hash_command_output(entropy_cmd_t *src, char *hash)
+hash_command_output(entropy_cmd_t *src, unsigned char *hash)
 {
        char buf[8192];
        fd_set rdset;
@@ -460,7 +459,7 @@ stir_from_programs(void)
 {
        int c;
        double entropy, total_entropy;
-       char hash[SHA_DIGEST_LENGTH];
+       unsigned char hash[SHA_DIGEST_LENGTH];
 
        total_entropy = 0;
        for(c = 0; entropy_cmds[c].path != NULL; c++) {
@@ -543,7 +542,8 @@ void
 prng_write_seedfile(void)
 {
        int fd;
-       char seed[SEED_FILE_SIZE], filename[MAXPATHLEN];
+       unsigned char seed[SEED_FILE_SIZE];
+       char filename[MAXPATHLEN];
        struct passwd *pw;
 
        pw = getpwuid(getuid());
@@ -862,4 +862,3 @@ main(int argc, char **argv)
        
        return ret == bytes ? 0 : 1;
 }
-
index 782279bad23b9fae75f22022bdec879cfea7bb0c..d7b2918f938851f03dbee7f2067ded974a244f1c 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh-rsa.c,v 1.21 2002/06/23 03:30:17 deraadt Exp $");
+RCSID("$OpenBSD: ssh-rsa.c,v 1.26 2002/08/27 17:13:56 stevesk Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -37,6 +37,8 @@ RCSID("$OpenBSD: ssh-rsa.c,v 1.21 2002/06/23 03:30:17 deraadt Exp $");
 #include "compat.h"
 #include "ssh.h"
 
+static int openssh_RSA_verify(int, u_char *, u_int, u_char *, u_int , RSA *);
+
 /* RSASSA-PKCS1-v1_5 (PKCS #1 v2.0 signature) with SHA1 */
 int
 ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
@@ -44,7 +46,7 @@ ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
 {
        const EVP_MD *evp_md;
        EVP_MD_CTX md;
-       u_char digest[EVP_MAX_MD_SIZE], *sig, *ret;
+       u_char digest[EVP_MAX_MD_SIZE], *sig;
        u_int slen, dlen, len;
        int ok, nid;
        Buffer b;
@@ -76,7 +78,7 @@ ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
                return -1;
        }
        if (len < slen) {
-               int diff = slen - len;
+               u_int diff = slen - len;
                debug("slen %u > len %u", slen, len);
                memmove(sig + diff, sig, len);
                memset(sig, 0, diff);
@@ -90,16 +92,16 @@ ssh_rsa_sign(Key *key, u_char **sigp, u_int *lenp,
        buffer_put_cstring(&b, "ssh-rsa");
        buffer_put_string(&b, sig, slen);
        len = buffer_len(&b);
-       ret = xmalloc(len);
-       memcpy(ret, buffer_ptr(&b), len);
+       if (lenp != NULL)
+               *lenp = len;
+       if (sigp != NULL) {
+               *sigp = xmalloc(len);
+               memcpy(*sigp, buffer_ptr(&b), len);
+       }
        buffer_free(&b);
        memset(sig, 's', slen);
        xfree(sig);
 
-       if (lenp != NULL)
-               *lenp = len;
-       if (sigp != NULL)
-               *sigp = ret;
        return 0;
 }
 
@@ -149,7 +151,7 @@ ssh_rsa_verify(Key *key, u_char *signature, u_int signaturelen,
                xfree(sigblob);
                return -1;
        } else if (len < modlen) {
-               int diff = modlen - len;
+               u_int diff = modlen - len;
                debug("ssh_rsa_verify: add padding: modlen %u > len %u",
                    modlen, len);
                sigblob = xrealloc(sigblob, modlen);
@@ -167,15 +169,100 @@ ssh_rsa_verify(Key *key, u_char *signature, u_int signaturelen,
        EVP_DigestUpdate(&md, data, datalen);
        EVP_DigestFinal(&md, digest, &dlen);
 
-       ret = RSA_verify(nid, digest, dlen, sigblob, len, key->rsa);
+       ret = openssh_RSA_verify(nid, digest, dlen, sigblob, len, key->rsa);
        memset(digest, 'd', sizeof(digest));
        memset(sigblob, 's', len);
        xfree(sigblob);
-       if (ret == 0) {
-               int ecode = ERR_get_error();
-               error("ssh_rsa_verify: RSA_verify failed: %s",
-                   ERR_error_string(ecode, NULL));
-       }
        debug("ssh_rsa_verify: signature %scorrect", (ret==0) ? "in" : "");
        return ret;
 }
+
+/*
+ * See:
+ * http://www.rsasecurity.com/rsalabs/pkcs/pkcs-1/
+ * ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.asn
+ */
+/*
+ * id-sha1 OBJECT IDENTIFIER ::= { iso(1) identified-organization(3)
+ *     oiw(14) secsig(3) algorithms(2) 26 }
+ */
+static const u_char id_sha1[] = {
+       0x30, 0x21, /* type Sequence, length 0x21 (33) */
+       0x30, 0x09, /* type Sequence, length 0x09 */
+       0x06, 0x05, /* type OID, length 0x05 */
+       0x2b, 0x0e, 0x03, 0x02, 0x1a, /* id-sha1 OID */
+       0x05, 0x00, /* NULL */
+       0x04, 0x14  /* Octet string, length 0x14 (20), followed by sha1 hash */
+};
+/*
+ * id-md5 OBJECT IDENTIFIER ::= { iso(1) member-body(2) us(840)
+ *     rsadsi(113549) digestAlgorithm(2) 5 }
+ */
+static const u_char id_md5[] = {
+       0x30, 0x20, /* type Sequence, length 0x20 (32) */
+       0x30, 0x0c, /* type Sequence, length 0x09 */
+       0x06, 0x08, /* type OID, length 0x05 */
+       0x2a, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, /* id-md5 */
+       0x05, 0x00, /* NULL */
+       0x04, 0x10  /* Octet string, length 0x10 (16), followed by md5 hash */
+};
+
+static int
+openssh_RSA_verify(int type, u_char *hash, u_int hashlen,
+    u_char *sigbuf, u_int siglen, RSA *rsa)
+{
+       u_int ret, rsasize, oidlen = 0, hlen = 0;
+       int len;
+       const u_char *oid = NULL;
+       u_char *decrypted = NULL;
+
+       ret = 0;
+       switch (type) {
+       case NID_sha1:
+               oid = id_sha1;
+               oidlen = sizeof(id_sha1);
+               hlen = 20;
+               break;
+       case NID_md5:
+               oid = id_md5;
+               oidlen = sizeof(id_md5);
+               hlen = 16;
+               break;
+       default:
+               goto done;
+               break;
+       }
+       if (hashlen != hlen) {
+               error("bad hashlen");
+               goto done;
+       }
+       rsasize = RSA_size(rsa);
+       if (siglen == 0 || siglen > rsasize) {
+               error("bad siglen");
+               goto done;
+       }
+       decrypted = xmalloc(rsasize);
+       if ((len = RSA_public_decrypt(siglen, sigbuf, decrypted, rsa,
+           RSA_PKCS1_PADDING)) < 0) {
+               error("RSA_public_decrypt failed: %s",
+                   ERR_error_string(ERR_get_error(), NULL));
+               goto done;
+       }
+       if (len != hlen + oidlen) {
+               error("bad decrypted len: %d != %d + %d", len, hlen, oidlen);
+               goto done;
+       }
+       if (memcmp(decrypted, oid, oidlen) != 0) {
+               error("oid mismatch");
+               goto done;
+       }
+       if (memcmp(decrypted + oidlen, hash, hlen) != 0) {
+               error("hash mismatch");
+               goto done;
+       }
+       ret = 1;
+done:
+       if (decrypted)
+               xfree(decrypted);
+       return ret;
+}
index 1f3efca78541df9eb91f4a2f59690f02642a9071..27808b1f3b2acebacc6a87ab94951e0adee6cace 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: ssh.1,v 1.160 2002/06/22 11:51:39 naddy Exp $
+.\" $OpenBSD: ssh.1,v 1.167 2002/09/27 15:46:21 stevesk Exp $
 .Dd September 25, 1999
 .Dt SSH 1
 .Os
@@ -48,7 +48,7 @@
 .Op Ar command
 .Pp
 .Nm ssh
-.Op Fl afgknqstvxACNPTX1246
+.Op Fl afgknqstvxACNTX1246
 .Op Fl b Ar bind_address
 .Op Fl c Ar cipher_spec
 .Op Fl e Ar escape_char
@@ -353,9 +353,17 @@ the connection is opened.
 The real authentication cookie is never
 sent to the server machine (and no cookies are sent in the plain).
 .Pp
-If the user is using an authentication agent, the connection to the agent
-is automatically forwarded to the remote side unless disabled on
-the command line or in a configuration file.
+If the
+.Cm ForwardAgent
+variable is set to
+.Dq yes
+(or, see the description of the
+.Fl A
+and
+.Fl a
+options described later) and 
+the user is using an authentication agent, the connection to the agent
+is automatically forwarded to the remote side.
 .Pp
 Forwarding of arbitrary TCP/IP connections over the secure channel can
 be specified either on the command line or in a configuration file.
@@ -394,6 +402,13 @@ Disables forwarding of the authentication agent connection.
 .It Fl A
 Enables forwarding of the authentication agent connection.
 This can also be specified on a per-host basis in a configuration file.
+.Pp
+Agent forwarding should be enabled with caution.  Users with the
+ability to bypass file permissions on the remote host (for the agent's
+Unix-domain socket) can access the local agent through the forwarded
+connection.  An attacker cannot obtain key material from the agent,
+however they can perform operations on the keys that enable them to
+authenticate using the identities loaded into the agent.
 .It Fl b Ar bind_address
 Specify the interface to transmit from on machines with multiple
 interfaces or aliased addresses.
@@ -515,15 +530,6 @@ command-line flag.
 Port to connect to on the remote host.
 This can be specified on a
 per-host basis in the configuration file.
-.It Fl P
-Use a non-privileged port for outgoing connections.
-This can be used if a firewall does
-not permit connections from privileged ports.
-Note that this option turns off
-.Cm RhostsAuthentication
-and
-.Cm RhostsRSAAuthentication
-for older servers.
 .It Fl q
 Quiet mode.
 Causes all warning and diagnostic messages to be suppressed.
@@ -559,6 +565,12 @@ Disables X11 forwarding.
 .It Fl X
 Enables X11 forwarding.
 This can also be specified on a per-host basis in a configuration file.
+.Pp
+X11 forwarding should be enabled with caution.  Users with the ability
+to bypass file permissions on the remote host (for the user's X
+authorization database) can access the local X11 display through the
+forwarded connection.  An attacker may then be able to perform
+activities such as keystroke monitoring.
 .It Fl C
 Requests compression of all data (including stdin, stdout, stderr, and
 data for forwarded X11 and TCP/IP connections).
@@ -568,7 +580,7 @@ and the
 .Dq level
 can be controlled by the
 .Cm CompressionLevel
-option.
+option for protocol version 1.
 Compression is desirable on modem lines and other
 slow connections, but will only slow down things on fast networks.
 The default value can be set on a host-by-host basis in the
@@ -714,11 +726,11 @@ to make this work.)
 .It Ev SSH_AUTH_SOCK
 Identifies the path of a unix-domain socket used to communicate with the
 agent.
-.It Ev SSH_CLIENT
-Identifies the client end of the connection.
+.It Ev SSH_CONNECTION
+Identifies the client and server ends of the connection.
 The variable contains
-three space-separated values: client ip-address, client port number,
-and server port number.
+four space-separated values: client ip-address, client port number,
+server ip-address and server port number.
 .It Ev SSH_ORIGINAL_COMMAND
 The variable contains the original command line if a forced command
 is executed.
@@ -742,7 +754,12 @@ reads
 .Pa $HOME/.ssh/environment ,
 and adds lines of the format
 .Dq VARNAME=value
-to the environment.
+to the environment if the file exists and if users are allowed to
+change their environment.
+See the
+.Cm PermitUserEnvironment
+option in
+.Xr sshd_config 5 .
 .Sh FILES
 .Bl -tag -width Ds
 .It Pa $HOME/.ssh/known_hosts
index 24ee541423a3f155367a83ff2d5aeb22fe68042e..2c589de824859bddac85a403ab9f9106c7668758 100644 (file)
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: ssh.c,v 1.179 2002/06/12 01:09:52 markus Exp $");
+RCSID("$OpenBSD: ssh.c,v 1.186 2002/09/19 01:58:18 djm Exp $");
 
 #include <openssl/evp.h>
 #include <openssl/err.h>
@@ -146,6 +146,9 @@ int subsystem_flag = 0;
 /* # of replies received for global requests */
 static int client_global_request_id = 0;
 
+/* pid of proxycommand child process */
+pid_t proxy_command_pid = 0;
+
 /* Prints a help message to the user.  This function never returns. */
 
 static void
@@ -174,7 +177,6 @@ usage(void)
        fprintf(stderr, "  -v          Verbose; display verbose debugging messages.\n");
        fprintf(stderr, "              Multiple -v increases verbosity.\n");
        fprintf(stderr, "  -V          Display version number only.\n");
-       fprintf(stderr, "  -P          Don't allocate a privileged port.\n");
        fprintf(stderr, "  -q          Quiet; don't display any warning messages.\n");
        fprintf(stderr, "  -f          Fork into background after authentication.\n");
        fprintf(stderr, "  -e char     Set escape character; ``none'' = disable (default: ~).\n");
@@ -229,6 +231,15 @@ main(int ac, char **av)
         */
        original_real_uid = getuid();
        original_effective_uid = geteuid();
+       /*
+        * Use uid-swapping to give up root privileges for the duration of
+        * option processing.  We will re-instantiate the rights when we are
+        * ready to create the privileged port, and will permanently drop
+        * them when the port has been created (actually, when the connection
+        * has been made, as we may need to create the port several times).
+        */
+       PRIV_END;
 
 #ifdef HAVE_SETRLIMIT
        /* If we are installed setuid root be careful to not drop core. */
@@ -248,15 +259,6 @@ main(int ac, char **av)
        /* Take a copy of the returned structure. */
        pw = pwcopy(pw);
 
-       /*
-        * Use uid-swapping to give up root privileges for the duration of
-        * option processing.  We will re-instantiate the rights when we are
-        * ready to create the privileged port, and will permanently drop
-        * them when the port has been created (actually, when the connection
-        * has been made, as we may need to create the port several times).
-        */
-       PRIV_END;
-
        /*
         * Set our umask to something reasonable, as some files are created
         * with the default umask.  This will make them world-readable but
@@ -303,7 +305,7 @@ again:
                case 'g':
                        options.gateway_ports = 1;
                        break;
-               case 'P':
+               case 'P':       /* deprecated */
                        options.use_privileged_port = 0;
                        break;
                case 'a':
@@ -552,7 +554,7 @@ again:
        if (buffer_len(&command) == 0)
                tty_flag = 1;
 
-       /* Force no tty*/
+       /* Force no tty */
        if (no_tty_flag)
                tty_flag = 0;
        /* Do not allocate a tty if stdin is not a tty. */
@@ -637,7 +639,8 @@ again:
        if (options.rhosts_rsa_authentication ||
            options.hostbased_authentication) {
                sensitive_data.nkeys = 3;
-               sensitive_data.keys = xmalloc(sensitive_data.nkeys*sizeof(Key));
+               sensitive_data.keys = xmalloc(sensitive_data.nkeys *
+                   sizeof(Key));
 
                PRIV_START;
                sensitive_data.keys[0] = key_load_private_type(KEY_RSA1,
@@ -648,7 +651,8 @@ again:
                    _PATH_HOST_RSA_KEY_FILE, "", NULL);
                PRIV_END;
 
-               if (sensitive_data.keys[0] == NULL &&
+               if (options.hostbased_authentication == 1 &&
+                   sensitive_data.keys[0] == NULL &&
                    sensitive_data.keys[1] == NULL &&
                    sensitive_data.keys[2] == NULL) {
                        sensitive_data.keys[1] = key_load_public(
@@ -721,6 +725,14 @@ again:
 
        exit_status = compat20 ? ssh_session2() : ssh_session();
        packet_close();
+
+       /*
+        * Send SIGHUP to proxy command if used. We don't wait() in 
+        * case it hangs and instead rely on init to reap the child
+        */
+       if (proxy_command_pid > 1)
+               kill(proxy_command_pid, SIGHUP);
+
        return exit_status;
 }
 
@@ -732,11 +744,19 @@ x11_get_proto(char **_proto, char **_data)
        FILE *f;
        int got_data = 0, i;
        char *display;
+       struct stat st;
 
        *_proto = proto;
        *_data = data;
        proto[0] = data[0] = '\0';
-       if (options.xauth_location && (display = getenv("DISPLAY"))) {
+       if (!options.xauth_location ||
+           (stat(options.xauth_location, &st) == -1)) {
+               debug("No xauth program.");
+       } else {
+               if ((display = getenv("DISPLAY")) == NULL) {
+                       debug("x11_get_proto: DISPLAY not set");
+                       return;
+               }
                /* Try to get Xauthority information for the display. */
                if (strncmp(display, "localhost:", 10) == 0)
                        /*
@@ -751,7 +771,7 @@ x11_get_proto(char **_proto, char **_data)
                else
                        snprintf(line, sizeof line, "%s list %.200s 2>"
                            _PATH_DEVNULL, options.xauth_location, display);
-               debug2("x11_get_proto %s", line);
+               debug2("x11_get_proto: %s", line);
                f = popen(line, "r");
                if (f && fgets(line, sizeof(line), f) &&
                    sscanf(line, "%*s %511s %511s", proto, data) == 2)
@@ -770,6 +790,7 @@ x11_get_proto(char **_proto, char **_data)
        if (!got_data) {
                u_int32_t rand = 0;
 
+               log("Warning: No xauth data; using fake authentication data for X11 forwarding.");
                strlcpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto);
                for (i = 0; i < 16; i++) {
                        if (i % 4 == 0)
@@ -819,11 +840,8 @@ check_agent_present(void)
 {
        if (options.forward_agent) {
                /* Clear agent forwarding if we don\'t have an agent. */
-               int authfd = ssh_get_authentication_socket();
-               if (authfd < 0)
+               if (!ssh_agent_present())
                        options.forward_agent = 0;
-               else
-                       ssh_close_authentication_socket(authfd);
        }
 }
 
index 07eee78b6eacd307841c742c5c0a9fc5e4faca29..0a6ad1317b96398744d08c2a7755d2c3d0eb3f00 100644 (file)
  */
 #define SSH_SERVICE_NAME       "ssh"
 
-#if defined(USE_PAM) && !defined(SSHD_PAM_SERVICE)
-# define SSHD_PAM_SERVICE       __progname
-#endif
-
 /*
  * Name of the environment variable containing the process ID of the
  * authentication agent.
index ef31d4336bfc9697ffdd0d1bc96c497b25302229..94cffbf395aa64ba8820e53cf415aadbc341d1d7 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: ssh_config,v 1.15 2002/06/20 20:03:34 stevesk Exp $
+#      $OpenBSD: ssh_config,v 1.16 2002/07/03 14:21:05 markus Exp $
 
 # This is the ssh client system-wide configuration file.  See
 # ssh_config(5) for more information.  This file provides defaults for
@@ -22,6 +22,7 @@
 #   RhostsRSAAuthentication no
 #   RSAAuthentication yes
 #   PasswordAuthentication yes
+#   HostbasedAuthentication no
 #   BatchMode no
 #   CheckHostIP yes
 #   StrictHostKeyChecking ask
index 53cb0fe9778ffd5a40ba17ab740baaeb19e95c85..ac05a0ceae713fffe09d6a9bc2c8a3bbe51b8f87 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: ssh_config.5,v 1.1 2002/06/20 19:56:07 stevesk Exp $
+.\" $OpenBSD: ssh_config.5,v 1.5 2002/08/29 22:54:10 stevesk Exp $
 .Dd September 25, 1999
 .Dt SSH_CONFIG 5
 .Os
 .Nm ssh
 obtains configuration data from the following sources in
 the following order:
-command line options, user's configuration file
-.Pq Pa $HOME/.ssh/config ,
-and system-wide configuration file
-.Pq Pa /etc/ssh/ssh_config .
+.Bl -enum -offset indent -compact
+.It
+command-line options
+.It
+user's configuration file
+.Pq Pa $HOME/.ssh/config
+.It
+system-wide configuration file
+.Pq Pa /etc/ssh/ssh_config
+.El
 .Pp
 For each parameter, the first obtained value
 will be used.
@@ -252,6 +258,13 @@ or
 .Dq no .
 The default is
 .Dq no .
+.Pp
+Agent forwarding should be enabled with caution.  Users with the
+ability to bypass file permissions on the remote host (for the agent's
+Unix-domain socket) can access the local agent through the forwarded
+connection.  An attacker cannot obtain key material from the agent,
+however they can perform operations on the keys that enable them to
+authenticate using the identities loaded into the agent.
 .It Cm ForwardX11
 Specifies whether X11 connections will be automatically redirected
 over the secure channel and
@@ -263,6 +276,12 @@ or
 .Dq no .
 The default is
 .Dq no .
+.Pp
+X11 forwarding should be enabled with caution.  Users with the ability
+to bypass file permissions on the remote host (for the user's X
+authorization database) can access the local X11 display through the
+forwarded connection.  An attacker may then be able to perform
+activities such as keystroke monitoring.
 .It Cm GatewayPorts
 Specifies whether remote hosts are allowed to connect to local
 forwarded ports.
@@ -492,7 +511,12 @@ or
 .Dq no .
 The default is
 .Dq no .
-This option applies to protocol version 1 only.
+This option applies to protocol version 1 only and requires
+.Nm ssh
+to be setuid root and
+.Cm UsePrivilegedPort
+to be set to
+.Dq yes .
 .It Cm RhostsRSAAuthentication
 Specifies whether to try rhosts based authentication with RSA host
 authentication.
@@ -567,6 +591,10 @@ or
 .Dq no .
 The default is
 .Dq no .
+If set to
+.Dq yes
+.Nm ssh
+must be setuid root.
 Note that this option must be set to
 .Dq yes
 if
@@ -584,7 +612,7 @@ Specifies a file to use for the user
 host key database instead of
 .Pa $HOME/.ssh/known_hosts .
 .It Cm XAuthLocation
-Specifies the location of the
+Specifies the full pathname of the
 .Xr xauth 1
 program.
 The default is
index 003e0e0954cd853062a26e3bcbd600c7b11db295..6c8d793f8d7fc0f49d7c6a6c5af3222215a1b495 100644 (file)
@@ -37,7 +37,7 @@
 "netstat -s"                           @PROG_NETSTAT@  0.02
 "netstat -is"                          @PROG_NETSTAT@  0.07
 
-"arp -a -n"                            @PROG_ARP@      0.02
+"arp -n -a"                            @PROG_ARP@      0.02
 
 "ifconfig -a"                          @PROG_IFCONFIG@ 0.02
 
index b89321fb8392b9154db711ec4df28e7d058e919d..776d72065579604979cba8ed1cd4f76d8b3e9775 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.126 2002/06/23 03:30:17 deraadt Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.135 2002/09/19 01:58:18 djm Exp $");
 
 #include <openssl/bn.h>
 
@@ -41,21 +41,13 @@ extern Options options;
 extern char *__progname;
 extern uid_t original_real_uid;
 extern uid_t original_effective_uid;
+extern pid_t proxy_command_pid;
 
 #ifndef INET6_ADDRSTRLEN               /* for non IPv6 machines */
 #define INET6_ADDRSTRLEN 46
 #endif
 
-static const char *
-sockaddr_ntop(struct sockaddr *sa, socklen_t salen)
-{
-       static char addrbuf[NI_MAXHOST];
-
-       if (getnameinfo(sa, salen, addrbuf, sizeof(addrbuf), NULL, 0,
-           NI_NUMERICHOST) != 0)
-               fatal("sockaddr_ntop: getnameinfo NI_NUMERICHOST failed");
-       return addrbuf;
-}
+static int show_other_keys(const char *, Key *);
 
 /*
  * Connect to the given ssh server using a proxy command.
@@ -73,9 +65,16 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
        /* Convert the port number into a string. */
        snprintf(strport, sizeof strport, "%hu", port);
 
-       /* Build the final command string in the buffer by making the
-          appropriate substitutions to the given proxy command. */
+       /*
+        * Build the final command string in the buffer by making the
+        * appropriate substitutions to the given proxy command.
+        *
+        * Use "exec" to avoid "sh -c" processes on some platforms 
+        * (e.g. Solaris)
+        */
        buffer_init(&command);
+       buffer_append(&command, "exec ", 5);
+
        for (cp = proxy_command; *cp; cp++) {
                if (cp[0] == '%' && cp[1] == '%') {
                        buffer_append(&command, "%", 1);
@@ -143,6 +142,8 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
        /* Parent. */
        if (pid < 0)
                fatal("fork failed: %.100s", strerror(errno));
+       else
+               proxy_command_pid = pid; /* save pid to clean up later */
 
        /* Close child side of the descriptors. */
        close(pin[0]);
@@ -238,7 +239,6 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
        int sock = -1, attempt;
        char ntop[NI_MAXHOST], strport[NI_MAXSERV];
        struct addrinfo hints, *ai, *aitop;
-       struct linger linger;
        struct servent *sp;
        /*
         * Did we get only other errors than "Connection refused" (which
@@ -307,9 +307,8 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
                        } else {
                                if (errno == ECONNREFUSED)
                                        full_failure = 0;
-                               log("ssh: connect to address %s port %s: %s",
-                                   sockaddr_ntop(ai->ai_addr, ai->ai_addrlen),
-                                   strport, strerror(errno));
+                               debug("connect to address %s port %s: %s",
+                                   ntop, strport, strerror(errno));
                                /*
                                 * Close the failed socket; there appear to
                                 * be some problems when reusing a socket for
@@ -332,20 +331,14 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
        freeaddrinfo(aitop);
 
        /* Return failure if we didn't get a successful connection. */
-       if (attempt >= connection_attempts)
+       if (attempt >= connection_attempts) {
+               log("ssh: connect to host %s port %s: %s",
+                   host, strport, strerror(errno));
                return full_failure ? ECONNABORTED : ECONNREFUSED;
+       }
 
        debug("Connection established.");
 
-       /*
-        * Set socket options.  We would like the socket to disappear as soon
-        * as it has been closed for whatever reason.
-        */
-       /* setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
-       linger.l_onoff = 1;
-       linger.l_linger = 5;
-       setsockopt(sock, SOL_SOCKET, SO_LINGER, (void *)&linger, sizeof(linger));
-
        /* Set keepalives if requested. */
        if (options.keepalives &&
            setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, (void *)&on,
@@ -476,7 +469,7 @@ confirm(const char *prompt)
                    (p[0] == '\0') || (p[0] == '\n') ||
                    strncasecmp(p, "no", 2) == 0)
                        ret = 0;
-               if (strncasecmp(p, "yes", 3) == 0)
+               if (p && strncasecmp(p, "yes", 3) == 0)
                        ret = 1;
                if (p)
                        xfree(p);
@@ -503,7 +496,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
        int salen;
        char ntop[NI_MAXHOST];
        char msg[1024];
-       int len, host_line, ip_line;
+       int len, host_line, ip_line, has_keys;
        const char *host_file = NULL, *ip_file = NULL;
 
        /*
@@ -647,14 +640,19 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
                            "have requested strict checking.", type, host);
                        goto fail;
                } else if (options.strict_host_key_checking == 2) {
+                       has_keys = show_other_keys(host, host_key);
                        /* The default */
                        fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
                        snprintf(msg, sizeof(msg),
                            "The authenticity of host '%.200s (%s)' can't be "
-                           "established.\n"
+                           "established%s\n"
                            "%s key fingerprint is %s.\n"
                            "Are you sure you want to continue connecting "
-                           "(yes/no)? ", host, ip, type, fp);
+                           "(yes/no)? ",
+                            host, ip,
+                            has_keys ? ",\nbut keys of different type are already "
+                            "known for this host." : ".",
+                            type, fp);
                        xfree(fp);
                        if (!confirm(msg))
                                goto fail;
@@ -757,6 +755,9 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
                 * accept the authentication.
                 */
                break;
+       case HOST_FOUND:
+               fatal("internal error");
+               break;
        }
 
        if (options.check_host_ip && host_status != HOST_CHANGED &&
@@ -868,3 +869,58 @@ ssh_put_password(char *password)
        memset(padded, 0, size);
        xfree(padded);
 }
+
+static int
+show_key_from_file(const char *file, const char *host, int keytype)
+{
+       Key *found;
+       char *fp;
+       int line, ret;
+
+       found = key_new(keytype);
+       if ((ret = lookup_key_in_hostfile_by_type(file, host,
+           keytype, found, &line))) {
+               fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
+               log("WARNING: %s key found for host %s\n"
+                   "in %s:%d\n"
+                   "%s key fingerprint %s.",
+                   key_type(found), host, file, line,
+                   key_type(found), fp);
+               xfree(fp);
+       }
+       key_free(found);
+       return (ret);
+}
+
+/* print all known host keys for a given host, but skip keys of given type */
+static int
+show_other_keys(const char *host, Key *key)
+{
+       int type[] = { KEY_RSA1, KEY_RSA, KEY_DSA, -1};
+       int i, found = 0;
+
+       for (i = 0; type[i] != -1; i++) {
+               if (type[i] == key->type)
+                       continue;
+               if (type[i] != KEY_RSA1 &&
+                   show_key_from_file(options.user_hostfile2, host, type[i])) {
+                       found = 1;
+                       continue;
+               }
+               if (type[i] != KEY_RSA1 &&
+                   show_key_from_file(options.system_hostfile2, host, type[i])) {
+                       found = 1;
+                       continue;
+               }
+               if (show_key_from_file(options.user_hostfile, host, type[i])) {
+                       found = 1;
+                       continue;
+               }
+               if (show_key_from_file(options.system_hostfile, host, type[i])) {
+                       found = 1;
+                       continue;
+               }
+               debug2("no key of type %d for host %s", type[i], host);
+       }
+       return (found);
+}
index e28b7fc72160264b72adaf364f3c42e9ce0e7955..2fc9a981afca2b830e5f1c41f46f11f1c29b61a5 100644 (file)
@@ -13,7 +13,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect1.c,v 1.51 2002/05/23 19:24:30 markus Exp $");
+RCSID("$OpenBSD: sshconnect1.c,v 1.52 2002/08/08 13:50:23 aaron Exp $");
 
 #include <openssl/bn.h>
 #include <openssl/md5.h>
@@ -254,7 +254,7 @@ try_rsa_authentication(int idx)
         * load the private key.  Try first with empty passphrase; if it
         * fails, ask for a passphrase.
         */
-       if (public->flags && KEY_FLAG_EXT)
+       if (public->flags & KEY_FLAG_EXT)
                private = public;
        else
                private = key_load_private_type(KEY_RSA1, authfile, "", NULL);
index 215f76ca2e3673f7258d7b36d0499d4194f370b1..703d0721f2b1cb0fa95d2ea6985b7ef91255b8cc 100644 (file)
@@ -23,7 +23,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshconnect2.c,v 1.105 2002/06/23 03:30:17 deraadt Exp $");
+RCSID("$OpenBSD: sshconnect2.c,v 1.107 2002/07/01 19:48:46 markus Exp $");
 
 #include "ssh.h"
 #include "ssh2.h"
@@ -95,10 +95,10 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
            compat_cipher_proposal(myproposal[PROPOSAL_ENC_ALGS_STOC]);
        if (options.compression) {
                myproposal[PROPOSAL_COMP_ALGS_CTOS] =
-               myproposal[PROPOSAL_COMP_ALGS_STOC] = "zlib";
+               myproposal[PROPOSAL_COMP_ALGS_STOC] = "zlib,none";
        } else {
                myproposal[PROPOSAL_COMP_ALGS_CTOS] =
-               myproposal[PROPOSAL_COMP_ALGS_STOC] = "none";
+               myproposal[PROPOSAL_COMP_ALGS_STOC] = "none,zlib";
        }
        if (options.macs != NULL) {
                myproposal[PROPOSAL_MAC_ALGS_CTOS] =
@@ -422,7 +422,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
        clear_auth_state(authctxt);
        dispatch_set(SSH2_MSG_USERAUTH_PK_OK, NULL);
 
-       /* try another method if we did not send a packet*/
+       /* try another method if we did not send a packet */
        if (sent == 0)
                userauth(authctxt, NULL);
 
@@ -947,9 +947,9 @@ ssh_keysign(Key *key, u_char **sigp, u_int *lenp,
        buffer_init(&b);
        buffer_put_int(&b, packet_get_connection_in()); /* send # of socket */
        buffer_put_string(&b, data, datalen);
-       msg_send(to[1], version, &b);
+       ssh_msg_send(to[1], version, &b);
 
-       if (msg_recv(from[0], &b) < 0) {
+       if (ssh_msg_recv(from[0], &b) < 0) {
                error("ssh_keysign: no reply");
                buffer_clear(&b);
                return -1;
index 37a7b58f6f35c71d64f03e5ce03a7608924152d0..22ab70e0021e50715e354627ab7a0b49f38259d0 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: sshd.8,v 1.186 2002/06/22 16:45:29 stevesk Exp $
+.\" $OpenBSD: sshd.8,v 1.193 2002/09/24 20:59:44 todd Exp $
 .Dd September 25, 1999
 .Dt SSHD 8
 .Os
@@ -203,7 +203,7 @@ The default is
 refuses to start if there is no configuration file.
 .It Fl g Ar login_grace_time
 Gives the grace time for clients to authenticate themselves (default
-600 seconds).
+120 seconds).
 If the client fails to authenticate the user within
 this many seconds, the server disconnects and exits.
 A value of zero indicates no limit.
@@ -350,7 +350,11 @@ Sets up basic environment.
 .It
 Reads
 .Pa $HOME/.ssh/environment
-if it exists.
+if it exists and users are allowed to change their environment.
+See the
+.Cm PermitUserEnvironment
+option in
+.Xr sshd_config 5 .
 .It
 Changes to user's home directory.
 .It
@@ -385,9 +389,9 @@ Each RSA public key consists of the following fields, separated by
 spaces: options, bits, exponent, modulus, comment.
 Each protocol version 2 public key consists of:
 options, keytype, base64 encoded key, comment.
-The options fields
-are optional; its presence is determined by whether the line starts
-with a number or not (the option field never starts with a number).
+The options field
+is optional; its presence is determined by whether the line starts
+with a number or not (the options field never starts with a number).
 The bits, exponent, modulus and comment fields give the RSA key for
 protocol version 1; the
 comment field is not used for anything (but may be convenient for the
@@ -398,7 +402,7 @@ or
 .Dq ssh-rsa .
 .Pp
 Note that lines in this file are usually several hundred bytes long
-(because of the size of the RSA key modulus).
+(because of the size of the public key encoding).
 You don't want to type them in; instead, copy the
 .Pa identity.pub ,
 .Pa id_dsa.pub
@@ -417,7 +421,7 @@ The following option specifications are supported (note
 that option keywords are case-insensitive):
 .Bl -tag -width Ds
 .It Cm from="pattern-list"
-Specifies that in addition to RSA authentication, the canonical name
+Specifies that in addition to public key authentication, the canonical name
 of the remote host must be present in the comma-separated list of
 patterns
 .Pf ( Ql *
@@ -429,7 +433,7 @@ patterns negated by prefixing them with
 .Ql ! ;
 if the canonical host name matches a negated pattern, the key is not accepted.
 The purpose
-of this option is to optionally increase security: RSA authentication
+of this option is to optionally increase security: public key authentication
 by itself does not trust the network or name servers or anything (but
 the key); however, if somebody somehow steals the key, the key
 permits an intruder to log in from anywhere in the world.
@@ -447,7 +451,7 @@ one must not request a pty or should specify
 .Cm no-pty .
 A quote may be included in the command by quoting it with a backslash.
 This option might be useful
-to restrict certain RSA keys to perform just a specific operation.
+to restrict certain public keys to perform just a specific operation.
 An example might be a key that permits remote backups but nothing else.
 Note that the client may specify TCP/IP and/or X11
 forwarding unless they are explicitly prohibited.
@@ -458,6 +462,10 @@ logging in using this key.
 Environment variables set this way
 override other default environment values.
 Multiple options of this type are permitted.
+Environment processing is disabled by default and is
+controlled via the
+.Cm PermitUserEnvironment
+option.
 This option is automatically disabled if
 .Cm UseLogin
 is enabled.
@@ -578,6 +586,8 @@ These files are created using
 .Xr ssh-keygen 1 .
 .It Pa /etc/moduli
 Contains Diffie-Hellman groups used for the "Diffie-Hellman Group Exchange".
+The file format is described in
+.Xr moduli 5 .
 .It Pa /var/empty
 .Xr chroot 2
 directory used by
@@ -698,6 +708,10 @@ It can only contain empty lines, comment lines (that start with
 and assignment lines of the form name=value.
 The file should be writable
 only by the user; it need not be readable by anyone else.
+Environment processing is disabled by default and is
+controlled via the
+.Cm PermitUserEnvironment
+option.
 .It Pa $HOME/.ssh/rc
 If this file exists, it is run with /bin/sh after reading the
 environment files but before starting the user's shell or command.
@@ -723,12 +737,12 @@ something similar to:
 if read proto cookie && [ -n "$DISPLAY" ]; then
        if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
                # X11UseLocalhost=yes
-               xauth add unix:`echo $DISPLAY |
+               echo add unix:`echo $DISPLAY |
                    cut -c11-` $proto $cookie
        else
                # X11UseLocalhost=no
-               xauth add $DISPLAY $proto $cookie
-       fi
+               echo add $DISPLAY $proto $cookie
+       fi | xauth -q -
 fi
 .Ed
 .Pp
index 851fad4be04cb29da8073fdbcadc196d446e7dc9..f8bd7ce544034cd0e101c8aeff1385db880fd2fc 100644 (file)
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.251 2002/06/25 18:51:04 markus Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.260 2002/09/27 10:42:09 mickey Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -303,11 +303,8 @@ grace_alarm_handler(int sig)
 {
        /* XXX no idea how fix this signal handler */
 
-       /* Close the connection. */
-       packet_close();
-
        /* Log error and exit. */
-       fatal("Timeout before authentication for %s.", get_remote_ipaddr());
+       fatal("Timeout before authentication for %s", get_remote_ipaddr());
 }
 
 /*
@@ -320,7 +317,7 @@ grace_alarm_handler(int sig)
 static void
 generate_ephemeral_server_key(void)
 {
-       u_int32_t rand = 0;
+       u_int32_t rnd = 0;
        int i;
 
        verbose("Generating %s%d bit RSA key.",
@@ -333,9 +330,9 @@ generate_ephemeral_server_key(void)
 
        for (i = 0; i < SSH_SESSION_KEY_LENGTH; i++) {
                if (i % 4 == 0)
-                       rand = arc4random();
-               sensitive_data.ssh1_cookie[i] = rand & 0xff;
-               rand >>= 8;
+                       rnd = arc4random();
+               sensitive_data.ssh1_cookie[i] = rnd & 0xff;
+               rnd >>= 8;
        }
        arc4random_stir();
 }
@@ -427,6 +424,12 @@ sshd_exchange_identification(int sock_in, int sock_out)
 
        compat_datafellows(remote_version);
 
+       if (datafellows & SSH_BUG_PROBE) {
+               log("probed from %s with %s.  Don't panic.",
+                   get_remote_ipaddr(), client_version_string);
+               fatal_cleanup();
+       }
+
        if (datafellows & SSH_BUG_SCANNER) {
                log("scanned from %s with %s.  Don't panic.",
                    get_remote_ipaddr(), client_version_string);
@@ -529,8 +532,8 @@ demote_sensitive_data(void)
 static void
 privsep_preauth_child(void)
 {
-       u_int32_t rand[256];
-       gid_t gidset[2];
+       u_int32_t rnd[256];
+       gid_t gidset[1];
        struct passwd *pw;
        int i;
 
@@ -538,8 +541,8 @@ privsep_preauth_child(void)
        privsep_challenge_enable();
 
        for (i = 0; i < 256; i++)
-               rand[i] = arc4random();
-       RAND_seed(rand, sizeof(rand));
+               rnd[i] = arc4random();
+       RAND_seed(rnd, sizeof(rnd));
 
        /* Demote the private keys to public keys. */
        demote_sensitive_data();
@@ -550,7 +553,7 @@ privsep_preauth_child(void)
        memset(pw->pw_passwd, 0, strlen(pw->pw_passwd));
        endpwent();
 
-       /* Change our root directory*/
+       /* Change our root directory */
        if (chroot(_PATH_PRIVSEP_CHROOT_DIR) == -1)
                fatal("chroot(\"%s\"): %s", _PATH_PRIVSEP_CHROOT_DIR,
                    strerror(errno));
@@ -573,7 +576,7 @@ privsep_preauth_child(void)
 #endif
 }
 
-static Authctxt*
+static Authctxt *
 privsep_preauth(void)
 {
        Authctxt *authctxt = NULL;
@@ -589,6 +592,8 @@ privsep_preauth(void)
        if (pid == -1) {
                fatal("fork of unprivileged child failed");
        } else if (pid != 0) {
+               fatal_remove_cleanup((void (*) (void *)) packet_close, NULL);
+
                debug2("Network child is on pid %ld", (long)pid);
 
                close(pmonitor->m_recvfd);
@@ -602,6 +607,10 @@ privsep_preauth(void)
                while (waitpid(pid, &status, 0) < 0)
                        if (errno != EINTR)
                                break;
+
+               /* Reinstall, since the child has finished */
+               fatal_add_cleanup((void (*) (void *)) packet_close, NULL);
+
                return (authctxt);
        } else {
                /* child */
@@ -624,7 +633,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) {
@@ -649,6 +658,8 @@ privsep_postauth(Authctxt *authctxt)
        if (pmonitor->m_pid == -1)
                fatal("fork of unprivileged child failed");
        else if (pmonitor->m_pid != 0) {
+               fatal_remove_cleanup((void (*) (void *)) packet_close, NULL);
+
                debug2("User child is on pid %ld", (long)pmonitor->m_pid);
                close(pmonitor->m_recvfd);
                monitor_child_postauth(pmonitor);
@@ -801,7 +812,6 @@ main(int ac, char **av)
        const char *remote_ip;
        int remote_port;
        FILE *f;
-       struct linger linger;
        struct addrinfo *ai;
        char ntop[NI_MAXHOST], strport[NI_MAXSERV];
        int listen_sock, maxfd;
@@ -906,6 +916,10 @@ main(int ac, char **av)
                        break;
                case 'u':
                        utmp_len = atoi(optarg);
+                       if (utmp_len > MAXHOSTNAMELEN) {
+                               fprintf(stderr, "Invalid utmp length.\n");
+                               exit(1);
+                       }
                        break;
                case 'o':
                        if (process_server_config_line(&options, optarg,
@@ -932,7 +946,7 @@ main(int ac, char **av)
            SYSLOG_FACILITY_AUTH : options.log_facility,
            !inetd_flag);
 
-#ifdef _CRAY
+#ifdef _UNICOS
        /* Cray can define user privs drop all prives now!
         * Not needed on PRIV_SU systems!
         */
@@ -956,7 +970,8 @@ main(int ac, char **av)
        debug("sshd version %.100s", SSH_VERSION);
 
        /* load private host keys */
-       sensitive_data.host_keys = xmalloc(options.num_host_key_files*sizeof(Key*));
+       sensitive_data.host_keys = xmalloc(options.num_host_key_files *
+           sizeof(Key *));
        for (i = 0; i < options.num_host_key_files; i++)
                sensitive_data.host_keys[i] = NULL;
        sensitive_data.server_key = NULL;
@@ -1035,7 +1050,14 @@ main(int ac, char **av)
                    (S_ISDIR(st.st_mode) == 0))
                        fatal("Missing privilege separation directory: %s",
                            _PATH_PRIVSEP_CHROOT_DIR);
+
+#ifdef HAVE_CYGWIN
+               if (check_ntsec(_PATH_PRIVSEP_CHROOT_DIR) &&
+                   (st.st_uid != getuid () ||
+                   (st.st_mode & (S_IWGRP|S_IWOTH)) != 0))
+#else
                if (st.st_uid != 0 || (st.st_mode & (S_IWGRP|S_IWOTH)) != 0)
+#endif
                        fatal("Bad owner or mode for %s",
                            _PATH_PRIVSEP_CHROOT_DIR);
        }
@@ -1135,17 +1157,12 @@ main(int ac, char **av)
                                continue;
                        }
                        /*
-                        * Set socket options.  We try to make the port
-                        * reusable and have it close as fast as possible
-                        * without waiting in unnecessary wait states on
-                        * close.
+                        * Set socket options.
+                        * Allow local port reuse in TIME_WAIT.
                         */
-                       setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
-                           &on, sizeof(on));
-                       linger.l_onoff = 1;
-                       linger.l_linger = 5;
-                       setsockopt(listen_sock, SOL_SOCKET, SO_LINGER,
-                           &linger, sizeof(linger));
+                       if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
+                           &on, sizeof(on)) == -1)
+                               error("setsockopt SO_REUSEADDR: %s", strerror(errno));
 
                        debug("Bind to port %s on %s.", strport, ntop);
 
@@ -1394,16 +1411,6 @@ main(int ac, char **av)
        signal(SIGCHLD, SIG_DFL);
        signal(SIGINT, SIG_DFL);
 
-       /*
-        * Set socket options for the connection.  We want the socket to
-        * close as fast as possible without waiting for anything.  If the
-        * connection is not a socket, these will do nothing.
-        */
-       /* setsockopt(sock_in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
-       linger.l_onoff = 1;
-       linger.l_linger = 5;
-       setsockopt(sock_in, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
-
        /* Set keepalives if requested. */
        if (options.keepalives &&
            setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
@@ -1591,7 +1598,7 @@ do_ssh1_kex(void)
        u_char session_key[SSH_SESSION_KEY_LENGTH];
        u_char cookie[8];
        u_int cipher_type, auth_mask, protocol_flags;
-       u_int32_t rand = 0;
+       u_int32_t rnd = 0;
 
        /*
         * Generate check bytes that the client must send back in the user
@@ -1604,9 +1611,9 @@ do_ssh1_kex(void)
         */
        for (i = 0; i < 8; i++) {
                if (i % 4 == 0)
-                       rand = arc4random();
-               cookie[i] = rand & 0xff;
-               rand >>= 8;
+                       rnd = arc4random();
+               cookie[i] = rnd & 0xff;
+               rnd >>= 8;
        }
 
        /*
index d57346befe67bf13ecf1faca11a740541d1bc3f2..36429c9d0c72c0d46f1940735074b86eef6e5150 100644 (file)
@@ -1,4 +1,4 @@
-#      $OpenBSD: sshd_config,v 1.56 2002/06/20 23:37:12 markus Exp $
+#      $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $
 
 # This is the sshd server system-wide configuration file.  See
 # sshd_config(5) for more information.
@@ -32,7 +32,7 @@
 
 # Authentication:
 
-#LoginGraceTime 600
+#LoginGraceTime 120
 #PermitRootLogin yes
 #StrictModes yes
 
@@ -71,7 +71,7 @@
 
 # Set this to 'yes' to enable PAM keyboard-interactive authentication 
 # Warning: enabling this may bypass the setting of 'PasswordAuthentication'
-#PAMAuthenticationViaKbdInt yes
+#PAMAuthenticationViaKbdInt no
 
 #X11Forwarding no
 #X11DisplayOffset 10
@@ -81,6 +81,7 @@
 #KeepAlive yes
 #UseLogin no
 #UsePrivilegeSeparation yes
+#PermitUserEnvironment no
 #Compression yes
 
 #MaxStartups 10
index aa7b7c7d4eae578c04651ea89b90890d3b22ec76..0944ba07671032066eed6fcb9c02e6dde4e261ca 100644 (file)
@@ -34,7 +34,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $OpenBSD: sshd_config.5,v 1.4 2002/06/22 16:45:29 stevesk Exp $
+.\" $OpenBSD: sshd_config.5,v 1.13 2002/09/16 20:12:11 stevesk Exp $
 .Dd September 25, 1999
 .Dt SSHD_CONFIG 5
 .Os
@@ -379,7 +379,7 @@ options must precede this option for non port qualified addresses.
 The server disconnects after this time if the user has not
 successfully logged in.
 If the value is 0, there is no time limit.
-The default is 600 (seconds).
+The default is 120 seconds.
 .It Cm LogLevel
 Gives the verbosity level that is used when logging messages from
 .Nm sshd .
@@ -465,6 +465,20 @@ for root.
 If this option is set to
 .Dq no
 root is not allowed to login.
+.It Cm PermitUserEnvironment
+Specifies whether
+.Pa ~/.ssh/environment
+and
+.Cm environment=
+options in
+.Pa ~/.ssh/authorized_keys
+are processed by
+.Nm sshd .
+The default is
+.Dq no .
+Enabling environment processing may enable users to bypass access
+restrictions in some configurations using mechanisms such as
+.Ev LD_PRELOAD .
 .It Cm PidFile
 Specifies the file that contains the process ID of the
 .Nm sshd
@@ -499,7 +513,7 @@ The default is
 .It Cm Protocol
 Specifies the protocol versions
 .Nm sshd
-should support.
+supports.
 The possible values are
 .Dq 1
 and
@@ -507,6 +521,13 @@ and
 Multiple versions must be comma-separated.
 The default is
 .Dq 2,1 .
+Note that the order of the protocol list does not indicate preference,
+because the client selects among multiple protocol versions offered
+by the server.
+Specifying
+.Dq 2,1
+is identical to
+.Dq 1,2 .
 .It Cm PubkeyAuthentication
 Specifies whether public key authentication is allowed.
 The default is
@@ -609,10 +630,35 @@ from interfering with real X11 servers.
 The default is 10.
 .It Cm X11Forwarding
 Specifies whether X11 forwarding is permitted.
+The argument must be
+.Dq yes
+or
+.Dq no .
 The default is
 .Dq no .
-Note that disabling X11 forwarding does not improve security in any
-way, as users can always install their own forwarders.
+.Pp
+When X11 forwarding is enabled, there may be additional exposure to
+the server and to client displays if the
+.Nm sshd
+proxy display is configured to listen on the wildcard address (see
+.Cm X11UseLocalhost
+below), however this is not the default.
+Additionally, the authentication spoofing and authentication data
+verification and substitution occur on the client side.
+The security risk of using X11 forwarding is that the client's X11
+display server may be exposed to attack when the ssh client requests
+forwarding (see the warnings for
+.Cm ForwardX11
+in
+.Xr ssh_config 5 ).
+A system administrator may have a stance in which they want to
+protect clients that may expose themselves to attack by unwittingly
+requesting X11 forwarding, which can warrant a
+.Dq no
+setting.
+.Pp
+Note that disabling X11 forwarding does not prevent users from
+forwarding X11 traffic, as users can always install their own forwarders.
 X11 forwarding is automatically disabled if
 .Cm UseLogin
 is enabled.
@@ -627,7 +673,7 @@ hostname part of the
 .Ev DISPLAY
 environment variable to
 .Dq localhost .
-This prevents remote hosts from connecting to the fake display.
+This prevents remote hosts from connecting to the proxy display.
 However, some older X11 clients may not function with this
 configuration.
 .Cm X11UseLocalhost
@@ -642,7 +688,7 @@ or
 The default is
 .Dq yes .
 .It Cm XAuthLocation
-Specifies the location of the
+Specifies the full pathname of the
 .Xr xauth 1
 program.
 The default is
@@ -654,7 +700,7 @@ The default is
 command-line arguments and configuration file options that specify time
 may be expressed using a sequence of the form:
 .Sm off
-.Ar time Oo Ar qualifier Oc ,
+.Ar time Op Ar qualifier ,
 .Sm on
 where
 .Ar time
index e76f94534daa9359c80b8d0a0120c8069b58dc3f..4cd1c0059c54418ab4344670a7d6ffb135ed3715 100644 (file)
@@ -39,7 +39,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshlogin.c,v 1.4 2002/06/23 03:30:17 deraadt Exp $");
+RCSID("$OpenBSD: sshlogin.c,v 1.5 2002/08/29 15:57:25 stevesk Exp $");
 
 #include "loginrec.h"
 
@@ -65,7 +65,7 @@ get_last_login_time(uid_t uid, const char *logname,
  */
 void
 record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
-    const char *host, struct sockaddr * addr)
+    const char *host, struct sockaddr * addr, socklen_t addrlen)
 {
   struct logininfo *li;
 
index bd30278e0e7d8d294f6469d33a5c66ea9e57d43c..287c0d9f6a14163e1c4743437b118d0fbd1e0afc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sshlogin.h,v 1.3 2001/06/26 17:27:25 markus Exp $     */
+/*     $OpenBSD: sshlogin.h,v 1.4 2002/08/29 15:57:25 stevesk Exp $    */
 
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -16,7 +16,7 @@
 
 void
 record_login(pid_t, const char *, const char *, uid_t,
-    const char *, struct sockaddr *);
+    const char *, struct sockaddr *, socklen_t);
 void   record_logout(pid_t, const char *, const char *);
 u_long         get_last_login_time(uid_t, const char *, char *, u_int);
 
index 64ac4e5994fa8d636431b88d043c561217c9030f..28d0e310c4732a050ffdb80b252e75bd11fd24f7 100644 (file)
@@ -162,7 +162,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
        }
        return 1;
 #else /* HAVE_DEV_PTS_AND_PTC */
-#ifdef _CRAY
+#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 */
 
-#ifdef _CRAY
+#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. */
index 0a772c7b33a8388063cd6c324b556459720b7069..86c61a4b0182b0563036d08a99e9976799607f87 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: uidswap.c,v 1.22 2002/05/28 21:24:00 stevesk Exp $");
+RCSID("$OpenBSD: uidswap.c,v 1.23 2002/07/15 17:15:31 stevesk Exp $");
 
 #include "log.h"
 #include "uidswap.h"
@@ -52,8 +52,9 @@ temporarily_use_uid(struct passwd *pw)
 #ifdef SAVED_IDS_WORK_WITH_SETEUID
        saved_euid = geteuid();
        saved_egid = getegid();
-       debug("temporarily_use_uid: %u/%u (e=%u)",
-           (u_int)pw->pw_uid, (u_int)pw->pw_gid, (u_int)saved_euid);
+       debug("temporarily_use_uid: %u/%u (e=%u/%u)",
+           (u_int)pw->pw_uid, (u_int)pw->pw_gid,
+           (u_int)saved_euid, (u_int)saved_egid);
        if (saved_euid != 0) {
                privileged = 0;
                return;
@@ -105,14 +106,16 @@ temporarily_use_uid(struct passwd *pw)
 void
 restore_uid(void)
 {
-       debug("restore_uid");
        /* it's a no-op unless privileged */
-       if (!privileged)
+       if (!privileged) {
+               debug("restore_uid: (unprivileged)");
                return;
+       }
        if (!temporarily_use_uid_effective)
                fatal("restore_uid: temporarily_use_uid not effective");
 
 #ifdef SAVED_IDS_WORK_WITH_SETEUID
+       debug("restore_uid: %u/%u", (u_int)saved_euid, (u_int)saved_egid);
        /* Set the effective uid back to the saved privileged uid. */
        if (seteuid(saved_euid) < 0)
                fatal("seteuid %u: %.100s", (u_int)saved_euid, strerror(errno));
@@ -142,6 +145,8 @@ permanently_set_uid(struct passwd *pw)
 {
        if (temporarily_use_uid_effective)
                fatal("permanently_set_uid: temporarily_use_uid effective");
+       debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,
+           (u_int)pw->pw_gid);
        if (setgid(pw->pw_gid) < 0)
                fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
        if (setuid(pw->pw_uid) < 0)
index 89fcb08152d744fd856128a4904d2f18d3272d5c..21eaf4d3f43ee0a333ca5d793234b5b498f93285 100644 (file)
  */
 
 #include "includes.h"
+RCSID("$OpenBSD: uuencode.c,v 1.16 2002/09/09 14:54:15 markus Exp $");
+
 #include "xmalloc.h"
 #include "uuencode.h"
-RCSID("$OpenBSD: uuencode.c,v 1.15 2002/03/04 17:27:39 stevesk Exp $");
 
 int
 uuencode(u_char *src, u_int srclength,
@@ -57,7 +58,7 @@ uudecode(const char *src, u_char *target, size_t targsize)
 void
 dump_base64(FILE *fp, u_char *data, u_int len)
 {
-       u_char *buf = xmalloc(2*len);
+       char *buf = xmalloc(2*len);
        int i, n;
 
        n = uuencode(data, len, buf, 2*len);
index 1e9b43128bb261422961ffb9f13a8126218f92eb..1f11299246491d40cc13af056a7eb012c2cfd8b8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: version.h,v 1.34 2002/06/26 13:56:27 markus Exp $ */
+/* $OpenBSD: version.h,v 1.35 2002/10/01 13:24:50 markus Exp $ */
 
-#define SSH_VERSION    "OpenSSH_3.4p1"
+#define SSH_VERSION    "OpenSSH_3.5p1"
 
This page took 0.856501 seconds and 5 git commands to generate.