summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CREDITS7
-rw-r--r--ChangeLog2289
-rw-r--r--INSTALL4
-rw-r--r--LICENCE160
-rw-r--r--Makefile.in85
-rw-r--r--README.dns52
-rw-r--r--README.privsep5
-rw-r--r--README.smartcard80
-rw-r--r--TODO80
-rw-r--r--acconfig.h79
-rw-r--r--atomicio.c6
-rw-r--r--atomicio.h8
-rw-r--r--auth-chall.c26
-rw-r--r--auth-krb5.c228
-rw-r--r--auth-options.c8
-rw-r--r--auth-pam.c962
-rw-r--r--auth-pam.h22
-rw-r--r--auth-passwd.c216
-rw-r--r--auth-rh-rsa.c6
-rw-r--r--auth-rhosts.c13
-rw-r--r--auth-rsa.c6
-rw-r--r--auth-sia.c27
-rw-r--r--auth-sia.h4
-rw-r--r--auth.c158
-rw-r--r--auth.h39
-rw-r--r--auth1.c145
-rw-r--r--auth2-chall.c21
-rw-r--r--auth2-gss.c247
-rw-r--r--auth2-hostbased.c10
-rw-r--r--auth2-kbdint.c4
-rw-r--r--auth2-none.c6
-rw-r--r--auth2-passwd.c6
-rw-r--r--auth2-pubkey.c8
-rw-r--r--auth2.c45
-rw-r--r--authfd.c41
-rw-r--r--authfd.h6
-rw-r--r--authfile.c13
-rw-r--r--bufaux.c8
-rw-r--r--bufaux.h2
-rw-r--r--buffer.c13
-rw-r--r--canohost.c52
-rw-r--r--channels.c258
-rw-r--r--cipher-3des1.c171
-rw-r--r--cipher-aes.c156
-rw-r--r--cipher-bf1.c97
-rw-r--r--cipher-ctr.c141
-rw-r--r--cipher.c380
-rw-r--r--clientloop.c48
-rw-r--r--compat.c17
-rw-r--r--compat.h8
-rw-r--r--config.h.in485
-rwxr-xr-xconfigure12980
-rw-r--r--configure.ac493
-rw-r--r--contrib/aix/README3
-rwxr-xr-xcontrib/aix/buildbff.sh13
-rwxr-xr-xcontrib/aix/inventory.sh2
-rw-r--r--contrib/caldera/openssh.spec6
-rw-r--r--contrib/cygwin/ssh-user-config8
-rw-r--r--contrib/findssl.sh159
-rw-r--r--contrib/redhat/openssh.spec27
-rw-r--r--contrib/suse/openssh.spec2
-rw-r--r--defines.h58
-rw-r--r--dh.c10
-rw-r--r--dispatch.c6
-rw-r--r--dns.c290
-rw-r--r--dns.h57
-rw-r--r--entropy.c10
-rw-r--r--groupaccess.c4
-rw-r--r--gss-genr.c256
-rw-r--r--gss-serv-krb5.c205
-rw-r--r--gss-serv.c292
-rw-r--r--hostfile.c6
-rw-r--r--includes.h11
-rw-r--r--key.c12
-rw-r--r--key.h5
-rw-r--r--log.c20
-rw-r--r--log.h4
-rw-r--r--loginrec.c81
-rw-r--r--loginrec.h7
-rw-r--r--logintest.c9
-rw-r--r--md5crypt.c162
-rw-r--r--md5crypt.h14
-rw-r--r--mdoc2man.awk340
-rw-r--r--misc.c30
-rw-r--r--misc.h4
-rw-r--r--moduli.c617
-rw-r--r--moduli.h23
-rw-r--r--monitor.c379
-rw-r--r--monitor.h12
-rw-r--r--monitor_fdpass.c2
-rw-r--r--monitor_mm.c1
-rw-r--r--monitor_wrap.c230
-rw-r--r--monitor_wrap.h25
-rw-r--r--msg.c6
-rw-r--r--myproposal.h5
-rw-r--r--nchan.c50
-rw-r--r--openbsd-compat/Makefile.in6
-rw-r--r--openbsd-compat/base64.h50
-rw-r--r--openbsd-compat/basename.c39
-rw-r--r--openbsd-compat/bindresvport.c63
-rw-r--r--openbsd-compat/bsd-arc4random.c3
-rw-r--r--openbsd-compat/bsd-cray.c810
-rw-r--r--openbsd-compat/bsd-cray.h34
-rw-r--r--openbsd-compat/bsd-cygwin_util.c95
-rw-r--r--openbsd-compat/bsd-cygwin_util.h15
-rw-r--r--openbsd-compat/bsd-misc.c94
-rw-r--r--openbsd-compat/bsd-misc.h45
-rw-r--r--openbsd-compat/bsd-nextstep.c6
-rw-r--r--openbsd-compat/bsd-nextstep.h25
-rw-r--r--openbsd-compat/bsd-snprintf.c557
-rw-r--r--openbsd-compat/bsd-waitpid.c11
-rw-r--r--openbsd-compat/bsd-waitpid.h8
-rw-r--r--openbsd-compat/daemon.c11
-rw-r--r--openbsd-compat/dirname.c42
-rw-r--r--openbsd-compat/fake-rfc2553.c220
-rw-r--r--openbsd-compat/fake-rfc2553.h154
-rw-r--r--openbsd-compat/getcwd.c7
-rw-r--r--openbsd-compat/getgrouplist.c9
-rw-r--r--openbsd-compat/getopt.c8
-rw-r--r--openbsd-compat/getrrsetbyname.c578
-rw-r--r--openbsd-compat/getrrsetbyname.h100
-rw-r--r--openbsd-compat/glob.c12
-rw-r--r--openbsd-compat/glob.h8
-rw-r--r--openbsd-compat/inet_aton.c12
-rw-r--r--openbsd-compat/inet_ntoa.c8
-rw-r--r--openbsd-compat/inet_ntop.c1
-rw-r--r--openbsd-compat/mktemp.c8
-rw-r--r--openbsd-compat/openbsd-compat.h175
-rw-r--r--openbsd-compat/port-aix.c91
-rw-r--r--openbsd-compat/port-aix.h26
-rw-r--r--openbsd-compat/port-irix.c43
-rw-r--r--openbsd-compat/port-irix.h36
-rw-r--r--openbsd-compat/readpassphrase.c40
-rw-r--r--openbsd-compat/realpath.c19
-rw-r--r--openbsd-compat/rresvport.c9
-rw-r--r--openbsd-compat/setenv.c8
-rw-r--r--openbsd-compat/setproctitle.c308
-rw-r--r--openbsd-compat/strlcat.c41
-rw-r--r--openbsd-compat/strlcpy.c41
-rw-r--r--openbsd-compat/strmode.c12
-rw-r--r--openbsd-compat/strsep.c16
-rw-r--r--openbsd-compat/sys-queue.h8
-rw-r--r--openbsd-compat/vis.c45
-rw-r--r--openbsd-compat/vis.h11
-rw-r--r--openbsd-compat/xcrypt.c116
-rw-r--r--openbsd-compat/xmmap.c5
-rw-r--r--packet.c180
-rw-r--r--packet.h15
-rw-r--r--progressmeter.c423
-rw-r--r--readconf.c189
-rw-r--r--readconf.h19
-rw-r--r--regress/Makefile61
-rw-r--r--regress/README.regress86
-rw-r--r--regress/agent-getpeereid.sh6
-rw-r--r--regress/agent-ptrace.sh18
-rw-r--r--regress/agent-timeout.sh12
-rw-r--r--regress/agent.sh2
-rw-r--r--regress/dynamic-forward.sh47
-rw-r--r--regress/forwarding.sh7
-rw-r--r--regress/proto-version.sh2
-rw-r--r--regress/reconfigure.sh35
-rw-r--r--regress/rekey.sh31
-rw-r--r--regress/sftp-badcmds.sh78
-rw-r--r--regress/sftp-batch.sh4
-rw-r--r--regress/sftp-cmds.sh109
-rw-r--r--regress/sftp.sh26
-rw-r--r--regress/ssh-com-client.sh6
-rw-r--r--regress/ssh-com-keygen.sh4
-rw-r--r--regress/ssh-com-sftp.sh28
-rw-r--r--regress/ssh-com.sh6
-rw-r--r--regress/stderr-after-eof.sh14
-rw-r--r--regress/stderr-data.sh2
-rw-r--r--regress/test-exec.sh45
-rw-r--r--regress/transfer.sh2
-rw-r--r--regress/try-ciphers.sh5
-rw-r--r--regress/yes-head.sh2
-rw-r--r--scard-opensc.c85
-rw-r--r--scard.c13
-rw-r--r--scard.h3
-rw-r--r--scp.011
-rw-r--r--scp.120
-rw-r--r--scp.c108
-rw-r--r--servconf.c147
-rw-r--r--servconf.h19
-rw-r--r--serverloop.c20
-rw-r--r--session.c267
-rw-r--r--session.h5
-rw-r--r--sftp-client.c10
-rw-r--r--sftp-common.c6
-rw-r--r--sftp-int.c217
-rw-r--r--sftp-server.02
-rw-r--r--sftp-server.84
-rw-r--r--sftp-server.c10
-rw-r--r--sftp.045
-rw-r--r--sftp.193
-rw-r--r--sftp.c37
-rw-r--r--ssh-add.036
-rw-r--r--ssh-add.140
-rw-r--r--ssh-add.c9
-rw-r--r--ssh-agent.08
-rw-r--r--ssh-agent.114
-rw-r--r--ssh-agent.c37
-rw-r--r--ssh-gss.h121
-rw-r--r--ssh-keygen.088
-rw-r--r--ssh-keygen.1131
-rw-r--r--ssh-keygen.c149
-rw-r--r--ssh-keyscan.040
-rw-r--r--ssh-keyscan.153
-rw-r--r--ssh-keyscan.c14
-rw-r--r--ssh-keysign.06
-rw-r--r--ssh-keysign.86
-rw-r--r--ssh-keysign.c7
-rw-r--r--ssh-rand-helper.c16
-rw-r--r--ssh-rsa.c33
-rw-r--r--ssh.047
-rw-r--r--ssh.151
-rw-r--r--ssh.c90
-rw-r--r--ssh.h6
-rw-r--r--ssh2.h4
-rw-r--r--ssh_config5
-rw-r--r--ssh_config.0110
-rw-r--r--ssh_config.5121
-rw-r--r--sshconnect.c184
-rw-r--r--sshconnect1.c589
-rw-r--r--sshconnect2.c625
-rw-r--r--sshd.049
-rw-r--r--sshd.868
-rw-r--r--sshd.c181
-rw-r--r--sshd_config35
-rw-r--r--sshd_config.0117
-rw-r--r--sshd_config.5115
-rw-r--r--sshlogin.c6
-rw-r--r--sshpty.c24
-rw-r--r--sshtty.c5
-rw-r--r--ttymodes.c14
-rw-r--r--uidswap.c53
-rw-r--r--version.h2
237 files changed, 18753 insertions, 15125 deletions
diff --git a/CREDITS b/CREDITS
index 8d7b8a484..092229cf7 100644
--- a/CREDITS
+++ b/CREDITS
@@ -23,7 +23,7 @@ Chris Saia <csaia@wtower.com> - SuSE packaging
23Chris, the Young One <cky@pobox.com> - Password auth fixes 23Chris, the Young One <cky@pobox.com> - Password auth fixes
24Christos Zoulas <christos@zoulas.com> - Autoconf fixes 24Christos Zoulas <christos@zoulas.com> - Autoconf fixes
25Chun-Chung Chen <cjj@u.washington.edu> - RPM fixes 25Chun-Chung Chen <cjj@u.washington.edu> - RPM fixes
26Corinna Vinschen <vinschen@cygnus.com> - Cygwin support 26Corinna Vinschen <vinschen@redhat.com> - Cygwin support
27Dan Brosemer <odin@linuxfreak.com> - Autoconf support, build fixes 27Dan Brosemer <odin@linuxfreak.com> - Autoconf support, build fixes
28Darren Hall <dhall@virage.org> - AIX patches 28Darren Hall <dhall@virage.org> - AIX patches
29Darren Tucker <dtucker@zip.com.au> - AIX BFF package scripts 29Darren Tucker <dtucker@zip.com.au> - AIX BFF package scripts
@@ -49,6 +49,7 @@ Juergen Keil <jk@tools.de> - scp bugfixing
49KAMAHARA Junzo <kamahara@cc.kshosen.ac.jp> - Configure fixes 49KAMAHARA Junzo <kamahara@cc.kshosen.ac.jp> - Configure fixes
50Kees Cook <cook@cpoint.net> - scp fixes 50Kees Cook <cook@cpoint.net> - scp fixes
51Kenji Miyake <kenji@miyake.org> - Configure fixes 51Kenji Miyake <kenji@miyake.org> - Configure fixes
52Kevin Cawlfield <cawlfiel@us.ibm.com> - AIX fixes.
52Kevin O'Connor <kevin_oconnor@standardandpoors.com> - RSAless operation 53Kevin O'Connor <kevin_oconnor@standardandpoors.com> - RSAless operation
53Kevin Steves <stevesk@pobox.com> - HP support, bugfixes, improvements 54Kevin Steves <stevesk@pobox.com> - HP support, bugfixes, improvements
54Kiyokazu SUTO <suto@ks-and-ks.ne.jp> - Bugfixes 55Kiyokazu SUTO <suto@ks-and-ks.ne.jp> - Bugfixes
@@ -69,11 +70,13 @@ Pavel Kankovsky <peak@argo.troja.mff.cuni.cz> - Security fixes
69Pavel Troller <patrol@omni.sinus.cz> - Bugfixes 70Pavel Troller <patrol@omni.sinus.cz> - Bugfixes
70Pekka Savola <pekkas@netcore.fi> - Bugfixes 71Pekka Savola <pekkas@netcore.fi> - Bugfixes
71Peter Kocks <peter.kocks@baygate.com> - Makefile fixes 72Peter Kocks <peter.kocks@baygate.com> - Makefile fixes
73Peter Stuge <stuge@cdy.org> - mdoc2man.awk script
72Phil Hands <phil@hands.com> - Debian scripts, assorted patches 74Phil Hands <phil@hands.com> - Debian scripts, assorted patches
73Phil Karn <karn@ka9q.ampr.org> - Autoconf fixes 75Phil Karn <karn@ka9q.ampr.org> - Autoconf fixes
74Philippe WILLEM <Philippe.WILLEM@urssaf.fr> - Bugfixes 76Philippe WILLEM <Philippe.WILLEM@urssaf.fr> - Bugfixes
75Phill Camp <P.S.S.Camp@ukc.ac.uk> - login code fix 77Phill Camp <P.S.S.Camp@ukc.ac.uk> - login code fix
76Rip Loomis <loomisg@cist.saic.com> - Solaris package support, fixes 78Rip Loomis <loomisg@cist.saic.com> - Solaris package support, fixes
79Roumen Petrov <openssh@roumenpetrov.info> - Compile & configure fixes
77SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp> - Multiple bugfixes 80SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp> - Multiple bugfixes
78Simon Wilkinson <sxw@dcs.ed.ac.uk> - PAM fixes, Compat with MIT KrbV 81Simon Wilkinson <sxw@dcs.ed.ac.uk> - PAM fixes, Compat with MIT KrbV
79Solar Designer <solar@openwall.com> - many patches and technical assistance 82Solar Designer <solar@openwall.com> - many patches and technical assistance
@@ -91,5 +94,5 @@ Apologies to anyone I have missed.
91 94
92Damien Miller <djm@mindrot.org> 95Damien Miller <djm@mindrot.org>
93 96
94$Id: CREDITS,v 1.67.6.1 2003/04/29 09:12:07 djm Exp $ 97$Id: CREDITS,v 1.74 2003/09/07 02:34:54 dtucker Exp $
95 98
diff --git a/ChangeLog b/ChangeLog
index 6ccc4d4ed..b5505da19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,995 @@
120030916
2 - (dtucker) [acconfig.h configure.ac defines.h session.c] Bug #252: Retrieve
3 PATH (or SUPATH) and UMASK from /etc/default/login on platforms that have it
4 (eg Solaris, Reliant Unix). Patch from Robert.Dahlem at siemens.com.
5 ok djm@
6 - (bal) OpenBSD Sync
7 - deraadt@cvs.openbsd.org 2003/09/16 03:03:47
8 [buffer.c]
9 do not expand buffer before attempting to reallocate it; markus ok
10 - (djm) Crank spec versions
11 - (djm) Banish (safe) sprintf from auth-pam.c. Patch from bal
12 - (tim) [configure.ac] Fix portability issues.
13 - (djm) Release 3.7p1
14
1520030914
16 - (dtucker) [Makefile regress/Makefile] Fix portability issues preventing
17 the regression tests from running with Solaris' make. Patch from Brian
18 Poole (raj at cerias.purdue.edu).
19 - (dtucker) [regress/Makefile] AIX's make doesn't like " +=", so replace
20 with vanilla "=".
21
2220030913
23 - (dtucker) [regress/agent-timeout.sh] Timeout of 5 sec is borderline for
24 slower hosts, increase to 10 sec.
25 - (dtucker) [auth-passwd.c] On AIX, call setauthdb() before loginsuccess(),
26 required to correctly reset failed login count when using a password
27 registry other than "files" (eg LDAP, see bug #543).
28 - (tim) [configure.ac] define WITH_ABBREV_NO_TTY for SCO.
29 Report by Roger Cornelius.
30 - (dtucker) [auth-pam.c] Use SSHD_PAM_SERVICE for PAM service name, patch
31 from cjwatson at debian.org.
32
3320030912
34 - (tim) [regress/agent-ptrace.sh] sh doesn't like "if ! shell_function; then".
35 - (tim) [Makefile.in] only mkdir regress if it does not exist.
36 - (tim) [regress/yes-head.sh] shell portability fix.
37
3820030911
39 - (dtucker) [configure.ac] Bug #588, #615: Move other libgen tests to after
40 the dirname test, to allow a broken dirname to be detected correctly.
41 Based partially on patch supplied by alex.kiernan at thus.net. ok djm@
42 - (tim) [configure.ac] Move libgen tests to before libwrap to unbreak
43 UnixWare 2.03 using --with-tcp-wrappers.
44 - (tim) [configure.ac] Prefer setuid/setgid on UnixWare and Open Server.
45 - (tim) [regress/agent-ptrace.sh regress/dynamic-forward.sh
46 regress/sftp-cmds.sh regress/stderr-after-eof.sh regress/test-exec.sh]
47 no longer depends on which(1). patch by dtucker@
48
4920030910
50 - (dtucker) [configure.ac] Bug #636: Add support for Cray's new X1 machine.
51 Patch from wendyp at cray.com.
52 - (dtucker) [configure.ac] Part of bug #615: tcsendbreak might be a macro.
53 - (dtucker) [regressh/yes-head.sh] Some platforms (eg Solaris) don't have
54 "yes".
55
5620030909
57 - (tim) [regress/Makefile] Fixes for building outside of a read-only
58 source tree.
59 - (tim) [regress/agent-timeout.sh] s/TIMEOUT/SSHAGENT_TIMEOUT/ Fixes conflict
60 with shell read-only variable.
61 - (tim) [regress/sftp-badcmds.sh regress/sftp-cmds.sh] Fix errors like
62 UX:rm: ERROR: Cannot remove '.' or '..'
63
6420030908
65 - (tim) [configure.ac openbsd-compat/getrrsetbyname.c] wrap _getshort and
66 _getlong in #ifndef
67 - (tim) [configure.ac acconfig.h openbsd-compat/getrrsetbyname.c] test for
68 HEADER.ad in arpa/nameser.h
69 - (tim) [ssh-keygen.c] s/PATH_MAX/MAXPATHLEN/ ok mouring@
70
7120030907
72 - (dtucker) [agent-ptrace.sh dynamic-forward.sh (all regress/)]
73 Put "which" inside quotes.
74 - (dtucker) [dynamic-forward.sh forwarding.sh sftp-batch.sh (all regress/)]
75 Add ${EXEEXT}: required to work on Cygwin.
76 - (dtucker) [regress/sftp-batch.sh] Make temporary batch file name more
77 distinctive, so "rm ${BATCH}.*" doesn't match the script itself.
78 - (dtucker) [regress/sftp-cmds.sh] Skip quoted file test on Cygwin.
79 - (dtucker) [openbsd-compat/xcrypt.c] #elsif -> #elif
80 - (dtucker) [acconfig.h] Typo.
81 - (dtucker) [CREDITS Makefile.in configure.ac mdoc2man.awk mdoc2man.pl]
82 Replace mdoc2man.pl with mdoc2man.awk, provided by Peter Stuge.
83
8420030906
85 - (dtucker) [acconfig.h configure.ac uidswap.c] Prefer setuid/setgid on AIX.
86
8720030905
88 - (dtucker) [Makefile.in] Add distclean target for regress/, fix clean target.
89
9020030904
91 - (dtucker) Portablize regression tests. Parts contributed by Roumen
92 Petrov, David M. Williams and Corinna Vinschen.
93 - [Makefile.in] Add "make tests" target and "make clean" hooks.
94 - [regress/agent-getpeereid.sh] Skip test on platforms that don't support
95 getpeereid.
96 - [regress/agent-ptrace.sh] Skip tests if platform doesn't support it or
97 gdb cannot be found.
98 - [regress/reconfigure/sh] Make path to sshd fully qualified if required.
99 - [regress/rekey.sh] Remove dependence on /dev/zero (not all platforms have
100 it). The sparse file will take less disk space too.
101 - [regress/sftp-cmds.sh] Ensure files used for test are readable.
102 - [regress/stderr-after-eof.sh] Search for a usable checksum program.
103 - [regress/sftp-badcmds.sh regress/sftp-cmds.sh regress/sftp.sh
104 regress/ssh-com-client.sh regress/ssh-com-sftp.sh regress/stderr-data.sh
105 regress/transfer.sh] Use ${EXEEXT} where appropriate.
106 - [regress/sftp.sh regress/ssh-com-sftp.sh] Remove dependency on /dev/stdin.
107 - [regress/agent-ptrace.sh regress/agent-timeout.sh]
108 "grep -q" -> "grep >/dev/null"
109 - [regress/agent.sh regress/proto-version.sh regress/ssh-com.sh
110 regress/test-exec.sh] Handle different ways of echoing without newlines.
111 - [regress/dynamic-forward.sh] Some "which" programs output on stderr.
112 - [regress/sftp-cmds.sh] Use portable "test" option.
113 - [regress/test-exec.sh] Use sudo, search for "whoami" equivalent, always
114 use Strictmodes no, wait longer for sshd startup.
115 - [regress/Makefile] Remove BSDisms.
116 - [regress/README.regress] Add a basic readme.
117 - [Makefile.in regress/agent-getpeereid.sh] config.h is now in $BUILDDIR
118 not $OBJ.
119 - [Makefile.in regress/agent-ptrace] Fix minor regress issues on Cygwin.
120
12120030903
122 - (djm) OpenBSD CVS Sync
123 - markus@cvs.openbsd.org 2003/08/26 09:58:43
124 [auth-passwd.c auth.c auth.h auth1.c auth2-none.c auth2-passwd.c]
125 [auth2.c monitor.c]
126 fix passwd auth for 'username leaks via timing'; with djm@, original
127 patches from solar
128 - markus@cvs.openbsd.org 2003/08/28 12:54:34
129 [auth.h]
130 remove kerberos support from ssh1, since it has been replaced with GSSAPI;
131 but keep kerberos passwd auth for ssh1 and 2; ok djm, hin, henning, ...
132 - markus@cvs.openbsd.org 2003/09/02 16:40:29
133 [version.h]
134 enter 3.7
135 - jmc@cvs.openbsd.org 2003/09/02 18:50:06
136 [sftp.1 ssh_config.5]
137 escape punctuation;
138 ok deraadt@
139
14020030902
141 - (djm) OpenBSD CVS Sync
142 - deraadt@cvs.openbsd.org 2003/08/24 17:36:51
143 [auth2-gss.c]
144 64 bit cleanups; markus ok
145 - markus@cvs.openbsd.org 2003/08/28 12:54:34
146 [auth-krb5.c auth.h auth1.c monitor.c monitor.h monitor_wrap.c]
147 [monitor_wrap.h readconf.c servconf.c session.c ssh_config.5]
148 [sshconnect1.c sshd.c sshd_config sshd_config.5]
149 remove kerberos support from ssh1, since it has been replaced with GSSAPI;
150 but keep kerberos passwd auth for ssh1 and 2; ok djm, hin, henning, ...
151 - markus@cvs.openbsd.org 2003/08/29 10:03:15
152 [compat.c compat.h]
153 SSH_BUG_K5USER is unused; ok henning@
154 - markus@cvs.openbsd.org 2003/08/29 10:04:36
155 [channels.c nchan.c]
156 be less chatty; debug -> debug2, cleanup; ok henning@
157 - markus@cvs.openbsd.org 2003/08/31 10:26:04
158 [progressmeter.c]
159 pass file_size + 1 to snprintf: fixes printing of truncated
160 file names; fix based on patch/report from sturm@;
161 - markus@cvs.openbsd.org 2003/08/31 12:14:22
162 [progressmeter.c]
163 do write to buf[-1]
164 - markus@cvs.openbsd.org 2003/08/31 13:29:05
165 [session.c]
166 call ssh_gssapi_storecreds conditionally from do_exec();
167 with sxw@inf.ed.ac.uk
168 - markus@cvs.openbsd.org 2003/08/31 13:30:18
169 [gss-serv.c]
170 correct string termination in parse_ename(); sxw@inf.ed.ac.uk
171 - markus@cvs.openbsd.org 2003/08/31 13:31:57
172 [gss-serv.c]
173 whitspace KNF
174 - markus@cvs.openbsd.org 2003/09/01 09:50:04
175 [sshd_config.5]
176 gss kex is not supported; sxw@inf.ed.ac.uk
177 - markus@cvs.openbsd.org 2003/09/01 12:50:46
178 [readconf.c]
179 rm gssapidelegatecreds alias; never supported before
180 - markus@cvs.openbsd.org 2003/09/01 13:52:18
181 [ssh.h]
182 rm whitespace
183 - markus@cvs.openbsd.org 2003/09/01 18:15:50
184 [readconf.c readconf.h servconf.c servconf.h ssh.c]
185 remove unused kerberos code; ok henning@
186 - markus@cvs.openbsd.org 2003/09/01 20:44:54
187 [auth2-gss.c]
188 fix leak
189 - (djm) Don't initialise pam_conv structures inline. Avoids HP/UX compiler
190 error. Part of Bug #423, patch from michael_steffens AT hp.com
191 - (djm) Bug #423: reorder setting of PAM_TTY and calling of PAM session
192 management (now done in do_setusercontext). Largely from
193 michael_steffens AT hp.com
194 - (djm) Fix openbsd-compat/ again - remove references to strl(cpy|cat).h
195
19620030829
197 - (bal) openbsd-compat/ clean up. Considate headers, add in Id on our
198 files, and added missing license to header.
199
20020030826
201 - (djm) Bug #629: Mark ssh_config option "pamauthenticationviakbdint"
202 as deprecated. Remove mention from README.privsep. Patch from
203 aet AT cc.hut.fi
204 - (dtucker) OpenBSD CVS Sync
205 - markus@cvs.openbsd.org 2003/08/22 10:56:09
206 [auth2.c auth2-gss.c auth.h compat.c compat.h gss-genr.c gss-serv-krb5.c
207 gss-serv.c monitor.c monitor.h monitor_wrap.c monitor_wrap.h readconf.c
208 readconf.h servconf.c servconf.h session.c session.h ssh-gss.h
209 ssh_config.5 sshconnect2.c sshd_config sshd_config.5]
210 support GSS API user authentication; patches from Simon Wilkinson,
211 stripped down and tested by Jakob and myself.
212 - markus@cvs.openbsd.org 2003/08/22 13:20:03
213 [sshconnect2.c]
214 remove support for "kerberos-2@ssh.com"
215 - markus@cvs.openbsd.org 2003/08/22 13:22:27
216 [auth2.c] (auth2-krb5.c removed)
217 nuke "kerberos-2@ssh.com"
218 - markus@cvs.openbsd.org 2003/08/22 20:55:06
219 [LICENCE]
220 add Simon Wilkinson
221 - deraadt@cvs.openbsd.org 2003/08/24 17:36:52
222 [monitor.c monitor_wrap.c sshconnect2.c]
223 64 bit cleanups; markus ok
224 - fgsch@cvs.openbsd.org 2003/08/25 08:13:09
225 [sftp-int.c]
226 fix div by zero when listing for filename lengths longer than width.
227 markus@ ok.
228 - djm@cvs.openbsd.org 2003/08/25 10:33:33
229 [sshconnect2.c]
230 fprintf->logit to silence login banner with "ssh -q"; ok markus@
231 - (dtucker) [Makefile.in acconfig.h auth-krb5.c auth-pam.c auth-pam.h
232 configure.ac defines.h gss-serv-krb5.c session.c ssh-gss.h sshconnect1.c
233 sshconnect2.c] Add Portable GSSAPI support, patch by Simon Wilkinson.
234 - (dtucker) [Makefile.in] Remove auth2-krb5.
235 - (dtucker) [contrib/aix/inventory.sh] Add public domain notice. ok mouring@
236 (the original author)
237 - (dtucker) [auth.c] Do not check for locked accounts when PAM is enabled.
238
23920030825
240 - (djm) Bug #621: Select OpenSC keys by usage attributes. Patch from
241 larsch@trustcenter.de
242 - (bal) openbsd-compat/ OpenBSD updates. Mostly licensing, ansifications
243 and minor fixes. OK djm@
244 - (bal) redo how we handle 'mysignal()'. Move it to
245 openbsd-compat/bsd-misc.c, s/mysignal/signal/ and #define signal to
246 be our 'mysignal' by default. OK djm@
247 - (dtucker) [acconfig.h auth.c configure.ac sshd.8] Bug #422 again: deny
248 any access to locked accounts. ok djm@
249 - (djm) Bug #564: Perform PAM account checks for all authentications when
250 UsePAM=yes; ok dtucker
251 - (dtucker) [configure.ac] Bug #533, #551: define BROKEN_GETADDRINFO on
252 Tru64, solves getnameinfo and "bad addr or host" errors. ok djm@
253 - (dtucker) [README buildbff.sh inventory.sh] (all in contrib/aix)
254 Update package builder: correctly handle config variables, use lsuser
255 rather than /etc/passwd, fix typos, add Id's.
256
25720030822
258 - (djm) s/get_progname/ssh_get_progname/g to avoid conflict with Heimdal
259 -lbroken; ok dtucker
260 - (dtucker) [contrib/cygwin/ssh-user-config] Put keys in authorized_keys
261 rather that authorized_keys2. Patch from vinschen@redhat.com.
262
26320030821
264 - (dtucker) OpenBSD CVS Sync
265 - markus@cvs.openbsd.org 2003/08/14 16:08:58
266 [ssh-keygen.c]
267 exit after primetest, ok djm@
268 - (dtucker) [defines.h] Put CMSG_DATA, CMSG_FIRSTHDR with other CMSG* macros,
269 change CMSG_DATA to use __CMSG_ALIGN (and thus work properly), reformat for
270 consistency.
271 - (dtucker) [configure.ac] Move openpty/ctty test outside of case statement
272 and after normal openpty test.
273
27420030813
275 - (dtucker) [session.c] Remove #ifdef TIOCSBRK kludge.
276 - (dtucker) OpenBSD CVS Sync
277 - markus@cvs.openbsd.org 2003/08/13 08:33:02
278 [session.c]
279 use more portable tcsendbreak(3) and ignore break_length;
280 ok deraadt, millert
281 - markus@cvs.openbsd.org 2003/08/13 08:46:31
282 [auth1.c readconf.c readconf.h servconf.c servconf.h ssh.c ssh_config
283 ssh_config.5 sshconnect1.c sshd.8 sshd.c sshd_config sshd_config.5]
284 remove RhostsAuthentication; suggested by djm@ before; ok djm@, deraadt@,
285 fgsch@, miod@, henning@, jakob@ and others
286 - markus@cvs.openbsd.org 2003/08/13 09:07:10
287 [readconf.c ssh.c]
288 socks4->socks, since with support both 4 and 5; dtucker@zip.com.au
289 - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
290 Add a tcsendbreak function for platforms that don't have one, based on the
291 one from OpenBSD.
292
29320030811
294 - (dtucker) OpenBSD CVS Sync
295 (thanks to Simon Wilkinson for help with this -dt)
296 - markus@cvs.openbsd.org 2003/07/16 15:02:06
297 [auth-krb5.c]
298 mcc -> fcc; from Love Hörnquist Åstrand <lha@it.su.se>
299 otherwise the kerberos credentinal is stored in a memory cache
300 in the privileged sshd. ok jabob@, hin@ (some time ago)
301 - (dtucker) [openbsd-compat/xcrypt.c] Remove Cygwin #ifdef block (duplicate
302 in bsd-cygwin_util.h).
303
30420030808
305 - (dtucker) [openbsd-compat/fake-rfc2553.h] Older Linuxes have AI_PASSIVE and
306 AI_CANONNAME in netdb.h but not AI_NUMERICHOST, so check each definition
307 separately before defining them.
308 - (dtucker) [auth-pam.c] Don't set PAM_TTY if tty is null. ok djm@
309
31020030807
311 - (dtucker) [session.c] Have session_break_req not attempt to send a break
312 if TIOCSBRK and TIOCCBRK are not defined (eg Cygwin).
313 - (dtucker) [canohost.c] Bug #336: Only check ip options if IP_OPTIONS is
314 defined (fixes compile error on really old Linuxes).
315 - (dtucker) [defines.h] Bug #336: Add CMSG_DATA and CMSG_FIRSTHDR macros if
316 not already defined (eg Linux with some versions of libc5), based on those
317 from OpenBSD.
318 - (dtucker) [openbsd-compat/bsd-cygwin_util.c openbsd-compat/bsd-cygwin_util.h]
319 Remove incorrect filenames from comments (file names are in Id tags).
320 - (dtucker) [session.c openbsd-compat/bsd-cygwin_util.h] Move Cygwin
321 specific defines and includes to bsd-cygwin_util.h. Fixes build error too.
322
32320030802
324 - (dtucker) [monitor.h monitor_wrap.h] Remove excess ident tags.
325 - (dtucker) OpenBSD CVS Sync
326 - markus@cvs.openbsd.org 2003/07/22 13:35:22
327 [auth1.c auth.h auth-passwd.c monitor.c monitor.h monitor_wrap.c
328 monitor_wrap.h readconf.c readconf.h servconf.c servconf.h session.c ssh.1
329 ssh.c ssh_config.5 sshconnect1.c sshd.c sshd_config.5 ssh.h]
330 remove (already disabled) KRB4/AFS support, re-enable -k in ssh(1);
331 test+ok henning@
332 - (dtucker) [Makefile.in acconfig.h configure.ac] Remove KRB4/AFS support.
333 - (dtucker) [auth-krb4.c radix.c radix.h] Remove KRB4/AFS specific files.
334 - (dtucker) OpenBSD CVS Sync
335 - markus@cvs.openbsd.org 2003/07/23 07:42:43
336 [sshd_config]
337 remove AFS; itojun@
338 - djm@cvs.openbsd.org 2003/07/28 09:49:56
339 [ssh-keygen.1 ssh-keygen.c]
340 Support for generating Diffie-Hellman groups (/etc/moduli) from ssh-keygen.
341 Based on code from Phil Karn, William Allen Simpson and Niels Provos.
342 ok markus@, thanks jmc@
343 - markus@cvs.openbsd.org 2003/07/29 18:24:00
344 [LICENCE progressmeter.c]
345 replace 4 clause BSD licensed progressmeter code with a replacement
346 from Nils Nordman and myself; ok deraadt@
347 (copied from OpenBSD an re-applied portable changes)
348 - markus@cvs.openbsd.org 2003/07/29 18:26:46
349 [progressmeter.c]
350 fix length for "- stalled -" (included with previous import)
351 - markus@cvs.openbsd.org 2003/07/30 07:44:14
352 [progressmeter.c]
353 use only 4 digits in format_size (included with previous import)
354 - markus@cvs.openbsd.org 2003/07/30 07:53:27
355 [progressmeter.c]
356 whitespace (included with previous import)
357 - markus@cvs.openbsd.org 2003/07/31 09:21:02
358 [auth2-none.c]
359 check whether passwd auth is allowd, similar to proto 1; rob@pitman.co.za
360 ok henning
361 - avsm@cvs.openbsd.org 2003/07/31 15:50:16
362 [atomicio.c]
363 correct comment: atomicio takes vwrite, not write; deraadt@ ok
364 - markus@cvs.openbsd.org 2003/07/31 22:34:03
365 [progressmeter.c]
366 print rate similar old version; round instead truncate;
367 (included in previous progressmeter.c commit)
368 - (dtucker) [openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
369 Add a tcgetpgrp function.
370 - (dtucker) [Makefile.in moduli.c moduli.h] Add new files and to Makefile.
371 - (dtucker) [openbsd-compat/bsd-misc.c] Fix cut-and-paste bug in tcgetpgrp.
372
37320030730
374 - (djm) [auth-pam.c] Don't use crappy APIs like sprintf. Thanks bal
375
37620030726
377 - (dtucker) [openbsd-compat/xcrypt.c] Fix typo: DISABLED_SHADOW ->
378 DISABLE_SHADOW. Fixes HP-UX compile error.
379
38020030724
381 - (bal) [auth-passwd.c openbsd-compat/Makefile.in openbsd-compat/xcrypt.c
382 openbsd-compat/xcrypt.h] Split off encryption into xcrypt() interface,
383 and isolate shadow password functions. Tested in Solaris, but should
384 not break other platforms too badly (except maybe HP =). Also brings
385 auth-passwd.c into full sync with OpenBSD tree.
386
38720030723
388 - (dtucker) [configure.ac] Back out change for bug #620.
389
39020030719
391 - (dtucker) [configure.ac] Bug #620: Define BROKEN_GETADDRINFO for
392 Solaris/x86. Patch from jrhett at isite.net.
393 - (dtucker) OpenBSD CVS Sync
394 - markus@cvs.openbsd.org 2003/07/14 12:36:37
395 [sshd.c]
396 remove undocumented -V option. would be only useful if openssh is used
397 as ssh v1 server for ssh.com's ssh v2.
398 - markus@cvs.openbsd.org 2003/07/16 10:34:53
399 [ssh.c sshd.c]
400 don't exit on multiple -v or -d; ok deraadt@
401 - markus@cvs.openbsd.org 2003/07/16 10:36:28
402 [sshtty.c]
403 clear IUCLC in enter_raw_mode; from rob@pitman.co.za; ok deraadt@, fgs@
404 - deraadt@cvs.openbsd.org 2003/07/18 01:54:25
405 [scp.c]
406 userid is unsigned, but well, force it anyways; andrushock@korovino.net
407 - djm@cvs.openbsd.org 2003/07/19 00:45:53
408 [sftp-int.c]
409 fix sftp filename parsing for arguments with escaped quotes. bz #517;
410 ok markus
411 - djm@cvs.openbsd.org 2003/07/19 00:46:31
412 [regress/sftp-cmds.sh]
413 regress test for sftp arguments with escaped quotes; ok markus
414
41520030714
416 - (dtucker) [acconfig.h configure.ac port-aix.c] Older AIXes don't declare
417 loginfailed at all, so assume 3-arg loginfailed if not declared.
418 - (dtucker) [port-aix.h] Work around name collision on AIX for r_type by
419 undef'ing it.
420 - (dtucker) Bug #543: [configure.ac port-aix.c port-aix.h]
421 Call setauthdb() before loginfailed(), which may load password registry-
422 specific functions. Based on patch by cawlfiel at us.ibm.com.
423 - (dtucker) [port-aix.h] Fix prototypes.
424 - (dtucker) OpenBSD CVS Sync
425 - avsm@cvs.openbsd.org 2003/07/09 13:58:19
426 [key.c]
427 minor tweak: when generating the hex fingerprint, give strlcat the full
428 bound to the buffer, and add a comment below explaining why the
429 zero-termination is one less than the bound. markus@ ok
430 - markus@cvs.openbsd.org 2003/07/10 14:42:28
431 [packet.c]
432 the 2^(blocksize*2) rekeying limit is too expensive for 3DES,
433 blowfish, etc, so enforce a 1GB limit for small blocksizes.
434 - markus@cvs.openbsd.org 2003/07/10 20:05:55
435 [sftp.c]
436 sync usage with manpage, add missing -R
437
43820030708
439 - (dtucker) [acconfig.h auth-passwd.c configure.ac session.c port-aix.[ch]]
440 Include AIX headers for authentication functions and make calls match
441 prototypes. Test for and handle 3-arg and 4-arg variants of loginfailed.
442 - (dtucker) [session.c] Check return value of setpcred().
443 - (dtucker) [auth-passwd.c auth.c session.c sshd.c port-aix.c port-aix.h]
444 Convert aixloginmsg into platform-independant Buffer loginmsg.
445
44620030707
447 - (dtucker) [configure.ac] Bug #600: Check that getrusage is declared before
448 searching libraries for it. Fixes build errors on NCR MP-RAS.
449
45020030706
451 - (dtucker) [ssh-rand-helper.c loginrec.c]
452 Apply atomicio typing change to these too.
453
45420030703
455 - (dtucker) OpenBSD CVS Sync
456 - djm@cvs.openbsd.org 2003/06/28 07:48:10
457 [sshd.c]
458 report pidfile creation errors, based on patch from Roumen Petrov;
459 ok markus@
460 - deraadt@cvs.openbsd.org 2003/06/28 16:23:06
461 [atomicio.c atomicio.h authfd.c clientloop.c monitor_wrap.c msg.c
462 progressmeter.c scp.c sftp-client.c ssh-keyscan.c ssh.h sshconnect.c
463 sshd.c]
464 deal with typing of write vs read in atomicio
465 - markus@cvs.openbsd.org 2003/06/29 12:44:38
466 [sshconnect.c]
467 memset 0, not \0; andrushock@korovino.net
468 - markus@cvs.openbsd.org 2003/07/02 12:56:34
469 [channels.c]
470 deny dynamic forwarding with -R for v1, too; ok djm@
471 - markus@cvs.openbsd.org 2003/07/02 14:51:16
472 [channels.c ssh.1 ssh_config.5]
473 (re)add socks5 suppport to -D; ok djm@
474 now ssh(1) can act both as a socks 4 and socks 5 server and
475 dynamically forward ports.
476 - markus@cvs.openbsd.org 2003/07/02 20:37:48
477 [ssh.c]
478 convert hostkeyalias to lowercase, otherwise uppercase aliases will
479 not match at all; ok henning@
480 - markus@cvs.openbsd.org 2003/07/03 08:21:46
481 [regress/dynamic-forward.sh]
482 add socks5; speedup; reformat; based on patch from dtucker@zip.com.au
483 - markus@cvs.openbsd.org 2003/07/03 08:24:13
484 [regress/Makefile]
485 enable tests for dynamic fwd via socks (-D), uses nc(1)
486 - djm@cvs.openbsd.org 2003/07/03 08:09:06
487 [readconf.c readconf.h ssh-keysign.c ssh.c]
488 fix AddressFamily option in config file, from brent@graveland.net;
489 ok markus@
490
49120030630
492 - (djm) Search for support functions necessary to build our
493 getrrsetbyname() replacement. Patch from Roumen Petrov
494
49520030629
496 - (dtucker) [includes.h] Bug #602: move #include of netdb.h to after in.h
497 (fixes compiler warnings on Solaris 2.5.1).
498 - (dtucker) [configure.ac] Add sanity test after system-dependant compiler
499 flag modifications.
500
50120030628
502 - (djm) Bug #591: use PKCS#15 private key label as a comment in case
503 of OpenSC. Report and patch from larsch@trustcenter.de
504 - (djm) Bug #593: Sanity check OpenSC card reader number; patch from
505 aj@dungeon.inka.de
506 - (dtucker) OpenBSD CVS Sync
507 - markus@cvs.openbsd.org 2003/06/23 09:02:44
508 [ssh_config.5]
509 document EnableSSHKeysign; bugzilla #599; ok deraadt@, jmc@
510 - markus@cvs.openbsd.org 2003/06/24 08:23:46
511 [auth2-hostbased.c auth2-pubkey.c auth2.c channels.c key.c key.h
512 monitor.c packet.c packet.h serverloop.c sshconnect2.c sshd.c]
513 int -> u_int; ok djm@, deraadt@, mouring@
514 - miod@cvs.openbsd.org 2003/06/25 22:39:36
515 [sftp-server.c]
516 Typo police: attribute is better written with an 'r'.
517 - markus@cvs.openbsd.org 2003/06/26 20:08:33
518 [readconf.c]
519 do not dump core for 'ssh -o proxycommand host'; ok deraadt@
520 - (dtucker) [regress/dynamic-forward.sh] Import new regression test.
521 - (dtucker) [configure.ac] Bug #570: Have ./configure --enable-FEATURE
522 actually enable the feature, for those normally disabled. Patch by
523 openssh (at) roumenpetrov.info.
524
52520030624
526 - (dtucker) Have configure refer the user to config.log and
527 contrib/findssl.sh for OpenSSL header/library mismatches.
528
52920030622
530 - (dtucker) OpenBSD CVS Sync
531 - markus@cvs.openbsd.org 2003/06/21 09:14:05
532 [regress/reconfigure.sh]
533 missing $SUDO; from dtucker@zip.com.au
534 - markus@cvs.openbsd.org 2003/06/18 11:28:11
535 [ssh-rsa.c]
536 backout last change, since it violates pkcs#1
537 switch to share/misc/license.template
538 - djm@cvs.openbsd.org 2003/06/20 05:47:58
539 [sshd_config.5]
540 sync description of protocol 2 cipher proposal; ok markus
541 - djm@cvs.openbsd.org 2003/06/20 05:48:21
542 [sshd_config]
543 sync some implemented options; ok markus@
544 - (dtucker) [regress/authorized_keys_root] Remove temp data file from CVS.
545 - (dtucker) [openbsd-compat/setproctitle.c] Ensure SPT_TYPE is defined before
546 testing its value.
547
54820030618
549 - (djm) OpenBSD CVS Sync
550 - markus@cvs.openbsd.org 2003/06/12 07:57:38
551 [monitor.c sshlogin.c sshpty.c]
552 typos; dtucker at zip.com.au
553 - djm@cvs.openbsd.org 2003/06/12 12:22:47
554 [LICENCE]
555 mention more copyright holders; ok markus@
556 - nino@cvs.openbsd.org 2003/06/12 15:34:09
557 [scp.c]
558 Typo. Ok markus@.
559 - markus@cvs.openbsd.org 2003/06/12 19:12:03
560 [scard.c scard.h ssh-agent.c ssh.c]
561 add sc_get_key_label; larsch at trustcenter.de; bugzilla#591
562 - markus@cvs.openbsd.org 2003/06/16 08:22:35
563 [ssh-rsa.c]
564 make sure the signature has at least the expected length (don't
565 insist on len == hlen + oidlen, since this breaks some smartcards)
566 bugzilla #592; ok djm@
567 - markus@cvs.openbsd.org 2003/06/16 10:22:45
568 [ssh-add.c]
569 print out key comment on each prompt; make ssh-askpass more useable; ok djm@
570 - markus@cvs.openbsd.org 2003/06/17 18:14:23
571 [cipher-ctr.c]
572 use license from /usr/share/misc/license.template for new code
573 - (dtucker) [reconfigure.sh rekey.sh sftp-badcmds.sh]
574 Import new regression tests from OpenBSD
575 - (dtucker) [regress/copy.1 regress/copy.2] Remove temp data files from CVS.
576 - (dtucker) OpenBSD CVS Sync (regress/)
577 - markus@cvs.openbsd.org 2003/04/02 12:21:13
578 [Makefile]
579 enable rekey test
580 - djm@cvs.openbsd.org 2003/04/04 09:34:22
581 [Makefile sftp-cmds.sh]
582 More regression tests, including recent directory rename bug; ok markus@
583 - markus@cvs.openbsd.org 2003/05/14 22:08:27
584 [ssh-com-client.sh ssh-com-keygen.sh ssh-com-sftp.sh ssh-com.sh]
585 test against some new commerical versions
586 - mouring@cvs.openbsd.org 2003/05/15 04:07:12
587 [sftp-cmds.sh]
588 Advanced put/get testing for sftp. OK @djm
589 - markus@cvs.openbsd.org 2003/06/12 15:40:01
590 [try-ciphers.sh]
591 add ctr
592 - markus@cvs.openbsd.org 2003/06/12 15:43:32
593 [Makefile]
594 test -HUP; dtucker at zip.com.au
595
59620030614
597 - (djm) Update license on fake-rfc2553.[ch]; ok itojun@
598
59920030611
600 - (djm) Mention portable copyright holders in LICENSE
601 - (djm) Put licenses on substantial header files
602 - (djm) Sync LICENSE against OpenBSD
603 - (djm) OpenBSD CVS Sync
604 - jmc@cvs.openbsd.org 2003/06/10 09:12:11
605 [scp.1 sftp-server.8 ssh.1 ssh-add.1 ssh-agent.1 ssh_config.5]
606 [sshd.8 sshd_config.5 ssh-keygen.1 ssh-keyscan.1 ssh-keysign.8]
607 - section reorder
608 - COMPATIBILITY merge
609 - macro cleanup
610 - kill whitespace at EOL
611 - new sentence, new line
612 ssh pages ok markus@
613 - deraadt@cvs.openbsd.org 2003/06/10 22:20:52
614 [packet.c progressmeter.c]
615 mostly ansi cleanup; pval ok
616 - jakob@cvs.openbsd.org 2003/06/11 10:16:16
617 [sshconnect.c]
618 clean up check_host_key() and improve SSHFP feedback. ok markus@
619 - jakob@cvs.openbsd.org 2003/06/11 10:18:47
620 [dns.c]
621 sync with check_host_key() change
622 - djm@cvs.openbsd.org 2003/06/11 11:18:38
623 [authfd.c authfd.h ssh-add.c ssh-agent.c]
624 make agent constraints (lifetime, confirm) work with smartcard keys;
625 ok markus@
626
627
62820030609
629 - (djm) Sync README.smartcard with OpenBSD -current
630 - (djm) Re-merge OpenSC info into README.smartcard
631
63220030606
633 - (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@
634
63520030605
636 - (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent
637 canohost.c changes.
638 - (djm) Implement paranoid priv dropping checks, based on:
639 "SetUID demystified" - Hao Chen, David Wagner and Drew Dean
640 Proceedings of USENIX Security Symposium 2002
641 - (djm) Don't use xmalloc() or pull in toplevel headers in fake-* code
642 - (djm) Merge all the openbsd/fake-* into fake-rfc2553.[ch]
643 - (djm) Bug #588 - Add scard-opensc.o back to Makefile.in
644 Patch from larsch@trustcenter.de
645 - (djm) Bug #589 - scard-opensc: load only keys with a private keys
646 Patch from larsch@trustcenter.de
647 - (dtucker) Add includes.h to fake-rfc2553.c so it will build.
648 - (dtucker) Define EAI_NONAME in fake-rfc2553.h (used by fake-rfc2553.c).
649
65020030604
651 - (djm) Bug #573 - Remove unneeded Krb headers and compat goop. Patch from
652 simon@sxw.org.uk (Also matches a change in OpenBSD a while ago)
653 - (djm) Bug #577 - wrong flag in scard-opensc.c sc_private_decrypt.
654 Patch from larsch@trustcenter.de; ok markus@
655 - (djm) Bug #584: scard-opensc.c doesn't work without PIN. Patch from
656 larsch@trustcenter.de; ok markus@
657 - (djm) OpenBSD CVS Sync
658 - djm@cvs.openbsd.org 2003/06/04 08:25:18
659 [sshconnect.c]
660 disable challenge/response and keyboard-interactive auth methods
661 upon hostkey mismatch. based on patch from fcusack AT fcusack.com.
662 bz #580; ok markus@
663 - djm@cvs.openbsd.org 2003/06/04 10:23:48
664 [sshd.c]
665 remove duplicated group-dropping code; ok markus@
666 - djm@cvs.openbsd.org 2003/06/04 12:03:59
667 [serverloop.c]
668 remove bitrotten commet; ok markus@
669 - djm@cvs.openbsd.org 2003/06/04 12:18:49
670 [scp.c]
671 ansify; ok markus@
672 - djm@cvs.openbsd.org 2003/06/04 12:40:39
673 [scp.c]
674 kill ssh process upon receipt of signal, bz #241.
675 based on patch from esb AT hawaii.edu; ok markus@
676 - djm@cvs.openbsd.org 2003/06/04 12:41:22
677 [sftp.c]
678 kill ssh process on receipt of signal; ok markus@
679 - (djm) Update to fix of bug #584: lock card before return.
680 From larsch@trustcenter.de
681 - (djm) Always use mysignal() for SIGALRM
682
68320030603
684 - (djm) Replace setproctitle replacement with code derived from
685 UCB sendmail
686 - (djm) OpenBSD CVS Sync
687 - markus@cvs.openbsd.org 2003/06/02 09:17:34
688 [auth2-hostbased.c auth.c auth-options.c auth-rhosts.c auth-rh-rsa.c]
689 [canohost.c monitor.c servconf.c servconf.h session.c sshd_config]
690 [sshd_config.5]
691 deprecate VerifyReverseMapping since it's dangerous if combined
692 with IP based access control as noted by Mike Harding; replace with
693 a UseDNS option, UseDNS is on by default and includes the
694 VerifyReverseMapping check; with itojun@, provos@, jakob@ and deraadt@
695 ok deraadt@, djm@
696 - millert@cvs.openbsd.org 2003/06/03 02:56:16
697 [scp.c]
698 Remove the advertising clause in the UCB license which Berkeley
699 rescinded 22 July 1999. Proofed by myself and Theo.
700 - (djm) Fix portable-specific uses of verify_reverse_mapping too
701 - (djm) Sync openbsd-compat with OpenBSD CVS.
702 - No more 4-term BSD licenses in linked code
703 - (dtucker) [port-aix.c bsd-cray.c] Fix uses of verify_reverse_mapping.
704
70520030602
706 - (djm) Fix segv from bad reordering in auth-pam.c
707 - (djm) Always use saved_argv in sshd.c as compat_init_setproctitle may
708 clobber
709 - (tim) openbsd-compat/xmmap.[ch] License clarifications. Add missing
710 CVS ID.
711 - (djm) Remove "noip6" option from RedHat spec file. This may now be
712 set at runtime using AddressFamily option.
713 - (djm) Fix use of macro before #define in cipher-aes.c
714 - (djm) Sync license on openbsd-compat/bindresvport.c with OpenBSD CVS
715 - (djm) OpenBSD CVS Sync
716 - djm@cvs.openbsd.org 2003/05/26 12:54:40
717 [sshconnect.c]
718 fix format strings; ok markus@
719 - deraadt@cvs.openbsd.org 2003/05/29 16:58:45
720 [sshd.c uidswap.c]
721 seteuid and setegid; markus ok
722 - jakob@cvs.openbsd.org 2003/06/02 08:31:10
723 [ssh_config.5]
724 VerifyHostKeyDNS is v2 only. ok markus@
725
72620030530
727 - (dtucker) Add missing semicolon in md5crypt.c, patch from openssh at
728 roumenpetrov.info
729 - (dtucker) Define SSHD_ACQUIRES_CTTY for NCR MP-RAS and Reliant Unix.
730
73120030526
732 - (djm) Avoid auth2-chall.c warning when compiling without
733 PAM, BSD_AUTH and SKEY
734
73520030525
736- (djm) OpenBSD CVS Sync
737 - djm@cvs.openbsd.org 2003/05/24 09:02:22
738 [log.c]
739 pass logged data through strnvis; ok markus
740 - djm@cvs.openbsd.org 2003/05/24 09:30:40
741 [authfile.c monitor.c sftp-common.c sshpty.c]
742 cast some types for printing; ok markus@
743
74420030524
745 - (dtucker) Correct --osfsia in INSTALL. Patch by skeleten at shillest.net
746
74720030523
748 - (djm) Use VIS_SAFE on logged strings rather than default strnvis
749 encoding (which encodes many more characters)
750 - OpenBSD CVS Sync
751 - jmc@cvs.openbsd.org 2003/05/20 12:03:35
752 [sftp.1]
753 - new sentence, new line
754 - added .Xr's
755 - typos
756 ok djm@
757 - jmc@cvs.openbsd.org 2003/05/20 12:09:31
758 [ssh.1 ssh_config.5 sshd.8 sshd_config.5 ssh-keygen.1]
759 new sentence, new line
760 - djm@cvs.openbsd.org 2003/05/23 08:29:30
761 [sshconnect.c]
762 fix leak; ok markus@
763
76420030520
765 - (djm) OpenBSD CVS Sync
766 - deraadt@cvs.openbsd.org 2003/05/18 23:22:01
767 [log.c]
768 use syslog_r() in a signal handler called place; markus ok
769 - (djm) Configure logic to detect syslog_r and friends
770
77120030519
772 - (djm) Sync auth-pam.h with what we actually implement
773
77420030518
775 - (djm) Return of the dreaded PAM_TTY_KLUDGE, which went missing in
776 recent merge
777 - (djm) OpenBSD CVS Sync
778 - djm@cvs.openbsd.org 2003/05/16 03:27:12
779 [readconf.c ssh_config ssh_config.5 ssh-keysign.c]
780 add AddressFamily option to ssh_config (like -4, -6 on commandline).
781 Portable bug #534; ok markus@
782 - itojun@cvs.openbsd.org 2003/05/17 03:25:58
783 [auth-rhosts.c]
784 just in case, put numbers to sscanf %s arg.
785 - markus@cvs.openbsd.org 2003/05/17 04:27:52
786 [cipher.c cipher-ctr.c myproposal.h]
787 experimental support for aes-ctr modes from
788 http://www.ietf.org/internet-drafts/draft-ietf-secsh-newmodes-00.txt
789 ok djm@
790 - (djm) Remove IPv4 by default hack now that we can specify AF in config
791 - (djm) Tidy and trim TODO
792 - (djm) Sync openbsd-compat/ with OpenBSD CVS head
793 - (djm) Big KNF on openbsd-compat/
794 - (djm) KNF on md5crypt.[ch]
795 - (djm) KNF on auth-sia.[ch]
796
79720030517
798 - (bal) strcat -> strlcat on openbsd-compat/realpath.c (rev 1.8 OpenBSD)
799
80020030516
801 - (djm) OpenBSD CVS Sync
802 - djm@cvs.openbsd.org 2003/05/15 13:52:10
803 [ssh.c]
804 Make "ssh -V" print the OpenSSL version in a human readable form. Patch
805 from Craig Leres (mindrot at ee.lbl.gov); ok markus@
806 - jakob@cvs.openbsd.org 2003/05/15 14:02:47
807 [readconf.c servconf.c]
808 warn for unsupported config option. ok markus@
809 - markus@cvs.openbsd.org 2003/05/15 14:09:21
810 [auth2-krb5.c]
811 fix 64bit issue; report itojun@
812 - djm@cvs.openbsd.org 2003/05/15 14:55:25
813 [readconf.c readconf.h ssh_config ssh_config.5 sshconnect.c]
814 add a ConnectTimeout option to ssh, based on patch from
815 Jean-Charles Longuet (jclonguet at free.fr); portable #207 ok markus@
816 - (djm) Add warning for UsePAM when built without PAM support
817 - (djm) A few type mismatch fixes from Bug #565
818 - (djm) Guard free_pam_environment against NULL argument. Works around
819 HP/UX PAM problems debugged by dtucker
820
82120030515
822 - (djm) OpenBSD CVS Sync
823 - jmc@cvs.openbsd.org 2003/05/14 13:11:56
824 [ssh-agent.1]
825 setup -> set up;
826 from wiz@netbsd
827 - jakob@cvs.openbsd.org 2003/05/14 18:16:20
828 [key.c key.h readconf.c readconf.h ssh_config.5 sshconnect.c]
829 [dns.c dns.h README.dns ssh-keygen.1 ssh-keygen.c]
830 add experimental support for verifying hos keys using DNS as described
831 in draft-ietf-secsh-dns-xx.txt. more information in README.dns.
832 ok markus@ and henning@
833 - markus@cvs.openbsd.org 2003/05/14 22:24:42
834 [clientloop.c session.c ssh.1]
835 allow to send a BREAK to the remote system; ok various
836 - markus@cvs.openbsd.org 2003/05/15 00:28:28
837 [sshconnect2.c]
838 cleanup unregister of per-method packet handlers; ok djm@
839 - jakob@cvs.openbsd.org 2003/05/15 01:48:10
840 [readconf.c readconf.h servconf.c servconf.h]
841 always parse kerberos options. ok djm@ markus@
842 - jakob@cvs.openbsd.org 2003/05/15 02:27:15
843 [dns.c]
844 add missing freerrset
845 - markus@cvs.openbsd.org 2003/05/15 03:08:29
846 [cipher.c cipher-bf1.c cipher-aes.c cipher-3des1.c]
847 split out custom EVP ciphers
848 - djm@cvs.openbsd.org 2003/05/15 03:10:52
849 [ssh-keygen.c]
850 avoid warning; ok jakob@
851 - mouring@cvs.openbsd.org 2003/05/15 03:39:07
852 [sftp-int.c]
853 Make put/get (globed and nonglobed) code more consistant. OK djm@
854 - mouring@cvs.openbsd.org 2003/05/15 03:43:59
855 [sftp-int.c sftp.c]
856 Teach ls how to display multiple column display and allow users
857 to return to single column format via 'ls -1'. OK @djm
858 - jakob@cvs.openbsd.org 2003/05/15 04:08:44
859 [readconf.c servconf.c]
860 disable kerberos when not supported. ok markus@
861 - markus@cvs.openbsd.org 2003/05/15 04:08:41
862 [ssh.1]
863 ~B is ssh2 only
864 - (djm) Always parse UsePAM
865 - (djm) Configure glue for DNS support (code doesn't work in portable yet)
866 - (djm) Import getrrsetbyname() function from OpenBSD libc (for DNS support)
867 - (djm) Tidy Makefile clean targets
868 - (djm) Adapt README.dns for portable
869 - (djm) Avoid uuencode.c warnings
870 - (djm) Enable UsePAM when built --with-pam
871 - (djm) Only build getrrsetbyname replacement when using --with-dns
872 - (djm) Bug #529: sshd doesn't work correctly after SIGHUP (copy argv
873 correctly)
874 - (djm) Bug #444: Wrong paths after reconfigure
875 - (dtucker) HP-UX needs to include <sys/strtio.h> for TIOCSBRK
876
87720030514
878 - (djm) Bug #117: Don't lie to PAM about username
879 - (djm) RCSID sync w/ OpenBSD
880 - (djm) OpenBSD CVS Sync
881 - djm@cvs.openbsd.org 2003/04/09 12:00:37
882 [readconf.c]
883 strip trailing whitespace from config lines before parsing.
884 Fixes bz 528; ok markus@
885 - markus@cvs.openbsd.org 2003/04/12 10:13:57
886 [cipher.c]
887 hide cipher details; ok djm@
888 - markus@cvs.openbsd.org 2003/04/12 10:15:36
889 [misc.c]
890 debug->debug2
891 - naddy@cvs.openbsd.org 2003/04/12 11:40:15
892 [ssh.1]
893 document -V switch, fix wording; ok markus@
894 - markus@cvs.openbsd.org 2003/04/14 14:17:50
895 [channels.c sshconnect.c sshd.c ssh-keyscan.c]
896 avoid hardcoded SOCK_xx; with itojun@; should allow ssh over SCTP
897 - mouring@cvs.openbsd.org 2003/04/14 21:31:27
898 [sftp-int.c]
899 Missing globfree(&g) in process_put() spotted by Vince Brimhall
900 <VBrimhall@novell.com>. ok@ Theo
901 - markus@cvs.openbsd.org 2003/04/16 14:35:27
902 [auth.h]
903 document struct Authctxt; with solar
904 - deraadt@cvs.openbsd.org 2003/04/26 04:29:49
905 [ssh-keyscan.c]
906 -t in usage(); rogier@quaak.org
907 - mouring@cvs.openbsd.org 2003/04/30 01:16:20
908 [sshd.8 sshd_config.5]
909 Escape ?, * and ! in .Ql for nroff compatibility. OpenSSH Portable
910 Bug #550 and * escaping suggested by jmc@.
911 - david@cvs.openbsd.org 2003/04/30 20:41:07
912 [sshd.8]
913 fix invalid .Pf macro usage introduced in previous commit
914 ok jmc@ mouring@
915 - markus@cvs.openbsd.org 2003/05/11 16:56:48
916 [authfile.c ssh-keygen.c]
917 change key_load_public to try to read a public from:
918 rsa1 private or rsa1 public and ssh2 keys.
919 this makes ssh-keygen -e fail for ssh1 keys more gracefully
920 for example; report from itojun (netbsd pr 20550).
921 - markus@cvs.openbsd.org 2003/05/11 20:30:25
922 [channels.c clientloop.c serverloop.c session.c ssh.c]
923 make channel_new() strdup the 'remote_name' (not the caller); ok theo
924 - markus@cvs.openbsd.org 2003/05/12 16:55:37
925 [sshconnect2.c]
926 for pubkey authentication try the user keys in the following order:
927 1. agent keys that are found in the config file
928 2. other agent keys
929 3. keys that are only listed in the config file
930 this helps when an agent has many keys, where the server might
931 close the connection before the correct key is used. report & ok pb@
932 - markus@cvs.openbsd.org 2003/05/12 18:35:18
933 [ssh-keyscan.1]
934 typo: DSA keys are of type ssh-dss; Brian Poole
935 - markus@cvs.openbsd.org 2003/05/14 00:52:59
936 [ssh2.h]
937 ranges for per auth method messages
938 - djm@cvs.openbsd.org 2003/05/14 01:00:44
939 [sftp.1]
940 emphasise the batchmode functionality and make reference to pubkey auth,
941 both of which are FAQs; ok markus@
942 - markus@cvs.openbsd.org 2003/05/14 02:15:47
943 [auth2.c monitor.c sshconnect2.c auth2-krb5.c]
944 implement kerberos over ssh2 ("kerberos-2@ssh.com"); tested with jakob@
945 server interops with commercial client; ok jakob@ djm@
946 - jmc@cvs.openbsd.org 2003/05/14 08:25:39
947 [sftp.1]
948 - better formatting in SYNOPSIS
949 - whitespace at EOL
950 ok djm@
951 - markus@cvs.openbsd.org 2003/05/14 08:57:49
952 [monitor.c]
953 http://bugzilla.mindrot.org/show_bug.cgi?id=560
954 Privsep child continues to run after monitor killed.
955 Pass monitor signals through to child; Darren Tucker
956 - (djm) Make portable build with MIT krb5 (some issues remain)
957 - (djm) Add new UsePAM configuration directive to allow runtime control
958 over usage of PAM. This allows non-root use of sshd when built with
959 --with-pam
960 - (djm) Die screaming if start_pam() is called when UsePAM=no
961 - (djm) Avoid KrbV leak for MIT Kerberos
962 - (dtucker) Set ai_socktype and ai_protocol in fake-getaddrinfo.c. ok djm@
963 - (djm) Bug #258: sscanf("[0-9]") -> sscanf("[0123456789]") for portability
964
96520030512
966 - (djm) Redhat spec: Don't install profile.d scripts when not
967 building with GNOME/GTK askpass (patch from bet@rahul.net)
968
96920030510
970 - (dtucker) Bug #318: Create ssh_prng_cmds.out during "make" rather than
971 "make install". Patch by roth@feep.net.
972 - (dtucker) Bug #536: Test for and work around openpty/controlling tty
973 problem on Linux (fixes "could not set controlling tty" errors).
974 - (djm) Merge FreeBSD PAM code: replaces PAM password auth kludge with
975 proper challenge-response module
976 - (djm) 2-clause license on loginrec.c, with permission from
977 andre@ae-35.com
978
97920030504
980 - (dtucker) Bug #497: Move #include of bsd-cygwin_util.h to openbsd-compat.h.
981 Patch from vinschen@redhat.com.
982
98320030503
984 - (dtucker) Add missing "void" to record_failed_login in bsd-cray.c. Noted
985 by wendyp@cray.com.
986
98720030502
988 - (dtucker) Bug #544: ignore invalid cmsg_type on Linux 2.0 kernels,
989 privsep should now work.
990 - (dtucker) Move handling of bad password authentications into a platform
991 specific record_failed_login() function (affects AIX & Unicos). ok mouring@
992
120030429 99320030429
2 - (djm) Add back radix.o (used by AFS support), after it went missing from 994 - (djm) Add back radix.o (used by AFS support), after it went missing from
3 Makefile many moons ago 995 Makefile many moons ago
@@ -5,6 +997,60 @@
5 - (djm) Fix blibpath specification for AIX/gcc 997 - (djm) Fix blibpath specification for AIX/gcc
6 - (djm) Some systems have basename in -lgen. Fix from ayamura@ayamura.org 998 - (djm) Some systems have basename in -lgen. Fix from ayamura@ayamura.org
7 999
100020030428
1001 - (bal) [defines.h progressmeter.c scp.c] Some more culling of non 64bit
1002 hacked code.
1003
100420030427
1005 - (bal) Bug #541: return; was dropped by mistake. Reported by
1006 furrier@iglou.com
1007 - (bal) Since we don't support platforms lacking u_int_64. We may
1008 as well clean out some of those evil #ifdefs
1009 - (bal) auth1.c minor resync while looking at the code.
1010 - (bal) auth2.c same changed as above.
1011
101220030409
1013 - (djm) Bug #539: Specify creation mode with O_CREAT for lastlog. Report
1014 from matth@eecs.berkeley.edu
1015 - (djm) Make the spec work with Redhat 9.0 (which renames sharutils)
1016 - (djm) OpenBSD CVS Sync
1017 - markus@cvs.openbsd.org 2003/04/02 09:48:07
1018 [clientloop.c monitor.c monitor_wrap.c packet.c packet.h readconf.c]
1019 [readconf.h serverloop.c sshconnect2.c]
1020 reapply rekeying chage, tested by henning@, ok djm@
1021 - markus@cvs.openbsd.org 2003/04/02 14:36:26
1022 [ssh-keysign.c]
1023 potential segfault if KEY_UNSPEC; cjwatson@debian.org; bug #526
1024 - itojun@cvs.openbsd.org 2003/04/03 07:25:27
1025 [progressmeter.c]
1026 $OpenBSD$
1027 - itojun@cvs.openbsd.org 2003/04/03 10:17:35
1028 [progressmeter.c]
1029 remove $OpenBSD$, as other *.c does not have it.
1030 - markus@cvs.openbsd.org 2003/04/07 08:29:57
1031 [monitor_wrap.c]
1032 typo: get correct counters; introduced during rekeying change.
1033 - millert@cvs.openbsd.org 2003/04/07 21:58:05
1034 [progressmeter.c]
1035 The UCB copyright here is incorrect. This code did not originate
1036 at UCB, it was written by Luke Mewburn. Updated the copyright at
1037 the author's request. markus@ OK
1038 - itojun@cvs.openbsd.org 2003/04/08 20:21:29
1039 [*.c *.h]
1040 rename log() into logit() to avoid name conflict. markus ok, from
1041 netbsd
1042 - (djm) XXX - Performed locally using:
1043 "perl -p -i -e 's/(\s|^)log\(/$1logit\(/g' *.c *.h"
1044 - hin@cvs.openbsd.org 2003/04/09 08:23:52
1045 [servconf.c]
1046 Don't include <krb.h> when compiling with Kerberos 5 support
1047 - (djm) Fix up missing include for packet.c
1048 - (djm) Fix missed log => logit occurance (reference by function pointer)
1049
105020030402
1051 - (bal) if IP_TOS is not found or broken don't try to compile in
1052 packet_set_tos() function call. bug #527
1053
820030401 105420030401
9 - (djm) OpenBSD CVS Sync 1055 - (djm) OpenBSD CVS Sync
10 - jmc@cvs.openbsd.org 2003/03/28 10:11:43 1056 - jmc@cvs.openbsd.org 2003/03/28 10:11:43
@@ -61,1245 +1107,4 @@
61 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. 1107 - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
62 Report from murple@murple.net, diagnosis from dtucker@zip.com.au 1108 Report from murple@murple.net, diagnosis from dtucker@zip.com.au
63 1109
6420030320 1110$Id: ChangeLog,v 1.2994.2.4 2003/09/16 06:00:52 djm Exp $
65 - (djm) OpenBSD CVS Sync
66 - markus@cvs.openbsd.org 2003/03/17 10:38:38
67 [progressmeter.c]
68 don't print \n if backgrounded; from ho@
69 - markus@cvs.openbsd.org 2003/03/17 11:43:47
70 [version.h]
71 enter 3.6
72 - (bal) The days of lack of int64_t support are over. Sorry kids.
73 - (bal) scp.c 'limit' conflicts with Cray. Rename to 'limitbw'
74 - (bal) Collection of Cray patches (bsd-cray.h fix for CRAYT3E and improved
75 guessing rules)
76 - (bal) Disable Privsep for Tru64 after pre-authentication due to issues
77 with SIA. Also, clean up of tru64 support patch by Chris Adams
78 <cmadams@hiwaay.net>
79 - (tim) [contrib/caldera/openssh.spec] workaround RPM quirk. Fix %files
80
8120030318
82 - (tim) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h]
83 add nanosleep(). testing/corrections by Darren Tucker <dtucker@zip.com.au>
84
8520030317
86 - (djm) Fix return value checks for RAND_bytes. Report from
87 Steve G <linux_4ever@yahoo.com>
88
8920030315
90 - (djm) OpenBSD CVS Sync
91 - markus@cvs.openbsd.org 2003/03/13 11:42:19
92 [authfile.c ssh-keysign.c]
93 move RSA_blinding_on to generic key load method
94 - markus@cvs.openbsd.org 2003/03/13 11:44:50
95 [ssh-agent.c]
96 ssh-agent is similar to ssh-keysign (allows other processes to use
97 private rsa keys). however, it gets key over socket and not from
98 a file, so we have to do blinding here as well.
99
10020030310
101- (djm) OpenBSD CVS Sync
102 - markus@cvs.openbsd.org 2003/03/05 22:33:43
103 [channels.c monitor.c scp.c session.c sftp-client.c sftp-int.c]
104 [sftp-server.c ssh-add.c sshconnect2.c]
105 fix memory leaks; from dlheine@suif.Stanford.EDU/CLOUSEAU; ok djm@
106 - (djm) One more portable-specific one from dlheine@suif.Stanford.EDU/
107 CLOUSEAU
108 - (djm) Bug #245: TTY problems on Solaris. Fix by stevesk@ and
109 dtucker@zip.com.au
110 - (djm) AIX package builder update from dtucker@zip.com.au
111
11220030225
113 - (djm) Fix some compile errors spotted by dtucker and his fabulous
114 tinderbox
115
11620030224
117 - (djm) Tweak gnome-ssh-askpass2:
118 - Retry kb and mouse grab a couple of times, so passphrase dialog doesn't
119 immediately fail if you are doing something else when it appears (e.g.
120 dragging a window)
121 - Perform server grab after we have the keyboard and/or pointer to avoid
122 races.
123 - (djm) OpenBSD CVS Sync
124 - markus@cvs.openbsd.org 2003/01/27 17:06:31
125 [sshd.c]
126 more specific error message when /var/empty has wrong permissions;
127 bug #46, map@appgate.com; ok henning@, provos@, stevesk@
128 - markus@cvs.openbsd.org 2003/01/28 16:11:52
129 [scp.1]
130 document -l; pekkas@netcore.fi
131 - stevesk@cvs.openbsd.org 2003/01/28 17:24:51
132 [scp.1]
133 remove example not pertinent with -1 addition; ok markus@
134 - jmc@cvs.openbsd.org 2003/01/31 21:54:40
135 [sshd.8]
136 typos; sshd(8): help and ok markus@
137 help and ok millert@
138 - markus@cvs.openbsd.org 2003/02/02 10:51:13
139 [scp.c]
140 call okname() only when using system(3) for remote-remote copy;
141 fixes bugs #483, #472; ok deraadt@, mouring@
142 - markus@cvs.openbsd.org 2003/02/02 10:56:08
143 [kex.c]
144 add support for key exchange guesses; based on work by
145 avraham.fraenkel@commatch.com; fixes bug #148; ok deraadt@
146 - markus@cvs.openbsd.org 2003/02/03 08:56:16
147 [sshpty.c]
148 don't call error() for readonly /dev; from soekris list; ok mcbride,
149 henning, deraadt.
150 - markus@cvs.openbsd.org 2003/02/04 09:32:08
151 [key.c]
152 better debug3 message
153 - markus@cvs.openbsd.org 2003/02/04 09:33:22
154 [monitor.c monitor_wrap.c]
155 skey/bsdauth: use 0 to indicate failure instead of -1, because
156 the buffer API only supports unsigned ints.
157 - markus@cvs.openbsd.org 2003/02/05 09:02:28
158 [readconf.c]
159 simplify ProxyCommand parsing, remove strcat/xrealloc; ok henning@, djm@
160 - markus@cvs.openbsd.org 2003/02/06 09:26:23
161 [session.c]
162 missing call to setproctitle() after authentication; ok provos@
163 - markus@cvs.openbsd.org 2003/02/06 09:27:29
164 [ssh.c ssh_config.5]
165 support 'ProxyCommand none'; bugzilla #433; binder@arago.de; ok djm@
166 - markus@cvs.openbsd.org 2003/02/06 09:29:18
167 [sftp-server.c]
168 fix races in rename/symlink; from Tony Finch; ok djm@
169 - markus@cvs.openbsd.org 2003/02/06 21:22:43
170 [auth1.c auth2.c]
171 undo broken fix for #387, fixes #486
172 - markus@cvs.openbsd.org 2003/02/10 11:51:47
173 [ssh-add.1]
174 xref sshd_config.5 (not sshd.8); mark@summersault.com; bug #490
175 - markus@cvs.openbsd.org 2003/02/12 09:33:04
176 [key.c key.h ssh-dss.c ssh-rsa.c]
177 merge ssh-dss.h ssh-rsa.h into key.h; ok deraadt@
178 - markus@cvs.openbsd.org 2003/02/12 21:39:50
179 [crc32.c crc32.h]
180 replace crc32.c with a BSD licensed version; noted by David Turner
181 - markus@cvs.openbsd.org 2003/02/16 17:09:57
182 [kex.c kexdh.c kexgex.c kex.h sshconnect2.c sshd.c ssh-keyscan.c]
183 split kex into client and server code, no need to link
184 server code into the client; ok provos@
185 - markus@cvs.openbsd.org 2003/02/16 17:30:33
186 [monitor.c monitor_wrap.c]
187 fix permitrootlogin forced-commands-only for privsep; bux #387;
188 ok provos@
189 - markus@cvs.openbsd.org 2003/02/21 09:05:53
190 [servconf.c]
191 print sshd_config filename in debug2 mode.
192 - mpech@cvs.openbsd.org 2003/02/21 10:34:48
193 [auth-krb4.c]
194 ...sizeof(&adat.session) is not good here.
195 henning@, deraadt@, millert@
196 - (djm) Add new object files to Makefile and reorder
197 - (djm) Bug #501: gai_strerror should return char*;
198 fix from dtucker@zip.com.au
199 - (djm) Most of Bug #499: Cygwin compile fixes for new progressmeter;
200 From vinschen@redhat.com
201 - (djm) Rest of Bug #499: Import a basename() function from OpenBSD libc
202 - (djm) Bug #494: Allow multiple accounts on Windows 9x/Me;
203 From vinschen@redhat.com
204 - (djm) Bug #456: Support for NEC SX6 with Unicos; from wendyp@cray.com
205
20620030211
207 - (djm) Cygwin needs libcrypt too. Patch from vinschen@redhat.com
208
20920030206
210 - (djm) Teach fake-getaddrinfo to use getservbyname() when provided a
211 string service name. Suggested by markus@, review by itojun@
212
21320030131
214 - (bal) AIX 4.2.1 lacks nanosleep(). Patch to use nsleep() provided by
215 dtucker@zip.com.au
216
21720030130
218 - (djm) Unbreak root password auth. Spotted by dtucker@zip.com.au
219
220200301028
221 - (djm) Search libposix4 and librt for nanosleep. From dtucker@zip.com.au
222 and openssh-unix-dev@thewrittenword.com
223
224200301027
225 - (bal) Bugzilla 477 patch by wendyp@cray.com. Define TIOCGPGRP for
226 cray. Also removed test for tcgetpgrp in configure.ac since it
227 is no longer used.
228
22920030124
230 - (djm) OpenBSD CVS Sync
231 - jmc@cvs.openbsd.org 2003/01/23 08:58:47
232 [sshd_config.5]
233 typos; ok millert@
234 - markus@cvs.openbsd.org 2003/01/23 13:50:27
235 [authfd.c authfd.h readpass.c ssh-add.1 ssh-add.c ssh-agent.c]
236 ssh-add -c, prompt user for confirmation (using ssh-askpass) when
237 private agent key is used; with djm@; test by dugsong@, djm@;
238 ok deraadt@
239 - markus@cvs.openbsd.org 2003/01/23 14:01:53
240 [scp.c]
241 bandwidth limitation patch (scp -l) from niels@; ok todd@, deraadt@
242 - markus@cvs.openbsd.org 2003/01/23 14:06:15
243 [scp.1 scp.c]
244 scp -12; Sam Smith and others; ok provos@, deraadt@
245 - (djm) Add TIMEVAL_TO_TIMESPEC macros
246
24720030123
248 - (djm) OpenBSD CVS Sync
249 - djm@cvs.openbsd.org 2003/01/23 00:03:00
250 [auth1.c]
251 Don't log TIS auth response; "get rid of it" - markus@
252
25320030122
254 - (djm) OpenBSD CVS Sync
255 - marc@cvs.openbsd.org 2003/01/21 18:14:36
256 [ssh-agent.1 ssh-agent.c]
257 Add a -t life option to ssh-agent that set the default lifetime.
258 The default can still be overriden by using -t in ssh-add.
259 OK markus@
260 - (djm) Reorganise PAM & SIA password handling to eliminate some common code
261 - (djm) Sync regress with OpenBSD -current
262
26320030120
264 - (djm) Fix compilation for NetBSD from dtucker@zip.com.au
265 - (tim) [progressmeter.c] make compilers without long long happy.
266 - (tim) [configure.ac] Add -belf to build ELF binaries on OpenServer 5 when
267 using cc. (gcc already did)
268
26920030118
270 - (djm) Revert fix for Bug #442 for now.
271
27220030117
273 - (djm) Bug #470: Detect strnvis, not strvis in configure.
274 From d_wllms@lanl.gov
275
27620030116
277 - (djm) OpenBSD CVS Sync
278 - djm@cvs.openbsd.org 2003/01/16 03:41:55
279 [sftp-int.c]
280 explicitly use first glob result
281
28220030114
283 - (djm) OpenBSD CVS Sync
284 - fgsch@cvs.openbsd.org 2003/01/10 23:23:24
285 [sftp-int.c]
286 typo; from Nils Nordman <nino at nforced dot com>.
287 - markus@cvs.openbsd.org 2003/01/11 18:29:43
288 [log.c]
289 set fatal_cleanups to NULL in fatal_remove_all_cleanups();
290 dtucker@zip.com.au
291 - markus@cvs.openbsd.org 2003/01/12 16:57:02
292 [progressmeter.c]
293 allow WARNINGS=yes; ok djm@
294 - djm@cvs.openbsd.org 2003/01/13 11:04:04
295 [sftp-int.c]
296 make cmds[] array static to avoid conflict with BSDI libc.
297 mindrot bug #466. Fix from mdev@idg.nl; ok markus@
298 - djm@cvs.openbsd.org 2003/01/14 10:58:00
299 [sftp-client.c sftp-int.c]
300 Don't try to upload or download non-regular files. Report from
301 apoloval@pantuflo.escet.urjc.es; ok markus@
302
30320030113
304 - (djm) Rework openbsd-compat/setproctitle.c a bit: move emulation type
305 detection to configure.ac. Prompted by stevesk@
306 - (djm) Bug #467: Add a --disable-strip option to turn off stripping of
307 installed binaries. From mdev@idg.nl
308
30920030110
310 - (djm) Enable new setproctitle emulation for Linux, AIX and HP/UX. More
311 systems may be added later.
312 - (djm) OpenBSD CVS Sync
313 - djm@cvs.openbsd.org 2003/01/08 23:53:26
314 [sftp.1 sftp.c sftp-int.c sftp-int.h]
315 Cleanup error handling for batchmode
316 Allow blank lines and comments in input
317 Ability to suppress abort on error in batchmode ("-put blah")
318 Fixes mindrot bug #452; markus@ ok
319 - fgsch@cvs.openbsd.org 2003/01/10 08:19:07
320 [scp.c sftp.1 sftp.c sftp-client.c sftp-int.c progressmeter.c]
321 [progressmeter.h]
322 sftp progress meter support.
323 original diffs by Nils Nordman <nino at nforced dot com> via
324 markus@, merged to -current by me, djm@ ok.
325 - djm@cvs.openbsd.org 2003/01/10 08:48:15
326 [sftp-client.c]
327 Simplify and avoid redundancy in packet send and receive
328 functions; ok fgs@
329 - djm@cvs.openbsd.org 2003/01/10 10:29:35
330 [scp.c]
331 Don't ftruncate after write error, creating sparse files of
332 incorrect length
333 mindrot bug #403, reported by rusr@cup.hp.com; ok markus@
334 - djm@cvs.openbsd.org 2003/01/10 10:32:54
335 [channels.c]
336 hush socket() errors, except last. Fixes mindrot bug #408; ok markus@
337
33820030108
339 - (djm) Sync openbsd-compat/ with OpenBSD -current
340 - (djm) Avoid redundant xstrdup/xfree in auth2-pam.c. From Solar via markus@
341 - (djm) OpenBSD CVS Sync
342 - markus@cvs.openbsd.org 2003/01/01 18:08:52
343 [channels.c]
344 move big output buffer messages to debug2
345 - djm@cvs.openbsd.org 2003/01/06 23:51:22
346 [sftp-client.c]
347 Fix "get -p" download to not add user-write perm. mindrot bug #426
348 reported by gfernandez@livevault.com; ok markus@
349 - fgsch@cvs.openbsd.org 2003/01/07 23:42:54
350 [sftp.1]
351 add version; from Nils Nordman <nino at nforced dot com> via markus@.
352 markus@ ok
353 - (djm) Update README to reflect AIX's status as a well supported platform.
354 From dtucker@zip.com.au
355 - (tim) [Makefile.in configure.ac] replace fixpath with sed script. Patch
356 by Mo DeJong.
357 - (tim) [auth.c] declare today at top of allowed_user() to keep
358 older compilers happy.
359 - (tim) [scp.c] make compilers without long long happy.
360
36120030107
362 - (djm) Bug #401: Work around Linux breakage with IPv6 mapped addresses.
363 Based on fix from yoshfuji@linux-ipv6.org
364 - (djm) Bug #442: Check for and deny access to accounts with locked
365 passwords. Patch from dtucker@zip.com.au
366 - (djm) Bug #44: Use local mkstemp() rather than glibc's silly one. Fixes
367 Can't pass KRB4 TGT passing. Fix from: jan.iven@cern.ch
368 - (djm) Fix Bug #442 for PAM case
369 - (djm) Bug #110: bogus error messages in lastlog_get_entry(). Fix based
370 on one by peak@argo.troja.mff.cuni.cz
371 - (djm) Bug #111: Run syslog and stderr logging through strnvis to eliminate
372 nasties. Report from peak@argo.troja.mff.cuni.cz
373 - (djm) Bug #178: On AIX /etc/nologin wasnt't shown to users. Fix from
374 Ralf.Wenk@fh-karlsruhe.de and dtucker@zip.com.au
375 - (djm) Fix my fix of the fix for the Bug #442 for PAM case. Spotted by
376 dtucker@zip.com.au. Reorder for clarity too.
377
37820030103
379 - (djm) Bug #461: ssh-copy-id fails with no arguments. Patch from
380 cjwatson@debian.org
381 - (djm) Bug #460: Filling utmp[x]->ut_addr_v6 if present. Patch from
382 cjwatson@debian.org
383 - (djm) Bug #446: Set LOGIN env var to pw_name on AIX. Patch from
384 mii@ornl.gov
385
38620030101
387 - (stevesk) [session.c sshlogin.c sshlogin.h] complete portable
388 parts of pass addrlen with sockaddr * fix.
389 from Hajimu UMEMOTO <ume@FreeBSD.org>
390
39120021222
392 - (bal) OpenBSD CVS Sync
393 - fgsch@cvs.openbsd.org 2002/11/15 10:03:09
394 [authfile.c]
395 lseek(2) may return -1 when getting the public/private key lenght.
396 Simplify the code and check for errors using fstat(2).
397
398 Problem reported by Mauricio Sanchez, markus@ ok.
399 - markus@cvs.openbsd.org 2002/11/18 16:43:44
400 [clientloop.c]
401 don't overwrite SIG{INT,QUIT,TERM} handler if set to SIG_IGN;
402 e.g. if ssh is used for backup; report Joerg Schilling; ok millert@
403 - markus@cvs.openbsd.org 2002/11/21 22:22:50
404 [dh.c]
405 debug->debug2
406 - markus@cvs.openbsd.org 2002/11/21 22:45:31
407 [cipher.c kex.c packet.c sshconnect.c sshconnect2.c]
408 debug->debug2, unify debug messages
409 - deraadt@cvs.openbsd.org 2002/11/21 23:03:51
410 [auth-krb5.c auth1.c hostfile.h monitor_wrap.c sftp-client.c sftp-int.c ssh-add.c ssh-rsa.c
411 sshconnect.c]
412 KNF
413 - markus@cvs.openbsd.org 2002/11/21 23:04:33
414 [ssh.c]
415 debug->debug2
416 - stevesk@cvs.openbsd.org 2002/11/24 21:46:24
417 [ssh-keysign.8]
418 typo: "the the"
419 - wcobb@cvs.openbsd.org 2002/11/26 00:45:03
420 [scp.c ssh-keygen.c]
421 Remove unnecessary fflush(stderr) calls, stderr is unbuffered by default.
422 ok markus@
423 - stevesk@cvs.openbsd.org 2002/11/26 02:35:30
424 [ssh-keygen.1]
425 remove outdated statement; ok markus@ deraadt@
426 - stevesk@cvs.openbsd.org 2002/11/26 02:38:54
427 [canohost.c]
428 KNF, comment and error message repair; ok markus@
429 - markus@cvs.openbsd.org 2002/11/27 17:53:35
430 [scp.c sftp.c ssh.c]
431 allow usernames with embedded '@', e.g. scp user@vhost@realhost:file /tmp;
432 http://bugzilla.mindrot.org/show_bug.cgi?id=447; ok mouring@, millert@
433 - stevesk@cvs.openbsd.org 2002/12/04 04:36:47
434 [session.c]
435 remove xauth entries before add; PR 2994 from janjaap@stack.nl.
436 ok markus@
437 - markus@cvs.openbsd.org 2002/12/05 11:08:35
438 [scp.c]
439 use roundup() similar to rcp/util.c and avoid problems with strange
440 filesystem block sizes, noted by tjr@freebsd.org; ok djm@
441 - djm@cvs.openbsd.org 2002/12/06 05:20:02
442 [sftp.1]
443 Fix cut'n'paste error, spotted by matthias.riese@b-novative.de; ok deraadt@
444 - millert@cvs.openbsd.org 2002/12/09 16:50:30
445 [ssh.c]
446 Avoid setting optind to 0 as GNU getopt treats that like we do optreset.
447 markus@ OK
448 - markus@cvs.openbsd.org 2002/12/10 08:56:00
449 [session.c]
450 Make sure $SHELL points to the shell from the password file, even if shell
451 is overridden from login.conf; bug#453; semen at online.sinor.ru; ok millert@
452 - markus@cvs.openbsd.org 2002/12/10 19:26:50
453 [packet.c]
454 move tos handling to packet_set_tos; ok provos/henning/deraadt
455 - markus@cvs.openbsd.org 2002/12/10 19:47:14
456 [packet.c]
457 static
458 - markus@cvs.openbsd.org 2002/12/13 10:03:15
459 [channels.c misc.c sshconnect2.c]
460 cleanup debug messages, more useful information for the client user.
461 - markus@cvs.openbsd.org 2002/12/13 15:20:52
462 [scp.c]
463 1) include stalling time in total time
464 2) truncate filenames to 45 instead of 20 characters
465 3) print rate instead of progress bar, no more stars
466 4) scale output to tty width
467 based on a patch from Niels; ok fries@ lebel@ fgs@ millert@
468 - (bal) [msg.c msg.h scp.c ssh-keysign.c sshconnect2.c] Resync CVS IDs since
469 we already did s/msg_send/ssh_msg_send/
470
47120021205
472 - (djm) PERL-free fixpaths from stuge-openssh-unix-dev@cdy.org
473
47420021122
475 - (tim) [configure.ac] fix STDPATH test for IRIX. First reported by
476 advax@triumf.ca. This type of solution tested by <herb@sgi.com>
477
47820021113
479 - (tim) [configure.ac] remove unused variables no_libsocket and no_libnsl
480
48120021111
482 - (tim) [contrib/solaris/opensshd.in] add umask 022 so sshd.pid is
483 not world writable.
484
48520021109
486 - (bal) OpenBSD CVS Sync
487 - itojun@cvs.openbsd.org 2002/10/16 14:31:48
488 [sftp-common.c]
489 64bit pedant. %llu is "unsigned long long". markus ok
490 - markus@cvs.openbsd.org 2002/10/23 10:32:13
491 [packet.c]
492 use %u for u_int
493 - markus@cvs.openbsd.org 2002/10/23 10:40:16
494 [bufaux.c]
495 %u for u_int
496 - markus@cvs.openbsd.org 2002/11/04 10:07:53
497 [auth.c]
498 don't compare against pw_home if realpath fails for pw_home (seen
499 on AFS); ok djm@
500 - markus@cvs.openbsd.org 2002/11/04 10:09:51
501 [packet.c]
502 log before send disconnect; ok djm@
503 - markus@cvs.openbsd.org 2002/11/05 19:45:20
504 [monitor.c]
505 handle overflows for size_t larger than u_int; siw@goneko.de, bug #425
506 - markus@cvs.openbsd.org 2002/11/05 20:10:37
507 [sftp-client.c]
508 typo; GaryF@livevault.com
509 - markus@cvs.openbsd.org 2002/11/07 16:28:47
510 [sshd.c]
511 log to stderr if -ie is given, bug #414, prj@po.cwru.edu
512 - markus@cvs.openbsd.org 2002/11/07 22:08:07
513 [readconf.c readconf.h ssh-keysign.8 ssh-keysign.c]
514 we cannot use HostbasedAuthentication for enabling ssh-keysign(8),
515 because HostbasedAuthentication might be enabled based on the
516 target host and ssh-keysign(8) does not know the remote hostname
517 and not trust ssh(1) about the hostname, so we add a new option
518 EnableSSHKeysign; ok djm@, report from zierke@informatik.uni-hamburg.de
519 - markus@cvs.openbsd.org 2002/11/07 22:35:38
520 [scp.c]
521 check exit status from ssh, and exit(1) if ssh fails; bug#369;
522 binder@arago.de
523 - (bal) Update ssh-host-config and minor rewrite of bsd-cygwin_util.c
524 ntsec now default if cygwin version beginning w/ version 56. Patch
525 by Corinna Vinschen <vinschen@redhat.com>
526 - (bal) AIX does not log login attempts for unknown users (bug #432).
527 patch by dtucker@zip.com.au
528
52920021021
530 - (djm) Bug #400: Kill ssh-rand-helper children on timeout, patch from
531 dtucker@zip.com.au
532 - (djm) Bug #317: FreeBSD needs libutil.h for openpty() Report from
533 dirk.meyer@dinoex.sub.org
534
53520021015
536 - (bal) Fix bug id 383 and only call loginrestrict for AIX if not root.
537 - (bal) More advanced strsep test by Darren Tucker <dtucker@zip.com.au>
538
53920021015
540 - (tim) [contrib/caldera/openssh.spec] make ssh-agent setgid nobody
541
54220021004
543 - (bal) Disable post-authentication Privsep for OSF/1. It conflicts with
544 SIA.
545
54620021003
547 - (djm) OpenBSD CVS Sync
548 - markus@cvs.openbsd.org 2002/10/01 20:34:12
549 [ssh-agent.c]
550 allow root to access the agent, since there is no protection from root.
551 - markus@cvs.openbsd.org 2002/10/01 13:24:50
552 [version.h]
553 OpenSSH 3.5
554 - (djm) Bump RPM spec version numbers
555 - (djm) Bug #406: s/msg_send/ssh_msg_send/ for Mac OS X 1.2
556
55720020930
558 - (djm) Tidy contrib/, add Makefile for GNOME passphrase dialogs,
559 tweak README
560 - (djm) OpenBSD CVS Sync
561 - mickey@cvs.openbsd.org 2002/09/27 10:42:09
562 [compat.c compat.h sshd.c]
563 add a generic match for a prober, such as sie big brother;
564 idea from stevesk@; markus@ ok
565 - stevesk@cvs.openbsd.org 2002/09/27 15:46:21
566 [ssh.1]
567 clarify compression level protocol 1 only; ok markus@ deraadt@
568
56920020927
570 - (djm) OpenBSD CVS Sync
571 - markus@cvs.openbsd.org 2002/09/25 11:17:16
572 [sshd_config]
573 sync LoginGraceTime with default
574 - markus@cvs.openbsd.org 2002/09/25 15:19:02
575 [sshd.c]
576 typo; pilot@monkey.org
577 - markus@cvs.openbsd.org 2002/09/26 11:38:43
578 [auth1.c auth.h auth-krb4.c monitor.c monitor.h monitor_wrap.c]
579 [monitor_wrap.h]
580 krb4 + privsep; ok dugsong@, deraadt@
581
58220020925
583 - (bal) Fix issue where successfull login does not clear failure counts
584 in AIX. Patch by dtucker@zip.com.au ok by djm
585 - (tim) Cray fixes (bug 367) based on patch from Wendy Palm @ cray.
586 This does not include the deattack.c fixes.
587
58820020923
589 - (djm) OpenBSD CVS Sync
590 - stevesk@cvs.openbsd.org 2002/09/23 20:46:27
591 [canohost.c]
592 change get_peer_ipaddr() and get_local_ipaddr() to not return NULL for
593 non-sockets; fixes a problem passing NULL to snprintf(). ok markus@
594 - markus@cvs.openbsd.org 2002/09/23 22:11:05
595 [monitor.c]
596 only call auth_krb5 if kerberos is enabled; ok deraadt@
597 - markus@cvs.openbsd.org 2002/09/24 08:46:04
598 [monitor.c]
599 only call kerberos code for authctxt->valid
600 - todd@cvs.openbsd.org 2002/09/24 20:59:44
601 [sshd.8]
602 tweak the example $HOME/.ssh/rc script to not show on any cmdline the
603 sensitive data it handles. This fixes bug # 402 as reported by
604 kolya@mit.edu (Nickolai Zeldovich).
605 ok markus@ and stevesk@
606
60720020923
608 - (tim) [configure.ac] s/return/exit/ patch by dtucker@zip.com.au
609
61020020922
611 - (djm) OpenBSD CVS Sync
612 - stevesk@cvs.openbsd.org 2002/09/19 14:53:14
613 [compat.c]
614 - markus@cvs.openbsd.org 2002/09/19 15:51:23
615 [ssh-add.c]
616 typo; cd@kalkatraz.de
617 - stevesk@cvs.openbsd.org 2002/09/19 16:03:15
618 [serverloop.c]
619 log IP address also; ok markus@
620 - stevesk@cvs.openbsd.org 2002/09/20 18:41:29
621 [auth.c]
622 log illegal user here for missing privsep case (ssh2).
623 this is executed in the monitor. ok markus@
624
62520020919
626 - (djm) OpenBSD CVS Sync
627 - stevesk@cvs.openbsd.org 2002/09/12 19:11:52
628 [ssh-agent.c]
629 %u for uid print; ok markus@
630 - stevesk@cvs.openbsd.org 2002/09/12 19:50:36
631 [session.c ssh.1]
632 add SSH_CONNECTION and deprecate SSH_CLIENT; bug #384. ok markus@
633 - stevesk@cvs.openbsd.org 2002/09/13 19:23:09
634 [channels.c sshconnect.c sshd.c]
635 remove use of SO_LINGER, it should not be needed. error check
636 SO_REUSEADDR. fixup comments. ok markus@
637 - stevesk@cvs.openbsd.org 2002/09/16 19:55:33
638 [session.c]
639 log when _PATH_NOLOGIN exists; ok markus@
640 - stevesk@cvs.openbsd.org 2002/09/16 20:12:11
641 [sshd_config.5]
642 more details on X11Forwarding security issues and threats; ok markus@
643 - stevesk@cvs.openbsd.org 2002/09/16 22:03:13
644 [sshd.8]
645 reference moduli(5) in FILES /etc/moduli.
646 - itojun@cvs.openbsd.org 2002/09/17 07:47:02
647 [channels.c]
648 don't quit while creating X11 listening socket.
649 http://mail-index.netbsd.org/current-users/2002/09/16/0005.html
650 got from portable. markus ok
651 - djm@cvs.openbsd.org 2002/09/19 01:58:18
652 [ssh.c sshconnect.c]
653 bugzilla.mindrot.org #223 - ProxyCommands don't exit.
654 Patch from dtucker@zip.com.au; ok markus@
655
65620020912
657 - (djm) Made GNOME askpass programs return non-zero if cancel button is
658 pressed.
659 - (djm) Added getpeereid() replacement. Properly implemented for systems
660 with SO_PEERCRED support. Faked for systems which lack it.
661 - (djm) Sync sys/tree.h with OpenBSD -current. Rename tree.h and
662 fake-queue.h to sys-tree.h and sys-queue.h
663 - (djm) OpenBSD CVS Sync
664 - markus@cvs.openbsd.org 2002/09/08 20:24:08
665 [hostfile.h]
666 no comma at end of enumerator list
667 - itojun@cvs.openbsd.org 2002/09/09 06:48:06
668 [auth1.c auth.h auth-krb5.c monitor.c monitor.h]
669 [monitor_wrap.c monitor_wrap.h]
670 kerberos support for privsep. confirmed to work by lha@stacken.kth.se
671 patch from markus
672 - markus@cvs.openbsd.org 2002/09/09 14:54:15
673 [channels.c kex.h key.c monitor.c monitor_wrap.c radix.c uuencode.c]
674 signed vs unsigned from -pedantic; ok henning@
675 - markus@cvs.openbsd.org 2002/09/10 20:24:47
676 [ssh-agent.c]
677 check the euid of the connecting process with getpeereid(2);
678 ok provos deraadt stevesk
679 - stevesk@cvs.openbsd.org 2002/09/11 17:55:03
680 [ssh.1]
681 add agent and X11 forwarding warning text from ssh_config.5; ok markus@
682 - stevesk@cvs.openbsd.org 2002/09/11 18:27:26
683 [authfd.c authfd.h ssh.c]
684 don't connect to agent to test for presence if we've previously
685 connected; ok markus@
686 - djm@cvs.openbsd.org 2002/09/11 22:41:50
687 [sftp.1 sftp-client.c sftp-client.h sftp-common.c sftp-common.h]
688 [sftp-glob.c sftp-glob.h sftp-int.c sftp-server.c]
689 support for short/long listings and globbing in "ls"; ok markus@
690 - djm@cvs.openbsd.org 2002/09/12 00:13:06
691 [sftp-int.c]
692 zap unused var introduced in last commit
693
69420020911
695 - (djm) Sync openbsd-compat with OpenBSD -current
696
69720020910
698 - (djm) Bug #365: Read /.ssh/environment properly under CygWin.
699 Patch from Mark Bradshaw <bradshaw@staff.crosswalk.com>
700 - (djm) Bug #138: Make protocol 1 blowfish work with old OpenSSL.
701 Patch from Robert Halubek <rob@adso.com.pl>
702
70320020905
704 - (djm) OpenBSD CVS Sync
705 - stevesk@cvs.openbsd.org 2002/09/04 18:52:42
706 [servconf.c sshd.8 sshd_config.5]
707 default LoginGraceTime to 2m; 1m may be too short for slow systems.
708 ok markus@
709 - (djm) Merge openssh-TODO.patch from Redhat (null) beta
710 - (djm) Add gnome-ssh-askpass2.c (gtk2) by merge with patch from
711 Nalin Dahyabhai <nalin@redhat.com>
712 - (djm) Add support for building gtk2 password requestor from Redhat beta
713
71420020903
715 - (djm) Patch from itojun@ for Darwin OS: test getaddrinfo, reorder libcrypt
716 - (djm) Fix Redhat RPM build dependancy test
717 - (djm) OpenBSD CVS Sync
718 - markus@cvs.openbsd.org 2002/08/12 10:46:35
719 [ssh-agent.c]
720 make ssh-agent setgid, disallow ptrace.
721 - espie@cvs.openbsd.org 2002/08/21 11:20:59
722 [sshd.8]
723 `RSA' updated to refer to `public key', where it matters.
724 okay markus@
725 - stevesk@cvs.openbsd.org 2002/08/21 19:38:06
726 [servconf.c sshd.8 sshd_config sshd_config.5]
727 change LoginGraceTime default to 1 minute; ok mouring@ markus@
728 - stevesk@cvs.openbsd.org 2002/08/21 20:10:28
729 [ssh-agent.c]
730 raise listen backlog; ok markus@
731 - stevesk@cvs.openbsd.org 2002/08/22 19:27:53
732 [ssh-agent.c]
733 use common close function; ok markus@
734 - stevesk@cvs.openbsd.org 2002/08/22 19:38:42
735 [clientloop.c]
736 format with current EscapeChar; bugzilla #388 from wknox@mitre.org.
737 ok markus@
738 - stevesk@cvs.openbsd.org 2002/08/22 20:57:19
739 [ssh-agent.c]
740 shutdown(SHUT_RDWR) not needed before close here; ok markus@
741 - markus@cvs.openbsd.org 2002/08/22 21:33:58
742 [auth1.c auth2.c]
743 auth_root_allowed() is handled by the monitor in the privsep case,
744 so skip this for use_privsep, ok stevesk@, fixes bugzilla #387/325
745 - markus@cvs.openbsd.org 2002/08/22 21:45:41
746 [session.c]
747 send signal name (not signal number) in "exit-signal" message; noticed
748 by galb@vandyke.com
749 - stevesk@cvs.openbsd.org 2002/08/27 17:13:56
750 [ssh-rsa.c]
751 RSA_public_decrypt() returns -1 on error so len must be signed;
752 ok markus@
753 - stevesk@cvs.openbsd.org 2002/08/27 17:18:40
754 [ssh_config.5]
755 some warning text for ForwardAgent and ForwardX11; ok markus@
756 - stevesk@cvs.openbsd.org 2002/08/29 15:57:25
757 [monitor.c session.c sshlogin.c sshlogin.h]
758 pass addrlen with sockaddr *; from Hajimu UMEMOTO <ume@FreeBSD.org>
759 NOTE: there are also p-specific parts to this patch. ok markus@
760 - stevesk@cvs.openbsd.org 2002/08/29 16:02:54
761 [ssh.1 ssh.c]
762 deprecate -P as UsePrivilegedPort defaults to no now; ok markus@
763 - stevesk@cvs.openbsd.org 2002/08/29 16:09:02
764 [ssh_config.5]
765 more on UsePrivilegedPort and setuid root; ok markus@
766 - stevesk@cvs.openbsd.org 2002/08/29 19:49:42
767 [ssh.c]
768 shrink initial privilege bracket for setuid case; ok markus@
769 - stevesk@cvs.openbsd.org 2002/08/29 22:54:10
770 [ssh_config.5 sshd_config.5]
771 state XAuthLocation is a full pathname
772
77320020820
774 - OpenBSD CVS Sync
775 - millert@cvs.openbsd.org 2002/08/02 14:43:15
776 [monitor.c monitor_mm.c]
777 Change mm_zalloc() sanity checks to be more in line with what
778 we do in calloc() and add a check to monitor_mm.c.
779 OK provos@ and markus@
780 - marc@cvs.openbsd.org 2002/08/02 16:00:07
781 [ssh.1 sshd.8]
782 note that .ssh/environment is only read when
783 allowed (PermitUserEnvironment in sshd_config).
784 OK markus@
785 - markus@cvs.openbsd.org 2002/08/02 21:23:41
786 [ssh-rsa.c]
787 diff is u_int (2x); ok deraadt/provos
788 - markus@cvs.openbsd.org 2002/08/02 22:20:30
789 [ssh-rsa.c]
790 replace RSA_verify with our own version and avoid the OpenSSL ASN.1 parser
791 for authentication; ok deraadt/djm
792 - aaron@cvs.openbsd.org 2002/08/08 13:50:23
793 [sshconnect1.c]
794 Use & to test if bits are set, not &&; markus@ ok.
795 - stevesk@cvs.openbsd.org 2002/08/08 23:54:52
796 [auth.c]
797 typo in comment
798 - stevesk@cvs.openbsd.org 2002/08/09 17:21:42
799 [sshd_config.5]
800 use Op for mdoc conformance; from esr@golux.thyrsus.com
801 ok aaron@
802 - stevesk@cvs.openbsd.org 2002/08/09 17:41:12
803 [sshd_config.5]
804 proxy vs. fake display
805 - stevesk@cvs.openbsd.org 2002/08/12 17:30:35
806 [ssh.1 sshd.8 sshd_config.5]
807 more PermitUserEnvironment; ok markus@
808 - stevesk@cvs.openbsd.org 2002/08/17 23:07:14
809 [ssh.1]
810 ForwardAgent has defaulted to no for over 2 years; be more clear here.
811 - stevesk@cvs.openbsd.org 2002/08/17 23:55:01
812 [ssh_config.5]
813 ordered list here
814 - (bal) [defines.h] Some platforms don't have SIZE_T_MAX. So assign
815 it to ULONG_MAX.
816
81720020813
818 - (tim) [configure.ac] Display OpenSSL header/library version.
819 Patch by dtucker@zip.com.au
820
82120020731
822 - (bal) OpenBSD CVS Sync
823 - markus@cvs.openbsd.org 2002/07/24 16:11:18
824 [hostfile.c hostfile.h sshconnect.c]
825 print out all known keys for a host if we get a unknown host key,
826 see discussion at http://marc.theaimsgroup.com/?t=101069210100016&r=1&w=4
827
828 the ssharp mitm tool attacks users in a similar way, so i'd like to
829 pointed out again:
830 A MITM attack is always possible if the ssh client prints:
831 The authenticity of host 'bla' can't be established.
832 (protocol version 2 with pubkey authentication allows you to detect
833 MITM attacks)
834 - mouring@cvs.openbsd.org 2002/07/25 01:16:59
835 [sftp.c]
836 FallBackToRsh does not exist anywhere else. Remove it from here.
837 OK deraadt.
838 - markus@cvs.openbsd.org 2002/07/29 18:57:30
839 [sshconnect.c]
840 print file:line
841 - markus@cvs.openbsd.org 2002/07/30 17:03:55
842 [auth-options.c servconf.c servconf.h session.c sshd_config sshd_config.5]
843 add PermitUserEnvironment (off by default!); from dot@dotat.at;
844 ok provos, deraadt
845
84620020730
847 - (bal) [uidswap.c] SCO compile correction by gert@greenie.muc.de
848
84920020728
850 - (stevesk) [auth-pam.c] should use PAM_MSG_MEMBER(); from solar
851 - (stevesk) [CREDITS] solar
852 - (stevesk) [ssh-rand-helper.c] RAND_bytes() and SHA1_Final() unsigned
853 char arg.
854
85520020725
856 - (djm) Remove some cruft from INSTALL
857 - (djm) Latest config.guess and config.sub from ftp://ftp.gnu.org/gnu/config/
858
85920020723
860 - (bal) [bsd-cray.c bsd-cray.h] Part 2 of Cray merger.
861 - (bal) sync ID w/ ssh-agent.c
862 - (bal) OpenBSD Sync
863 - markus@cvs.openbsd.org 2002/07/19 15:43:33
864 [log.c log.h session.c sshd.c]
865 remove fatal cleanups after fork; based on discussions with and code
866 from solar.
867 - stevesk@cvs.openbsd.org 2002/07/19 17:42:40
868 [ssh.c]
869 display a warning from ssh when XAuthLocation does not exist or xauth
870 returned no authentication data. ok markus@
871 - stevesk@cvs.openbsd.org 2002/07/21 18:32:20
872 [auth-options.c]
873 unneeded includes
874 - stevesk@cvs.openbsd.org 2002/07/21 18:34:43
875 [auth-options.h]
876 remove invalid comment
877 - markus@cvs.openbsd.org 2002/07/22 11:03:06
878 [session.c]
879 fallback to _PATH_STDPATH on setusercontext+LOGIN_SETPATH errors;
880 - stevesk@cvs.openbsd.org 2002/07/22 17:32:56
881 [monitor.c]
882 u_int here; ok provos@
883 - stevesk@cvs.openbsd.org 2002/07/23 16:03:10
884 [sshd.c]
885 utmp_len is unsigned; display error consistent with other options.
886 ok markus@
887 - stevesk@cvs.openbsd.org 2002/07/15 17:15:31
888 [uidswap.c]
889 little more debugging; ok markus@
890
89120020722
892 - (bal) AIX tty data limiting patch fix by leigh@solinno.co.uk
893 - (stevesk) [xmmap.c] missing prototype for fatal()
894 - (bal) [configure.ac defines.h loginrec.c sshd.c sshpty.c] Partial sync
895 with Cray (mostly #ifdef renaming). Patch by wendyp@cray.com.
896 - (bal) [configure.ac] Missing ;; from cray patch.
897 - (bal) [monitor_mm.c openbsd-compat/xmmap.h] Move xmmap() defines
898 into it's own header.
899 - (stevesk) [auth-pam.[ch] session.c] pam_getenvlist() must be
900 freed by the caller; add free_pam_environment() and use it.
901 - (stevesk) [auth-pam.c] typo in comment
902
90320020721
904 - (stevesk) [auth-pam.c] merge cosmetic changes from solar's
905 openssh-3.4p1-owl-password-changing.diff
906 - (stevesk) [auth-pam.c] merge rest of solar's PAM patch;
907 PAM_NEW_AUTHTOK_REQD remains in #if 0 for now.
908 - (stevesk) [auth-pam.c] cast to avoid initialization type mismatch
909 warning on pam_conv struct conversation function.
910 - (stevesk) [auth-pam.h] license
911 - (stevesk) [auth-pam.h] unneeded include
912 - (stevesk) [auth-pam.[ch] ssh.h] move SSHD_PAM_SERVICE to auth-pam.h
913
91420020720
915 - (stevesk) [ssh-keygen.c] bug #231: always init/seed_rng().
916
91720020719
918 - (tim) [contrib/solaris/buildpkg.sh] create privsep user/group if needed.
919 Patch by dtucker@zip.com.au
920 - (tim) [configure.ac] test for libxnet on HP. Patch by dtucker@zip.com.au
921
92220020718
923 - (tim) [defines.h] Bug 313 patch by dirk.meyer@dinoex.sub.org
924 - (tim) [monitor_mm.c] add missing declaration for xmmap(). Reported
925 by ayamura@ayamura.org
926 - (tim) [configure.ac] Bug 267 rework int64_t test.
927 - (tim) [includes.h] Bug 267 add stdint.h
928
92920020717
930 - (bal) aixbff package updated by dtucker@zip.com.au
931 - (tim) [configure.ac] change how we do paths in AC_PATH_PROGS tests
932 for autoconf 2.53. Based on a patch by jrj@purdue.edu
933
93420020716
935 - (tim) [contrib/solaris/opensshd.in] Only kill sshd if .pid file found
936
93720020715
938 - (bal) OpenBSD CVS Sync
939 - itojun@cvs.openbsd.org 2002/07/12 13:29:09
940 [sshconnect.c]
941 print connect failure during debugging mode.
942 - markus@cvs.openbsd.org 2002/07/12 15:50:17
943 [cipher.c]
944 EVP_CIPH_CUSTOM_IV for our own rijndael
945 - (bal) Remove unused tty defined in do_setusercontext() pointed out by
946 dtucker@zip.com.au plus a a more KNF since I am near it.
947 - (bal) Privsep user creation support in Solaris buildpkg.sh by
948 dtucker@zip.com.au
949
95020020714
951 - (tim) [Makefile.in] replace "id sshd" with "sshd -t"
952 - (bal/tim) [acconfig.h configure.ac monitor_mm.c servconf.c
953 openbsd-compat/Makefile.in] support compression on platforms that
954 have no/broken MAP_ANON. Moved code to openbsd-compat/xmmap.c
955 Based on patch from nalin@redhat.com of code extracted from Owl's package
956 - (tim) [ssh_prng_cmds.in] Bug 323 arp -n flag doesn't exist under Solaris.
957 report by chris@by-design.net
958 - (tim) [loginrec.c] Bug 347: Fix typo (WTMPX_FILE) report by rodney@bond.net
959 - (tim) [loginrec.c] Bug 348: add missing found = 1; to wtmpx_islogin()
960 report by rodney@bond.net
961
96220020712
963 - (tim) [Makefile.in] quiet down install-files: and check-user:
964 - (tim) [configure.ac] remove unused filepriv line
965
96620020710
967 - (tim) [contrib/cygwin/ssh-host-config] explicitely sets the permissions
968 on /var/empty to 755 Patch by vinschen@redhat.com
969 - (bal) OpenBSD CVS Sync
970 - itojun@cvs.openbsd.org 2002/07/09 11:56:50
971 [sshconnect.c]
972 silently try next address on connect(2). markus ok
973 - itojun@cvs.openbsd.org 2002/07/09 11:56:27
974 [canohost.c]
975 suppress log on reverse lookup failiure, as there's no real value in
976 doing so.
977 markus ok
978 - itojun@cvs.openbsd.org 2002/07/09 12:04:02
979 [sshconnect.c]
980 ed static function (less warnings)
981 - stevesk@cvs.openbsd.org 2002/07/09 17:46:25
982 [sshd_config.5]
983 clarify no preference ordering in protocol list; ok markus@
984 - itojun@cvs.openbsd.org 2002/07/10 10:28:15
985 [sshconnect.c]
986 bark if all connection attempt fails.
987 - deraadt@cvs.openbsd.org 2002/07/10 17:53:54
988 [rijndael.c]
989 use right sizeof in memcpy; markus ok
990
99120020709
992 - (bal) NO_IPPORT_RESERVED_CONCEPT used instead of CYGWIN so other platforms
993 lacking that concept can share it. Patch by vinschen@redhat.com
994
99520020708
996 - (tim) [openssh/contrib/solaris/buildpkg.sh] add PKG_INSTALL_ROOT to
997 work in a jumpstart environment. patch by kbrint@rufus.net
998 - (tim) [Makefile.in] workaround for broken pakadd on some systems.
999 - (tim) [configure.ac] fix libc89 utimes test. Mention default path for
1000 --with-privsep-path=
1001
100220020707
1003 - (tim) [Makefile.in] use umask instead of chmod on $(PRIVSEP_PATH)
1004 - (tim) [acconfig.h configure.ac sshd.c]
1005 s/BROKEN_FD_PASSING/DISABLE_FD_PASSING/
1006 - (tim) [contrib/cygwin/ssh-host-config] sshd account creation fixes
1007 patch from vinschen@redhat.com
1008 - (bal) [realpath.c] Updated with OpenBSD tree.
1009 - (bal) OpenBSD CVS Sync
1010 - deraadt@cvs.openbsd.org 2002/07/04 04:15:33
1011 [key.c monitor_wrap.c sftp-glob.c ssh-dss.c ssh-rsa.c]
1012 patch memory leaks; grendel@zeitbombe.org
1013 - deraadt@cvs.openbsd.org 2002/07/04 08:12:15
1014 [channels.c packet.c]
1015 blah blah minor nothing as i read and re-read and re-read...
1016 - markus@cvs.openbsd.org 2002/07/04 10:41:47
1017 [key.c monitor_wrap.c ssh-dss.c ssh-rsa.c]
1018 don't allocate, copy, and discard if there is not interested in the data;
1019 ok deraadt@
1020 - deraadt@cvs.openbsd.org 2002/07/06 01:00:49
1021 [log.c]
1022 KNF
1023 - deraadt@cvs.openbsd.org 2002/07/06 01:01:26
1024 [ssh-keyscan.c]
1025 KNF, realloc fix, and clean usage
1026 - stevesk@cvs.openbsd.org 2002/07/06 17:47:58
1027 [ssh-keyscan.c]
1028 unused variable
1029 - (bal) Minor KNF on ssh-keyscan.c
1030
103120020705
1032 - (tim) [configure.ac] AIX 4.2.1 has authenticate() in libs.
1033 Reported by Darren Tucker <dtucker@zip.com.au>
1034 - (tim) [contrib/cygwin/ssh-host-config] double slash corrction
1035 from vinschen@redhat.com
1036
103720020704
1038 - (bal) Limit data to TTY for AIX only (Newer versions can't handle the
1039 faster data rate) Bug #124
1040 - (bal) glob.c defines TILDE and AIX also defines it. #undef it first.
1041 bug #265
1042 - (bal) One too many nulls in ports-aix.c
1043
104420020703
1045 - (bal) Updated contrib/cygwin/ patch by vinschen@redhat.com
1046 - (bal) minor correction to utimes() replacement. Patch by
1047 onoe@sm.sony.co.jp
1048 - OpenBSD CVS Sync
1049 - markus@cvs.openbsd.org 2002/06/27 08:49:44
1050 [dh.c ssh-keyscan.c sshconnect.c]
1051 more checks for NULL pointers; from grendel@zeitbombe.org; ok deraadt@
1052 - deraadt@cvs.openbsd.org 2002/06/27 09:08:00
1053 [monitor.c]
1054 improve mm_zalloc check; markus ok
1055 - deraadt@cvs.openbsd.org 2002/06/27 10:35:47
1056 [auth2-none.c monitor.c sftp-client.c]
1057 use xfree()
1058 - stevesk@cvs.openbsd.org 2002/06/27 19:49:08
1059 [ssh-keyscan.c]
1060 use convtime(); ok markus@
1061 - millert@cvs.openbsd.org 2002/06/28 01:49:31
1062 [monitor_mm.c]
1063 tree(3) wants an int return value for its compare functions and
1064 the difference between two pointers is not an int. Just do the
1065 safest thing and store the result in a long and then return 0,
1066 -1, or 1 based on that result.
1067 - deraadt@cvs.openbsd.org 2002/06/28 01:50:37
1068 [monitor_wrap.c]
1069 use ssize_t
1070 - deraadt@cvs.openbsd.org 2002/06/28 10:08:25
1071 [sshd.c]
1072 range check -u option at invocation
1073 - deraadt@cvs.openbsd.org 2002/06/28 23:05:06
1074 [sshd.c]
1075 gidset[2] -> gidset[1]; markus ok
1076 - deraadt@cvs.openbsd.org 2002/06/30 21:54:16
1077 [auth2.c session.c sshd.c]
1078 lint asks that we use names that do not overlap
1079 - deraadt@cvs.openbsd.org 2002/06/30 21:59:45
1080 [auth-bsdauth.c auth-skey.c auth2-chall.c clientloop.c key.c
1081 monitor_wrap.c monitor_wrap.h scard.h session.h sftp-glob.c ssh.c
1082 sshconnect2.c sshd.c]
1083 minor KNF
1084 - deraadt@cvs.openbsd.org 2002/07/01 16:15:25
1085 [msg.c]
1086 %u
1087 - markus@cvs.openbsd.org 2002/07/01 19:48:46
1088 [sshconnect2.c]
1089 for compression=yes, we fallback to no-compression if the server does
1090 not support compression, vice versa for compression=no. ok mouring@
1091 - markus@cvs.openbsd.org 2002/07/03 09:55:38
1092 [ssh-keysign.c]
1093 use RSA_blinding_on() for rsa hostkeys (suggested by Bill Sommerfeld)
1094 in order to avoid a possible Kocher timing attack pointed out by Charles
1095 Hannum; ok provos@
1096 - markus@cvs.openbsd.org 2002/07/03 14:21:05
1097 [ssh-keysign.8 ssh-keysign.c ssh.c ssh_config]
1098 re-enable ssh-keysign's sbit, but make ssh-keysign read
1099 /etc/ssh/ssh_config and exit if HostbasedAuthentication is disabled
1100 globally. based on discussions with deraadt, itojun and sommerfeld;
1101 ok itojun@
1102 - (bal) Failed password attempts don't increment counter on AIX. Bug #145
1103 - (bal) Missed Makefile.in change. keysign needs readconf.o
1104 - (bal) Clean up aix_usrinfo(). Ignore TTY= period I guess.
1105
110620020702
1107 - (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc &
1108 friends consistently. Spotted by Solar Designer <solar@openwall.com>
1109
111020020629
1111 - (bal) fix to auth2-pam.c to swap fatal() arguments, A bit of style
1112 clean up while I'm near it.
1113
111420020628
1115 - (stevesk) [sshd_config] PAMAuthenticationViaKbdInt no; commented
1116 options should contain default value. from solar.
1117 - (bal) Cygwin uid0 fix by vinschen@redhat.com
1118 - (bal) s/config.h/includes.h/ in openbsd-compat/ for *.c. Otherwise wise
1119 have issues of our fixes not propogating right (ie bcopy instead of
1120 memmove). OK tim
1121 - (bal) FreeBSD needs <sys/types.h> to detect if mmap() is supported.
1122 Bug #303
1123
112420020627
1125 - OpenBSD CVS Sync
1126 - deraadt@cvs.openbsd.org 2002/06/26 14:49:36
1127 [monitor.c]
1128 correct %u
1129 - deraadt@cvs.openbsd.org 2002/06/26 14:50:04
1130 [monitor_fdpass.c]
1131 use ssize_t for recvmsg() and sendmsg() return
1132 - markus@cvs.openbsd.org 2002/06/26 14:51:33
1133 [ssh-add.c]
1134 fix exit code for -X/-x
1135 - deraadt@cvs.openbsd.org 2002/06/26 15:00:32
1136 [monitor_wrap.c]
1137 more %u
1138 - markus@cvs.openbsd.org 2002/06/26 22:27:32
1139 [ssh-keysign.c]
1140 bug #304, xfree(data) called to early; openssh@sigint.cs.purdue.edu
1141
114220020626
1143 - (stevesk) [monitor.c] remove duplicate proto15 dispatch entry for PAM
1144 - (bal) OpenBSD CVS Sync
1145 - markus@cvs.openbsd.org 2002/06/23 21:34:07
1146 [channels.c]
1147 tcode is u_int
1148 - markus@cvs.openbsd.org 2002/06/24 13:12:23
1149 [ssh-agent.1]
1150 the socket name contains ssh-agent's ppid; via mpech@ from form@
1151 - markus@cvs.openbsd.org 2002/06/24 14:33:27
1152 [channels.c channels.h clientloop.c serverloop.c]
1153 move channel counter to u_int
1154 - markus@cvs.openbsd.org 2002/06/24 14:55:38
1155 [authfile.c kex.c ssh-agent.c]
1156 cat to (void) when output from buffer_get_X is ignored
1157 - itojun@cvs.openbsd.org 2002/06/24 15:49:22
1158 [msg.c]
1159 printf type pedant
1160 - deraadt@cvs.openbsd.org 2002/06/24 17:57:20
1161 [sftp-server.c sshpty.c]
1162 explicit (u_int) for uid and gid
1163 - markus@cvs.openbsd.org 2002/06/25 16:22:42
1164 [authfd.c]
1165 unnecessary cast
1166 - markus@cvs.openbsd.org 2002/06/25 18:51:04
1167 [sshd.c]
1168 lightweight do_setusercontext after chroot()
1169 - (bal) Updated AIX package build. Patch by dtucker@zip.com.au
1170 - (tim) [Makefile.in] fix test on installing ssh-rand-helper.8
1171 - (bal) added back in error check for mmap(). I screwed up, Pointed
1172 out by stevesk@
1173 - (tim) [README.privsep] UnixWare tip no longer needed.
1174 - (bal) fixed NeXTStep missing munmap() issue. It defines HAVE_MMAP,
1175 but it all damned lies.
1176 - (stevesk) [README.privsep] more for sshd pseudo-account.
1177 - (tim) [contrib/caldera/openssh.spec] add support for privsep
1178 - (djm) setlogin needs pgid==pid on BSD/OS; from itojun@
1179 - (djm) OpenBSD CVS Sync
1180 - markus@cvs.openbsd.org 2002/06/26 08:53:12
1181 [bufaux.c]
1182 limit size of BNs to 8KB; ok provos/deraadt
1183 - markus@cvs.openbsd.org 2002/06/26 08:54:18
1184 [buffer.c]
1185 limit append to 1MB and buffers to 10MB
1186 - markus@cvs.openbsd.org 2002/06/26 08:55:02
1187 [channels.c]
1188 limit # of channels to 10000
1189 - markus@cvs.openbsd.org 2002/06/26 08:58:26
1190 [session.c]
1191 limit # of env vars to 1000; ok deraadt/djm
1192 - deraadt@cvs.openbsd.org 2002/06/26 13:20:57
1193 [monitor.c]
1194 be careful in mm_zalloc
1195 - deraadt@cvs.openbsd.org 2002/06/26 13:49:26
1196 [session.c]
1197 disclose less information from environment files; based on input
1198 from djm, and dschultz@uclink.Berkeley.EDU
1199 - markus@cvs.openbsd.org 2002/06/26 13:55:37
1200 [auth2-chall.c]
1201 make sure # of response matches # of queries, fixes int overflow;
1202 from ISS
1203 - markus@cvs.openbsd.org 2002/06/26 13:56:27
1204 [version.h]
1205 3.4
1206 - (djm) Require krb5 devel for RPM build w/ KrbV
1207 - (djm) Improve PAMAuthenticationViaKbdInt text from Nalin Dahyabhai
1208 <nalin@redhat.com>
1209 - (djm) Update spec files for release
1210 - (djm) Fix int overflow in auth2-pam.c, similar to one discovered by ISS
1211 - (djm) Release 3.4p1
1212 - (tim) [contrib/caldera/openssh.spec] remove 2 configure options I put in
1213 by mistake
1214
121520020625
1216 - (stevesk) [INSTALL acconfig.h configure.ac defines.h] remove --with-rsh
1217 - (stevesk) [README.privsep] minor updates
1218 - (djm) Create privsep directory and warn if privsep user is missing
1219 during make install
1220 - (bal) Started list of PrivSep issues in TODO
1221 - (bal) if mmap() is substandard, don't allow compression on server side.
1222 Post 'event' we will add more options.
1223 - (tim) [contrib/caldera/openssh.spec] Sync with Caldera
1224 - (bal) moved aix_usrinfo() and noted not setting real TTY. Patch by
1225 dtucker@zip.com.au
1226 - (tim) [acconfig.h configure.ac sshd.c] BROKEN_FD_PASSING fix from Markus
1227 for Cygwin, Cray, & SCO
1228
122920020624
1230 - OpenBSD CVS Sync
1231 - deraadt@cvs.openbsd.org 2002/06/23 03:25:50
1232 [tildexpand.c]
1233 KNF
1234 - deraadt@cvs.openbsd.org 2002/06/23 03:26:19
1235 [cipher.c key.c]
1236 KNF
1237 - deraadt@cvs.openbsd.org 2002/06/23 03:30:58
1238 [scard.c ssh-dss.c ssh-rsa.c sshconnect.c sshconnect2.c sshd.c sshlogin.c
1239 sshpty.c]
1240 various KNF and %d for unsigned
1241 - deraadt@cvs.openbsd.org 2002/06/23 09:30:14
1242 [sftp-client.c sftp-client.h sftp-common.c sftp-int.c sftp-server.c
1243 sftp.c]
1244 bunch of u_int vs int stuff
1245 - deraadt@cvs.openbsd.org 2002/06/23 09:39:55
1246 [ssh-keygen.c]
1247 u_int stuff
1248 - deraadt@cvs.openbsd.org 2002/06/23 09:46:51
1249 [bufaux.c servconf.c]
1250 minor KNF. things the fingers do while you read
1251 - deraadt@cvs.openbsd.org 2002/06/23 10:29:52
1252 [ssh-agent.c sshd.c]
1253 some minor KNF and %u
1254 - deraadt@cvs.openbsd.org 2002/06/23 20:39:45
1255 [session.c]
1256 compression_level is u_int
1257 - deraadt@cvs.openbsd.org 2002/06/23 21:06:13
1258 [sshpty.c]
1259 KNF
1260 - deraadt@cvs.openbsd.org 2002/06/23 21:06:41
1261 [channels.c channels.h session.c session.h]
1262 display, screen, row, col, xpixel, ypixel are u_int; markus ok
1263 - deraadt@cvs.openbsd.org 2002/06/23 21:10:02
1264 [packet.c]
1265 packet_get_int() returns unsigned for reason & seqnr
1266 - (bal) Also fixed IPADDR_IN_DISPLAY case where display, screen, row, col,
1267 xpixel are u_int.
1268
1269
127020020623
1271 - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX.
1272 - (bal) removed GNUism for getops in ssh-agent since glibc lacks optreset.
1273 - (bal) add extern char *getopt. Based on report by dtucker@zip.com.au
1274 - OpenBSD CVS Sync
1275 - stevesk@cvs.openbsd.org 2002/06/22 02:00:29
1276 [ssh.h]
1277 correct comment
1278 - stevesk@cvs.openbsd.org 2002/06/22 02:40:23
1279 [ssh.1]
1280 section 5 not 4 for ssh_config
1281 - naddy@cvs.openbsd.org 2002/06/22 11:51:39
1282 [ssh.1]
1283 typo
1284 - stevesk@cvs.openbsd.org 2002/06/22 16:32:54
1285 [sshd.8]
1286 add /var/empty in FILES section
1287 - stevesk@cvs.openbsd.org 2002/06/22 16:40:19
1288 [sshd.c]
1289 check /var/empty owner mode; ok provos@
1290 - stevesk@cvs.openbsd.org 2002/06/22 16:41:57
1291 [scp.1]
1292 typo
1293 - stevesk@cvs.openbsd.org 2002/06/22 16:45:29
1294 [ssh-agent.1 sshd.8 sshd_config.5]
1295 use process ID vs. pid/PID/process identifier
1296 - stevesk@cvs.openbsd.org 2002/06/22 20:05:27
1297 [sshd.c]
1298 don't call setsid() if debugging or run from inetd; no "Operation not
1299 permitted" errors now; ok millert@ markus@
1300 - stevesk@cvs.openbsd.org 2002/06/22 23:09:51
1301 [monitor.c]
1302 save auth method before monitor_reset_key_state(); bugzilla bug #284;
1303 ok provos@
1304
1305$Id: ChangeLog,v 1.2648.2.1 2003/04/29 09:12:07 djm Exp $
diff --git a/INSTALL b/INSTALL
index f5ab0dbd3..93070b105 100644
--- a/INSTALL
+++ b/INSTALL
@@ -123,7 +123,7 @@ it if lastlog is installed in a different place.
123 123
124--without-lastlog will disable lastlog support entirely. 124--without-lastlog will disable lastlog support entirely.
125 125
126--with-sia, --without-sia will enable or disable OSF1's Security 126--with-osfsia, --without-osfsia will enable or disable OSF1's Security
127Integration Architecture. The default for OSF1 machines is enable. 127Integration Architecture. The default for OSF1 machines is enable.
128 128
129--with-kerberos4=PATH will enable Kerberos IV support. You will need 129--with-kerberos4=PATH will enable Kerberos IV support. You will need
@@ -217,4 +217,4 @@ Please refer to the "reporting bugs" section of the webpage at
217http://www.openssh.com/ 217http://www.openssh.com/
218 218
219 219
220$Id: INSTALL,v 1.55 2002/07/25 04:36:25 djm Exp $ 220$Id: INSTALL,v 1.56 2003/05/24 01:41:16 dtucker Exp $
diff --git a/LICENCE b/LICENCE
index 19d4c74e6..b47556dda 100644
--- a/LICENCE
+++ b/LICENCE
@@ -76,14 +76,6 @@ OpenSSH contains no GPL code.
76 POSSIBILITY OF SUCH DAMAGES. 76 POSSIBILITY OF SUCH DAMAGES.
77 77
782) 782)
79 The 32-bit CRC implementation in crc32.c is due to Gary S. Brown.
80 Comments in the file indicate it may be used for any purpose without
81 restrictions:
82
83 * COPYRIGHT (C) 1986 Gary S. Brown. You may use this program, or
84 * code or tables extracted from it, as desired without restriction.
85
863)
87 The 32-bit CRC compensation attack detector in deattack.c was 79 The 32-bit CRC compensation attack detector in deattack.c was
88 contributed by CORE SDI S.A. under a BSD-style license. 80 contributed by CORE SDI S.A. under a BSD-style license.
89 81
@@ -104,7 +96,7 @@ OpenSSH contains no GPL code.
104 * Ariel Futoransky <futo@core-sdi.com> 96 * Ariel Futoransky <futo@core-sdi.com>
105 * <http://www.core-sdi.com> 97 * <http://www.core-sdi.com>
106 98
1074) 993)
108 ssh-keygen was contributed by David Mazieres under a BSD-style 100 ssh-keygen was contributed by David Mazieres under a BSD-style
109 license. 101 license.
110 102
@@ -114,7 +106,7 @@ OpenSSH contains no GPL code.
114 * permitted provided that due credit is given to the author and the 106 * permitted provided that due credit is given to the author and the
115 * OpenBSD project by leaving this copyright notice intact. 107 * OpenBSD project by leaving this copyright notice intact.
116 108
1175) 1094)
118 The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers 110 The Rijndael implementation by Vincent Rijmen, Antoon Bosselaers
119 and Paulo Barreto is in the public domain and distributed 111 and Paulo Barreto is in the public domain and distributed
120 with the following license: 112 with the following license:
@@ -141,12 +133,10 @@ OpenSSH contains no GPL code.
141 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 133 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
142 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 134 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
143 135
1446) 1365)
145 One component of the ssh source code is under a 4-clause BSD license, 137 One component of the ssh source code is under a 3-clause BSD license,
146 held by the University of California, since we pulled these parts from 138 held by the University of California, since we pulled these parts from
147 original Berkeley code. The Regents of the University of California 139 original Berkeley code.
148 have declared that term 3 is no longer enforceable on their source code,
149 but we retain that license as is.
150 140
151 * Copyright (c) 1983, 1990, 1992, 1993, 1995 141 * Copyright (c) 1983, 1990, 1992, 1993, 1995
152 * The Regents of the University of California. All rights reserved. 142 * The Regents of the University of California. All rights reserved.
@@ -159,11 +149,7 @@ OpenSSH contains no GPL code.
159 * 2. Redistributions in binary form must reproduce the above copyright 149 * 2. Redistributions in binary form must reproduce the above copyright
160 * notice, this list of conditions and the following disclaimer in the 150 * notice, this list of conditions and the following disclaimer in the
161 * documentation and/or other materials provided with the distribution. 151 * documentation and/or other materials provided with the distribution.
162 * 3. All advertising materials mentioning features or use of this software 152 * 3. Neither the name of the University nor the names of its contributors
163 * must display the following acknowledgement:
164 * This product includes software developed by the University of
165 * California, Berkeley and its contributors.
166 * 4. Neither the name of the University nor the names of its contributors
167 * may be used to endorse or promote products derived from this software 153 * may be used to endorse or promote products derived from this software
168 * without specific prior written permission. 154 * without specific prior written permission.
169 * 155 *
@@ -179,7 +165,7 @@ OpenSSH contains no GPL code.
179 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 165 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
180 * SUCH DAMAGE. 166 * SUCH DAMAGE.
181 167
1827) 1686)
183 Remaining components of the software are provided under a standard 169 Remaining components of the software are provided under a standard
184 2-term BSD licence with the following names as copyright holders: 170 2-term BSD licence with the following names as copyright holders:
185 171
@@ -192,6 +178,31 @@ OpenSSH contains no GPL code.
192 Kevin Steves 178 Kevin Steves
193 Daniel Kouril 179 Daniel Kouril
194 Per Allansson 180 Per Allansson
181 Wesley Griffin
182 Per Allansson
183 Nils Nordman
184 Simon Wilkinson
185
186 Portable OpenSSH additionally includes code from the following copyright
187 holders, also under the 2-term BSD license:
188
189 Ben Lindstrom
190 Tim Rice
191 Andre Lucas
192 Chris Adams
193 Corinna Vinschen
194 Cray Inc.
195 Denis Parker
196 Gert Doering
197 Jakob Schlyter
198 Jason Downs
199 Juha Yrjölä
200 Michael Stone
201 Networks Associates Technology, Inc.
202 Solar Designer
203 Todd C. Miller
204 Wayne Schroeder
205 William Jones
195 206
196 * Redistribution and use in source and binary forms, with or without 207 * Redistribution and use in source and binary forms, with or without
197 * modification, are permitted provided that the following conditions 208 * modification, are permitted provided that the following conditions
@@ -212,3 +223,110 @@ OpenSSH contains no GPL code.
212 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 223 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
213 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 224 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
214 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 225 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
226
2278) Portable OpenSSH contains the following additional licenses:
228
229 a) md5crypt.c, md5crypt.h
230
231 * "THE BEER-WARE LICENSE" (Revision 42):
232 * <phk@login.dknet.dk> wrote this file. As long as you retain this
233 * notice you can do whatever you want with this stuff. If we meet
234 * some day, and you think this stuff is worth it, you can buy me a
235 * beer in return. Poul-Henning Kamp
236
237 b) snprintf replacement
238
239 * Copyright Patrick Powell 1995
240 * This code is based on code written by Patrick Powell
241 * (papowell@astart.com) It may be used for any purpose as long as this
242 * notice remains intact on all source code distributions
243
244 c) Compatibility code (openbsd-compat)
245
246 Apart from the previously mentioned licenses, various pieces of code
247 in the openbsd-compat/ subdirectory are licensed as follows:
248
249 Some code is licensed under a 3-term BSD license, to the following
250 copyright holders:
251
252 Todd C. Miller
253 Theo de Raadt
254 Damien Miller
255 Eric P. Allman
256 The Regents of the University of California
257
258 * Redistribution and use in source and binary forms, with or without
259 * modification, are permitted provided that the following conditions
260 * are met:
261 * 1. Redistributions of source code must retain the above copyright
262 * notice, this list of conditions and the following disclaimer.
263 * 2. Redistributions in binary form must reproduce the above copyright
264 * notice, this list of conditions and the following disclaimer in the
265 * documentation and/or other materials provided with the distribution.
266 * 3. Neither the name of the University nor the names of its contributors
267 * may be used to endorse or promote products derived from this software
268 * without specific prior written permission.
269 *
270 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
271 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
272 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
273 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
274 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
275 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
276 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
277 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
278 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
279 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
280 * SUCH DAMAGE.
281
282 Some code is licensed under an ISC-style license, to the following
283 copyright holders:
284
285 Internet Software Consortium.
286 Todd C. Miller
287
288 * Permission to use, copy, modify, and distribute this software for any
289 * purpose with or without fee is hereby granted, provided that the above
290 * copyright notice and this permission notice appear in all copies.
291 *
292 * THE SOFTWARE IS PROVIDED "AS IS" AND TODD C. MILLER DISCLAIMS ALL
293 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
294 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL TODD C. MILLER BE LIABLE
295 * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
296 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
297 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
298 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
299
300 Some code is licensed under a MIT-style license to the following
301 copyright holders:
302
303 Free Software Foundation, Inc.
304
305 * Permission is hereby granted, free of charge, to any person obtaining a *
306 * copy of this software and associated documentation files (the *
307 * "Software"), to deal in the Software without restriction, including *
308 * without limitation the rights to use, copy, modify, merge, publish, *
309 * distribute, distribute with modifications, sublicense, and/or sell *
310 * copies of the Software, and to permit persons to whom the Software is *
311 * furnished to do so, subject to the following conditions: *
312 * *
313 * The above copyright notice and this permission notice shall be included *
314 * in all copies or substantial portions of the Software. *
315 * *
316 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
317 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
318 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
319 * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
320 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
321 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
322 * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
323 * *
324 * Except as contained in this notice, the name(s) of the above copyright *
325 * holders shall not be used in advertising or otherwise to promote the *
326 * sale, use or other dealings in this Software without prior written *
327 * authorization. *
328 ****************************************************************************/
329
330
331------
332$OpenBSD: LICENCE,v 1.17 2003/08/22 20:55:06 markus Exp $
diff --git a/Makefile.in b/Makefile.in
index 39bbf344d..8a8774461 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,4 +1,4 @@
1# $Id: Makefile.in,v 1.228.2.1 2003/04/29 09:12:08 djm Exp $ 1# $Id: Makefile.in,v 1.249 2003/09/14 01:40:36 dtucker Exp $
2 2
3# uncomment if you run a non bourne compatable shell. Ie. csh 3# uncomment if you run a non bourne compatable shell. Ie. csh
4#SHELL = @SH@ 4#SHELL = @SH@
@@ -46,6 +46,7 @@ LIBS=@LIBS@
46LIBPAM=@LIBPAM@ 46LIBPAM=@LIBPAM@
47LIBWRAP=@LIBWRAP@ 47LIBWRAP=@LIBWRAP@
48AR=@AR@ 48AR=@AR@
49AWK=@AWK@
49RANLIB=@RANLIB@ 50RANLIB=@RANLIB@
50INSTALL=@INSTALL@ 51INSTALL=@INSTALL@
51PERL=@PERL@ 52PERL=@PERL@
@@ -61,13 +62,14 @@ INSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@
61TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} sftp-server$(EXEEXT) sftp$(EXEEXT) 62TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} sftp-server$(EXEEXT) sftp$(EXEEXT)
62 63
63LIBSSH_OBJS=authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o \ 64LIBSSH_OBJS=authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o \
64 cipher.o compat.o compress.o crc32.o deattack.o fatal.o \ 65 cipher.o cipher-aes.o cipher-bf1.o cipher-ctr.o cipher-3des1.o \
65 hostfile.o log.o match.o mpaux.o nchan.o packet.o radix.o readpass.o \ 66 compat.o compress.o crc32.o deattack.o fatal.o \
66 rsa.o tildexpand.o ttymodes.o xmalloc.o atomicio.o \ 67 hostfile.o log.o match.o moduli.o mpaux.o nchan.o packet.o \
68 readpass.o rsa.o tildexpand.o ttymodes.o xmalloc.o atomicio.o \
67 key.o dispatch.o kex.o mac.o uuencode.o misc.o \ 69 key.o dispatch.o kex.o mac.o uuencode.o misc.o \
68 rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o kexgex.o \ 70 rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o kexgex.o \
69 kexdhc.o kexgexc.o scard.o msg.o progressmeter.o \ 71 kexdhc.o kexgexc.o scard.o msg.o progressmeter.o dns.o \
70 entropy.o 72 entropy.o scard-opensc.o gss-genr.o
71 73
72SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ 74SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
73 sshconnect.o sshconnect1.o sshconnect2.o 75 sshconnect.o sshconnect1.o sshconnect2.o
@@ -80,8 +82,9 @@ SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
80 auth2-none.o auth2-passwd.o auth2-pubkey.o \ 82 auth2-none.o auth2-passwd.o auth2-pubkey.o \
81 monitor_mm.o monitor.o monitor_wrap.o monitor_fdpass.o \ 83 monitor_mm.o monitor.o monitor_wrap.o monitor_fdpass.o \
82 kexdhs.o kexgexs.o \ 84 kexdhs.o kexgexs.o \
83 auth-krb5.o auth-krb4.o \ 85 auth-krb5.o \
84 loginrec.o auth-pam.o auth2-pam.o auth-sia.o md5crypt.o 86 auth2-gss.o gss-serv.o gss-serv-krb5.o \
87 loginrec.o auth-pam.o auth-sia.o md5crypt.o
85 88
86MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out ssh-keysign.8.out sshd_config.5.out ssh_config.5.out 89MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out ssh-keysign.8.out sshd_config.5.out ssh_config.5.out
87MANPAGES_IN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 ssh-keysign.8 sshd_config.5 ssh_config.5 90MANPAGES_IN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 ssh-keysign.8 sshd_config.5 ssh_config.5
@@ -109,11 +112,11 @@ PATHSUBS = \
109 112
110FIXPATHSCMD = $(SED) $(PATHSUBS) 113FIXPATHSCMD = $(SED) $(PATHSUBS)
111 114
112all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) 115all: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS)
113 116
114$(LIBSSH_OBJS): config.h 117$(LIBSSH_OBJS): Makefile.in config.h
115$(SSHOBJS): config.h 118$(SSHOBJS): Makefile.in config.h
116$(SSHDOBJS): config.h 119$(SSHDOBJS): Makefile.in config.h
117 120
118.c.o: 121.c.o:
119 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< 122 $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
@@ -171,7 +174,7 @@ $(MANPAGES): $(MANPAGES_IN)
171 manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \ 174 manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \
172 fi; \ 175 fi; \
173 if test "$(MANTYPE)" = "man"; then \ 176 if test "$(MANTYPE)" = "man"; then \
174 $(FIXPATHSCMD) $${manpage} | $(PERL) $(srcdir)/mdoc2man.pl > $@; \ 177 $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \
175 else \ 178 else \
176 $(FIXPATHSCMD) $${manpage} > $@; \ 179 $(FIXPATHSCMD) $${manpage} > $@; \
177 fi 180 fi
@@ -180,10 +183,20 @@ $(CONFIGFILES): $(CONFIGFILES_IN)
180 conffile=`echo $@ | sed 's/.out$$//'`; \ 183 conffile=`echo $@ | sed 's/.out$$//'`; \
181 $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@ 184 $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@
182 185
186ssh_prng_cmds.out: ssh_prng_cmds
187 if test ! -z "$(INSTALL_SSH_PRNG_CMDS)"; then \
188 $(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \
189 fi
190
191# fake rule to stop make trying to compile moduli.o into a binary "modulo"
192moduli:
193 echo
194
183clean: 195clean:
184 rm -f *.o *.a $(TARGETS) logintest config.cache config.log 196 rm -f *.o *.a $(TARGETS) logintest config.cache config.log
185 rm -f *.out core 197 rm -f *.out core
186 (cd openbsd-compat && $(MAKE) clean) 198 (cd openbsd-compat && $(MAKE) clean)
199 (cd regress && $(MAKE) clean)
187 200
188distclean: 201distclean:
189 rm -f *.o *.a $(TARGETS) logintest config.cache config.log 202 rm -f *.o *.a $(TARGETS) logintest config.cache config.log
@@ -192,16 +205,14 @@ distclean:
192 rm -rf autom4te.cache 205 rm -rf autom4te.cache
193 (cd openbsd-compat && $(MAKE) distclean) 206 (cd openbsd-compat && $(MAKE) distclean)
194 (cd scard && $(MAKE) distclean) 207 (cd scard && $(MAKE) distclean)
208 (cd regress && $(MAKE) distclean)
195 209
196veryclean: 210veryclean: distclean
197 rm -f configure config.h.in *.0 211 rm -f configure config.h.in *.0
198 rm -f *.o *.a $(TARGETS) logintest config.cache config.log
199 rm -f *.out core
200 rm -f Makefile config.h config.status ssh_prng_cmds *~
201 (cd openbsd-compat && $(MAKE) distclean)
202 (cd scard && $(MAKE) distclean)
203 212
204mrproper: distclean 213mrproper: veryclean
214
215realclean: veryclean
205 216
206catman-do: 217catman-do:
207 @for f in $(MANPAGES_IN) ; do \ 218 @for f in $(MANPAGES_IN) ; do \
@@ -215,8 +226,8 @@ distprep: catman-do
215 $(AUTORECONF) 226 $(AUTORECONF)
216 (cd scard && $(MAKE) -f Makefile.in distprep) 227 (cd scard && $(MAKE) -f Makefile.in distprep)
217 228
218install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files host-key check-config 229install: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files host-key check-config
219install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files 230install-nokeys: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files
220 231
221check-config: 232check-config:
222 -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config 233 -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
@@ -280,7 +291,6 @@ install-files: scard-install
280 echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \ 291 echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
281 fi 292 fi
282 @if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \ 293 @if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
283 $(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \
284 if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \ 294 if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \
285 $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \ 295 $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \
286 else \ 296 else \
@@ -359,3 +369,32 @@ uninstall:
359 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 369 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
360 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 370 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
361 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 371 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
372
373tests: $(TARGETS)
374 BUILDDIR=`pwd`; \
375 [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \
376 TEST_SSH_SSH="$${BUILDDIR}/ssh"; \
377 TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \
378 TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \
379 TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \
380 TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \
381 TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \
382 TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \
383 TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \
384 cd $(srcdir)/regress || exit $$?; \
385 $(MAKE) \
386 .OBJDIR="$${BUILDDIR}/regress" \
387 .CURDIR="`pwd`" \
388 BUILDDIR="$${BUILDDIR}" \
389 OBJ="$${BUILDDIR}/regress/" \
390 PATH="$${BUILDDIR}:$${PATH}" \
391 TEST_SSH_SSH="$${TEST_SSH_SSH}" \
392 TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \
393 TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \
394 TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \
395 TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \
396 TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \
397 TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \
398 TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \
399 EXEEXT="$(EXEEXT)" \
400 $@
diff --git a/README.dns b/README.dns
new file mode 100644
index 000000000..e24092e03
--- /dev/null
+++ b/README.dns
@@ -0,0 +1,52 @@
1How to verify host keys using OpenSSH and DNS
2---------------------------------------------
3
4OpenSSH contains experimental support for verifying host keys using DNS
5as described in draft-ietf-secsh-dns-xx.txt. The document contains
6very brief instructions on how to test this feature. Configuring DNS
7and DNSSEC is out of the scope of this document.
8
9
10(1) Enable DNS fingerprint support in OpenSSH
11
12 configure --with-dns
13
14(2) Generate and publish the DNS RR
15
16To create a DNS resource record (RR) containing a fingerprint of the
17public host key, use the following command:
18
19 ssh-keygen -r hostname -f keyfile -g
20
21where "hostname" is your fully qualified hostname and "keyfile" is the
22file containing the public host key file. If you have multiple keys,
23you should generate one RR for each key.
24
25In the example above, ssh-keygen will print the fingerprint in a
26generic DNS RR format parsable by most modern name server
27implementations. If your nameserver has support for the SSHFP RR, as
28defined by the draft, you can omit the -g flag and ssh-keygen will
29print a standard RR.
30
31To publish the fingerprint using the DNS you must add the generated RR
32to your DNS zone file and sign your zone.
33
34
35(3) Enable the ssh client to verify host keys using DNS
36
37To enable the ssh client to verify host keys using DNS, you have to
38add the following option to the ssh configuration file
39($HOME/.ssh/config or /etc/ssh/ssh_config):
40
41 VerifyHostKeyDNS yes
42
43Upon connection the client will try to look up the fingerprint RR
44using DNS. If the fingerprint received from the DNS server matches
45the remote host key, the user will be notified.
46
47
48 Jakob Schlyter
49 Wesley Griffin
50
51
52$OpenBSD: README.dns,v 1.1 2003/05/14 18:16:20 jakob Exp $
diff --git a/README.privsep b/README.privsep
index e8bf1db34..64adad83b 100644
--- a/README.privsep
+++ b/README.privsep
@@ -40,8 +40,7 @@ Compression will be disabled on systems without a working mmap MAP_ANON.
40 40
41PAM-enabled OpenSSH is known to function with privsep on Linux. 41PAM-enabled OpenSSH is known to function with privsep on Linux.
42It does not function on HP-UX with a trusted system 42It does not function on HP-UX with a trusted system
43configuration. PAMAuthenticationViaKbdInt does not function with 43configuration.
44privsep.
45 44
46On Compaq Tru64 Unix, only the pre-authentication part of privsep is 45On Compaq Tru64 Unix, only the pre-authentication part of privsep is
47supported. Post-authentication privsep is disabled automatically (so 46supported. Post-authentication privsep is disabled automatically (so
@@ -62,4 +61,4 @@ process 1005 is the sshd process listening for new connections.
62process 6917 is the privileged monitor process, 6919 is the user owned 61process 6917 is the privileged monitor process, 6919 is the user owned
63sshd process and 6921 is the shell process. 62sshd process and 6921 is the shell process.
64 63
65$Id: README.privsep,v 1.11 2003/03/21 01:18:09 mouring Exp $ 64$Id: README.privsep,v 1.12 2003/08/26 00:48:15 djm Exp $
diff --git a/README.smartcard b/README.smartcard
index 29bec8dc6..88810fc83 100644
--- a/README.smartcard
+++ b/README.smartcard
@@ -1,62 +1,66 @@
1How to use smartcards with OpenSSH? 1How to use smartcards with OpenSSH?
2 2
3OpenSSH contains experimental support for authentication using Cyberflex 3OpenSSH contains experimental support for authentication using
4smartcards and TODOS card readers, in addition to the cards with PKCS#15 4Cyberflex smartcards and TODOS card readers, in addition to the cards
5structure supported by OpenSC. 5with PKCS#15 structure supported by OpenSC. To enable this you
6need to:
6 7
7WARNING: Smartcard support is still in development. 8Using libsectok:
8Keyfile formats, etc are still subject to change.
9 9
10To enable sectok support: 10(1) enable sectok support in OpenSSH:
11 11
12(1) install sectok: 12 $ ./configure --with-sectok
13 13
14 Sources and instructions are available from 14(2) If you have used a previous version of ssh with your card, you
15 http://www.citi.umich.edu/projects/smartcard/sectok.html 15 must remove the old applet and keys.
16
17(2) enable sectok support in OpenSSH:
18 16
19 $ ./configure --with-sectok[=/path/to/libsectok] [options] 17 $ sectok
18 sectok> login -d
19 sectok> junload Ssh.bin
20 sectok> delete 0012
21 sectok> delete sh
22 sectok> quit
20 23
21(3) load the Java Cardlet to the Cyberflex card: 24(3) load the Java Cardlet to the Cyberflex card and set card passphrase:
22 25
23 $ sectok 26 $ sectok
24 sectok> login -d 27 sectok> login -d
25 sectok> jload /usr/libdata/ssh/Ssh.bin 28 sectok> jload /usr/libdata/ssh/Ssh.bin
29 sectok> setpass
30 Enter new AUT0 passphrase:
31 Re-enter passphrase:
26 sectok> quit 32 sectok> quit
27 33
28(4) load a RSA key to the card: 34 Do not forget the passphrase. There is no way to
35 recover if you do.
29 36
30 Please don't use your production RSA keys, since 37 IMPORTANT WARNING: If you attempt to login with the
31 with the current version of sectok/ssh-keygen 38 wrong passphrase three times in a row, you will
32 the private key file is still readable. 39 destroy your card.
33 40
34 $ ssh-keygen -f /path/to/rsakey -U <readernum, eg. 0> 41(4) load a RSA key to the card:
42
43 $ ssh-keygen -f /path/to/rsakey -U 1
44 (where 1 is the reader number, you can also try 0)
35 45
36 In spite of the name, this does not generate a key. 46 In spite of the name, this does not generate a key.
37 It just loads an already existing key on to the card. 47 It just loads an already existing key on to the card.
38 48
39(5) optional: 49(5) Optional: If you don't want to use a card passphrase, change the
40 50 acl on the private key file:
41 Change the card password so that only you can
42 read the private key:
43 51
44 $ sectok 52 $ sectok
45 sectok> login -d 53 sectok> login -d
46 sectok> setpass 54 sectok> acl 0012 world: w
55 world: w
56 AUT0: w inval
47 sectok> quit 57 sectok> quit
48 58
49 This prevents reading the key but not use of the 59 If you do this, anyone who has access to your card
50 key by the card applet. 60 can assume your identity. This is not recommended.
51
52 Do not forget the passphrase. There is no way to
53 recover if you do.
54 61
55 IMPORTANT WARNING: If you attempt to login with the
56 wrong passphrase three times in a row, you will
57 destroy your card.
58 62
59To enable OpenSC support: 63Using OpenSC:
60 64
61(1) install OpenSC: 65(1) install OpenSC:
62 66
@@ -71,15 +75,19 @@ To enable OpenSC support:
71 75
72 Not supported yet. 76 Not supported yet.
73 77
74Common smartcard options: 78
79Common operations:
75 80
76(1) tell the ssh client to use the card reader: 81(1) tell the ssh client to use the card reader:
77 82
78 $ ssh -I <readernum, eg. 0> otherhost 83 $ ssh -I 1 otherhost
79 84
80(2) or tell the agent (don't forget to restart) to use the smartcard: 85(2) or tell the agent (don't forget to restart) to use the smartcard:
81 86
82 $ ssh-add -s <readernum, eg. 0> 87 $ ssh-add -s 1
88
83 89
84-markus, 90-markus,
85Sat Apr 13 13:48:10 EEST 2002 91Tue Jul 17 23:54:51 CEST 2001
92
93$OpenBSD: README.smartcard,v 1.8 2002/03/26 18:56:23 rees Exp $
diff --git a/TODO b/TODO
index de83000f5..bca818523 100644
--- a/TODO
+++ b/TODO
@@ -1,4 +1,19 @@
1Documentation:
2
3- Update the docs
4 - Update README
5 - Update INSTALL
6 - Merge INSTALL & README.privsep
7
8- Install FAQ?
9
10- General FAQ on S/Key, TIS, RSA, RSA2, DSA, etc and suggestions on when it
11 would be best to use them.
12
13- Create a Documentation/ directory?
14
1Programming: 15Programming:
16
2- Grep for 'XXX' comments and fix 17- Grep for 'XXX' comments and fix
3 18
4- Link order is incorrect for some systems using Kerberos 4 and AFS. Result 19- Link order is incorrect for some systems using Kerberos 4 and AFS. Result
@@ -21,8 +36,9 @@ Programming:
21 and maybe support alternate forms of authentications like OPIE via 36 and maybe support alternate forms of authentications like OPIE via
22 pam? 37 pam?
23 38
24- Rework PAM ChallengeResponseAuthentication 39- Improve PAM ChallengeResponseAuthentication
25 - Use kbdint request packet with 0 prompts for informational messages 40 - Informational messages
41 - chauthtok
26 - Use different PAM service name for kbdint vs regular auth (suggest from 42 - Use different PAM service name for kbdint vs regular auth (suggest from
27 Solar Designer) 43 Solar Designer)
28 - Ability to select which ChallengeResponseAuthentications may be used 44 - Ability to select which ChallengeResponseAuthentications may be used
@@ -35,70 +51,17 @@ Programming:
35- Finish integrating kernel-level auditing code for IRIX and SOLARIS 51- Finish integrating kernel-level auditing code for IRIX and SOLARIS
36 (Gilbert.r.loomis@saic.com) 52 (Gilbert.r.loomis@saic.com)
37 53
38- sftp-server: Rework to step down to 32bit ints if the platform
39 lacks 'long long' == 64bit (Notable SCO w/ SCO compiler)
40
41- Linux hangs for 20 seconds when you do "sleep 20&exit". All current
42 solutions break scp or leaves processes hanging around after the ssh
43 connection has ended. It seems to be linked to two things. One
44 select() under Linux is not as nice as others, and two the children
45 of the shell are not killed on exiting the shell.
46 A short run-down of what happens:
47 - The shell starts up, and starts its own session. As a side-effect, it
48 gets its own process group.
49 - The child forks off sleep, and because it's in the background, puts it
50 into its own process group. The sleep command inherits a copy of the
51 shell's descriptor for the tty as its stdout.
52 - The shell exits, but doesn't SIGHUP all of its child PIDs like it probably
53 should(?)
54 - The sshd server attempts to read from the master side of the pty, and
55 while there are still process with the pty open, no EOF is produced.
56 - The sleep command exits, closes its descriptor, sshd detects the EOF, and
57 the connection gets closed.
58 Ways we've tried fixing this in sshd, and why they didn't work out:
59 - SIGHUP the sshd's process group.
60 - The shell is in its own process group.
61 - Track process group IDs of all children before we reap them (via an extra
62 field in Session structures which holds the pgid for each child pid), and
63 SIGHUP the pgid when we reap.
64 - Background commands are in yet another process group.
65 - Close the connection when the child dies.
66 - Background commands may need to write data to the connection. Also
67 prematurely truncates output from some commands (scp server, the
68 famous "dd if=/dev/zero bs=1000 count=100" case).
69 Known workarounds:
70 - bash: shopt huponexit on
71 - tcsh: none
72 - zsh: setopt HUP (usually the default setting)
73 (taken from email from Jason Stone to openssh-unix-dev, 5 May 2001)
74 - pdksh: ?
75 This appears to affect NetKit rsh under Linux as well: it behaves the same
76 with 'sleep 20 & exit'.
77
78- Build an automated test suite
79
80- 64-bit builds on HP-UX 11.X (stevesk@pobox.com): 54- 64-bit builds on HP-UX 11.X (stevesk@pobox.com):
81 - utmp/wtmp get corrupted (something in loginrec?) 55 - utmp/wtmp get corrupted (something in loginrec?)
82 - can't build with PAM (no 64-bit libpam yet) 56 - can't build with PAM (no 64-bit libpam yet)
83 57
84Documentation:
85- More and better
86
87- Install FAQ?
88
89- General FAQ on S/Key, TIS, RSA, RSA2, DSA, etc and suggestions on when it
90 would be best to use them.
91
92- Create a Documentation/ directory?
93
94Clean up configure/makefiles: 58Clean up configure/makefiles:
95- Clean up configure.ac - There are a few double #defined variables 59- Clean up configure.ac - There are a few double #defined variables
96 left to do. HAVE_LOGIN is one of them. Consider NOT looking for 60 left to do. HAVE_LOGIN is one of them. Consider NOT looking for
97 information in wtmpx or utmpx or any of that stuff if it's not detected 61 information in wtmpx or utmpx or any of that stuff if it's not detected
98 from the start 62 from the start
99 63
100- Fails to compile when cross compile. 64- Fails to compile when cross compile. (vinschen@redhat.com)
101 (vinschen@redhat.com)
102 65
103- Replace the whole u_intXX_t evilness in acconfig.h with something better??? 66- Replace the whole u_intXX_t evilness in acconfig.h with something better???
104 - Do it in configure.ac 67 - Do it in configure.ac
@@ -118,7 +81,6 @@ Packaging:
118- HP-UX: Provide DEPOT package scripts. 81- HP-UX: Provide DEPOT package scripts.
119 (gilbert.r.loomis@saic.com) 82 (gilbert.r.loomis@saic.com)
120 83
121
122PrivSep Issues: 84PrivSep Issues:
123- mmap() issues. 85- mmap() issues.
124 + /dev/zero solution (Solaris) 86 + /dev/zero solution (Solaris)
@@ -127,11 +89,11 @@ PrivSep Issues:
127- PAM 89- PAM
128 + See above PAM notes 90 + See above PAM notes
129- AIX 91- AIX
130 + usrinfo() does not set TTY, but only required for legicy systems. Works 92 + usrinfo() does not set TTY, but only required for legacy systems. Works
131 with PrivSep. 93 with PrivSep.
132- OSF 94- OSF
133 + SIA is broken 95 + SIA is broken
134- Cygwin 96- Cygwin
135 + Privsep for Pre-auth only (no fd passing) 97 + Privsep for Pre-auth only (no fd passing)
136 98
137$Id: TODO,v 1.53 2003/01/12 23:00:34 djm Exp $ 99$Id: TODO,v 1.55 2003/06/11 13:56:41 dtucker Exp $
diff --git a/acconfig.h b/acconfig.h
index b6e4b37cc..9bfb9b6c9 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,4 +1,28 @@
1/* $Id: acconfig.h,v 1.149 2003/03/10 00:38:10 djm Exp $ */ 1/* $Id: acconfig.h,v 1.166 2003/09/16 01:52:19 dtucker Exp $ */
2
3/*
4 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
2 26
3#ifndef _CONFIG_H 27#ifndef _CONFIG_H
4#define _CONFIG_H 28#define _CONFIG_H
@@ -8,9 +32,19 @@
8 32
9@TOP@ 33@TOP@
10 34
35/* Define if your platform breaks doing a seteuid before a setuid */
36#undef SETEUID_BREAKS_SETUID
37
38/* Define if your setreuid() is broken */
39#undef BROKEN_SETREUID
40
41/* Define if your setregid() is broken */
42#undef BROKEN_SETREGID
43
11/* Define to a Set Process Title type if your system is */ 44/* Define to a Set Process Title type if your system is */
12/* supported by bsd-setproctitle.c */ 45/* supported by bsd-setproctitle.c */
13#undef SPT_TYPE 46#undef SPT_TYPE
47#undef SPT_PADCHAR
14 48
15/* setgroups() NOOP allowed */ 49/* setgroups() NOOP allowed */
16#undef SETGROUPS_NOOP 50#undef SETGROUPS_NOOP
@@ -82,6 +116,9 @@
82/* Define if you want to enable AIX4's authenticate function */ 116/* Define if you want to enable AIX4's authenticate function */
83#undef WITH_AIXAUTHENTICATE 117#undef WITH_AIXAUTHENTICATE
84 118
119/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */
120#undef AIX_LOGINFAILED_4ARG
121
85/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */ 122/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */
86#undef WITH_IRIX_ARRAY 123#undef WITH_IRIX_ARRAY
87 124
@@ -201,18 +238,15 @@
201/* Define if compiler implements __func__ */ 238/* Define if compiler implements __func__ */
202#undef HAVE___func__ 239#undef HAVE___func__
203 240
241/* Define this is you want GSSAPI support in the version 2 protocol */
242#undef GSSAPI
243
204/* Define if you want Kerberos 5 support */ 244/* Define if you want Kerberos 5 support */
205#undef KRB5 245#undef KRB5
206 246
207/* Define this if you are using the Heimdal version of Kerberos V5 */ 247/* Define this if you are using the Heimdal version of Kerberos V5 */
208#undef HEIMDAL 248#undef HEIMDAL
209 249
210/* Define if you want Kerberos 4 support */
211#undef KRB4
212
213/* Define if you want AFS support */
214#undef AFS
215
216/* Define if you want S/Key support */ 250/* Define if you want S/Key support */
217#undef SKEY 251#undef SKEY
218 252
@@ -295,9 +329,6 @@
295/* Specify location of ssh.pid */ 329/* Specify location of ssh.pid */
296#undef _PATH_SSH_PIDDIR 330#undef _PATH_SSH_PIDDIR
297 331
298/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
299#undef IPV4_DEFAULT
300
301/* getaddrinfo is broken (if present) */ 332/* getaddrinfo is broken (if present) */
302#undef BROKEN_GETADDRINFO 333#undef BROKEN_GETADDRINFO
303 334
@@ -328,6 +359,9 @@
328/* Define in your struct dirent expects you to allocate extra space for d_name */ 359/* Define in your struct dirent expects you to allocate extra space for d_name */
329#undef BROKEN_ONE_BYTE_DIRENT_D_NAME 360#undef BROKEN_ONE_BYTE_DIRENT_D_NAME
330 361
362/* Define if your system has /etc/default/login */
363#undef HAVE_ETC_DEFAULT_LOGIN
364
331/* Define if your getopt(3) defines and uses optreset */ 365/* Define if your getopt(3) defines and uses optreset */
332#undef HAVE_GETOPT_OPTRESET 366#undef HAVE_GETOPT_OPTRESET
333 367
@@ -367,15 +401,28 @@
367/* Silly mkstemp() */ 401/* Silly mkstemp() */
368#undef HAVE_STRICT_MKSTEMP 402#undef HAVE_STRICT_MKSTEMP
369 403
370/* Setproctitle emulation */
371#undef SETPROCTITLE_STRATEGY
372#undef SETPROCTITLE_PS_PADDING
373
374/* Some systems put this outside of libc */ 404/* Some systems put this outside of libc */
375#undef HAVE_NANOSLEEP 405#undef HAVE_NANOSLEEP
376 406
377/* Pushing STREAMS modules incorrectly acquires a controlling TTY */ 407/* Define if sshd somehow reacquires a controlling TTY after setsid() */
378#undef STREAMS_PUSH_ACQUIRES_CTTY 408#undef SSHD_ACQUIRES_CTTY
409
410/* Define if cmsg_type is not passed correctly */
411#undef BROKEN_CMSG_TYPE
412
413/* Strings used in /etc/passwd to denote locked account */
414#undef LOCKED_PASSWD_STRING
415#undef LOCKED_PASSWD_PREFIX
416#undef LOCKED_PASSWD_SUBSTR
417
418/* Define if DNS support is to be activated */
419#undef DNS
420
421/* Define if getrrsetbyname() exists */
422#undef HAVE_GETRRSETBYNAME
423
424/* Define if HEADER.ad exists in arpa/nameser.h */
425#undef HAVE_HEADER_AD
379 426
380@BOTTOM@ 427@BOTTOM@
381 428
diff --git a/atomicio.c b/atomicio.c
index 47161eb3a..7637e1671 100644
--- a/atomicio.c
+++ b/atomicio.c
@@ -24,16 +24,16 @@
24 */ 24 */
25 25
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $"); 27RCSID("$OpenBSD: atomicio.c,v 1.12 2003/07/31 15:50:16 avsm Exp $");
28 28
29#include "atomicio.h" 29#include "atomicio.h"
30 30
31/* 31/*
32 * ensure all of data on socket comes through. f==read || f==write 32 * ensure all of data on socket comes through. f==read || f==vwrite
33 */ 33 */
34ssize_t 34ssize_t
35atomicio(f, fd, _s, n) 35atomicio(f, fd, _s, n)
36 ssize_t (*f) (); 36 ssize_t (*f) (int, void *, size_t);
37 int fd; 37 int fd;
38 void *_s; 38 void *_s;
39 size_t n; 39 size_t n;
diff --git a/atomicio.h b/atomicio.h
index e569d38c6..5c0f392ef 100644
--- a/atomicio.h
+++ b/atomicio.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: atomicio.h,v 1.4 2001/06/26 06:32:46 itojun Exp $ */ 1/* $OpenBSD: atomicio.h,v 1.5 2003/06/28 16:23:06 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. 4 * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved.
@@ -26,6 +26,8 @@
26 */ 26 */
27 27
28/* 28/*
29 * Ensure all of data on socket comes through. f==read || f==write 29 * Ensure all of data on socket comes through. f==read || f==vwrite
30 */ 30 */
31ssize_t atomicio(ssize_t (*)(), int, void *, size_t); 31ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
32
33#define vwrite (ssize_t (*)(int, void *, size_t))write
diff --git a/auth-chall.c b/auth-chall.c
index 45e0c3452..6b7c8bd13 100644
--- a/auth-chall.c
+++ b/auth-chall.c
@@ -76,7 +76,33 @@ verify_response(Authctxt *authctxt, const char *response)
76 return 0; 76 return 0;
77 resp[0] = (char *)response; 77 resp[0] = (char *)response;
78 res = device->respond(authctxt->kbdintctxt, 1, resp); 78 res = device->respond(authctxt->kbdintctxt, 1, resp);
79 if (res == 1) {
80 /* postponed - send a null query just in case */
81 char *name, *info, **prompts;
82 u_int i, numprompts, *echo_on;
83
84 res = device->query(authctxt->kbdintctxt, &name, &info,
85 &numprompts, &prompts, &echo_on);
86 if (res == 0) {
87 for (i = 0; i < numprompts; i++)
88 xfree(prompts[i]);
89 xfree(prompts);
90 xfree(name);
91 xfree(echo_on);
92 xfree(info);
93 }
94 /* if we received more prompts, we're screwed */
95 res = (numprompts != 0);
96 }
79 device->free_ctx(authctxt->kbdintctxt); 97 device->free_ctx(authctxt->kbdintctxt);
80 authctxt->kbdintctxt = NULL; 98 authctxt->kbdintctxt = NULL;
81 return res ? 0 : 1; 99 return res ? 0 : 1;
82} 100}
101void
102abandon_challenge_response(Authctxt *authctxt)
103{
104 if (authctxt->kbdintctxt != NULL) {
105 device->free_ctx(authctxt->kbdintctxt);
106 authctxt->kbdintctxt = NULL;
107 }
108}
diff --git a/auth-krb5.c b/auth-krb5.c
index e3e2d9751..0aa5195b8 100644
--- a/auth-krb5.c
+++ b/auth-krb5.c
@@ -28,7 +28,7 @@
28 */ 28 */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$OpenBSD: auth-krb5.c,v 1.10 2002/11/21 23:03:51 deraadt Exp $"); 31RCSID("$OpenBSD: auth-krb5.c,v 1.12 2003/08/28 12:54:34 markus Exp $");
32 32
33#include "ssh.h" 33#include "ssh.h"
34#include "ssh1.h" 34#include "ssh1.h"
@@ -40,10 +40,8 @@ RCSID("$OpenBSD: auth-krb5.c,v 1.10 2002/11/21 23:03:51 deraadt Exp $");
40#include "auth.h" 40#include "auth.h"
41 41
42#ifdef KRB5 42#ifdef KRB5
43
43#include <krb5.h> 44#include <krb5.h>
44#ifndef HEIMDAL
45#define krb5_get_err_text(context,code) error_message(code)
46#endif /* !HEIMDAL */
47 45
48extern ServerOptions options; 46extern ServerOptions options;
49 47
@@ -67,193 +65,6 @@ krb5_init(void *context)
67 return (0); 65 return (0);
68} 66}
69 67
70/*
71 * Try krb5 authentication. server_user is passed for logging purposes
72 * only, in auth is received ticket, in client is returned principal
73 * from the ticket
74 */
75int
76auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *reply)
77{
78 krb5_error_code problem;
79 krb5_principal server;
80 krb5_ticket *ticket;
81 int fd, ret;
82
83 ret = 0;
84 server = NULL;
85 ticket = NULL;
86 reply->length = 0;
87
88 problem = krb5_init(authctxt);
89 if (problem)
90 goto err;
91
92 problem = krb5_auth_con_init(authctxt->krb5_ctx,
93 &authctxt->krb5_auth_ctx);
94 if (problem)
95 goto err;
96
97 fd = packet_get_connection_in();
98#ifdef HEIMDAL
99 problem = krb5_auth_con_setaddrs_from_fd(authctxt->krb5_ctx,
100 authctxt->krb5_auth_ctx, &fd);
101#else
102 problem = krb5_auth_con_genaddrs(authctxt->krb5_ctx,
103 authctxt->krb5_auth_ctx,fd,
104 KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR |
105 KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR);
106#endif
107 if (problem)
108 goto err;
109
110 problem = krb5_sname_to_principal(authctxt->krb5_ctx, NULL, NULL,
111 KRB5_NT_SRV_HST, &server);
112 if (problem)
113 goto err;
114
115 problem = krb5_rd_req(authctxt->krb5_ctx, &authctxt->krb5_auth_ctx,
116 auth, server, NULL, NULL, &ticket);
117 if (problem)
118 goto err;
119
120#ifdef HEIMDAL
121 problem = krb5_copy_principal(authctxt->krb5_ctx, ticket->client,
122 &authctxt->krb5_user);
123#else
124 problem = krb5_copy_principal(authctxt->krb5_ctx,
125 ticket->enc_part2->client,
126 &authctxt->krb5_user);
127#endif
128 if (problem)
129 goto err;
130
131 /* if client wants mutual auth */
132 problem = krb5_mk_rep(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
133 reply);
134 if (problem)
135 goto err;
136
137 /* Check .k5login authorization now. */
138 if (!krb5_kuserok(authctxt->krb5_ctx, authctxt->krb5_user,
139 authctxt->pw->pw_name))
140 goto err;
141
142 if (client)
143 krb5_unparse_name(authctxt->krb5_ctx, authctxt->krb5_user,
144 client);
145
146 ret = 1;
147 err:
148 if (server)
149 krb5_free_principal(authctxt->krb5_ctx, server);
150 if (ticket)
151 krb5_free_ticket(authctxt->krb5_ctx, ticket);
152 if (!ret && reply->length) {
153 xfree(reply->data);
154 memset(reply, 0, sizeof(*reply));
155 }
156
157 if (problem) {
158 if (authctxt->krb5_ctx != NULL)
159 debug("Kerberos v5 authentication failed: %s",
160 krb5_get_err_text(authctxt->krb5_ctx, problem));
161 else
162 debug("Kerberos v5 authentication failed: %d",
163 problem);
164 }
165
166 return (ret);
167}
168
169int
170auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt)
171{
172 krb5_error_code problem;
173 krb5_ccache ccache = NULL;
174 char *pname;
175 krb5_creds **creds;
176
177 if (authctxt->pw == NULL || authctxt->krb5_user == NULL)
178 return (0);
179
180 temporarily_use_uid(authctxt->pw);
181
182#ifdef HEIMDAL
183 problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops, &ccache);
184#else
185{
186 char ccname[40];
187 int tmpfd;
188
189 snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
190
191 if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
192 log("mkstemp(): %.100s", strerror(errno));
193 problem = errno;
194 goto fail;
195 }
196 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
197 log("fchmod(): %.100s", strerror(errno));
198 close(tmpfd);
199 problem = errno;
200 goto fail;
201 }
202 close(tmpfd);
203 problem = krb5_cc_resolve(authctxt->krb5_ctx, ccname, &ccache);
204}
205#endif
206 if (problem)
207 goto fail;
208
209 problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache,
210 authctxt->krb5_user);
211 if (problem)
212 goto fail;
213
214#ifdef HEIMDAL
215 problem = krb5_rd_cred2(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
216 ccache, tgt);
217 if (problem)
218 goto fail;
219#else
220 problem = krb5_rd_cred(authctxt->krb5_ctx, authctxt->krb5_auth_ctx,
221 tgt, &creds, NULL);
222 if (problem)
223 goto fail;
224 problem = krb5_cc_store_cred(authctxt->krb5_ctx, ccache, *creds);
225 if (problem)
226 goto fail;
227#endif
228
229 authctxt->krb5_fwd_ccache = ccache;
230 ccache = NULL;
231
232 authctxt->krb5_ticket_file = (char *)krb5_cc_get_name(authctxt->krb5_ctx, authctxt->krb5_fwd_ccache);
233
234 problem = krb5_unparse_name(authctxt->krb5_ctx, authctxt->krb5_user,
235 &pname);
236 if (problem)
237 goto fail;
238
239 debug("Kerberos v5 TGT accepted (%s)", pname);
240
241 restore_uid();
242
243 return (1);
244
245 fail:
246 if (problem)
247 debug("Kerberos v5 TGT passing failed: %s",
248 krb5_get_err_text(authctxt->krb5_ctx, problem));
249 if (ccache)
250 krb5_cc_destroy(authctxt->krb5_ctx, ccache);
251
252 restore_uid();
253
254 return (0);
255}
256
257int 68int
258auth_krb5_password(Authctxt *authctxt, const char *password) 69auth_krb5_password(Authctxt *authctxt, const char *password)
259{ 70{
@@ -264,6 +75,7 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
264 int tmpfd; 75 int tmpfd;
265#endif 76#endif
266 krb5_error_code problem; 77 krb5_error_code problem;
78 krb5_ccache ccache = NULL;
267 79
268 if (authctxt->pw == NULL) 80 if (authctxt->pw == NULL)
269 return (0); 81 return (0);
@@ -280,23 +92,35 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
280 goto out; 92 goto out;
281 93
282#ifdef HEIMDAL 94#ifdef HEIMDAL
283 problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops, 95 problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_mcc_ops, &ccache);
284 &authctxt->krb5_fwd_ccache);
285 if (problem) 96 if (problem)
286 goto out; 97 goto out;
287 98
288 problem = krb5_cc_initialize(authctxt->krb5_ctx, 99 problem = krb5_cc_initialize(authctxt->krb5_ctx, ccache,
289 authctxt->krb5_fwd_ccache, authctxt->krb5_user); 100 authctxt->krb5_user);
290 if (problem) 101 if (problem)
291 goto out; 102 goto out;
292 103
293 restore_uid(); 104 restore_uid();
105
294 problem = krb5_verify_user(authctxt->krb5_ctx, authctxt->krb5_user, 106 problem = krb5_verify_user(authctxt->krb5_ctx, authctxt->krb5_user,
295 authctxt->krb5_fwd_ccache, password, 1, NULL); 107 ccache, password, 1, NULL);
108
296 temporarily_use_uid(authctxt->pw); 109 temporarily_use_uid(authctxt->pw);
297 110
298 if (problem) 111 if (problem)
299 goto out; 112 goto out;
113 problem = krb5_cc_gen_new(authctxt->krb5_ctx, &krb5_fcc_ops,
114 &authctxt->krb5_fwd_ccache);
115 if (problem)
116 goto out;
117
118 problem = krb5_cc_copy_cache(authctxt->krb5_ctx, ccache,
119 authctxt->krb5_fwd_ccache);
120 krb5_cc_destroy(authctxt->krb5_ctx, ccache);
121 ccache = NULL;
122 if (problem)
123 goto out;
300 124
301#else 125#else
302 problem = krb5_get_init_creds_password(authctxt->krb5_ctx, &creds, 126 problem = krb5_get_init_creds_password(authctxt->krb5_ctx, &creds,
@@ -326,13 +150,13 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
326 snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid()); 150 snprintf(ccname,sizeof(ccname),"FILE:/tmp/krb5cc_%d_XXXXXX",geteuid());
327 151
328 if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) { 152 if ((tmpfd = mkstemp(ccname+strlen("FILE:")))==-1) {
329 log("mkstemp(): %.100s", strerror(errno)); 153 logit("mkstemp(): %.100s", strerror(errno));
330 problem = errno; 154 problem = errno;
331 goto out; 155 goto out;
332 } 156 }
333 157
334 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) { 158 if (fchmod(tmpfd,S_IRUSR | S_IWUSR) == -1) {
335 log("fchmod(): %.100s", strerror(errno)); 159 logit("fchmod(): %.100s", strerror(errno));
336 close(tmpfd); 160 close(tmpfd);
337 problem = errno; 161 problem = errno;
338 goto out; 162 goto out;
@@ -360,6 +184,9 @@ auth_krb5_password(Authctxt *authctxt, const char *password)
360 restore_uid(); 184 restore_uid();
361 185
362 if (problem) { 186 if (problem) {
187 if (ccache)
188 krb5_cc_destroy(authctxt->krb5_ctx, ccache);
189
363 if (authctxt->krb5_ctx != NULL && problem!=-1) 190 if (authctxt->krb5_ctx != NULL && problem!=-1)
364 debug("Kerberos password authentication failed: %s", 191 debug("Kerberos password authentication failed: %s",
365 krb5_get_err_text(authctxt->krb5_ctx, problem)); 192 krb5_get_err_text(authctxt->krb5_ctx, problem));
@@ -391,11 +218,6 @@ krb5_cleanup_proc(void *context)
391 krb5_free_principal(authctxt->krb5_ctx, authctxt->krb5_user); 218 krb5_free_principal(authctxt->krb5_ctx, authctxt->krb5_user);
392 authctxt->krb5_user = NULL; 219 authctxt->krb5_user = NULL;
393 } 220 }
394 if (authctxt->krb5_auth_ctx) {
395 krb5_auth_con_free(authctxt->krb5_ctx,
396 authctxt->krb5_auth_ctx);
397 authctxt->krb5_auth_ctx = NULL;
398 }
399 if (authctxt->krb5_ctx) { 221 if (authctxt->krb5_ctx) {
400 krb5_free_context(authctxt->krb5_ctx); 222 krb5_free_context(authctxt->krb5_ctx);
401 authctxt->krb5_ctx = NULL; 223 authctxt->krb5_ctx = NULL;
diff --git a/auth-options.c b/auth-options.c
index 8595fdc14..0e146ab15 100644
--- a/auth-options.c
+++ b/auth-options.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: auth-options.c,v 1.26 2002/07/30 17:03:55 markus Exp $"); 13RCSID("$OpenBSD: auth-options.c,v 1.28 2003/06/02 09:17:34 markus Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "match.h" 16#include "match.h"
@@ -173,7 +173,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
173 if (strncasecmp(opts, cp, strlen(cp)) == 0) { 173 if (strncasecmp(opts, cp, strlen(cp)) == 0) {
174 const char *remote_ip = get_remote_ipaddr(); 174 const char *remote_ip = get_remote_ipaddr();
175 const char *remote_host = get_canonical_hostname( 175 const char *remote_host = get_canonical_hostname(
176 options.verify_reverse_mapping); 176 options.use_dns);
177 char *patterns = xmalloc(strlen(opts) + 1); 177 char *patterns = xmalloc(strlen(opts) + 1);
178 178
179 opts += strlen(cp); 179 opts += strlen(cp);
@@ -201,7 +201,7 @@ auth_parse_options(struct passwd *pw, char *opts, char *file, u_long linenum)
201 if (match_host_and_ip(remote_host, remote_ip, 201 if (match_host_and_ip(remote_host, remote_ip,
202 patterns) != 1) { 202 patterns) != 1) {
203 xfree(patterns); 203 xfree(patterns);
204 log("Authentication tried for %.100s with " 204 logit("Authentication tried for %.100s with "
205 "correct key but not from a permitted " 205 "correct key but not from a permitted "
206 "host (host=%.200s, ip=%.200s).", 206 "host (host=%.200s, ip=%.200s).",
207 pw->pw_name, remote_host, remote_ip); 207 pw->pw_name, remote_host, remote_ip);
@@ -287,7 +287,7 @@ next_option:
287 return 1; 287 return 1;
288 288
289bad_option: 289bad_option:
290 log("Bad options in %.100s file, line %lu: %.50s", 290 logit("Bad options in %.100s file, line %lu: %.50s",
291 file, linenum, opts); 291 file, linenum, opts);
292 auth_debug_add("Bad options in %.100s file, line %lu: %.50s", 292 auth_debug_add("Bad options in %.100s file, line %lu: %.50s",
293 file, linenum, opts); 293 file, linenum, opts);
diff --git a/auth-pam.c b/auth-pam.c
index cb57ba110..754cbf6df 100644
--- a/auth-pam.c
+++ b/auth-pam.c
@@ -1,5 +1,11 @@
1/* 1/*-
2 * Copyright (c) 2000 Damien Miller. All rights reserved. 2 * Copyright (c) 2002 Networks Associates Technology, Inc.
3 * All rights reserved.
4 *
5 * This software was developed for the FreeBSD Project by ThinkSec AS and
6 * NAI Labs, the Security Research Division of Network Associates, Inc.
7 * under DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the
8 * DARPA CHATS research program.
3 * 9 *
4 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
@@ -10,446 +16,706 @@
10 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
12 * 18 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
23 */ 30 */
24 31
32/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
25#include "includes.h" 33#include "includes.h"
34RCSID("$Id: auth-pam.c,v 1.72.2.1 2003/09/16 06:00:52 djm Exp $");
26 35
27#ifdef USE_PAM 36#ifdef USE_PAM
28#include "xmalloc.h" 37#include <security/pam_appl.h>
29#include "log.h" 38
30#include "auth.h" 39#include "auth.h"
31#include "auth-options.h"
32#include "auth-pam.h" 40#include "auth-pam.h"
33#include "servconf.h" 41#include "buffer.h"
42#include "bufaux.h"
34#include "canohost.h" 43#include "canohost.h"
44#include "log.h"
45#include "monitor_wrap.h"
46#include "msg.h"
47#include "packet.h"
35#include "readpass.h" 48#include "readpass.h"
49#include "servconf.h"
50#include "ssh2.h"
51#include "xmalloc.h"
52#include "auth-options.h"
36 53
37extern char *__progname; 54extern ServerOptions options;
38 55
39extern int use_privsep; 56#define __unused
40 57
41RCSID("$Id: auth-pam.c,v 1.55.4.1 2003/04/29 09:12:08 djm Exp $"); 58#ifdef USE_POSIX_THREADS
59#include <pthread.h>
60/*
61 * Avoid namespace clash when *not* using pthreads for systems *with*
62 * pthreads, which unconditionally define pthread_t via sys/types.h
63 * (e.g. Linux)
64 */
65typedef pthread_t sp_pthread_t;
66#else
67/*
68 * Simulate threads with processes.
69 */
70typedef pid_t sp_pthread_t;
42 71
43#define NEW_AUTHTOK_MSG \ 72static void
44 "Warning: Your password has expired, please change it now." 73pthread_exit(void *value __unused)
45#define NEW_AUTHTOK_MSG_PRIVSEP \ 74{
46 "Your password has expired, the session cannot proceed." 75 _exit(0);
76}
47 77
48static int do_pam_conversation(int num_msg, const struct pam_message **msg, 78static int
49 struct pam_response **resp, void *appdata_ptr); 79pthread_create(sp_pthread_t *thread, const void *attr __unused,
80 void *(*thread_start)(void *), void *arg)
81{
82 pid_t pid;
83
84 switch ((pid = fork())) {
85 case -1:
86 error("fork(): %s", strerror(errno));
87 return (-1);
88 case 0:
89 thread_start(arg);
90 _exit(1);
91 default:
92 *thread = pid;
93 return (0);
94 }
95}
50 96
51/* module-local variables */ 97static int
52static struct pam_conv conv = { 98pthread_cancel(sp_pthread_t thread)
53 (int (*)())do_pam_conversation,
54 NULL
55};
56static char *__pam_msg = NULL;
57static pam_handle_t *__pamh = NULL;
58static const char *__pampasswd = NULL;
59
60/* states for do_pam_conversation() */
61enum { INITIAL_LOGIN, OTHER } pamstate = INITIAL_LOGIN;
62/* remember whether pam_acct_mgmt() returned PAM_NEW_AUTHTOK_REQD */
63static int password_change_required = 0;
64/* remember whether the last pam_authenticate() succeeded or not */
65static int was_authenticated = 0;
66
67/* Remember what has been initialised */
68static int session_opened = 0;
69static int creds_set = 0;
70
71/* accessor which allows us to switch conversation structs according to
72 * the authentication method being used */
73void do_pam_set_conv(struct pam_conv *conv)
74{ 99{
75 pam_set_item(__pamh, PAM_CONV, conv); 100 return (kill(thread, SIGTERM));
76} 101}
77 102
78/* start an authentication run */ 103static int
79int do_pam_authenticate(int flags) 104pthread_join(sp_pthread_t thread, void **value __unused)
80{ 105{
81 int retval = pam_authenticate(__pamh, flags); 106 int status;
82 was_authenticated = (retval == PAM_SUCCESS); 107
83 return retval; 108 waitpid(thread, &status, 0);
109 return (status);
84} 110}
111#endif
112
113
114static pam_handle_t *sshpam_handle;
115static int sshpam_err;
116static int sshpam_authenticated;
117static int sshpam_new_authtok_reqd;
118static int sshpam_session_open;
119static int sshpam_cred_established;
120
121struct pam_ctxt {
122 sp_pthread_t pam_thread;
123 int pam_psock;
124 int pam_csock;
125 int pam_done;
126};
127
128static void sshpam_free_ctx(void *);
85 129
86/* 130/*
87 * PAM conversation function. 131 * Conversation function for authentication thread.
88 * There are two states this can run in.
89 *
90 * INITIAL_LOGIN mode simply feeds the password from the client into
91 * PAM in response to PAM_PROMPT_ECHO_OFF, and collects output
92 * messages with into __pam_msg. This is used during initial
93 * authentication to bypass the normal PAM password prompt.
94 *
95 * OTHER mode handles PAM_PROMPT_ECHO_OFF with read_passphrase()
96 * and outputs messages to stderr. This mode is used if pam_chauthtok()
97 * is called to update expired passwords.
98 */ 132 */
99static int do_pam_conversation(int num_msg, const struct pam_message **msg, 133static int
100 struct pam_response **resp, void *appdata_ptr) 134sshpam_thread_conv(int n, const struct pam_message **msg,
135 struct pam_response **resp, void *data)
101{ 136{
102 struct pam_response *reply; 137 Buffer buffer;
103 int count; 138 struct pam_ctxt *ctxt;
104 char buf[1024]; 139 int i;
105 140
106 /* PAM will free this later */ 141 ctxt = data;
107 reply = xmalloc(num_msg * sizeof(*reply)); 142 if (n <= 0 || n > PAM_MAX_NUM_MSG)
108 143 return (PAM_CONV_ERR);
109 for (count = 0; count < num_msg; count++) { 144 *resp = xmalloc(n * sizeof **resp);
110 if (pamstate == INITIAL_LOGIN) { 145 buffer_init(&buffer);
111 /* 146 for (i = 0; i < n; ++i) {
112 * We can't use stdio yet, queue messages for 147 resp[i]->resp_retcode = 0;
113 * printing later 148 resp[i]->resp = NULL;
114 */ 149 switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
115 switch(PAM_MSG_MEMBER(msg, count, msg_style)) { 150 case PAM_PROMPT_ECHO_OFF:
116 case PAM_PROMPT_ECHO_ON: 151 buffer_put_cstring(&buffer, PAM_MSG_MEMBER(msg, i, msg));
117 xfree(reply); 152 ssh_msg_send(ctxt->pam_csock,
118 return PAM_CONV_ERR; 153 PAM_MSG_MEMBER(msg, i, msg_style), &buffer);
119 case PAM_PROMPT_ECHO_OFF: 154 ssh_msg_recv(ctxt->pam_csock, &buffer);
120 if (__pampasswd == NULL) { 155 if (buffer_get_char(&buffer) != PAM_AUTHTOK)
121 xfree(reply); 156 goto fail;
122 return PAM_CONV_ERR; 157 resp[i]->resp = buffer_get_string(&buffer, NULL);
123 } 158 break;
124 reply[count].resp = xstrdup(__pampasswd); 159 case PAM_PROMPT_ECHO_ON:
125 reply[count].resp_retcode = PAM_SUCCESS; 160 buffer_put_cstring(&buffer, PAM_MSG_MEMBER(msg, i, msg));
126 break; 161 ssh_msg_send(ctxt->pam_csock,
127 case PAM_ERROR_MSG: 162 PAM_MSG_MEMBER(msg, i, msg_style), &buffer);
128 case PAM_TEXT_INFO: 163 ssh_msg_recv(ctxt->pam_csock, &buffer);
129 if (PAM_MSG_MEMBER(msg, count, msg) != NULL) { 164 if (buffer_get_char(&buffer) != PAM_AUTHTOK)
130 message_cat(&__pam_msg, 165 goto fail;
131 PAM_MSG_MEMBER(msg, count, msg)); 166 resp[i]->resp = buffer_get_string(&buffer, NULL);
132 } 167 break;
133 reply[count].resp = xstrdup(""); 168 case PAM_ERROR_MSG:
134 reply[count].resp_retcode = PAM_SUCCESS; 169 buffer_put_cstring(&buffer, PAM_MSG_MEMBER(msg, i, msg));
135 break; 170 ssh_msg_send(ctxt->pam_csock,
136 default: 171 PAM_MSG_MEMBER(msg, i, msg_style), &buffer);
137 xfree(reply); 172 break;
138 return PAM_CONV_ERR; 173 case PAM_TEXT_INFO:
139 } 174 buffer_put_cstring(&buffer, PAM_MSG_MEMBER(msg, i, msg));
140 } else { 175 ssh_msg_send(ctxt->pam_csock,
141 /* 176 PAM_MSG_MEMBER(msg, i, msg_style), &buffer);
142 * stdio is connected, so interact directly 177 break;
143 */ 178 default:
144 switch(PAM_MSG_MEMBER(msg, count, msg_style)) { 179 goto fail;
145 case PAM_PROMPT_ECHO_ON:
146 fputs(PAM_MSG_MEMBER(msg, count, msg), stderr);
147 fgets(buf, sizeof(buf), stdin);
148 reply[count].resp = xstrdup(buf);
149 reply[count].resp_retcode = PAM_SUCCESS;
150 break;
151 case PAM_PROMPT_ECHO_OFF:
152 reply[count].resp =
153 read_passphrase(PAM_MSG_MEMBER(msg, count,
154 msg), RP_ALLOW_STDIN);
155 reply[count].resp_retcode = PAM_SUCCESS;
156 break;
157 case PAM_ERROR_MSG:
158 case PAM_TEXT_INFO:
159 if (PAM_MSG_MEMBER(msg, count, msg) != NULL)
160 fprintf(stderr, "%s\n",
161 PAM_MSG_MEMBER(msg, count, msg));
162 reply[count].resp = xstrdup("");
163 reply[count].resp_retcode = PAM_SUCCESS;
164 break;
165 default:
166 xfree(reply);
167 return PAM_CONV_ERR;
168 }
169 } 180 }
181 buffer_clear(&buffer);
170 } 182 }
171 183 buffer_free(&buffer);
172 *resp = reply; 184 return (PAM_SUCCESS);
173 185 fail:
174 return PAM_SUCCESS; 186 while (i)
187 xfree(resp[--i]);
188 xfree(*resp);
189 *resp = NULL;
190 buffer_free(&buffer);
191 return (PAM_CONV_ERR);
175} 192}
176 193
177/* Called at exit to cleanly shutdown PAM */ 194/*
178void do_pam_cleanup_proc(void *context) 195 * Authentication thread.
196 */
197static void *
198sshpam_thread(void *ctxtp)
179{ 199{
180 int pam_retval = PAM_SUCCESS; 200 struct pam_ctxt *ctxt = ctxtp;
201 Buffer buffer;
202 struct pam_conv sshpam_conv;
203#ifndef USE_POSIX_THREADS
204 const char *pam_user;
205
206 pam_get_item(sshpam_handle, PAM_USER, (const void **)&pam_user);
207 setproctitle("%s [pam]", pam_user);
208#endif
181 209
182 if (__pamh && session_opened) { 210 sshpam_conv.conv = sshpam_thread_conv;
183 pam_retval = pam_close_session(__pamh, 0); 211 sshpam_conv.appdata_ptr = ctxt;
184 if (pam_retval != PAM_SUCCESS) 212
185 log("Cannot close PAM session[%d]: %.200s", 213 buffer_init(&buffer);
186 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 214 sshpam_err = pam_set_item(sshpam_handle, PAM_CONV,
187 } 215 (const void *)&sshpam_conv);
216 if (sshpam_err != PAM_SUCCESS)
217 goto auth_fail;
218 sshpam_err = pam_authenticate(sshpam_handle, 0);
219 if (sshpam_err != PAM_SUCCESS)
220 goto auth_fail;
221 buffer_put_cstring(&buffer, "OK");
222 ssh_msg_send(ctxt->pam_csock, sshpam_err, &buffer);
223 buffer_free(&buffer);
224 pthread_exit(NULL);
225
226 auth_fail:
227 buffer_put_cstring(&buffer,
228 pam_strerror(sshpam_handle, sshpam_err));
229 ssh_msg_send(ctxt->pam_csock, PAM_AUTH_ERR, &buffer);
230 buffer_free(&buffer);
231 pthread_exit(NULL);
232
233 return (NULL); /* Avoid warning for non-pthread case */
234}
188 235
189 if (__pamh && creds_set) { 236static void
190 pam_retval = pam_setcred(__pamh, PAM_DELETE_CRED); 237sshpam_thread_cleanup(void *ctxtp)
191 if (pam_retval != PAM_SUCCESS) 238{
192 debug("Cannot delete credentials[%d]: %.200s", 239 struct pam_ctxt *ctxt = ctxtp;
193 pam_retval, PAM_STRERROR(__pamh, pam_retval));
194 }
195 240
196 if (__pamh) { 241 pthread_cancel(ctxt->pam_thread);
197 pam_retval = pam_end(__pamh, pam_retval); 242 pthread_join(ctxt->pam_thread, NULL);
198 if (pam_retval != PAM_SUCCESS) 243 close(ctxt->pam_psock);
199 log("Cannot release PAM authentication[%d]: %.200s", 244 close(ctxt->pam_csock);
200 pam_retval, PAM_STRERROR(__pamh, pam_retval));
201 }
202} 245}
203 246
204/* Attempt password authentication using PAM */ 247static int
205int auth_pam_password(Authctxt *authctxt, const char *password) 248sshpam_null_conv(int n, const struct pam_message **msg,
249 struct pam_response **resp, void *data)
206{ 250{
207 extern ServerOptions options; 251 return (PAM_CONV_ERR);
208 int pam_retval; 252}
209 struct passwd *pw = authctxt->pw;
210 253
211 do_pam_set_conv(&conv); 254static struct pam_conv null_conv = { sshpam_null_conv, NULL };
212 255
213 __pampasswd = password; 256static void
257sshpam_cleanup(void *arg)
258{
259 (void)arg;
260 debug("PAM: cleanup");
261 pam_set_item(sshpam_handle, PAM_CONV, (const void *)&null_conv);
262 if (sshpam_cred_established) {
263 pam_setcred(sshpam_handle, PAM_DELETE_CRED);
264 sshpam_cred_established = 0;
265 }
266 if (sshpam_session_open) {
267 pam_close_session(sshpam_handle, PAM_SILENT);
268 sshpam_session_open = 0;
269 }
270 sshpam_authenticated = sshpam_new_authtok_reqd = 0;
271 pam_end(sshpam_handle, sshpam_err);
272 sshpam_handle = NULL;
273}
214 274
215 pamstate = INITIAL_LOGIN; 275static int
216 pam_retval = do_pam_authenticate( 276sshpam_init(const char *user)
217 options.permit_empty_passwd == 0 ? PAM_DISALLOW_NULL_AUTHTOK : 0); 277{
218 if (pam_retval == PAM_SUCCESS && pw) { 278 extern u_int utmp_len;
219 debug("PAM password authentication accepted for " 279 extern char *__progname;
220 "%.100s", pw->pw_name); 280 const char *pam_rhost, *pam_user;
221 return 1; 281
222 } else { 282 if (sshpam_handle != NULL) {
223 debug("PAM password authentication failed for " 283 /* We already have a PAM context; check if the user matches */
224 "%.100s: %s", pw ? pw->pw_name : "an illegal user", 284 sshpam_err = pam_get_item(sshpam_handle,
225 PAM_STRERROR(__pamh, pam_retval)); 285 PAM_USER, (const void **)&pam_user);
226 return 0; 286 if (sshpam_err == PAM_SUCCESS && strcmp(user, pam_user) == 0)
287 return (0);
288 fatal_remove_cleanup(sshpam_cleanup, NULL);
289 pam_end(sshpam_handle, sshpam_err);
290 sshpam_handle = NULL;
291 }
292 debug("PAM: initializing for \"%s\"", user);
293 sshpam_err =
294 pam_start(SSHD_PAM_SERVICE, user, &null_conv, &sshpam_handle);
295 if (sshpam_err != PAM_SUCCESS) {
296 pam_end(sshpam_handle, sshpam_err);
297 sshpam_handle = NULL;
298 return (-1);
227 } 299 }
300 pam_rhost = get_remote_name_or_ip(utmp_len, options.use_dns);
301 debug("PAM: setting PAM_RHOST to \"%s\"", pam_rhost);
302 sshpam_err = pam_set_item(sshpam_handle, PAM_RHOST, pam_rhost);
303 if (sshpam_err != PAM_SUCCESS) {
304 pam_end(sshpam_handle, sshpam_err);
305 sshpam_handle = NULL;
306 return (-1);
307 }
308#ifdef PAM_TTY_KLUDGE
309 /*
310 * Some silly PAM modules (e.g. pam_time) require a TTY to operate.
311 * sshd doesn't set the tty until too late in the auth process and
312 * may not even set one (for tty-less connections)
313 */
314 debug("PAM: setting PAM_TTY to \"ssh\"");
315 sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, "ssh");
316 if (sshpam_err != PAM_SUCCESS) {
317 pam_end(sshpam_handle, sshpam_err);
318 sshpam_handle = NULL;
319 return (-1);
320 }
321#endif
322 fatal_add_cleanup(sshpam_cleanup, NULL);
323 return (0);
228} 324}
229 325
230/* Do account management using PAM */ 326static void *
231int do_pam_account(char *username, char *remote_user) 327sshpam_init_ctx(Authctxt *authctxt)
232{ 328{
233 int pam_retval; 329 struct pam_ctxt *ctxt;
330 int socks[2];
234 331
235 do_pam_set_conv(&conv); 332 /* Refuse to start if we don't have PAM enabled */
333 if (!options.use_pam)
334 return NULL;
236 335
237 if (remote_user) { 336 /* Initialize PAM */
238 debug("PAM setting ruser to \"%.200s\"", remote_user); 337 if (sshpam_init(authctxt->user) == -1) {
239 pam_retval = pam_set_item(__pamh, PAM_RUSER, remote_user); 338 error("PAM: initialization failed");
240 if (pam_retval != PAM_SUCCESS) 339 return (NULL);
241 fatal("PAM set ruser failed[%d]: %.200s", pam_retval,
242 PAM_STRERROR(__pamh, pam_retval));
243 } 340 }
244 341
245 pam_retval = pam_acct_mgmt(__pamh, 0); 342 ctxt = xmalloc(sizeof *ctxt);
246 debug2("pam_acct_mgmt() = %d", pam_retval); 343 ctxt->pam_done = 0;
247 switch (pam_retval) { 344
248 case PAM_SUCCESS: 345 /* Start the authentication thread */
249 /* This is what we want */ 346 if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, socks) == -1) {
250 break; 347 error("PAM: failed create sockets: %s", strerror(errno));
251#if 0 348 xfree(ctxt);
252 case PAM_NEW_AUTHTOK_REQD: 349 return (NULL);
253 message_cat(&__pam_msg, use_privsep ? 350 }
254 NEW_AUTHTOK_MSG_PRIVSEP : NEW_AUTHTOK_MSG); 351 ctxt->pam_psock = socks[0];
255 /* flag that password change is necessary */ 352 ctxt->pam_csock = socks[1];
256 password_change_required = 1; 353 if (pthread_create(&ctxt->pam_thread, NULL, sshpam_thread, ctxt) == -1) {
257 /* disallow other functionality for now */ 354 error("PAM: failed to start authentication thread: %s",
258 no_port_forwarding_flag |= 2; 355 strerror(errno));
259 no_agent_forwarding_flag |= 2; 356 close(socks[0]);
260 no_x11_forwarding_flag |= 2; 357 close(socks[1]);
358 xfree(ctxt);
359 return (NULL);
360 }
361 fatal_add_cleanup(sshpam_thread_cleanup, ctxt);
362 return (ctxt);
363}
364
365static int
366sshpam_query(void *ctx, char **name, char **info,
367 u_int *num, char ***prompts, u_int **echo_on)
368{
369 Buffer buffer;
370 struct pam_ctxt *ctxt = ctx;
371 size_t plen;
372 u_char type;
373 char *msg;
374 size_t len;
375
376 buffer_init(&buffer);
377 *name = xstrdup("");
378 *info = xstrdup("");
379 *prompts = xmalloc(sizeof(char *));
380 **prompts = NULL;
381 plen = 0;
382 *echo_on = xmalloc(sizeof(u_int));
383 while (ssh_msg_recv(ctxt->pam_psock, &buffer) == 0) {
384 type = buffer_get_char(&buffer);
385 msg = buffer_get_string(&buffer, NULL);
386 switch (type) {
387 case PAM_PROMPT_ECHO_ON:
388 case PAM_PROMPT_ECHO_OFF:
389 *num = 1;
390 len = plen + strlen(msg) + 1;
391 **prompts = xrealloc(**prompts, len);
392 plen += snprintf(**prompts + plen, len, "%s", msg);
393 **echo_on = (type == PAM_PROMPT_ECHO_ON);
394 xfree(msg);
395 return (0);
396 case PAM_ERROR_MSG:
397 case PAM_TEXT_INFO:
398 /* accumulate messages */
399 len = plen + strlen(msg) + 1;
400 **prompts = xrealloc(**prompts, len);
401 plen += snprintf(**prompts + plen, len, "%s", msg);
402 xfree(msg);
261 break; 403 break;
404 case PAM_SUCCESS:
405 case PAM_AUTH_ERR:
406 if (**prompts != NULL) {
407 /* drain any accumulated messages */
408#if 0 /* XXX - not compatible with privsep */
409 packet_start(SSH2_MSG_USERAUTH_BANNER);
410 packet_put_cstring(**prompts);
411 packet_put_cstring("");
412 packet_send();
413 packet_write_wait();
262#endif 414#endif
415 xfree(**prompts);
416 **prompts = NULL;
417 }
418 if (type == PAM_SUCCESS) {
419 *num = 0;
420 **echo_on = 0;
421 ctxt->pam_done = 1;
422 xfree(msg);
423 return (0);
424 }
425 error("PAM: %s", msg);
263 default: 426 default:
264 log("PAM rejected by account configuration[%d]: " 427 *num = 0;
265 "%.200s", pam_retval, PAM_STRERROR(__pamh, 428 **echo_on = 0;
266 pam_retval)); 429 xfree(msg);
267 return(0); 430 ctxt->pam_done = -1;
431 return (-1);
432 }
268 } 433 }
434 return (-1);
435}
269 436
270 return(1); 437/* XXX - see also comment in auth-chall.c:verify_response */
438static int
439sshpam_respond(void *ctx, u_int num, char **resp)
440{
441 Buffer buffer;
442 struct pam_ctxt *ctxt = ctx;
443
444 debug2("PAM: %s", __func__);
445 switch (ctxt->pam_done) {
446 case 1:
447 sshpam_authenticated = 1;
448 return (0);
449 case 0:
450 break;
451 default:
452 return (-1);
453 }
454 if (num != 1) {
455 error("PAM: expected one response, got %u", num);
456 return (-1);
457 }
458 buffer_init(&buffer);
459 buffer_put_cstring(&buffer, *resp);
460 ssh_msg_send(ctxt->pam_psock, PAM_AUTHTOK, &buffer);
461 buffer_free(&buffer);
462 return (1);
271} 463}
272 464
273/* Do PAM-specific session initialisation */ 465static void
274void do_pam_session(char *username, const char *ttyname) 466sshpam_free_ctx(void *ctxtp)
275{ 467{
276 int pam_retval; 468 struct pam_ctxt *ctxt = ctxtp;
277 469
278 do_pam_set_conv(&conv); 470 fatal_remove_cleanup(sshpam_thread_cleanup, ctxt);
471 sshpam_thread_cleanup(ctxtp);
472 xfree(ctxt);
473 /*
474 * We don't call sshpam_cleanup() here because we may need the PAM
475 * handle at a later stage, e.g. when setting up a session. It's
476 * still on the cleanup list, so pam_end() *will* be called before
477 * the server process terminates.
478 */
479}
279 480
280 if (ttyname != NULL) { 481KbdintDevice sshpam_device = {
281 debug("PAM setting tty to \"%.200s\"", ttyname); 482 "pam",
282 pam_retval = pam_set_item(__pamh, PAM_TTY, ttyname); 483 sshpam_init_ctx,
283 if (pam_retval != PAM_SUCCESS) 484 sshpam_query,
284 fatal("PAM set tty failed[%d]: %.200s", 485 sshpam_respond,
285 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 486 sshpam_free_ctx
286 } 487};
287 488
288 pam_retval = pam_open_session(__pamh, 0); 489KbdintDevice mm_sshpam_device = {
289 if (pam_retval != PAM_SUCCESS) 490 "pam",
290 fatal("PAM session setup failed[%d]: %.200s", 491 mm_sshpam_init_ctx,
291 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 492 mm_sshpam_query,
493 mm_sshpam_respond,
494 mm_sshpam_free_ctx
495};
496
497/*
498 * This replaces auth-pam.c
499 */
500void
501start_pam(const char *user)
502{
503 if (!options.use_pam)
504 fatal("PAM: initialisation requested when UsePAM=no");
292 505
293 session_opened = 1; 506 if (sshpam_init(user) == -1)
507 fatal("PAM: initialisation failed");
294} 508}
295 509
296/* Set PAM credentials */ 510void
297void do_pam_setcred(int init) 511finish_pam(void)
298{ 512{
299 int pam_retval; 513 fatal_remove_cleanup(sshpam_cleanup, NULL);
514 sshpam_cleanup(NULL);
515}
300 516
301 if (__pamh == NULL) 517u_int
302 return; 518do_pam_account(void)
519{
520 sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
521 debug3("%s: pam_acct_mgmt = %d", __func__, sshpam_err);
522
523 if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD)
524 return (0);
525
526 if (sshpam_err == PAM_NEW_AUTHTOK_REQD) {
527 sshpam_new_authtok_reqd = 1;
528
529 /* Prevent forwardings until password changed */
530 no_port_forwarding_flag |= 2;
531 no_agent_forwarding_flag |= 2;
532 no_x11_forwarding_flag |= 2;
533 }
303 534
304 do_pam_set_conv(&conv); 535 return (1);
305
306 debug("PAM establishing creds");
307 pam_retval = pam_setcred(__pamh,
308 init ? PAM_ESTABLISH_CRED : PAM_REINITIALIZE_CRED);
309 if (pam_retval != PAM_SUCCESS) {
310 if (was_authenticated)
311 fatal("PAM setcred failed[%d]: %.200s",
312 pam_retval, PAM_STRERROR(__pamh, pam_retval));
313 else
314 debug("PAM setcred failed[%d]: %.200s",
315 pam_retval, PAM_STRERROR(__pamh, pam_retval));
316 } else
317 creds_set = 1;
318} 536}
319 537
320/* accessor function for file scope static variable */ 538void
321int is_pam_password_change_required(void) 539do_pam_session(void)
322{ 540{
323 return password_change_required; 541 sshpam_err = pam_set_item(sshpam_handle, PAM_CONV,
542 (const void *)&null_conv);
543 if (sshpam_err != PAM_SUCCESS)
544 fatal("PAM: failed to set PAM_CONV: %s",
545 pam_strerror(sshpam_handle, sshpam_err));
546 sshpam_err = pam_open_session(sshpam_handle, 0);
547 if (sshpam_err != PAM_SUCCESS)
548 fatal("PAM: pam_open_session(): %s",
549 pam_strerror(sshpam_handle, sshpam_err));
550 sshpam_session_open = 1;
324} 551}
325 552
326/* 553void
327 * Have user change authentication token if pam_acct_mgmt() indicated 554do_pam_set_tty(const char *tty)
328 * it was expired. This needs to be called after an interactive
329 * session is established and the user's pty is connected to
330 * stdin/stdout/stderr.
331 */
332void do_pam_chauthtok(void)
333{ 555{
334 int pam_retval; 556 if (tty != NULL) {
335 557 debug("PAM: setting PAM_TTY to \"%s\"", tty);
336 do_pam_set_conv(&conv); 558 sshpam_err = pam_set_item(sshpam_handle, PAM_TTY, tty);
337 559 if (sshpam_err != PAM_SUCCESS)
338 if (password_change_required) { 560 fatal("PAM: failed to set PAM_TTY: %s",
339 if (use_privsep) 561 pam_strerror(sshpam_handle, sshpam_err));
340 fatal("Password changing is currently unsupported" 562 }
341 " with privilege separation"); 563}
342 pamstate = OTHER; 564
343 pam_retval = pam_chauthtok(__pamh, PAM_CHANGE_EXPIRED_AUTHTOK); 565void
344 if (pam_retval != PAM_SUCCESS) 566do_pam_setcred(int init)
345 fatal("PAM pam_chauthtok failed[%d]: %.200s", 567{
346 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 568 sshpam_err = pam_set_item(sshpam_handle, PAM_CONV,
347#if 0 569 (const void *)&null_conv);
348 /* XXX: This would need to be done in the parent process, 570 if (sshpam_err != PAM_SUCCESS)
349 * but there's currently no way to pass such request. */ 571 fatal("PAM: failed to set PAM_CONV: %s",
350 no_port_forwarding_flag &= ~2; 572 pam_strerror(sshpam_handle, sshpam_err));
351 no_agent_forwarding_flag &= ~2; 573 if (init) {
352 no_x11_forwarding_flag &= ~2; 574 debug("PAM: establishing credentials");
353 if (!no_port_forwarding_flag && options.allow_tcp_forwarding) 575 sshpam_err = pam_setcred(sshpam_handle, PAM_ESTABLISH_CRED);
354 channel_permit_all_opens(); 576 } else {
355#endif 577 debug("PAM: reinitializing credentials");
578 sshpam_err = pam_setcred(sshpam_handle, PAM_REINITIALIZE_CRED);
579 }
580 if (sshpam_err == PAM_SUCCESS) {
581 sshpam_cred_established = 1;
582 return;
356 } 583 }
584 if (sshpam_authenticated)
585 fatal("PAM: pam_setcred(): %s",
586 pam_strerror(sshpam_handle, sshpam_err));
587 else
588 debug("PAM: pam_setcred(): %s",
589 pam_strerror(sshpam_handle, sshpam_err));
357} 590}
358 591
359/* Cleanly shutdown PAM */ 592int
360void finish_pam(void) 593is_pam_password_change_required(void)
361{ 594{
362 do_pam_cleanup_proc(NULL); 595 return (sshpam_new_authtok_reqd);
363 fatal_remove_cleanup(&do_pam_cleanup_proc, NULL);
364} 596}
365 597
366/* Start PAM authentication for specified account */ 598static int
367void start_pam(const char *user) 599pam_chauthtok_conv(int n, const struct pam_message **msg,
600 struct pam_response **resp, void *data)
368{ 601{
369 int pam_retval; 602 char input[PAM_MAX_MSG_SIZE];
370 extern ServerOptions options; 603 int i;
371 extern u_int utmp_len;
372 const char *rhost;
373 604
374 debug("Starting up PAM with username \"%.200s\"", user); 605 if (n <= 0 || n > PAM_MAX_NUM_MSG)
606 return (PAM_CONV_ERR);
607 *resp = xmalloc(n * sizeof **resp);
608 for (i = 0; i < n; ++i) {
609 switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
610 case PAM_PROMPT_ECHO_OFF:
611 resp[i]->resp =
612 read_passphrase(PAM_MSG_MEMBER(msg, i, msg),
613 RP_ALLOW_STDIN);
614 resp[i]->resp_retcode = PAM_SUCCESS;
615 break;
616 case PAM_PROMPT_ECHO_ON:
617 fputs(PAM_MSG_MEMBER(msg, i, msg), stderr);
618 fgets(input, sizeof input, stdin);
619 resp[i]->resp = xstrdup(input);
620 resp[i]->resp_retcode = PAM_SUCCESS;
621 break;
622 case PAM_ERROR_MSG:
623 case PAM_TEXT_INFO:
624 fputs(PAM_MSG_MEMBER(msg, i, msg), stderr);
625 resp[i]->resp_retcode = PAM_SUCCESS;
626 break;
627 default:
628 goto fail;
629 }
630 }
631 return (PAM_SUCCESS);
632 fail:
633 while (i)
634 xfree(resp[--i]);
635 xfree(*resp);
636 *resp = NULL;
637 return (PAM_CONV_ERR);
638}
375 639
376 pam_retval = pam_start(SSHD_PAM_SERVICE, user, &conv, &__pamh); 640/*
641 * XXX this should be done in the authentication phase, but ssh1 doesn't
642 * support that
643 */
644void
645do_pam_chauthtok(void)
646{
647 struct pam_conv pam_conv;
648
649 pam_conv.conv = pam_chauthtok_conv;
650 pam_conv.appdata_ptr = NULL;
651
652 if (use_privsep)
653 fatal("Password expired (unable to change with privsep)");
654 sshpam_err = pam_set_item(sshpam_handle, PAM_CONV,
655 (const void *)&pam_conv);
656 if (sshpam_err != PAM_SUCCESS)
657 fatal("PAM: failed to set PAM_CONV: %s",
658 pam_strerror(sshpam_handle, sshpam_err));
659 debug("PAM: changing password");
660 sshpam_err = pam_chauthtok(sshpam_handle, PAM_CHANGE_EXPIRED_AUTHTOK);
661 if (sshpam_err != PAM_SUCCESS)
662 fatal("PAM: pam_chauthtok(): %s",
663 pam_strerror(sshpam_handle, sshpam_err));
664}
377 665
378 if (pam_retval != PAM_SUCCESS) 666/*
379 fatal("PAM initialisation failed[%d]: %.200s", 667 * Set a PAM environment string. We need to do this so that the session
380 pam_retval, PAM_STRERROR(__pamh, pam_retval)); 668 * modules can handle things like Kerberos/GSI credentials that appear
669 * during the ssh authentication process.
670 */
381 671
382 rhost = get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping); 672int
383 debug("PAM setting rhost to \"%.200s\"", rhost); 673do_pam_putenv(char *name, char *value)
674{
675 int ret = 1;
676#ifdef HAVE_PAM_PUTENV
677 char *compound;
678 size_t len;
384 679
385 pam_retval = pam_set_item(__pamh, PAM_RHOST, rhost); 680 len = strlen(name) + strlen(value) + 2;
386 if (pam_retval != PAM_SUCCESS) 681 compound = xmalloc(len);
387 fatal("PAM set rhost failed[%d]: %.200s", pam_retval,
388 PAM_STRERROR(__pamh, pam_retval));
389#ifdef PAM_TTY_KLUDGE
390 /*
391 * Some PAM modules (e.g. pam_time) require a TTY to operate,
392 * and will fail in various stupid ways if they don't get one.
393 * sshd doesn't set the tty until too late in the auth process and may
394 * not even need one (for tty-less connections)
395 * Kludge: Set a fake PAM_TTY
396 */
397 pam_retval = pam_set_item(__pamh, PAM_TTY, "NODEVssh");
398 if (pam_retval != PAM_SUCCESS)
399 fatal("PAM set tty failed[%d]: %.200s",
400 pam_retval, PAM_STRERROR(__pamh, pam_retval));
401#endif /* PAM_TTY_KLUDGE */
402 682
403 fatal_add_cleanup(&do_pam_cleanup_proc, NULL); 683 snprintf(compound, len, "%s=%s", name, value);
404} 684 ret = pam_putenv(sshpam_handle, compound);
685 xfree(compound);
686#endif
405 687
406/* Return list of PAM environment strings */ 688 return (ret);
407char **fetch_pam_environment(void)
408{
409#ifdef HAVE_PAM_GETENVLIST
410 return(pam_getenvlist(__pamh));
411#else /* HAVE_PAM_GETENVLIST */
412 return(NULL);
413#endif /* HAVE_PAM_GETENVLIST */
414} 689}
415 690
416void free_pam_environment(char **env) 691void
692print_pam_messages(void)
417{ 693{
418 int i; 694 /* XXX */
419
420 if (env != NULL) {
421 for (i = 0; env[i] != NULL; i++)
422 xfree(env[i]);
423 }
424} 695}
425 696
426/* Print any messages that have been generated during authentication */ 697char **
427/* or account checking to stderr */ 698fetch_pam_environment(void)
428void print_pam_messages(void)
429{ 699{
430 if (__pam_msg != NULL) 700#ifdef HAVE_PAM_GETENVLIST
431 fputs(__pam_msg, stderr); 701 debug("PAM: retrieving environment");
702 return (pam_getenvlist(sshpam_handle));
703#else
704 return (NULL);
705#endif
432} 706}
433 707
434/* Append a message to buffer */ 708void
435void message_cat(char **p, const char *a) 709free_pam_environment(char **env)
436{ 710{
437 char *cp; 711 char **envp;
438 size_t new_len;
439
440 new_len = strlen(a);
441 712
442 if (*p) { 713 if (env == NULL)
443 size_t len = strlen(*p); 714 return;
444
445 *p = xrealloc(*p, new_len + len + 2);
446 cp = *p + len;
447 } else
448 *p = cp = xmalloc(new_len + 2);
449 715
450 memcpy(cp, a, new_len); 716 for (envp = env; *envp; envp++)
451 cp[new_len] = '\n'; 717 xfree(*envp);
452 cp[new_len + 1] = '\0'; 718 xfree(env);
453} 719}
454 720
455#endif /* USE_PAM */ 721#endif /* USE_PAM */
diff --git a/auth-pam.h b/auth-pam.h
index 7881b6b80..5c952f305 100644
--- a/auth-pam.h
+++ b/auth-pam.h
@@ -1,4 +1,4 @@
1/* $Id: auth-pam.h,v 1.16 2002/07/23 00:44:07 stevesk Exp $ */ 1/* $Id: auth-pam.h,v 1.21 2003/09/02 13:18:53 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Damien Miller. All rights reserved. 4 * Copyright (c) 2000 Damien Miller. All rights reserved.
@@ -31,19 +31,17 @@
31# define SSHD_PAM_SERVICE __progname 31# define SSHD_PAM_SERVICE __progname
32#endif 32#endif
33 33
34void start_pam(const char *user); 34void start_pam(const char *);
35void finish_pam(void); 35void finish_pam(void);
36int auth_pam_password(Authctxt *authctxt, const char *password); 36u_int do_pam_account(void);
37char **fetch_pam_environment(void); 37void do_pam_session(void);
38void free_pam_environment(char **env); 38void do_pam_set_tty(const char *);
39int do_pam_authenticate(int flags); 39void do_pam_setcred(int );
40int do_pam_account(char *username, char *remote_user);
41void do_pam_session(char *username, const char *ttyname);
42void do_pam_setcred(int init);
43void print_pam_messages(void);
44int is_pam_password_change_required(void); 40int is_pam_password_change_required(void);
45void do_pam_chauthtok(void); 41void do_pam_chauthtok(void);
46void do_pam_set_conv(struct pam_conv *); 42int do_pam_putenv(char *, char *);
47void message_cat(char **p, const char *a); 43void print_pam_messages(void);
44char ** fetch_pam_environment(void);
45void free_pam_environment(char **);
48 46
49#endif /* USE_PAM */ 47#endif /* USE_PAM */
diff --git a/auth-passwd.c b/auth-passwd.c
index 62ea3a52d..95cc134de 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -36,55 +36,20 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: auth-passwd.c,v 1.27 2002/05/24 16:45:16 stevesk Exp $"); 39RCSID("$OpenBSD: auth-passwd.c,v 1.29 2003/08/26 09:58:43 markus Exp $");
40 40
41#include "packet.h" 41#include "packet.h"
42#include "log.h" 42#include "log.h"
43#include "servconf.h" 43#include "servconf.h"
44#include "auth.h" 44#include "auth.h"
45
46#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
47/* Don't need any of these headers for the PAM or SIA cases */
48# ifdef HAVE_CRYPT_H
49# include <crypt.h>
50# endif
51# ifdef WITH_AIXAUTHENTICATE
52# include <login.h>
53# endif
54# ifdef __hpux
55# include <hpsecurity.h>
56# include <prot.h>
57# endif
58# ifdef HAVE_SECUREWARE
59# include <sys/security.h>
60# include <sys/audit.h>
61# include <prot.h>
62# endif /* HAVE_SECUREWARE */
63# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
64# include <shadow.h>
65# endif
66# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
67# include <sys/label.h>
68# include <sys/audit.h>
69# include <pwdadj.h>
70# endif
71# if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
72# include "md5crypt.h"
73# endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
74
75# ifdef HAVE_CYGWIN
76# undef ERROR
77# include <windows.h>
78# include <sys/cygwin.h>
79# define is_winnt (GetVersion() < 0x80000000)
80# endif
81#endif /* !USE_PAM && !HAVE_OSF_SIA */
82
83extern ServerOptions options;
84#ifdef WITH_AIXAUTHENTICATE 45#ifdef WITH_AIXAUTHENTICATE
85extern char *aixloginmsg; 46# include "buffer.h"
47# include "canohost.h"
48extern Buffer loginmsg;
86#endif 49#endif
87 50
51extern ServerOptions options;
52
88/* 53/*
89 * Tries to authenticate the user using password. Returns true if 54 * Tries to authenticate the user using password. Returns true if
90 * authentication succeeds. 55 * authentication succeeds.
@@ -94,50 +59,25 @@ auth_password(Authctxt *authctxt, const char *password)
94{ 59{
95 struct passwd * pw = authctxt->pw; 60 struct passwd * pw = authctxt->pw;
96 int ok = authctxt->valid; 61 int ok = authctxt->valid;
97#if !defined(USE_PAM) && !defined(HAVE_OSF_SIA)
98 char *encrypted_password;
99 char *pw_password;
100 char *salt;
101# if defined(__hpux) || defined(HAVE_SECUREWARE)
102 struct pr_passwd *spw;
103# endif /* __hpux || HAVE_SECUREWARE */
104# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
105 struct spwd *spw;
106# endif
107# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
108 struct passwd_adjunct *spw;
109# endif
110# ifdef WITH_AIXAUTHENTICATE
111 char *authmsg;
112 int authsuccess;
113 int reenter = 1;
114# endif
115#endif /* !defined(USE_PAM) && !defined(HAVE_OSF_SIA) */
116 62
117 /* deny if no user. */ 63 /* deny if no user. */
118 if (pw == NULL) 64 if (pw == NULL)
119 ok = 0; 65 return 0;
120#ifndef HAVE_CYGWIN 66#ifndef HAVE_CYGWIN
121 if (pw && pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES) 67 if (pw && pw->pw_uid == 0 && options.permit_root_login != PERMIT_YES)
122 ok = 0; 68 ok = 0;
123#endif 69#endif
124 if (*password == '\0' && options.permit_empty_passwd == 0) 70 if (*password == '\0' && options.permit_empty_passwd == 0)
125 ok = 0;
126
127#if defined(USE_PAM)
128 return auth_pam_password(authctxt, password) && ok;
129#elif defined(HAVE_OSF_SIA)
130 if (!ok)
131 return 0; 71 return 0;
132 return auth_sia_password(authctxt, password); 72
73#if defined(HAVE_OSF_SIA)
74 return auth_sia_password(authctxt, password) && ok;
133#else 75#else
134 if (!ok)
135 return 0;
136# ifdef KRB5 76# ifdef KRB5
137 if (options.kerberos_authentication == 1) { 77 if (options.kerberos_authentication == 1) {
138 int ret = auth_krb5_password(authctxt, password); 78 int ret = auth_krb5_password(authctxt, password);
139 if (ret == 1 || ret == 0) 79 if (ret == 1 || ret == 0)
140 return ret; 80 return ret && ok;
141 /* Fall back to ordinary passwd authentication. */ 81 /* Fall back to ordinary passwd authentication. */
142 } 82 }
143# endif 83# endif
@@ -148,27 +88,47 @@ auth_password(Authctxt *authctxt, const char *password)
148 if (hToken == INVALID_HANDLE_VALUE) 88 if (hToken == INVALID_HANDLE_VALUE)
149 return 0; 89 return 0;
150 cygwin_set_impersonation_token(hToken); 90 cygwin_set_impersonation_token(hToken);
151 return 1; 91 return ok;
152 } 92 }
153# endif 93# endif
154# ifdef WITH_AIXAUTHENTICATE 94# ifdef WITH_AIXAUTHENTICATE
155 authsuccess = (authenticate(pw->pw_name,password,&reenter,&authmsg) == 0); 95 {
156 96 char *authmsg = NULL;
157 if (authsuccess) 97 int reenter = 1;
158 /* We don't have a pty yet, so just label the line as "ssh" */ 98 int authsuccess = 0;
159 if (loginsuccess(authctxt->user, 99
160 get_canonical_hostname(options.verify_reverse_mapping), 100 if (authenticate(pw->pw_name, password, &reenter,
161 "ssh", &aixloginmsg) < 0) 101 &authmsg) == 0 && ok) {
162 aixloginmsg = NULL; 102 char *msg;
163 103 char *host =
164 return(authsuccess); 104 (char *)get_canonical_hostname(options.use_dns);
165# endif 105
166# ifdef KRB4 106 authsuccess = 1;
167 if (options.kerberos_authentication == 1) { 107 aix_remove_embedded_newlines(authmsg);
168 int ret = auth_krb4_password(authctxt, password); 108
169 if (ret == 1 || ret == 0) 109 debug3("AIX/authenticate succeeded for user %s: %.100s",
170 return ret; 110 pw->pw_name, authmsg);
171 /* Fall back to ordinary passwd authentication. */ 111
112 /* No pty yet, so just label the line as "ssh" */
113 aix_setauthdb(authctxt->user);
114 if (loginsuccess(authctxt->user, host, "ssh",
115 &msg) == 0) {
116 if (msg != NULL) {
117 debug("%s: msg %s", __func__, msg);
118 buffer_append(&loginmsg, msg,
119 strlen(msg));
120 xfree(msg);
121 }
122 }
123 } else {
124 debug3("AIX/authenticate failed for user %s: %.100s",
125 pw->pw_name, authmsg);
126 }
127
128 if (authmsg != NULL)
129 xfree(authmsg);
130
131 return authsuccess;
172 } 132 }
173# endif 133# endif
174# ifdef BSD_AUTH 134# ifdef BSD_AUTH
@@ -176,64 +136,28 @@ auth_password(Authctxt *authctxt, const char *password)
176 (char *)password) == 0) 136 (char *)password) == 0)
177 return 0; 137 return 0;
178 else 138 else
179 return 1; 139 return ok;
180# endif 140# else
181 pw_password = pw->pw_passwd; 141 {
182 142 /* Just use the supplied fake password if authctxt is invalid */
183 /* 143 char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
184 * Various interfaces to shadow or protected password data
185 */
186# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
187 spw = getspnam(pw->pw_name);
188 if (spw != NULL)
189 pw_password = spw->sp_pwdp;
190# endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
191
192# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
193 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
194 pw_password = spw->pwa_passwd;
195# endif /* defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW) */
196
197# ifdef HAVE_SECUREWARE
198 if ((spw = getprpwnam(pw->pw_name)) != NULL)
199 pw_password = spw->ufld.fd_encrypt;
200# endif /* HAVE_SECUREWARE */
201
202# if defined(__hpux) && !defined(HAVE_SECUREWARE)
203 if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL)
204 pw_password = spw->ufld.fd_encrypt;
205# endif /* defined(__hpux) && !defined(HAVE_SECUREWARE) */
206 144
207 /* Check for users with no password. */ 145 /* Check for users with no password. */
208 if ((password[0] == '\0') && (pw_password[0] == '\0')) 146 if (strcmp(pw_password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)
209 return 1; 147 return ok;
210 148 else {
211 if (pw_password[0] != '\0') 149 /* Encrypt the candidate password using the proper salt. */
212 salt = pw_password; 150 char *encrypted_password = xcrypt(password,
213 else 151 (pw_password[0] && pw_password[1]) ? pw_password : "xx");
214 salt = "xx"; 152
153 /*
154 * Authentication is accepted if the encrypted passwords
155 * are identical.
156 */
157 return (strcmp(encrypted_password, pw_password) == 0) && ok;
158 }
215 159
216# ifdef HAVE_MD5_PASSWORDS 160 }
217 if (is_md5_salt(salt)) 161# endif
218 encrypted_password = md5_crypt(password, salt); 162#endif /* !HAVE_OSF_SIA */
219 else
220 encrypted_password = crypt(password, salt);
221# else /* HAVE_MD5_PASSWORDS */
222# if defined(__hpux) && !defined(HAVE_SECUREWARE)
223 if (iscomsec())
224 encrypted_password = bigcrypt(password, salt);
225 else
226 encrypted_password = crypt(password, salt);
227# else
228# ifdef HAVE_SECUREWARE
229 encrypted_password = bigcrypt(password, salt);
230# else
231 encrypted_password = crypt(password, salt);
232# endif /* HAVE_SECUREWARE */
233# endif /* __hpux && !defined(HAVE_SECUREWARE) */
234# endif /* HAVE_MD5_PASSWORDS */
235
236 /* Authentication is accepted if the encrypted passwords are identical. */
237 return (strcmp(encrypted_password, pw_password) == 0);
238#endif /* !USE_PAM && !HAVE_OSF_SIA */
239} 163}
diff --git a/auth-rh-rsa.c b/auth-rh-rsa.c
index d7848d04c..2eb7e6e2d 100644
--- a/auth-rh-rsa.c
+++ b/auth-rh-rsa.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.34 2002/03/25 09:25:06 markus Exp $"); 16RCSID("$OpenBSD: auth-rh-rsa.c,v 1.36 2003/06/02 09:17:34 markus Exp $");
17 17
18#include "packet.h" 18#include "packet.h"
19#include "uidswap.h" 19#include "uidswap.h"
@@ -63,7 +63,7 @@ auth_rhosts_rsa(struct passwd *pw, char *cuser, Key *client_host_key)
63 client_host_key->rsa == NULL) 63 client_host_key->rsa == NULL)
64 return 0; 64 return 0;
65 65
66 chost = (char *)get_canonical_hostname(options.verify_reverse_mapping); 66 chost = (char *)get_canonical_hostname(options.use_dns);
67 debug("Rhosts RSA authentication: canonical host %.900s", chost); 67 debug("Rhosts RSA authentication: canonical host %.900s", chost);
68 68
69 if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) { 69 if (!PRIVSEP(auth_rhosts_rsa_key_allowed(pw, cuser, chost, client_host_key))) {
@@ -75,7 +75,7 @@ auth_rhosts_rsa(struct passwd *pw, char *cuser, Key *client_host_key)
75 75
76 /* Perform the challenge-response dialog with the client for the host key. */ 76 /* Perform the challenge-response dialog with the client for the host key. */
77 if (!auth_rsa_challenge_dialog(client_host_key)) { 77 if (!auth_rsa_challenge_dialog(client_host_key)) {
78 log("Client on %.800s failed to respond correctly to host authentication.", 78 logit("Client on %.800s failed to respond correctly to host authentication.",
79 chost); 79 chost);
80 return 0; 80 return 0;
81 } 81 }
diff --git a/auth-rhosts.c b/auth-rhosts.c
index afca1f7c6..b42a64c90 100644
--- a/auth-rhosts.c
+++ b/auth-rhosts.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rhosts.c,v 1.28 2002/05/13 21:26:49 markus Exp $"); 17RCSID("$OpenBSD: auth-rhosts.c,v 1.31 2003/06/02 09:17:34 markus Exp $");
18 18
19#include "packet.h" 19#include "packet.h"
20#include "uidswap.h" 20#include "uidswap.h"
@@ -68,7 +68,8 @@ check_rhosts_file(const char *filename, const char *hostname,
68 * This should be safe because each buffer is as big as the 68 * This should be safe because each buffer is as big as the
69 * whole string, and thus cannot be overwritten. 69 * whole string, and thus cannot be overwritten.
70 */ 70 */
71 switch (sscanf(buf, "%s %s %s", hostbuf, userbuf, dummy)) { 71 switch (sscanf(buf, "%1023s %1023s %1023s", hostbuf, userbuf,
72 dummy)) {
72 case 0: 73 case 0:
73 auth_debug_add("Found empty line in %.100s.", filename); 74 auth_debug_add("Found empty line in %.100s.", filename);
74 continue; 75 continue;
@@ -155,7 +156,7 @@ auth_rhosts(struct passwd *pw, const char *client_user)
155{ 156{
156 const char *hostname, *ipaddr; 157 const char *hostname, *ipaddr;
157 158
158 hostname = get_canonical_hostname(options.verify_reverse_mapping); 159 hostname = get_canonical_hostname(options.use_dns);
159 ipaddr = get_remote_ipaddr(); 160 ipaddr = get_remote_ipaddr();
160 return auth_rhosts2(pw, client_user, hostname, ipaddr); 161 return auth_rhosts2(pw, client_user, hostname, ipaddr);
161} 162}
@@ -220,7 +221,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam
220 * not group or world writable. 221 * not group or world writable.
221 */ 222 */
222 if (stat(pw->pw_dir, &st) < 0) { 223 if (stat(pw->pw_dir, &st) < 0) {
223 log("Rhosts authentication refused for %.100s: " 224 logit("Rhosts authentication refused for %.100s: "
224 "no home directory %.200s", pw->pw_name, pw->pw_dir); 225 "no home directory %.200s", pw->pw_name, pw->pw_dir);
225 auth_debug_add("Rhosts authentication refused for %.100s: " 226 auth_debug_add("Rhosts authentication refused for %.100s: "
226 "no home directory %.200s", pw->pw_name, pw->pw_dir); 227 "no home directory %.200s", pw->pw_name, pw->pw_dir);
@@ -229,7 +230,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam
229 if (options.strict_modes && 230 if (options.strict_modes &&
230 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || 231 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
231 (st.st_mode & 022) != 0)) { 232 (st.st_mode & 022) != 0)) {
232 log("Rhosts authentication refused for %.100s: " 233 logit("Rhosts authentication refused for %.100s: "
233 "bad ownership or modes for home directory.", pw->pw_name); 234 "bad ownership or modes for home directory.", pw->pw_name);
234 auth_debug_add("Rhosts authentication refused for %.100s: " 235 auth_debug_add("Rhosts authentication refused for %.100s: "
235 "bad ownership or modes for home directory.", pw->pw_name); 236 "bad ownership or modes for home directory.", pw->pw_name);
@@ -256,7 +257,7 @@ auth_rhosts2_raw(struct passwd *pw, const char *client_user, const char *hostnam
256 if (options.strict_modes && 257 if (options.strict_modes &&
257 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || 258 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
258 (st.st_mode & 022) != 0)) { 259 (st.st_mode & 022) != 0)) {
259 log("Rhosts authentication refused for %.100s: bad modes for %.200s", 260 logit("Rhosts authentication refused for %.100s: bad modes for %.200s",
260 pw->pw_name, buf); 261 pw->pw_name, buf);
261 auth_debug_add("Bad file modes for %.200s", buf); 262 auth_debug_add("Bad file modes for %.200s", buf);
262 continue; 263 continue;
diff --git a/auth-rsa.c b/auth-rsa.c
index 92f6277f9..5631d238c 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rsa.c,v 1.56 2002/06/10 16:53:06 stevesk Exp $"); 17RCSID("$OpenBSD: auth-rsa.c,v 1.57 2003/04/08 20:21:28 itojun Exp $");
18 18
19#include <openssl/rsa.h> 19#include <openssl/rsa.h>
20#include <openssl/md5.h> 20#include <openssl/md5.h>
@@ -187,7 +187,7 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
187 secure_filename(f, file, pw, line, sizeof(line)) != 0) { 187 secure_filename(f, file, pw, line, sizeof(line)) != 0) {
188 xfree(file); 188 xfree(file);
189 fclose(f); 189 fclose(f);
190 log("Authentication refused: %s", line); 190 logit("Authentication refused: %s", line);
191 restore_uid(); 191 restore_uid();
192 return (0); 192 return (0);
193 } 193 }
@@ -246,7 +246,7 @@ auth_rsa_key_allowed(struct passwd *pw, BIGNUM *client_n, Key **rkey)
246 246
247 /* check the real bits */ 247 /* check the real bits */
248 if (bits != BN_num_bits(key->rsa->n)) 248 if (bits != BN_num_bits(key->rsa->n))
249 log("Warning: %s, line %lu: keysize mismatch: " 249 logit("Warning: %s, line %lu: keysize mismatch: "
250 "actual %d vs. announced %d.", 250 "actual %d vs. announced %d.",
251 file, linenum, BN_num_bits(key->rsa->n), bits); 251 file, linenum, BN_num_bits(key->rsa->n), bits);
252 252
diff --git a/auth-sia.c b/auth-sia.c
index 5c9b3f5de..cae5f0912 100644
--- a/auth-sia.c
+++ b/auth-sia.c
@@ -52,26 +52,27 @@ auth_sia_password(Authctxt *authctxt, char *pass)
52 SIAENTITY *ent = NULL; 52 SIAENTITY *ent = NULL;
53 const char *host; 53 const char *host;
54 54
55 host = get_canonical_hostname(options.verify_reverse_mapping); 55 host = get_canonical_hostname(options.use_dns);
56 56
57 if (!authctxt->user || !pass || pass[0] == '\0') 57 if (!authctxt->user || pass == NULL || pass[0] == '\0')
58 return(0); 58 return (0);
59 59
60 if (sia_ses_init(&ent, saved_argc, saved_argv, host, authctxt->user, 60 if (sia_ses_init(&ent, saved_argc, saved_argv, host, authctxt->user,
61 NULL, 0, NULL) != SIASUCCESS) 61 NULL, 0, NULL) != SIASUCCESS)
62 return(0); 62 return (0);
63 63
64 if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) { 64 if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) {
65 error("Couldn't authenticate %s from %s", authctxt->user, 65 error("Couldn't authenticate %s from %s",
66 host); 66 authctxt->user, host);
67 if (ret & SIASTOP) 67 if (ret & SIASTOP)
68 sia_ses_release(&ent); 68 sia_ses_release(&ent);
69 return(0); 69
70 return (0);
70 } 71 }
71 72
72 sia_ses_release(&ent); 73 sia_ses_release(&ent);
73 74
74 return(1); 75 return (1);
75} 76}
76 77
77void 78void
@@ -80,10 +81,10 @@ session_setup_sia(struct passwd *pw, char *tty)
80 SIAENTITY *ent = NULL; 81 SIAENTITY *ent = NULL;
81 const char *host; 82 const char *host;
82 83
83 host = get_canonical_hostname(options.verify_reverse_mapping); 84 host = get_canonical_hostname(options.use_dns);
84 85
85 if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name, tty, 86 if (sia_ses_init(&ent, saved_argc, saved_argv, host, pw->pw_name,
86 0, NULL) != SIASUCCESS) 87 tty, 0, NULL) != SIASUCCESS)
87 fatal("sia_ses_init failed"); 88 fatal("sia_ses_init failed");
88 89
89 if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { 90 if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) {
@@ -97,8 +98,8 @@ session_setup_sia(struct passwd *pw, char *tty)
97 pw->pw_name, host); 98 pw->pw_name, host);
98 99
99 if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) 100 if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS)
100 fatal("Couldn't launch session for %s from %s", pw->pw_name, 101 fatal("Couldn't launch session for %s from %s",
101 host); 102 pw->pw_name, host);
102 103
103 sia_ses_release(&ent); 104 sia_ses_release(&ent);
104 105
diff --git a/auth-sia.h b/auth-sia.h
index 7aecce940..38164ff81 100644
--- a/auth-sia.h
+++ b/auth-sia.h
@@ -26,7 +26,7 @@
26 26
27#ifdef HAVE_OSF_SIA 27#ifdef HAVE_OSF_SIA
28 28
29int auth_sia_password(Authctxt *authctxt, char *pass); 29int auth_sia_password(Authctxt *, char *);
30void session_setup_sia(struct passwd *pw, char *tty); 30void session_setup_sia(struct passwd *, char *);
31 31
32#endif /* HAVE_OSF_SIA */ 32#endif /* HAVE_OSF_SIA */
diff --git a/auth.c b/auth.c
index 1268accb1..46e495adf 100644
--- a/auth.c
+++ b/auth.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth.c,v 1.46 2002/11/04 10:07:53 markus Exp $"); 26RCSID("$OpenBSD: auth.c,v 1.49 2003/08/26 09:58:43 markus Exp $");
27 27
28#ifdef HAVE_LOGIN_H 28#ifdef HAVE_LOGIN_H
29#include <login.h> 29#include <login.h>
@@ -54,6 +54,7 @@ RCSID("$OpenBSD: auth.c,v 1.46 2002/11/04 10:07:53 markus Exp $");
54 54
55/* import */ 55/* import */
56extern ServerOptions options; 56extern ServerOptions options;
57extern Buffer loginmsg;
57 58
58/* Debugging messages */ 59/* Debugging messages */
59Buffer auth_debug; 60Buffer auth_debug;
@@ -72,26 +73,25 @@ int
72allowed_user(struct passwd * pw) 73allowed_user(struct passwd * pw)
73{ 74{
74 struct stat st; 75 struct stat st;
75 const char *hostname = NULL, *ipaddr = NULL; 76 const char *hostname = NULL, *ipaddr = NULL, *passwd = NULL;
76 char *shell; 77 char *shell;
77 int i; 78 int i;
78#ifdef WITH_AIXAUTHENTICATE 79#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
79 char *loginmsg; 80 struct spwd *spw = NULL;
80#endif /* WITH_AIXAUTHENTICATE */
81#if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \
82 !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE)
83 struct spwd *spw;
84 time_t today;
85#endif 81#endif
86 82
87 /* Shouldn't be called if pw is NULL, but better safe than sorry... */ 83 /* Shouldn't be called if pw is NULL, but better safe than sorry... */
88 if (!pw || !pw->pw_name) 84 if (!pw || !pw->pw_name)
89 return 0; 85 return 0;
90 86
91#if !defined(USE_PAM) && defined(HAVE_SHADOW_H) && \ 87#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
92 !defined(DISABLE_SHADOW) && defined(HAS_SHADOW_EXPIRE) 88 if (!options.use_pam)
89 spw = getspnam(pw->pw_name);
90#ifdef HAS_SHADOW_EXPIRE
93#define DAY (24L * 60 * 60) /* 1 day in seconds */ 91#define DAY (24L * 60 * 60) /* 1 day in seconds */
94 if ((spw = getspnam(pw->pw_name)) != NULL) { 92 if (!options.use_pam && spw != NULL) {
93 time_t today;
94
95 today = time(NULL) / DAY; 95 today = time(NULL) / DAY;
96 debug3("allowed_user: today %d sp_expire %d sp_lstchg %d" 96 debug3("allowed_user: today %d sp_expire %d sp_lstchg %d"
97 " sp_max %d", (int)today, (int)spw->sp_expire, 97 " sp_max %d", (int)today, (int)spw->sp_expire,
@@ -102,25 +102,58 @@ allowed_user(struct passwd * pw)
102 * day after the day specified. 102 * day after the day specified.
103 */ 103 */
104 if (spw->sp_expire != -1 && today > spw->sp_expire) { 104 if (spw->sp_expire != -1 && today > spw->sp_expire) {
105 log("Account %.100s has expired", pw->pw_name); 105 logit("Account %.100s has expired", pw->pw_name);
106 return 0; 106 return 0;
107 } 107 }
108 108
109 if (spw->sp_lstchg == 0) { 109 if (spw->sp_lstchg == 0) {
110 log("User %.100s password has expired (root forced)", 110 logit("User %.100s password has expired (root forced)",
111 pw->pw_name); 111 pw->pw_name);
112 return 0; 112 return 0;
113 } 113 }
114 114
115 if (spw->sp_max != -1 && 115 if (spw->sp_max != -1 &&
116 today > spw->sp_lstchg + spw->sp_max) { 116 today > spw->sp_lstchg + spw->sp_max) {
117 log("User %.100s password has expired (password aged)", 117 logit("User %.100s password has expired (password aged)",
118 pw->pw_name); 118 pw->pw_name);
119 return 0; 119 return 0;
120 } 120 }
121 } 121 }
122#endif /* HAS_SHADOW_EXPIRE */
123#endif /* defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) */
124
125 /* grab passwd field for locked account check */
126#if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
127 if (spw != NULL)
128 passwd = spw->sp_pwdp;
129#else
130 passwd = pw->pw_passwd;
122#endif 131#endif
123 132
133 /* check for locked account */
134 if (!options.use_pam && passwd && *passwd) {
135 int locked = 0;
136
137#ifdef LOCKED_PASSWD_STRING
138 if (strcmp(passwd, LOCKED_PASSWD_STRING) == 0)
139 locked = 1;
140#endif
141#ifdef LOCKED_PASSWD_PREFIX
142 if (strncmp(passwd, LOCKED_PASSWD_PREFIX,
143 strlen(LOCKED_PASSWD_PREFIX)) == 0)
144 locked = 1;
145#endif
146#ifdef LOCKED_PASSWD_SUBSTR
147 if (strstr(passwd, LOCKED_PASSWD_SUBSTR))
148 locked = 1;
149#endif
150 if (locked) {
151 logit("User %.100s not allowed because account is locked",
152 pw->pw_name);
153 return 0;
154 }
155 }
156
124 /* 157 /*
125 * Get the shell from the password data. An empty shell field is 158 * Get the shell from the password data. An empty shell field is
126 * legal, and means /bin/sh. 159 * legal, and means /bin/sh.
@@ -129,19 +162,19 @@ allowed_user(struct passwd * pw)
129 162
130 /* deny if shell does not exists or is not executable */ 163 /* deny if shell does not exists or is not executable */
131 if (stat(shell, &st) != 0) { 164 if (stat(shell, &st) != 0) {
132 log("User %.100s not allowed because shell %.100s does not exist", 165 logit("User %.100s not allowed because shell %.100s does not exist",
133 pw->pw_name, shell); 166 pw->pw_name, shell);
134 return 0; 167 return 0;
135 } 168 }
136 if (S_ISREG(st.st_mode) == 0 || 169 if (S_ISREG(st.st_mode) == 0 ||
137 (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) { 170 (st.st_mode & (S_IXOTH|S_IXUSR|S_IXGRP)) == 0) {
138 log("User %.100s not allowed because shell %.100s is not executable", 171 logit("User %.100s not allowed because shell %.100s is not executable",
139 pw->pw_name, shell); 172 pw->pw_name, shell);
140 return 0; 173 return 0;
141 } 174 }
142 175
143 if (options.num_deny_users > 0 || options.num_allow_users > 0) { 176 if (options.num_deny_users > 0 || options.num_allow_users > 0) {
144 hostname = get_canonical_hostname(options.verify_reverse_mapping); 177 hostname = get_canonical_hostname(options.use_dns);
145 ipaddr = get_remote_ipaddr(); 178 ipaddr = get_remote_ipaddr();
146 } 179 }
147 180
@@ -150,7 +183,7 @@ allowed_user(struct passwd * pw)
150 for (i = 0; i < options.num_deny_users; i++) 183 for (i = 0; i < options.num_deny_users; i++)
151 if (match_user(pw->pw_name, hostname, ipaddr, 184 if (match_user(pw->pw_name, hostname, ipaddr,
152 options.deny_users[i])) { 185 options.deny_users[i])) {
153 log("User %.100s not allowed because listed in DenyUsers", 186 logit("User %.100s not allowed because listed in DenyUsers",
154 pw->pw_name); 187 pw->pw_name);
155 return 0; 188 return 0;
156 } 189 }
@@ -163,7 +196,7 @@ allowed_user(struct passwd * pw)
163 break; 196 break;
164 /* i < options.num_allow_users iff we break for loop */ 197 /* i < options.num_allow_users iff we break for loop */
165 if (i >= options.num_allow_users) { 198 if (i >= options.num_allow_users) {
166 log("User %.100s not allowed because not listed in AllowUsers", 199 logit("User %.100s not allowed because not listed in AllowUsers",
167 pw->pw_name); 200 pw->pw_name);
168 return 0; 201 return 0;
169 } 202 }
@@ -171,7 +204,7 @@ allowed_user(struct passwd * pw)
171 if (options.num_deny_groups > 0 || options.num_allow_groups > 0) { 204 if (options.num_deny_groups > 0 || options.num_allow_groups > 0) {
172 /* Get the user's group access list (primary and supplementary) */ 205 /* Get the user's group access list (primary and supplementary) */
173 if (ga_init(pw->pw_name, pw->pw_gid) == 0) { 206 if (ga_init(pw->pw_name, pw->pw_gid) == 0) {
174 log("User %.100s not allowed because not in any group", 207 logit("User %.100s not allowed because not in any group",
175 pw->pw_name); 208 pw->pw_name);
176 return 0; 209 return 0;
177 } 210 }
@@ -181,7 +214,7 @@ allowed_user(struct passwd * pw)
181 if (ga_match(options.deny_groups, 214 if (ga_match(options.deny_groups,
182 options.num_deny_groups)) { 215 options.num_deny_groups)) {
183 ga_free(); 216 ga_free();
184 log("User %.100s not allowed because a group is listed in DenyGroups", 217 logit("User %.100s not allowed because a group is listed in DenyGroups",
185 pw->pw_name); 218 pw->pw_name);
186 return 0; 219 return 0;
187 } 220 }
@@ -193,7 +226,7 @@ allowed_user(struct passwd * pw)
193 if (!ga_match(options.allow_groups, 226 if (!ga_match(options.allow_groups,
194 options.num_allow_groups)) { 227 options.num_allow_groups)) {
195 ga_free(); 228 ga_free();
196 log("User %.100s not allowed because none of user's groups are listed in AllowGroups", 229 logit("User %.100s not allowed because none of user's groups are listed in AllowGroups",
197 pw->pw_name); 230 pw->pw_name);
198 return 0; 231 return 0;
199 } 232 }
@@ -206,26 +239,23 @@ allowed_user(struct passwd * pw)
206 * PermitRootLogin to control logins via ssh), or if running as 239 * PermitRootLogin to control logins via ssh), or if running as
207 * non-root user (since loginrestrictions will always fail). 240 * non-root user (since loginrestrictions will always fail).
208 */ 241 */
209 if ((pw->pw_uid != 0) && (geteuid() == 0) && 242 if ((pw->pw_uid != 0) && (geteuid() == 0)) {
210 loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &loginmsg) != 0) { 243 char *msg;
211 int loginrestrict_errno = errno; 244
212 245 if (loginrestrictions(pw->pw_name, S_RLOGIN, NULL, &msg) != 0) {
213 if (loginmsg && *loginmsg) { 246 int loginrestrict_errno = errno;
214 /* Remove embedded newlines (if any) */ 247
215 char *p; 248 if (msg && *msg) {
216 for (p = loginmsg; *p; p++) { 249 buffer_append(&loginmsg, msg, strlen(msg));
217 if (*p == '\n') 250 aix_remove_embedded_newlines(msg);
218 *p = ' '; 251 logit("Login restricted for %s: %.100s",
252 pw->pw_name, msg);
219 } 253 }
220 /* Remove trailing newline */ 254 /* Don't fail if /etc/nologin set */
221 *--p = '\0'; 255 if (!(loginrestrict_errno == EPERM &&
222 log("Login restricted for %s: %.100s", pw->pw_name, 256 stat(_PATH_NOLOGIN, &st) == 0))
223 loginmsg); 257 return 0;
224 } 258 }
225 /* Don't fail if /etc/nologin set */
226 if (!(loginrestrict_errno == EPERM &&
227 stat(_PATH_NOLOGIN, &st) == 0))
228 return 0;
229 } 259 }
230#endif /* WITH_AIXAUTHENTICATE */ 260#endif /* WITH_AIXAUTHENTICATE */
231 261
@@ -252,7 +282,7 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
252 !authctxt->valid || 282 !authctxt->valid ||
253 authctxt->failures >= AUTH_FAIL_LOG || 283 authctxt->failures >= AUTH_FAIL_LOG ||
254 strcmp(method, "password") == 0) 284 strcmp(method, "password") == 0)
255 authlog = log; 285 authlog = logit;
256 286
257 if (authctxt->postponed) 287 if (authctxt->postponed)
258 authmsg = "Postponed"; 288 authmsg = "Postponed";
@@ -268,13 +298,10 @@ auth_log(Authctxt *authctxt, int authenticated, char *method, char *info)
268 get_remote_port(), 298 get_remote_port(),
269 info); 299 info);
270 300
271#ifdef WITH_AIXAUTHENTICATE 301#ifdef CUSTOM_FAILED_LOGIN
272 if (authenticated == 0 && strcmp(method, "password") == 0) 302 if (authenticated == 0 && strcmp(method, "password") == 0)
273 loginfailed(authctxt->user, 303 record_failed_login(authctxt->user, "ssh");
274 get_canonical_hostname(options.verify_reverse_mapping), 304#endif
275 "ssh");
276#endif /* WITH_AIXAUTHENTICATE */
277
278} 305}
279 306
280/* 307/*
@@ -293,12 +320,12 @@ auth_root_allowed(char *method)
293 break; 320 break;
294 case PERMIT_FORCED_ONLY: 321 case PERMIT_FORCED_ONLY:
295 if (forced_command) { 322 if (forced_command) {
296 log("Root login accepted for forced command."); 323 logit("Root login accepted for forced command.");
297 return 1; 324 return 1;
298 } 325 }
299 break; 326 break;
300 } 327 }
301 log("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr()); 328 logit("ROOT LOGIN REFUSED FROM %.200s", get_remote_ipaddr());
302 return 0; 329 return 0;
303} 330}
304 331
@@ -390,7 +417,7 @@ check_key_in_hostfiles(struct passwd *pw, Key *key, const char *host,
390 (stat(user_hostfile, &st) == 0) && 417 (stat(user_hostfile, &st) == 0) &&
391 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) || 418 ((st.st_uid != 0 && st.st_uid != pw->pw_uid) ||
392 (st.st_mode & 022) != 0)) { 419 (st.st_mode & 022) != 0)) {
393 log("Authentication refused for %.100s: " 420 logit("Authentication refused for %.100s: "
394 "bad owner or modes for %.200s", 421 "bad owner or modes for %.200s",
395 pw->pw_name, user_hostfile); 422 pw->pw_name, user_hostfile);
396 } else { 423 } else {
@@ -494,12 +521,10 @@ getpwnamallow(const char *user)
494 521
495 pw = getpwnam(user); 522 pw = getpwnam(user);
496 if (pw == NULL) { 523 if (pw == NULL) {
497 log("Illegal user %.100s from %.100s", 524 logit("Illegal user %.100s from %.100s",
498 user, get_remote_ipaddr()); 525 user, get_remote_ipaddr());
499#ifdef WITH_AIXAUTHENTICATE 526#ifdef CUSTOM_FAILED_LOGIN
500 loginfailed(user, 527 record_failed_login(user, "ssh");
501 get_canonical_hostname(options.verify_reverse_mapping),
502 "ssh");
503#endif 528#endif
504 return (NULL); 529 return (NULL);
505 } 530 }
@@ -564,3 +589,24 @@ auth_debug_reset(void)
564 auth_debug_init = 1; 589 auth_debug_init = 1;
565 } 590 }
566} 591}
592
593struct passwd *
594fakepw(void)
595{
596 static struct passwd fake;
597
598 memset(&fake, 0, sizeof(fake));
599 fake.pw_name = "NOUSER";
600 fake.pw_passwd =
601 "$2a$06$r3.juUaHZDlIbQaO2dS9FuYxL1W9M81R1Tc92PoSNmzvpEqLkLGrK";
602 fake.pw_gecos = "NOUSER";
603 fake.pw_uid = -1;
604 fake.pw_gid = -1;
605#ifdef HAVE_PW_CLASS_IN_PASSWD
606 fake.pw_class = "";
607#endif
608 fake.pw_dir = "/nonexist";
609 fake.pw_shell = "/nonexist";
610
611 return (&fake);
612}
diff --git a/auth.h b/auth.h
index c75d75366..beaacb8bc 100644
--- a/auth.h
+++ b/auth.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: auth.h,v 1.41 2002/09/26 11:38:43 markus Exp $ */ 1/* $OpenBSD: auth.h,v 1.46 2003/08/28 12:54:34 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -48,29 +48,32 @@ typedef struct KbdintDevice KbdintDevice;
48 48
49struct Authctxt { 49struct Authctxt {
50 int success; 50 int success;
51 int postponed; 51 int postponed; /* authentication needs another step */
52 int valid; 52 int valid; /* user exists and is allowed to login */
53 int attempt; 53 int attempt;
54 int failures; 54 int failures;
55 char *user; 55 char *user; /* username sent by the client */
56 char *service; 56 char *service;
57 struct passwd *pw; 57 struct passwd *pw; /* set if 'valid' */
58 char *style; 58 char *style;
59 void *kbdintctxt; 59 void *kbdintctxt;
60#ifdef BSD_AUTH 60#ifdef BSD_AUTH
61 auth_session_t *as; 61 auth_session_t *as;
62#endif 62#endif
63#ifdef KRB4
64 char *krb4_ticket_file;
65#endif
66#ifdef KRB5 63#ifdef KRB5
67 krb5_context krb5_ctx; 64 krb5_context krb5_ctx;
68 krb5_auth_context krb5_auth_ctx;
69 krb5_ccache krb5_fwd_ccache; 65 krb5_ccache krb5_fwd_ccache;
70 krb5_principal krb5_user; 66 krb5_principal krb5_user;
71 char *krb5_ticket_file; 67 char *krb5_ticket_file;
72#endif 68#endif
69 void *methoddata;
73}; 70};
71/*
72 * Every authentication method has to handle authentication requests for
73 * non-existing users, or for users that are not allowed to login. In this
74 * case 'valid' is set to 0, but 'user' points to the username requested by
75 * the client.
76 */
74 77
75struct Authmethod { 78struct Authmethod {
76 char *name; 79 char *name;
@@ -111,20 +114,6 @@ int auth_rhosts_rsa_key_allowed(struct passwd *, char *, char *, Key *);
111int hostbased_key_allowed(struct passwd *, const char *, char *, Key *); 114int hostbased_key_allowed(struct passwd *, const char *, char *, Key *);
112int user_key_allowed(struct passwd *, Key *); 115int user_key_allowed(struct passwd *, Key *);
113 116
114#ifdef KRB4
115#include <krb.h>
116int auth_krb4(Authctxt *, KTEXT, char **, KTEXT);
117int auth_krb4_password(Authctxt *, const char *);
118void krb4_cleanup_proc(void *);
119
120#ifdef AFS
121#include <kafs.h>
122int auth_krb4_tgt(Authctxt *, const char *);
123int auth_afs_token(Authctxt *, const char *);
124#endif /* AFS */
125
126#endif /* KRB4 */
127
128#ifdef KRB5 117#ifdef KRB5
129int auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *); 118int auth_krb5(Authctxt *authctxt, krb5_data *auth, char **client, krb5_data *);
130int auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt); 119int auth_krb5_tgt(Authctxt *authctxt, krb5_data *tgt);
@@ -133,7 +122,6 @@ void krb5_cleanup_proc(void *authctxt);
133#endif /* KRB5 */ 122#endif /* KRB5 */
134 123
135#include "auth-pam.h" 124#include "auth-pam.h"
136#include "auth2-pam.h"
137 125
138Authctxt *do_authentication(void); 126Authctxt *do_authentication(void);
139Authctxt *do_authentication2(void); 127Authctxt *do_authentication2(void);
@@ -159,6 +147,7 @@ struct passwd * getpwnamallow(const char *user);
159 147
160char *get_challenge(Authctxt *); 148char *get_challenge(Authctxt *);
161int verify_response(Authctxt *, const char *); 149int verify_response(Authctxt *, const char *);
150void abandon_challenge_response(Authctxt *);
162 151
163struct passwd * auth_get_user(void); 152struct passwd * auth_get_user(void);
164 153
@@ -184,6 +173,8 @@ void auth_debug_add(const char *fmt,...) __attribute__((format(printf, 1, 2)));
184void auth_debug_send(void); 173void auth_debug_send(void);
185void auth_debug_reset(void); 174void auth_debug_reset(void);
186 175
176struct passwd *fakepw(void);
177
187#define AUTH_FAIL_MAX 6 178#define AUTH_FAIL_MAX 6
188#define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2) 179#define AUTH_FAIL_LOG (AUTH_FAIL_MAX/2)
189#define AUTH_FAIL_MSG "Too many authentication failures for %.100s" 180#define AUTH_FAIL_MSG "Too many authentication failures for %.100s"
diff --git a/auth1.c b/auth1.c
index c273f2fb6..dfe944dd1 100644
--- a/auth1.c
+++ b/auth1.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: auth1.c,v 1.47 2003/02/06 21:22:42 markus Exp $"); 13RCSID("$OpenBSD: auth1.c,v 1.52 2003/08/28 12:54:34 markus Exp $");
14 14
15#include "xmalloc.h" 15#include "xmalloc.h"
16#include "rsa.h" 16#include "rsa.h"
@@ -49,10 +49,6 @@ get_authname(int type)
49 case SSH_CMSG_AUTH_TIS: 49 case SSH_CMSG_AUTH_TIS:
50 case SSH_CMSG_AUTH_TIS_RESPONSE: 50 case SSH_CMSG_AUTH_TIS_RESPONSE:
51 return "challenge-response"; 51 return "challenge-response";
52#if defined(KRB4) || defined(KRB5)
53 case SSH_CMSG_AUTH_KERBEROS:
54 return "kerberos";
55#endif
56 } 52 }
57 snprintf(buf, sizeof buf, "bad-auth-msg-%d", type); 53 snprintf(buf, sizeof buf, "bad-auth-msg-%d", type);
58 return buf; 54 return buf;
@@ -73,7 +69,7 @@ do_authloop(Authctxt *authctxt)
73 char info[1024]; 69 char info[1024];
74 u_int dlen; 70 u_int dlen;
75 u_int ulen; 71 u_int ulen;
76 int type = 0; 72 int prev, type = 0;
77 struct passwd *pw = authctxt->pw; 73 struct passwd *pw = authctxt->pw;
78 74
79 debug("Attempting authentication for %s%.100s.", 75 debug("Attempting authentication for %s%.100s.",
@@ -81,7 +77,7 @@ do_authloop(Authctxt *authctxt)
81 77
82 /* If the user has no password, accept authentication immediately. */ 78 /* If the user has no password, accept authentication immediately. */
83 if (options.password_authentication && 79 if (options.password_authentication &&
84#if defined(KRB4) || defined(KRB5) 80#ifdef KRB5
85 (!options.kerberos_authentication || options.kerberos_or_local_passwd) && 81 (!options.kerberos_authentication || options.kerberos_or_local_passwd) &&
86#endif 82#endif
87 PRIVSEP(auth_password(authctxt, ""))) { 83 PRIVSEP(auth_password(authctxt, ""))) {
@@ -103,104 +99,22 @@ do_authloop(Authctxt *authctxt)
103 info[0] = '\0'; 99 info[0] = '\0';
104 100
105 /* Get a packet from the client. */ 101 /* Get a packet from the client. */
102 prev = type;
106 type = packet_read(); 103 type = packet_read();
107 104
105 /*
106 * If we started challenge-response authentication but the
107 * next packet is not a response to our challenge, release
108 * the resources allocated by get_challenge() (which would
109 * normally have been released by verify_response() had we
110 * received such a response)
111 */
112 if (prev == SSH_CMSG_AUTH_TIS &&
113 type != SSH_CMSG_AUTH_TIS_RESPONSE)
114 abandon_challenge_response(authctxt);
115
108 /* Process the packet. */ 116 /* Process the packet. */
109 switch (type) { 117 switch (type) {
110
111#if defined(KRB4) || defined(KRB5)
112 case SSH_CMSG_AUTH_KERBEROS:
113 if (!options.kerberos_authentication) {
114 verbose("Kerberos authentication disabled.");
115 } else {
116 char *kdata = packet_get_string(&dlen);
117 packet_check_eom();
118
119 if (kdata[0] == 4) { /* KRB_PROT_VERSION */
120#ifdef KRB4
121 KTEXT_ST tkt, reply;
122 tkt.length = dlen;
123 if (tkt.length < MAX_KTXT_LEN)
124 memcpy(tkt.dat, kdata, tkt.length);
125
126 if (PRIVSEP(auth_krb4(authctxt, &tkt,
127 &client_user, &reply))) {
128 authenticated = 1;
129 snprintf(info, sizeof(info),
130 " tktuser %.100s",
131 client_user);
132
133 packet_start(
134 SSH_SMSG_AUTH_KERBEROS_RESPONSE);
135 packet_put_string((char *)
136 reply.dat, reply.length);
137 packet_send();
138 packet_write_wait();
139 }
140#endif /* KRB4 */
141 } else {
142#ifdef KRB5
143 krb5_data tkt, reply;
144 tkt.length = dlen;
145 tkt.data = kdata;
146
147 if (PRIVSEP(auth_krb5(authctxt, &tkt,
148 &client_user, &reply))) {
149 authenticated = 1;
150 snprintf(info, sizeof(info),
151 " tktuser %.100s",
152 client_user);
153
154 /* Send response to client */
155 packet_start(
156 SSH_SMSG_AUTH_KERBEROS_RESPONSE);
157 packet_put_string((char *)
158 reply.data, reply.length);
159 packet_send();
160 packet_write_wait();
161
162 if (reply.length)
163 xfree(reply.data);
164 }
165#endif /* KRB5 */
166 }
167 xfree(kdata);
168 }
169 break;
170#endif /* KRB4 || KRB5 */
171
172#if defined(AFS) || defined(KRB5)
173 /* XXX - punt on backward compatibility here. */
174 case SSH_CMSG_HAVE_KERBEROS_TGT:
175 packet_send_debug("Kerberos TGT passing disabled before authentication.");
176 break;
177#ifdef AFS
178 case SSH_CMSG_HAVE_AFS_TOKEN:
179 packet_send_debug("AFS token passing disabled before authentication.");
180 break;
181#endif /* AFS */
182#endif /* AFS || KRB5 */
183
184 case SSH_CMSG_AUTH_RHOSTS:
185 if (!options.rhosts_authentication) {
186 verbose("Rhosts authentication disabled.");
187 break;
188 }
189 /*
190 * Get client user name. Note that we just have to
191 * trust the client; this is one reason why rhosts
192 * authentication is insecure. (Another is
193 * IP-spoofing on a local network.)
194 */
195 client_user = packet_get_string(&ulen);
196 packet_check_eom();
197
198 /* Try to authenticate using /etc/hosts.equiv and .rhosts. */
199 authenticated = auth_rhosts(pw, client_user);
200
201 snprintf(info, sizeof info, " ruser %.100s", client_user);
202 break;
203
204 case SSH_CMSG_AUTH_RHOSTS_RSA: 118 case SSH_CMSG_AUTH_RHOSTS_RSA:
205 if (!options.rhosts_rsa_authentication) { 119 if (!options.rhosts_rsa_authentication) {
206 verbose("Rhosts with RSA authentication disabled."); 120 verbose("Rhosts with RSA authentication disabled.");
@@ -297,7 +211,7 @@ do_authloop(Authctxt *authctxt)
297 * Any unknown messages will be ignored (and failure 211 * Any unknown messages will be ignored (and failure
298 * returned) during authentication. 212 * returned) during authentication.
299 */ 213 */
300 log("Unknown message during authentication: type %d", type); 214 logit("Unknown message during authentication: type %d", type);
301 break; 215 break;
302 } 216 }
303#ifdef BSD_AUTH 217#ifdef BSD_AUTH
@@ -311,8 +225,6 @@ do_authloop(Authctxt *authctxt)
311 authctxt->user); 225 authctxt->user);
312 226
313#ifdef _UNICOS 227#ifdef _UNICOS
314 if (type == SSH_CMSG_AUTH_PASSWORD && !authenticated)
315 cray_login_failure(authctxt->user, IA_UDBERR);
316 if (authenticated && cray_access_denied(authctxt->user)) { 228 if (authenticated && cray_access_denied(authctxt->user)) {
317 authenticated = 0; 229 authenticated = 0;
318 fatal("Access denied for user %s.",authctxt->user); 230 fatal("Access denied for user %s.",authctxt->user);
@@ -332,9 +244,10 @@ do_authloop(Authctxt *authctxt)
332 !auth_root_allowed(get_authname(type))) 244 !auth_root_allowed(get_authname(type)))
333 authenticated = 0; 245 authenticated = 0;
334#endif 246#endif
247
335#ifdef USE_PAM 248#ifdef USE_PAM
336 if (!use_privsep && authenticated && 249 if (options.use_pam && authenticated &&
337 !do_pam_account(pw->pw_name, client_user)) 250 !PRIVSEP(do_pam_account()))
338 authenticated = 0; 251 authenticated = 0;
339#endif 252#endif
340 253
@@ -349,9 +262,8 @@ do_authloop(Authctxt *authctxt)
349 if (authenticated) 262 if (authenticated)
350 return; 263 return;
351 264
352 if (authctxt->failures++ > AUTH_FAIL_MAX) { 265 if (authctxt->failures++ > AUTH_FAIL_MAX)
353 packet_disconnect(AUTH_FAIL_MSG, authctxt->user); 266 packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
354 }
355 267
356 packet_start(SSH_SMSG_FAILURE); 268 packet_start(SSH_SMSG_FAILURE);
357 packet_send(); 269 packet_send();
@@ -380,16 +292,6 @@ do_authentication(void)
380 if ((style = strchr(user, ':')) != NULL) 292 if ((style = strchr(user, ':')) != NULL)
381 *style++ = '\0'; 293 *style++ = '\0';
382 294
383#ifdef KRB5
384 /* XXX - SSH.com Kerberos v5 braindeath. */
385 if ((datafellows & SSH_BUG_K5USER) &&
386 options.kerberos_authentication) {
387 char *p;
388 if ((p = strchr(user, '@')) != NULL)
389 *p = '\0';
390 }
391#endif
392
393 authctxt = authctxt_new(); 295 authctxt = authctxt_new();
394 authctxt->user = user; 296 authctxt->user = user;
395 authctxt->style = style; 297 authctxt->style = style;
@@ -397,14 +299,17 @@ do_authentication(void)
397 /* Verify that the user is a valid user. */ 299 /* Verify that the user is a valid user. */
398 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL) 300 if ((authctxt->pw = PRIVSEP(getpwnamallow(user))) != NULL)
399 authctxt->valid = 1; 301 authctxt->valid = 1;
400 else 302 else {
401 debug("do_authentication: illegal user %s", user); 303 debug("do_authentication: illegal user %s", user);
304 authctxt->pw = fakepw();
305 }
402 306
403 setproctitle("%s%s", authctxt->pw ? user : "unknown", 307 setproctitle("%s%s", authctxt->pw ? user : "unknown",
404 use_privsep ? " [net]" : ""); 308 use_privsep ? " [net]" : "");
405 309
406#ifdef USE_PAM 310#ifdef USE_PAM
407 PRIVSEP(start_pam(authctxt->pw == NULL ? "NOUSER" : user)); 311 if (options.use_pam)
312 PRIVSEP(start_pam(user));
408#endif 313#endif
409 314
410 /* 315 /*
diff --git a/auth2-chall.c b/auth2-chall.c
index 0d1709307..aacbf0bcc 100644
--- a/auth2-chall.c
+++ b/auth2-chall.c
@@ -41,6 +41,9 @@ static void input_userauth_info_response(int, u_int32_t, void *);
41#ifdef BSD_AUTH 41#ifdef BSD_AUTH
42extern KbdintDevice bsdauth_device; 42extern KbdintDevice bsdauth_device;
43#else 43#else
44#ifdef USE_PAM
45extern KbdintDevice sshpam_device;
46#endif
44#ifdef SKEY 47#ifdef SKEY
45extern KbdintDevice skey_device; 48extern KbdintDevice skey_device;
46#endif 49#endif
@@ -50,6 +53,9 @@ KbdintDevice *devices[] = {
50#ifdef BSD_AUTH 53#ifdef BSD_AUTH
51 &bsdauth_device, 54 &bsdauth_device,
52#else 55#else
56#ifdef USE_PAM
57 &sshpam_device,
58#endif
53#ifdef SKEY 59#ifdef SKEY
54 &skey_device, 60 &skey_device,
55#endif 61#endif
@@ -320,18 +326,27 @@ input_userauth_info_response(int type, u_int32_t seq, void *ctxt)
320void 326void
321privsep_challenge_enable(void) 327privsep_challenge_enable(void)
322{ 328{
329#if defined(BSD_AUTH) || defined(USE_PAM) || defined(SKEY)
330 int n = 0;
331#endif
323#ifdef BSD_AUTH 332#ifdef BSD_AUTH
324 extern KbdintDevice mm_bsdauth_device; 333 extern KbdintDevice mm_bsdauth_device;
325#endif 334#endif
335#ifdef USE_PAM
336 extern KbdintDevice mm_sshpam_device;
337#endif
326#ifdef SKEY 338#ifdef SKEY
327 extern KbdintDevice mm_skey_device; 339 extern KbdintDevice mm_skey_device;
328#endif 340#endif
329 /* As long as SSHv1 has devices[0] hard coded this is fine */ 341
330#ifdef BSD_AUTH 342#ifdef BSD_AUTH
331 devices[0] = &mm_bsdauth_device; 343 devices[n++] = &mm_bsdauth_device;
332#else 344#else
345#ifdef USE_PAM
346 devices[n++] = &mm_sshpam_device;
347#endif
333#ifdef SKEY 348#ifdef SKEY
334 devices[0] = &mm_skey_device; 349 devices[n++] = &mm_skey_device;
335#endif 350#endif
336#endif 351#endif
337} 352}
diff --git a/auth2-gss.c b/auth2-gss.c
new file mode 100644
index 000000000..75b94b009
--- /dev/null
+++ b/auth2-gss.c
@@ -0,0 +1,247 @@
1/* $OpenBSD: auth2-gss.c,v 1.3 2003/09/01 20:44:54 markus Exp $ */
2
3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include "includes.h"
28
29#ifdef GSSAPI
30
31#include "auth.h"
32#include "ssh2.h"
33#include "xmalloc.h"
34#include "log.h"
35#include "dispatch.h"
36#include "servconf.h"
37#include "compat.h"
38#include "packet.h"
39#include "monitor_wrap.h"
40
41#include "ssh-gss.h"
42
43extern ServerOptions options;
44
45static void input_gssapi_token(int type, u_int32_t plen, void *ctxt);
46static void input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt);
47static void input_gssapi_errtok(int, u_int32_t, void *);
48
49/*
50 * We only support those mechanisms that we know about (ie ones that we know
51 * how to check local user kuserok and the like
52 */
53static int
54userauth_gssapi(Authctxt *authctxt)
55{
56 gss_OID_desc oid = {0, NULL};
57 Gssctxt *ctxt = NULL;
58 int mechs;
59 gss_OID_set supported;
60 int present;
61 OM_uint32 ms;
62 u_int len;
63 char *doid = NULL;
64
65 if (!authctxt->valid || authctxt->user == NULL)
66 return (0);
67
68 mechs = packet_get_int();
69 if (mechs == 0) {
70 debug("Mechanism negotiation is not supported");
71 return (0);
72 }
73
74 ssh_gssapi_supported_oids(&supported);
75 do {
76 mechs--;
77
78 if (doid)
79 xfree(doid);
80
81 doid = packet_get_string(&len);
82
83 if (doid[0] != SSH_GSS_OIDTYPE || doid[1] != len-2) {
84 logit("Mechanism OID received using the old encoding form");
85 oid.elements = doid;
86 oid.length = len;
87 } else {
88 oid.elements = doid + 2;
89 oid.length = len - 2;
90 }
91 gss_test_oid_set_member(&ms, &oid, supported, &present);
92 } while (mechs > 0 && !present);
93
94 gss_release_oid_set(&ms, &supported);
95
96 if (!present) {
97 xfree(doid);
98 return (0);
99 }
100
101 if (GSS_ERROR(PRIVSEP(ssh_gssapi_server_ctx(&ctxt, &oid)))) {
102 xfree(doid);
103 return (0);
104 }
105
106 authctxt->methoddata=(void *)ctxt;
107
108 packet_start(SSH2_MSG_USERAUTH_GSSAPI_RESPONSE);
109
110 /* Return OID in same format as we received it*/
111 packet_put_string(doid, len);
112
113 packet_send();
114 xfree(doid);
115
116 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, &input_gssapi_token);
117 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, &input_gssapi_errtok);
118 authctxt->postponed = 1;
119
120 return (0);
121}
122
123static void
124input_gssapi_token(int type, u_int32_t plen, void *ctxt)
125{
126 Authctxt *authctxt = ctxt;
127 Gssctxt *gssctxt;
128 gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
129 gss_buffer_desc recv_tok;
130 OM_uint32 maj_status, min_status;
131 u_int len;
132
133 if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
134 fatal("No authentication or GSSAPI context");
135
136 gssctxt = authctxt->methoddata;
137 recv_tok.value = packet_get_string(&len);
138 recv_tok.length = len; /* u_int vs. size_t */
139
140 packet_check_eom();
141
142 maj_status = PRIVSEP(ssh_gssapi_accept_ctx(gssctxt, &recv_tok,
143 &send_tok, NULL));
144
145 xfree(recv_tok.value);
146
147 if (GSS_ERROR(maj_status)) {
148 if (send_tok.length != 0) {
149 packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK);
150 packet_put_string(send_tok.value, send_tok.length);
151 packet_send();
152 }
153 authctxt->postponed = 0;
154 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
155 userauth_finish(authctxt, 0, "gssapi");
156 } else {
157 if (send_tok.length != 0) {
158 packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
159 packet_put_string(send_tok.value, send_tok.length);
160 packet_send();
161 }
162 if (maj_status == GSS_S_COMPLETE) {
163 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
164 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE,
165 &input_gssapi_exchange_complete);
166 }
167 }
168
169 gss_release_buffer(&min_status, &send_tok);
170}
171
172static void
173input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
174{
175 Authctxt *authctxt = ctxt;
176 Gssctxt *gssctxt;
177 gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
178 gss_buffer_desc recv_tok;
179 OM_uint32 maj_status;
180 u_int len;
181
182 if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
183 fatal("No authentication or GSSAPI context");
184
185 gssctxt = authctxt->methoddata;
186 recv_tok.value = packet_get_string(&len);
187 recv_tok.length = len;
188
189 packet_check_eom();
190
191 /* Push the error token into GSSAPI to see what it says */
192 maj_status = PRIVSEP(ssh_gssapi_accept_ctx(gssctxt, &recv_tok,
193 &send_tok, NULL));
194
195 xfree(recv_tok.value);
196
197 /* We can't return anything to the client, even if we wanted to */
198 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
199 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL);
200
201 /* The client will have already moved on to the next auth */
202
203 gss_release_buffer(&maj_status, &send_tok);
204}
205
206/*
207 * This is called when the client thinks we've completed authentication.
208 * It should only be enabled in the dispatch handler by the function above,
209 * which only enables it once the GSSAPI exchange is complete.
210 */
211
212static void
213input_gssapi_exchange_complete(int type, u_int32_t plen, void *ctxt)
214{
215 Authctxt *authctxt = ctxt;
216 Gssctxt *gssctxt;
217 int authenticated;
218
219 if (authctxt == NULL || (authctxt->methoddata == NULL && !use_privsep))
220 fatal("No authentication or GSSAPI context");
221
222 gssctxt = authctxt->methoddata;
223
224 /*
225 * We don't need to check the status, because the stored credentials
226 * which userok uses are only populated once the context init step
227 * has returned complete.
228 */
229
230 packet_check_eom();
231
232 authenticated = PRIVSEP(ssh_gssapi_userok(authctxt->user));
233
234 authctxt->postponed = 0;
235 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
236 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, NULL);
237 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
238 userauth_finish(authctxt, authenticated, "gssapi");
239}
240
241Authmethod method_gssapi = {
242 "gssapi",
243 userauth_gssapi,
244 &options.gss_authentication
245};
246
247#endif /* GSSAPI */
diff --git a/auth2-hostbased.c b/auth2-hostbased.c
index 2bde7bb79..505d3eff4 100644
--- a/auth2-hostbased.c
+++ b/auth2-hostbased.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-hostbased.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); 26RCSID("$OpenBSD: auth2-hostbased.c,v 1.5 2003/06/24 08:23:46 markus Exp $");
27 27
28#include "ssh2.h" 28#include "ssh2.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -42,7 +42,7 @@ RCSID("$OpenBSD: auth2-hostbased.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
42/* import */ 42/* import */
43extern ServerOptions options; 43extern ServerOptions options;
44extern u_char *session_id2; 44extern u_char *session_id2;
45extern int session_id2_len; 45extern u_int session_id2_len;
46 46
47static int 47static int
48userauth_hostbased(Authctxt *authctxt) 48userauth_hostbased(Authctxt *authctxt)
@@ -77,7 +77,7 @@ userauth_hostbased(Authctxt *authctxt)
77 pktype = key_type_from_name(pkalg); 77 pktype = key_type_from_name(pkalg);
78 if (pktype == KEY_UNSPEC) { 78 if (pktype == KEY_UNSPEC) {
79 /* this is perfectly legal */ 79 /* this is perfectly legal */
80 log("userauth_hostbased: unsupported " 80 logit("userauth_hostbased: unsupported "
81 "public key algorithm: %s", pkalg); 81 "public key algorithm: %s", pkalg);
82 goto done; 82 goto done;
83 } 83 }
@@ -136,7 +136,7 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
136 HostStatus host_status; 136 HostStatus host_status;
137 int len; 137 int len;
138 138
139 resolvedname = get_canonical_hostname(options.verify_reverse_mapping); 139 resolvedname = get_canonical_hostname(options.use_dns);
140 ipaddr = get_remote_ipaddr(); 140 ipaddr = get_remote_ipaddr();
141 141
142 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s", 142 debug2("userauth_hostbased: chost %s resolvedname %s ipaddr %s",
@@ -152,7 +152,7 @@ hostbased_key_allowed(struct passwd *pw, const char *cuser, char *chost,
152 chost[len - 1] = '\0'; 152 chost[len - 1] = '\0';
153 } 153 }
154 if (strcasecmp(resolvedname, chost) != 0) 154 if (strcasecmp(resolvedname, chost) != 0)
155 log("userauth_hostbased mismatch: " 155 logit("userauth_hostbased mismatch: "
156 "client sends %s, but we resolve %s to %s", 156 "client sends %s, but we resolve %s to %s",
157 chost, ipaddr, resolvedname); 157 chost, ipaddr, resolvedname);
158 if (auth_rhosts2(pw, cuser, resolvedname, ipaddr) == 0) 158 if (auth_rhosts2(pw, cuser, resolvedname, ipaddr) == 0)
diff --git a/auth2-kbdint.c b/auth2-kbdint.c
index e60992881..1696ef4d3 100644
--- a/auth2-kbdint.c
+++ b/auth2-kbdint.c
@@ -49,10 +49,6 @@ userauth_kbdint(Authctxt *authctxt)
49 if (options.challenge_response_authentication) 49 if (options.challenge_response_authentication)
50 authenticated = auth2_challenge(authctxt, devs); 50 authenticated = auth2_challenge(authctxt, devs);
51 51
52#ifdef USE_PAM
53 if (authenticated == 0 && options.pam_authentication_via_kbd_int)
54 authenticated = auth2_pam(authctxt);
55#endif
56 xfree(devs); 52 xfree(devs);
57 xfree(lang); 53 xfree(lang);
58#ifdef HAVE_CYGWIN 54#ifdef HAVE_CYGWIN
diff --git a/auth2-none.c b/auth2-none.c
index 692a2961f..c342addec 100644
--- a/auth2-none.c
+++ b/auth2-none.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-none.c,v 1.4 2002/06/27 10:35:47 deraadt Exp $"); 26RCSID("$OpenBSD: auth2-none.c,v 1.6 2003/08/26 09:58:43 markus Exp $");
27 27
28#include "auth.h" 28#include "auth.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -100,7 +100,9 @@ userauth_none(Authctxt *authctxt)
100 if (check_nt_auth(1, authctxt->pw) == 0) 100 if (check_nt_auth(1, authctxt->pw) == 0)
101 return(0); 101 return(0);
102#endif 102#endif
103 return PRIVSEP(auth_password(authctxt, "")) && authctxt->valid; 103 if (options.password_authentication)
104 return (PRIVSEP(auth_password(authctxt, "")));
105 return (0);
104} 106}
105 107
106Authmethod method_none = { 108Authmethod method_none = {
diff --git a/auth2-passwd.c b/auth2-passwd.c
index 5026969f8..67fb4c921 100644
--- a/auth2-passwd.c
+++ b/auth2-passwd.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-passwd.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); 26RCSID("$OpenBSD: auth2-passwd.c,v 1.4 2003/08/26 09:58:43 markus Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29#include "packet.h" 29#include "packet.h"
@@ -44,10 +44,10 @@ userauth_passwd(Authctxt *authctxt)
44 u_int len; 44 u_int len;
45 change = packet_get_char(); 45 change = packet_get_char();
46 if (change) 46 if (change)
47 log("password change not supported"); 47 logit("password change not supported");
48 password = packet_get_string(&len); 48 password = packet_get_string(&len);
49 packet_check_eom(); 49 packet_check_eom();
50 if (PRIVSEP(auth_password(authctxt, password)) == 1 && authctxt->valid 50 if (PRIVSEP(auth_password(authctxt, password)) == 1
51#ifdef HAVE_CYGWIN 51#ifdef HAVE_CYGWIN
52 && check_nt_auth(1, authctxt->pw) 52 && check_nt_auth(1, authctxt->pw)
53#endif 53#endif
diff --git a/auth2-pubkey.c b/auth2-pubkey.c
index 947bfed0b..d51e939f1 100644
--- a/auth2-pubkey.c
+++ b/auth2-pubkey.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2-pubkey.c,v 1.2 2002/05/31 11:35:15 markus Exp $"); 26RCSID("$OpenBSD: auth2-pubkey.c,v 1.4 2003/06/24 08:23:46 markus Exp $");
27 27
28#include "ssh2.h" 28#include "ssh2.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -44,7 +44,7 @@ RCSID("$OpenBSD: auth2-pubkey.c,v 1.2 2002/05/31 11:35:15 markus Exp $");
44/* import */ 44/* import */
45extern ServerOptions options; 45extern ServerOptions options;
46extern u_char *session_id2; 46extern u_char *session_id2;
47extern int session_id2_len; 47extern u_int session_id2_len;
48 48
49static int 49static int
50userauth_pubkey(Authctxt *authctxt) 50userauth_pubkey(Authctxt *authctxt)
@@ -78,7 +78,7 @@ userauth_pubkey(Authctxt *authctxt)
78 pktype = key_type_from_name(pkalg); 78 pktype = key_type_from_name(pkalg);
79 if (pktype == KEY_UNSPEC) { 79 if (pktype == KEY_UNSPEC) {
80 /* this is perfectly legal */ 80 /* this is perfectly legal */
81 log("userauth_pubkey: unsupported public key algorithm: %s", 81 logit("userauth_pubkey: unsupported public key algorithm: %s",
82 pkalg); 82 pkalg);
83 goto done; 83 goto done;
84 } 84 }
@@ -199,7 +199,7 @@ user_key_allowed2(struct passwd *pw, Key *key, char *file)
199 if (options.strict_modes && 199 if (options.strict_modes &&
200 secure_filename(f, file, pw, line, sizeof(line)) != 0) { 200 secure_filename(f, file, pw, line, sizeof(line)) != 0) {
201 fclose(f); 201 fclose(f);
202 log("Authentication refused: %s", line); 202 logit("Authentication refused: %s", line);
203 restore_uid(); 203 restore_uid();
204 return 0; 204 return 0;
205 } 205 }
diff --git a/auth2.c b/auth2.c
index 1b21eb2da..41e77efdc 100644
--- a/auth2.c
+++ b/auth2.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: auth2.c,v 1.96 2003/02/06 21:22:43 markus Exp $"); 26RCSID("$OpenBSD: auth2.c,v 1.102 2003/08/26 09:58:43 markus Exp $");
27 27
28#include "ssh2.h" 28#include "ssh2.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -36,10 +36,14 @@ RCSID("$OpenBSD: auth2.c,v 1.96 2003/02/06 21:22:43 markus Exp $");
36#include "pathnames.h" 36#include "pathnames.h"
37#include "monitor_wrap.h" 37#include "monitor_wrap.h"
38 38
39#ifdef GSSAPI
40#include "ssh-gss.h"
41#endif
42
39/* import */ 43/* import */
40extern ServerOptions options; 44extern ServerOptions options;
41extern u_char *session_id2; 45extern u_char *session_id2;
42extern int session_id2_len; 46extern u_int session_id2_len;
43 47
44Authctxt *x_authctxt = NULL; 48Authctxt *x_authctxt = NULL;
45 49
@@ -50,10 +54,16 @@ extern Authmethod method_pubkey;
50extern Authmethod method_passwd; 54extern Authmethod method_passwd;
51extern Authmethod method_kbdint; 55extern Authmethod method_kbdint;
52extern Authmethod method_hostbased; 56extern Authmethod method_hostbased;
57#ifdef GSSAPI
58extern Authmethod method_gssapi;
59#endif
53 60
54Authmethod *authmethods[] = { 61Authmethod *authmethods[] = {
55 &method_none, 62 &method_none,
56 &method_pubkey, 63 &method_pubkey,
64#ifdef GSSAPI
65 &method_gssapi,
66#endif
57 &method_passwd, 67 &method_passwd,
58 &method_kbdint, 68 &method_kbdint,
59 &method_hostbased, 69 &method_hostbased,
@@ -85,10 +95,6 @@ do_authentication2(void)
85 /* challenge-response is implemented via keyboard interactive */ 95 /* challenge-response is implemented via keyboard interactive */
86 if (options.challenge_response_authentication) 96 if (options.challenge_response_authentication)
87 options.kbd_interactive_authentication = 1; 97 options.kbd_interactive_authentication = 1;
88 if (options.pam_authentication_via_kbd_int)
89 options.kbd_interactive_authentication = 1;
90 if (use_privsep)
91 options.pam_authentication_via_kbd_int = 0;
92 98
93 dispatch_init(&dispatch_protocol_error); 99 dispatch_init(&dispatch_protocol_error);
94 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request); 100 dispatch_set(SSH2_MSG_SERVICE_REQUEST, &input_service_request);
@@ -157,12 +163,15 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
157 authctxt->valid = 1; 163 authctxt->valid = 1;
158 debug2("input_userauth_request: setting up authctxt for %s", user); 164 debug2("input_userauth_request: setting up authctxt for %s", user);
159#ifdef USE_PAM 165#ifdef USE_PAM
160 PRIVSEP(start_pam(authctxt->pw->pw_name)); 166 if (options.use_pam)
167 PRIVSEP(start_pam(authctxt->pw->pw_name));
161#endif 168#endif
162 } else { 169 } else {
163 log("input_userauth_request: illegal user %s", user); 170 logit("input_userauth_request: illegal user %s", user);
171 authctxt->pw = fakepw();
164#ifdef USE_PAM 172#ifdef USE_PAM
165 PRIVSEP(start_pam("NOUSER")); 173 if (options.use_pam)
174 PRIVSEP(start_pam(user));
166#endif 175#endif
167 } 176 }
168 setproctitle("%s%s", authctxt->pw ? user : "unknown", 177 setproctitle("%s%s", authctxt->pw ? user : "unknown",
@@ -180,6 +189,12 @@ input_userauth_request(int type, u_int32_t seq, void *ctxt)
180 } 189 }
181 /* reset state */ 190 /* reset state */
182 auth2_challenge_stop(authctxt); 191 auth2_challenge_stop(authctxt);
192
193#ifdef GSSAPI
194 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, NULL);
195 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE, NULL);
196#endif
197
183 authctxt->postponed = 0; 198 authctxt->postponed = 0;
184 199
185 /* try to authenticate user */ 200 /* try to authenticate user */
@@ -210,10 +225,9 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
210 authenticated = 0; 225 authenticated = 0;
211 226
212#ifdef USE_PAM 227#ifdef USE_PAM
213 if (!use_privsep && authenticated && authctxt->user && 228 if (options.use_pam && authenticated && !PRIVSEP(do_pam_account()))
214 !do_pam_account(authctxt->user, NULL))
215 authenticated = 0; 229 authenticated = 0;
216#endif /* USE_PAM */ 230#endif
217 231
218#ifdef _UNICOS 232#ifdef _UNICOS
219 if (authenticated && cray_access_denied(authctxt->user)) { 233 if (authenticated && cray_access_denied(authctxt->user)) {
@@ -238,13 +252,8 @@ userauth_finish(Authctxt *authctxt, int authenticated, char *method)
238 /* now we can break out */ 252 /* now we can break out */
239 authctxt->success = 1; 253 authctxt->success = 1;
240 } else { 254 } else {
241 if (authctxt->failures++ > AUTH_FAIL_MAX) { 255 if (authctxt->failures++ > AUTH_FAIL_MAX)
242 packet_disconnect(AUTH_FAIL_MSG, authctxt->user); 256 packet_disconnect(AUTH_FAIL_MSG, authctxt->user);
243 }
244#ifdef _UNICOS
245 if (strcmp(method, "password") == 0)
246 cray_login_failure(authctxt->user, IA_UDBERR);
247#endif /* _UNICOS */
248 methods = authmethods_get(); 257 methods = authmethods_get();
249 packet_start(SSH2_MSG_USERAUTH_FAILURE); 258 packet_start(SSH2_MSG_USERAUTH_FAILURE);
250 packet_put_cstring(methods); 259 packet_put_cstring(methods);
diff --git a/authfd.c b/authfd.c
index a186e0117..c78db6d94 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: authfd.c,v 1.58 2003/01/23 13:50:27 markus Exp $"); 38RCSID("$OpenBSD: authfd.c,v 1.61 2003/06/28 16:23:06 deraadt Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -122,8 +122,8 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
122 PUT_32BIT(buf, len); 122 PUT_32BIT(buf, len);
123 123
124 /* Send the length and then the packet to the agent. */ 124 /* Send the length and then the packet to the agent. */
125 if (atomicio(write, auth->fd, buf, 4) != 4 || 125 if (atomicio(vwrite, auth->fd, buf, 4) != 4 ||
126 atomicio(write, auth->fd, buffer_ptr(request), 126 atomicio(vwrite, auth->fd, buffer_ptr(request),
127 buffer_len(request)) != buffer_len(request)) { 127 buffer_len(request)) != buffer_len(request)) {
128 error("Error writing to authentication socket."); 128 error("Error writing to authentication socket.");
129 return 0; 129 return 0;
@@ -332,7 +332,7 @@ ssh_get_next_identity(AuthenticationConnection *auth, char **comment, int versio
332 buffer_get_bignum(&auth->identities, key->rsa->n); 332 buffer_get_bignum(&auth->identities, key->rsa->n);
333 *comment = buffer_get_string(&auth->identities, NULL); 333 *comment = buffer_get_string(&auth->identities, NULL);
334 if (bits != BN_num_bits(key->rsa->n)) 334 if (bits != BN_num_bits(key->rsa->n))
335 log("Warning: identity keysize mismatch: actual %d, announced %u", 335 logit("Warning: identity keysize mismatch: actual %d, announced %u",
336 BN_num_bits(key->rsa->n), bits); 336 BN_num_bits(key->rsa->n), bits);
337 break; 337 break;
338 case 2: 338 case 2:
@@ -373,7 +373,7 @@ ssh_decrypt_challenge(AuthenticationConnection *auth,
373 if (key->type != KEY_RSA1) 373 if (key->type != KEY_RSA1)
374 return 0; 374 return 0;
375 if (response_type == 0) { 375 if (response_type == 0) {
376 log("Compatibility with ssh protocol version 1.0 no longer supported."); 376 logit("Compatibility with ssh protocol version 1.0 no longer supported.");
377 return 0; 377 return 0;
378 } 378 }
379 buffer_init(&buffer); 379 buffer_init(&buffer);
@@ -392,7 +392,7 @@ ssh_decrypt_challenge(AuthenticationConnection *auth,
392 type = buffer_get_char(&buffer); 392 type = buffer_get_char(&buffer);
393 393
394 if (agent_failed(type)) { 394 if (agent_failed(type)) {
395 log("Agent admitted failure to authenticate using the key."); 395 logit("Agent admitted failure to authenticate using the key.");
396 } else if (type != SSH_AGENT_RSA_RESPONSE) { 396 } else if (type != SSH_AGENT_RSA_RESPONSE) {
397 fatal("Bad authentication response: %d", type); 397 fatal("Bad authentication response: %d", type);
398 } else { 398 } else {
@@ -441,7 +441,7 @@ ssh_agent_sign(AuthenticationConnection *auth,
441 } 441 }
442 type = buffer_get_char(&msg); 442 type = buffer_get_char(&msg);
443 if (agent_failed(type)) { 443 if (agent_failed(type)) {
444 log("Agent admitted failure to sign using the key."); 444 logit("Agent admitted failure to sign using the key.");
445 } else if (type != SSH2_AGENT_SIGN_RESPONSE) { 445 } else if (type != SSH2_AGENT_SIGN_RESPONSE) {
446 fatal("Bad authentication response: %d", type); 446 fatal("Bad authentication response: %d", type);
447 } else { 447 } else {
@@ -589,16 +589,33 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key)
589} 589}
590 590
591int 591int
592ssh_update_card(AuthenticationConnection *auth, int add, const char *reader_id, const char *pin) 592ssh_update_card(AuthenticationConnection *auth, int add,
593 const char *reader_id, const char *pin, u_int life, u_int confirm)
593{ 594{
594 Buffer msg; 595 Buffer msg;
595 int type; 596 int type, constrained = (life || confirm);
597
598 if (add) {
599 type = constrained ?
600 SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED :
601 SSH_AGENTC_ADD_SMARTCARD_KEY;
602 } else
603 type = SSH_AGENTC_REMOVE_SMARTCARD_KEY;
596 604
597 buffer_init(&msg); 605 buffer_init(&msg);
598 buffer_put_char(&msg, add ? SSH_AGENTC_ADD_SMARTCARD_KEY : 606 buffer_put_char(&msg, type);
599 SSH_AGENTC_REMOVE_SMARTCARD_KEY);
600 buffer_put_cstring(&msg, reader_id); 607 buffer_put_cstring(&msg, reader_id);
601 buffer_put_cstring(&msg, pin); 608 buffer_put_cstring(&msg, pin);
609
610 if (constrained) {
611 if (life != 0) {
612 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME);
613 buffer_put_int(&msg, life);
614 }
615 if (confirm != 0)
616 buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_CONFIRM);
617 }
618
602 if (ssh_request_reply(auth, &msg, &msg) == 0) { 619 if (ssh_request_reply(auth, &msg, &msg) == 0) {
603 buffer_free(&msg); 620 buffer_free(&msg);
604 return 0; 621 return 0;
@@ -641,7 +658,7 @@ decode_reply(int type)
641 case SSH_AGENT_FAILURE: 658 case SSH_AGENT_FAILURE:
642 case SSH_COM_AGENT2_FAILURE: 659 case SSH_COM_AGENT2_FAILURE:
643 case SSH2_AGENT_FAILURE: 660 case SSH2_AGENT_FAILURE:
644 log("SSH_AGENT_FAILURE"); 661 logit("SSH_AGENT_FAILURE");
645 return 0; 662 return 0;
646 case SSH_AGENT_SUCCESS: 663 case SSH_AGENT_SUCCESS:
647 return 1; 664 return 1;
diff --git a/authfd.h b/authfd.h
index 2a8751ec1..74b825c51 100644
--- a/authfd.h
+++ b/authfd.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: authfd.h,v 1.32 2003/01/23 13:50:27 markus Exp $ */ 1/* $OpenBSD: authfd.h,v 1.33 2003/06/11 11:18:38 djm Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -49,6 +49,7 @@
49/* add key with constraints */ 49/* add key with constraints */
50#define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24 50#define SSH_AGENTC_ADD_RSA_ID_CONSTRAINED 24
51#define SSH2_AGENTC_ADD_ID_CONSTRAINED 25 51#define SSH2_AGENTC_ADD_ID_CONSTRAINED 25
52#define SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED 26
52 53
53#define SSH_AGENT_CONSTRAIN_LIFETIME 1 54#define SSH_AGENT_CONSTRAIN_LIFETIME 1
54#define SSH_AGENT_CONSTRAIN_CONFIRM 2 55#define SSH_AGENT_CONSTRAIN_CONFIRM 2
@@ -82,7 +83,8 @@ int ssh_add_identity_constrained(AuthenticationConnection *, Key *,
82int ssh_remove_identity(AuthenticationConnection *, Key *); 83int ssh_remove_identity(AuthenticationConnection *, Key *);
83int ssh_remove_all_identities(AuthenticationConnection *, int); 84int ssh_remove_all_identities(AuthenticationConnection *, int);
84int ssh_lock_agent(AuthenticationConnection *, int, const char *); 85int ssh_lock_agent(AuthenticationConnection *, int, const char *);
85int ssh_update_card(AuthenticationConnection *, int, const char *, const char *); 86int ssh_update_card(AuthenticationConnection *, int, const char *,
87 const char *, u_int, u_int);
86 88
87int 89int
88ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16], 90ssh_decrypt_challenge(AuthenticationConnection *, Key *, BIGNUM *, u_char[16],
diff --git a/authfile.c b/authfile.c
index 90618efde..1f46093e3 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: authfile.c,v 1.52 2003/03/13 11:42:18 markus Exp $"); 39RCSID("$OpenBSD: authfile.c,v 1.54 2003/05/24 09:30:39 djm Exp $");
40 40
41#include <openssl/err.h> 41#include <openssl/err.h>
42#include <openssl/evp.h> 42#include <openssl/evp.h>
@@ -514,7 +514,7 @@ key_perm_ok(int fd, const char *filename)
514 error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @"); 514 error("@ WARNING: UNPROTECTED PRIVATE KEY FILE! @");
515 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); 515 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
516 error("Permissions 0%3.3o for '%s' are too open.", 516 error("Permissions 0%3.3o for '%s' are too open.",
517 st.st_mode & 0777, filename); 517 (u_int)st.st_mode & 0777, filename);
518 error("It is recommended that your private key files are NOT accessible by others."); 518 error("It is recommended that your private key files are NOT accessible by others.");
519 error("This private key will be ignored."); 519 error("This private key will be ignored.");
520 return 0; 520 return 0;
@@ -629,9 +629,18 @@ key_load_public(const char *filename, char **commentp)
629 Key *pub; 629 Key *pub;
630 char file[MAXPATHLEN]; 630 char file[MAXPATHLEN];
631 631
632 /* try rsa1 private key */
632 pub = key_load_public_type(KEY_RSA1, filename, commentp); 633 pub = key_load_public_type(KEY_RSA1, filename, commentp);
633 if (pub != NULL) 634 if (pub != NULL)
634 return pub; 635 return pub;
636
637 /* try rsa1 public key */
638 pub = key_new(KEY_RSA1);
639 if (key_try_load_public(pub, filename, commentp) == 1)
640 return pub;
641 key_free(pub);
642
643 /* try ssh2 public key */
635 pub = key_new(KEY_UNSPEC); 644 pub = key_new(KEY_UNSPEC);
636 if (key_try_load_public(pub, filename, commentp) == 1) 645 if (key_try_load_public(pub, filename, commentp) == 1)
637 return pub; 646 return pub;
diff --git a/bufaux.c b/bufaux.c
index 3c276b810..37cc27ff6 100644
--- a/bufaux.c
+++ b/bufaux.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: bufaux.c,v 1.28 2002/10/23 10:40:16 markus Exp $"); 40RCSID("$OpenBSD: bufaux.c,v 1.29 2003/04/08 20:21:28 itojun Exp $");
41 41
42#include <openssl/bn.h> 42#include <openssl/bn.h>
43#include "bufaux.h" 43#include "bufaux.h"
@@ -119,7 +119,7 @@ buffer_put_bignum2(Buffer *buffer, BIGNUM *value)
119 /**XXX should be two's-complement */ 119 /**XXX should be two's-complement */
120 int i, carry; 120 int i, carry;
121 u_char *uc = buf; 121 u_char *uc = buf;
122 log("negativ!"); 122 logit("negativ!");
123 for (i = bytes-1, carry = 1; i>=0; i--) { 123 for (i = bytes-1, carry = 1; i>=0; i--) {
124 uc[i] ^= 0xff; 124 uc[i] ^= 0xff;
125 if (carry) 125 if (carry)
@@ -165,7 +165,6 @@ buffer_get_int(Buffer *buffer)
165 return GET_32BIT(buf); 165 return GET_32BIT(buf);
166} 166}
167 167
168#ifdef HAVE_U_INT64_T
169u_int64_t 168u_int64_t
170buffer_get_int64(Buffer *buffer) 169buffer_get_int64(Buffer *buffer)
171{ 170{
@@ -174,7 +173,6 @@ buffer_get_int64(Buffer *buffer)
174 buffer_get(buffer, (char *) buf, 8); 173 buffer_get(buffer, (char *) buf, 8);
175 return GET_64BIT(buf); 174 return GET_64BIT(buf);
176} 175}
177#endif
178 176
179/* 177/*
180 * Stores integers in the buffer, msb first. 178 * Stores integers in the buffer, msb first.
@@ -197,7 +195,6 @@ buffer_put_int(Buffer *buffer, u_int value)
197 buffer_append(buffer, buf, 4); 195 buffer_append(buffer, buf, 4);
198} 196}
199 197
200#ifdef HAVE_U_INT64_T
201void 198void
202buffer_put_int64(Buffer *buffer, u_int64_t value) 199buffer_put_int64(Buffer *buffer, u_int64_t value)
203{ 200{
@@ -206,7 +203,6 @@ buffer_put_int64(Buffer *buffer, u_int64_t value)
206 PUT_64BIT(buf, value); 203 PUT_64BIT(buf, value);
207 buffer_append(buffer, buf, 8); 204 buffer_append(buffer, buf, 8);
208} 205}
209#endif
210 206
211/* 207/*
212 * Returns an arbitrary binary string from the buffer. The string cannot 208 * Returns an arbitrary binary string from the buffer. The string cannot
diff --git a/bufaux.h b/bufaux.h
index 80f35c1ec..935553579 100644
--- a/bufaux.h
+++ b/bufaux.h
@@ -29,10 +29,8 @@ void buffer_put_short(Buffer *, u_short);
29u_int buffer_get_int(Buffer *); 29u_int buffer_get_int(Buffer *);
30void buffer_put_int(Buffer *, u_int); 30void buffer_put_int(Buffer *, u_int);
31 31
32#ifdef HAVE_U_INT64_T
33u_int64_t buffer_get_int64(Buffer *); 32u_int64_t buffer_get_int64(Buffer *);
34void buffer_put_int64(Buffer *, u_int64_t); 33void buffer_put_int64(Buffer *, u_int64_t);
35#endif
36 34
37int buffer_get_char(Buffer *); 35int buffer_get_char(Buffer *);
38void buffer_put_char(Buffer *, int); 36void buffer_put_char(Buffer *, int);
diff --git a/buffer.c b/buffer.c
index ad04b267e..8ff8c2f48 100644
--- a/buffer.c
+++ b/buffer.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: buffer.c,v 1.16 2002/06/26 08:54:18 markus Exp $"); 15RCSID("$OpenBSD: buffer.c,v 1.17 2003/09/16 03:03:47 deraadt Exp $");
16 16
17#include "xmalloc.h" 17#include "xmalloc.h"
18#include "buffer.h" 18#include "buffer.h"
@@ -69,6 +69,7 @@ buffer_append(Buffer *buffer, const void *data, u_int len)
69void * 69void *
70buffer_append_space(Buffer *buffer, u_int len) 70buffer_append_space(Buffer *buffer, u_int len)
71{ 71{
72 u_int newlen;
72 void *p; 73 void *p;
73 74
74 if (len > 0x100000) 75 if (len > 0x100000)
@@ -98,11 +99,13 @@ restart:
98 goto restart; 99 goto restart;
99 } 100 }
100 /* Increase the size of the buffer and retry. */ 101 /* Increase the size of the buffer and retry. */
101 buffer->alloc += len + 32768; 102
102 if (buffer->alloc > 0xa00000) 103 newlen = buffer->alloc + len + 32768;
104 if (newlen > 0xa00000)
103 fatal("buffer_append_space: alloc %u not supported", 105 fatal("buffer_append_space: alloc %u not supported",
104 buffer->alloc); 106 newlen);
105 buffer->buf = xrealloc(buffer->buf, buffer->alloc); 107 buffer->buf = xrealloc(buffer->buf, newlen);
108 buffer->alloc = newlen;
106 goto restart; 109 goto restart;
107 /* NOTREACHED */ 110 /* NOTREACHED */
108} 111}
diff --git a/canohost.c b/canohost.c
index 941db23b6..438175f76 100644
--- a/canohost.c
+++ b/canohost.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: canohost.c,v 1.35 2002/11/26 02:38:54 stevesk Exp $"); 15RCSID("$OpenBSD: canohost.c,v 1.37 2003/06/02 09:17:34 markus Exp $");
16 16
17#include "packet.h" 17#include "packet.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -27,7 +27,7 @@ static void check_ip_options(int, char *);
27 */ 27 */
28 28
29static char * 29static char *
30get_remote_hostname(int socket, int verify_reverse_mapping) 30get_remote_hostname(int socket, int use_dns)
31{ 31{
32 struct sockaddr_storage from; 32 struct sockaddr_storage from;
33 int i; 33 int i;
@@ -72,6 +72,9 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
72 NULL, 0, NI_NUMERICHOST) != 0) 72 NULL, 0, NI_NUMERICHOST) != 0)
73 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed"); 73 fatal("get_remote_hostname: getnameinfo NI_NUMERICHOST failed");
74 74
75 if (!use_dns)
76 return xstrdup(ntop);
77
75 if (from.ss_family == AF_INET) 78 if (from.ss_family == AF_INET)
76 check_ip_options(socket, ntop); 79 check_ip_options(socket, ntop);
77 80
@@ -80,14 +83,24 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
80 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name), 83 if (getnameinfo((struct sockaddr *)&from, fromlen, name, sizeof(name),
81 NULL, 0, NI_NAMEREQD) != 0) { 84 NULL, 0, NI_NAMEREQD) != 0) {
82 /* Host name not found. Use ip address. */ 85 /* Host name not found. Use ip address. */
83#if 0
84 log("Could not reverse map address %.100s.", ntop);
85#endif
86 return xstrdup(ntop); 86 return xstrdup(ntop);
87 } 87 }
88 88
89 /* Got host name. */ 89 /*
90 name[sizeof(name) - 1] = '\0'; 90 * if reverse lookup result looks like a numeric hostname,
91 * someone is trying to trick us by PTR record like following:
92 * 1.1.1.10.in-addr.arpa. IN PTR 2.3.4.5
93 */
94 memset(&hints, 0, sizeof(hints));
95 hints.ai_socktype = SOCK_DGRAM; /*dummy*/
96 hints.ai_flags = AI_NUMERICHOST;
97 if (getaddrinfo(name, "0", &hints, &ai) == 0) {
98 logit("Nasty PTR record \"%s\" is set up for %s, ignoring",
99 name, ntop);
100 freeaddrinfo(ai);
101 return xstrdup(ntop);
102 }
103
91 /* 104 /*
92 * Convert it to all lowercase (which is expected by the rest 105 * Convert it to all lowercase (which is expected by the rest
93 * of this software). 106 * of this software).
@@ -95,9 +108,6 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
95 for (i = 0; name[i]; i++) 108 for (i = 0; name[i]; i++)
96 if (isupper(name[i])) 109 if (isupper(name[i]))
97 name[i] = tolower(name[i]); 110 name[i] = tolower(name[i]);
98
99 if (!verify_reverse_mapping)
100 return xstrdup(name);
101 /* 111 /*
102 * Map it back to an IP address and check that the given 112 * Map it back to an IP address and check that the given
103 * address actually is an address of this host. This is 113 * address actually is an address of this host. This is
@@ -111,7 +121,7 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
111 hints.ai_family = from.ss_family; 121 hints.ai_family = from.ss_family;
112 hints.ai_socktype = SOCK_STREAM; 122 hints.ai_socktype = SOCK_STREAM;
113 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) { 123 if (getaddrinfo(name, NULL, &hints, &aitop) != 0) {
114 log("reverse mapping checking getaddrinfo for %.700s " 124 logit("reverse mapping checking getaddrinfo for %.700s "
115 "failed - POSSIBLE BREAKIN ATTEMPT!", name); 125 "failed - POSSIBLE BREAKIN ATTEMPT!", name);
116 return xstrdup(ntop); 126 return xstrdup(ntop);
117 } 127 }
@@ -126,7 +136,7 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
126 /* If we reached the end of the list, the address was not there. */ 136 /* If we reached the end of the list, the address was not there. */
127 if (!ai) { 137 if (!ai) {
128 /* Address not found for the host name. */ 138 /* Address not found for the host name. */
129 log("Address %.100s maps to %.600s, but this does not " 139 logit("Address %.100s maps to %.600s, but this does not "
130 "map back to the address - POSSIBLE BREAKIN ATTEMPT!", 140 "map back to the address - POSSIBLE BREAKIN ATTEMPT!",
131 ntop, name); 141 ntop, name);
132 return xstrdup(ntop); 142 return xstrdup(ntop);
@@ -149,6 +159,7 @@ get_remote_hostname(int socket, int verify_reverse_mapping)
149static void 159static void
150check_ip_options(int socket, char *ipaddr) 160check_ip_options(int socket, char *ipaddr)
151{ 161{
162#ifdef IP_OPTIONS
152 u_char options[200]; 163 u_char options[200];
153 char text[sizeof(options) * 3 + 1]; 164 char text[sizeof(options) * 3 + 1];
154 socklen_t option_size; 165 socklen_t option_size;
@@ -166,11 +177,12 @@ check_ip_options(int socket, char *ipaddr)
166 for (i = 0; i < option_size; i++) 177 for (i = 0; i < option_size; i++)
167 snprintf(text + i*3, sizeof(text) - i*3, 178 snprintf(text + i*3, sizeof(text) - i*3,
168 " %2.2x", options[i]); 179 " %2.2x", options[i]);
169 log("Connection from %.100s with IP options:%.800s", 180 logit("Connection from %.100s with IP options:%.800s",
170 ipaddr, text); 181 ipaddr, text);
171 packet_disconnect("Connection from %.100s with IP options:%.800s", 182 packet_disconnect("Connection from %.100s with IP options:%.800s",
172 ipaddr, text); 183 ipaddr, text);
173 } 184 }
185#endif /* IP_OPTIONS */
174} 186}
175 187
176/* 188/*
@@ -180,14 +192,14 @@ check_ip_options(int socket, char *ipaddr)
180 */ 192 */
181 193
182const char * 194const char *
183get_canonical_hostname(int verify_reverse_mapping) 195get_canonical_hostname(int use_dns)
184{ 196{
185 static char *canonical_host_name = NULL; 197 static char *canonical_host_name = NULL;
186 static int verify_reverse_mapping_done = 0; 198 static int use_dns_done = 0;
187 199
188 /* Check if we have previously retrieved name with same option. */ 200 /* Check if we have previously retrieved name with same option. */
189 if (canonical_host_name != NULL) { 201 if (canonical_host_name != NULL) {
190 if (verify_reverse_mapping_done != verify_reverse_mapping) 202 if (use_dns_done != use_dns)
191 xfree(canonical_host_name); 203 xfree(canonical_host_name);
192 else 204 else
193 return canonical_host_name; 205 return canonical_host_name;
@@ -196,11 +208,11 @@ get_canonical_hostname(int verify_reverse_mapping)
196 /* Get the real hostname if socket; otherwise return UNKNOWN. */ 208 /* Get the real hostname if socket; otherwise return UNKNOWN. */
197 if (packet_connection_is_on_socket()) 209 if (packet_connection_is_on_socket())
198 canonical_host_name = get_remote_hostname( 210 canonical_host_name = get_remote_hostname(
199 packet_get_connection_in(), verify_reverse_mapping); 211 packet_get_connection_in(), use_dns);
200 else 212 else
201 canonical_host_name = xstrdup("UNKNOWN"); 213 canonical_host_name = xstrdup("UNKNOWN");
202 214
203 verify_reverse_mapping_done = verify_reverse_mapping; 215 use_dns_done = use_dns;
204 return canonical_host_name; 216 return canonical_host_name;
205} 217}
206 218
@@ -294,11 +306,11 @@ get_remote_ipaddr(void)
294} 306}
295 307
296const char * 308const char *
297get_remote_name_or_ip(u_int utmp_len, int verify_reverse_mapping) 309get_remote_name_or_ip(u_int utmp_len, int use_dns)
298{ 310{
299 static const char *remote = ""; 311 static const char *remote = "";
300 if (utmp_len > 0) 312 if (utmp_len > 0)
301 remote = get_canonical_hostname(verify_reverse_mapping); 313 remote = get_canonical_hostname(use_dns);
302 if (utmp_len == 0 || strlen(remote) > utmp_len) 314 if (utmp_len == 0 || strlen(remote) > utmp_len)
303 remote = get_remote_ipaddr(); 315 remote = get_remote_ipaddr();
304 return remote; 316 return remote;
diff --git a/channels.c b/channels.c
index 1937b0244..65a6a7f00 100644
--- a/channels.c
+++ b/channels.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: channels.c,v 1.187 2003/03/05 22:33:43 markus Exp $"); 42RCSID("$OpenBSD: channels.c,v 1.194 2003/08/29 10:04:36 markus Exp $");
43 43
44#include "ssh.h" 44#include "ssh.h"
45#include "ssh1.h" 45#include "ssh1.h"
@@ -54,7 +54,7 @@ RCSID("$OpenBSD: channels.c,v 1.187 2003/03/05 22:33:43 markus Exp $");
54#include "key.h" 54#include "key.h"
55#include "authfd.h" 55#include "authfd.h"
56#include "pathnames.h" 56#include "pathnames.h"
57 57#include "bufaux.h"
58 58
59/* -- channel core */ 59/* -- channel core */
60 60
@@ -142,12 +142,12 @@ channel_lookup(int id)
142 Channel *c; 142 Channel *c;
143 143
144 if (id < 0 || id >= channels_alloc) { 144 if (id < 0 || id >= channels_alloc) {
145 log("channel_lookup: %d: bad id", id); 145 logit("channel_lookup: %d: bad id", id);
146 return NULL; 146 return NULL;
147 } 147 }
148 c = channels[id]; 148 c = channels[id];
149 if (c == NULL) { 149 if (c == NULL) {
150 log("channel_lookup: %d: bad id: channel free", id); 150 logit("channel_lookup: %d: bad id: channel free", id);
151 return NULL; 151 return NULL;
152 } 152 }
153 return c; 153 return c;
@@ -177,7 +177,7 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
177 177
178 /* XXX ugly hack: nonblock is only set by the server */ 178 /* XXX ugly hack: nonblock is only set by the server */
179 if (nonblock && isatty(c->rfd)) { 179 if (nonblock && isatty(c->rfd)) {
180 debug("channel %d: rfd %d isatty", c->self, c->rfd); 180 debug2("channel %d: rfd %d isatty", c->self, c->rfd);
181 c->isatty = 1; 181 c->isatty = 1;
182 if (!isatty(c->wfd)) { 182 if (!isatty(c->wfd)) {
183 error("channel %d: wfd %d is not a tty?", 183 error("channel %d: wfd %d is not a tty?",
@@ -256,7 +256,7 @@ channel_new(char *ctype, int type, int rfd, int wfd, int efd,
256 c->local_consumed = 0; 256 c->local_consumed = 0;
257 c->local_maxpacket = maxpack; 257 c->local_maxpacket = maxpack;
258 c->remote_id = -1; 258 c->remote_id = -1;
259 c->remote_name = remote_name; 259 c->remote_name = xstrdup(remote_name);
260 c->remote_window = 0; 260 c->remote_window = 0;
261 c->remote_maxpacket = 0; 261 c->remote_maxpacket = 0;
262 c->force_drain = 0; 262 c->force_drain = 0;
@@ -304,7 +304,7 @@ channel_close_fd(int *fdp)
304static void 304static void
305channel_close_fds(Channel *c) 305channel_close_fds(Channel *c)
306{ 306{
307 debug3("channel_close_fds: channel %d: r %d w %d e %d", 307 debug3("channel %d: close_fds r %d w %d e %d",
308 c->self, c->rfd, c->wfd, c->efd); 308 c->self, c->rfd, c->wfd, c->efd);
309 309
310 channel_close_fd(&c->sock); 310 channel_close_fd(&c->sock);
@@ -324,11 +324,11 @@ channel_free(Channel *c)
324 for (n = 0, i = 0; i < channels_alloc; i++) 324 for (n = 0, i = 0; i < channels_alloc; i++)
325 if (channels[i]) 325 if (channels[i])
326 n++; 326 n++;
327 debug("channel_free: channel %d: %s, nchannels %d", c->self, 327 debug("channel %d: free: %s, nchannels %d", c->self,
328 c->remote_name ? c->remote_name : "???", n); 328 c->remote_name ? c->remote_name : "???", n);
329 329
330 s = channel_open_message(); 330 s = channel_open_message();
331 debug3("channel_free: status: %s", s); 331 debug3("channel %d: status: %s", c->self, s);
332 xfree(s); 332 xfree(s);
333 333
334 if (c->sock != -1) 334 if (c->sock != -1)
@@ -419,7 +419,7 @@ channel_not_very_much_buffered_data(void)
419 } 419 }
420#endif 420#endif
421 if (buffer_len(&c->output) > packet_get_maxsize()) { 421 if (buffer_len(&c->output) > packet_get_maxsize()) {
422 debug2("channel %d: big output buffer %d > %d", 422 debug2("channel %d: big output buffer %u > %u",
423 c->self, buffer_len(&c->output), 423 c->self, buffer_len(&c->output),
424 packet_get_maxsize()); 424 packet_get_maxsize());
425 return 0; 425 return 0;
@@ -575,7 +575,7 @@ channel_send_open(int id)
575 Channel *c = channel_lookup(id); 575 Channel *c = channel_lookup(id);
576 576
577 if (c == NULL) { 577 if (c == NULL) {
578 log("channel_send_open: %d: bad id", id); 578 logit("channel_send_open: %d: bad id", id);
579 return; 579 return;
580 } 580 }
581 debug2("channel %d: send open", id); 581 debug2("channel %d: send open", id);
@@ -593,10 +593,10 @@ channel_request_start(int id, char *service, int wantconfirm)
593 Channel *c = channel_lookup(id); 593 Channel *c = channel_lookup(id);
594 594
595 if (c == NULL) { 595 if (c == NULL) {
596 log("channel_request_start: %d: unknown channel id", id); 596 logit("channel_request_start: %d: unknown channel id", id);
597 return; 597 return;
598 } 598 }
599 debug("channel %d: request %s", id, service) ; 599 debug2("channel %d: request %s", id, service) ;
600 packet_start(SSH2_MSG_CHANNEL_REQUEST); 600 packet_start(SSH2_MSG_CHANNEL_REQUEST);
601 packet_put_int(c->remote_id); 601 packet_put_int(c->remote_id);
602 packet_put_cstring(service); 602 packet_put_cstring(service);
@@ -608,7 +608,7 @@ channel_register_confirm(int id, channel_callback_fn *fn)
608 Channel *c = channel_lookup(id); 608 Channel *c = channel_lookup(id);
609 609
610 if (c == NULL) { 610 if (c == NULL) {
611 log("channel_register_comfirm: %d: bad id", id); 611 logit("channel_register_comfirm: %d: bad id", id);
612 return; 612 return;
613 } 613 }
614 c->confirm = fn; 614 c->confirm = fn;
@@ -619,7 +619,7 @@ channel_register_cleanup(int id, channel_callback_fn *fn)
619 Channel *c = channel_lookup(id); 619 Channel *c = channel_lookup(id);
620 620
621 if (c == NULL) { 621 if (c == NULL) {
622 log("channel_register_cleanup: %d: bad id", id); 622 logit("channel_register_cleanup: %d: bad id", id);
623 return; 623 return;
624 } 624 }
625 c->detach_user = fn; 625 c->detach_user = fn;
@@ -630,7 +630,7 @@ channel_cancel_cleanup(int id)
630 Channel *c = channel_lookup(id); 630 Channel *c = channel_lookup(id);
631 631
632 if (c == NULL) { 632 if (c == NULL) {
633 log("channel_cancel_cleanup: %d: bad id", id); 633 logit("channel_cancel_cleanup: %d: bad id", id);
634 return; 634 return;
635 } 635 }
636 c->detach_user = NULL; 636 c->detach_user = NULL;
@@ -641,7 +641,7 @@ channel_register_filter(int id, channel_filter_fn *fn)
641 Channel *c = channel_lookup(id); 641 Channel *c = channel_lookup(id);
642 642
643 if (c == NULL) { 643 if (c == NULL) {
644 log("channel_register_filter: %d: bad id", id); 644 logit("channel_register_filter: %d: bad id", id);
645 return; 645 return;
646 } 646 }
647 c->input_filter = fn; 647 c->input_filter = fn;
@@ -739,7 +739,7 @@ channel_pre_input_draining(Channel *c, fd_set * readset, fd_set * writeset)
739 packet_put_int(c->remote_id); 739 packet_put_int(c->remote_id);
740 packet_send(); 740 packet_send();
741 c->type = SSH_CHANNEL_CLOSED; 741 c->type = SSH_CHANNEL_CLOSED;
742 debug("channel %d: closing after input drain.", c->self); 742 debug2("channel %d: closing after input drain.", c->self);
743 } 743 }
744} 744}
745 745
@@ -780,7 +780,7 @@ x11_open_helper(Buffer *b)
780 proto_len = ucp[6] + 256 * ucp[7]; 780 proto_len = ucp[6] + 256 * ucp[7];
781 data_len = ucp[8] + 256 * ucp[9]; 781 data_len = ucp[8] + 256 * ucp[9];
782 } else { 782 } else {
783 debug("Initial X11 packet contains bad byte order byte: 0x%x", 783 debug2("Initial X11 packet contains bad byte order byte: 0x%x",
784 ucp[0]); 784 ucp[0]);
785 return -1; 785 return -1;
786 } 786 }
@@ -793,14 +793,14 @@ x11_open_helper(Buffer *b)
793 /* Check if authentication protocol matches. */ 793 /* Check if authentication protocol matches. */
794 if (proto_len != strlen(x11_saved_proto) || 794 if (proto_len != strlen(x11_saved_proto) ||
795 memcmp(ucp + 12, x11_saved_proto, proto_len) != 0) { 795 memcmp(ucp + 12, x11_saved_proto, proto_len) != 0) {
796 debug("X11 connection uses different authentication protocol."); 796 debug2("X11 connection uses different authentication protocol.");
797 return -1; 797 return -1;
798 } 798 }
799 /* Check if authentication data matches our fake data. */ 799 /* Check if authentication data matches our fake data. */
800 if (data_len != x11_fake_data_len || 800 if (data_len != x11_fake_data_len ||
801 memcmp(ucp + 12 + ((proto_len + 3) & ~3), 801 memcmp(ucp + 12 + ((proto_len + 3) & ~3),
802 x11_fake_data, x11_fake_data_len) != 0) { 802 x11_fake_data, x11_fake_data_len) != 0) {
803 debug("X11 auth data does not match fake data."); 803 debug2("X11 auth data does not match fake data.");
804 return -1; 804 return -1;
805 } 805 }
806 /* Check fake data length */ 806 /* Check fake data length */
@@ -833,7 +833,7 @@ channel_pre_x11_open_13(Channel *c, fd_set * readset, fd_set * writeset)
833 * We have received an X11 connection that has bad 833 * We have received an X11 connection that has bad
834 * authentication information. 834 * authentication information.
835 */ 835 */
836 log("X11 connection rejected because of wrong authentication."); 836 logit("X11 connection rejected because of wrong authentication.");
837 buffer_clear(&c->input); 837 buffer_clear(&c->input);
838 buffer_clear(&c->output); 838 buffer_clear(&c->output);
839 channel_close_fd(&c->sock); 839 channel_close_fd(&c->sock);
@@ -856,8 +856,8 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
856 c->type = SSH_CHANNEL_OPEN; 856 c->type = SSH_CHANNEL_OPEN;
857 channel_pre_open(c, readset, writeset); 857 channel_pre_open(c, readset, writeset);
858 } else if (ret == -1) { 858 } else if (ret == -1) {
859 log("X11 connection rejected because of wrong authentication."); 859 logit("X11 connection rejected because of wrong authentication.");
860 debug("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate); 860 debug2("X11 rejected %d i%d/o%d", c->self, c->istate, c->ostate);
861 chan_read_failed(c); 861 chan_read_failed(c);
862 buffer_clear(&c->input); 862 buffer_clear(&c->input);
863 chan_ibuf_empty(c); 863 chan_ibuf_empty(c);
@@ -867,7 +867,7 @@ channel_pre_x11_open(Channel *c, fd_set * readset, fd_set * writeset)
867 chan_write_failed(c); 867 chan_write_failed(c);
868 else 868 else
869 c->type = SSH_CHANNEL_OPEN; 869 c->type = SSH_CHANNEL_OPEN;
870 debug("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate); 870 debug2("X11 closed %d i%d/o%d", c->self, c->istate, c->ostate);
871 } 871 }
872} 872}
873 873
@@ -925,7 +925,7 @@ channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
925 strlcpy(c->path, host, sizeof(c->path)); 925 strlcpy(c->path, host, sizeof(c->path));
926 c->host_port = ntohs(s4_req.dest_port); 926 c->host_port = ntohs(s4_req.dest_port);
927 927
928 debug("channel %d: dynamic request: socks4 host %s port %u command %u", 928 debug2("channel %d: dynamic request: socks4 host %s port %u command %u",
929 c->self, host, c->host_port, s4_req.command); 929 c->self, host, c->host_port, s4_req.command);
930 930
931 if (s4_req.command != 1) { 931 if (s4_req.command != 1) {
@@ -941,6 +941,117 @@ channel_decode_socks4(Channel *c, fd_set * readset, fd_set * writeset)
941 return 1; 941 return 1;
942} 942}
943 943
944/* try to decode a socks5 header */
945#define SSH_SOCKS5_AUTHDONE 0x1000
946#define SSH_SOCKS5_NOAUTH 0x00
947#define SSH_SOCKS5_IPV4 0x01
948#define SSH_SOCKS5_DOMAIN 0x03
949#define SSH_SOCKS5_IPV6 0x04
950#define SSH_SOCKS5_CONNECT 0x01
951#define SSH_SOCKS5_SUCCESS 0x00
952
953static int
954channel_decode_socks5(Channel *c, fd_set * readset, fd_set * writeset)
955{
956 struct {
957 u_int8_t version;
958 u_int8_t command;
959 u_int8_t reserved;
960 u_int8_t atyp;
961 } s5_req, s5_rsp;
962 u_int16_t dest_port;
963 u_char *p, dest_addr[255+1];
964 int i, have, found, nmethods, addrlen, af;
965
966 debug2("channel %d: decode socks5", c->self);
967 p = buffer_ptr(&c->input);
968 if (p[0] != 0x05)
969 return -1;
970 have = buffer_len(&c->input);
971 if (!(c->flags & SSH_SOCKS5_AUTHDONE)) {
972 /* format: ver | nmethods | methods */
973 if (have < 2)
974 return 0;
975 nmethods = p[1];
976 if (have < nmethods + 2)
977 return 0;
978 /* look for method: "NO AUTHENTICATION REQUIRED" */
979 for (found = 0, i = 2 ; i < nmethods + 2; i++) {
980 if (p[i] == SSH_SOCKS5_NOAUTH ) {
981 found = 1;
982 break;
983 }
984 }
985 if (!found) {
986 debug("channel %d: method SSH_SOCKS5_NOAUTH not found",
987 c->self);
988 return -1;
989 }
990 buffer_consume(&c->input, nmethods + 2);
991 buffer_put_char(&c->output, 0x05); /* version */
992 buffer_put_char(&c->output, SSH_SOCKS5_NOAUTH); /* method */
993 FD_SET(c->sock, writeset);
994 c->flags |= SSH_SOCKS5_AUTHDONE;
995 debug2("channel %d: socks5 auth done", c->self);
996 return 0; /* need more */
997 }
998 debug2("channel %d: socks5 post auth", c->self);
999 if (have < sizeof(s5_req)+1)
1000 return 0; /* need more */
1001 memcpy((char *)&s5_req, p, sizeof(s5_req));
1002 if (s5_req.version != 0x05 ||
1003 s5_req.command != SSH_SOCKS5_CONNECT ||
1004 s5_req.reserved != 0x00) {
1005 debug2("channel %d: only socks5 connect supported", c->self);
1006 return -1;
1007 }
1008 switch(s5_req.atyp){
1009 case SSH_SOCKS5_IPV4:
1010 addrlen = 4;
1011 af = AF_INET;
1012 break;
1013 case SSH_SOCKS5_DOMAIN:
1014 addrlen = p[sizeof(s5_req)];
1015 af = -1;
1016 break;
1017 case SSH_SOCKS5_IPV6:
1018 addrlen = 16;
1019 af = AF_INET6;
1020 break;
1021 default:
1022 debug2("channel %d: bad socks5 atyp %d", c->self, s5_req.atyp);
1023 return -1;
1024 }
1025 if (have < 4 + addrlen + 2)
1026 return 0;
1027 buffer_consume(&c->input, sizeof(s5_req));
1028 if (s5_req.atyp == SSH_SOCKS5_DOMAIN)
1029 buffer_consume(&c->input, 1); /* host string length */
1030 buffer_get(&c->input, (char *)&dest_addr, addrlen);
1031 buffer_get(&c->input, (char *)&dest_port, 2);
1032 dest_addr[addrlen] = '\0';
1033 if (s5_req.atyp == SSH_SOCKS5_DOMAIN)
1034 strlcpy(c->path, dest_addr, sizeof(c->path));
1035 else if (inet_ntop(af, dest_addr, c->path, sizeof(c->path)) == NULL)
1036 return -1;
1037 c->host_port = ntohs(dest_port);
1038
1039 debug2("channel %d: dynamic request: socks5 host %s port %u command %u",
1040 c->self, c->path, c->host_port, s5_req.command);
1041
1042 s5_rsp.version = 0x05;
1043 s5_rsp.command = SSH_SOCKS5_SUCCESS;
1044 s5_rsp.reserved = 0; /* ignored */
1045 s5_rsp.atyp = SSH_SOCKS5_IPV4;
1046 ((struct in_addr *)&dest_addr)->s_addr = INADDR_ANY;
1047 dest_port = 0; /* ignored */
1048
1049 buffer_append(&c->output, (char *)&s5_rsp, sizeof(s5_rsp));
1050 buffer_append(&c->output, (char *)&dest_addr, sizeof(struct in_addr));
1051 buffer_append(&c->output, (char *)&dest_port, sizeof(dest_port));
1052 return 1;
1053}
1054
944/* dynamic port forwarding */ 1055/* dynamic port forwarding */
945static void 1056static void
946channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset) 1057channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)
@@ -953,7 +1064,7 @@ channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)
953 debug2("channel %d: pre_dynamic: have %d", c->self, have); 1064 debug2("channel %d: pre_dynamic: have %d", c->self, have);
954 /* buffer_dump(&c->input); */ 1065 /* buffer_dump(&c->input); */
955 /* check if the fixed size part of the packet is in buffer. */ 1066 /* check if the fixed size part of the packet is in buffer. */
956 if (have < 4) { 1067 if (have < 3) {
957 /* need more */ 1068 /* need more */
958 FD_SET(c->sock, readset); 1069 FD_SET(c->sock, readset);
959 return; 1070 return;
@@ -964,6 +1075,9 @@ channel_pre_dynamic(Channel *c, fd_set * readset, fd_set * writeset)
964 case 0x04: 1075 case 0x04:
965 ret = channel_decode_socks4(c, readset, writeset); 1076 ret = channel_decode_socks4(c, readset, writeset);
966 break; 1077 break;
1078 case 0x05:
1079 ret = channel_decode_socks5(c, readset, writeset);
1080 break;
967 default: 1081 default:
968 ret = -1; 1082 ret = -1;
969 break; 1083 break;
@@ -997,7 +1111,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
997 addrlen = sizeof(addr); 1111 addrlen = sizeof(addr);
998 newsock = accept(c->sock, &addr, &addrlen); 1112 newsock = accept(c->sock, &addr, &addrlen);
999 if (c->single_connection) { 1113 if (c->single_connection) {
1000 debug("single_connection: closing X11 listener."); 1114 debug2("single_connection: closing X11 listener.");
1001 channel_close_fd(&c->sock); 1115 channel_close_fd(&c->sock);
1002 chan_mark_dead(c); 1116 chan_mark_dead(c);
1003 } 1117 }
@@ -1013,8 +1127,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
1013 1127
1014 nc = channel_new("accepted x11 socket", 1128 nc = channel_new("accepted x11 socket",
1015 SSH_CHANNEL_OPENING, newsock, newsock, -1, 1129 SSH_CHANNEL_OPENING, newsock, newsock, -1,
1016 c->local_window_max, c->local_maxpacket, 1130 c->local_window_max, c->local_maxpacket, 0, buf, 1);
1017 0, xstrdup(buf), 1);
1018 if (compat20) { 1131 if (compat20) {
1019 packet_start(SSH2_MSG_CHANNEL_OPEN); 1132 packet_start(SSH2_MSG_CHANNEL_OPEN);
1020 packet_put_cstring("x11"); 1133 packet_put_cstring("x11");
@@ -1024,7 +1137,7 @@ channel_post_x11_listener(Channel *c, fd_set * readset, fd_set * writeset)
1024 /* originator ipaddr and port */ 1137 /* originator ipaddr and port */
1025 packet_put_cstring(remote_ipaddr); 1138 packet_put_cstring(remote_ipaddr);
1026 if (datafellows & SSH_BUG_X11FWD) { 1139 if (datafellows & SSH_BUG_X11FWD) {
1027 debug("ssh2 x11 bug compat mode"); 1140 debug2("ssh2 x11 bug compat mode");
1028 } else { 1141 } else {
1029 packet_put_int(remote_port); 1142 packet_put_int(remote_port);
1030 } 1143 }
@@ -1129,10 +1242,8 @@ channel_post_port_listener(Channel *c, fd_set * readset, fd_set * writeset)
1129 return; 1242 return;
1130 } 1243 }
1131 set_nodelay(newsock); 1244 set_nodelay(newsock);
1132 nc = channel_new(rtype, 1245 nc = channel_new(rtype, nextstate, newsock, newsock, -1,
1133 nextstate, newsock, newsock, -1, 1246 c->local_window_max, c->local_maxpacket, 0, rtype, 1);
1134 c->local_window_max, c->local_maxpacket,
1135 0, xstrdup(rtype), 1);
1136 nc->listening_port = c->listening_port; 1247 nc->listening_port = c->listening_port;
1137 nc->host_port = c->host_port; 1248 nc->host_port = c->host_port;
1138 strlcpy(nc->path, c->path, sizeof(nc->path)); 1249 strlcpy(nc->path, c->path, sizeof(nc->path));
@@ -1158,7 +1269,6 @@ static void
1158channel_post_auth_listener(Channel *c, fd_set * readset, fd_set * writeset) 1269channel_post_auth_listener(Channel *c, fd_set * readset, fd_set * writeset)
1159{ 1270{
1160 Channel *nc; 1271 Channel *nc;
1161 char *name;
1162 int newsock; 1272 int newsock;
1163 struct sockaddr addr; 1273 struct sockaddr addr;
1164 socklen_t addrlen; 1274 socklen_t addrlen;
@@ -1170,11 +1280,10 @@ channel_post_auth_listener(Channel *c, fd_set * readset, fd_set * writeset)
1170 error("accept from auth socket: %.100s", strerror(errno)); 1280 error("accept from auth socket: %.100s", strerror(errno));
1171 return; 1281 return;
1172 } 1282 }
1173 name = xstrdup("accepted auth socket");
1174 nc = channel_new("accepted auth socket", 1283 nc = channel_new("accepted auth socket",
1175 SSH_CHANNEL_OPENING, newsock, newsock, -1, 1284 SSH_CHANNEL_OPENING, newsock, newsock, -1,
1176 c->local_window_max, c->local_maxpacket, 1285 c->local_window_max, c->local_maxpacket,
1177 0, name, 1); 1286 0, "accepted auth socket", 1);
1178 if (compat20) { 1287 if (compat20) {
1179 packet_start(SSH2_MSG_CHANNEL_OPEN); 1288 packet_start(SSH2_MSG_CHANNEL_OPEN);
1180 packet_put_cstring("auth-agent@openssh.com"); 1289 packet_put_cstring("auth-agent@openssh.com");
@@ -1247,16 +1356,16 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
1247 if (len < 0 && (errno == EINTR || errno == EAGAIN)) 1356 if (len < 0 && (errno == EINTR || errno == EAGAIN))
1248 return 1; 1357 return 1;
1249 if (len <= 0) { 1358 if (len <= 0) {
1250 debug("channel %d: read<=0 rfd %d len %d", 1359 debug2("channel %d: read<=0 rfd %d len %d",
1251 c->self, c->rfd, len); 1360 c->self, c->rfd, len);
1252 if (c->type != SSH_CHANNEL_OPEN) { 1361 if (c->type != SSH_CHANNEL_OPEN) {
1253 debug("channel %d: not open", c->self); 1362 debug2("channel %d: not open", c->self);
1254 chan_mark_dead(c); 1363 chan_mark_dead(c);
1255 return -1; 1364 return -1;
1256 } else if (compat13) { 1365 } else if (compat13) {
1257 buffer_clear(&c->output); 1366 buffer_clear(&c->output);
1258 c->type = SSH_CHANNEL_INPUT_DRAINING; 1367 c->type = SSH_CHANNEL_INPUT_DRAINING;
1259 debug("channel %d: input draining.", c->self); 1368 debug2("channel %d: input draining.", c->self);
1260 } else { 1369 } else {
1261 chan_read_failed(c); 1370 chan_read_failed(c);
1262 } 1371 }
@@ -1264,7 +1373,7 @@ channel_handle_rfd(Channel *c, fd_set * readset, fd_set * writeset)
1264 } 1373 }
1265 if (c->input_filter != NULL) { 1374 if (c->input_filter != NULL) {
1266 if (c->input_filter(c, buf, len) == -1) { 1375 if (c->input_filter(c, buf, len) == -1) {
1267 debug("channel %d: filter stops", c->self); 1376 debug2("channel %d: filter stops", c->self);
1268 chan_read_failed(c); 1377 chan_read_failed(c);
1269 } 1378 }
1270 } else { 1379 } else {
@@ -1297,12 +1406,12 @@ channel_handle_wfd(Channel *c, fd_set * readset, fd_set * writeset)
1297 return 1; 1406 return 1;
1298 if (len <= 0) { 1407 if (len <= 0) {
1299 if (c->type != SSH_CHANNEL_OPEN) { 1408 if (c->type != SSH_CHANNEL_OPEN) {
1300 debug("channel %d: not open", c->self); 1409 debug2("channel %d: not open", c->self);
1301 chan_mark_dead(c); 1410 chan_mark_dead(c);
1302 return -1; 1411 return -1;
1303 } else if (compat13) { 1412 } else if (compat13) {
1304 buffer_clear(&c->output); 1413 buffer_clear(&c->output);
1305 debug("channel %d: input draining.", c->self); 1414 debug2("channel %d: input draining.", c->self);
1306 c->type = SSH_CHANNEL_INPUT_DRAINING; 1415 c->type = SSH_CHANNEL_INPUT_DRAINING;
1307 } else { 1416 } else {
1308 chan_write_failed(c); 1417 chan_write_failed(c);
@@ -1509,16 +1618,16 @@ channel_garbage_collect(Channel *c)
1509 if (c->detach_user != NULL) { 1618 if (c->detach_user != NULL) {
1510 if (!chan_is_dead(c, 0)) 1619 if (!chan_is_dead(c, 0))
1511 return; 1620 return;
1512 debug("channel %d: gc: notify user", c->self); 1621 debug2("channel %d: gc: notify user", c->self);
1513 c->detach_user(c->self, NULL); 1622 c->detach_user(c->self, NULL);
1514 /* if we still have a callback */ 1623 /* if we still have a callback */
1515 if (c->detach_user != NULL) 1624 if (c->detach_user != NULL)
1516 return; 1625 return;
1517 debug("channel %d: gc: user detached", c->self); 1626 debug2("channel %d: gc: user detached", c->self);
1518 } 1627 }
1519 if (!chan_is_dead(c, 1)) 1628 if (!chan_is_dead(c, 1))
1520 return; 1629 return;
1521 debug("channel %d: garbage collecting", c->self); 1630 debug2("channel %d: garbage collecting", c->self);
1522 channel_free(c); 1631 channel_free(c);
1523} 1632}
1524 1633
@@ -1717,11 +1826,11 @@ channel_input_data(int type, u_int32_t seq, void *ctxt)
1717 1826
1718 if (compat20) { 1827 if (compat20) {
1719 if (data_len > c->local_maxpacket) { 1828 if (data_len > c->local_maxpacket) {
1720 log("channel %d: rcvd big packet %d, maxpack %d", 1829 logit("channel %d: rcvd big packet %d, maxpack %d",
1721 c->self, data_len, c->local_maxpacket); 1830 c->self, data_len, c->local_maxpacket);
1722 } 1831 }
1723 if (data_len > c->local_window) { 1832 if (data_len > c->local_window) {
1724 log("channel %d: rcvd too much data %d, win %d", 1833 logit("channel %d: rcvd too much data %d, win %d",
1725 c->self, data_len, c->local_window); 1834 c->self, data_len, c->local_window);
1726 xfree(data); 1835 xfree(data);
1727 return; 1836 return;
@@ -1748,7 +1857,7 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
1748 if (c == NULL) 1857 if (c == NULL)
1749 packet_disconnect("Received extended_data for bad channel %d.", id); 1858 packet_disconnect("Received extended_data for bad channel %d.", id);
1750 if (c->type != SSH_CHANNEL_OPEN) { 1859 if (c->type != SSH_CHANNEL_OPEN) {
1751 log("channel %d: ext data for non open", id); 1860 logit("channel %d: ext data for non open", id);
1752 return; 1861 return;
1753 } 1862 }
1754 if (c->flags & CHAN_EOF_RCVD) { 1863 if (c->flags & CHAN_EOF_RCVD) {
@@ -1762,13 +1871,13 @@ channel_input_extended_data(int type, u_int32_t seq, void *ctxt)
1762 if (c->efd == -1 || 1871 if (c->efd == -1 ||
1763 c->extended_usage != CHAN_EXTENDED_WRITE || 1872 c->extended_usage != CHAN_EXTENDED_WRITE ||
1764 tcode != SSH2_EXTENDED_DATA_STDERR) { 1873 tcode != SSH2_EXTENDED_DATA_STDERR) {
1765 log("channel %d: bad ext data", c->self); 1874 logit("channel %d: bad ext data", c->self);
1766 return; 1875 return;
1767 } 1876 }
1768 data = packet_get_string(&data_len); 1877 data = packet_get_string(&data_len);
1769 packet_check_eom(); 1878 packet_check_eom();
1770 if (data_len > c->local_window) { 1879 if (data_len > c->local_window) {
1771 log("channel %d: rcvd too much extended_data %d, win %d", 1880 logit("channel %d: rcvd too much extended_data %d, win %d",
1772 c->self, data_len, c->local_window); 1881 c->self, data_len, c->local_window);
1773 xfree(data); 1882 xfree(data);
1774 return; 1883 return;
@@ -1893,7 +2002,7 @@ channel_input_open_confirmation(int type, u_int32_t seq, void *ctxt)
1893 c->confirm(c->self, NULL); 2002 c->confirm(c->self, NULL);
1894 debug2("callback done"); 2003 debug2("callback done");
1895 } 2004 }
1896 debug("channel %d: open confirm rwindow %u rmax %u", c->self, 2005 debug2("channel %d: open confirm rwindow %u rmax %u", c->self,
1897 c->remote_window, c->remote_maxpacket); 2006 c->remote_window, c->remote_maxpacket);
1898 } 2007 }
1899 packet_check_eom(); 2008 packet_check_eom();
@@ -1934,7 +2043,7 @@ channel_input_open_failure(int type, u_int32_t seq, void *ctxt)
1934 msg = packet_get_string(NULL); 2043 msg = packet_get_string(NULL);
1935 lang = packet_get_string(NULL); 2044 lang = packet_get_string(NULL);
1936 } 2045 }
1937 log("channel %d: open failed: %s%s%s", id, 2046 logit("channel %d: open failed: %s%s%s", id,
1938 reason2txt(reason), msg ? ": ": "", msg ? msg : ""); 2047 reason2txt(reason), msg ? ": ": "", msg ? msg : "");
1939 if (msg != NULL) 2048 if (msg != NULL)
1940 xfree(msg); 2049 xfree(msg);
@@ -1961,7 +2070,7 @@ channel_input_window_adjust(int type, u_int32_t seq, void *ctxt)
1961 c = channel_lookup(id); 2070 c = channel_lookup(id);
1962 2071
1963 if (c == NULL || c->type != SSH_CHANNEL_OPEN) { 2072 if (c == NULL || c->type != SSH_CHANNEL_OPEN) {
1964 log("Received window adjust for " 2073 logit("Received window adjust for "
1965 "non-open channel %d.", id); 2074 "non-open channel %d.", id);
1966 return; 2075 return;
1967 } 2076 }
@@ -1996,8 +2105,8 @@ channel_input_port_open(int type, u_int32_t seq, void *ctxt)
1996 originator_string, 1); 2105 originator_string, 1);
1997 c->remote_id = remote_id; 2106 c->remote_id = remote_id;
1998 } 2107 }
2108 xfree(originator_string);
1999 if (c == NULL) { 2109 if (c == NULL) {
2000 xfree(originator_string);
2001 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE); 2110 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
2002 packet_put_int(remote_id); 2111 packet_put_int(remote_id);
2003 packet_send(); 2112 packet_send();
@@ -2058,7 +2167,7 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
2058 continue; 2167 continue;
2059 } 2168 }
2060 /* Create a port to listen for the host. */ 2169 /* Create a port to listen for the host. */
2061 sock = socket(ai->ai_family, SOCK_STREAM, 0); 2170 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
2062 if (sock < 0) { 2171 if (sock < 0) {
2063 /* this is no error since kernel may not support ipv6 */ 2172 /* this is no error since kernel may not support ipv6 */
2064 verbose("socket: %.100s", strerror(errno)); 2173 verbose("socket: %.100s", strerror(errno));
@@ -2094,7 +2203,7 @@ channel_setup_fwd_listener(int type, const char *listen_addr, u_short listen_por
2094 /* Allocate a channel number for the socket. */ 2203 /* Allocate a channel number for the socket. */
2095 c = channel_new("port listener", type, sock, sock, -1, 2204 c = channel_new("port listener", type, sock, sock, -1,
2096 CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT, 2205 CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_PACKET_DEFAULT,
2097 0, xstrdup("port listener"), 1); 2206 0, "port listener", 1);
2098 strlcpy(c->path, host, sizeof(c->path)); 2207 strlcpy(c->path, host, sizeof(c->path));
2099 c->host_port = port_to_connect; 2208 c->host_port = port_to_connect;
2100 c->listening_port = listen_port; 2209 c->listening_port = listen_port;
@@ -2167,7 +2276,7 @@ channel_request_remote_forwarding(u_short listen_port,
2167 success = 1; 2276 success = 1;
2168 break; 2277 break;
2169 case SSH_SMSG_FAILURE: 2278 case SSH_SMSG_FAILURE:
2170 log("Warning: Server denied remote port forwarding."); 2279 logit("Warning: Server denied remote port forwarding.");
2171 break; 2280 break;
2172 default: 2281 default:
2173 /* Unknown packet */ 2282 /* Unknown packet */
@@ -2206,9 +2315,13 @@ channel_input_port_forward_request(int is_root, int gateway_ports)
2206 * privileged port. 2315 * privileged port.
2207 */ 2316 */
2208 if (port < IPPORT_RESERVED && !is_root) 2317 if (port < IPPORT_RESERVED && !is_root)
2209 packet_disconnect("Requested forwarding of port %d but user is not root.", 2318 packet_disconnect(
2210 port); 2319 "Requested forwarding of port %d but user is not root.",
2320 port);
2321 if (host_port == 0)
2322 packet_disconnect("Dynamic forwarding denied.");
2211#endif 2323#endif
2324
2212 /* Initiate forwarding */ 2325 /* Initiate forwarding */
2213 channel_setup_local_fwd_listener(port, hostname, host_port, gateway_ports); 2326 channel_setup_local_fwd_listener(port, hostname, host_port, gateway_ports);
2214 2327
@@ -2280,7 +2393,7 @@ connect_to(const char *host, u_short port)
2280 error("connect_to: getnameinfo failed"); 2393 error("connect_to: getnameinfo failed");
2281 continue; 2394 continue;
2282 } 2395 }
2283 sock = socket(ai->ai_family, SOCK_STREAM, 0); 2396 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
2284 if (sock < 0) { 2397 if (sock < 0) {
2285 if (ai->ai_next == NULL) 2398 if (ai->ai_next == NULL)
2286 error("socket: %.100s", strerror(errno)); 2399 error("socket: %.100s", strerror(errno));
@@ -2340,7 +2453,7 @@ channel_connect_to(const char *host, u_short port)
2340 2453
2341 } 2454 }
2342 if (!permit) { 2455 if (!permit) {
2343 log("Received request to connect to host %.100s port %d, " 2456 logit("Received request to connect to host %.100s port %d, "
2344 "but the request was denied.", host, port); 2457 "but the request was denied.", host, port);
2345 return -1; 2458 return -1;
2346 } 2459 }
@@ -2381,7 +2494,8 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
2381 for (ai = aitop; ai; ai = ai->ai_next) { 2494 for (ai = aitop; ai; ai = ai->ai_next) {
2382 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6) 2495 if (ai->ai_family != AF_INET && ai->ai_family != AF_INET6)
2383 continue; 2496 continue;
2384 sock = socket(ai->ai_family, SOCK_STREAM, 0); 2497 sock = socket(ai->ai_family, ai->ai_socktype,
2498 ai->ai_protocol);
2385 if (sock < 0) { 2499 if (sock < 0) {
2386 if ((errno != EINVAL) && (errno != EAFNOSUPPORT)) { 2500 if ((errno != EINVAL) && (errno != EAFNOSUPPORT)) {
2387 error("socket: %.100s", strerror(errno)); 2501 error("socket: %.100s", strerror(errno));
@@ -2400,7 +2514,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
2400 } 2514 }
2401#endif 2515#endif
2402 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { 2516 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
2403 debug("bind port %d: %.100s", port, strerror(errno)); 2517 debug2("bind port %d: %.100s", port, strerror(errno));
2404 close(sock); 2518 close(sock);
2405 2519
2406 if (ai->ai_next) 2520 if (ai->ai_next)
@@ -2449,7 +2563,7 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost,
2449 nc = channel_new("x11 listener", 2563 nc = channel_new("x11 listener",
2450 SSH_CHANNEL_X11_LISTENER, sock, sock, -1, 2564 SSH_CHANNEL_X11_LISTENER, sock, sock, -1,
2451 CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 2565 CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
2452 0, xstrdup("X11 inet listener"), 1); 2566 0, "X11 inet listener", 1);
2453 nc->single_connection = single_connection; 2567 nc->single_connection = single_connection;
2454 } 2568 }
2455 2569
@@ -2547,14 +2661,14 @@ x11_connect_display(void)
2547 } 2661 }
2548 for (ai = aitop; ai; ai = ai->ai_next) { 2662 for (ai = aitop; ai; ai = ai->ai_next) {
2549 /* Create a socket. */ 2663 /* Create a socket. */
2550 sock = socket(ai->ai_family, SOCK_STREAM, 0); 2664 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
2551 if (sock < 0) { 2665 if (sock < 0) {
2552 debug("socket: %.100s", strerror(errno)); 2666 debug2("socket: %.100s", strerror(errno));
2553 continue; 2667 continue;
2554 } 2668 }
2555 /* Connect it to the display. */ 2669 /* Connect it to the display. */
2556 if (connect(sock, ai->ai_addr, ai->ai_addrlen) < 0) { 2670 if (connect(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
2557 debug("connect %.100s port %d: %.100s", buf, 2671 debug2("connect %.100s port %d: %.100s", buf,
2558 6000 + display_number, strerror(errno)); 2672 6000 + display_number, strerror(errno));
2559 close(sock); 2673 close(sock);
2560 continue; 2674 continue;
@@ -2606,11 +2720,11 @@ x11_input_open(int type, u_int32_t seq, void *ctxt)
2606 c->remote_id = remote_id; 2720 c->remote_id = remote_id;
2607 c->force_drain = 1; 2721 c->force_drain = 1;
2608 } 2722 }
2723 xfree(remote_host);
2609 if (c == NULL) { 2724 if (c == NULL) {
2610 /* Send refusal to the remote host. */ 2725 /* Send refusal to the remote host. */
2611 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE); 2726 packet_start(SSH_MSG_CHANNEL_OPEN_FAILURE);
2612 packet_put_int(remote_id); 2727 packet_put_int(remote_id);
2613 xfree(remote_host);
2614 } else { 2728 } else {
2615 /* Send a confirmation to the remote host. */ 2729 /* Send a confirmation to the remote host. */
2616 packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION); 2730 packet_start(SSH_MSG_CHANNEL_OPEN_CONFIRMATION);
@@ -2732,7 +2846,6 @@ auth_input_open_request(int type, u_int32_t seq, void *ctxt)
2732{ 2846{
2733 Channel *c = NULL; 2847 Channel *c = NULL;
2734 int remote_id, sock; 2848 int remote_id, sock;
2735 char *name;
2736 2849
2737 /* Read the remote channel number from the message. */ 2850 /* Read the remote channel number from the message. */
2738 remote_id = packet_get_int(); 2851 remote_id = packet_get_int();
@@ -2751,9 +2864,8 @@ auth_input_open_request(int type, u_int32_t seq, void *ctxt)
2751 * agent. 2864 * agent.
2752 */ 2865 */
2753 if (sock >= 0) { 2866 if (sock >= 0) {
2754 name = xstrdup("authentication agent connection");
2755 c = channel_new("", SSH_CHANNEL_OPEN, sock, sock, 2867 c = channel_new("", SSH_CHANNEL_OPEN, sock, sock,
2756 -1, 0, 0, 0, name, 1); 2868 -1, 0, 0, 0, "authentication agent connection", 1);
2757 c->remote_id = remote_id; 2869 c->remote_id = remote_id;
2758 c->force_drain = 1; 2870 c->force_drain = 1;
2759 } 2871 }
diff --git a/cipher-3des1.c b/cipher-3des1.c
new file mode 100644
index 000000000..f9a352397
--- /dev/null
+++ b/cipher-3des1.c
@@ -0,0 +1,171 @@
1/*
2 * Copyright (c) 2003 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: cipher-3des1.c,v 1.1 2003/05/15 03:08:29 markus Exp $");
27
28#include <openssl/evp.h>
29#include "xmalloc.h"
30#include "log.h"
31
32/*
33 * This is used by SSH1:
34 *
35 * What kind of triple DES are these 2 routines?
36 *
37 * Why is there a redundant initialization vector?
38 *
39 * If only iv3 was used, then, this would till effect have been
40 * outer-cbc. However, there is also a private iv1 == iv2 which
41 * perhaps makes differential analysis easier. On the other hand, the
42 * private iv1 probably makes the CRC-32 attack ineffective. This is a
43 * result of that there is no longer any known iv1 to use when
44 * choosing the X block.
45 */
46struct ssh1_3des_ctx
47{
48 EVP_CIPHER_CTX k1, k2, k3;
49};
50
51const EVP_CIPHER * evp_ssh1_3des(void);
52void ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int);
53
54static int
55ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
56 int enc)
57{
58 struct ssh1_3des_ctx *c;
59 u_char *k1, *k2, *k3;
60
61 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
62 c = xmalloc(sizeof(*c));
63 EVP_CIPHER_CTX_set_app_data(ctx, c);
64 }
65 if (key == NULL)
66 return (1);
67 if (enc == -1)
68 enc = ctx->encrypt;
69 k1 = k2 = k3 = (u_char *) key;
70 k2 += 8;
71 if (EVP_CIPHER_CTX_key_length(ctx) >= 16+8) {
72 if (enc)
73 k3 += 16;
74 else
75 k1 += 16;
76 }
77 EVP_CIPHER_CTX_init(&c->k1);
78 EVP_CIPHER_CTX_init(&c->k2);
79 EVP_CIPHER_CTX_init(&c->k3);
80#ifdef SSH_OLD_EVP
81 EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc);
82 EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc);
83 EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc);
84#else
85 if (EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc) == 0 ||
86 EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc) == 0 ||
87 EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc) == 0) {
88 memset(c, 0, sizeof(*c));
89 xfree(c);
90 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
91 return (0);
92 }
93#endif
94 return (1);
95}
96
97static int
98ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len)
99{
100 struct ssh1_3des_ctx *c;
101
102 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
103 error("ssh1_3des_cbc: no context");
104 return (0);
105 }
106#ifdef SSH_OLD_EVP
107 EVP_Cipher(&c->k1, dest, (u_char *)src, len);
108 EVP_Cipher(&c->k2, dest, dest, len);
109 EVP_Cipher(&c->k3, dest, dest, len);
110#else
111 if (EVP_Cipher(&c->k1, dest, (u_char *)src, len) == 0 ||
112 EVP_Cipher(&c->k2, dest, dest, len) == 0 ||
113 EVP_Cipher(&c->k3, dest, dest, len) == 0)
114 return (0);
115#endif
116 return (1);
117}
118
119static int
120ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx)
121{
122 struct ssh1_3des_ctx *c;
123
124 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) != NULL) {
125 memset(c, 0, sizeof(*c));
126 xfree(c);
127 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
128 }
129 return (1);
130}
131
132void
133ssh1_3des_iv(EVP_CIPHER_CTX *evp, int doset, u_char *iv, int len)
134{
135 struct ssh1_3des_ctx *c;
136
137 if (len != 24)
138 fatal("%s: bad 3des iv length: %d", __func__, len);
139 if ((c = EVP_CIPHER_CTX_get_app_data(evp)) == NULL)
140 fatal("%s: no 3des context", __func__);
141 if (doset) {
142 debug3("%s: Installed 3DES IV", __func__);
143 memcpy(c->k1.iv, iv, 8);
144 memcpy(c->k2.iv, iv + 8, 8);
145 memcpy(c->k3.iv, iv + 16, 8);
146 } else {
147 debug3("%s: Copying 3DES IV", __func__);
148 memcpy(iv, c->k1.iv, 8);
149 memcpy(iv + 8, c->k2.iv, 8);
150 memcpy(iv + 16, c->k3.iv, 8);
151 }
152}
153
154const EVP_CIPHER *
155evp_ssh1_3des(void)
156{
157 static EVP_CIPHER ssh1_3des;
158
159 memset(&ssh1_3des, 0, sizeof(EVP_CIPHER));
160 ssh1_3des.nid = NID_undef;
161 ssh1_3des.block_size = 8;
162 ssh1_3des.iv_len = 0;
163 ssh1_3des.key_len = 16;
164 ssh1_3des.init = ssh1_3des_init;
165 ssh1_3des.cleanup = ssh1_3des_cleanup;
166 ssh1_3des.do_cipher = ssh1_3des_cbc;
167#ifndef SSH_OLD_EVP
168 ssh1_3des.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH;
169#endif
170 return (&ssh1_3des);
171}
diff --git a/cipher-aes.c b/cipher-aes.c
new file mode 100644
index 000000000..c41def600
--- /dev/null
+++ b/cipher-aes.c
@@ -0,0 +1,156 @@
1/*
2 * Copyright (c) 2003 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26#if OPENSSL_VERSION_NUMBER < 0x00907000L
27RCSID("$OpenBSD: cipher-aes.c,v 1.1 2003/05/15 03:08:29 markus Exp $");
28
29#include <openssl/evp.h>
30#include "rijndael.h"
31#include "xmalloc.h"
32#include "log.h"
33
34#define RIJNDAEL_BLOCKSIZE 16
35struct ssh_rijndael_ctx
36{
37 rijndael_ctx r_ctx;
38 u_char r_iv[RIJNDAEL_BLOCKSIZE];
39};
40
41const EVP_CIPHER * evp_rijndael(void);
42void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
43
44static int
45ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
46 int enc)
47{
48 struct ssh_rijndael_ctx *c;
49
50 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
51 c = xmalloc(sizeof(*c));
52 EVP_CIPHER_CTX_set_app_data(ctx, c);
53 }
54 if (key != NULL) {
55 if (enc == -1)
56 enc = ctx->encrypt;
57 rijndael_set_key(&c->r_ctx, (u_char *)key,
58 8*EVP_CIPHER_CTX_key_length(ctx), enc);
59 }
60 if (iv != NULL)
61 memcpy(c->r_iv, iv, RIJNDAEL_BLOCKSIZE);
62 return (1);
63}
64
65static int
66ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
67 u_int len)
68{
69 struct ssh_rijndael_ctx *c;
70 u_char buf[RIJNDAEL_BLOCKSIZE];
71 u_char *cprev, *cnow, *plain, *ivp;
72 int i, j, blocks = len / RIJNDAEL_BLOCKSIZE;
73
74 if (len == 0)
75 return (1);
76 if (len % RIJNDAEL_BLOCKSIZE)
77 fatal("ssh_rijndael_cbc: bad len %d", len);
78 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
79 error("ssh_rijndael_cbc: no context");
80 return (0);
81 }
82 if (ctx->encrypt) {
83 cnow = dest;
84 plain = (u_char *)src;
85 cprev = c->r_iv;
86 for (i = 0; i < blocks; i++, plain+=RIJNDAEL_BLOCKSIZE,
87 cnow+=RIJNDAEL_BLOCKSIZE) {
88 for (j = 0; j < RIJNDAEL_BLOCKSIZE; j++)
89 buf[j] = plain[j] ^ cprev[j];
90 rijndael_encrypt(&c->r_ctx, buf, cnow);
91 cprev = cnow;
92 }
93 memcpy(c->r_iv, cprev, RIJNDAEL_BLOCKSIZE);
94 } else {
95 cnow = (u_char *) (src+len-RIJNDAEL_BLOCKSIZE);
96 plain = dest+len-RIJNDAEL_BLOCKSIZE;
97
98 memcpy(buf, cnow, RIJNDAEL_BLOCKSIZE);
99 for (i = blocks; i > 0; i--, cnow-=RIJNDAEL_BLOCKSIZE,
100 plain-=RIJNDAEL_BLOCKSIZE) {
101 rijndael_decrypt(&c->r_ctx, cnow, plain);
102 ivp = (i == 1) ? c->r_iv : cnow-RIJNDAEL_BLOCKSIZE;
103 for (j = 0; j < RIJNDAEL_BLOCKSIZE; j++)
104 plain[j] ^= ivp[j];
105 }
106 memcpy(c->r_iv, buf, RIJNDAEL_BLOCKSIZE);
107 }
108 return (1);
109}
110
111static int
112ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx)
113{
114 struct ssh_rijndael_ctx *c;
115
116 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) != NULL) {
117 memset(c, 0, sizeof(*c));
118 xfree(c);
119 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
120 }
121 return (1);
122}
123
124void
125ssh_rijndael_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, u_int len)
126{
127 struct ssh_rijndael_ctx *c;
128
129 if ((c = EVP_CIPHER_CTX_get_app_data(evp)) == NULL)
130 fatal("ssh_rijndael_iv: no context");
131 if (doset)
132 memcpy(c->r_iv, iv, len);
133 else
134 memcpy(iv, c->r_iv, len);
135}
136
137const EVP_CIPHER *
138evp_rijndael(void)
139{
140 static EVP_CIPHER rijndal_cbc;
141
142 memset(&rijndal_cbc, 0, sizeof(EVP_CIPHER));
143 rijndal_cbc.nid = NID_undef;
144 rijndal_cbc.block_size = RIJNDAEL_BLOCKSIZE;
145 rijndal_cbc.iv_len = RIJNDAEL_BLOCKSIZE;
146 rijndal_cbc.key_len = 16;
147 rijndal_cbc.init = ssh_rijndael_init;
148 rijndal_cbc.cleanup = ssh_rijndael_cleanup;
149 rijndal_cbc.do_cipher = ssh_rijndael_cbc;
150#ifndef SSH_OLD_EVP
151 rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
152 EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV;
153#endif
154 return (&rijndal_cbc);
155}
156#endif /* OPENSSL_VERSION_NUMBER */
diff --git a/cipher-bf1.c b/cipher-bf1.c
new file mode 100644
index 000000000..64578bae8
--- /dev/null
+++ b/cipher-bf1.c
@@ -0,0 +1,97 @@
1/*
2 * Copyright (c) 2003 Markus Friedl. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26RCSID("$OpenBSD: cipher-bf1.c,v 1.1 2003/05/15 03:08:29 markus Exp $");
27
28#include <openssl/evp.h>
29#include "xmalloc.h"
30#include "log.h"
31/*
32 * SSH1 uses a variation on Blowfish, all bytes must be swapped before
33 * and after encryption/decryption. Thus the swap_bytes stuff (yuk).
34 */
35
36const EVP_CIPHER * evp_ssh1_bf(void);
37
38static void
39swap_bytes(const u_char *src, u_char *dst, int n)
40{
41 u_char c[4];
42
43 /* Process 4 bytes every lap. */
44 for (n = n / 4; n > 0; n--) {
45 c[3] = *src++;
46 c[2] = *src++;
47 c[1] = *src++;
48 c[0] = *src++;
49
50 *dst++ = c[0];
51 *dst++ = c[1];
52 *dst++ = c[2];
53 *dst++ = c[3];
54 }
55}
56
57#ifdef SSH_OLD_EVP
58static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key,
59 const unsigned char *iv, int enc)
60{
61 if (iv != NULL)
62 memcpy (&(ctx->oiv[0]), iv, 8);
63 memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8);
64 if (key != NULL)
65 BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx),
66 key);
67}
68#endif
69
70static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL;
71
72static int
73bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len)
74{
75 int ret;
76
77 swap_bytes(in, out, len);
78 ret = (*orig_bf)(ctx, out, out, len);
79 swap_bytes(out, out, len);
80 return (ret);
81}
82
83const EVP_CIPHER *
84evp_ssh1_bf(void)
85{
86 static EVP_CIPHER ssh1_bf;
87
88 memcpy(&ssh1_bf, EVP_bf_cbc(), sizeof(EVP_CIPHER));
89 orig_bf = ssh1_bf.do_cipher;
90 ssh1_bf.nid = NID_undef;
91#ifdef SSH_OLD_EVP
92 ssh1_bf.init = bf_ssh1_init;
93#endif
94 ssh1_bf.do_cipher = bf_ssh1_cipher;
95 ssh1_bf.key_len = 32;
96 return (&ssh1_bf);
97}
diff --git a/cipher-ctr.c b/cipher-ctr.c
new file mode 100644
index 000000000..a2bab5c14
--- /dev/null
+++ b/cipher-ctr.c
@@ -0,0 +1,141 @@
1/*
2 * Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#include "includes.h"
17RCSID("$OpenBSD: cipher-ctr.c,v 1.2 2003/06/17 18:14:23 markus Exp $");
18
19#include <openssl/evp.h>
20
21#include "log.h"
22#include "xmalloc.h"
23
24#if OPENSSL_VERSION_NUMBER < 0x00907000L
25#include "rijndael.h"
26#define AES_KEY rijndael_ctx
27#define AES_BLOCK_SIZE 16
28#define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b)
29#define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1)
30#else
31#include <openssl/aes.h>
32#endif
33
34const EVP_CIPHER *evp_aes_128_ctr(void);
35void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
36
37struct ssh_aes_ctr_ctx
38{
39 AES_KEY aes_ctx;
40 u_char aes_counter[AES_BLOCK_SIZE];
41};
42
43/*
44 * increment counter 'ctr',
45 * the counter is of size 'len' bytes and stored in network-byte-order.
46 * (LSB at ctr[len-1], MSB at ctr[0])
47 */
48static void
49ssh_ctr_inc(u_char *ctr, u_int len)
50{
51 int i;
52
53 for (i = len - 1; i >= 0; i--)
54 if (++ctr[i]) /* continue on overflow */
55 return;
56}
57
58static int
59ssh_aes_ctr(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
60 u_int len)
61{
62 struct ssh_aes_ctr_ctx *c;
63 u_int n = 0;
64 u_char buf[AES_BLOCK_SIZE];
65
66 if (len == 0)
67 return (1);
68 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL)
69 return (0);
70
71 while ((len--) > 0) {
72 if (n == 0) {
73 AES_encrypt(c->aes_counter, buf, &c->aes_ctx);
74 ssh_ctr_inc(c->aes_counter, AES_BLOCK_SIZE);
75 }
76 *(dest++) = *(src++) ^ buf[n];
77 n = (n + 1) % AES_BLOCK_SIZE;
78 }
79 return (1);
80}
81
82static int
83ssh_aes_ctr_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
84 int enc)
85{
86 struct ssh_aes_ctr_ctx *c;
87
88 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
89 c = xmalloc(sizeof(*c));
90 EVP_CIPHER_CTX_set_app_data(ctx, c);
91 }
92 if (key != NULL)
93 AES_set_encrypt_key(key, ctx->key_len * 8, &c->aes_ctx);
94 if (iv != NULL)
95 memcpy(c->aes_counter, iv, AES_BLOCK_SIZE);
96 return (1);
97}
98
99static int
100ssh_aes_ctr_cleanup(EVP_CIPHER_CTX *ctx)
101{
102 struct ssh_aes_ctr_ctx *c;
103
104 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) != NULL) {
105 memset(c, 0, sizeof(*c));
106 xfree(c);
107 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
108 }
109 return (1);
110}
111
112void
113ssh_aes_ctr_iv(EVP_CIPHER_CTX *evp, int doset, u_char * iv, u_int len)
114{
115 struct ssh_aes_ctr_ctx *c;
116
117 if ((c = EVP_CIPHER_CTX_get_app_data(evp)) == NULL)
118 fatal("ssh_aes_ctr_iv: no context");
119 if (doset)
120 memcpy(c->aes_counter, iv, len);
121 else
122 memcpy(iv, c->aes_counter, len);
123}
124
125const EVP_CIPHER *
126evp_aes_128_ctr(void)
127{
128 static EVP_CIPHER aes_ctr;
129
130 memset(&aes_ctr, 0, sizeof(EVP_CIPHER));
131 aes_ctr.nid = NID_undef;
132 aes_ctr.block_size = AES_BLOCK_SIZE;
133 aes_ctr.iv_len = AES_BLOCK_SIZE;
134 aes_ctr.key_len = 16;
135 aes_ctr.init = ssh_aes_ctr_init;
136 aes_ctr.cleanup = ssh_aes_ctr_cleanup;
137 aes_ctr.do_cipher = ssh_aes_ctr;
138 aes_ctr.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
139 EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV;
140 return (&aes_ctr);
141}
diff --git a/cipher.c b/cipher.c
index b5d38747e..e7c3c5411 100644
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: cipher.c,v 1.62 2002/11/21 22:45:31 markus Exp $"); 38RCSID("$OpenBSD: cipher.c,v 1.65 2003/05/17 04:27:52 markus Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "log.h" 41#include "log.h"
@@ -49,11 +49,14 @@ RCSID("$OpenBSD: cipher.c,v 1.62 2002/11/21 22:45:31 markus Exp $");
49#endif 49#endif
50 50
51#if OPENSSL_VERSION_NUMBER < 0x00907000L 51#if OPENSSL_VERSION_NUMBER < 0x00907000L
52#include "rijndael.h" 52extern const EVP_CIPHER *evp_rijndael(void);
53static const EVP_CIPHER *evp_rijndael(void); 53extern void ssh_rijndael_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
54#endif 54#endif
55static const EVP_CIPHER *evp_ssh1_3des(void); 55extern const EVP_CIPHER *evp_ssh1_bf(void);
56static const EVP_CIPHER *evp_ssh1_bf(void); 56extern const EVP_CIPHER *evp_ssh1_3des(void);
57extern void ssh1_3des_iv(EVP_CIPHER_CTX *, int, u_char *, int);
58extern const EVP_CIPHER *evp_aes_128_ctr(void);
59extern void ssh_aes_ctr_iv(EVP_CIPHER_CTX *, int, u_char *, u_int);
57 60
58struct Cipher { 61struct Cipher {
59 char *name; 62 char *name;
@@ -84,6 +87,9 @@ struct Cipher {
84 { "rijndael-cbc@lysator.liu.se", 87 { "rijndael-cbc@lysator.liu.se",
85 SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc }, 88 SSH_CIPHER_SSH2, 16, 32, EVP_aes_256_cbc },
86#endif 89#endif
90 { "aes128-ctr", SSH_CIPHER_SSH2, 16, 16, evp_aes_128_ctr },
91 { "aes192-ctr", SSH_CIPHER_SSH2, 16, 24, evp_aes_128_ctr },
92 { "aes256-ctr", SSH_CIPHER_SSH2, 16, 32, evp_aes_128_ctr },
87 93
88 { NULL, SSH_CIPHER_ILLEGAL, 0, 0, NULL } 94 { NULL, SSH_CIPHER_ILLEGAL, 0, 0, NULL }
89}; 95};
@@ -296,298 +302,6 @@ cipher_set_key_string(CipherContext *cc, Cipher *cipher,
296 memset(&md, 0, sizeof(md)); 302 memset(&md, 0, sizeof(md));
297} 303}
298 304
299/* Implementations for other non-EVP ciphers */
300
301/*
302 * This is used by SSH1:
303 *
304 * What kind of triple DES are these 2 routines?
305 *
306 * Why is there a redundant initialization vector?
307 *
308 * If only iv3 was used, then, this would till effect have been
309 * outer-cbc. However, there is also a private iv1 == iv2 which
310 * perhaps makes differential analysis easier. On the other hand, the
311 * private iv1 probably makes the CRC-32 attack ineffective. This is a
312 * result of that there is no longer any known iv1 to use when
313 * choosing the X block.
314 */
315struct ssh1_3des_ctx
316{
317 EVP_CIPHER_CTX k1, k2, k3;
318};
319
320static int
321ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
322 int enc)
323{
324 struct ssh1_3des_ctx *c;
325 u_char *k1, *k2, *k3;
326
327 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
328 c = xmalloc(sizeof(*c));
329 EVP_CIPHER_CTX_set_app_data(ctx, c);
330 }
331 if (key == NULL)
332 return (1);
333 if (enc == -1)
334 enc = ctx->encrypt;
335 k1 = k2 = k3 = (u_char *) key;
336 k2 += 8;
337 if (EVP_CIPHER_CTX_key_length(ctx) >= 16+8) {
338 if (enc)
339 k3 += 16;
340 else
341 k1 += 16;
342 }
343 EVP_CIPHER_CTX_init(&c->k1);
344 EVP_CIPHER_CTX_init(&c->k2);
345 EVP_CIPHER_CTX_init(&c->k3);
346#ifdef SSH_OLD_EVP
347 EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc);
348 EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc);
349 EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc);
350#else
351 if (EVP_CipherInit(&c->k1, EVP_des_cbc(), k1, NULL, enc) == 0 ||
352 EVP_CipherInit(&c->k2, EVP_des_cbc(), k2, NULL, !enc) == 0 ||
353 EVP_CipherInit(&c->k3, EVP_des_cbc(), k3, NULL, enc) == 0) {
354 memset(c, 0, sizeof(*c));
355 xfree(c);
356 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
357 return (0);
358 }
359#endif
360 return (1);
361}
362
363static int
364ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len)
365{
366 struct ssh1_3des_ctx *c;
367
368 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
369 error("ssh1_3des_cbc: no context");
370 return (0);
371 }
372#ifdef SSH_OLD_EVP
373 EVP_Cipher(&c->k1, dest, (u_char *)src, len);
374 EVP_Cipher(&c->k2, dest, dest, len);
375 EVP_Cipher(&c->k3, dest, dest, len);
376#else
377 if (EVP_Cipher(&c->k1, dest, (u_char *)src, len) == 0 ||
378 EVP_Cipher(&c->k2, dest, dest, len) == 0 ||
379 EVP_Cipher(&c->k3, dest, dest, len) == 0)
380 return (0);
381#endif
382 return (1);
383}
384
385static int
386ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx)
387{
388 struct ssh1_3des_ctx *c;
389
390 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) != NULL) {
391 memset(c, 0, sizeof(*c));
392 xfree(c);
393 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
394 }
395 return (1);
396}
397
398static const EVP_CIPHER *
399evp_ssh1_3des(void)
400{
401 static EVP_CIPHER ssh1_3des;
402
403 memset(&ssh1_3des, 0, sizeof(EVP_CIPHER));
404 ssh1_3des.nid = NID_undef;
405 ssh1_3des.block_size = 8;
406 ssh1_3des.iv_len = 0;
407 ssh1_3des.key_len = 16;
408 ssh1_3des.init = ssh1_3des_init;
409 ssh1_3des.cleanup = ssh1_3des_cleanup;
410 ssh1_3des.do_cipher = ssh1_3des_cbc;
411#ifndef SSH_OLD_EVP
412 ssh1_3des.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH;
413#endif
414 return (&ssh1_3des);
415}
416
417/*
418 * SSH1 uses a variation on Blowfish, all bytes must be swapped before
419 * and after encryption/decryption. Thus the swap_bytes stuff (yuk).
420 */
421static void
422swap_bytes(const u_char *src, u_char *dst, int n)
423{
424 u_char c[4];
425
426 /* Process 4 bytes every lap. */
427 for (n = n / 4; n > 0; n--) {
428 c[3] = *src++;
429 c[2] = *src++;
430 c[1] = *src++;
431 c[0] = *src++;
432
433 *dst++ = c[0];
434 *dst++ = c[1];
435 *dst++ = c[2];
436 *dst++ = c[3];
437 }
438}
439
440#ifdef SSH_OLD_EVP
441static void bf_ssh1_init (EVP_CIPHER_CTX * ctx, const unsigned char *key,
442 const unsigned char *iv, int enc)
443{
444 if (iv != NULL)
445 memcpy (&(ctx->oiv[0]), iv, 8);
446 memcpy (&(ctx->iv[0]), &(ctx->oiv[0]), 8);
447 if (key != NULL)
448 BF_set_key (&(ctx->c.bf_ks), EVP_CIPHER_CTX_key_length (ctx),
449 key);
450}
451#endif
452static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL;
453
454static int
455bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len)
456{
457 int ret;
458
459 swap_bytes(in, out, len);
460 ret = (*orig_bf)(ctx, out, out, len);
461 swap_bytes(out, out, len);
462 return (ret);
463}
464
465static const EVP_CIPHER *
466evp_ssh1_bf(void)
467{
468 static EVP_CIPHER ssh1_bf;
469
470 memcpy(&ssh1_bf, EVP_bf_cbc(), sizeof(EVP_CIPHER));
471 orig_bf = ssh1_bf.do_cipher;
472 ssh1_bf.nid = NID_undef;
473#ifdef SSH_OLD_EVP
474 ssh1_bf.init = bf_ssh1_init;
475#endif
476 ssh1_bf.do_cipher = bf_ssh1_cipher;
477 ssh1_bf.key_len = 32;
478 return (&ssh1_bf);
479}
480
481#if OPENSSL_VERSION_NUMBER < 0x00907000L
482/* RIJNDAEL */
483#define RIJNDAEL_BLOCKSIZE 16
484struct ssh_rijndael_ctx
485{
486 rijndael_ctx r_ctx;
487 u_char r_iv[RIJNDAEL_BLOCKSIZE];
488};
489
490static int
491ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
492 int enc)
493{
494 struct ssh_rijndael_ctx *c;
495
496 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
497 c = xmalloc(sizeof(*c));
498 EVP_CIPHER_CTX_set_app_data(ctx, c);
499 }
500 if (key != NULL) {
501 if (enc == -1)
502 enc = ctx->encrypt;
503 rijndael_set_key(&c->r_ctx, (u_char *)key,
504 8*EVP_CIPHER_CTX_key_length(ctx), enc);
505 }
506 if (iv != NULL)
507 memcpy(c->r_iv, iv, RIJNDAEL_BLOCKSIZE);
508 return (1);
509}
510
511static int
512ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
513 u_int len)
514{
515 struct ssh_rijndael_ctx *c;
516 u_char buf[RIJNDAEL_BLOCKSIZE];
517 u_char *cprev, *cnow, *plain, *ivp;
518 int i, j, blocks = len / RIJNDAEL_BLOCKSIZE;
519
520 if (len == 0)
521 return (1);
522 if (len % RIJNDAEL_BLOCKSIZE)
523 fatal("ssh_rijndael_cbc: bad len %d", len);
524 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) == NULL) {
525 error("ssh_rijndael_cbc: no context");
526 return (0);
527 }
528 if (ctx->encrypt) {
529 cnow = dest;
530 plain = (u_char *)src;
531 cprev = c->r_iv;
532 for (i = 0; i < blocks; i++, plain+=RIJNDAEL_BLOCKSIZE,
533 cnow+=RIJNDAEL_BLOCKSIZE) {
534 for (j = 0; j < RIJNDAEL_BLOCKSIZE; j++)
535 buf[j] = plain[j] ^ cprev[j];
536 rijndael_encrypt(&c->r_ctx, buf, cnow);
537 cprev = cnow;
538 }
539 memcpy(c->r_iv, cprev, RIJNDAEL_BLOCKSIZE);
540 } else {
541 cnow = (u_char *) (src+len-RIJNDAEL_BLOCKSIZE);
542 plain = dest+len-RIJNDAEL_BLOCKSIZE;
543
544 memcpy(buf, cnow, RIJNDAEL_BLOCKSIZE);
545 for (i = blocks; i > 0; i--, cnow-=RIJNDAEL_BLOCKSIZE,
546 plain-=RIJNDAEL_BLOCKSIZE) {
547 rijndael_decrypt(&c->r_ctx, cnow, plain);
548 ivp = (i == 1) ? c->r_iv : cnow-RIJNDAEL_BLOCKSIZE;
549 for (j = 0; j < RIJNDAEL_BLOCKSIZE; j++)
550 plain[j] ^= ivp[j];
551 }
552 memcpy(c->r_iv, buf, RIJNDAEL_BLOCKSIZE);
553 }
554 return (1);
555}
556
557static int
558ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx)
559{
560 struct ssh_rijndael_ctx *c;
561
562 if ((c = EVP_CIPHER_CTX_get_app_data(ctx)) != NULL) {
563 memset(c, 0, sizeof(*c));
564 xfree(c);
565 EVP_CIPHER_CTX_set_app_data(ctx, NULL);
566 }
567 return (1);
568}
569
570static const EVP_CIPHER *
571evp_rijndael(void)
572{
573 static EVP_CIPHER rijndal_cbc;
574
575 memset(&rijndal_cbc, 0, sizeof(EVP_CIPHER));
576 rijndal_cbc.nid = NID_undef;
577 rijndal_cbc.block_size = RIJNDAEL_BLOCKSIZE;
578 rijndal_cbc.iv_len = RIJNDAEL_BLOCKSIZE;
579 rijndal_cbc.key_len = 16;
580 rijndal_cbc.init = ssh_rijndael_init;
581 rijndal_cbc.cleanup = ssh_rijndael_cleanup;
582 rijndal_cbc.do_cipher = ssh_rijndael_cbc;
583#ifndef SSH_OLD_EVP
584 rijndal_cbc.flags = EVP_CIPH_CBC_MODE | EVP_CIPH_VARIABLE_LENGTH |
585 EVP_CIPH_ALWAYS_CALL_INIT | EVP_CIPH_CUSTOM_IV;
586#endif
587 return (&rijndal_cbc);
588}
589#endif
590
591/* 305/*
592 * Exports an IV from the CipherContext required to export the key 306 * Exports an IV from the CipherContext required to export the key
593 * state back from the unprivileged child to the privileged parent 307 * state back from the unprivileged child to the privileged parent
@@ -611,7 +325,6 @@ void
611cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len) 325cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
612{ 326{
613 Cipher *c = cc->cipher; 327 Cipher *c = cc->cipher;
614 u_char *civ = NULL;
615 int evplen; 328 int evplen;
616 329
617 switch (c->number) { 330 switch (c->number) {
@@ -624,45 +337,28 @@ cipher_get_keyiv(CipherContext *cc, u_char *iv, u_int len)
624 if (evplen != len) 337 if (evplen != len)
625 fatal("%s: wrong iv length %d != %d", __func__, 338 fatal("%s: wrong iv length %d != %d", __func__,
626 evplen, len); 339 evplen, len);
627
628#if OPENSSL_VERSION_NUMBER < 0x00907000L 340#if OPENSSL_VERSION_NUMBER < 0x00907000L
629 if (c->evptype == evp_rijndael) { 341 if (c->evptype == evp_rijndael)
630 struct ssh_rijndael_ctx *aesc; 342 ssh_rijndael_iv(&cc->evp, 0, iv, len);
631 343 else
632 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
633 if (aesc == NULL)
634 fatal("%s: no rijndael context", __func__);
635 civ = aesc->r_iv;
636 } else
637#endif 344#endif
638 { 345 if (c->evptype == evp_aes_128_ctr)
639 civ = cc->evp.iv; 346 ssh_aes_ctr_iv(&cc->evp, 0, iv, len);
640 } 347 else
348 memcpy(iv, cc->evp.iv, len);
349 break;
350 case SSH_CIPHER_3DES:
351 ssh1_3des_iv(&cc->evp, 0, iv, 24);
641 break; 352 break;
642 case SSH_CIPHER_3DES: {
643 struct ssh1_3des_ctx *desc;
644 if (len != 24)
645 fatal("%s: bad 3des iv length: %d", __func__, len);
646 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
647 if (desc == NULL)
648 fatal("%s: no 3des context", __func__);
649 debug3("%s: Copying 3DES IV", __func__);
650 memcpy(iv, desc->k1.iv, 8);
651 memcpy(iv + 8, desc->k2.iv, 8);
652 memcpy(iv + 16, desc->k3.iv, 8);
653 return;
654 }
655 default: 353 default:
656 fatal("%s: bad cipher %d", __func__, c->number); 354 fatal("%s: bad cipher %d", __func__, c->number);
657 } 355 }
658 memcpy(iv, civ, len);
659} 356}
660 357
661void 358void
662cipher_set_keyiv(CipherContext *cc, u_char *iv) 359cipher_set_keyiv(CipherContext *cc, u_char *iv)
663{ 360{
664 Cipher *c = cc->cipher; 361 Cipher *c = cc->cipher;
665 u_char *div = NULL;
666 int evplen = 0; 362 int evplen = 0;
667 363
668 switch (c->number) { 364 switch (c->number) {
@@ -672,36 +368,22 @@ cipher_set_keyiv(CipherContext *cc, u_char *iv)
672 evplen = EVP_CIPHER_CTX_iv_length(&cc->evp); 368 evplen = EVP_CIPHER_CTX_iv_length(&cc->evp);
673 if (evplen == 0) 369 if (evplen == 0)
674 return; 370 return;
675
676#if OPENSSL_VERSION_NUMBER < 0x00907000L 371#if OPENSSL_VERSION_NUMBER < 0x00907000L
677 if (c->evptype == evp_rijndael) { 372 if (c->evptype == evp_rijndael)
678 struct ssh_rijndael_ctx *aesc; 373 ssh_rijndael_iv(&cc->evp, 1, iv, evplen);
679 374 else
680 aesc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
681 if (aesc == NULL)
682 fatal("%s: no rijndael context", __func__);
683 div = aesc->r_iv;
684 } else
685#endif 375#endif
686 { 376 if (c->evptype == evp_aes_128_ctr)
687 div = cc->evp.iv; 377 ssh_aes_ctr_iv(&cc->evp, 1, iv, evplen);
688 } 378 else
379 memcpy(cc->evp.iv, iv, evplen);
380 break;
381 case SSH_CIPHER_3DES:
382 ssh1_3des_iv(&cc->evp, 1, iv, 24);
689 break; 383 break;
690 case SSH_CIPHER_3DES: {
691 struct ssh1_3des_ctx *desc;
692 desc = EVP_CIPHER_CTX_get_app_data(&cc->evp);
693 if (desc == NULL)
694 fatal("%s: no 3des context", __func__);
695 debug3("%s: Installed 3DES IV", __func__);
696 memcpy(desc->k1.iv, iv, 8);
697 memcpy(desc->k2.iv, iv + 8, 8);
698 memcpy(desc->k3.iv, iv + 16, 8);
699 return;
700 }
701 default: 384 default:
702 fatal("%s: bad cipher %d", __func__, c->number); 385 fatal("%s: bad cipher %d", __func__, c->number);
703 } 386 }
704 memcpy(div, iv, evplen);
705} 387}
706 388
707#if OPENSSL_VERSION_NUMBER < 0x00907000L 389#if OPENSSL_VERSION_NUMBER < 0x00907000L
diff --git a/clientloop.c b/clientloop.c
index af207c070..d8def78bd 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.107 2003/04/01 10:22:21 markus Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.112 2003/06/28 16:23:06 deraadt Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -395,9 +395,9 @@ client_suspend_self(Buffer *bin, Buffer *bout, Buffer *berr)
395 395
396 /* Flush stdout and stderr buffers. */ 396 /* Flush stdout and stderr buffers. */
397 if (buffer_len(bout) > 0) 397 if (buffer_len(bout) > 0)
398 atomicio(write, fileno(stdout), buffer_ptr(bout), buffer_len(bout)); 398 atomicio(vwrite, fileno(stdout), buffer_ptr(bout), buffer_len(bout));
399 if (buffer_len(berr) > 0) 399 if (buffer_len(berr) > 0)
400 atomicio(write, fileno(stderr), buffer_ptr(berr), buffer_len(berr)); 400 atomicio(vwrite, fileno(stderr), buffer_ptr(berr), buffer_len(berr));
401 401
402 leave_raw_mode(); 402 leave_raw_mode();
403 403
@@ -490,13 +490,13 @@ process_cmdline(void)
490 if (*s == 0) 490 if (*s == 0)
491 goto out; 491 goto out;
492 if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) { 492 if (strlen(s) < 2 || s[0] != '-' || !(s[1] == 'L' || s[1] == 'R')) {
493 log("Invalid command."); 493 logit("Invalid command.");
494 goto out; 494 goto out;
495 } 495 }
496 if (s[1] == 'L') 496 if (s[1] == 'L')
497 local = 1; 497 local = 1;
498 if (!local && !compat20) { 498 if (!local && !compat20) {
499 log("Not supported for SSH protocol version 1."); 499 logit("Not supported for SSH protocol version 1.");
500 goto out; 500 goto out;
501 } 501 }
502 s += 2; 502 s += 2;
@@ -507,24 +507,24 @@ process_cmdline(void)
507 sfwd_port, buf, sfwd_host_port) != 3 && 507 sfwd_port, buf, sfwd_host_port) != 3 &&
508 sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]", 508 sscanf(s, "%5[0-9]/%255[^/]/%5[0-9]",
509 sfwd_port, buf, sfwd_host_port) != 3) { 509 sfwd_port, buf, sfwd_host_port) != 3) {
510 log("Bad forwarding specification."); 510 logit("Bad forwarding specification.");
511 goto out; 511 goto out;
512 } 512 }
513 if ((fwd_port = a2port(sfwd_port)) == 0 || 513 if ((fwd_port = a2port(sfwd_port)) == 0 ||
514 (fwd_host_port = a2port(sfwd_host_port)) == 0) { 514 (fwd_host_port = a2port(sfwd_host_port)) == 0) {
515 log("Bad forwarding port(s)."); 515 logit("Bad forwarding port(s).");
516 goto out; 516 goto out;
517 } 517 }
518 if (local) { 518 if (local) {
519 if (channel_setup_local_fwd_listener(fwd_port, buf, 519 if (channel_setup_local_fwd_listener(fwd_port, buf,
520 fwd_host_port, options.gateway_ports) < 0) { 520 fwd_host_port, options.gateway_ports) < 0) {
521 log("Port forwarding failed."); 521 logit("Port forwarding failed.");
522 goto out; 522 goto out;
523 } 523 }
524 } else 524 } else
525 channel_request_remote_forwarding(fwd_port, buf, 525 channel_request_remote_forwarding(fwd_port, buf,
526 fwd_host_port); 526 fwd_host_port);
527 log("Forwarding port."); 527 logit("Forwarding port.");
528out: 528out:
529 signal(SIGINT, handler); 529 signal(SIGINT, handler);
530 enter_raw_mode(); 530 enter_raw_mode();
@@ -574,10 +574,23 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
574 /* We have been continued. */ 574 /* We have been continued. */
575 continue; 575 continue;
576 576
577 case 'B':
578 if (compat20) {
579 snprintf(string, sizeof string,
580 "%cB\r\n", escape_char);
581 buffer_append(berr, string,
582 strlen(string));
583 channel_request_start(session_ident,
584 "break", 0);
585 packet_put_int(1000);
586 packet_send();
587 }
588 continue;
589
577 case 'R': 590 case 'R':
578 if (compat20) { 591 if (compat20) {
579 if (datafellows & SSH_BUG_NOREKEY) 592 if (datafellows & SSH_BUG_NOREKEY)
580 log("Server does not support re-keying"); 593 logit("Server does not support re-keying");
581 else 594 else
582 need_rekeying = 1; 595 need_rekeying = 1;
583 } 596 }
@@ -636,6 +649,7 @@ process_escapes(Buffer *bin, Buffer *bout, Buffer *berr, char *buf, int len)
636"%c?\r\n\ 649"%c?\r\n\
637Supported escape sequences:\r\n\ 650Supported escape sequences:\r\n\
638%c. - terminate connection\r\n\ 651%c. - terminate connection\r\n\
652%cB - send a BREAK to the remote system\r\n\
639%cC - open a command line\r\n\ 653%cC - open a command line\r\n\
640%cR - Request rekey (SSH protocol 2 only)\r\n\ 654%cR - Request rekey (SSH protocol 2 only)\r\n\
641%c^Z - suspend ssh\r\n\ 655%c^Z - suspend ssh\r\n\
@@ -646,7 +660,7 @@ Supported escape sequences:\r\n\
646(Note that escapes are only recognized immediately after newline.)\r\n", 660(Note that escapes are only recognized immediately after newline.)\r\n",
647 escape_char, escape_char, escape_char, escape_char, 661 escape_char, escape_char, escape_char, escape_char,
648 escape_char, escape_char, escape_char, escape_char, 662 escape_char, escape_char, escape_char, escape_char,
649 escape_char, escape_char); 663 escape_char, escape_char, escape_char);
650 buffer_append(berr, string, strlen(string)); 664 buffer_append(berr, string, strlen(string));
651 continue; 665 continue;
652 666
@@ -968,9 +982,8 @@ client_loop(int have_pty, int escape_char_arg, int ssh2_chan_id)
968 /* Do channel operations unless rekeying in progress. */ 982 /* Do channel operations unless rekeying in progress. */
969 if (!rekeying) { 983 if (!rekeying) {
970 channel_after_select(readset, writeset); 984 channel_after_select(readset, writeset);
971 985 if (need_rekeying || packet_need_rekeying()) {
972 if (need_rekeying) { 986 debug("need rekeying");
973 debug("user requests rekeying");
974 xxx_kex->done = 0; 987 xxx_kex->done = 0;
975 kex_send_kexinit(xxx_kex); 988 kex_send_kexinit(xxx_kex);
976 need_rekeying = 0; 989 need_rekeying = 0;
@@ -1146,7 +1159,7 @@ client_request_forwarded_tcpip(const char *request_type, int rchan)
1146 c = channel_new("forwarded-tcpip", 1159 c = channel_new("forwarded-tcpip",
1147 SSH_CHANNEL_CONNECTING, sock, sock, -1, 1160 SSH_CHANNEL_CONNECTING, sock, sock, -1,
1148 CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0, 1161 CHAN_TCP_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
1149 xstrdup(originator_address), 1); 1162 originator_address, 1);
1150 xfree(originator_address); 1163 xfree(originator_address);
1151 xfree(listen_address); 1164 xfree(listen_address);
1152 return c; 1165 return c;
@@ -1182,8 +1195,7 @@ client_request_x11(const char *request_type, int rchan)
1182 return NULL; 1195 return NULL;
1183 c = channel_new("x11", 1196 c = channel_new("x11",
1184 SSH_CHANNEL_X11_OPEN, sock, sock, -1, 1197 SSH_CHANNEL_X11_OPEN, sock, sock, -1,
1185 CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, 1198 CHAN_TCP_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 0, "x11", 1);
1186 xstrdup("x11"), 1);
1187 c->force_drain = 1; 1199 c->force_drain = 1;
1188 return c; 1200 return c;
1189} 1201}
@@ -1205,7 +1217,7 @@ client_request_agent(const char *request_type, int rchan)
1205 c = channel_new("authentication agent connection", 1217 c = channel_new("authentication agent connection",
1206 SSH_CHANNEL_OPEN, sock, sock, -1, 1218 SSH_CHANNEL_OPEN, sock, sock, -1,
1207 CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0, 1219 CHAN_X11_WINDOW_DEFAULT, CHAN_TCP_WINDOW_DEFAULT, 0,
1208 xstrdup("authentication agent connection"), 1); 1220 "authentication agent connection", 1);
1209 c->force_drain = 1; 1221 c->force_drain = 1;
1210 return c; 1222 return c;
1211} 1223}
diff --git a/compat.c b/compat.c
index 5e1774ab6..af1d14321 100644
--- a/compat.c
+++ b/compat.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: compat.c,v 1.66 2003/04/01 10:31:26 markus Exp $"); 26RCSID("$OpenBSD: compat.c,v 1.69 2003/08/29 10:03:15 markus Exp $");
27 27
28#include "buffer.h" 28#include "buffer.h"
29#include "packet.h" 29#include "packet.h"
@@ -79,7 +79,11 @@ compat_datafellows(const char *version)
79 { "OpenSSH_2.5.3*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, 79 { "OpenSSH_2.5.3*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF},
80 { "OpenSSH_2.*," 80 { "OpenSSH_2.*,"
81 "OpenSSH_3.0*," 81 "OpenSSH_3.0*,"
82 "OpenSSH_3.1*", SSH_BUG_EXTEOF}, 82 "OpenSSH_3.1*", SSH_BUG_EXTEOF|SSH_BUG_GSSAPI_BER},
83 { "OpenSSH_3.2*,"
84 "OpenSSH_3.3*,"
85 "OpenSSH_3.4*,"
86 "OpenSSH_3.5*", SSH_BUG_GSSAPI_BER},
83 { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF}, 87 { "Sun_SSH_1.0*", SSH_BUG_NOREKEY|SSH_BUG_EXTEOF},
84 { "OpenSSH*", 0 }, 88 { "OpenSSH*", 0 },
85 { "*MindTerm*", 0 }, 89 { "*MindTerm*", 0 },
@@ -131,12 +135,9 @@ compat_datafellows(const char *version)
131 "1.2.19*," 135 "1.2.19*,"
132 "1.2.20*," 136 "1.2.20*,"
133 "1.2.21*," 137 "1.2.21*,"
134 "1.2.22*", SSH_BUG_IGNOREMSG|SSH_BUG_K5USER }, 138 "1.2.22*", SSH_BUG_IGNOREMSG },
135 { "1.3.2*", /* F-Secure */ 139 { "1.3.2*", /* F-Secure */
136 SSH_BUG_IGNOREMSG|SSH_BUG_K5USER }, 140 SSH_BUG_IGNOREMSG },
137 { "1.2.1*,"
138 "1.2.2*,"
139 "1.2.3*", SSH_BUG_K5USER },
140 { "*SSH Compatible Server*", /* Netscreen */ 141 { "*SSH Compatible Server*", /* Netscreen */
141 SSH_BUG_PASSWORDPAD }, 142 SSH_BUG_PASSWORDPAD },
142 { "*OSU_0*," 143 { "*OSU_0*,"
@@ -188,7 +189,7 @@ proto_spec(const char *spec)
188 ret |= SSH_PROTO_2; 189 ret |= SSH_PROTO_2;
189 break; 190 break;
190 default: 191 default:
191 log("ignoring bad proto spec: '%s'.", p); 192 logit("ignoring bad proto spec: '%s'.", p);
192 break; 193 break;
193 } 194 }
194 } 195 }
diff --git a/compat.h b/compat.h
index 881e450d3..7a5004455 100644
--- a/compat.h
+++ b/compat.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: compat.h,v 1.34 2003/04/01 10:31:26 markus Exp $ */ 1/* $OpenBSD: compat.h,v 1.36 2003/08/29 10:03:15 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 1999, 2000, 2001 Markus Friedl. All rights reserved.
@@ -53,9 +53,9 @@
53#define SSH_BUG_DERIVEKEY 0x00040000 53#define SSH_BUG_DERIVEKEY 0x00040000
54#define SSH_BUG_DUMMYCHAN 0x00100000 54#define SSH_BUG_DUMMYCHAN 0x00100000
55#define SSH_BUG_EXTEOF 0x00200000 55#define SSH_BUG_EXTEOF 0x00200000
56#define SSH_BUG_K5USER 0x00400000 56#define SSH_BUG_PROBE 0x00400000
57#define SSH_BUG_PROBE 0x00800000 57#define SSH_BUG_FIRSTKEX 0x00800000
58#define SSH_BUG_FIRSTKEX 0x01000000 58#define SSH_BUG_GSSAPI_BER 0x01000000
59 59
60void enable_compat13(void); 60void enable_compat13(void);
61void enable_compat20(void); 61void enable_compat20(void);
diff --git a/config.h.in b/config.h.in
index 55149792c..41495c4fb 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,5 +1,29 @@
1/* config.h.in. Generated from configure.ac by autoheader. */ 1/* config.h.in. Generated automatically from configure.ac by autoheader. */
2/* $Id: acconfig.h,v 1.149 2003/03/10 00:38:10 djm Exp $ */ 2/* $Id: acconfig.h,v 1.166 2003/09/16 01:52:19 dtucker Exp $ */
3
4/*
5 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
3 27
4#ifndef _CONFIG_H 28#ifndef _CONFIG_H
5#define _CONFIG_H 29#define _CONFIG_H
@@ -8,9 +32,20 @@
8/* Please make your changes there */ 32/* Please make your changes there */
9 33
10 34
35
36/* Define if your platform breaks doing a seteuid before a setuid */
37#undef SETEUID_BREAKS_SETUID
38
39/* Define if your setreuid() is broken */
40#undef BROKEN_SETREUID
41
42/* Define if your setregid() is broken */
43#undef BROKEN_SETREGID
44
11/* Define to a Set Process Title type if your system is */ 45/* Define to a Set Process Title type if your system is */
12/* supported by bsd-setproctitle.c */ 46/* supported by bsd-setproctitle.c */
13#undef SPT_TYPE 47#undef SPT_TYPE
48#undef SPT_PADCHAR
14 49
15/* setgroups() NOOP allowed */ 50/* setgroups() NOOP allowed */
16#undef SETGROUPS_NOOP 51#undef SETGROUPS_NOOP
@@ -82,6 +117,9 @@
82/* Define if you want to enable AIX4's authenticate function */ 117/* Define if you want to enable AIX4's authenticate function */
83#undef WITH_AIXAUTHENTICATE 118#undef WITH_AIXAUTHENTICATE
84 119
120/* Define if your AIX loginfailed() function takes 4 arguments (AIX >= 5.2) */
121#undef AIX_LOGINFAILED_4ARG
122
85/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */ 123/* Define if you have/want arrays (cluster-wide session managment, not C arrays) */
86#undef WITH_IRIX_ARRAY 124#undef WITH_IRIX_ARRAY
87 125
@@ -201,18 +239,15 @@
201/* Define if compiler implements __func__ */ 239/* Define if compiler implements __func__ */
202#undef HAVE___func__ 240#undef HAVE___func__
203 241
242/* Define this is you want GSSAPI support in the version 2 protocol */
243#undef GSSAPI
244
204/* Define if you want Kerberos 5 support */ 245/* Define if you want Kerberos 5 support */
205#undef KRB5 246#undef KRB5
206 247
207/* Define this if you are using the Heimdal version of Kerberos V5 */ 248/* Define this if you are using the Heimdal version of Kerberos V5 */
208#undef HEIMDAL 249#undef HEIMDAL
209 250
210/* Define if you want Kerberos 4 support */
211#undef KRB4
212
213/* Define if you want AFS support */
214#undef AFS
215
216/* Define if you want S/Key support */ 251/* Define if you want S/Key support */
217#undef SKEY 252#undef SKEY
218 253
@@ -295,9 +330,6 @@
295/* Specify location of ssh.pid */ 330/* Specify location of ssh.pid */
296#undef _PATH_SSH_PIDDIR 331#undef _PATH_SSH_PIDDIR
297 332
298/* Use IPv4 for connection by default, IPv6 can still if explicity asked */
299#undef IPV4_DEFAULT
300
301/* getaddrinfo is broken (if present) */ 333/* getaddrinfo is broken (if present) */
302#undef BROKEN_GETADDRINFO 334#undef BROKEN_GETADDRINFO
303 335
@@ -328,6 +360,9 @@
328/* Define in your struct dirent expects you to allocate extra space for d_name */ 360/* Define in your struct dirent expects you to allocate extra space for d_name */
329#undef BROKEN_ONE_BYTE_DIRENT_D_NAME 361#undef BROKEN_ONE_BYTE_DIRENT_D_NAME
330 362
363/* Define if your system has /etc/default/login */
364#undef HAVE_ETC_DEFAULT_LOGIN
365
331/* Define if your getopt(3) defines and uses optreset */ 366/* Define if your getopt(3) defines and uses optreset */
332#undef HAVE_GETOPT_OPTRESET 367#undef HAVE_GETOPT_OPTRESET
333 368
@@ -367,542 +402,558 @@
367/* Silly mkstemp() */ 402/* Silly mkstemp() */
368#undef HAVE_STRICT_MKSTEMP 403#undef HAVE_STRICT_MKSTEMP
369 404
370/* Setproctitle emulation */
371#undef SETPROCTITLE_STRATEGY
372#undef SETPROCTITLE_PS_PADDING
373
374/* Some systems put this outside of libc */ 405/* Some systems put this outside of libc */
375#undef HAVE_NANOSLEEP 406#undef HAVE_NANOSLEEP
376 407
377/* Pushing STREAMS modules incorrectly acquires a controlling TTY */ 408/* Define if sshd somehow reacquires a controlling TTY after setsid() */
378#undef STREAMS_PUSH_ACQUIRES_CTTY 409#undef SSHD_ACQUIRES_CTTY
410
411/* Define if cmsg_type is not passed correctly */
412#undef BROKEN_CMSG_TYPE
413
414/* Strings used in /etc/passwd to denote locked account */
415#undef LOCKED_PASSWD_STRING
416#undef LOCKED_PASSWD_PREFIX
417#undef LOCKED_PASSWD_SUBSTR
418
419/* Define if DNS support is to be activated */
420#undef DNS
421
422/* Define if getrrsetbyname() exists */
423#undef HAVE_GETRRSETBYNAME
379 424
425/* Define if HEADER.ad exists in arpa/nameser.h */
426#undef HAVE_HEADER_AD
380 427
381/* Define to 1 if the `getpgrp' function requires zero arguments. */ 428
429/* Define if the `getpgrp' function takes no argument. */
382#undef GETPGRP_VOID 430#undef GETPGRP_VOID
383 431
384/* Define to 1 if you have the `arc4random' function. */ 432/* Define if you have the `arc4random' function. */
385#undef HAVE_ARC4RANDOM 433#undef HAVE_ARC4RANDOM
386 434
387/* Define to 1 if you have the `b64_ntop' function. */ 435/* Define if you have the `b64_ntop' function. */
388#undef HAVE_B64_NTOP 436#undef HAVE_B64_NTOP
389 437
390/* Define to 1 if you have the `b64_pton' function. */ 438/* Define if you have the `b64_pton' function. */
391#undef HAVE_B64_PTON 439#undef HAVE_B64_PTON
392 440
393/* Define to 1 if you have the `basename' function. */ 441/* Define if you have the `basename' function. */
394#undef HAVE_BASENAME 442#undef HAVE_BASENAME
395 443
396/* Define to 1 if you have the `bcopy' function. */ 444/* Define if you have the `bcopy' function. */
397#undef HAVE_BCOPY 445#undef HAVE_BCOPY
398 446
399/* Define to 1 if you have the `bindresvport_sa' function. */ 447/* Define if you have the `bindresvport_sa' function. */
400#undef HAVE_BINDRESVPORT_SA 448#undef HAVE_BINDRESVPORT_SA
401 449
402/* Define to 1 if you have the <bstring.h> header file. */ 450/* Define if you have the <bstring.h> header file. */
403#undef HAVE_BSTRING_H 451#undef HAVE_BSTRING_H
404 452
405/* Define to 1 if you have the `clock' function. */ 453/* Define if you have the `clock' function. */
406#undef HAVE_CLOCK 454#undef HAVE_CLOCK
407 455
408/* Define to 1 if you have the <crypt.h> header file. */ 456/* Define if you have the <crypt.h> header file. */
409#undef HAVE_CRYPT_H 457#undef HAVE_CRYPT_H
410 458
411/* Define to 1 if you have the `dirname' function. */ 459/* Define if you have the `dirname' function. */
412#undef HAVE_DIRNAME 460#undef HAVE_DIRNAME
413 461
414/* Define to 1 if you have the <endian.h> header file. */ 462/* Define if you have the <endian.h> header file. */
415#undef HAVE_ENDIAN_H 463#undef HAVE_ENDIAN_H
416 464
417/* Define to 1 if you have the `endutent' function. */ 465/* Define if you have the `endutent' function. */
418#undef HAVE_ENDUTENT 466#undef HAVE_ENDUTENT
419 467
420/* Define to 1 if you have the `endutxent' function. */ 468/* Define if you have the `endutxent' function. */
421#undef HAVE_ENDUTXENT 469#undef HAVE_ENDUTXENT
422 470
423/* Define to 1 if you have the `fchmod' function. */ 471/* Define if you have the `fchmod' function. */
424#undef HAVE_FCHMOD 472#undef HAVE_FCHMOD
425 473
426/* Define to 1 if you have the `fchown' function. */ 474/* Define if you have the `fchown' function. */
427#undef HAVE_FCHOWN 475#undef HAVE_FCHOWN
428 476
429/* Define to 1 if you have the <floatingpoint.h> header file. */ 477/* Define if you have the <features.h> header file. */
478#undef HAVE_FEATURES_H
479
480/* Define if you have the <floatingpoint.h> header file. */
430#undef HAVE_FLOATINGPOINT_H 481#undef HAVE_FLOATINGPOINT_H
431 482
432/* Define to 1 if you have the `freeaddrinfo' function. */ 483/* Define if you have the `freeaddrinfo' function. */
433#undef HAVE_FREEADDRINFO 484#undef HAVE_FREEADDRINFO
434 485
435/* Define to 1 if you have the `futimes' function. */ 486/* Define if you have the `futimes' function. */
436#undef HAVE_FUTIMES 487#undef HAVE_FUTIMES
437 488
438/* Define to 1 if you have the `gai_strerror' function. */ 489/* Define if you have the `gai_strerror' function. */
439#undef HAVE_GAI_STRERROR 490#undef HAVE_GAI_STRERROR
440 491
441/* Define to 1 if you have the `getaddrinfo' function. */ 492/* Define if you have the `getaddrinfo' function. */
442#undef HAVE_GETADDRINFO 493#undef HAVE_GETADDRINFO
443 494
444/* Define to 1 if you have the `getcwd' function. */ 495/* Define if you have the `getcwd' function. */
445#undef HAVE_GETCWD 496#undef HAVE_GETCWD
446 497
447/* Define to 1 if you have the `getgrouplist' function. */ 498/* Define if you have the `getgrouplist' function. */
448#undef HAVE_GETGROUPLIST 499#undef HAVE_GETGROUPLIST
449 500
450/* Define to 1 if you have the `getluid' function. */ 501/* Define if you have the `getluid' function. */
451#undef HAVE_GETLUID 502#undef HAVE_GETLUID
452 503
453/* Define to 1 if you have the `getnameinfo' function. */ 504/* Define if you have the `getnameinfo' function. */
454#undef HAVE_GETNAMEINFO 505#undef HAVE_GETNAMEINFO
455 506
456/* Define to 1 if you have the `getopt' function. */ 507/* Define if you have the `getopt' function. */
457#undef HAVE_GETOPT 508#undef HAVE_GETOPT
458 509
459/* Define to 1 if you have the <getopt.h> header file. */ 510/* Define if you have the <getopt.h> header file. */
460#undef HAVE_GETOPT_H 511#undef HAVE_GETOPT_H
461 512
462/* Define to 1 if you have the `getpeereid' function. */ 513/* Define if you have the `getpeereid' function. */
463#undef HAVE_GETPEEREID 514#undef HAVE_GETPEEREID
464 515
465/* Define to 1 if you have the `getpwanam' function. */ 516/* Define if you have the `getpwanam' function. */
466#undef HAVE_GETPWANAM 517#undef HAVE_GETPWANAM
467 518
468/* Define to 1 if you have the `getrlimit' function. */ 519/* Define if you have the `getrlimit' function. */
469#undef HAVE_GETRLIMIT 520#undef HAVE_GETRLIMIT
470 521
471/* Define to 1 if you have the `getrusage' function. */ 522/* Define if you have the `getrusage' function. */
472#undef HAVE_GETRUSAGE 523#undef HAVE_GETRUSAGE
473 524
474/* Define to 1 if you have the `gettimeofday' function. */ 525/* Define if you have the `gettimeofday' function. */
475#undef HAVE_GETTIMEOFDAY 526#undef HAVE_GETTIMEOFDAY
476 527
477/* Define to 1 if you have the `getttyent' function. */ 528/* Define if you have the `getttyent' function. */
478#undef HAVE_GETTTYENT 529#undef HAVE_GETTTYENT
479 530
480/* Define to 1 if you have the `getutent' function. */ 531/* Define if you have the `getutent' function. */
481#undef HAVE_GETUTENT 532#undef HAVE_GETUTENT
482 533
483/* Define to 1 if you have the `getutid' function. */ 534/* Define if you have the `getutid' function. */
484#undef HAVE_GETUTID 535#undef HAVE_GETUTID
485 536
486/* Define to 1 if you have the `getutline' function. */ 537/* Define if you have the `getutline' function. */
487#undef HAVE_GETUTLINE 538#undef HAVE_GETUTLINE
488 539
489/* Define to 1 if you have the `getutxent' function. */ 540/* Define if you have the `getutxent' function. */
490#undef HAVE_GETUTXENT 541#undef HAVE_GETUTXENT
491 542
492/* Define to 1 if you have the `getutxid' function. */ 543/* Define if you have the `getutxid' function. */
493#undef HAVE_GETUTXID 544#undef HAVE_GETUTXID
494 545
495/* Define to 1 if you have the `getutxline' function. */ 546/* Define if you have the `getutxline' function. */
496#undef HAVE_GETUTXLINE 547#undef HAVE_GETUTXLINE
497 548
498/* Define to 1 if you have the `glob' function. */ 549/* Define if you have the `glob' function. */
499#undef HAVE_GLOB 550#undef HAVE_GLOB
500 551
501/* Define to 1 if you have the <glob.h> header file. */ 552/* Define if you have the <glob.h> header file. */
502#undef HAVE_GLOB_H 553#undef HAVE_GLOB_H
503 554
504/* Define to 1 if you have the <ia.h> header file. */ 555/* Define if you have the <gssapi.h> header file. */
556#undef HAVE_GSSAPI_H
557
558/* Define if you have the <ia.h> header file. */
505#undef HAVE_IA_H 559#undef HAVE_IA_H
506 560
507/* Define to 1 if you have the `inet_aton' function. */ 561/* Define if you have the `inet_aton' function. */
508#undef HAVE_INET_ATON 562#undef HAVE_INET_ATON
509 563
510/* Define to 1 if you have the `inet_ntoa' function. */ 564/* Define if you have the `inet_ntoa' function. */
511#undef HAVE_INET_NTOA 565#undef HAVE_INET_NTOA
512 566
513/* Define to 1 if you have the `inet_ntop' function. */ 567/* Define if you have the `inet_ntop' function. */
514#undef HAVE_INET_NTOP 568#undef HAVE_INET_NTOP
515 569
516/* Define to 1 if you have the `innetgr' function. */ 570/* Define if you have the `innetgr' function. */
517#undef HAVE_INNETGR 571#undef HAVE_INNETGR
518 572
519/* Define to 1 if you have the <inttypes.h> header file. */ 573/* Define if you have the <inttypes.h> header file. */
520#undef HAVE_INTTYPES_H 574#undef HAVE_INTTYPES_H
521 575
522/* Define to 1 if you have the <krb.h> header file. */ 576/* Define if you have the <lastlog.h> header file. */
523#undef HAVE_KRB_H
524
525/* Define to 1 if you have the <lastlog.h> header file. */
526#undef HAVE_LASTLOG_H 577#undef HAVE_LASTLOG_H
527 578
528/* Define to 1 if you have the `crypt' library (-lcrypt). */ 579/* Define if you have the `crypt' library (-lcrypt). */
529#undef HAVE_LIBCRYPT 580#undef HAVE_LIBCRYPT
530 581
531/* Define to 1 if you have the `des' library (-ldes). */ 582/* Define if you have the `dl' library (-ldl). */
532#undef HAVE_LIBDES
533
534/* Define to 1 if you have the `des425' library (-ldes425). */
535#undef HAVE_LIBDES425
536
537/* Define to 1 if you have the `dl' library (-ldl). */
538#undef HAVE_LIBDL 583#undef HAVE_LIBDL
539 584
540/* Define to 1 if you have the <libgen.h> header file. */ 585/* Define if you have the <libgen.h> header file. */
541#undef HAVE_LIBGEN_H 586#undef HAVE_LIBGEN_H
542 587
543/* Define to 1 if you have the `krb' library (-lkrb). */ 588/* Define if you have the `nsl' library (-lnsl). */
544#undef HAVE_LIBKRB
545
546/* Define to 1 if you have the `krb4' library (-lkrb4). */
547#undef HAVE_LIBKRB4
548
549/* Define to 1 if you have the `nsl' library (-lnsl). */
550#undef HAVE_LIBNSL 589#undef HAVE_LIBNSL
551 590
552/* Define to 1 if you have the `pam' library (-lpam). */ 591/* Define if you have the `pam' library (-lpam). */
553#undef HAVE_LIBPAM 592#undef HAVE_LIBPAM
554 593
555/* Define to 1 if you have the `resolv' library (-lresolv). */ 594/* Define if you have the `sectok' library (-lsectok). */
556#undef HAVE_LIBRESOLV
557
558/* Define to 1 if you have the `sectok' library (-lsectok). */
559#undef HAVE_LIBSECTOK 595#undef HAVE_LIBSECTOK
560 596
561/* Define to 1 if you have the `socket' library (-lsocket). */ 597/* Define if you have the `socket' library (-lsocket). */
562#undef HAVE_LIBSOCKET 598#undef HAVE_LIBSOCKET
563 599
564/* Define to 1 if you have the <libutil.h> header file. */ 600/* Define if you have the <libutil.h> header file. */
565#undef HAVE_LIBUTIL_H 601#undef HAVE_LIBUTIL_H
566 602
567/* Define to 1 if you have the `xnet' library (-lxnet). */ 603/* Define if you have the `xnet' library (-lxnet). */
568#undef HAVE_LIBXNET 604#undef HAVE_LIBXNET
569 605
570/* Define to 1 if you have the `z' library (-lz). */ 606/* Define if you have the `z' library (-lz). */
571#undef HAVE_LIBZ 607#undef HAVE_LIBZ
572 608
573/* Define to 1 if you have the <limits.h> header file. */ 609/* Define if you have the <limits.h> header file. */
574#undef HAVE_LIMITS_H 610#undef HAVE_LIMITS_H
575 611
576/* Define to 1 if you have the <login_cap.h> header file. */ 612/* Define if you have the <login_cap.h> header file. */
577#undef HAVE_LOGIN_CAP_H 613#undef HAVE_LOGIN_CAP_H
578 614
579/* Define to 1 if you have the `login_getcapbool' function. */ 615/* Define if you have the `login_getcapbool' function. */
580#undef HAVE_LOGIN_GETCAPBOOL 616#undef HAVE_LOGIN_GETCAPBOOL
581 617
582/* Define to 1 if you have the <login.h> header file. */ 618/* Define if you have the <login.h> header file. */
583#undef HAVE_LOGIN_H 619#undef HAVE_LOGIN_H
584 620
585/* Define to 1 if you have the `logout' function. */ 621/* Define if you have the `logout' function. */
586#undef HAVE_LOGOUT 622#undef HAVE_LOGOUT
587 623
588/* Define to 1 if you have the `logwtmp' function. */ 624/* Define if you have the `logwtmp' function. */
589#undef HAVE_LOGWTMP 625#undef HAVE_LOGWTMP
590 626
591/* Define to 1 if you have the <maillock.h> header file. */ 627/* Define if you have the <maillock.h> header file. */
592#undef HAVE_MAILLOCK_H 628#undef HAVE_MAILLOCK_H
593 629
594/* Define to 1 if you have the `md5_crypt' function. */ 630/* Define if you have the `md5_crypt' function. */
595#undef HAVE_MD5_CRYPT 631#undef HAVE_MD5_CRYPT
596 632
597/* Define to 1 if you have the `memmove' function. */ 633/* Define if you have the `memmove' function. */
598#undef HAVE_MEMMOVE 634#undef HAVE_MEMMOVE
599 635
600/* Define to 1 if you have the <memory.h> header file. */ 636/* Define if you have the <memory.h> header file. */
601#undef HAVE_MEMORY_H 637#undef HAVE_MEMORY_H
602 638
603/* Define to 1 if you have the `mkdtemp' function. */ 639/* Define if you have the `mkdtemp' function. */
604#undef HAVE_MKDTEMP 640#undef HAVE_MKDTEMP
605 641
606/* Define to 1 if you have the `mmap' function. */ 642/* Define if you have the `mmap' function. */
607#undef HAVE_MMAP 643#undef HAVE_MMAP
608 644
609/* Define to 1 if you have the <netdb.h> header file. */ 645/* Define if you have the <netdb.h> header file. */
610#undef HAVE_NETDB_H 646#undef HAVE_NETDB_H
611 647
612/* Define to 1 if you have the <netgroup.h> header file. */ 648/* Define if you have the <netgroup.h> header file. */
613#undef HAVE_NETGROUP_H 649#undef HAVE_NETGROUP_H
614 650
615/* Define to 1 if you have the <netinet/in_systm.h> header file. */ 651/* Define if you have the <netinet/in_systm.h> header file. */
616#undef HAVE_NETINET_IN_SYSTM_H 652#undef HAVE_NETINET_IN_SYSTM_H
617 653
618/* Define to 1 if you have the `ngetaddrinfo' function. */ 654/* Define if you have the `ngetaddrinfo' function. */
619#undef HAVE_NGETADDRINFO 655#undef HAVE_NGETADDRINFO
620 656
621/* Define to 1 if you have the `nsleep' function. */ 657/* Define if you have the `nsleep' function. */
622#undef HAVE_NSLEEP 658#undef HAVE_NSLEEP
623 659
624/* Define to 1 if you have the `ogetaddrinfo' function. */ 660/* Define if you have the `ogetaddrinfo' function. */
625#undef HAVE_OGETADDRINFO 661#undef HAVE_OGETADDRINFO
626 662
627/* Define to 1 if you have the `openpty' function. */ 663/* Define if you have the `openlog_r' function. */
664#undef HAVE_OPENLOG_R
665
666/* Define if you have the `openpty' function. */
628#undef HAVE_OPENPTY 667#undef HAVE_OPENPTY
629 668
630/* Define to 1 if you have the `pam_getenvlist' function. */ 669/* Define if you have the `pam_getenvlist' function. */
631#undef HAVE_PAM_GETENVLIST 670#undef HAVE_PAM_GETENVLIST
632 671
633/* Define to 1 if you have the <paths.h> header file. */ 672/* Define if you have the `pam_putenv' function. */
673#undef HAVE_PAM_PUTENV
674
675/* Define if you have the <paths.h> header file. */
634#undef HAVE_PATHS_H 676#undef HAVE_PATHS_H
635 677
636/* Define to 1 if you have the `pstat' function. */ 678/* Define if you have the `pstat' function. */
637#undef HAVE_PSTAT 679#undef HAVE_PSTAT
638 680
639/* Define to 1 if you have the <pty.h> header file. */ 681/* Define if you have the <pty.h> header file. */
640#undef HAVE_PTY_H 682#undef HAVE_PTY_H
641 683
642/* Define to 1 if you have the `pututline' function. */ 684/* Define if you have the `pututline' function. */
643#undef HAVE_PUTUTLINE 685#undef HAVE_PUTUTLINE
644 686
645/* Define to 1 if you have the `pututxline' function. */ 687/* Define if you have the `pututxline' function. */
646#undef HAVE_PUTUTXLINE 688#undef HAVE_PUTUTXLINE
647 689
648/* Define to 1 if you have the `readpassphrase' function. */ 690/* Define if you have the `readpassphrase' function. */
649#undef HAVE_READPASSPHRASE 691#undef HAVE_READPASSPHRASE
650 692
651/* Define to 1 if you have the <readpassphrase.h> header file. */ 693/* Define if you have the <readpassphrase.h> header file. */
652#undef HAVE_READPASSPHRASE_H 694#undef HAVE_READPASSPHRASE_H
653 695
654/* Define to 1 if you have the `realpath' function. */ 696/* Define if you have the `realpath' function. */
655#undef HAVE_REALPATH 697#undef HAVE_REALPATH
656 698
657/* Define to 1 if you have the `recvmsg' function. */ 699/* Define if you have the `recvmsg' function. */
658#undef HAVE_RECVMSG 700#undef HAVE_RECVMSG
659 701
660/* Define to 1 if you have the <rpc/types.h> header file. */ 702/* Define if you have the <rpc/types.h> header file. */
661#undef HAVE_RPC_TYPES_H 703#undef HAVE_RPC_TYPES_H
662 704
663/* Define to 1 if you have the `rresvport_af' function. */ 705/* Define if you have the `rresvport_af' function. */
664#undef HAVE_RRESVPORT_AF 706#undef HAVE_RRESVPORT_AF
665 707
666/* Define to 1 if you have the <sectok.h> header file. */ 708/* Define if you have the <sectok.h> header file. */
667#undef HAVE_SECTOK_H 709#undef HAVE_SECTOK_H
668 710
669/* Define to 1 if you have the <security/pam_appl.h> header file. */ 711/* Define if you have the <security/pam_appl.h> header file. */
670#undef HAVE_SECURITY_PAM_APPL_H 712#undef HAVE_SECURITY_PAM_APPL_H
671 713
672/* Define to 1 if you have the `sendmsg' function. */ 714/* Define if you have the `sendmsg' function. */
673#undef HAVE_SENDMSG 715#undef HAVE_SENDMSG
674 716
675/* Define to 1 if you have the `setdtablesize' function. */ 717/* Define if you have the `setauthdb' function. */
718#undef HAVE_SETAUTHDB
719
720/* Define if you have the `setdtablesize' function. */
676#undef HAVE_SETDTABLESIZE 721#undef HAVE_SETDTABLESIZE
677 722
678/* Define to 1 if you have the `setegid' function. */ 723/* Define if you have the `setegid' function. */
679#undef HAVE_SETEGID 724#undef HAVE_SETEGID
680 725
681/* Define to 1 if you have the `setenv' function. */ 726/* Define if you have the `setenv' function. */
682#undef HAVE_SETENV 727#undef HAVE_SETENV
683 728
684/* Define to 1 if you have the `seteuid' function. */ 729/* Define if you have the `seteuid' function. */
685#undef HAVE_SETEUID 730#undef HAVE_SETEUID
686 731
687/* Define to 1 if you have the `setgroups' function. */ 732/* Define if you have the `setgroups' function. */
688#undef HAVE_SETGROUPS 733#undef HAVE_SETGROUPS
689 734
690/* Define to 1 if you have the `setlogin' function. */ 735/* Define if you have the `setlogin' function. */
691#undef HAVE_SETLOGIN 736#undef HAVE_SETLOGIN
692 737
693/* Define to 1 if you have the `setluid' function. */ 738/* Define if you have the `setluid' function. */
694#undef HAVE_SETLUID 739#undef HAVE_SETLUID
695 740
696/* Define to 1 if you have the `setpcred' function. */ 741/* Define if you have the `setpcred' function. */
697#undef HAVE_SETPCRED 742#undef HAVE_SETPCRED
698 743
699/* Define to 1 if you have the `setproctitle' function. */ 744/* Define if you have the `setproctitle' function. */
700#undef HAVE_SETPROCTITLE 745#undef HAVE_SETPROCTITLE
701 746
702/* Define to 1 if you have the `setresgid' function. */ 747/* Define if you have the `setregid' function. */
748#undef HAVE_SETREGID
749
750/* Define if you have the `setresgid' function. */
703#undef HAVE_SETRESGID 751#undef HAVE_SETRESGID
704 752
705/* Define to 1 if you have the `setreuid' function. */ 753/* Define if you have the `setresuid' function. */
754#undef HAVE_SETRESUID
755
756/* Define if you have the `setreuid' function. */
706#undef HAVE_SETREUID 757#undef HAVE_SETREUID
707 758
708/* Define to 1 if you have the `setrlimit' function. */ 759/* Define if you have the `setrlimit' function. */
709#undef HAVE_SETRLIMIT 760#undef HAVE_SETRLIMIT
710 761
711/* Define to 1 if you have the `setsid' function. */ 762/* Define if you have the `setsid' function. */
712#undef HAVE_SETSID 763#undef HAVE_SETSID
713 764
714/* Define to 1 if you have the `setutent' function. */ 765/* Define if you have the `setutent' function. */
715#undef HAVE_SETUTENT 766#undef HAVE_SETUTENT
716 767
717/* Define to 1 if you have the `setutxent' function. */ 768/* Define if you have the `setutxent' function. */
718#undef HAVE_SETUTXENT 769#undef HAVE_SETUTXENT
719 770
720/* Define to 1 if you have the `setvbuf' function. */ 771/* Define if you have the `setvbuf' function. */
721#undef HAVE_SETVBUF 772#undef HAVE_SETVBUF
722 773
723/* Define to 1 if you have the <shadow.h> header file. */ 774/* Define if you have the <shadow.h> header file. */
724#undef HAVE_SHADOW_H 775#undef HAVE_SHADOW_H
725 776
726/* Define to 1 if you have the `sigaction' function. */ 777/* Define if you have the `sigaction' function. */
727#undef HAVE_SIGACTION 778#undef HAVE_SIGACTION
728 779
729/* Define to 1 if you have the `sigvec' function. */ 780/* Define if you have the `sigvec' function. */
730#undef HAVE_SIGVEC 781#undef HAVE_SIGVEC
731 782
732/* Define to 1 if the system has the type `sig_atomic_t'. */ 783/* Define if the system has the type `sig_atomic_t'. */
733#undef HAVE_SIG_ATOMIC_T 784#undef HAVE_SIG_ATOMIC_T
734 785
735/* Define to 1 if you have the `snprintf' function. */ 786/* Define if you have the `snprintf' function. */
736#undef HAVE_SNPRINTF 787#undef HAVE_SNPRINTF
737 788
738/* Define to 1 if you have the `socketpair' function. */ 789/* Define if you have the `socketpair' function. */
739#undef HAVE_SOCKETPAIR 790#undef HAVE_SOCKETPAIR
740 791
741/* Define to 1 if you have the <stddef.h> header file. */ 792/* Define if you have the <stddef.h> header file. */
742#undef HAVE_STDDEF_H 793#undef HAVE_STDDEF_H
743 794
744/* Define to 1 if you have the <stdint.h> header file. */ 795/* Define if you have the <stdint.h> header file. */
745#undef HAVE_STDINT_H 796#undef HAVE_STDINT_H
746 797
747/* Define to 1 if you have the <stdlib.h> header file. */ 798/* Define if you have the <stdlib.h> header file. */
748#undef HAVE_STDLIB_H 799#undef HAVE_STDLIB_H
749 800
750/* Define to 1 if you have the `strerror' function. */ 801/* Define if you have the `strerror' function. */
751#undef HAVE_STRERROR 802#undef HAVE_STRERROR
752 803
753/* Define to 1 if you have the `strftime' function. */ 804/* Define if you have the `strftime' function. */
754#undef HAVE_STRFTIME 805#undef HAVE_STRFTIME
755 806
756/* Define to 1 if you have the <strings.h> header file. */ 807/* Define if you have the <strings.h> header file. */
757#undef HAVE_STRINGS_H 808#undef HAVE_STRINGS_H
758 809
759/* Define to 1 if you have the <string.h> header file. */ 810/* Define if you have the <string.h> header file. */
760#undef HAVE_STRING_H 811#undef HAVE_STRING_H
761 812
762/* Define to 1 if you have the `strlcat' function. */ 813/* Define if you have the `strlcat' function. */
763#undef HAVE_STRLCAT 814#undef HAVE_STRLCAT
764 815
765/* Define to 1 if you have the `strlcpy' function. */ 816/* Define if you have the `strlcpy' function. */
766#undef HAVE_STRLCPY 817#undef HAVE_STRLCPY
767 818
768/* Define to 1 if you have the `strmode' function. */ 819/* Define if you have the `strmode' function. */
769#undef HAVE_STRMODE 820#undef HAVE_STRMODE
770 821
771/* Define to 1 if you have the `strnvis' function. */ 822/* Define if you have the `strnvis' function. */
772#undef HAVE_STRNVIS 823#undef HAVE_STRNVIS
773 824
774/* Define to 1 if you have the `strsep' function. */ 825/* Define if you have the `strsep' function. */
775#undef HAVE_STRSEP 826#undef HAVE_STRSEP
776 827
777/* Define to 1 if `st_blksize' is member of `struct stat'. */ 828/* Define if `st_blksize' is member of `struct stat'. */
778#undef HAVE_STRUCT_STAT_ST_BLKSIZE 829#undef HAVE_STRUCT_STAT_ST_BLKSIZE
779 830
780/* Define to 1 if the system has the type `struct timespec'. */ 831/* Define if the system has the type `struct timespec'. */
781#undef HAVE_STRUCT_TIMESPEC 832#undef HAVE_STRUCT_TIMESPEC
782 833
783/* Define to 1 if you have the `sysconf' function. */ 834/* Define if you have the `sysconf' function. */
784#undef HAVE_SYSCONF 835#undef HAVE_SYSCONF
785 836
786/* Define to 1 if you have the <sys/bitypes.h> header file. */ 837/* Define if you have the <sys/audit.h> header file. */
838#undef HAVE_SYS_AUDIT_H
839
840/* Define if you have the <sys/bitypes.h> header file. */
787#undef HAVE_SYS_BITYPES_H 841#undef HAVE_SYS_BITYPES_H
788 842
789/* Define to 1 if you have the <sys/bsdtty.h> header file. */ 843/* Define if you have the <sys/bsdtty.h> header file. */
790#undef HAVE_SYS_BSDTTY_H 844#undef HAVE_SYS_BSDTTY_H
791 845
792/* Define to 1 if you have the <sys/cdefs.h> header file. */ 846/* Define if you have the <sys/cdefs.h> header file. */
793#undef HAVE_SYS_CDEFS_H 847#undef HAVE_SYS_CDEFS_H
794 848
795/* Define to 1 if you have the <sys/mman.h> header file. */ 849/* Define if you have the <sys/mman.h> header file. */
796#undef HAVE_SYS_MMAN_H 850#undef HAVE_SYS_MMAN_H
797 851
798/* Define to 1 if you have the <sys/pstat.h> header file. */ 852/* Define if you have the <sys/pstat.h> header file. */
799#undef HAVE_SYS_PSTAT_H 853#undef HAVE_SYS_PSTAT_H
800 854
801/* Define to 1 if you have the <sys/select.h> header file. */ 855/* Define if you have the <sys/select.h> header file. */
802#undef HAVE_SYS_SELECT_H 856#undef HAVE_SYS_SELECT_H
803 857
804/* Define to 1 if you have the <sys/stat.h> header file. */ 858/* Define if you have the <sys/stat.h> header file. */
805#undef HAVE_SYS_STAT_H 859#undef HAVE_SYS_STAT_H
806 860
807/* Define to 1 if you have the <sys/stropts.h> header file. */ 861/* Define if you have the <sys/stropts.h> header file. */
808#undef HAVE_SYS_STROPTS_H 862#undef HAVE_SYS_STROPTS_H
809 863
810/* Define to 1 if you have the <sys/sysmacros.h> header file. */ 864/* Define if you have the <sys/strtio.h> header file. */
865#undef HAVE_SYS_STRTIO_H
866
867/* Define if you have the <sys/sysmacros.h> header file. */
811#undef HAVE_SYS_SYSMACROS_H 868#undef HAVE_SYS_SYSMACROS_H
812 869
813/* Define to 1 if you have the <sys/timers.h> header file. */ 870/* Define if you have the <sys/timers.h> header file. */
814#undef HAVE_SYS_TIMERS_H 871#undef HAVE_SYS_TIMERS_H
815 872
816/* Define to 1 if you have the <sys/time.h> header file. */ 873/* Define if you have the <sys/time.h> header file. */
817#undef HAVE_SYS_TIME_H 874#undef HAVE_SYS_TIME_H
818 875
819/* Define to 1 if you have the <sys/types.h> header file. */ 876/* Define if you have the <sys/types.h> header file. */
820#undef HAVE_SYS_TYPES_H 877#undef HAVE_SYS_TYPES_H
821 878
822/* Define to 1 if you have the <sys/un.h> header file. */ 879/* Define if you have the <sys/un.h> header file. */
823#undef HAVE_SYS_UN_H 880#undef HAVE_SYS_UN_H
824 881
825/* Define to 1 if you have the `tcgetpgrp' function. */ 882/* Define if you have the `tcgetpgrp' function. */
826#undef HAVE_TCGETPGRP 883#undef HAVE_TCGETPGRP
827 884
828/* Define to 1 if you have the `time' function. */ 885/* Define if you have the `tcsendbreak' function. */
886#undef HAVE_TCSENDBREAK
887
888/* Define if you have the `time' function. */
829#undef HAVE_TIME 889#undef HAVE_TIME
830 890
831/* Define to 1 if you have the <time.h> header file. */ 891/* Define if you have the <time.h> header file. */
832#undef HAVE_TIME_H 892#undef HAVE_TIME_H
833 893
834/* Define to 1 if you have the <tmpdir.h> header file. */ 894/* Define if you have the <tmpdir.h> header file. */
835#undef HAVE_TMPDIR_H 895#undef HAVE_TMPDIR_H
836 896
837/* Define to 1 if you have the `truncate' function. */ 897/* Define if you have the `truncate' function. */
838#undef HAVE_TRUNCATE 898#undef HAVE_TRUNCATE
839 899
840/* Define to 1 if you have the <ttyent.h> header file. */ 900/* Define if you have the <ttyent.h> header file. */
841#undef HAVE_TTYENT_H 901#undef HAVE_TTYENT_H
842 902
843/* Define to 1 if you have the <unistd.h> header file. */ 903/* Define if you have the <unistd.h> header file. */
844#undef HAVE_UNISTD_H 904#undef HAVE_UNISTD_H
845 905
846/* Define to 1 if you have the `updwtmp' function. */ 906/* Define if you have the `updwtmp' function. */
847#undef HAVE_UPDWTMP 907#undef HAVE_UPDWTMP
848 908
849/* Define to 1 if you have the <usersec.h> header file. */ 909/* Define if you have the <usersec.h> header file. */
850#undef HAVE_USERSEC_H 910#undef HAVE_USERSEC_H
851 911
852/* Define to 1 if you have the <util.h> header file. */ 912/* Define if you have the <util.h> header file. */
853#undef HAVE_UTIL_H 913#undef HAVE_UTIL_H
854 914
855/* Define to 1 if you have the `utimes' function. */ 915/* Define if you have the `utimes' function. */
856#undef HAVE_UTIMES 916#undef HAVE_UTIMES
857 917
858/* Define to 1 if you have the <utime.h> header file. */ 918/* Define if you have the <utime.h> header file. */
859#undef HAVE_UTIME_H 919#undef HAVE_UTIME_H
860 920
861/* Define to 1 if you have the `utmpname' function. */ 921/* Define if you have the `utmpname' function. */
862#undef HAVE_UTMPNAME 922#undef HAVE_UTMPNAME
863 923
864/* Define to 1 if you have the `utmpxname' function. */ 924/* Define if you have the `utmpxname' function. */
865#undef HAVE_UTMPXNAME 925#undef HAVE_UTMPXNAME
866 926
867/* Define to 1 if you have the <utmpx.h> header file. */ 927/* Define if you have the <utmpx.h> header file. */
868#undef HAVE_UTMPX_H 928#undef HAVE_UTMPX_H
869 929
870/* Define to 1 if you have the <utmp.h> header file. */ 930/* Define if you have the <utmp.h> header file. */
871#undef HAVE_UTMP_H 931#undef HAVE_UTMP_H
872 932
873/* Define to 1 if you have the `vhangup' function. */ 933/* Define if you have the `vhangup' function. */
874#undef HAVE_VHANGUP 934#undef HAVE_VHANGUP
875 935
876/* Define to 1 if you have the `vsnprintf' function. */ 936/* Define if you have the `vsnprintf' function. */
877#undef HAVE_VSNPRINTF 937#undef HAVE_VSNPRINTF
878 938
879/* Define to 1 if you have the `waitpid' function. */ 939/* Define if you have the `waitpid' function. */
880#undef HAVE_WAITPID 940#undef HAVE_WAITPID
881 941
882/* Define to 1 if you have the `_getpty' function. */ 942/* Define if you have the `_getlong' function. */
943#undef HAVE__GETLONG
944
945/* Define if you have the `_getpty' function. */
883#undef HAVE__GETPTY 946#undef HAVE__GETPTY
884 947
885/* Define to 1 if you have the `__b64_ntop' function. */ 948/* Define if you have the `_getshort' function. */
949#undef HAVE__GETSHORT
950
951/* Define if you have the `__b64_ntop' function. */
886#undef HAVE___B64_NTOP 952#undef HAVE___B64_NTOP
887 953
888/* Define to 1 if you have the `__b64_pton' function. */ 954/* Define if you have the `__b64_pton' function. */
889#undef HAVE___B64_PTON 955#undef HAVE___B64_PTON
890 956
891/* Define to the address where bug reports for this package should be sent. */
892#undef PACKAGE_BUGREPORT
893
894/* Define to the full name of this package. */
895#undef PACKAGE_NAME
896
897/* Define to the full name and version of this package. */
898#undef PACKAGE_STRING
899
900/* Define to the one symbol short name of this package. */
901#undef PACKAGE_TARNAME
902
903/* Define to the version of this package. */
904#undef PACKAGE_VERSION
905
906/* The size of a `char', as computed by sizeof. */ 957/* The size of a `char', as computed by sizeof. */
907#undef SIZEOF_CHAR 958#undef SIZEOF_CHAR
908 959
@@ -918,11 +969,11 @@
918/* The size of a `short int', as computed by sizeof. */ 969/* The size of a `short int', as computed by sizeof. */
919#undef SIZEOF_SHORT_INT 970#undef SIZEOF_SHORT_INT
920 971
921/* Define to 1 if you have the ANSI C header files. */ 972/* Define if you have the ANSI C header files. */
922#undef STDC_HEADERS 973#undef STDC_HEADERS
923 974
924/* Define to 1 if your processor stores words with the most significant byte 975/* Define if your processor stores words with the most significant byte first
925 first (like Motorola and SPARC, unlike Intel and VAX). */ 976 (like Motorola and SPARC, unlike Intel and VAX). */
926#undef WORDS_BIGENDIAN 977#undef WORDS_BIGENDIAN
927 978
928/* Number of bits in a file offset, on hosts where this is settable. */ 979/* Number of bits in a file offset, on hosts where this is settable. */
diff --git a/configure b/configure
index ceeb5b013..096c51af7 100755
--- a/configure
+++ b/configure
@@ -1,81 +1,12 @@
1#! /bin/sh 1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles. 2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.57. 3# Generated by Autoconf 2.52.
4# 4#
5# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 5# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6# Free Software Foundation, Inc. 6# Free Software Foundation, Inc.
7# This configure script is free software; the Free Software Foundation 7# This configure script is free software; the Free Software Foundation
8# gives unlimited permission to copy, distribute and modify it. 8# gives unlimited permission to copy, distribute and modify it.
9## --------------------- ##
10## M4sh Initialization. ##
11## --------------------- ##
12 9
13# Be Bourne compatible
14if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
15 emulate sh
16 NULLCMD=:
17 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
18 # is contrary to our usage. Disable this feature.
19 alias -g '${1+"$@"}'='"$@"'
20elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
21 set -o posix
22fi
23
24# Support unset when possible.
25if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
26 as_unset=unset
27else
28 as_unset=false
29fi
30
31
32# Work around bugs in pre-3.0 UWIN ksh.
33$as_unset ENV MAIL MAILPATH
34PS1='$ '
35PS2='> '
36PS4='+ '
37
38# NLS nuisances.
39for as_var in \
40 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
41 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
42 LC_TELEPHONE LC_TIME
43do
44 if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
45 eval $as_var=C; export $as_var
46 else
47 $as_unset $as_var
48 fi
49done
50
51# Required to use basename.
52if expr a : '\(a\)' >/dev/null 2>&1; then
53 as_expr=expr
54else
55 as_expr=false
56fi
57
58if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
59 as_basename=basename
60else
61 as_basename=false
62fi
63
64
65# Name of the executable.
66as_me=`$as_basename "$0" ||
67$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
68 X"$0" : 'X\(//\)$' \| \
69 X"$0" : 'X\(/\)$' \| \
70 . : '\(.\)' 2>/dev/null ||
71echo X/"$0" |
72 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
73 /^X\/\(\/\/\)$/{ s//\1/; q; }
74 /^X\/\(\/\).*/{ s//\1/; q; }
75 s/.*/./; q'`
76
77
78# PATH needs CR, and LINENO needs CR and PATH.
79# Avoid depending upon Character Ranges. 10# Avoid depending upon Character Ranges.
80as_cr_letters='abcdefghijklmnopqrstuvwxyz' 11as_cr_letters='abcdefghijklmnopqrstuvwxyz'
81as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' 12as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
@@ -83,113 +14,22 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
83as_cr_digits='0123456789' 14as_cr_digits='0123456789'
84as_cr_alnum=$as_cr_Letters$as_cr_digits 15as_cr_alnum=$as_cr_Letters$as_cr_digits
85 16
86# The user is always right. 17# Sed expression to map a string onto a valid variable name.
87if test "${PATH_SEPARATOR+set}" != set; then 18as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
88 echo "#! /bin/sh" >conf$$.sh
89 echo "exit 0" >>conf$$.sh
90 chmod +x conf$$.sh
91 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
92 PATH_SEPARATOR=';'
93 else
94 PATH_SEPARATOR=:
95 fi
96 rm -f conf$$.sh
97fi
98
99
100 as_lineno_1=$LINENO
101 as_lineno_2=$LINENO
102 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
103 test "x$as_lineno_1" != "x$as_lineno_2" &&
104 test "x$as_lineno_3" = "x$as_lineno_2" || {
105 # Find who we are. Look in the path if we contain no path at all
106 # relative or not.
107 case $0 in
108 *[\\/]* ) as_myself=$0 ;;
109 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
110for as_dir in $PATH
111do
112 IFS=$as_save_IFS
113 test -z "$as_dir" && as_dir=.
114 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
115done
116
117 ;;
118 esac
119 # We did not find ourselves, most probably we were run as `sh COMMAND'
120 # in which case we are not to be found in the path.
121 if test "x$as_myself" = x; then
122 as_myself=$0
123 fi
124 if test ! -f "$as_myself"; then
125 { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
126 { (exit 1); exit 1; }; }
127 fi
128 case $CONFIG_SHELL in
129 '')
130 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
131for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
132do
133 IFS=$as_save_IFS
134 test -z "$as_dir" && as_dir=.
135 for as_base in sh bash ksh sh5; do
136 case $as_dir in
137 /*)
138 if ("$as_dir/$as_base" -c '
139 as_lineno_1=$LINENO
140 as_lineno_2=$LINENO
141 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
142 test "x$as_lineno_1" != "x$as_lineno_2" &&
143 test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
144 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
145 $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
146 CONFIG_SHELL=$as_dir/$as_base
147 export CONFIG_SHELL
148 exec "$CONFIG_SHELL" "$0" ${1+"$@"}
149 fi;;
150 esac
151 done
152done
153;;
154 esac
155
156 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
157 # uniformly replaced by the line number. The first 'sed' inserts a
158 # line-number line before each line; the second 'sed' does the real
159 # work. The second script uses 'N' to pair each line-number line
160 # with the numbered line, and appends trailing '-' during
161 # substitution so that $LINENO is not a special case at line end.
162 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
163 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
164 sed '=' <$as_myself |
165 sed '
166 N
167 s,$,-,
168 : loop
169 s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
170 t loop
171 s,-$,,
172 s,^['$as_cr_digits']*\n,,
173 ' >$as_me.lineno &&
174 chmod +x $as_me.lineno ||
175 { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
176 { (exit 1); exit 1; }; }
177 19
178 # Don't try to exec as it changes $[0], causing all sort of problems 20# Sed expression to map a string onto a valid CPP name.
179 # (the dirname of $[0] is not the place where we might find the 21as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
180 # original and so on. Autoconf is especially sensible to this).
181 . ./$as_me.lineno
182 # Exit status is that of the last command.
183 exit
184}
185 22
23# Be Bourne compatible
24if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25 emulate sh
26 NULLCMD=:
27elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28 set -o posix
29fi
186 30
187case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in 31# Name of the executable.
188 *c*,-n*) ECHO_N= ECHO_C=' 32as_me=`echo "$0" |sed 's,.*[\\/],,'`
189' ECHO_T=' ' ;;
190 *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
191 *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
192esac
193 33
194if expr a : '\(a\)' >/dev/null 2>&1; then 34if expr a : '\(a\)' >/dev/null 2>&1; then
195 as_expr=expr 35 as_expr=expr
@@ -215,20 +55,24 @@ else
215fi 55fi
216rm -f conf$$ conf$$.exe conf$$.file 56rm -f conf$$ conf$$.exe conf$$.file
217 57
218if mkdir -p . 2>/dev/null; then
219 as_mkdir_p=:
220else
221 as_mkdir_p=false
222fi
223
224as_executable_p="test -f" 58as_executable_p="test -f"
225 59
226# Sed expression to map a string onto a valid CPP name. 60# Support unset when possible.
227as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" 61if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
228 62 as_unset=unset
229# Sed expression to map a string onto a valid variable name. 63else
230as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" 64 as_unset=false
65fi
231 66
67# NLS nuisances.
68$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
232 76
233# IFS 77# IFS
234# We need space, tab and new line, in precisely that order. 78# We need space, tab and new line, in precisely that order.
@@ -237,8 +81,7 @@ as_nl='
237IFS=" $as_nl" 81IFS=" $as_nl"
238 82
239# CDPATH. 83# CDPATH.
240$as_unset CDPATH 84$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
241
242 85
243# Name of the host. 86# Name of the host.
244# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, 87# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
@@ -251,11 +94,9 @@ exec 6>&1
251# Initializations. 94# Initializations.
252# 95#
253ac_default_prefix=/usr/local 96ac_default_prefix=/usr/local
254ac_config_libobj_dir=.
255cross_compiling=no 97cross_compiling=no
256subdirs= 98subdirs=
257MFLAGS= 99MFLAGS= MAKEFLAGS=
258MAKEFLAGS=
259SHELL=${CONFIG_SHELL-/bin/sh} 100SHELL=${CONFIG_SHELL-/bin/sh}
260 101
261# Maximum number of lines to put in a shell here document. 102# Maximum number of lines to put in a shell here document.
@@ -263,13 +104,6 @@ SHELL=${CONFIG_SHELL-/bin/sh}
263# only ac_max_sed_lines should be used. 104# only ac_max_sed_lines should be used.
264: ${ac_max_here_lines=38} 105: ${ac_max_here_lines=38}
265 106
266# Identity of this package.
267PACKAGE_NAME=
268PACKAGE_TARNAME=
269PACKAGE_VERSION=
270PACKAGE_STRING=
271PACKAGE_BUGREPORT=
272
273ac_unique_file="ssh.c" 107ac_unique_file="ssh.c"
274# Factoring default headers for most tests. 108# Factoring default headers for most tests.
275ac_includes_default="\ 109ac_includes_default="\
@@ -308,9 +142,6 @@ ac_includes_default="\
308# include <unistd.h> 142# include <unistd.h>
309#endif" 143#endif"
310 144
311ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CPP RANLIB ac_ct_RANLIB INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AR PERL SED ENT TEST_MINUS_S_SH SH LOGIN_PROGRAM_FALLBACK LD EGREP LIBWRAP LIBPAM INSTALL_SSH_RAND_HELPER SSH_PRIVSEP_USER PROG_LS PROG_NETSTAT PROG_ARP PROG_IFCONFIG PROG_JSTAT PROG_PS PROG_SAR PROG_W PROG_WHO PROG_LAST PROG_LASTLOG PROG_DF PROG_VMSTAT PROG_UPTIME PROG_IPCS PROG_TAIL INSTALL_SSH_PRNG_CMDS OPENSC_CONFIG PRIVSEP_PATH xauth_path STRIP_OPT XAUTH_PATH NROFF MANTYPE mansubdir user_path piddir LIBOBJS LTLIBOBJS'
312ac_subst_files=''
313
314# Initialize some variables set by options. 145# Initialize some variables set by options.
315ac_init_help= 146ac_init_help=
316ac_init_version=false 147ac_init_version=false
@@ -349,6 +180,13 @@ oldincludedir='/usr/include'
349infodir='${prefix}/info' 180infodir='${prefix}/info'
350mandir='${prefix}/man' 181mandir='${prefix}/man'
351 182
183# Identity of this package.
184PACKAGE_NAME=
185PACKAGE_TARNAME=
186PACKAGE_VERSION=
187PACKAGE_STRING=
188PACKAGE_BUGREPORT=
189
352ac_prev= 190ac_prev=
353for ac_option 191for ac_option
354do 192do
@@ -481,7 +319,7 @@ do
481 with_fp=no ;; 319 with_fp=no ;;
482 320
483 -no-create | --no-create | --no-creat | --no-crea | --no-cre \ 321 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
484 | --no-cr | --no-c | -n) 322 | --no-cr | --no-c)
485 no_create=yes ;; 323 no_create=yes ;;
486 324
487 -no-recursion | --no-recursion | --no-recursio | --no-recursi \ 325 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -660,7 +498,7 @@ do
660 eval ac_val=$`echo $ac_var` 498 eval ac_val=$`echo $ac_var`
661 case $ac_val in 499 case $ac_val in
662 [\\/$]* | ?:[\\/]* | NONE | '' ) ;; 500 [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
663 *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 501 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
664 { (exit 1); exit 1; }; };; 502 { (exit 1); exit 1; }; };;
665 esac 503 esac
666done 504done
@@ -672,19 +510,18 @@ do
672 eval ac_val=$`echo $ac_var` 510 eval ac_val=$`echo $ac_var`
673 case $ac_val in 511 case $ac_val in
674 [\\/$]* | ?:[\\/]* ) ;; 512 [\\/$]* | ?:[\\/]* ) ;;
675 *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 513 *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
676 { (exit 1); exit 1; }; };; 514 { (exit 1); exit 1; }; };;
677 esac 515 esac
678done 516done
679 517
680# There might be people who depend on the old broken behavior: `$host' 518# There might be people who depend on the old broken behavior: `$host'
681# used to hold the argument of --host etc. 519# used to hold the argument of --host etc.
682# FIXME: To remove some day.
683build=$build_alias 520build=$build_alias
684host=$host_alias 521host=$host_alias
685target=$target_alias 522target=$target_alias
686 523
687# FIXME: To remove some day. 524# FIXME: should be removed in autoconf 3.0.
688if test "x$host_alias" != x; then 525if test "x$host_alias" != x; then
689 if test "x$build_alias" = x; then 526 if test "x$build_alias" = x; then
690 cross_compiling=maybe 527 cross_compiling=maybe
@@ -700,23 +537,13 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
700 537
701test "$silent" = yes && exec 6>/dev/null 538test "$silent" = yes && exec 6>/dev/null
702 539
703
704# Find the source files, if location was not specified. 540# Find the source files, if location was not specified.
705if test -z "$srcdir"; then 541if test -z "$srcdir"; then
706 ac_srcdir_defaulted=yes 542 ac_srcdir_defaulted=yes
707 # Try the directory containing this script, then its parent. 543 # Try the directory containing this script, then its parent.
708 ac_confdir=`(dirname "$0") 2>/dev/null || 544 ac_prog=$0
709$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 545 ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
710 X"$0" : 'X\(//\)[^/]' \| \ 546 test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
711 X"$0" : 'X\(//\)$' \| \
712 X"$0" : 'X\(/\)' \| \
713 . : '\(.\)' 2>/dev/null ||
714echo X"$0" |
715 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
716 /^X\(\/\/\)[^/].*/{ s//\1/; q; }
717 /^X\(\/\/\)$/{ s//\1/; q; }
718 /^X\(\/\).*/{ s//\1/; q; }
719 s/.*/./; q'`
720 srcdir=$ac_confdir 547 srcdir=$ac_confdir
721 if test ! -r $srcdir/$ac_unique_file; then 548 if test ! -r $srcdir/$ac_unique_file; then
722 srcdir=.. 549 srcdir=..
@@ -726,16 +553,13 @@ else
726fi 553fi
727if test ! -r $srcdir/$ac_unique_file; then 554if test ! -r $srcdir/$ac_unique_file; then
728 if test "$ac_srcdir_defaulted" = yes; then 555 if test "$ac_srcdir_defaulted" = yes; then
729 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 556 { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
730 { (exit 1); exit 1; }; } 557 { (exit 1); exit 1; }; }
731 else 558 else
732 { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 559 { echo "$as_me: error: cannot find sources in $srcdir" >&2
733 { (exit 1); exit 1; }; } 560 { (exit 1); exit 1; }; }
734 fi 561 fi
735fi 562fi
736(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
737 { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
738 { (exit 1); exit 1; }; }
739srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` 563srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
740ac_env_build_alias_set=${build_alias+set} 564ac_env_build_alias_set=${build_alias+set}
741ac_env_build_alias_value=$build_alias 565ac_env_build_alias_value=$build_alias
@@ -776,7 +600,7 @@ ac_cv_env_CPP_value=$CPP
776if test "$ac_init_help" = "long"; then 600if test "$ac_init_help" = "long"; then
777 # Omit some internal or obsolete options to make the list less imposing. 601 # Omit some internal or obsolete options to make the list less imposing.
778 # This message is too long to be a string in the A/UX 3.1 sh. 602 # This message is too long to be a string in the A/UX 3.1 sh.
779 cat <<_ACEOF 603 cat <<EOF
780\`configure' configures this package to adapt to many kinds of systems. 604\`configure' configures this package to adapt to many kinds of systems.
781 605
782Usage: $0 [OPTION]... [VAR=VALUE]... 606Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -797,9 +621,9 @@ Configuration:
797 -n, --no-create do not create output files 621 -n, --no-create do not create output files
798 --srcdir=DIR find the sources in DIR [configure dir or \`..'] 622 --srcdir=DIR find the sources in DIR [configure dir or \`..']
799 623
800_ACEOF 624EOF
801 625
802 cat <<_ACEOF 626 cat <<EOF
803Installation directories: 627Installation directories:
804 --prefix=PREFIX install architecture-independent files in PREFIX 628 --prefix=PREFIX install architecture-independent files in PREFIX
805 [$ac_default_prefix] 629 [$ac_default_prefix]
@@ -826,19 +650,19 @@ Fine tuning of the installation directories:
826 --oldincludedir=DIR C header files for non-gcc [/usr/include] 650 --oldincludedir=DIR C header files for non-gcc [/usr/include]
827 --infodir=DIR info documentation [PREFIX/info] 651 --infodir=DIR info documentation [PREFIX/info]
828 --mandir=DIR man documentation [PREFIX/man] 652 --mandir=DIR man documentation [PREFIX/man]
829_ACEOF 653EOF
830 654
831 cat <<\_ACEOF 655 cat <<\EOF
832 656
833System types: 657System types:
834 --build=BUILD configure for building on BUILD [guessed] 658 --build=BUILD configure for building on BUILD [guessed]
835 --host=HOST cross-compile to build programs to run on HOST [BUILD] 659 --host=HOST build programs to run on HOST [BUILD]
836_ACEOF 660EOF
837fi 661fi
838 662
839if test -n "$ac_init_help"; then 663if test -n "$ac_init_help"; then
840 664
841 cat <<\_ACEOF 665 cat <<\EOF
842 666
843Optional Features: 667Optional Features:
844 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) 668 --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
@@ -877,9 +701,8 @@ Optional Packages:
877 --with-privsep-user=user Specify non-privileged user for privilege separation 701 --with-privsep-user=user Specify non-privileged user for privilege separation
878 --with-sectok Enable smartcard support using libsectok 702 --with-sectok Enable smartcard support using libsectok
879 --with-opensc=PFX Enable smartcard support using OpenSC 703 --with-opensc=PFX Enable smartcard support using OpenSC
704 --with-dns Support for fetching keys from DNS (experimental)
880 --with-kerberos5=PATH Enable Kerberos 5 support 705 --with-kerberos5=PATH Enable Kerberos 5 support
881 --with-kerberos4=PATH Enable Kerberos 4 support
882 --with-afs=PATH Enable AFS support
883 --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty) 706 --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)
884 --with-xauth=PATH Specify path to xauth program 707 --with-xauth=PATH Specify path to xauth program
885 --with-mantype=man|cat|doc Set man page type 708 --with-mantype=man|cat|doc Set man page type
@@ -888,7 +711,6 @@ Optional Packages:
888 --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY 711 --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY
889 --with-default-path= Specify default \$PATH environment for server 712 --with-default-path= Specify default \$PATH environment for server
890 --with-superuser-path= Specify different path for super-user 713 --with-superuser-path= Specify different path for super-user
891 --with-ipv4-default Use IPv4 by connections unless '-6' specified
892 --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses 714 --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses
893 --with-bsd-auth Enable BSD auth support 715 --with-bsd-auth Enable BSD auth support
894 --with-pid-dir=PATH Specify location of ssh.pid file 716 --with-pid-dir=PATH Specify location of ssh.pid file
@@ -906,60 +728,40 @@ Some influential environment variables:
906Use these variables to override the choices made by `configure' or to help 728Use these variables to override the choices made by `configure' or to help
907it to find libraries and programs with nonstandard names/locations. 729it to find libraries and programs with nonstandard names/locations.
908 730
909_ACEOF 731EOF
910fi 732fi
911 733
912if test "$ac_init_help" = "recursive"; then 734if test "$ac_init_help" = "recursive"; then
913 # If there are subdirs, report their specific --help. 735 # If there are subdirs, report their specific --help.
914 ac_popdir=`pwd` 736 ac_popdir=`pwd`
915 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue 737 for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
916 test -d $ac_dir || continue 738 cd $ac_subdir
917 ac_builddir=. 739 # A "../" for each directory in /$ac_subdir.
918 740 ac_dots=`echo $ac_subdir |
919if test "$ac_dir" != .; then 741 sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
920 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` 742
921 # A "../" for each directory in $ac_dir_suffix. 743 case $srcdir in
922 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` 744 .) # No --srcdir option. We are building in place.
923else 745 ac_sub_srcdir=$srcdir ;;
924 ac_dir_suffix= ac_top_builddir= 746 [\\/]* | ?:[\\/]* ) # Absolute path.
925fi 747 ac_sub_srcdir=$srcdir/$ac_subdir ;;
748 *) # Relative path.
749 ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
750 esac
926 751
927case $srcdir in
928 .) # No --srcdir option. We are building in place.
929 ac_srcdir=.
930 if test -z "$ac_top_builddir"; then
931 ac_top_srcdir=.
932 else
933 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
934 fi ;;
935 [\\/]* | ?:[\\/]* ) # Absolute path.
936 ac_srcdir=$srcdir$ac_dir_suffix;
937 ac_top_srcdir=$srcdir ;;
938 *) # Relative path.
939 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
940 ac_top_srcdir=$ac_top_builddir$srcdir ;;
941esac
942# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
943# absolute.
944ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
945ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
946ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
947ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
948
949 cd $ac_dir
950 # Check for guested configure; otherwise get Cygnus style configure. 752 # Check for guested configure; otherwise get Cygnus style configure.
951 if test -f $ac_srcdir/configure.gnu; then 753 if test -f $ac_sub_srcdir/configure.gnu; then
952 echo 754 echo
953 $SHELL $ac_srcdir/configure.gnu --help=recursive 755 $SHELL $ac_sub_srcdir/configure.gnu --help=recursive
954 elif test -f $ac_srcdir/configure; then 756 elif test -f $ac_sub_srcdir/configure; then
955 echo 757 echo
956 $SHELL $ac_srcdir/configure --help=recursive 758 $SHELL $ac_sub_srcdir/configure --help=recursive
957 elif test -f $ac_srcdir/configure.ac || 759 elif test -f $ac_sub_srcdir/configure.ac ||
958 test -f $ac_srcdir/configure.in; then 760 test -f $ac_sub_srcdir/configure.in; then
959 echo 761 echo
960 $ac_configure --help 762 $ac_configure --help
961 else 763 else
962 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 764 echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
963 fi 765 fi
964 cd $ac_popdir 766 cd $ac_popdir
965 done 767 done
@@ -967,31 +769,31 @@ fi
967 769
968test -n "$ac_init_help" && exit 0 770test -n "$ac_init_help" && exit 0
969if $ac_init_version; then 771if $ac_init_version; then
970 cat <<\_ACEOF 772 cat <<\EOF
971 773
972Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 774Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
973Free Software Foundation, Inc. 775Free Software Foundation, Inc.
974This configure script is free software; the Free Software Foundation 776This configure script is free software; the Free Software Foundation
975gives unlimited permission to copy, distribute and modify it. 777gives unlimited permission to copy, distribute and modify it.
976_ACEOF 778EOF
977 exit 0 779 exit 0
978fi 780fi
979exec 5>config.log 781exec 5>config.log
980cat >&5 <<_ACEOF 782cat >&5 <<EOF
981This file contains any messages produced by compilers while 783This file contains any messages produced by compilers while
982running configure, to aid debugging if configure makes a mistake. 784running configure, to aid debugging if configure makes a mistake.
983 785
984It was created by $as_me, which was 786It was created by $as_me, which was
985generated by GNU Autoconf 2.57. Invocation command line was 787generated by GNU Autoconf 2.52. Invocation command line was
986 788
987 $ $0 $@ 789 $ $0 $@
988 790
989_ACEOF 791EOF
990{ 792{
991cat <<_ASUNAME 793cat <<_ASUNAME
992## --------- ## 794## ---------- ##
993## Platform. ## 795## Platform. ##
994## --------- ## 796## ---------- ##
995 797
996hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` 798hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
997uname -m = `(uname -m) 2>/dev/null || echo unknown` 799uname -m = `(uname -m) 2>/dev/null || echo unknown`
@@ -1010,96 +812,51 @@ hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
1010/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` 812/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
1011/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` 813/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
1012 814
1013_ASUNAME 815PATH = $PATH
1014
1015as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
1016for as_dir in $PATH
1017do
1018 IFS=$as_save_IFS
1019 test -z "$as_dir" && as_dir=.
1020 echo "PATH: $as_dir"
1021done
1022 816
817_ASUNAME
1023} >&5 818} >&5
1024 819
1025cat >&5 <<_ACEOF 820cat >&5 <<EOF
1026 821## ------------ ##
1027 822## Core tests. ##
1028## ----------- ## 823## ------------ ##
1029## Core tests. ##
1030## ----------- ##
1031
1032_ACEOF
1033 824
825EOF
1034 826
1035# Keep a trace of the command line. 827# Keep a trace of the command line.
1036# Strip out --no-create and --no-recursion so they do not pile up. 828# Strip out --no-create and --no-recursion so they do not pile up.
1037# Strip out --silent because we don't want to record it for future runs.
1038# Also quote any args containing shell meta-characters. 829# Also quote any args containing shell meta-characters.
1039# Make two passes to allow for proper duplicate-argument suppression.
1040ac_configure_args= 830ac_configure_args=
1041ac_configure_args0=
1042ac_configure_args1=
1043ac_sep= 831ac_sep=
1044ac_must_keep_next=false 832for ac_arg
1045for ac_pass in 1 2
1046do 833do
1047 for ac_arg 834 case $ac_arg in
1048 do 835 -no-create | --no-create | --no-creat | --no-crea | --no-cre \
1049 case $ac_arg in 836 | --no-cr | --no-c) ;;
1050 -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; 837 -no-recursion | --no-recursion | --no-recursio | --no-recursi \
1051 -q | -quiet | --quiet | --quie | --qui | --qu | --q \ 838 | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
1052 | -silent | --silent | --silen | --sile | --sil) 839 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1053 continue ;; 840 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
1054 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) 841 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1055 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; 842 ac_sep=" " ;;
1056 esac 843 *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
1057 case $ac_pass in 844 ac_sep=" " ;;
1058 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 845 esac
1059 2) 846 # Get rid of the leading space.
1060 ac_configure_args1="$ac_configure_args1 '$ac_arg'"
1061 if test $ac_must_keep_next = true; then
1062 ac_must_keep_next=false # Got value, back to normal.
1063 else
1064 case $ac_arg in
1065 *=* | --config-cache | -C | -disable-* | --disable-* \
1066 | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
1067 | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
1068 | -with-* | --with-* | -without-* | --without-* | --x)
1069 case "$ac_configure_args0 " in
1070 "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
1071 esac
1072 ;;
1073 -* ) ac_must_keep_next=true ;;
1074 esac
1075 fi
1076 ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
1077 # Get rid of the leading space.
1078 ac_sep=" "
1079 ;;
1080 esac
1081 done
1082done 847done
1083$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
1084$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
1085 848
1086# When interrupted or exit'd, cleanup temporary files, and complete 849# When interrupted or exit'd, cleanup temporary files, and complete
1087# config.log. We remove comments because anyway the quotes in there 850# config.log. We remove comments because anyway the quotes in there
1088# would cause problems or look ugly. 851# would cause problems or look ugly.
1089# WARNING: Be sure not to use single quotes in there, as some shells,
1090# such as our DU 5.0 friend, will then `close' the trap.
1091trap 'exit_status=$? 852trap 'exit_status=$?
1092 # Save into config.log some information that might help in debugging. 853 # Save into config.log some information that might help in debugging.
1093 { 854 echo >&5
1094 echo 855 echo "## ----------------- ##" >&5
1095 856 echo "## Cache variables. ##" >&5
1096 cat <<\_ASBOX 857 echo "## ----------------- ##" >&5
1097## ---------------- ## 858 echo >&5
1098## Cache variables. ## 859 # The following way of writing the cache mishandles newlines in values,
1099## ---------------- ##
1100_ASBOX
1101 echo
1102 # The following way of writing the cache mishandles newlines in values,
1103{ 860{
1104 (set) 2>&1 | 861 (set) 2>&1 |
1105 case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in 862 case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
@@ -1113,53 +870,21 @@ _ASBOX
1113 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" 870 "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
1114 ;; 871 ;;
1115 esac; 872 esac;
1116} 873} >&5
1117 echo 874 sed "/^$/d" confdefs.h >conftest.log
1118 875 if test -s conftest.log; then
1119 cat <<\_ASBOX 876 echo >&5
1120## ----------------- ## 877 echo "## ------------ ##" >&5
1121## Output variables. ## 878 echo "## confdefs.h. ##" >&5
1122## ----------------- ## 879 echo "## ------------ ##" >&5
1123_ASBOX 880 echo >&5
1124 echo 881 cat conftest.log >&5
1125 for ac_var in $ac_subst_vars 882 fi
1126 do 883 (echo; echo) >&5
1127 eval ac_val=$`echo $ac_var` 884 test "$ac_signal" != 0 &&
1128 echo "$ac_var='"'"'$ac_val'"'"'" 885 echo "$as_me: caught signal $ac_signal" >&5
1129 done | sort 886 echo "$as_me: exit $exit_status" >&5
1130 echo 887 rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
1131
1132 if test -n "$ac_subst_files"; then
1133 cat <<\_ASBOX
1134## ------------- ##
1135## Output files. ##
1136## ------------- ##
1137_ASBOX
1138 echo
1139 for ac_var in $ac_subst_files
1140 do
1141 eval ac_val=$`echo $ac_var`
1142 echo "$ac_var='"'"'$ac_val'"'"'"
1143 done | sort
1144 echo
1145 fi
1146
1147 if test -s confdefs.h; then
1148 cat <<\_ASBOX
1149## ----------- ##
1150## confdefs.h. ##
1151## ----------- ##
1152_ASBOX
1153 echo
1154 sed "/^$/d" confdefs.h | sort
1155 echo
1156 fi
1157 test "$ac_signal" != 0 &&
1158 echo "$as_me: caught signal $ac_signal"
1159 echo "$as_me: exit $exit_status"
1160 } >&5
1161 rm -f core core.* *.core &&
1162 rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
1163 exit $exit_status 888 exit $exit_status
1164 ' 0 889 ' 0
1165for ac_signal in 1 2 13 15; do 890for ac_signal in 1 2 13 15; do
@@ -1172,33 +897,6 @@ rm -rf conftest* confdefs.h
1172# AIX cpp loses on an empty file, so make sure it contains at least a newline. 897# AIX cpp loses on an empty file, so make sure it contains at least a newline.
1173echo >confdefs.h 898echo >confdefs.h
1174 899
1175# Predefined preprocessor variables.
1176
1177cat >>confdefs.h <<_ACEOF
1178#define PACKAGE_NAME "$PACKAGE_NAME"
1179_ACEOF
1180
1181
1182cat >>confdefs.h <<_ACEOF
1183#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
1184_ACEOF
1185
1186
1187cat >>confdefs.h <<_ACEOF
1188#define PACKAGE_VERSION "$PACKAGE_VERSION"
1189_ACEOF
1190
1191
1192cat >>confdefs.h <<_ACEOF
1193#define PACKAGE_STRING "$PACKAGE_STRING"
1194_ACEOF
1195
1196
1197cat >>confdefs.h <<_ACEOF
1198#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
1199_ACEOF
1200
1201
1202# Let the site file select an alternate cache file if it wants to. 900# Let the site file select an alternate cache file if it wants to.
1203# Prefer explicitly selected file to automatically selected ones. 901# Prefer explicitly selected file to automatically selected ones.
1204if test -z "$CONFIG_SITE"; then 902if test -z "$CONFIG_SITE"; then
@@ -1210,9 +908,9 @@ if test -z "$CONFIG_SITE"; then
1210fi 908fi
1211for ac_site_file in $CONFIG_SITE; do 909for ac_site_file in $CONFIG_SITE; do
1212 if test -r "$ac_site_file"; then 910 if test -r "$ac_site_file"; then
1213 { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 911 { echo "$as_me:911: loading site script $ac_site_file" >&5
1214echo "$as_me: loading site script $ac_site_file" >&6;} 912echo "$as_me: loading site script $ac_site_file" >&6;}
1215 sed 's/^/| /' "$ac_site_file" >&5 913 cat "$ac_site_file" >&5
1216 . "$ac_site_file" 914 . "$ac_site_file"
1217 fi 915 fi
1218done 916done
@@ -1221,7 +919,7 @@ if test -r "$cache_file"; then
1221 # Some versions of bash will fail to source /dev/null (special 919 # Some versions of bash will fail to source /dev/null (special
1222 # files actually), so we avoid doing that. 920 # files actually), so we avoid doing that.
1223 if test -f "$cache_file"; then 921 if test -f "$cache_file"; then
1224 { echo "$as_me:$LINENO: loading cache $cache_file" >&5 922 { echo "$as_me:922: loading cache $cache_file" >&5
1225echo "$as_me: loading cache $cache_file" >&6;} 923echo "$as_me: loading cache $cache_file" >&6;}
1226 case $cache_file in 924 case $cache_file in
1227 [\\/]* | ?:[\\/]* ) . $cache_file;; 925 [\\/]* | ?:[\\/]* ) . $cache_file;;
@@ -1229,7 +927,7 @@ echo "$as_me: loading cache $cache_file" >&6;}
1229 esac 927 esac
1230 fi 928 fi
1231else 929else
1232 { echo "$as_me:$LINENO: creating cache $cache_file" >&5 930 { echo "$as_me:930: creating cache $cache_file" >&5
1233echo "$as_me: creating cache $cache_file" >&6;} 931echo "$as_me: creating cache $cache_file" >&6;}
1234 >$cache_file 932 >$cache_file
1235fi 933fi
@@ -1245,42 +943,42 @@ for ac_var in `(set) 2>&1 |
1245 eval ac_new_val="\$ac_env_${ac_var}_value" 943 eval ac_new_val="\$ac_env_${ac_var}_value"
1246 case $ac_old_set,$ac_new_set in 944 case $ac_old_set,$ac_new_set in
1247 set,) 945 set,)
1248 { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 946 { echo "$as_me:946: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
1249echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} 947echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
1250 ac_cache_corrupted=: ;; 948 ac_cache_corrupted=: ;;
1251 ,set) 949 ,set)
1252 { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 950 { echo "$as_me:950: error: \`$ac_var' was not set in the previous run" >&5
1253echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} 951echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
1254 ac_cache_corrupted=: ;; 952 ac_cache_corrupted=: ;;
1255 ,);; 953 ,);;
1256 *) 954 *)
1257 if test "x$ac_old_val" != "x$ac_new_val"; then 955 if test "x$ac_old_val" != "x$ac_new_val"; then
1258 { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 956 { echo "$as_me:956: error: \`$ac_var' has changed since the previous run:" >&5
1259echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} 957echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
1260 { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 958 { echo "$as_me:958: former value: $ac_old_val" >&5
1261echo "$as_me: former value: $ac_old_val" >&2;} 959echo "$as_me: former value: $ac_old_val" >&2;}
1262 { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 960 { echo "$as_me:960: current value: $ac_new_val" >&5
1263echo "$as_me: current value: $ac_new_val" >&2;} 961echo "$as_me: current value: $ac_new_val" >&2;}
1264 ac_cache_corrupted=: 962 ac_cache_corrupted=:
1265 fi;; 963 fi;;
1266 esac 964 esac
1267 # Pass precious variables to config.status. 965 # Pass precious variables to config.status. It doesn't matter if
966 # we pass some twice (in addition to the command line arguments).
1268 if test "$ac_new_set" = set; then 967 if test "$ac_new_set" = set; then
1269 case $ac_new_val in 968 case $ac_new_val in
1270 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) 969 *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
1271 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; 970 ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
1272 *) ac_arg=$ac_var=$ac_new_val ;; 971 ac_configure_args="$ac_configure_args '$ac_arg'"
1273 esac 972 ;;
1274 case " $ac_configure_args " in 973 *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
1275 *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. 974 ;;
1276 *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
1277 esac 975 esac
1278 fi 976 fi
1279done 977done
1280if $ac_cache_corrupted; then 978if $ac_cache_corrupted; then
1281 { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 979 { echo "$as_me:979: error: changes in the environment can compromise the build" >&5
1282echo "$as_me: error: changes in the environment can compromise the build" >&2;} 980echo "$as_me: error: changes in the environment can compromise the build" >&2;}
1283 { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 981 { { echo "$as_me:981: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
1284echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} 982echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
1285 { (exit 1); exit 1; }; } 983 { (exit 1); exit 1; }; }
1286fi 984fi
@@ -1291,27 +989,28 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1291ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 989ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1292ac_compiler_gnu=$ac_cv_c_compiler_gnu 990ac_compiler_gnu=$ac_cv_c_compiler_gnu
1293 991
992case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
993 *c*,-n*) ECHO_N= ECHO_C='
994' ECHO_T=' ' ;;
995 *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
996 *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
997esac
998echo "#! $SHELL" >conftest.sh
999echo "exit 0" >>conftest.sh
1000chmod +x conftest.sh
1001if { (echo "$as_me:1001: PATH=\".;.\"; conftest.sh") >&5
1002 (PATH=".;."; conftest.sh) 2>&5
1003 ac_status=$?
1004 echo "$as_me:1004: \$? = $ac_status" >&5
1005 (exit $ac_status); }; then
1006 ac_path_separator=';'
1007else
1008 ac_path_separator=:
1009fi
1010PATH_SEPARATOR="$ac_path_separator"
1011rm -f conftest.sh
1294 1012
1295 1013ac_config_headers="$ac_config_headers config.h"
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314 ac_config_headers="$ac_config_headers config.h"
1315 1014
1316ac_ext=c 1015ac_ext=c
1317ac_cpp='$CPP $CPPFLAGS' 1016ac_cpp='$CPP $CPPFLAGS'
@@ -1321,7 +1020,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
1321if test -n "$ac_tool_prefix"; then 1020if test -n "$ac_tool_prefix"; then
1322 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. 1021 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1323set dummy ${ac_tool_prefix}gcc; ac_word=$2 1022set dummy ${ac_tool_prefix}gcc; ac_word=$2
1324echo "$as_me:$LINENO: checking for $ac_word" >&5 1023echo "$as_me:1023: checking for $ac_word" >&5
1325echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1024echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1326if test "${ac_cv_prog_CC+set}" = set; then 1025if test "${ac_cv_prog_CC+set}" = set; then
1327 echo $ECHO_N "(cached) $ECHO_C" >&6 1026 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1329,28 +1028,25 @@ else
1329 if test -n "$CC"; then 1028 if test -n "$CC"; then
1330 ac_cv_prog_CC="$CC" # Let the user override the test. 1029 ac_cv_prog_CC="$CC" # Let the user override the test.
1331else 1030else
1332as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1031 ac_save_IFS=$IFS; IFS=$ac_path_separator
1333for as_dir in $PATH 1032ac_dummy="$PATH"
1334do 1033for ac_dir in $ac_dummy; do
1335 IFS=$as_save_IFS 1034 IFS=$ac_save_IFS
1336 test -z "$as_dir" && as_dir=. 1035 test -z "$ac_dir" && ac_dir=.
1337 for ac_exec_ext in '' $ac_executable_extensions; do 1036 $as_executable_p "$ac_dir/$ac_word" || continue
1338 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1037ac_cv_prog_CC="${ac_tool_prefix}gcc"
1339 ac_cv_prog_CC="${ac_tool_prefix}gcc" 1038echo "$as_me:1038: found $ac_dir/$ac_word" >&5
1340 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1039break
1341 break 2
1342 fi
1343done
1344done 1040done
1345 1041
1346fi 1042fi
1347fi 1043fi
1348CC=$ac_cv_prog_CC 1044CC=$ac_cv_prog_CC
1349if test -n "$CC"; then 1045if test -n "$CC"; then
1350 echo "$as_me:$LINENO: result: $CC" >&5 1046 echo "$as_me:1046: result: $CC" >&5
1351echo "${ECHO_T}$CC" >&6 1047echo "${ECHO_T}$CC" >&6
1352else 1048else
1353 echo "$as_me:$LINENO: result: no" >&5 1049 echo "$as_me:1049: result: no" >&5
1354echo "${ECHO_T}no" >&6 1050echo "${ECHO_T}no" >&6
1355fi 1051fi
1356 1052
@@ -1359,7 +1055,7 @@ if test -z "$ac_cv_prog_CC"; then
1359 ac_ct_CC=$CC 1055 ac_ct_CC=$CC
1360 # Extract the first word of "gcc", so it can be a program name with args. 1056 # Extract the first word of "gcc", so it can be a program name with args.
1361set dummy gcc; ac_word=$2 1057set dummy gcc; ac_word=$2
1362echo "$as_me:$LINENO: checking for $ac_word" >&5 1058echo "$as_me:1058: checking for $ac_word" >&5
1363echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1059echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1364if test "${ac_cv_prog_ac_ct_CC+set}" = set; then 1060if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1365 echo $ECHO_N "(cached) $ECHO_C" >&6 1061 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1367,28 +1063,25 @@ else
1367 if test -n "$ac_ct_CC"; then 1063 if test -n "$ac_ct_CC"; then
1368 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. 1064 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1369else 1065else
1370as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1066 ac_save_IFS=$IFS; IFS=$ac_path_separator
1371for as_dir in $PATH 1067ac_dummy="$PATH"
1372do 1068for ac_dir in $ac_dummy; do
1373 IFS=$as_save_IFS 1069 IFS=$ac_save_IFS
1374 test -z "$as_dir" && as_dir=. 1070 test -z "$ac_dir" && ac_dir=.
1375 for ac_exec_ext in '' $ac_executable_extensions; do 1071 $as_executable_p "$ac_dir/$ac_word" || continue
1376 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1072ac_cv_prog_ac_ct_CC="gcc"
1377 ac_cv_prog_ac_ct_CC="gcc" 1073echo "$as_me:1073: found $ac_dir/$ac_word" >&5
1378 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1074break
1379 break 2
1380 fi
1381done
1382done 1075done
1383 1076
1384fi 1077fi
1385fi 1078fi
1386ac_ct_CC=$ac_cv_prog_ac_ct_CC 1079ac_ct_CC=$ac_cv_prog_ac_ct_CC
1387if test -n "$ac_ct_CC"; then 1080if test -n "$ac_ct_CC"; then
1388 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 1081 echo "$as_me:1081: result: $ac_ct_CC" >&5
1389echo "${ECHO_T}$ac_ct_CC" >&6 1082echo "${ECHO_T}$ac_ct_CC" >&6
1390else 1083else
1391 echo "$as_me:$LINENO: result: no" >&5 1084 echo "$as_me:1084: result: no" >&5
1392echo "${ECHO_T}no" >&6 1085echo "${ECHO_T}no" >&6
1393fi 1086fi
1394 1087
@@ -1401,7 +1094,7 @@ if test -z "$CC"; then
1401 if test -n "$ac_tool_prefix"; then 1094 if test -n "$ac_tool_prefix"; then
1402 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. 1095 # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1403set dummy ${ac_tool_prefix}cc; ac_word=$2 1096set dummy ${ac_tool_prefix}cc; ac_word=$2
1404echo "$as_me:$LINENO: checking for $ac_word" >&5 1097echo "$as_me:1097: checking for $ac_word" >&5
1405echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1098echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1406if test "${ac_cv_prog_CC+set}" = set; then 1099if test "${ac_cv_prog_CC+set}" = set; then
1407 echo $ECHO_N "(cached) $ECHO_C" >&6 1100 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1409,28 +1102,25 @@ else
1409 if test -n "$CC"; then 1102 if test -n "$CC"; then
1410 ac_cv_prog_CC="$CC" # Let the user override the test. 1103 ac_cv_prog_CC="$CC" # Let the user override the test.
1411else 1104else
1412as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1105 ac_save_IFS=$IFS; IFS=$ac_path_separator
1413for as_dir in $PATH 1106ac_dummy="$PATH"
1414do 1107for ac_dir in $ac_dummy; do
1415 IFS=$as_save_IFS 1108 IFS=$ac_save_IFS
1416 test -z "$as_dir" && as_dir=. 1109 test -z "$ac_dir" && ac_dir=.
1417 for ac_exec_ext in '' $ac_executable_extensions; do 1110 $as_executable_p "$ac_dir/$ac_word" || continue
1418 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1111ac_cv_prog_CC="${ac_tool_prefix}cc"
1419 ac_cv_prog_CC="${ac_tool_prefix}cc" 1112echo "$as_me:1112: found $ac_dir/$ac_word" >&5
1420 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1113break
1421 break 2
1422 fi
1423done
1424done 1114done
1425 1115
1426fi 1116fi
1427fi 1117fi
1428CC=$ac_cv_prog_CC 1118CC=$ac_cv_prog_CC
1429if test -n "$CC"; then 1119if test -n "$CC"; then
1430 echo "$as_me:$LINENO: result: $CC" >&5 1120 echo "$as_me:1120: result: $CC" >&5
1431echo "${ECHO_T}$CC" >&6 1121echo "${ECHO_T}$CC" >&6
1432else 1122else
1433 echo "$as_me:$LINENO: result: no" >&5 1123 echo "$as_me:1123: result: no" >&5
1434echo "${ECHO_T}no" >&6 1124echo "${ECHO_T}no" >&6
1435fi 1125fi
1436 1126
@@ -1439,7 +1129,7 @@ if test -z "$ac_cv_prog_CC"; then
1439 ac_ct_CC=$CC 1129 ac_ct_CC=$CC
1440 # Extract the first word of "cc", so it can be a program name with args. 1130 # Extract the first word of "cc", so it can be a program name with args.
1441set dummy cc; ac_word=$2 1131set dummy cc; ac_word=$2
1442echo "$as_me:$LINENO: checking for $ac_word" >&5 1132echo "$as_me:1132: checking for $ac_word" >&5
1443echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1133echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1444if test "${ac_cv_prog_ac_ct_CC+set}" = set; then 1134if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1445 echo $ECHO_N "(cached) $ECHO_C" >&6 1135 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1447,28 +1137,25 @@ else
1447 if test -n "$ac_ct_CC"; then 1137 if test -n "$ac_ct_CC"; then
1448 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. 1138 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1449else 1139else
1450as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1140 ac_save_IFS=$IFS; IFS=$ac_path_separator
1451for as_dir in $PATH 1141ac_dummy="$PATH"
1452do 1142for ac_dir in $ac_dummy; do
1453 IFS=$as_save_IFS 1143 IFS=$ac_save_IFS
1454 test -z "$as_dir" && as_dir=. 1144 test -z "$ac_dir" && ac_dir=.
1455 for ac_exec_ext in '' $ac_executable_extensions; do 1145 $as_executable_p "$ac_dir/$ac_word" || continue
1456 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1146ac_cv_prog_ac_ct_CC="cc"
1457 ac_cv_prog_ac_ct_CC="cc" 1147echo "$as_me:1147: found $ac_dir/$ac_word" >&5
1458 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1148break
1459 break 2
1460 fi
1461done
1462done 1149done
1463 1150
1464fi 1151fi
1465fi 1152fi
1466ac_ct_CC=$ac_cv_prog_ac_ct_CC 1153ac_ct_CC=$ac_cv_prog_ac_ct_CC
1467if test -n "$ac_ct_CC"; then 1154if test -n "$ac_ct_CC"; then
1468 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 1155 echo "$as_me:1155: result: $ac_ct_CC" >&5
1469echo "${ECHO_T}$ac_ct_CC" >&6 1156echo "${ECHO_T}$ac_ct_CC" >&6
1470else 1157else
1471 echo "$as_me:$LINENO: result: no" >&5 1158 echo "$as_me:1158: result: no" >&5
1472echo "${ECHO_T}no" >&6 1159echo "${ECHO_T}no" >&6
1473fi 1160fi
1474 1161
@@ -1481,7 +1168,7 @@ fi
1481if test -z "$CC"; then 1168if test -z "$CC"; then
1482 # Extract the first word of "cc", so it can be a program name with args. 1169 # Extract the first word of "cc", so it can be a program name with args.
1483set dummy cc; ac_word=$2 1170set dummy cc; ac_word=$2
1484echo "$as_me:$LINENO: checking for $ac_word" >&5 1171echo "$as_me:1171: checking for $ac_word" >&5
1485echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1172echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1486if test "${ac_cv_prog_CC+set}" = set; then 1173if test "${ac_cv_prog_CC+set}" = set; then
1487 echo $ECHO_N "(cached) $ECHO_C" >&6 1174 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1490,22 +1177,19 @@ else
1490 ac_cv_prog_CC="$CC" # Let the user override the test. 1177 ac_cv_prog_CC="$CC" # Let the user override the test.
1491else 1178else
1492 ac_prog_rejected=no 1179 ac_prog_rejected=no
1493as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1180 ac_save_IFS=$IFS; IFS=$ac_path_separator
1494for as_dir in $PATH 1181ac_dummy="$PATH"
1495do 1182for ac_dir in $ac_dummy; do
1496 IFS=$as_save_IFS 1183 IFS=$ac_save_IFS
1497 test -z "$as_dir" && as_dir=. 1184 test -z "$ac_dir" && ac_dir=.
1498 for ac_exec_ext in '' $ac_executable_extensions; do 1185 $as_executable_p "$ac_dir/$ac_word" || continue
1499 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1186if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1500 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then 1187 ac_prog_rejected=yes
1501 ac_prog_rejected=yes 1188 continue
1502 continue 1189fi
1503 fi 1190ac_cv_prog_CC="cc"
1504 ac_cv_prog_CC="cc" 1191echo "$as_me:1191: found $ac_dir/$ac_word" >&5
1505 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1192break
1506 break 2
1507 fi
1508done
1509done 1193done
1510 1194
1511if test $ac_prog_rejected = yes; then 1195if test $ac_prog_rejected = yes; then
@@ -1517,17 +1201,19 @@ if test $ac_prog_rejected = yes; then
1517 # However, it has the same basename, so the bogon will be chosen 1201 # However, it has the same basename, so the bogon will be chosen
1518 # first if we set CC to just the basename; use the full file name. 1202 # first if we set CC to just the basename; use the full file name.
1519 shift 1203 shift
1520 ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" 1204 set dummy "$ac_dir/$ac_word" ${1+"$@"}
1205 shift
1206 ac_cv_prog_CC="$@"
1521 fi 1207 fi
1522fi 1208fi
1523fi 1209fi
1524fi 1210fi
1525CC=$ac_cv_prog_CC 1211CC=$ac_cv_prog_CC
1526if test -n "$CC"; then 1212if test -n "$CC"; then
1527 echo "$as_me:$LINENO: result: $CC" >&5 1213 echo "$as_me:1213: result: $CC" >&5
1528echo "${ECHO_T}$CC" >&6 1214echo "${ECHO_T}$CC" >&6
1529else 1215else
1530 echo "$as_me:$LINENO: result: no" >&5 1216 echo "$as_me:1216: result: no" >&5
1531echo "${ECHO_T}no" >&6 1217echo "${ECHO_T}no" >&6
1532fi 1218fi
1533 1219
@@ -1538,7 +1224,7 @@ if test -z "$CC"; then
1538 do 1224 do
1539 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. 1225 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1540set dummy $ac_tool_prefix$ac_prog; ac_word=$2 1226set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1541echo "$as_me:$LINENO: checking for $ac_word" >&5 1227echo "$as_me:1227: checking for $ac_word" >&5
1542echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1228echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1543if test "${ac_cv_prog_CC+set}" = set; then 1229if test "${ac_cv_prog_CC+set}" = set; then
1544 echo $ECHO_N "(cached) $ECHO_C" >&6 1230 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1546,28 +1232,25 @@ else
1546 if test -n "$CC"; then 1232 if test -n "$CC"; then
1547 ac_cv_prog_CC="$CC" # Let the user override the test. 1233 ac_cv_prog_CC="$CC" # Let the user override the test.
1548else 1234else
1549as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1235 ac_save_IFS=$IFS; IFS=$ac_path_separator
1550for as_dir in $PATH 1236ac_dummy="$PATH"
1551do 1237for ac_dir in $ac_dummy; do
1552 IFS=$as_save_IFS 1238 IFS=$ac_save_IFS
1553 test -z "$as_dir" && as_dir=. 1239 test -z "$ac_dir" && ac_dir=.
1554 for ac_exec_ext in '' $ac_executable_extensions; do 1240 $as_executable_p "$ac_dir/$ac_word" || continue
1555 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1241ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1556 ac_cv_prog_CC="$ac_tool_prefix$ac_prog" 1242echo "$as_me:1242: found $ac_dir/$ac_word" >&5
1557 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1243break
1558 break 2
1559 fi
1560done
1561done 1244done
1562 1245
1563fi 1246fi
1564fi 1247fi
1565CC=$ac_cv_prog_CC 1248CC=$ac_cv_prog_CC
1566if test -n "$CC"; then 1249if test -n "$CC"; then
1567 echo "$as_me:$LINENO: result: $CC" >&5 1250 echo "$as_me:1250: result: $CC" >&5
1568echo "${ECHO_T}$CC" >&6 1251echo "${ECHO_T}$CC" >&6
1569else 1252else
1570 echo "$as_me:$LINENO: result: no" >&5 1253 echo "$as_me:1253: result: no" >&5
1571echo "${ECHO_T}no" >&6 1254echo "${ECHO_T}no" >&6
1572fi 1255fi
1573 1256
@@ -1580,7 +1263,7 @@ if test -z "$CC"; then
1580do 1263do
1581 # Extract the first word of "$ac_prog", so it can be a program name with args. 1264 # Extract the first word of "$ac_prog", so it can be a program name with args.
1582set dummy $ac_prog; ac_word=$2 1265set dummy $ac_prog; ac_word=$2
1583echo "$as_me:$LINENO: checking for $ac_word" >&5 1266echo "$as_me:1266: checking for $ac_word" >&5
1584echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 1267echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1585if test "${ac_cv_prog_ac_ct_CC+set}" = set; then 1268if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1586 echo $ECHO_N "(cached) $ECHO_C" >&6 1269 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1588,28 +1271,25 @@ else
1588 if test -n "$ac_ct_CC"; then 1271 if test -n "$ac_ct_CC"; then
1589 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. 1272 ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1590else 1273else
1591as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 1274 ac_save_IFS=$IFS; IFS=$ac_path_separator
1592for as_dir in $PATH 1275ac_dummy="$PATH"
1593do 1276for ac_dir in $ac_dummy; do
1594 IFS=$as_save_IFS 1277 IFS=$ac_save_IFS
1595 test -z "$as_dir" && as_dir=. 1278 test -z "$ac_dir" && ac_dir=.
1596 for ac_exec_ext in '' $ac_executable_extensions; do 1279 $as_executable_p "$ac_dir/$ac_word" || continue
1597 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 1280ac_cv_prog_ac_ct_CC="$ac_prog"
1598 ac_cv_prog_ac_ct_CC="$ac_prog" 1281echo "$as_me:1281: found $ac_dir/$ac_word" >&5
1599 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 1282break
1600 break 2
1601 fi
1602done
1603done 1283done
1604 1284
1605fi 1285fi
1606fi 1286fi
1607ac_ct_CC=$ac_cv_prog_ac_ct_CC 1287ac_ct_CC=$ac_cv_prog_ac_ct_CC
1608if test -n "$ac_ct_CC"; then 1288if test -n "$ac_ct_CC"; then
1609 echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 1289 echo "$as_me:1289: result: $ac_ct_CC" >&5
1610echo "${ECHO_T}$ac_ct_CC" >&6 1290echo "${ECHO_T}$ac_ct_CC" >&6
1611else 1291else
1612 echo "$as_me:$LINENO: result: no" >&5 1292 echo "$as_me:1292: result: no" >&5
1613echo "${ECHO_T}no" >&6 1293echo "${ECHO_T}no" >&6
1614fi 1294fi
1615 1295
@@ -1621,40 +1301,33 @@ fi
1621 1301
1622fi 1302fi
1623 1303
1624 1304test -z "$CC" && { { echo "$as_me:1304: error: no acceptable cc found in \$PATH" >&5
1625test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH 1305echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1626See \`config.log' for more details." >&5
1627echo "$as_me: error: no acceptable C compiler found in \$PATH
1628See \`config.log' for more details." >&2;}
1629 { (exit 1); exit 1; }; } 1306 { (exit 1); exit 1; }; }
1630 1307
1631# Provide some information about the compiler. 1308# Provide some information about the compiler.
1632echo "$as_me:$LINENO:" \ 1309echo "$as_me:1309:" \
1633 "checking for C compiler version" >&5 1310 "checking for C compiler version" >&5
1634ac_compiler=`set X $ac_compile; echo $2` 1311ac_compiler=`set X $ac_compile; echo $2`
1635{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 1312{ (eval echo "$as_me:1312: \"$ac_compiler --version </dev/null >&5\"") >&5
1636 (eval $ac_compiler --version </dev/null >&5) 2>&5 1313 (eval $ac_compiler --version </dev/null >&5) 2>&5
1637 ac_status=$? 1314 ac_status=$?
1638 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1315 echo "$as_me:1315: \$? = $ac_status" >&5
1639 (exit $ac_status); } 1316 (exit $ac_status); }
1640{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 1317{ (eval echo "$as_me:1317: \"$ac_compiler -v </dev/null >&5\"") >&5
1641 (eval $ac_compiler -v </dev/null >&5) 2>&5 1318 (eval $ac_compiler -v </dev/null >&5) 2>&5
1642 ac_status=$? 1319 ac_status=$?
1643 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1320 echo "$as_me:1320: \$? = $ac_status" >&5
1644 (exit $ac_status); } 1321 (exit $ac_status); }
1645{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 1322{ (eval echo "$as_me:1322: \"$ac_compiler -V </dev/null >&5\"") >&5
1646 (eval $ac_compiler -V </dev/null >&5) 2>&5 1323 (eval $ac_compiler -V </dev/null >&5) 2>&5
1647 ac_status=$? 1324 ac_status=$?
1648 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1325 echo "$as_me:1325: \$? = $ac_status" >&5
1649 (exit $ac_status); } 1326 (exit $ac_status); }
1650 1327
1651cat >conftest.$ac_ext <<_ACEOF 1328cat >conftest.$ac_ext <<_ACEOF
1652#line $LINENO "configure" 1329#line 1329 "configure"
1653/* confdefs.h. */ 1330#include "confdefs.h"
1654_ACEOF
1655cat confdefs.h >>conftest.$ac_ext
1656cat >>conftest.$ac_ext <<_ACEOF
1657/* end confdefs.h. */
1658 1331
1659int 1332int
1660main () 1333main ()
@@ -1665,120 +1338,100 @@ main ()
1665} 1338}
1666_ACEOF 1339_ACEOF
1667ac_clean_files_save=$ac_clean_files 1340ac_clean_files_save=$ac_clean_files
1668ac_clean_files="$ac_clean_files a.out a.exe b.out" 1341ac_clean_files="$ac_clean_files a.out a.exe"
1669# Try to create an executable without -o first, disregard a.out. 1342# Try to create an executable without -o first, disregard a.out.
1670# It will help us diagnose broken compilers, and finding out an intuition 1343# It will help us diagnose broken compilers, and finding out an intuition
1671# of exeext. 1344# of exeext.
1672echo "$as_me:$LINENO: checking for C compiler default output" >&5 1345echo "$as_me:1345: checking for C compiler default output" >&5
1673echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 1346echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1674ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` 1347ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1675if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 1348if { (eval echo "$as_me:1348: \"$ac_link_default\"") >&5
1676 (eval $ac_link_default) 2>&5 1349 (eval $ac_link_default) 2>&5
1677 ac_status=$? 1350 ac_status=$?
1678 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1351 echo "$as_me:1351: \$? = $ac_status" >&5
1679 (exit $ac_status); }; then 1352 (exit $ac_status); }; then
1680 # Find the output, starting from the most likely. This scheme is 1353 # Find the output, starting from the most likely. This scheme is
1681# not robust to junk in `.', hence go to wildcards (a.*) only as a last 1354# not robust to junk in `.', hence go to wildcards (a.*) only as a last
1682# resort. 1355# resort.
1683 1356for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1684# Be careful to initialize this variable, since it used to be cached. 1357 ls a.out conftest 2>/dev/null;
1685# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. 1358 ls a.* conftest.* 2>/dev/null`; do
1686ac_cv_exeext=
1687# b.out is created by i960 compilers.
1688for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
1689do
1690 test -f "$ac_file" || continue
1691 case $ac_file in 1359 case $ac_file in
1692 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) 1360 *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
1693 ;; 1361 a.out ) # We found the default executable, but exeext='' is most
1694 conftest.$ac_ext ) 1362 # certainly right.
1695 # This is the source file. 1363 break;;
1696 ;; 1364 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1697 [ab].out ) 1365 # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1698 # We found the default executable, but exeext='' is most 1366 export ac_cv_exeext
1699 # certainly right. 1367 break;;
1700 break;; 1368 * ) break;;
1701 *.* )
1702 ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1703 # FIXME: I believe we export ac_cv_exeext for Libtool,
1704 # but it would be cool to find out if it's true. Does anybody
1705 # maintain Libtool? --akim.
1706 export ac_cv_exeext
1707 break;;
1708 * )
1709 break;;
1710 esac 1369 esac
1711done 1370done
1712else 1371else
1713 echo "$as_me: failed program was:" >&5 1372 echo "$as_me: failed program was:" >&5
1714sed 's/^/| /' conftest.$ac_ext >&5 1373cat conftest.$ac_ext >&5
1715 1374{ { echo "$as_me:1374: error: C compiler cannot create executables" >&5
1716{ { echo "$as_me:$LINENO: error: C compiler cannot create executables 1375echo "$as_me: error: C compiler cannot create executables" >&2;}
1717See \`config.log' for more details." >&5
1718echo "$as_me: error: C compiler cannot create executables
1719See \`config.log' for more details." >&2;}
1720 { (exit 77); exit 77; }; } 1376 { (exit 77); exit 77; }; }
1721fi 1377fi
1722 1378
1723ac_exeext=$ac_cv_exeext 1379ac_exeext=$ac_cv_exeext
1724echo "$as_me:$LINENO: result: $ac_file" >&5 1380echo "$as_me:1380: result: $ac_file" >&5
1725echo "${ECHO_T}$ac_file" >&6 1381echo "${ECHO_T}$ac_file" >&6
1726 1382
1727# Check the compiler produces executables we can run. If not, either 1383# Check the compiler produces executables we can run. If not, either
1728# the compiler is broken, or we cross compile. 1384# the compiler is broken, or we cross compile.
1729echo "$as_me:$LINENO: checking whether the C compiler works" >&5 1385echo "$as_me:1385: checking whether the C compiler works" >&5
1730echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 1386echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1731# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 1387# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1732# If not cross compiling, check that we can run a simple program. 1388# If not cross compiling, check that we can run a simple program.
1733if test "$cross_compiling" != yes; then 1389if test "$cross_compiling" != yes; then
1734 if { ac_try='./$ac_file' 1390 if { ac_try='./$ac_file'
1735 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1391 { (eval echo "$as_me:1391: \"$ac_try\"") >&5
1736 (eval $ac_try) 2>&5 1392 (eval $ac_try) 2>&5
1737 ac_status=$? 1393 ac_status=$?
1738 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1394 echo "$as_me:1394: \$? = $ac_status" >&5
1739 (exit $ac_status); }; }; then 1395 (exit $ac_status); }; }; then
1740 cross_compiling=no 1396 cross_compiling=no
1741 else 1397 else
1742 if test "$cross_compiling" = maybe; then 1398 if test "$cross_compiling" = maybe; then
1743 cross_compiling=yes 1399 cross_compiling=yes
1744 else 1400 else
1745 { { echo "$as_me:$LINENO: error: cannot run C compiled programs. 1401 { { echo "$as_me:1401: error: cannot run C compiled programs.
1746If you meant to cross compile, use \`--host'. 1402If you meant to cross compile, use \`--host'." >&5
1747See \`config.log' for more details." >&5
1748echo "$as_me: error: cannot run C compiled programs. 1403echo "$as_me: error: cannot run C compiled programs.
1749If you meant to cross compile, use \`--host'. 1404If you meant to cross compile, use \`--host'." >&2;}
1750See \`config.log' for more details." >&2;}
1751 { (exit 1); exit 1; }; } 1405 { (exit 1); exit 1; }; }
1752 fi 1406 fi
1753 fi 1407 fi
1754fi 1408fi
1755echo "$as_me:$LINENO: result: yes" >&5 1409echo "$as_me:1409: result: yes" >&5
1756echo "${ECHO_T}yes" >&6 1410echo "${ECHO_T}yes" >&6
1757 1411
1758rm -f a.out a.exe conftest$ac_cv_exeext b.out 1412rm -f a.out a.exe conftest$ac_cv_exeext
1759ac_clean_files=$ac_clean_files_save 1413ac_clean_files=$ac_clean_files_save
1760# Check the compiler produces executables we can run. If not, either 1414# Check the compiler produces executables we can run. If not, either
1761# the compiler is broken, or we cross compile. 1415# the compiler is broken, or we cross compile.
1762echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 1416echo "$as_me:1416: checking whether we are cross compiling" >&5
1763echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 1417echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1764echo "$as_me:$LINENO: result: $cross_compiling" >&5 1418echo "$as_me:1418: result: $cross_compiling" >&5
1765echo "${ECHO_T}$cross_compiling" >&6 1419echo "${ECHO_T}$cross_compiling" >&6
1766 1420
1767echo "$as_me:$LINENO: checking for suffix of executables" >&5 1421echo "$as_me:1421: checking for executable suffix" >&5
1768echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 1422echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1769if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 1423if { (eval echo "$as_me:1423: \"$ac_link\"") >&5
1770 (eval $ac_link) 2>&5 1424 (eval $ac_link) 2>&5
1771 ac_status=$? 1425 ac_status=$?
1772 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1426 echo "$as_me:1426: \$? = $ac_status" >&5
1773 (exit $ac_status); }; then 1427 (exit $ac_status); }; then
1774 # If both `conftest.exe' and `conftest' are `present' (well, observable) 1428 # If both `conftest.exe' and `conftest' are `present' (well, observable)
1775# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will 1429# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
1776# work properly (i.e., refer to `conftest.exe'), while it won't with 1430# work properly (i.e., refer to `conftest.exe'), while it won't with
1777# `rm'. 1431# `rm'.
1778for ac_file in conftest.exe conftest conftest.*; do 1432for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1779 test -f "$ac_file" || continue
1780 case $ac_file in 1433 case $ac_file in
1781 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; 1434 *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;;
1782 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` 1435 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1783 export ac_cv_exeext 1436 export ac_cv_exeext
1784 break;; 1437 break;;
@@ -1786,32 +1439,26 @@ for ac_file in conftest.exe conftest conftest.*; do
1786 esac 1439 esac
1787done 1440done
1788else 1441else
1789 { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link 1442 { { echo "$as_me:1442: error: cannot compute EXEEXT: cannot compile and link" >&5
1790See \`config.log' for more details." >&5 1443echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1791echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
1792See \`config.log' for more details." >&2;}
1793 { (exit 1); exit 1; }; } 1444 { (exit 1); exit 1; }; }
1794fi 1445fi
1795 1446
1796rm -f conftest$ac_cv_exeext 1447rm -f conftest$ac_cv_exeext
1797echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 1448echo "$as_me:1448: result: $ac_cv_exeext" >&5
1798echo "${ECHO_T}$ac_cv_exeext" >&6 1449echo "${ECHO_T}$ac_cv_exeext" >&6
1799 1450
1800rm -f conftest.$ac_ext 1451rm -f conftest.$ac_ext
1801EXEEXT=$ac_cv_exeext 1452EXEEXT=$ac_cv_exeext
1802ac_exeext=$EXEEXT 1453ac_exeext=$EXEEXT
1803echo "$as_me:$LINENO: checking for suffix of object files" >&5 1454echo "$as_me:1454: checking for object suffix" >&5
1804echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 1455echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1805if test "${ac_cv_objext+set}" = set; then 1456if test "${ac_cv_objext+set}" = set; then
1806 echo $ECHO_N "(cached) $ECHO_C" >&6 1457 echo $ECHO_N "(cached) $ECHO_C" >&6
1807else 1458else
1808 cat >conftest.$ac_ext <<_ACEOF 1459 cat >conftest.$ac_ext <<_ACEOF
1809#line $LINENO "configure" 1460#line 1460 "configure"
1810/* confdefs.h. */ 1461#include "confdefs.h"
1811_ACEOF
1812cat confdefs.h >>conftest.$ac_ext
1813cat >>conftest.$ac_ext <<_ACEOF
1814/* end confdefs.h. */
1815 1462
1816int 1463int
1817main () 1464main ()
@@ -1822,47 +1469,40 @@ main ()
1822} 1469}
1823_ACEOF 1470_ACEOF
1824rm -f conftest.o conftest.obj 1471rm -f conftest.o conftest.obj
1825if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1472if { (eval echo "$as_me:1472: \"$ac_compile\"") >&5
1826 (eval $ac_compile) 2>&5 1473 (eval $ac_compile) 2>&5
1827 ac_status=$? 1474 ac_status=$?
1828 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1475 echo "$as_me:1475: \$? = $ac_status" >&5
1829 (exit $ac_status); }; then 1476 (exit $ac_status); }; then
1830 for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do 1477 for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1831 case $ac_file in 1478 case $ac_file in
1832 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; 1479 *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;;
1833 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` 1480 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1834 break;; 1481 break;;
1835 esac 1482 esac
1836done 1483done
1837else 1484else
1838 echo "$as_me: failed program was:" >&5 1485 echo "$as_me: failed program was:" >&5
1839sed 's/^/| /' conftest.$ac_ext >&5 1486cat conftest.$ac_ext >&5
1840 1487{ { echo "$as_me:1487: error: cannot compute OBJEXT: cannot compile" >&5
1841{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile 1488echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1842See \`config.log' for more details." >&5
1843echo "$as_me: error: cannot compute suffix of object files: cannot compile
1844See \`config.log' for more details." >&2;}
1845 { (exit 1); exit 1; }; } 1489 { (exit 1); exit 1; }; }
1846fi 1490fi
1847 1491
1848rm -f conftest.$ac_cv_objext conftest.$ac_ext 1492rm -f conftest.$ac_cv_objext conftest.$ac_ext
1849fi 1493fi
1850echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 1494echo "$as_me:1494: result: $ac_cv_objext" >&5
1851echo "${ECHO_T}$ac_cv_objext" >&6 1495echo "${ECHO_T}$ac_cv_objext" >&6
1852OBJEXT=$ac_cv_objext 1496OBJEXT=$ac_cv_objext
1853ac_objext=$OBJEXT 1497ac_objext=$OBJEXT
1854echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 1498echo "$as_me:1498: checking whether we are using the GNU C compiler" >&5
1855echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 1499echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1856if test "${ac_cv_c_compiler_gnu+set}" = set; then 1500if test "${ac_cv_c_compiler_gnu+set}" = set; then
1857 echo $ECHO_N "(cached) $ECHO_C" >&6 1501 echo $ECHO_N "(cached) $ECHO_C" >&6
1858else 1502else
1859 cat >conftest.$ac_ext <<_ACEOF 1503 cat >conftest.$ac_ext <<_ACEOF
1860#line $LINENO "configure" 1504#line 1504 "configure"
1861/* confdefs.h. */ 1505#include "confdefs.h"
1862_ACEOF
1863cat confdefs.h >>conftest.$ac_ext
1864cat >>conftest.$ac_ext <<_ACEOF
1865/* end confdefs.h. */
1866 1506
1867int 1507int
1868main () 1508main ()
@@ -1876,46 +1516,41 @@ main ()
1876} 1516}
1877_ACEOF 1517_ACEOF
1878rm -f conftest.$ac_objext 1518rm -f conftest.$ac_objext
1879if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1519if { (eval echo "$as_me:1519: \"$ac_compile\"") >&5
1880 (eval $ac_compile) 2>&5 1520 (eval $ac_compile) 2>&5
1881 ac_status=$? 1521 ac_status=$?
1882 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1522 echo "$as_me:1522: \$? = $ac_status" >&5
1883 (exit $ac_status); } && 1523 (exit $ac_status); } &&
1884 { ac_try='test -s conftest.$ac_objext' 1524 { ac_try='test -s conftest.$ac_objext'
1885 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1525 { (eval echo "$as_me:1525: \"$ac_try\"") >&5
1886 (eval $ac_try) 2>&5 1526 (eval $ac_try) 2>&5
1887 ac_status=$? 1527 ac_status=$?
1888 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1528 echo "$as_me:1528: \$? = $ac_status" >&5
1889 (exit $ac_status); }; }; then 1529 (exit $ac_status); }; }; then
1890 ac_compiler_gnu=yes 1530 ac_compiler_gnu=yes
1891else 1531else
1892 echo "$as_me: failed program was:" >&5 1532 echo "$as_me: failed program was:" >&5
1893sed 's/^/| /' conftest.$ac_ext >&5 1533cat conftest.$ac_ext >&5
1894
1895ac_compiler_gnu=no 1534ac_compiler_gnu=no
1896fi 1535fi
1897rm -f conftest.$ac_objext conftest.$ac_ext 1536rm -f conftest.$ac_objext conftest.$ac_ext
1898ac_cv_c_compiler_gnu=$ac_compiler_gnu 1537ac_cv_c_compiler_gnu=$ac_compiler_gnu
1899 1538
1900fi 1539fi
1901echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 1540echo "$as_me:1540: result: $ac_cv_c_compiler_gnu" >&5
1902echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 1541echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1903GCC=`test $ac_compiler_gnu = yes && echo yes` 1542GCC=`test $ac_compiler_gnu = yes && echo yes`
1904ac_test_CFLAGS=${CFLAGS+set} 1543ac_test_CFLAGS=${CFLAGS+set}
1905ac_save_CFLAGS=$CFLAGS 1544ac_save_CFLAGS=$CFLAGS
1906CFLAGS="-g" 1545CFLAGS="-g"
1907echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 1546echo "$as_me:1546: checking whether $CC accepts -g" >&5
1908echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 1547echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1909if test "${ac_cv_prog_cc_g+set}" = set; then 1548if test "${ac_cv_prog_cc_g+set}" = set; then
1910 echo $ECHO_N "(cached) $ECHO_C" >&6 1549 echo $ECHO_N "(cached) $ECHO_C" >&6
1911else 1550else
1912 cat >conftest.$ac_ext <<_ACEOF 1551 cat >conftest.$ac_ext <<_ACEOF
1913#line $LINENO "configure" 1552#line 1552 "configure"
1914/* confdefs.h. */ 1553#include "confdefs.h"
1915_ACEOF
1916cat confdefs.h >>conftest.$ac_ext
1917cat >>conftest.$ac_ext <<_ACEOF
1918/* end confdefs.h. */
1919 1554
1920int 1555int
1921main () 1556main ()
@@ -1926,27 +1561,26 @@ main ()
1926} 1561}
1927_ACEOF 1562_ACEOF
1928rm -f conftest.$ac_objext 1563rm -f conftest.$ac_objext
1929if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1564if { (eval echo "$as_me:1564: \"$ac_compile\"") >&5
1930 (eval $ac_compile) 2>&5 1565 (eval $ac_compile) 2>&5
1931 ac_status=$? 1566 ac_status=$?
1932 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1567 echo "$as_me:1567: \$? = $ac_status" >&5
1933 (exit $ac_status); } && 1568 (exit $ac_status); } &&
1934 { ac_try='test -s conftest.$ac_objext' 1569 { ac_try='test -s conftest.$ac_objext'
1935 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1570 { (eval echo "$as_me:1570: \"$ac_try\"") >&5
1936 (eval $ac_try) 2>&5 1571 (eval $ac_try) 2>&5
1937 ac_status=$? 1572 ac_status=$?
1938 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1573 echo "$as_me:1573: \$? = $ac_status" >&5
1939 (exit $ac_status); }; }; then 1574 (exit $ac_status); }; }; then
1940 ac_cv_prog_cc_g=yes 1575 ac_cv_prog_cc_g=yes
1941else 1576else
1942 echo "$as_me: failed program was:" >&5 1577 echo "$as_me: failed program was:" >&5
1943sed 's/^/| /' conftest.$ac_ext >&5 1578cat conftest.$ac_ext >&5
1944
1945ac_cv_prog_cc_g=no 1579ac_cv_prog_cc_g=no
1946fi 1580fi
1947rm -f conftest.$ac_objext conftest.$ac_ext 1581rm -f conftest.$ac_objext conftest.$ac_ext
1948fi 1582fi
1949echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 1583echo "$as_me:1583: result: $ac_cv_prog_cc_g" >&5
1950echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 1584echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1951if test "$ac_test_CFLAGS" = set; then 1585if test "$ac_test_CFLAGS" = set; then
1952 CFLAGS=$ac_save_CFLAGS 1586 CFLAGS=$ac_save_CFLAGS
@@ -1963,102 +1597,6 @@ else
1963 CFLAGS= 1597 CFLAGS=
1964 fi 1598 fi
1965fi 1599fi
1966echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
1967echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1968if test "${ac_cv_prog_cc_stdc+set}" = set; then
1969 echo $ECHO_N "(cached) $ECHO_C" >&6
1970else
1971 ac_cv_prog_cc_stdc=no
1972ac_save_CC=$CC
1973cat >conftest.$ac_ext <<_ACEOF
1974#line $LINENO "configure"
1975/* confdefs.h. */
1976_ACEOF
1977cat confdefs.h >>conftest.$ac_ext
1978cat >>conftest.$ac_ext <<_ACEOF
1979/* end confdefs.h. */
1980#include <stdarg.h>
1981#include <stdio.h>
1982#include <sys/types.h>
1983#include <sys/stat.h>
1984/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
1985struct buf { int x; };
1986FILE * (*rcsopen) (struct buf *, struct stat *, int);
1987static char *e (p, i)
1988 char **p;
1989 int i;
1990{
1991 return p[i];
1992}
1993static char *f (char * (*g) (char **, int), char **p, ...)
1994{
1995 char *s;
1996 va_list v;
1997 va_start (v,p);
1998 s = g (p, va_arg (v,int));
1999 va_end (v);
2000 return s;
2001}
2002int test (int i, double x);
2003struct s1 {int (*f) (int a);};
2004struct s2 {int (*f) (double a);};
2005int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2006int argc;
2007char **argv;
2008int
2009main ()
2010{
2011return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2012 ;
2013 return 0;
2014}
2015_ACEOF
2016# Don't try gcc -ansi; that turns off useful extensions and
2017# breaks some systems' header files.
2018# AIX -qlanglvl=ansi
2019# Ultrix and OSF/1 -std1
2020# HP-UX 10.20 and later -Ae
2021# HP-UX older versions -Aa -D_HPUX_SOURCE
2022# SVR4 -Xc -D__EXTENSIONS__
2023for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2024do
2025 CC="$ac_save_CC $ac_arg"
2026 rm -f conftest.$ac_objext
2027if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2028 (eval $ac_compile) 2>&5
2029 ac_status=$?
2030 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2031 (exit $ac_status); } &&
2032 { ac_try='test -s conftest.$ac_objext'
2033 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2034 (eval $ac_try) 2>&5
2035 ac_status=$?
2036 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2037 (exit $ac_status); }; }; then
2038 ac_cv_prog_cc_stdc=$ac_arg
2039break
2040else
2041 echo "$as_me: failed program was:" >&5
2042sed 's/^/| /' conftest.$ac_ext >&5
2043
2044fi
2045rm -f conftest.$ac_objext
2046done
2047rm -f conftest.$ac_ext conftest.$ac_objext
2048CC=$ac_save_CC
2049
2050fi
2051
2052case "x$ac_cv_prog_cc_stdc" in
2053 x|xno)
2054 echo "$as_me:$LINENO: result: none needed" >&5
2055echo "${ECHO_T}none needed" >&6 ;;
2056 *)
2057 echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
2058echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2059 CC="$CC $ac_cv_prog_cc_stdc" ;;
2060esac
2061
2062# Some people use a C++ compiler to compile C. Since we use `exit', 1600# Some people use a C++ compiler to compile C. Since we use `exit',
2063# in C++ we need to declare it. In case someone uses the same compiler 1601# in C++ we need to declare it. In case someone uses the same compiler
2064# for both compiling C and C++ we need to have the C++ compiler decide 1602# for both compiling C and C++ we need to have the C++ compiler decide
@@ -2069,16 +1607,16 @@ cat >conftest.$ac_ext <<_ACEOF
2069#endif 1607#endif
2070_ACEOF 1608_ACEOF
2071rm -f conftest.$ac_objext 1609rm -f conftest.$ac_objext
2072if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1610if { (eval echo "$as_me:1610: \"$ac_compile\"") >&5
2073 (eval $ac_compile) 2>&5 1611 (eval $ac_compile) 2>&5
2074 ac_status=$? 1612 ac_status=$?
2075 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1613 echo "$as_me:1613: \$? = $ac_status" >&5
2076 (exit $ac_status); } && 1614 (exit $ac_status); } &&
2077 { ac_try='test -s conftest.$ac_objext' 1615 { ac_try='test -s conftest.$ac_objext'
2078 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1616 { (eval echo "$as_me:1616: \"$ac_try\"") >&5
2079 (eval $ac_try) 2>&5 1617 (eval $ac_try) 2>&5
2080 ac_status=$? 1618 ac_status=$?
2081 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1619 echo "$as_me:1619: \$? = $ac_status" >&5
2082 (exit $ac_status); }; }; then 1620 (exit $ac_status); }; }; then
2083 for ac_declaration in \ 1621 for ac_declaration in \
2084 ''\ 1622 ''\
@@ -2090,12 +1628,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2090 'void exit (int);' 1628 'void exit (int);'
2091do 1629do
2092 cat >conftest.$ac_ext <<_ACEOF 1630 cat >conftest.$ac_ext <<_ACEOF
2093#line $LINENO "configure" 1631#line 1631 "configure"
2094/* confdefs.h. */ 1632#include "confdefs.h"
2095_ACEOF
2096cat confdefs.h >>conftest.$ac_ext
2097cat >>conftest.$ac_ext <<_ACEOF
2098/* end confdefs.h. */
2099#include <stdlib.h> 1633#include <stdlib.h>
2100$ac_declaration 1634$ac_declaration
2101int 1635int
@@ -2107,32 +1641,27 @@ exit (42);
2107} 1641}
2108_ACEOF 1642_ACEOF
2109rm -f conftest.$ac_objext 1643rm -f conftest.$ac_objext
2110if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1644if { (eval echo "$as_me:1644: \"$ac_compile\"") >&5
2111 (eval $ac_compile) 2>&5 1645 (eval $ac_compile) 2>&5
2112 ac_status=$? 1646 ac_status=$?
2113 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1647 echo "$as_me:1647: \$? = $ac_status" >&5
2114 (exit $ac_status); } && 1648 (exit $ac_status); } &&
2115 { ac_try='test -s conftest.$ac_objext' 1649 { ac_try='test -s conftest.$ac_objext'
2116 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1650 { (eval echo "$as_me:1650: \"$ac_try\"") >&5
2117 (eval $ac_try) 2>&5 1651 (eval $ac_try) 2>&5
2118 ac_status=$? 1652 ac_status=$?
2119 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1653 echo "$as_me:1653: \$? = $ac_status" >&5
2120 (exit $ac_status); }; }; then 1654 (exit $ac_status); }; }; then
2121 : 1655 :
2122else 1656else
2123 echo "$as_me: failed program was:" >&5 1657 echo "$as_me: failed program was:" >&5
2124sed 's/^/| /' conftest.$ac_ext >&5 1658cat conftest.$ac_ext >&5
2125
2126continue 1659continue
2127fi 1660fi
2128rm -f conftest.$ac_objext conftest.$ac_ext 1661rm -f conftest.$ac_objext conftest.$ac_ext
2129 cat >conftest.$ac_ext <<_ACEOF 1662 cat >conftest.$ac_ext <<_ACEOF
2130#line $LINENO "configure" 1663#line 1663 "configure"
2131/* confdefs.h. */ 1664#include "confdefs.h"
2132_ACEOF
2133cat confdefs.h >>conftest.$ac_ext
2134cat >>conftest.$ac_ext <<_ACEOF
2135/* end confdefs.h. */
2136$ac_declaration 1665$ac_declaration
2137int 1666int
2138main () 1667main ()
@@ -2143,22 +1672,21 @@ exit (42);
2143} 1672}
2144_ACEOF 1673_ACEOF
2145rm -f conftest.$ac_objext 1674rm -f conftest.$ac_objext
2146if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1675if { (eval echo "$as_me:1675: \"$ac_compile\"") >&5
2147 (eval $ac_compile) 2>&5 1676 (eval $ac_compile) 2>&5
2148 ac_status=$? 1677 ac_status=$?
2149 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1678 echo "$as_me:1678: \$? = $ac_status" >&5
2150 (exit $ac_status); } && 1679 (exit $ac_status); } &&
2151 { ac_try='test -s conftest.$ac_objext' 1680 { ac_try='test -s conftest.$ac_objext'
2152 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1681 { (eval echo "$as_me:1681: \"$ac_try\"") >&5
2153 (eval $ac_try) 2>&5 1682 (eval $ac_try) 2>&5
2154 ac_status=$? 1683 ac_status=$?
2155 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1684 echo "$as_me:1684: \$? = $ac_status" >&5
2156 (exit $ac_status); }; }; then 1685 (exit $ac_status); }; }; then
2157 break 1686 break
2158else 1687else
2159 echo "$as_me: failed program was:" >&5 1688 echo "$as_me: failed program was:" >&5
2160sed 's/^/| /' conftest.$ac_ext >&5 1689cat conftest.$ac_ext >&5
2161
2162fi 1690fi
2163rm -f conftest.$ac_objext conftest.$ac_ext 1691rm -f conftest.$ac_objext conftest.$ac_ext
2164done 1692done
@@ -2171,8 +1699,7 @@ fi
2171 1699
2172else 1700else
2173 echo "$as_me: failed program was:" >&5 1701 echo "$as_me: failed program was:" >&5
2174sed 's/^/| /' conftest.$ac_ext >&5 1702cat conftest.$ac_ext >&5
2175
2176fi 1703fi
2177rm -f conftest.$ac_objext conftest.$ac_ext 1704rm -f conftest.$ac_objext conftest.$ac_ext
2178ac_ext=c 1705ac_ext=c
@@ -2198,7 +1725,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
2198 fi 1725 fi
2199done 1726done
2200if test -z "$ac_aux_dir"; then 1727if test -z "$ac_aux_dir"; then
2201 { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 1728 { { echo "$as_me:1728: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
2202echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} 1729echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
2203 { (exit 1); exit 1; }; } 1730 { (exit 1); exit 1; }; }
2204fi 1731fi
@@ -2208,11 +1735,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
2208 1735
2209# Make sure we can run config.sub. 1736# Make sure we can run config.sub.
2210$ac_config_sub sun4 >/dev/null 2>&1 || 1737$ac_config_sub sun4 >/dev/null 2>&1 ||
2211 { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 1738 { { echo "$as_me:1738: error: cannot run $ac_config_sub" >&5
2212echo "$as_me: error: cannot run $ac_config_sub" >&2;} 1739echo "$as_me: error: cannot run $ac_config_sub" >&2;}
2213 { (exit 1); exit 1; }; } 1740 { (exit 1); exit 1; }; }
2214 1741
2215echo "$as_me:$LINENO: checking build system type" >&5 1742echo "$as_me:1742: checking build system type" >&5
2216echo $ECHO_N "checking build system type... $ECHO_C" >&6 1743echo $ECHO_N "checking build system type... $ECHO_C" >&6
2217if test "${ac_cv_build+set}" = set; then 1744if test "${ac_cv_build+set}" = set; then
2218 echo $ECHO_N "(cached) $ECHO_C" >&6 1745 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2221,24 +1748,23 @@ else
2221test -z "$ac_cv_build_alias" && 1748test -z "$ac_cv_build_alias" &&
2222 ac_cv_build_alias=`$ac_config_guess` 1749 ac_cv_build_alias=`$ac_config_guess`
2223test -z "$ac_cv_build_alias" && 1750test -z "$ac_cv_build_alias" &&
2224 { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 1751 { { echo "$as_me:1751: error: cannot guess build type; you must specify one" >&5
2225echo "$as_me: error: cannot guess build type; you must specify one" >&2;} 1752echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
2226 { (exit 1); exit 1; }; } 1753 { (exit 1); exit 1; }; }
2227ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || 1754ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
2228 { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 1755 { { echo "$as_me:1755: error: $ac_config_sub $ac_cv_build_alias failed." >&5
2229echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} 1756echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
2230 { (exit 1); exit 1; }; } 1757 { (exit 1); exit 1; }; }
2231 1758
2232fi 1759fi
2233echo "$as_me:$LINENO: result: $ac_cv_build" >&5 1760echo "$as_me:1760: result: $ac_cv_build" >&5
2234echo "${ECHO_T}$ac_cv_build" >&6 1761echo "${ECHO_T}$ac_cv_build" >&6
2235build=$ac_cv_build 1762build=$ac_cv_build
2236build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 1763build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
2237build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 1764build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
2238build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 1765build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
2239 1766
2240 1767echo "$as_me:1767: checking host system type" >&5
2241echo "$as_me:$LINENO: checking host system type" >&5
2242echo $ECHO_N "checking host system type... $ECHO_C" >&6 1768echo $ECHO_N "checking host system type... $ECHO_C" >&6
2243if test "${ac_cv_host+set}" = set; then 1769if test "${ac_cv_host+set}" = set; then
2244 echo $ECHO_N "(cached) $ECHO_C" >&6 1770 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2247,33 +1773,28 @@ else
2247test -z "$ac_cv_host_alias" && 1773test -z "$ac_cv_host_alias" &&
2248 ac_cv_host_alias=$ac_cv_build_alias 1774 ac_cv_host_alias=$ac_cv_build_alias
2249ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || 1775ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
2250 { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 1776 { { echo "$as_me:1776: error: $ac_config_sub $ac_cv_host_alias failed" >&5
2251echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} 1777echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
2252 { (exit 1); exit 1; }; } 1778 { (exit 1); exit 1; }; }
2253 1779
2254fi 1780fi
2255echo "$as_me:$LINENO: result: $ac_cv_host" >&5 1781echo "$as_me:1781: result: $ac_cv_host" >&5
2256echo "${ECHO_T}$ac_cv_host" >&6 1782echo "${ECHO_T}$ac_cv_host" >&6
2257host=$ac_cv_host 1783host=$ac_cv_host
2258host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` 1784host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
2259host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` 1785host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
2260host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` 1786host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
2261 1787
2262 1788echo "$as_me:1788: checking whether byte ordering is bigendian" >&5
2263
2264echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
2265echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 1789echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
2266if test "${ac_cv_c_bigendian+set}" = set; then 1790if test "${ac_cv_c_bigendian+set}" = set; then
2267 echo $ECHO_N "(cached) $ECHO_C" >&6 1791 echo $ECHO_N "(cached) $ECHO_C" >&6
2268else 1792else
2269 # See if sys/param.h defines the BYTE_ORDER macro. 1793 ac_cv_c_bigendian=unknown
1794# See if sys/param.h defines the BYTE_ORDER macro.
2270cat >conftest.$ac_ext <<_ACEOF 1795cat >conftest.$ac_ext <<_ACEOF
2271#line $LINENO "configure" 1796#line 1796 "configure"
2272/* confdefs.h. */ 1797#include "confdefs.h"
2273_ACEOF
2274cat confdefs.h >>conftest.$ac_ext
2275cat >>conftest.$ac_ext <<_ACEOF
2276/* end confdefs.h. */
2277#include <sys/types.h> 1798#include <sys/types.h>
2278#include <sys/param.h> 1799#include <sys/param.h>
2279 1800
@@ -2289,25 +1810,21 @@ main ()
2289} 1810}
2290_ACEOF 1811_ACEOF
2291rm -f conftest.$ac_objext 1812rm -f conftest.$ac_objext
2292if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1813if { (eval echo "$as_me:1813: \"$ac_compile\"") >&5
2293 (eval $ac_compile) 2>&5 1814 (eval $ac_compile) 2>&5
2294 ac_status=$? 1815 ac_status=$?
2295 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1816 echo "$as_me:1816: \$? = $ac_status" >&5
2296 (exit $ac_status); } && 1817 (exit $ac_status); } &&
2297 { ac_try='test -s conftest.$ac_objext' 1818 { ac_try='test -s conftest.$ac_objext'
2298 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1819 { (eval echo "$as_me:1819: \"$ac_try\"") >&5
2299 (eval $ac_try) 2>&5 1820 (eval $ac_try) 2>&5
2300 ac_status=$? 1821 ac_status=$?
2301 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1822 echo "$as_me:1822: \$? = $ac_status" >&5
2302 (exit $ac_status); }; }; then 1823 (exit $ac_status); }; }; then
2303 # It does; now see whether it defined to BIG_ENDIAN or not. 1824 # It does; now see whether it defined to BIG_ENDIAN or not.
2304cat >conftest.$ac_ext <<_ACEOF 1825cat >conftest.$ac_ext <<_ACEOF
2305#line $LINENO "configure" 1826#line 1826 "configure"
2306/* confdefs.h. */ 1827#include "confdefs.h"
2307_ACEOF
2308cat confdefs.h >>conftest.$ac_ext
2309cat >>conftest.$ac_ext <<_ACEOF
2310/* end confdefs.h. */
2311#include <sys/types.h> 1828#include <sys/types.h>
2312#include <sys/param.h> 1829#include <sys/param.h>
2313 1830
@@ -2323,91 +1840,38 @@ main ()
2323} 1840}
2324_ACEOF 1841_ACEOF
2325rm -f conftest.$ac_objext 1842rm -f conftest.$ac_objext
2326if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 1843if { (eval echo "$as_me:1843: \"$ac_compile\"") >&5
2327 (eval $ac_compile) 2>&5 1844 (eval $ac_compile) 2>&5
2328 ac_status=$? 1845 ac_status=$?
2329 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1846 echo "$as_me:1846: \$? = $ac_status" >&5
2330 (exit $ac_status); } && 1847 (exit $ac_status); } &&
2331 { ac_try='test -s conftest.$ac_objext' 1848 { ac_try='test -s conftest.$ac_objext'
2332 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1849 { (eval echo "$as_me:1849: \"$ac_try\"") >&5
2333 (eval $ac_try) 2>&5 1850 (eval $ac_try) 2>&5
2334 ac_status=$? 1851 ac_status=$?
2335 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1852 echo "$as_me:1852: \$? = $ac_status" >&5
2336 (exit $ac_status); }; }; then 1853 (exit $ac_status); }; }; then
2337 ac_cv_c_bigendian=yes 1854 ac_cv_c_bigendian=yes
2338else 1855else
2339 echo "$as_me: failed program was:" >&5 1856 echo "$as_me: failed program was:" >&5
2340sed 's/^/| /' conftest.$ac_ext >&5 1857cat conftest.$ac_ext >&5
2341
2342ac_cv_c_bigendian=no 1858ac_cv_c_bigendian=no
2343fi 1859fi
2344rm -f conftest.$ac_objext conftest.$ac_ext 1860rm -f conftest.$ac_objext conftest.$ac_ext
2345else 1861else
2346 echo "$as_me: failed program was:" >&5 1862 echo "$as_me: failed program was:" >&5
2347sed 's/^/| /' conftest.$ac_ext >&5 1863cat conftest.$ac_ext >&5
2348
2349# It does not; compile a test program.
2350if test "$cross_compiling" = yes; then
2351 # try to guess the endianness by grepping values into an object file
2352 ac_cv_c_bigendian=unknown
2353 cat >conftest.$ac_ext <<_ACEOF
2354#line $LINENO "configure"
2355/* confdefs.h. */
2356_ACEOF
2357cat confdefs.h >>conftest.$ac_ext
2358cat >>conftest.$ac_ext <<_ACEOF
2359/* end confdefs.h. */
2360short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
2361short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
2362void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
2363short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
2364short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
2365void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
2366int
2367main ()
2368{
2369 _ascii (); _ebcdic ();
2370 ;
2371 return 0;
2372}
2373_ACEOF
2374rm -f conftest.$ac_objext
2375if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
2376 (eval $ac_compile) 2>&5
2377 ac_status=$?
2378 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2379 (exit $ac_status); } &&
2380 { ac_try='test -s conftest.$ac_objext'
2381 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
2382 (eval $ac_try) 2>&5
2383 ac_status=$?
2384 echo "$as_me:$LINENO: \$? = $ac_status" >&5
2385 (exit $ac_status); }; }; then
2386 if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
2387 ac_cv_c_bigendian=yes
2388fi
2389if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
2390 if test "$ac_cv_c_bigendian" = unknown; then
2391 ac_cv_c_bigendian=no
2392 else
2393 # finding both strings is unlikely to happen, but who knows?
2394 ac_cv_c_bigendian=unknown
2395 fi
2396fi
2397else
2398 echo "$as_me: failed program was:" >&5
2399sed 's/^/| /' conftest.$ac_ext >&5
2400
2401fi 1864fi
2402rm -f conftest.$ac_objext conftest.$ac_ext 1865rm -f conftest.$ac_objext conftest.$ac_ext
1866if test $ac_cv_c_bigendian = unknown; then
1867if test "$cross_compiling" = yes; then
1868 { { echo "$as_me:1868: error: cannot run test program while cross compiling" >&5
1869echo "$as_me: error: cannot run test program while cross compiling" >&2;}
1870 { (exit 1); exit 1; }; }
2403else 1871else
2404 cat >conftest.$ac_ext <<_ACEOF 1872 cat >conftest.$ac_ext <<_ACEOF
2405#line $LINENO "configure" 1873#line 1873 "configure"
2406/* confdefs.h. */ 1874#include "confdefs.h"
2407_ACEOF
2408cat confdefs.h >>conftest.$ac_ext
2409cat >>conftest.$ac_ext <<_ACEOF
2410/* end confdefs.h. */
2411int 1875int
2412main () 1876main ()
2413{ 1877{
@@ -2422,57 +1886,81 @@ main ()
2422} 1886}
2423_ACEOF 1887_ACEOF
2424rm -f conftest$ac_exeext 1888rm -f conftest$ac_exeext
2425if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 1889if { (eval echo "$as_me:1889: \"$ac_link\"") >&5
2426 (eval $ac_link) 2>&5 1890 (eval $ac_link) 2>&5
2427 ac_status=$? 1891 ac_status=$?
2428 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1892 echo "$as_me:1892: \$? = $ac_status" >&5
2429 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 1893 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
2430 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 1894 { (eval echo "$as_me:1894: \"$ac_try\"") >&5
2431 (eval $ac_try) 2>&5 1895 (eval $ac_try) 2>&5
2432 ac_status=$? 1896 ac_status=$?
2433 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1897 echo "$as_me:1897: \$? = $ac_status" >&5
2434 (exit $ac_status); }; }; then 1898 (exit $ac_status); }; }; then
2435 ac_cv_c_bigendian=no 1899 ac_cv_c_bigendian=no
2436else 1900else
2437 echo "$as_me: program exited with status $ac_status" >&5 1901 echo "$as_me: program exited with status $ac_status" >&5
2438echo "$as_me: failed program was:" >&5 1902echo "$as_me: failed program was:" >&5
2439sed 's/^/| /' conftest.$ac_ext >&5 1903cat conftest.$ac_ext >&5
2440
2441( exit $ac_status )
2442ac_cv_c_bigendian=yes 1904ac_cv_c_bigendian=yes
2443fi 1905fi
2444rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 1906rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
2445fi 1907fi
2446fi 1908fi
2447rm -f conftest.$ac_objext conftest.$ac_ext
2448fi 1909fi
2449echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 1910echo "$as_me:1910: result: $ac_cv_c_bigendian" >&5
2450echo "${ECHO_T}$ac_cv_c_bigendian" >&6 1911echo "${ECHO_T}$ac_cv_c_bigendian" >&6
2451case $ac_cv_c_bigendian in 1912if test $ac_cv_c_bigendian = yes; then
2452 yes)
2453 1913
2454cat >>confdefs.h <<\_ACEOF 1914cat >>confdefs.h <<\EOF
2455#define WORDS_BIGENDIAN 1 1915#define WORDS_BIGENDIAN 1
2456_ACEOF 1916EOF
2457 ;;
2458 no)
2459 ;;
2460 *)
2461 { { echo "$as_me:$LINENO: error: unknown endianness
2462presetting ac_cv_c_bigendian=no (or yes) will help" >&5
2463echo "$as_me: error: unknown endianness
2464presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
2465 { (exit 1); exit 1; }; } ;;
2466esac
2467 1917
1918fi
2468 1919
2469# Checks for programs. 1920# Checks for programs.
1921for ac_prog in mawk gawk nawk awk
1922do
1923 # Extract the first word of "$ac_prog", so it can be a program name with args.
1924set dummy $ac_prog; ac_word=$2
1925echo "$as_me:1925: checking for $ac_word" >&5
1926echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1927if test "${ac_cv_prog_AWK+set}" = set; then
1928 echo $ECHO_N "(cached) $ECHO_C" >&6
1929else
1930 if test -n "$AWK"; then
1931 ac_cv_prog_AWK="$AWK" # Let the user override the test.
1932else
1933 ac_save_IFS=$IFS; IFS=$ac_path_separator
1934ac_dummy="$PATH"
1935for ac_dir in $ac_dummy; do
1936 IFS=$ac_save_IFS
1937 test -z "$ac_dir" && ac_dir=.
1938 $as_executable_p "$ac_dir/$ac_word" || continue
1939ac_cv_prog_AWK="$ac_prog"
1940echo "$as_me:1940: found $ac_dir/$ac_word" >&5
1941break
1942done
1943
1944fi
1945fi
1946AWK=$ac_cv_prog_AWK
1947if test -n "$AWK"; then
1948 echo "$as_me:1948: result: $AWK" >&5
1949echo "${ECHO_T}$AWK" >&6
1950else
1951 echo "$as_me:1951: result: no" >&5
1952echo "${ECHO_T}no" >&6
1953fi
1954
1955 test -n "$AWK" && break
1956done
1957
2470ac_ext=c 1958ac_ext=c
2471ac_cpp='$CPP $CPPFLAGS' 1959ac_cpp='$CPP $CPPFLAGS'
2472ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 1960ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2473ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 1961ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2474ac_compiler_gnu=$ac_cv_c_compiler_gnu 1962ac_compiler_gnu=$ac_cv_c_compiler_gnu
2475echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 1963echo "$as_me:1963: checking how to run the C preprocessor" >&5
2476echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 1964echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2477# On Suns, sometimes $CPP names a directory. 1965# On Suns, sometimes $CPP names a directory.
2478if test -n "$CPP" && test -d "$CPP"; then 1966if test -n "$CPP" && test -d "$CPP"; then
@@ -2490,31 +1978,21 @@ for ac_c_preproc_warn_flag in '' yes
2490do 1978do
2491 # Use a header file that comes with gcc, so configuring glibc 1979 # Use a header file that comes with gcc, so configuring glibc
2492 # with a fresh cross-compiler works. 1980 # with a fresh cross-compiler works.
2493 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2494 # <limits.h> exists even on freestanding compilers.
2495 # On the NeXT, cc -E runs the code through the compiler's parser, 1981 # On the NeXT, cc -E runs the code through the compiler's parser,
2496 # not just through cpp. "Syntax error" is here to catch this case. 1982 # not just through cpp. "Syntax error" is here to catch this case.
2497 cat >conftest.$ac_ext <<_ACEOF 1983 cat >conftest.$ac_ext <<_ACEOF
2498#line $LINENO "configure" 1984#line 1984 "configure"
2499/* confdefs.h. */ 1985#include "confdefs.h"
2500_ACEOF 1986#include <assert.h>
2501cat confdefs.h >>conftest.$ac_ext
2502cat >>conftest.$ac_ext <<_ACEOF
2503/* end confdefs.h. */
2504#ifdef __STDC__
2505# include <limits.h>
2506#else
2507# include <assert.h>
2508#endif
2509 Syntax error 1987 Syntax error
2510_ACEOF 1988_ACEOF
2511if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 1989if { (eval echo "$as_me:1989: \"$ac_cpp conftest.$ac_ext\"") >&5
2512 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 1990 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2513 ac_status=$? 1991 ac_status=$?
2514 grep -v '^ *+' conftest.er1 >conftest.err 1992 egrep -v '^ *\+' conftest.er1 >conftest.err
2515 rm -f conftest.er1 1993 rm -f conftest.er1
2516 cat conftest.err >&5 1994 cat conftest.err >&5
2517 echo "$as_me:$LINENO: \$? = $ac_status" >&5 1995 echo "$as_me:1995: \$? = $ac_status" >&5
2518 (exit $ac_status); } >/dev/null; then 1996 (exit $ac_status); } >/dev/null; then
2519 if test -s conftest.err; then 1997 if test -s conftest.err; then
2520 ac_cpp_err=$ac_c_preproc_warn_flag 1998 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2528,8 +2006,7 @@ if test -z "$ac_cpp_err"; then
2528 : 2006 :
2529else 2007else
2530 echo "$as_me: failed program was:" >&5 2008 echo "$as_me: failed program was:" >&5
2531sed 's/^/| /' conftest.$ac_ext >&5 2009 cat conftest.$ac_ext >&5
2532
2533 # Broken: fails on valid input. 2010 # Broken: fails on valid input.
2534continue 2011continue
2535fi 2012fi
@@ -2538,21 +2015,17 @@ rm -f conftest.err conftest.$ac_ext
2538 # OK, works on sane cases. Now check whether non-existent headers 2015 # OK, works on sane cases. Now check whether non-existent headers
2539 # can be detected and how. 2016 # can be detected and how.
2540 cat >conftest.$ac_ext <<_ACEOF 2017 cat >conftest.$ac_ext <<_ACEOF
2541#line $LINENO "configure" 2018#line 2018 "configure"
2542/* confdefs.h. */ 2019#include "confdefs.h"
2543_ACEOF
2544cat confdefs.h >>conftest.$ac_ext
2545cat >>conftest.$ac_ext <<_ACEOF
2546/* end confdefs.h. */
2547#include <ac_nonexistent.h> 2020#include <ac_nonexistent.h>
2548_ACEOF 2021_ACEOF
2549if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 2022if { (eval echo "$as_me:2022: \"$ac_cpp conftest.$ac_ext\"") >&5
2550 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 2023 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2551 ac_status=$? 2024 ac_status=$?
2552 grep -v '^ *+' conftest.er1 >conftest.err 2025 egrep -v '^ *\+' conftest.er1 >conftest.err
2553 rm -f conftest.er1 2026 rm -f conftest.er1
2554 cat conftest.err >&5 2027 cat conftest.err >&5
2555 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2028 echo "$as_me:2028: \$? = $ac_status" >&5
2556 (exit $ac_status); } >/dev/null; then 2029 (exit $ac_status); } >/dev/null; then
2557 if test -s conftest.err; then 2030 if test -s conftest.err; then
2558 ac_cpp_err=$ac_c_preproc_warn_flag 2031 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2567,8 +2040,7 @@ if test -z "$ac_cpp_err"; then
2567continue 2040continue
2568else 2041else
2569 echo "$as_me: failed program was:" >&5 2042 echo "$as_me: failed program was:" >&5
2570sed 's/^/| /' conftest.$ac_ext >&5 2043 cat conftest.$ac_ext >&5
2571
2572 # Passes both tests. 2044 # Passes both tests.
2573ac_preproc_ok=: 2045ac_preproc_ok=:
2574break 2046break
@@ -2590,38 +2062,28 @@ fi
2590else 2062else
2591 ac_cv_prog_CPP=$CPP 2063 ac_cv_prog_CPP=$CPP
2592fi 2064fi
2593echo "$as_me:$LINENO: result: $CPP" >&5 2065echo "$as_me:2065: result: $CPP" >&5
2594echo "${ECHO_T}$CPP" >&6 2066echo "${ECHO_T}$CPP" >&6
2595ac_preproc_ok=false 2067ac_preproc_ok=false
2596for ac_c_preproc_warn_flag in '' yes 2068for ac_c_preproc_warn_flag in '' yes
2597do 2069do
2598 # Use a header file that comes with gcc, so configuring glibc 2070 # Use a header file that comes with gcc, so configuring glibc
2599 # with a fresh cross-compiler works. 2071 # with a fresh cross-compiler works.
2600 # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
2601 # <limits.h> exists even on freestanding compilers.
2602 # On the NeXT, cc -E runs the code through the compiler's parser, 2072 # On the NeXT, cc -E runs the code through the compiler's parser,
2603 # not just through cpp. "Syntax error" is here to catch this case. 2073 # not just through cpp. "Syntax error" is here to catch this case.
2604 cat >conftest.$ac_ext <<_ACEOF 2074 cat >conftest.$ac_ext <<_ACEOF
2605#line $LINENO "configure" 2075#line 2075 "configure"
2606/* confdefs.h. */ 2076#include "confdefs.h"
2607_ACEOF 2077#include <assert.h>
2608cat confdefs.h >>conftest.$ac_ext
2609cat >>conftest.$ac_ext <<_ACEOF
2610/* end confdefs.h. */
2611#ifdef __STDC__
2612# include <limits.h>
2613#else
2614# include <assert.h>
2615#endif
2616 Syntax error 2078 Syntax error
2617_ACEOF 2079_ACEOF
2618if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 2080if { (eval echo "$as_me:2080: \"$ac_cpp conftest.$ac_ext\"") >&5
2619 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 2081 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2620 ac_status=$? 2082 ac_status=$?
2621 grep -v '^ *+' conftest.er1 >conftest.err 2083 egrep -v '^ *\+' conftest.er1 >conftest.err
2622 rm -f conftest.er1 2084 rm -f conftest.er1
2623 cat conftest.err >&5 2085 cat conftest.err >&5
2624 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2086 echo "$as_me:2086: \$? = $ac_status" >&5
2625 (exit $ac_status); } >/dev/null; then 2087 (exit $ac_status); } >/dev/null; then
2626 if test -s conftest.err; then 2088 if test -s conftest.err; then
2627 ac_cpp_err=$ac_c_preproc_warn_flag 2089 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2635,8 +2097,7 @@ if test -z "$ac_cpp_err"; then
2635 : 2097 :
2636else 2098else
2637 echo "$as_me: failed program was:" >&5 2099 echo "$as_me: failed program was:" >&5
2638sed 's/^/| /' conftest.$ac_ext >&5 2100 cat conftest.$ac_ext >&5
2639
2640 # Broken: fails on valid input. 2101 # Broken: fails on valid input.
2641continue 2102continue
2642fi 2103fi
@@ -2645,21 +2106,17 @@ rm -f conftest.err conftest.$ac_ext
2645 # OK, works on sane cases. Now check whether non-existent headers 2106 # OK, works on sane cases. Now check whether non-existent headers
2646 # can be detected and how. 2107 # can be detected and how.
2647 cat >conftest.$ac_ext <<_ACEOF 2108 cat >conftest.$ac_ext <<_ACEOF
2648#line $LINENO "configure" 2109#line 2109 "configure"
2649/* confdefs.h. */ 2110#include "confdefs.h"
2650_ACEOF
2651cat confdefs.h >>conftest.$ac_ext
2652cat >>conftest.$ac_ext <<_ACEOF
2653/* end confdefs.h. */
2654#include <ac_nonexistent.h> 2111#include <ac_nonexistent.h>
2655_ACEOF 2112_ACEOF
2656if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 2113if { (eval echo "$as_me:2113: \"$ac_cpp conftest.$ac_ext\"") >&5
2657 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 2114 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2658 ac_status=$? 2115 ac_status=$?
2659 grep -v '^ *+' conftest.er1 >conftest.err 2116 egrep -v '^ *\+' conftest.er1 >conftest.err
2660 rm -f conftest.er1 2117 rm -f conftest.er1
2661 cat conftest.err >&5 2118 cat conftest.err >&5
2662 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2119 echo "$as_me:2119: \$? = $ac_status" >&5
2663 (exit $ac_status); } >/dev/null; then 2120 (exit $ac_status); } >/dev/null; then
2664 if test -s conftest.err; then 2121 if test -s conftest.err; then
2665 ac_cpp_err=$ac_c_preproc_warn_flag 2122 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -2674,8 +2131,7 @@ if test -z "$ac_cpp_err"; then
2674continue 2131continue
2675else 2132else
2676 echo "$as_me: failed program was:" >&5 2133 echo "$as_me: failed program was:" >&5
2677sed 's/^/| /' conftest.$ac_ext >&5 2134 cat conftest.$ac_ext >&5
2678
2679 # Passes both tests. 2135 # Passes both tests.
2680ac_preproc_ok=: 2136ac_preproc_ok=:
2681break 2137break
@@ -2688,10 +2144,8 @@ rm -f conftest.err conftest.$ac_ext
2688if $ac_preproc_ok; then 2144if $ac_preproc_ok; then
2689 : 2145 :
2690else 2146else
2691 { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check 2147 { { echo "$as_me:2147: error: C preprocessor \"$CPP\" fails sanity check" >&5
2692See \`config.log' for more details." >&5 2148echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2693echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
2694See \`config.log' for more details." >&2;}
2695 { (exit 1); exit 1; }; } 2149 { (exit 1); exit 1; }; }
2696fi 2150fi
2697 2151
@@ -2704,7 +2158,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
2704if test -n "$ac_tool_prefix"; then 2158if test -n "$ac_tool_prefix"; then
2705 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. 2159 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
2706set dummy ${ac_tool_prefix}ranlib; ac_word=$2 2160set dummy ${ac_tool_prefix}ranlib; ac_word=$2
2707echo "$as_me:$LINENO: checking for $ac_word" >&5 2161echo "$as_me:2161: checking for $ac_word" >&5
2708echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2162echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2709if test "${ac_cv_prog_RANLIB+set}" = set; then 2163if test "${ac_cv_prog_RANLIB+set}" = set; then
2710 echo $ECHO_N "(cached) $ECHO_C" >&6 2164 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2712,28 +2166,25 @@ else
2712 if test -n "$RANLIB"; then 2166 if test -n "$RANLIB"; then
2713 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. 2167 ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
2714else 2168else
2715as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2169 ac_save_IFS=$IFS; IFS=$ac_path_separator
2716for as_dir in $PATH 2170ac_dummy="$PATH"
2717do 2171for ac_dir in $ac_dummy; do
2718 IFS=$as_save_IFS 2172 IFS=$ac_save_IFS
2719 test -z "$as_dir" && as_dir=. 2173 test -z "$ac_dir" && ac_dir=.
2720 for ac_exec_ext in '' $ac_executable_extensions; do 2174 $as_executable_p "$ac_dir/$ac_word" || continue
2721 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2175ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
2722 ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" 2176echo "$as_me:2176: found $ac_dir/$ac_word" >&5
2723 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2177break
2724 break 2
2725 fi
2726done
2727done 2178done
2728 2179
2729fi 2180fi
2730fi 2181fi
2731RANLIB=$ac_cv_prog_RANLIB 2182RANLIB=$ac_cv_prog_RANLIB
2732if test -n "$RANLIB"; then 2183if test -n "$RANLIB"; then
2733 echo "$as_me:$LINENO: result: $RANLIB" >&5 2184 echo "$as_me:2184: result: $RANLIB" >&5
2734echo "${ECHO_T}$RANLIB" >&6 2185echo "${ECHO_T}$RANLIB" >&6
2735else 2186else
2736 echo "$as_me:$LINENO: result: no" >&5 2187 echo "$as_me:2187: result: no" >&5
2737echo "${ECHO_T}no" >&6 2188echo "${ECHO_T}no" >&6
2738fi 2189fi
2739 2190
@@ -2742,7 +2193,7 @@ if test -z "$ac_cv_prog_RANLIB"; then
2742 ac_ct_RANLIB=$RANLIB 2193 ac_ct_RANLIB=$RANLIB
2743 # Extract the first word of "ranlib", so it can be a program name with args. 2194 # Extract the first word of "ranlib", so it can be a program name with args.
2744set dummy ranlib; ac_word=$2 2195set dummy ranlib; ac_word=$2
2745echo "$as_me:$LINENO: checking for $ac_word" >&5 2196echo "$as_me:2196: checking for $ac_word" >&5
2746echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2197echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2747if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then 2198if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
2748 echo $ECHO_N "(cached) $ECHO_C" >&6 2199 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2750,18 +2201,15 @@ else
2750 if test -n "$ac_ct_RANLIB"; then 2201 if test -n "$ac_ct_RANLIB"; then
2751 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. 2202 ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
2752else 2203else
2753as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2204 ac_save_IFS=$IFS; IFS=$ac_path_separator
2754for as_dir in $PATH 2205ac_dummy="$PATH"
2755do 2206for ac_dir in $ac_dummy; do
2756 IFS=$as_save_IFS 2207 IFS=$ac_save_IFS
2757 test -z "$as_dir" && as_dir=. 2208 test -z "$ac_dir" && ac_dir=.
2758 for ac_exec_ext in '' $ac_executable_extensions; do 2209 $as_executable_p "$ac_dir/$ac_word" || continue
2759 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2210ac_cv_prog_ac_ct_RANLIB="ranlib"
2760 ac_cv_prog_ac_ct_RANLIB="ranlib" 2211echo "$as_me:2211: found $ac_dir/$ac_word" >&5
2761 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2212break
2762 break 2
2763 fi
2764done
2765done 2213done
2766 2214
2767 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" 2215 test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
@@ -2769,10 +2217,10 @@ fi
2769fi 2217fi
2770ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB 2218ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
2771if test -n "$ac_ct_RANLIB"; then 2219if test -n "$ac_ct_RANLIB"; then
2772 echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 2220 echo "$as_me:2220: result: $ac_ct_RANLIB" >&5
2773echo "${ECHO_T}$ac_ct_RANLIB" >&6 2221echo "${ECHO_T}$ac_ct_RANLIB" >&6
2774else 2222else
2775 echo "$as_me:$LINENO: result: no" >&5 2223 echo "$as_me:2223: result: no" >&5
2776echo "${ECHO_T}no" >&6 2224echo "${ECHO_T}no" >&6
2777fi 2225fi
2778 2226
@@ -2793,48 +2241,43 @@ fi
2793# AFS /usr/afsws/bin/install, which mishandles nonexistent args 2241# AFS /usr/afsws/bin/install, which mishandles nonexistent args
2794# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" 2242# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2795# ./install, which can be erroneously created by make from ./install.sh. 2243# ./install, which can be erroneously created by make from ./install.sh.
2796echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 2244echo "$as_me:2244: checking for a BSD compatible install" >&5
2797echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 2245echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2798if test -z "$INSTALL"; then 2246if test -z "$INSTALL"; then
2799if test "${ac_cv_path_install+set}" = set; then 2247if test "${ac_cv_path_install+set}" = set; then
2800 echo $ECHO_N "(cached) $ECHO_C" >&6 2248 echo $ECHO_N "(cached) $ECHO_C" >&6
2801else 2249else
2802 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2250 ac_save_IFS=$IFS; IFS=$ac_path_separator
2803for as_dir in $PATH 2251 for ac_dir in $PATH; do
2804do 2252 IFS=$ac_save_IFS
2805 IFS=$as_save_IFS 2253 # Account for people who put trailing slashes in PATH elements.
2806 test -z "$as_dir" && as_dir=. 2254 case $ac_dir/ in
2807 # Account for people who put trailing slashes in PATH elements. 2255 / | ./ | .// | /cC/* \
2808case $as_dir/ in 2256 | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2809 ./ | .// | /cC/* | \ 2257 | /usr/ucb/* ) ;;
2810 /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ 2258 *)
2811 /usr/ucb/* ) ;; 2259 # OSF1 and SCO ODT 3.0 have their own names for install.
2812 *) 2260 # Don't use installbsd from OSF since it installs stuff as root
2813 # OSF1 and SCO ODT 3.0 have their own names for install. 2261 # by default.
2814 # Don't use installbsd from OSF since it installs stuff as root 2262 for ac_prog in ginstall scoinst install; do
2815 # by default. 2263 if $as_executable_p "$ac_dir/$ac_prog"; then
2816 for ac_prog in ginstall scoinst install; do 2264 if test $ac_prog = install &&
2817 for ac_exec_ext in '' $ac_executable_extensions; do 2265 grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2818 if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then 2266 # AIX install. It has an incompatible calling convention.
2819 if test $ac_prog = install && 2267 :
2820 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then 2268 elif test $ac_prog = install &&
2821 # AIX install. It has an incompatible calling convention. 2269 grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2822 : 2270 # program-specific install script used by HP pwplus--don't use.
2823 elif test $ac_prog = install && 2271 :
2824 grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then 2272 else
2825 # program-specific install script used by HP pwplus--don't use. 2273 ac_cv_path_install="$ac_dir/$ac_prog -c"
2826 : 2274 break 2
2827 else 2275 fi
2828 ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" 2276 fi
2829 break 3
2830 fi
2831 fi
2832 done 2277 done
2833 done 2278 ;;
2834 ;; 2279 esac
2835esac 2280 done
2836done
2837
2838 2281
2839fi 2282fi
2840 if test "${ac_cv_path_install+set}" = set; then 2283 if test "${ac_cv_path_install+set}" = set; then
@@ -2847,7 +2290,7 @@ fi
2847 INSTALL=$ac_install_sh 2290 INSTALL=$ac_install_sh
2848 fi 2291 fi
2849fi 2292fi
2850echo "$as_me:$LINENO: result: $INSTALL" >&5 2293echo "$as_me:2293: result: $INSTALL" >&5
2851echo "${ECHO_T}$INSTALL" >&6 2294echo "${ECHO_T}$INSTALL" >&6
2852 2295
2853# Use test -z because SunOS4 sh mishandles braces in ${var-val}. 2296# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
@@ -2860,7 +2303,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2860 2303
2861# Extract the first word of "ar", so it can be a program name with args. 2304# Extract the first word of "ar", so it can be a program name with args.
2862set dummy ar; ac_word=$2 2305set dummy ar; ac_word=$2
2863echo "$as_me:$LINENO: checking for $ac_word" >&5 2306echo "$as_me:2306: checking for $ac_word" >&5
2864echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2307echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2865if test "${ac_cv_path_AR+set}" = set; then 2308if test "${ac_cv_path_AR+set}" = set; then
2866 echo $ECHO_N "(cached) $ECHO_C" >&6 2309 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2870,18 +2313,16 @@ else
2870 ac_cv_path_AR="$AR" # Let the user override the test with a path. 2313 ac_cv_path_AR="$AR" # Let the user override the test with a path.
2871 ;; 2314 ;;
2872 *) 2315 *)
2873 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2316 ac_save_IFS=$IFS; IFS=$ac_path_separator
2874for as_dir in $PATH 2317ac_dummy="$PATH"
2875do 2318for ac_dir in $ac_dummy; do
2876 IFS=$as_save_IFS 2319 IFS=$ac_save_IFS
2877 test -z "$as_dir" && as_dir=. 2320 test -z "$ac_dir" && ac_dir=.
2878 for ac_exec_ext in '' $ac_executable_extensions; do 2321 if $as_executable_p "$ac_dir/$ac_word"; then
2879 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2322 ac_cv_path_AR="$ac_dir/$ac_word"
2880 ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext" 2323 echo "$as_me:2323: found $ac_dir/$ac_word" >&5
2881 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2324 break
2882 break 2 2325fi
2883 fi
2884done
2885done 2326done
2886 2327
2887 ;; 2328 ;;
@@ -2890,10 +2331,10 @@ fi
2890AR=$ac_cv_path_AR 2331AR=$ac_cv_path_AR
2891 2332
2892if test -n "$AR"; then 2333if test -n "$AR"; then
2893 echo "$as_me:$LINENO: result: $AR" >&5 2334 echo "$as_me:2334: result: $AR" >&5
2894echo "${ECHO_T}$AR" >&6 2335echo "${ECHO_T}$AR" >&6
2895else 2336else
2896 echo "$as_me:$LINENO: result: no" >&5 2337 echo "$as_me:2337: result: no" >&5
2897echo "${ECHO_T}no" >&6 2338echo "${ECHO_T}no" >&6
2898fi 2339fi
2899 2340
@@ -2901,7 +2342,7 @@ for ac_prog in perl5 perl
2901do 2342do
2902 # Extract the first word of "$ac_prog", so it can be a program name with args. 2343 # Extract the first word of "$ac_prog", so it can be a program name with args.
2903set dummy $ac_prog; ac_word=$2 2344set dummy $ac_prog; ac_word=$2
2904echo "$as_me:$LINENO: checking for $ac_word" >&5 2345echo "$as_me:2345: checking for $ac_word" >&5
2905echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2346echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2906if test "${ac_cv_path_PERL+set}" = set; then 2347if test "${ac_cv_path_PERL+set}" = set; then
2907 echo $ECHO_N "(cached) $ECHO_C" >&6 2348 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2911,18 +2352,16 @@ else
2911 ac_cv_path_PERL="$PERL" # Let the user override the test with a path. 2352 ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
2912 ;; 2353 ;;
2913 *) 2354 *)
2914 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2355 ac_save_IFS=$IFS; IFS=$ac_path_separator
2915for as_dir in $PATH 2356ac_dummy="$PATH"
2916do 2357for ac_dir in $ac_dummy; do
2917 IFS=$as_save_IFS 2358 IFS=$ac_save_IFS
2918 test -z "$as_dir" && as_dir=. 2359 test -z "$ac_dir" && ac_dir=.
2919 for ac_exec_ext in '' $ac_executable_extensions; do 2360 if $as_executable_p "$ac_dir/$ac_word"; then
2920 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2361 ac_cv_path_PERL="$ac_dir/$ac_word"
2921 ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" 2362 echo "$as_me:2362: found $ac_dir/$ac_word" >&5
2922 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2363 break
2923 break 2 2364fi
2924 fi
2925done
2926done 2365done
2927 2366
2928 ;; 2367 ;;
@@ -2931,10 +2370,10 @@ fi
2931PERL=$ac_cv_path_PERL 2370PERL=$ac_cv_path_PERL
2932 2371
2933if test -n "$PERL"; then 2372if test -n "$PERL"; then
2934 echo "$as_me:$LINENO: result: $PERL" >&5 2373 echo "$as_me:2373: result: $PERL" >&5
2935echo "${ECHO_T}$PERL" >&6 2374echo "${ECHO_T}$PERL" >&6
2936else 2375else
2937 echo "$as_me:$LINENO: result: no" >&5 2376 echo "$as_me:2376: result: no" >&5
2938echo "${ECHO_T}no" >&6 2377echo "${ECHO_T}no" >&6
2939fi 2378fi
2940 2379
@@ -2943,7 +2382,7 @@ done
2943 2382
2944# Extract the first word of "sed", so it can be a program name with args. 2383# Extract the first word of "sed", so it can be a program name with args.
2945set dummy sed; ac_word=$2 2384set dummy sed; ac_word=$2
2946echo "$as_me:$LINENO: checking for $ac_word" >&5 2385echo "$as_me:2385: checking for $ac_word" >&5
2947echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2386echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2948if test "${ac_cv_path_SED+set}" = set; then 2387if test "${ac_cv_path_SED+set}" = set; then
2949 echo $ECHO_N "(cached) $ECHO_C" >&6 2388 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2953,18 +2392,16 @@ else
2953 ac_cv_path_SED="$SED" # Let the user override the test with a path. 2392 ac_cv_path_SED="$SED" # Let the user override the test with a path.
2954 ;; 2393 ;;
2955 *) 2394 *)
2956 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2395 ac_save_IFS=$IFS; IFS=$ac_path_separator
2957for as_dir in $PATH 2396ac_dummy="$PATH"
2958do 2397for ac_dir in $ac_dummy; do
2959 IFS=$as_save_IFS 2398 IFS=$ac_save_IFS
2960 test -z "$as_dir" && as_dir=. 2399 test -z "$ac_dir" && ac_dir=.
2961 for ac_exec_ext in '' $ac_executable_extensions; do 2400 if $as_executable_p "$ac_dir/$ac_word"; then
2962 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2401 ac_cv_path_SED="$ac_dir/$ac_word"
2963 ac_cv_path_SED="$as_dir/$ac_word$ac_exec_ext" 2402 echo "$as_me:2402: found $ac_dir/$ac_word" >&5
2964 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2403 break
2965 break 2 2404fi
2966 fi
2967done
2968done 2405done
2969 2406
2970 ;; 2407 ;;
@@ -2973,17 +2410,16 @@ fi
2973SED=$ac_cv_path_SED 2410SED=$ac_cv_path_SED
2974 2411
2975if test -n "$SED"; then 2412if test -n "$SED"; then
2976 echo "$as_me:$LINENO: result: $SED" >&5 2413 echo "$as_me:2413: result: $SED" >&5
2977echo "${ECHO_T}$SED" >&6 2414echo "${ECHO_T}$SED" >&6
2978else 2415else
2979 echo "$as_me:$LINENO: result: no" >&5 2416 echo "$as_me:2416: result: no" >&5
2980echo "${ECHO_T}no" >&6 2417echo "${ECHO_T}no" >&6
2981fi 2418fi
2982 2419
2983
2984# Extract the first word of "ent", so it can be a program name with args. 2420# Extract the first word of "ent", so it can be a program name with args.
2985set dummy ent; ac_word=$2 2421set dummy ent; ac_word=$2
2986echo "$as_me:$LINENO: checking for $ac_word" >&5 2422echo "$as_me:2422: checking for $ac_word" >&5
2987echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2423echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2988if test "${ac_cv_path_ENT+set}" = set; then 2424if test "${ac_cv_path_ENT+set}" = set; then
2989 echo $ECHO_N "(cached) $ECHO_C" >&6 2425 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -2993,18 +2429,16 @@ else
2993 ac_cv_path_ENT="$ENT" # Let the user override the test with a path. 2429 ac_cv_path_ENT="$ENT" # Let the user override the test with a path.
2994 ;; 2430 ;;
2995 *) 2431 *)
2996 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2432 ac_save_IFS=$IFS; IFS=$ac_path_separator
2997for as_dir in $PATH 2433ac_dummy="$PATH"
2998do 2434for ac_dir in $ac_dummy; do
2999 IFS=$as_save_IFS 2435 IFS=$ac_save_IFS
3000 test -z "$as_dir" && as_dir=. 2436 test -z "$ac_dir" && ac_dir=.
3001 for ac_exec_ext in '' $ac_executable_extensions; do 2437 if $as_executable_p "$ac_dir/$ac_word"; then
3002 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2438 ac_cv_path_ENT="$ac_dir/$ac_word"
3003 ac_cv_path_ENT="$as_dir/$ac_word$ac_exec_ext" 2439 echo "$as_me:2439: found $ac_dir/$ac_word" >&5
3004 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2440 break
3005 break 2 2441fi
3006 fi
3007done
3008done 2442done
3009 2443
3010 ;; 2444 ;;
@@ -3013,17 +2447,16 @@ fi
3013ENT=$ac_cv_path_ENT 2447ENT=$ac_cv_path_ENT
3014 2448
3015if test -n "$ENT"; then 2449if test -n "$ENT"; then
3016 echo "$as_me:$LINENO: result: $ENT" >&5 2450 echo "$as_me:2450: result: $ENT" >&5
3017echo "${ECHO_T}$ENT" >&6 2451echo "${ECHO_T}$ENT" >&6
3018else 2452else
3019 echo "$as_me:$LINENO: result: no" >&5 2453 echo "$as_me:2453: result: no" >&5
3020echo "${ECHO_T}no" >&6 2454echo "${ECHO_T}no" >&6
3021fi 2455fi
3022 2456
3023
3024# Extract the first word of "bash", so it can be a program name with args. 2457# Extract the first word of "bash", so it can be a program name with args.
3025set dummy bash; ac_word=$2 2458set dummy bash; ac_word=$2
3026echo "$as_me:$LINENO: checking for $ac_word" >&5 2459echo "$as_me:2459: checking for $ac_word" >&5
3027echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2460echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3028if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then 2461if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
3029 echo $ECHO_N "(cached) $ECHO_C" >&6 2462 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3033,18 +2466,16 @@ else
3033 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path. 2466 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path.
3034 ;; 2467 ;;
3035 *) 2468 *)
3036 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2469 ac_save_IFS=$IFS; IFS=$ac_path_separator
3037for as_dir in $PATH 2470ac_dummy="$PATH"
3038do 2471for ac_dir in $ac_dummy; do
3039 IFS=$as_save_IFS 2472 IFS=$ac_save_IFS
3040 test -z "$as_dir" && as_dir=. 2473 test -z "$ac_dir" && ac_dir=.
3041 for ac_exec_ext in '' $ac_executable_extensions; do 2474 if $as_executable_p "$ac_dir/$ac_word"; then
3042 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2475 ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
3043 ac_cv_path_TEST_MINUS_S_SH="$as_dir/$ac_word$ac_exec_ext" 2476 echo "$as_me:2476: found $ac_dir/$ac_word" >&5
3044 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2477 break
3045 break 2 2478fi
3046 fi
3047done
3048done 2479done
3049 2480
3050 ;; 2481 ;;
@@ -3053,16 +2484,16 @@ fi
3053TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH 2484TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
3054 2485
3055if test -n "$TEST_MINUS_S_SH"; then 2486if test -n "$TEST_MINUS_S_SH"; then
3056 echo "$as_me:$LINENO: result: $TEST_MINUS_S_SH" >&5 2487 echo "$as_me:2487: result: $TEST_MINUS_S_SH" >&5
3057echo "${ECHO_T}$TEST_MINUS_S_SH" >&6 2488echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
3058else 2489else
3059 echo "$as_me:$LINENO: result: no" >&5 2490 echo "$as_me:2490: result: no" >&5
3060echo "${ECHO_T}no" >&6 2491echo "${ECHO_T}no" >&6
3061fi 2492fi
3062 2493
3063# Extract the first word of "ksh", so it can be a program name with args. 2494# Extract the first word of "ksh", so it can be a program name with args.
3064set dummy ksh; ac_word=$2 2495set dummy ksh; ac_word=$2
3065echo "$as_me:$LINENO: checking for $ac_word" >&5 2496echo "$as_me:2496: checking for $ac_word" >&5
3066echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2497echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3067if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then 2498if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
3068 echo $ECHO_N "(cached) $ECHO_C" >&6 2499 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3072,18 +2503,16 @@ else
3072 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path. 2503 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path.
3073 ;; 2504 ;;
3074 *) 2505 *)
3075 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2506 ac_save_IFS=$IFS; IFS=$ac_path_separator
3076for as_dir in $PATH 2507ac_dummy="$PATH"
3077do 2508for ac_dir in $ac_dummy; do
3078 IFS=$as_save_IFS 2509 IFS=$ac_save_IFS
3079 test -z "$as_dir" && as_dir=. 2510 test -z "$ac_dir" && ac_dir=.
3080 for ac_exec_ext in '' $ac_executable_extensions; do 2511 if $as_executable_p "$ac_dir/$ac_word"; then
3081 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2512 ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
3082 ac_cv_path_TEST_MINUS_S_SH="$as_dir/$ac_word$ac_exec_ext" 2513 echo "$as_me:2513: found $ac_dir/$ac_word" >&5
3083 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2514 break
3084 break 2 2515fi
3085 fi
3086done
3087done 2516done
3088 2517
3089 ;; 2518 ;;
@@ -3092,16 +2521,16 @@ fi
3092TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH 2521TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
3093 2522
3094if test -n "$TEST_MINUS_S_SH"; then 2523if test -n "$TEST_MINUS_S_SH"; then
3095 echo "$as_me:$LINENO: result: $TEST_MINUS_S_SH" >&5 2524 echo "$as_me:2524: result: $TEST_MINUS_S_SH" >&5
3096echo "${ECHO_T}$TEST_MINUS_S_SH" >&6 2525echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
3097else 2526else
3098 echo "$as_me:$LINENO: result: no" >&5 2527 echo "$as_me:2527: result: no" >&5
3099echo "${ECHO_T}no" >&6 2528echo "${ECHO_T}no" >&6
3100fi 2529fi
3101 2530
3102# Extract the first word of "sh", so it can be a program name with args. 2531# Extract the first word of "sh", so it can be a program name with args.
3103set dummy sh; ac_word=$2 2532set dummy sh; ac_word=$2
3104echo "$as_me:$LINENO: checking for $ac_word" >&5 2533echo "$as_me:2533: checking for $ac_word" >&5
3105echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2534echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3106if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then 2535if test "${ac_cv_path_TEST_MINUS_S_SH+set}" = set; then
3107 echo $ECHO_N "(cached) $ECHO_C" >&6 2536 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3111,18 +2540,16 @@ else
3111 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path. 2540 ac_cv_path_TEST_MINUS_S_SH="$TEST_MINUS_S_SH" # Let the user override the test with a path.
3112 ;; 2541 ;;
3113 *) 2542 *)
3114 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2543 ac_save_IFS=$IFS; IFS=$ac_path_separator
3115for as_dir in $PATH 2544ac_dummy="$PATH"
3116do 2545for ac_dir in $ac_dummy; do
3117 IFS=$as_save_IFS 2546 IFS=$ac_save_IFS
3118 test -z "$as_dir" && as_dir=. 2547 test -z "$ac_dir" && ac_dir=.
3119 for ac_exec_ext in '' $ac_executable_extensions; do 2548 if $as_executable_p "$ac_dir/$ac_word"; then
3120 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2549 ac_cv_path_TEST_MINUS_S_SH="$ac_dir/$ac_word"
3121 ac_cv_path_TEST_MINUS_S_SH="$as_dir/$ac_word$ac_exec_ext" 2550 echo "$as_me:2550: found $ac_dir/$ac_word" >&5
3122 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2551 break
3123 break 2 2552fi
3124 fi
3125done
3126done 2553done
3127 2554
3128 ;; 2555 ;;
@@ -3131,16 +2558,16 @@ fi
3131TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH 2558TEST_MINUS_S_SH=$ac_cv_path_TEST_MINUS_S_SH
3132 2559
3133if test -n "$TEST_MINUS_S_SH"; then 2560if test -n "$TEST_MINUS_S_SH"; then
3134 echo "$as_me:$LINENO: result: $TEST_MINUS_S_SH" >&5 2561 echo "$as_me:2561: result: $TEST_MINUS_S_SH" >&5
3135echo "${ECHO_T}$TEST_MINUS_S_SH" >&6 2562echo "${ECHO_T}$TEST_MINUS_S_SH" >&6
3136else 2563else
3137 echo "$as_me:$LINENO: result: no" >&5 2564 echo "$as_me:2564: result: no" >&5
3138echo "${ECHO_T}no" >&6 2565echo "${ECHO_T}no" >&6
3139fi 2566fi
3140 2567
3141# Extract the first word of "sh", so it can be a program name with args. 2568# Extract the first word of "sh", so it can be a program name with args.
3142set dummy sh; ac_word=$2 2569set dummy sh; ac_word=$2
3143echo "$as_me:$LINENO: checking for $ac_word" >&5 2570echo "$as_me:2570: checking for $ac_word" >&5
3144echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2571echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3145if test "${ac_cv_path_SH+set}" = set; then 2572if test "${ac_cv_path_SH+set}" = set; then
3146 echo $ECHO_N "(cached) $ECHO_C" >&6 2573 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3150,18 +2577,16 @@ else
3150 ac_cv_path_SH="$SH" # Let the user override the test with a path. 2577 ac_cv_path_SH="$SH" # Let the user override the test with a path.
3151 ;; 2578 ;;
3152 *) 2579 *)
3153 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2580 ac_save_IFS=$IFS; IFS=$ac_path_separator
3154for as_dir in $PATH 2581ac_dummy="$PATH"
3155do 2582for ac_dir in $ac_dummy; do
3156 IFS=$as_save_IFS 2583 IFS=$ac_save_IFS
3157 test -z "$as_dir" && as_dir=. 2584 test -z "$ac_dir" && ac_dir=.
3158 for ac_exec_ext in '' $ac_executable_extensions; do 2585 if $as_executable_p "$ac_dir/$ac_word"; then
3159 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2586 ac_cv_path_SH="$ac_dir/$ac_word"
3160 ac_cv_path_SH="$as_dir/$ac_word$ac_exec_ext" 2587 echo "$as_me:2587: found $ac_dir/$ac_word" >&5
3161 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2588 break
3162 break 2 2589fi
3163 fi
3164done
3165done 2590done
3166 2591
3167 ;; 2592 ;;
@@ -3170,14 +2595,13 @@ fi
3170SH=$ac_cv_path_SH 2595SH=$ac_cv_path_SH
3171 2596
3172if test -n "$SH"; then 2597if test -n "$SH"; then
3173 echo "$as_me:$LINENO: result: $SH" >&5 2598 echo "$as_me:2598: result: $SH" >&5
3174echo "${ECHO_T}$SH" >&6 2599echo "${ECHO_T}$SH" >&6
3175else 2600else
3176 echo "$as_me:$LINENO: result: no" >&5 2601 echo "$as_me:2601: result: no" >&5
3177echo "${ECHO_T}no" >&6 2602echo "${ECHO_T}no" >&6
3178fi 2603fi
3179 2604
3180
3181# System features 2605# System features
3182# Check whether --enable-largefile or --disable-largefile was given. 2606# Check whether --enable-largefile or --disable-largefile was given.
3183if test "${enable_largefile+set}" = set; then 2607if test "${enable_largefile+set}" = set; then
@@ -3186,7 +2610,7 @@ if test "${enable_largefile+set}" = set; then
3186fi; 2610fi;
3187if test "$enable_largefile" != no; then 2611if test "$enable_largefile" != no; then
3188 2612
3189 echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 2613 echo "$as_me:2613: checking for special C compiler options needed for large files" >&5
3190echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 2614echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
3191if test "${ac_cv_sys_largefile_CC+set}" = set; then 2615if test "${ac_cv_sys_largefile_CC+set}" = set; then
3192 echo $ECHO_N "(cached) $ECHO_C" >&6 2616 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3198,12 +2622,8 @@ else
3198 # IRIX 6.2 and later do not support large files by default, 2622 # IRIX 6.2 and later do not support large files by default,
3199 # so use the C compiler's -n32 option if that helps. 2623 # so use the C compiler's -n32 option if that helps.
3200 cat >conftest.$ac_ext <<_ACEOF 2624 cat >conftest.$ac_ext <<_ACEOF
3201#line $LINENO "configure" 2625#line 2625 "configure"
3202/* confdefs.h. */ 2626#include "confdefs.h"
3203_ACEOF
3204cat confdefs.h >>conftest.$ac_ext
3205cat >>conftest.$ac_ext <<_ACEOF
3206/* end confdefs.h. */
3207#include <sys/types.h> 2627#include <sys/types.h>
3208 /* Check that off_t can represent 2**63 - 1 correctly. 2628 /* Check that off_t can represent 2**63 - 1 correctly.
3209 We can't simply define LARGE_OFF_T to be 9223372036854775807, 2629 We can't simply define LARGE_OFF_T to be 9223372036854775807,
@@ -3222,42 +2642,40 @@ main ()
3222} 2642}
3223_ACEOF 2643_ACEOF
3224 rm -f conftest.$ac_objext 2644 rm -f conftest.$ac_objext
3225if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2645if { (eval echo "$as_me:2645: \"$ac_compile\"") >&5
3226 (eval $ac_compile) 2>&5 2646 (eval $ac_compile) 2>&5
3227 ac_status=$? 2647 ac_status=$?
3228 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2648 echo "$as_me:2648: \$? = $ac_status" >&5
3229 (exit $ac_status); } && 2649 (exit $ac_status); } &&
3230 { ac_try='test -s conftest.$ac_objext' 2650 { ac_try='test -s conftest.$ac_objext'
3231 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2651 { (eval echo "$as_me:2651: \"$ac_try\"") >&5
3232 (eval $ac_try) 2>&5 2652 (eval $ac_try) 2>&5
3233 ac_status=$? 2653 ac_status=$?
3234 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2654 echo "$as_me:2654: \$? = $ac_status" >&5
3235 (exit $ac_status); }; }; then 2655 (exit $ac_status); }; }; then
3236 break 2656 break
3237else 2657else
3238 echo "$as_me: failed program was:" >&5 2658 echo "$as_me: failed program was:" >&5
3239sed 's/^/| /' conftest.$ac_ext >&5 2659cat conftest.$ac_ext >&5
3240
3241fi 2660fi
3242rm -f conftest.$ac_objext 2661rm -f conftest.$ac_objext
3243 CC="$CC -n32" 2662 CC="$CC -n32"
3244 rm -f conftest.$ac_objext 2663 rm -f conftest.$ac_objext
3245if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2664if { (eval echo "$as_me:2664: \"$ac_compile\"") >&5
3246 (eval $ac_compile) 2>&5 2665 (eval $ac_compile) 2>&5
3247 ac_status=$? 2666 ac_status=$?
3248 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2667 echo "$as_me:2667: \$? = $ac_status" >&5
3249 (exit $ac_status); } && 2668 (exit $ac_status); } &&
3250 { ac_try='test -s conftest.$ac_objext' 2669 { ac_try='test -s conftest.$ac_objext'
3251 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2670 { (eval echo "$as_me:2670: \"$ac_try\"") >&5
3252 (eval $ac_try) 2>&5 2671 (eval $ac_try) 2>&5
3253 ac_status=$? 2672 ac_status=$?
3254 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2673 echo "$as_me:2673: \$? = $ac_status" >&5
3255 (exit $ac_status); }; }; then 2674 (exit $ac_status); }; }; then
3256 ac_cv_sys_largefile_CC=' -n32'; break 2675 ac_cv_sys_largefile_CC=' -n32'; break
3257else 2676else
3258 echo "$as_me: failed program was:" >&5 2677 echo "$as_me: failed program was:" >&5
3259sed 's/^/| /' conftest.$ac_ext >&5 2678cat conftest.$ac_ext >&5
3260
3261fi 2679fi
3262rm -f conftest.$ac_objext 2680rm -f conftest.$ac_objext
3263 break 2681 break
@@ -3266,13 +2684,13 @@ rm -f conftest.$ac_objext
3266 rm -f conftest.$ac_ext 2684 rm -f conftest.$ac_ext
3267 fi 2685 fi
3268fi 2686fi
3269echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 2687echo "$as_me:2687: result: $ac_cv_sys_largefile_CC" >&5
3270echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 2688echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
3271 if test "$ac_cv_sys_largefile_CC" != no; then 2689 if test "$ac_cv_sys_largefile_CC" != no; then
3272 CC=$CC$ac_cv_sys_largefile_CC 2690 CC=$CC$ac_cv_sys_largefile_CC
3273 fi 2691 fi
3274 2692
3275 echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 2693 echo "$as_me:2693: checking for _FILE_OFFSET_BITS value needed for large files" >&5
3276echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 2694echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
3277if test "${ac_cv_sys_file_offset_bits+set}" = set; then 2695if test "${ac_cv_sys_file_offset_bits+set}" = set; then
3278 echo $ECHO_N "(cached) $ECHO_C" >&6 2696 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3280,12 +2698,8 @@ else
3280 while :; do 2698 while :; do
3281 ac_cv_sys_file_offset_bits=no 2699 ac_cv_sys_file_offset_bits=no
3282 cat >conftest.$ac_ext <<_ACEOF 2700 cat >conftest.$ac_ext <<_ACEOF
3283#line $LINENO "configure" 2701#line 2701 "configure"
3284/* confdefs.h. */ 2702#include "confdefs.h"
3285_ACEOF
3286cat confdefs.h >>conftest.$ac_ext
3287cat >>conftest.$ac_ext <<_ACEOF
3288/* end confdefs.h. */
3289#include <sys/types.h> 2703#include <sys/types.h>
3290 /* Check that off_t can represent 2**63 - 1 correctly. 2704 /* Check that off_t can represent 2**63 - 1 correctly.
3291 We can't simply define LARGE_OFF_T to be 9223372036854775807, 2705 We can't simply define LARGE_OFF_T to be 9223372036854775807,
@@ -3304,31 +2718,26 @@ main ()
3304} 2718}
3305_ACEOF 2719_ACEOF
3306rm -f conftest.$ac_objext 2720rm -f conftest.$ac_objext
3307if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2721if { (eval echo "$as_me:2721: \"$ac_compile\"") >&5
3308 (eval $ac_compile) 2>&5 2722 (eval $ac_compile) 2>&5
3309 ac_status=$? 2723 ac_status=$?
3310 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2724 echo "$as_me:2724: \$? = $ac_status" >&5
3311 (exit $ac_status); } && 2725 (exit $ac_status); } &&
3312 { ac_try='test -s conftest.$ac_objext' 2726 { ac_try='test -s conftest.$ac_objext'
3313 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2727 { (eval echo "$as_me:2727: \"$ac_try\"") >&5
3314 (eval $ac_try) 2>&5 2728 (eval $ac_try) 2>&5
3315 ac_status=$? 2729 ac_status=$?
3316 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2730 echo "$as_me:2730: \$? = $ac_status" >&5
3317 (exit $ac_status); }; }; then 2731 (exit $ac_status); }; }; then
3318 break 2732 break
3319else 2733else
3320 echo "$as_me: failed program was:" >&5 2734 echo "$as_me: failed program was:" >&5
3321sed 's/^/| /' conftest.$ac_ext >&5 2735cat conftest.$ac_ext >&5
3322
3323fi 2736fi
3324rm -f conftest.$ac_objext conftest.$ac_ext 2737rm -f conftest.$ac_objext conftest.$ac_ext
3325 cat >conftest.$ac_ext <<_ACEOF 2738 cat >conftest.$ac_ext <<_ACEOF
3326#line $LINENO "configure" 2739#line 2739 "configure"
3327/* confdefs.h. */ 2740#include "confdefs.h"
3328_ACEOF
3329cat confdefs.h >>conftest.$ac_ext
3330cat >>conftest.$ac_ext <<_ACEOF
3331/* end confdefs.h. */
3332#define _FILE_OFFSET_BITS 64 2741#define _FILE_OFFSET_BITS 64
3333#include <sys/types.h> 2742#include <sys/types.h>
3334 /* Check that off_t can represent 2**63 - 1 correctly. 2743 /* Check that off_t can represent 2**63 - 1 correctly.
@@ -3348,38 +2757,37 @@ main ()
3348} 2757}
3349_ACEOF 2758_ACEOF
3350rm -f conftest.$ac_objext 2759rm -f conftest.$ac_objext
3351if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2760if { (eval echo "$as_me:2760: \"$ac_compile\"") >&5
3352 (eval $ac_compile) 2>&5 2761 (eval $ac_compile) 2>&5
3353 ac_status=$? 2762 ac_status=$?
3354 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2763 echo "$as_me:2763: \$? = $ac_status" >&5
3355 (exit $ac_status); } && 2764 (exit $ac_status); } &&
3356 { ac_try='test -s conftest.$ac_objext' 2765 { ac_try='test -s conftest.$ac_objext'
3357 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2766 { (eval echo "$as_me:2766: \"$ac_try\"") >&5
3358 (eval $ac_try) 2>&5 2767 (eval $ac_try) 2>&5
3359 ac_status=$? 2768 ac_status=$?
3360 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2769 echo "$as_me:2769: \$? = $ac_status" >&5
3361 (exit $ac_status); }; }; then 2770 (exit $ac_status); }; }; then
3362 ac_cv_sys_file_offset_bits=64; break 2771 ac_cv_sys_file_offset_bits=64; break
3363else 2772else
3364 echo "$as_me: failed program was:" >&5 2773 echo "$as_me: failed program was:" >&5
3365sed 's/^/| /' conftest.$ac_ext >&5 2774cat conftest.$ac_ext >&5
3366
3367fi 2775fi
3368rm -f conftest.$ac_objext conftest.$ac_ext 2776rm -f conftest.$ac_objext conftest.$ac_ext
3369 break 2777 break
3370done 2778done
3371fi 2779fi
3372echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 2780echo "$as_me:2780: result: $ac_cv_sys_file_offset_bits" >&5
3373echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 2781echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
3374if test "$ac_cv_sys_file_offset_bits" != no; then 2782if test "$ac_cv_sys_file_offset_bits" != no; then
3375 2783
3376cat >>confdefs.h <<_ACEOF 2784cat >>confdefs.h <<EOF
3377#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits 2785#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
3378_ACEOF 2786EOF
3379 2787
3380fi 2788fi
3381rm -f conftest* 2789rm -f conftest*
3382 echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 2790 echo "$as_me:2790: checking for _LARGE_FILES value needed for large files" >&5
3383echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 2791echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
3384if test "${ac_cv_sys_large_files+set}" = set; then 2792if test "${ac_cv_sys_large_files+set}" = set; then
3385 echo $ECHO_N "(cached) $ECHO_C" >&6 2793 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3387,12 +2795,8 @@ else
3387 while :; do 2795 while :; do
3388 ac_cv_sys_large_files=no 2796 ac_cv_sys_large_files=no
3389 cat >conftest.$ac_ext <<_ACEOF 2797 cat >conftest.$ac_ext <<_ACEOF
3390#line $LINENO "configure" 2798#line 2798 "configure"
3391/* confdefs.h. */ 2799#include "confdefs.h"
3392_ACEOF
3393cat confdefs.h >>conftest.$ac_ext
3394cat >>conftest.$ac_ext <<_ACEOF
3395/* end confdefs.h. */
3396#include <sys/types.h> 2800#include <sys/types.h>
3397 /* Check that off_t can represent 2**63 - 1 correctly. 2801 /* Check that off_t can represent 2**63 - 1 correctly.
3398 We can't simply define LARGE_OFF_T to be 9223372036854775807, 2802 We can't simply define LARGE_OFF_T to be 9223372036854775807,
@@ -3411,31 +2815,26 @@ main ()
3411} 2815}
3412_ACEOF 2816_ACEOF
3413rm -f conftest.$ac_objext 2817rm -f conftest.$ac_objext
3414if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2818if { (eval echo "$as_me:2818: \"$ac_compile\"") >&5
3415 (eval $ac_compile) 2>&5 2819 (eval $ac_compile) 2>&5
3416 ac_status=$? 2820 ac_status=$?
3417 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2821 echo "$as_me:2821: \$? = $ac_status" >&5
3418 (exit $ac_status); } && 2822 (exit $ac_status); } &&
3419 { ac_try='test -s conftest.$ac_objext' 2823 { ac_try='test -s conftest.$ac_objext'
3420 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2824 { (eval echo "$as_me:2824: \"$ac_try\"") >&5
3421 (eval $ac_try) 2>&5 2825 (eval $ac_try) 2>&5
3422 ac_status=$? 2826 ac_status=$?
3423 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2827 echo "$as_me:2827: \$? = $ac_status" >&5
3424 (exit $ac_status); }; }; then 2828 (exit $ac_status); }; }; then
3425 break 2829 break
3426else 2830else
3427 echo "$as_me: failed program was:" >&5 2831 echo "$as_me: failed program was:" >&5
3428sed 's/^/| /' conftest.$ac_ext >&5 2832cat conftest.$ac_ext >&5
3429
3430fi 2833fi
3431rm -f conftest.$ac_objext conftest.$ac_ext 2834rm -f conftest.$ac_objext conftest.$ac_ext
3432 cat >conftest.$ac_ext <<_ACEOF 2835 cat >conftest.$ac_ext <<_ACEOF
3433#line $LINENO "configure" 2836#line 2836 "configure"
3434/* confdefs.h. */ 2837#include "confdefs.h"
3435_ACEOF
3436cat confdefs.h >>conftest.$ac_ext
3437cat >>conftest.$ac_ext <<_ACEOF
3438/* end confdefs.h. */
3439#define _LARGE_FILES 1 2838#define _LARGE_FILES 1
3440#include <sys/types.h> 2839#include <sys/types.h>
3441 /* Check that off_t can represent 2**63 - 1 correctly. 2840 /* Check that off_t can represent 2**63 - 1 correctly.
@@ -3455,57 +2854,55 @@ main ()
3455} 2854}
3456_ACEOF 2855_ACEOF
3457rm -f conftest.$ac_objext 2856rm -f conftest.$ac_objext
3458if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 2857if { (eval echo "$as_me:2857: \"$ac_compile\"") >&5
3459 (eval $ac_compile) 2>&5 2858 (eval $ac_compile) 2>&5
3460 ac_status=$? 2859 ac_status=$?
3461 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2860 echo "$as_me:2860: \$? = $ac_status" >&5
3462 (exit $ac_status); } && 2861 (exit $ac_status); } &&
3463 { ac_try='test -s conftest.$ac_objext' 2862 { ac_try='test -s conftest.$ac_objext'
3464 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 2863 { (eval echo "$as_me:2863: \"$ac_try\"") >&5
3465 (eval $ac_try) 2>&5 2864 (eval $ac_try) 2>&5
3466 ac_status=$? 2865 ac_status=$?
3467 echo "$as_me:$LINENO: \$? = $ac_status" >&5 2866 echo "$as_me:2866: \$? = $ac_status" >&5
3468 (exit $ac_status); }; }; then 2867 (exit $ac_status); }; }; then
3469 ac_cv_sys_large_files=1; break 2868 ac_cv_sys_large_files=1; break
3470else 2869else
3471 echo "$as_me: failed program was:" >&5 2870 echo "$as_me: failed program was:" >&5
3472sed 's/^/| /' conftest.$ac_ext >&5 2871cat conftest.$ac_ext >&5
3473
3474fi 2872fi
3475rm -f conftest.$ac_objext conftest.$ac_ext 2873rm -f conftest.$ac_objext conftest.$ac_ext
3476 break 2874 break
3477done 2875done
3478fi 2876fi
3479echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 2877echo "$as_me:2877: result: $ac_cv_sys_large_files" >&5
3480echo "${ECHO_T}$ac_cv_sys_large_files" >&6 2878echo "${ECHO_T}$ac_cv_sys_large_files" >&6
3481if test "$ac_cv_sys_large_files" != no; then 2879if test "$ac_cv_sys_large_files" != no; then
3482 2880
3483cat >>confdefs.h <<_ACEOF 2881cat >>confdefs.h <<EOF
3484#define _LARGE_FILES $ac_cv_sys_large_files 2882#define _LARGE_FILES $ac_cv_sys_large_files
3485_ACEOF 2883EOF
3486 2884
3487fi 2885fi
3488rm -f conftest* 2886rm -f conftest*
3489fi 2887fi
3490 2888
3491
3492if test -z "$AR" ; then 2889if test -z "$AR" ; then
3493 { { echo "$as_me:$LINENO: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5 2890 { { echo "$as_me:2890: error: *** 'ar' missing, please install or fix your \$PATH ***" >&5
3494echo "$as_me: error: *** 'ar' missing, please install or fix your \$PATH ***" >&2;} 2891echo "$as_me: error: *** 'ar' missing, please install or fix your \$PATH ***" >&2;}
3495 { (exit 1); exit 1; }; } 2892 { (exit 1); exit 1; }; }
3496fi 2893fi
3497 2894
3498# Use LOGIN_PROGRAM from environment if possible 2895# Use LOGIN_PROGRAM from environment if possible
3499if test ! -z "$LOGIN_PROGRAM" ; then 2896if test ! -z "$LOGIN_PROGRAM" ; then
3500 cat >>confdefs.h <<_ACEOF 2897 cat >>confdefs.h <<EOF
3501#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM" 2898#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM"
3502_ACEOF 2899EOF
3503 2900
3504else 2901else
3505 # Search for login 2902 # Search for login
3506 # Extract the first word of "login", so it can be a program name with args. 2903 # Extract the first word of "login", so it can be a program name with args.
3507set dummy login; ac_word=$2 2904set dummy login; ac_word=$2
3508echo "$as_me:$LINENO: checking for $ac_word" >&5 2905echo "$as_me:2905: checking for $ac_word" >&5
3509echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 2906echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3510if test "${ac_cv_path_LOGIN_PROGRAM_FALLBACK+set}" = set; then 2907if test "${ac_cv_path_LOGIN_PROGRAM_FALLBACK+set}" = set; then
3511 echo $ECHO_N "(cached) $ECHO_C" >&6 2908 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3515,18 +2912,16 @@ else
3515 ac_cv_path_LOGIN_PROGRAM_FALLBACK="$LOGIN_PROGRAM_FALLBACK" # Let the user override the test with a path. 2912 ac_cv_path_LOGIN_PROGRAM_FALLBACK="$LOGIN_PROGRAM_FALLBACK" # Let the user override the test with a path.
3516 ;; 2913 ;;
3517 *) 2914 *)
3518 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 2915 ac_save_IFS=$IFS; IFS=$ac_path_separator
3519for as_dir in $PATH 2916ac_dummy="$PATH"
3520do 2917for ac_dir in $ac_dummy; do
3521 IFS=$as_save_IFS 2918 IFS=$ac_save_IFS
3522 test -z "$as_dir" && as_dir=. 2919 test -z "$ac_dir" && ac_dir=.
3523 for ac_exec_ext in '' $ac_executable_extensions; do 2920 if $as_executable_p "$ac_dir/$ac_word"; then
3524 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 2921 ac_cv_path_LOGIN_PROGRAM_FALLBACK="$ac_dir/$ac_word"
3525 ac_cv_path_LOGIN_PROGRAM_FALLBACK="$as_dir/$ac_word$ac_exec_ext" 2922 echo "$as_me:2922: found $ac_dir/$ac_word" >&5
3526 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 2923 break
3527 break 2 2924fi
3528 fi
3529done
3530done 2925done
3531 2926
3532 ;; 2927 ;;
@@ -3535,17 +2930,17 @@ fi
3535LOGIN_PROGRAM_FALLBACK=$ac_cv_path_LOGIN_PROGRAM_FALLBACK 2930LOGIN_PROGRAM_FALLBACK=$ac_cv_path_LOGIN_PROGRAM_FALLBACK
3536 2931
3537if test -n "$LOGIN_PROGRAM_FALLBACK"; then 2932if test -n "$LOGIN_PROGRAM_FALLBACK"; then
3538 echo "$as_me:$LINENO: result: $LOGIN_PROGRAM_FALLBACK" >&5 2933 echo "$as_me:2933: result: $LOGIN_PROGRAM_FALLBACK" >&5
3539echo "${ECHO_T}$LOGIN_PROGRAM_FALLBACK" >&6 2934echo "${ECHO_T}$LOGIN_PROGRAM_FALLBACK" >&6
3540else 2935else
3541 echo "$as_me:$LINENO: result: no" >&5 2936 echo "$as_me:2936: result: no" >&5
3542echo "${ECHO_T}no" >&6 2937echo "${ECHO_T}no" >&6
3543fi 2938fi
3544 2939
3545 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then 2940 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
3546 cat >>confdefs.h <<_ACEOF 2941 cat >>confdefs.h <<EOF
3547#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM_FALLBACK" 2942#define LOGIN_PROGRAM_FALLBACK "$LOGIN_PROGRAM_FALLBACK"
3548_ACEOF 2943EOF
3549 2944
3550 fi 2945 fi
3551fi 2946fi
@@ -3554,8 +2949,98 @@ if test -z "$LD" ; then
3554 LD=$CC 2949 LD=$CC
3555fi 2950fi
3556 2951
2952echo "$as_me:2952: checking for $CC option to accept ANSI C" >&5
2953echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2954if test "${ac_cv_prog_cc_stdc+set}" = set; then
2955 echo $ECHO_N "(cached) $ECHO_C" >&6
2956else
2957 ac_cv_prog_cc_stdc=no
2958ac_save_CC=$CC
2959cat >conftest.$ac_ext <<_ACEOF
2960#line 2960 "configure"
2961#include "confdefs.h"
2962#include <stdarg.h>
2963#include <stdio.h>
2964#include <sys/types.h>
2965#include <sys/stat.h>
2966/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2967struct buf { int x; };
2968FILE * (*rcsopen) (struct buf *, struct stat *, int);
2969static char *e (p, i)
2970 char **p;
2971 int i;
2972{
2973 return p[i];
2974}
2975static char *f (char * (*g) (char **, int), char **p, ...)
2976{
2977 char *s;
2978 va_list v;
2979 va_start (v,p);
2980 s = g (p, va_arg (v,int));
2981 va_end (v);
2982 return s;
2983}
2984int test (int i, double x);
2985struct s1 {int (*f) (int a);};
2986struct s2 {int (*f) (double a);};
2987int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2988int argc;
2989char **argv;
2990int
2991main ()
2992{
2993return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2994 ;
2995 return 0;
2996}
2997_ACEOF
2998# Don't try gcc -ansi; that turns off useful extensions and
2999# breaks some systems' header files.
3000# AIX -qlanglvl=ansi
3001# Ultrix and OSF/1 -std1
3002# HP-UX 10.20 and later -Ae
3003# HP-UX older versions -Aa -D_HPUX_SOURCE
3004# SVR4 -Xc -D__EXTENSIONS__
3005for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
3006do
3007 CC="$ac_save_CC $ac_arg"
3008 rm -f conftest.$ac_objext
3009if { (eval echo "$as_me:3009: \"$ac_compile\"") >&5
3010 (eval $ac_compile) 2>&5
3011 ac_status=$?
3012 echo "$as_me:3012: \$? = $ac_status" >&5
3013 (exit $ac_status); } &&
3014 { ac_try='test -s conftest.$ac_objext'
3015 { (eval echo "$as_me:3015: \"$ac_try\"") >&5
3016 (eval $ac_try) 2>&5
3017 ac_status=$?
3018 echo "$as_me:3018: \$? = $ac_status" >&5
3019 (exit $ac_status); }; }; then
3020 ac_cv_prog_cc_stdc=$ac_arg
3021break
3022else
3023 echo "$as_me: failed program was:" >&5
3024cat conftest.$ac_ext >&5
3025fi
3026rm -f conftest.$ac_objext
3027done
3028rm -f conftest.$ac_ext conftest.$ac_objext
3029CC=$ac_save_CC
3030
3031fi
3032
3033case "x$ac_cv_prog_cc_stdc" in
3034 x|xno)
3035 echo "$as_me:3035: result: none needed" >&5
3036echo "${ECHO_T}none needed" >&6 ;;
3037 *)
3038 echo "$as_me:3038: result: $ac_cv_prog_cc_stdc" >&5
3039echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
3040 CC="$CC $ac_cv_prog_cc_stdc" ;;
3041esac
3557 3042
3558echo "$as_me:$LINENO: checking for inline" >&5 3043echo "$as_me:3043: checking for inline" >&5
3559echo $ECHO_N "checking for inline... $ECHO_C" >&6 3044echo $ECHO_N "checking for inline... $ECHO_C" >&6
3560if test "${ac_cv_c_inline+set}" = set; then 3045if test "${ac_cv_c_inline+set}" = set; then
3561 echo $ECHO_N "(cached) $ECHO_C" >&6 3046 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3563,53 +3048,47 @@ else
3563 ac_cv_c_inline=no 3048 ac_cv_c_inline=no
3564for ac_kw in inline __inline__ __inline; do 3049for ac_kw in inline __inline__ __inline; do
3565 cat >conftest.$ac_ext <<_ACEOF 3050 cat >conftest.$ac_ext <<_ACEOF
3566#line $LINENO "configure" 3051#line 3051 "configure"
3567/* confdefs.h. */ 3052#include "confdefs.h"
3568_ACEOF
3569cat confdefs.h >>conftest.$ac_ext
3570cat >>conftest.$ac_ext <<_ACEOF
3571/* end confdefs.h. */
3572#ifndef __cplusplus 3053#ifndef __cplusplus
3573typedef int foo_t; 3054static $ac_kw int static_foo () {return 0; }
3574static $ac_kw foo_t static_foo () {return 0; } 3055$ac_kw int foo () {return 0; }
3575$ac_kw foo_t foo () {return 0; }
3576#endif 3056#endif
3577 3057
3578_ACEOF 3058_ACEOF
3579rm -f conftest.$ac_objext 3059rm -f conftest.$ac_objext
3580if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 3060if { (eval echo "$as_me:3060: \"$ac_compile\"") >&5
3581 (eval $ac_compile) 2>&5 3061 (eval $ac_compile) 2>&5
3582 ac_status=$? 3062 ac_status=$?
3583 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3063 echo "$as_me:3063: \$? = $ac_status" >&5
3584 (exit $ac_status); } && 3064 (exit $ac_status); } &&
3585 { ac_try='test -s conftest.$ac_objext' 3065 { ac_try='test -s conftest.$ac_objext'
3586 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3066 { (eval echo "$as_me:3066: \"$ac_try\"") >&5
3587 (eval $ac_try) 2>&5 3067 (eval $ac_try) 2>&5
3588 ac_status=$? 3068 ac_status=$?
3589 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3069 echo "$as_me:3069: \$? = $ac_status" >&5
3590 (exit $ac_status); }; }; then 3070 (exit $ac_status); }; }; then
3591 ac_cv_c_inline=$ac_kw; break 3071 ac_cv_c_inline=$ac_kw; break
3592else 3072else
3593 echo "$as_me: failed program was:" >&5 3073 echo "$as_me: failed program was:" >&5
3594sed 's/^/| /' conftest.$ac_ext >&5 3074cat conftest.$ac_ext >&5
3595
3596fi 3075fi
3597rm -f conftest.$ac_objext conftest.$ac_ext 3076rm -f conftest.$ac_objext conftest.$ac_ext
3598done 3077done
3599 3078
3600fi 3079fi
3601echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 3080echo "$as_me:3080: result: $ac_cv_c_inline" >&5
3602echo "${ECHO_T}$ac_cv_c_inline" >&6 3081echo "${ECHO_T}$ac_cv_c_inline" >&6
3603case $ac_cv_c_inline in 3082case $ac_cv_c_inline in
3604 inline | yes) ;; 3083 inline | yes) ;;
3605 no) 3084 no)
3606cat >>confdefs.h <<\_ACEOF 3085cat >>confdefs.h <<\EOF
3607#define inline 3086#define inline
3608_ACEOF 3087EOF
3609 ;; 3088 ;;
3610 *) cat >>confdefs.h <<_ACEOF 3089 *) cat >>confdefs.h <<EOF
3611#define inline $ac_cv_c_inline 3090#define inline $ac_cv_c_inline
3612_ACEOF 3091EOF
3613 ;; 3092 ;;
3614esac 3093esac
3615 3094
@@ -3620,10 +3099,9 @@ fi
3620# Check for some target-specific stuff 3099# Check for some target-specific stuff
3621case "$host" in 3100case "$host" in
3622*-*-aix*) 3101*-*-aix*)
3623 AFS_LIBS="-lld"
3624 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 3102 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
3625 LDFLAGS="$LDFLAGS -L/usr/local/lib" 3103 LDFLAGS="$LDFLAGS -L/usr/local/lib"
3626 echo "$as_me:$LINENO: checking how to specify blibpath for linker ($LD)" >&5 3104 echo "$as_me:3104: checking how to specify blibpath for linker ($LD)" >&5
3627echo $ECHO_N "checking how to specify blibpath for linker ($LD)... $ECHO_C" >&6 3105echo $ECHO_N "checking how to specify blibpath for linker ($LD)... $ECHO_C" >&6
3628 if (test -z "$blibpath"); then 3106 if (test -z "$blibpath"); then
3629 blibpath="/usr/lib:/lib:/usr/local/lib" 3107 blibpath="/usr/lib:/lib:/usr/local/lib"
@@ -3633,12 +3111,8 @@ echo $ECHO_N "checking how to specify blibpath for linker ($LD)... $ECHO_C" >&6
3633 if (test -z "$blibflags"); then 3111 if (test -z "$blibflags"); then
3634 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath" 3112 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
3635 cat >conftest.$ac_ext <<_ACEOF 3113 cat >conftest.$ac_ext <<_ACEOF
3636#line $LINENO "configure" 3114#line 3114 "configure"
3637/* confdefs.h. */ 3115#include "confdefs.h"
3638_ACEOF
3639cat confdefs.h >>conftest.$ac_ext
3640cat >>conftest.$ac_ext <<_ACEOF
3641/* end confdefs.h. */
3642 3116
3643int 3117int
3644main () 3118main ()
@@ -3649,116 +3123,101 @@ main ()
3649} 3123}
3650_ACEOF 3124_ACEOF
3651rm -f conftest.$ac_objext conftest$ac_exeext 3125rm -f conftest.$ac_objext conftest$ac_exeext
3652if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3126if { (eval echo "$as_me:3126: \"$ac_link\"") >&5
3653 (eval $ac_link) 2>&5 3127 (eval $ac_link) 2>&5
3654 ac_status=$? 3128 ac_status=$?
3655 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3129 echo "$as_me:3129: \$? = $ac_status" >&5
3656 (exit $ac_status); } && 3130 (exit $ac_status); } &&
3657 { ac_try='test -s conftest$ac_exeext' 3131 { ac_try='test -s conftest$ac_exeext'
3658 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3132 { (eval echo "$as_me:3132: \"$ac_try\"") >&5
3659 (eval $ac_try) 2>&5 3133 (eval $ac_try) 2>&5
3660 ac_status=$? 3134 ac_status=$?
3661 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3135 echo "$as_me:3135: \$? = $ac_status" >&5
3662 (exit $ac_status); }; }; then 3136 (exit $ac_status); }; }; then
3663 blibflags=$tryflags 3137 blibflags=$tryflags
3664else 3138else
3665 echo "$as_me: failed program was:" >&5 3139 echo "$as_me: failed program was:" >&5
3666sed 's/^/| /' conftest.$ac_ext >&5 3140cat conftest.$ac_ext >&5
3667
3668fi 3141fi
3669rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3142rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3670 fi 3143 fi
3671 done 3144 done
3672 if (test -z "$blibflags"); then 3145 if (test -z "$blibflags"); then
3673 echo "$as_me:$LINENO: result: not found" >&5 3146 echo "$as_me:3146: result: not found" >&5
3674echo "${ECHO_T}not found" >&6 3147echo "${ECHO_T}not found" >&6
3675 { { echo "$as_me:$LINENO: error: *** must be able to specify blibpath on AIX - check config.log" >&5 3148 { { echo "$as_me:3148: error: *** must be able to specify blibpath on AIX - check config.log" >&5
3676echo "$as_me: error: *** must be able to specify blibpath on AIX - check config.log" >&2;} 3149echo "$as_me: error: *** must be able to specify blibpath on AIX - check config.log" >&2;}
3677 { (exit 1); exit 1; }; } 3150 { (exit 1); exit 1; }; }
3678 else 3151 else
3679 echo "$as_me:$LINENO: result: $blibflags" >&5 3152 echo "$as_me:3152: result: $blibflags" >&5
3680echo "${ECHO_T}$blibflags" >&6 3153echo "${ECHO_T}$blibflags" >&6
3681 fi 3154 fi
3682 LDFLAGS="$saved_LDFLAGS" 3155 LDFLAGS="$saved_LDFLAGS"
3683 echo "$as_me:$LINENO: checking for authenticate" >&5 3156 echo "$as_me:3156: checking for authenticate" >&5
3684echo $ECHO_N "checking for authenticate... $ECHO_C" >&6 3157echo $ECHO_N "checking for authenticate... $ECHO_C" >&6
3685if test "${ac_cv_func_authenticate+set}" = set; then 3158if test "${ac_cv_func_authenticate+set}" = set; then
3686 echo $ECHO_N "(cached) $ECHO_C" >&6 3159 echo $ECHO_N "(cached) $ECHO_C" >&6
3687else 3160else
3688 cat >conftest.$ac_ext <<_ACEOF 3161 cat >conftest.$ac_ext <<_ACEOF
3689#line $LINENO "configure" 3162#line 3162 "configure"
3690/* confdefs.h. */ 3163#include "confdefs.h"
3691_ACEOF
3692cat confdefs.h >>conftest.$ac_ext
3693cat >>conftest.$ac_ext <<_ACEOF
3694/* end confdefs.h. */
3695/* System header to define __stub macros and hopefully few prototypes, 3164/* System header to define __stub macros and hopefully few prototypes,
3696 which can conflict with char authenticate (); below. 3165 which can conflict with char authenticate (); below. */
3697 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 3166#include <assert.h>
3698 <limits.h> exists even on freestanding compilers. */
3699#ifdef __STDC__
3700# include <limits.h>
3701#else
3702# include <assert.h>
3703#endif
3704/* Override any gcc2 internal prototype to avoid an error. */ 3167/* Override any gcc2 internal prototype to avoid an error. */
3705#ifdef __cplusplus 3168#ifdef __cplusplus
3706extern "C" 3169extern "C"
3707{
3708#endif 3170#endif
3709/* We use char because int might match the return type of a gcc2 3171/* We use char because int might match the return type of a gcc2
3710 builtin and then its argument prototype would still apply. */ 3172 builtin and then its argument prototype would still apply. */
3711char authenticate (); 3173char authenticate ();
3174char (*f) ();
3175
3176int
3177main ()
3178{
3712/* The GNU C library defines this for functions which it implements 3179/* The GNU C library defines this for functions which it implements
3713 to always fail with ENOSYS. Some functions are actually named 3180 to always fail with ENOSYS. Some functions are actually named
3714 something starting with __ and the normal name is an alias. */ 3181 something starting with __ and the normal name is an alias. */
3715#if defined (__stub_authenticate) || defined (__stub___authenticate) 3182#if defined (__stub_authenticate) || defined (__stub___authenticate)
3716choke me 3183choke me
3717#else 3184#else
3718char (*f) () = authenticate; 3185f = authenticate;
3719#endif
3720#ifdef __cplusplus
3721}
3722#endif 3186#endif
3723 3187
3724int
3725main ()
3726{
3727return f != authenticate;
3728 ; 3188 ;
3729 return 0; 3189 return 0;
3730} 3190}
3731_ACEOF 3191_ACEOF
3732rm -f conftest.$ac_objext conftest$ac_exeext 3192rm -f conftest.$ac_objext conftest$ac_exeext
3733if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3193if { (eval echo "$as_me:3193: \"$ac_link\"") >&5
3734 (eval $ac_link) 2>&5 3194 (eval $ac_link) 2>&5
3735 ac_status=$? 3195 ac_status=$?
3736 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3196 echo "$as_me:3196: \$? = $ac_status" >&5
3737 (exit $ac_status); } && 3197 (exit $ac_status); } &&
3738 { ac_try='test -s conftest$ac_exeext' 3198 { ac_try='test -s conftest$ac_exeext'
3739 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3199 { (eval echo "$as_me:3199: \"$ac_try\"") >&5
3740 (eval $ac_try) 2>&5 3200 (eval $ac_try) 2>&5
3741 ac_status=$? 3201 ac_status=$?
3742 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3202 echo "$as_me:3202: \$? = $ac_status" >&5
3743 (exit $ac_status); }; }; then 3203 (exit $ac_status); }; }; then
3744 ac_cv_func_authenticate=yes 3204 ac_cv_func_authenticate=yes
3745else 3205else
3746 echo "$as_me: failed program was:" >&5 3206 echo "$as_me: failed program was:" >&5
3747sed 's/^/| /' conftest.$ac_ext >&5 3207cat conftest.$ac_ext >&5
3748
3749ac_cv_func_authenticate=no 3208ac_cv_func_authenticate=no
3750fi 3209fi
3751rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3210rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3752fi 3211fi
3753echo "$as_me:$LINENO: result: $ac_cv_func_authenticate" >&5 3212echo "$as_me:3212: result: $ac_cv_func_authenticate" >&5
3754echo "${ECHO_T}$ac_cv_func_authenticate" >&6 3213echo "${ECHO_T}$ac_cv_func_authenticate" >&6
3755if test $ac_cv_func_authenticate = yes; then 3214if test $ac_cv_func_authenticate = yes; then
3756 cat >>confdefs.h <<\_ACEOF 3215 cat >>confdefs.h <<\EOF
3757#define WITH_AIXAUTHENTICATE 1 3216#define WITH_AIXAUTHENTICATE 1
3758_ACEOF 3217EOF
3759 3218
3760else 3219else
3761 echo "$as_me:$LINENO: checking for authenticate in -ls" >&5 3220 echo "$as_me:3220: checking for authenticate in -ls" >&5
3762echo $ECHO_N "checking for authenticate in -ls... $ECHO_C" >&6 3221echo $ECHO_N "checking for authenticate in -ls... $ECHO_C" >&6
3763if test "${ac_cv_lib_s_authenticate+set}" = set; then 3222if test "${ac_cv_lib_s_authenticate+set}" = set; then
3764 echo $ECHO_N "(cached) $ECHO_C" >&6 3223 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3766,12 +3225,8 @@ else
3766 ac_check_lib_save_LIBS=$LIBS 3225 ac_check_lib_save_LIBS=$LIBS
3767LIBS="-ls $LIBS" 3226LIBS="-ls $LIBS"
3768cat >conftest.$ac_ext <<_ACEOF 3227cat >conftest.$ac_ext <<_ACEOF
3769#line $LINENO "configure" 3228#line 3228 "configure"
3770/* confdefs.h. */ 3229#include "confdefs.h"
3771_ACEOF
3772cat confdefs.h >>conftest.$ac_ext
3773cat >>conftest.$ac_ext <<_ACEOF
3774/* end confdefs.h. */
3775 3230
3776/* Override any gcc2 internal prototype to avoid an error. */ 3231/* Override any gcc2 internal prototype to avoid an error. */
3777#ifdef __cplusplus 3232#ifdef __cplusplus
@@ -3789,126 +3244,279 @@ authenticate ();
3789} 3244}
3790_ACEOF 3245_ACEOF
3791rm -f conftest.$ac_objext conftest$ac_exeext 3246rm -f conftest.$ac_objext conftest$ac_exeext
3792if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3247if { (eval echo "$as_me:3247: \"$ac_link\"") >&5
3793 (eval $ac_link) 2>&5 3248 (eval $ac_link) 2>&5
3794 ac_status=$? 3249 ac_status=$?
3795 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3250 echo "$as_me:3250: \$? = $ac_status" >&5
3796 (exit $ac_status); } && 3251 (exit $ac_status); } &&
3797 { ac_try='test -s conftest$ac_exeext' 3252 { ac_try='test -s conftest$ac_exeext'
3798 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3253 { (eval echo "$as_me:3253: \"$ac_try\"") >&5
3799 (eval $ac_try) 2>&5 3254 (eval $ac_try) 2>&5
3800 ac_status=$? 3255 ac_status=$?
3801 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3256 echo "$as_me:3256: \$? = $ac_status" >&5
3802 (exit $ac_status); }; }; then 3257 (exit $ac_status); }; }; then
3803 ac_cv_lib_s_authenticate=yes 3258 ac_cv_lib_s_authenticate=yes
3804else 3259else
3805 echo "$as_me: failed program was:" >&5 3260 echo "$as_me: failed program was:" >&5
3806sed 's/^/| /' conftest.$ac_ext >&5 3261cat conftest.$ac_ext >&5
3807
3808ac_cv_lib_s_authenticate=no 3262ac_cv_lib_s_authenticate=no
3809fi 3263fi
3810rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3264rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3811LIBS=$ac_check_lib_save_LIBS 3265LIBS=$ac_check_lib_save_LIBS
3812fi 3266fi
3813echo "$as_me:$LINENO: result: $ac_cv_lib_s_authenticate" >&5 3267echo "$as_me:3267: result: $ac_cv_lib_s_authenticate" >&5
3814echo "${ECHO_T}$ac_cv_lib_s_authenticate" >&6 3268echo "${ECHO_T}$ac_cv_lib_s_authenticate" >&6
3815if test $ac_cv_lib_s_authenticate = yes; then 3269if test $ac_cv_lib_s_authenticate = yes; then
3816 cat >>confdefs.h <<\_ACEOF 3270 cat >>confdefs.h <<\EOF
3817#define WITH_AIXAUTHENTICATE 1 3271#define WITH_AIXAUTHENTICATE 1
3818_ACEOF 3272EOF
3819 3273
3820 LIBS="$LIBS -ls" 3274 LIBS="$LIBS -ls"
3821 3275
3822fi 3276fi
3823 3277
3278fi
3279
3280 echo "$as_me:3280: checking whether loginfailed is declared" >&5
3281echo $ECHO_N "checking whether loginfailed is declared... $ECHO_C" >&6
3282if test "${ac_cv_have_decl_loginfailed+set}" = set; then
3283 echo $ECHO_N "(cached) $ECHO_C" >&6
3284else
3285 cat >conftest.$ac_ext <<_ACEOF
3286#line 3286 "configure"
3287#include "confdefs.h"
3288#include <usersec.h>
3289
3290int
3291main ()
3292{
3293#ifndef loginfailed
3294 char *p = (char *) loginfailed;
3295#endif
3824 3296
3297 ;
3298 return 0;
3299}
3300_ACEOF
3301rm -f conftest.$ac_objext
3302if { (eval echo "$as_me:3302: \"$ac_compile\"") >&5
3303 (eval $ac_compile) 2>&5
3304 ac_status=$?
3305 echo "$as_me:3305: \$? = $ac_status" >&5
3306 (exit $ac_status); } &&
3307 { ac_try='test -s conftest.$ac_objext'
3308 { (eval echo "$as_me:3308: \"$ac_try\"") >&5
3309 (eval $ac_try) 2>&5
3310 ac_status=$?
3311 echo "$as_me:3311: \$? = $ac_status" >&5
3312 (exit $ac_status); }; }; then
3313 ac_cv_have_decl_loginfailed=yes
3314else
3315 echo "$as_me: failed program was:" >&5
3316cat conftest.$ac_ext >&5
3317ac_cv_have_decl_loginfailed=no
3318fi
3319rm -f conftest.$ac_objext conftest.$ac_ext
3825fi 3320fi
3321echo "$as_me:3321: result: $ac_cv_have_decl_loginfailed" >&5
3322echo "${ECHO_T}$ac_cv_have_decl_loginfailed" >&6
3323if test $ac_cv_have_decl_loginfailed = yes; then
3324 echo "$as_me:3324: checking if loginfailed takes 4 arguments" >&5
3325echo $ECHO_N "checking if loginfailed takes 4 arguments... $ECHO_C" >&6
3326 cat >conftest.$ac_ext <<_ACEOF
3327#line 3327 "configure"
3328#include "confdefs.h"
3329#include <usersec.h>
3330int
3331main ()
3332{
3333(void)loginfailed("user","host","tty",0);
3334 ;
3335 return 0;
3336}
3337_ACEOF
3338rm -f conftest.$ac_objext
3339if { (eval echo "$as_me:3339: \"$ac_compile\"") >&5
3340 (eval $ac_compile) 2>&5
3341 ac_status=$?
3342 echo "$as_me:3342: \$? = $ac_status" >&5
3343 (exit $ac_status); } &&
3344 { ac_try='test -s conftest.$ac_objext'
3345 { (eval echo "$as_me:3345: \"$ac_try\"") >&5
3346 (eval $ac_try) 2>&5
3347 ac_status=$?
3348 echo "$as_me:3348: \$? = $ac_status" >&5
3349 (exit $ac_status); }; }; then
3350 echo "$as_me:3350: result: yes" >&5
3351echo "${ECHO_T}yes" >&6
3352 cat >>confdefs.h <<\EOF
3353#define AIX_LOGINFAILED_4ARG 1
3354EOF
3826 3355
3827 cat >>confdefs.h <<\_ACEOF 3356else
3828#define BROKEN_GETADDRINFO 1 3357 echo "$as_me: failed program was:" >&5
3358cat conftest.$ac_ext >&5
3359echo "$as_me:3359: result: no" >&5
3360echo "${ECHO_T}no" >&6
3361
3362fi
3363rm -f conftest.$ac_objext conftest.$ac_ext
3364fi
3365
3366for ac_func in setauthdb
3367do
3368as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3369echo "$as_me:3369: checking for $ac_func" >&5
3370echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3371if eval "test \"\${$as_ac_var+set}\" = set"; then
3372 echo $ECHO_N "(cached) $ECHO_C" >&6
3373else
3374 cat >conftest.$ac_ext <<_ACEOF
3375#line 3375 "configure"
3376#include "confdefs.h"
3377/* System header to define __stub macros and hopefully few prototypes,
3378 which can conflict with char $ac_func (); below. */
3379#include <assert.h>
3380/* Override any gcc2 internal prototype to avoid an error. */
3381#ifdef __cplusplus
3382extern "C"
3383#endif
3384/* We use char because int might match the return type of a gcc2
3385 builtin and then its argument prototype would still apply. */
3386char $ac_func ();
3387char (*f) ();
3388
3389int
3390main ()
3391{
3392/* The GNU C library defines this for functions which it implements
3393 to always fail with ENOSYS. Some functions are actually named
3394 something starting with __ and the normal name is an alias. */
3395#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3396choke me
3397#else
3398f = $ac_func;
3399#endif
3400
3401 ;
3402 return 0;
3403}
3829_ACEOF 3404_ACEOF
3405rm -f conftest.$ac_objext conftest$ac_exeext
3406if { (eval echo "$as_me:3406: \"$ac_link\"") >&5
3407 (eval $ac_link) 2>&5
3408 ac_status=$?
3409 echo "$as_me:3409: \$? = $ac_status" >&5
3410 (exit $ac_status); } &&
3411 { ac_try='test -s conftest$ac_exeext'
3412 { (eval echo "$as_me:3412: \"$ac_try\"") >&5
3413 (eval $ac_try) 2>&5
3414 ac_status=$?
3415 echo "$as_me:3415: \$? = $ac_status" >&5
3416 (exit $ac_status); }; }; then
3417 eval "$as_ac_var=yes"
3418else
3419 echo "$as_me: failed program was:" >&5
3420cat conftest.$ac_ext >&5
3421eval "$as_ac_var=no"
3422fi
3423rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3424fi
3425echo "$as_me:3425: result: `eval echo '${'$as_ac_var'}'`" >&5
3426echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3427if test `eval echo '${'$as_ac_var'}'` = yes; then
3428 cat >>confdefs.h <<EOF
3429#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3430EOF
3431
3432fi
3433done
3830 3434
3831 cat >>confdefs.h <<\_ACEOF 3435 cat >>confdefs.h <<\EOF
3436#define BROKEN_GETADDRINFO 1
3437EOF
3438
3439 cat >>confdefs.h <<\EOF
3832#define BROKEN_REALPATH 1 3440#define BROKEN_REALPATH 1
3833_ACEOF 3441EOF
3442
3443 cat >>confdefs.h <<\EOF
3444#define SETEUID_BREAKS_SETUID 1
3445EOF
3834 3446
3835 cat >>confdefs.h <<\_ACEOF 3447 cat >>confdefs.h <<\EOF
3448#define BROKEN_SETREUID 1
3449EOF
3450
3451 cat >>confdefs.h <<\EOF
3452#define BROKEN_SETREGID 1
3453EOF
3454
3455 cat >>confdefs.h <<\EOF
3836#define DISABLE_LASTLOG 1 3456#define DISABLE_LASTLOG 1
3837_ACEOF 3457EOF
3838 3458
3839 cat >>confdefs.h <<\_ACEOF 3459 cat >>confdefs.h <<\EOF
3840#define LOGIN_NEEDS_UTMPX 1 3460#define LOGIN_NEEDS_UTMPX 1
3841_ACEOF 3461EOF
3842 3462
3843 cat >>confdefs.h <<\_ACEOF 3463 cat >>confdefs.h <<\EOF
3844#define SETPROCTITLE_STRATEGY PS_USE_CLOBBER_ARGV 3464#define SPT_TYPE SPT_REUSEARGV
3845_ACEOF 3465EOF
3846
3847 cat >>confdefs.h <<\_ACEOF
3848#define SETPROCTITLE_PS_PADDING '\0'
3849_ACEOF
3850 3466
3851 ;; 3467 ;;
3852*-*-cygwin*) 3468*-*-cygwin*)
3853 check_for_libcrypt_later=1 3469 check_for_libcrypt_later=1
3854 LIBS="$LIBS /usr/lib/textmode.o" 3470 LIBS="$LIBS /usr/lib/textmode.o"
3855 cat >>confdefs.h <<\_ACEOF 3471 cat >>confdefs.h <<\EOF
3856#define HAVE_CYGWIN 1 3472#define HAVE_CYGWIN 1
3857_ACEOF 3473EOF
3858 3474
3859 cat >>confdefs.h <<\_ACEOF 3475 cat >>confdefs.h <<\EOF
3860#define USE_PIPES 1 3476#define USE_PIPES 1
3861_ACEOF 3477EOF
3862 3478
3863 cat >>confdefs.h <<\_ACEOF 3479 cat >>confdefs.h <<\EOF
3864#define DISABLE_SHADOW 1 3480#define DISABLE_SHADOW 1
3865_ACEOF 3481EOF
3866
3867 cat >>confdefs.h <<\_ACEOF
3868#define IPV4_DEFAULT 1
3869_ACEOF
3870 3482
3871 cat >>confdefs.h <<\_ACEOF 3483 cat >>confdefs.h <<\EOF
3872#define IP_TOS_IS_BROKEN 1 3484#define IP_TOS_IS_BROKEN 1
3873_ACEOF 3485EOF
3874 3486
3875 cat >>confdefs.h <<\_ACEOF 3487 cat >>confdefs.h <<\EOF
3876#define NO_X11_UNIX_SOCKETS 1 3488#define NO_X11_UNIX_SOCKETS 1
3877_ACEOF 3489EOF
3878 3490
3879 cat >>confdefs.h <<\_ACEOF 3491 cat >>confdefs.h <<\EOF
3880#define NO_IPPORT_RESERVED_CONCEPT 1 3492#define NO_IPPORT_RESERVED_CONCEPT 1
3881_ACEOF 3493EOF
3882 3494
3883 cat >>confdefs.h <<\_ACEOF 3495 cat >>confdefs.h <<\EOF
3884#define DISABLE_FD_PASSING 1 3496#define DISABLE_FD_PASSING 1
3885_ACEOF 3497EOF
3886 3498
3887 cat >>confdefs.h <<\_ACEOF 3499 cat >>confdefs.h <<\EOF
3888#define SETGROUPS_NOOP 1 3500#define SETGROUPS_NOOP 1
3889_ACEOF 3501EOF
3890 3502
3891 ;; 3503 ;;
3892*-*-dgux*) 3504*-*-dgux*)
3893 cat >>confdefs.h <<\_ACEOF 3505 cat >>confdefs.h <<\EOF
3894#define IP_TOS_IS_BROKEN 1 3506#define IP_TOS_IS_BROKEN 1
3895_ACEOF 3507EOF
3896 3508
3897 ;; 3509 ;;
3898*-*-darwin*) 3510*-*-darwin*)
3899 echo "$as_me:$LINENO: checking if we have working getaddrinfo" >&5 3511 echo "$as_me:3511: checking if we have working getaddrinfo" >&5
3900echo $ECHO_N "checking if we have working getaddrinfo... $ECHO_C" >&6 3512echo $ECHO_N "checking if we have working getaddrinfo... $ECHO_C" >&6
3901 if test "$cross_compiling" = yes; then 3513 if test "$cross_compiling" = yes; then
3902 echo "$as_me:$LINENO: result: assume it is working" >&5 3514 echo "$as_me:3514: result: assume it is working" >&5
3903echo "${ECHO_T}assume it is working" >&6 3515echo "${ECHO_T}assume it is working" >&6
3904else 3516else
3905 cat >conftest.$ac_ext <<_ACEOF 3517 cat >conftest.$ac_ext <<_ACEOF
3906#line $LINENO "configure" 3518#line 3518 "configure"
3907/* confdefs.h. */ 3519#include "confdefs.h"
3908_ACEOF
3909cat confdefs.h >>conftest.$ac_ext
3910cat >>conftest.$ac_ext <<_ACEOF
3911/* end confdefs.h. */
3912#include <mach-o/dyld.h> 3520#include <mach-o/dyld.h>
3913main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) 3521main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
3914 exit(0); 3522 exit(0);
@@ -3917,32 +3525,30 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
3917} 3525}
3918_ACEOF 3526_ACEOF
3919rm -f conftest$ac_exeext 3527rm -f conftest$ac_exeext
3920if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3528if { (eval echo "$as_me:3528: \"$ac_link\"") >&5
3921 (eval $ac_link) 2>&5 3529 (eval $ac_link) 2>&5
3922 ac_status=$? 3530 ac_status=$?
3923 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3531 echo "$as_me:3531: \$? = $ac_status" >&5
3924 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 3532 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
3925 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3533 { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3926 (eval $ac_try) 2>&5 3534 (eval $ac_try) 2>&5
3927 ac_status=$? 3535 ac_status=$?
3928 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3536 echo "$as_me:3536: \$? = $ac_status" >&5
3929 (exit $ac_status); }; }; then 3537 (exit $ac_status); }; }; then
3930 echo "$as_me:$LINENO: result: working" >&5 3538 echo "$as_me:3538: result: working" >&5
3931echo "${ECHO_T}working" >&6 3539echo "${ECHO_T}working" >&6
3932else 3540else
3933 echo "$as_me: program exited with status $ac_status" >&5 3541 echo "$as_me: program exited with status $ac_status" >&5
3934echo "$as_me: failed program was:" >&5 3542echo "$as_me: failed program was:" >&5
3935sed 's/^/| /' conftest.$ac_ext >&5 3543cat conftest.$ac_ext >&5
3936 3544echo "$as_me:3544: result: buggy" >&5
3937( exit $ac_status )
3938echo "$as_me:$LINENO: result: buggy" >&5
3939echo "${ECHO_T}buggy" >&6 3545echo "${ECHO_T}buggy" >&6
3940 cat >>confdefs.h <<\_ACEOF 3546 cat >>confdefs.h <<\EOF
3941#define BROKEN_GETADDRINFO 1 3547#define BROKEN_GETADDRINFO 1
3942_ACEOF 3548EOF
3943 3549
3944fi 3550fi
3945rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 3551rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
3946fi 3552fi
3947 ;; 3553 ;;
3948*-*-hpux10.26) 3554*-*-hpux10.26)
@@ -3951,37 +3557,41 @@ fi
3951 fi 3557 fi
3952 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" 3558 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
3953 IPADDR_IN_DISPLAY=yes 3559 IPADDR_IN_DISPLAY=yes
3954 cat >>confdefs.h <<\_ACEOF 3560 cat >>confdefs.h <<\EOF
3955#define HAVE_SECUREWARE 1 3561#define HAVE_SECUREWARE 1
3956_ACEOF 3562EOF
3957 3563
3958 cat >>confdefs.h <<\_ACEOF 3564 cat >>confdefs.h <<\EOF
3959#define USE_PIPES 1 3565#define USE_PIPES 1
3960_ACEOF 3566EOF
3961 3567
3962 cat >>confdefs.h <<\_ACEOF 3568 cat >>confdefs.h <<\EOF
3963#define LOGIN_NO_ENDOPT 1 3569#define LOGIN_NO_ENDOPT 1
3964_ACEOF 3570EOF
3965 3571
3966 cat >>confdefs.h <<\_ACEOF 3572 cat >>confdefs.h <<\EOF
3967#define LOGIN_NEEDS_UTMPX 1 3573#define LOGIN_NEEDS_UTMPX 1
3968_ACEOF 3574EOF
3969 3575
3970 cat >>confdefs.h <<\_ACEOF 3576 cat >>confdefs.h <<\EOF
3971#define DISABLE_SHADOW 1 3577#define DISABLE_SHADOW 1
3972_ACEOF 3578EOF
3973 3579
3974 cat >>confdefs.h <<\_ACEOF 3580 cat >>confdefs.h <<\EOF
3975#define DISABLE_UTMP 1 3581#define DISABLE_UTMP 1
3976_ACEOF 3582EOF
3977 3583
3978 cat >>confdefs.h <<\_ACEOF 3584 cat >>confdefs.h <<\EOF
3979#define SETPROCTITLE_STRATEGY PS_USE_PSTAT 3585#define LOCKED_PASSWD_STRING "*"
3980_ACEOF 3586EOF
3587
3588 cat >>confdefs.h <<\EOF
3589#define SPT_TYPE SPT_PSTAT
3590EOF
3981 3591
3982 LIBS="$LIBS -lsec -lsecpw" 3592 LIBS="$LIBS -lsec -lsecpw"
3983 3593
3984echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5 3594echo "$as_me:3594: checking for t_error in -lxnet" >&5
3985echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6 3595echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
3986if test "${ac_cv_lib_xnet_t_error+set}" = set; then 3596if test "${ac_cv_lib_xnet_t_error+set}" = set; then
3987 echo $ECHO_N "(cached) $ECHO_C" >&6 3597 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -3989,12 +3599,8 @@ else
3989 ac_check_lib_save_LIBS=$LIBS 3599 ac_check_lib_save_LIBS=$LIBS
3990LIBS="-lxnet $LIBS" 3600LIBS="-lxnet $LIBS"
3991cat >conftest.$ac_ext <<_ACEOF 3601cat >conftest.$ac_ext <<_ACEOF
3992#line $LINENO "configure" 3602#line 3602 "configure"
3993/* confdefs.h. */ 3603#include "confdefs.h"
3994_ACEOF
3995cat confdefs.h >>conftest.$ac_ext
3996cat >>conftest.$ac_ext <<_ACEOF
3997/* end confdefs.h. */
3998 3604
3999/* Override any gcc2 internal prototype to avoid an error. */ 3605/* Override any gcc2 internal prototype to avoid an error. */
4000#ifdef __cplusplus 3606#ifdef __cplusplus
@@ -4012,38 +3618,37 @@ t_error ();
4012} 3618}
4013_ACEOF 3619_ACEOF
4014rm -f conftest.$ac_objext conftest$ac_exeext 3620rm -f conftest.$ac_objext conftest$ac_exeext
4015if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3621if { (eval echo "$as_me:3621: \"$ac_link\"") >&5
4016 (eval $ac_link) 2>&5 3622 (eval $ac_link) 2>&5
4017 ac_status=$? 3623 ac_status=$?
4018 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3624 echo "$as_me:3624: \$? = $ac_status" >&5
4019 (exit $ac_status); } && 3625 (exit $ac_status); } &&
4020 { ac_try='test -s conftest$ac_exeext' 3626 { ac_try='test -s conftest$ac_exeext'
4021 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3627 { (eval echo "$as_me:3627: \"$ac_try\"") >&5
4022 (eval $ac_try) 2>&5 3628 (eval $ac_try) 2>&5
4023 ac_status=$? 3629 ac_status=$?
4024 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3630 echo "$as_me:3630: \$? = $ac_status" >&5
4025 (exit $ac_status); }; }; then 3631 (exit $ac_status); }; }; then
4026 ac_cv_lib_xnet_t_error=yes 3632 ac_cv_lib_xnet_t_error=yes
4027else 3633else
4028 echo "$as_me: failed program was:" >&5 3634 echo "$as_me: failed program was:" >&5
4029sed 's/^/| /' conftest.$ac_ext >&5 3635cat conftest.$ac_ext >&5
4030
4031ac_cv_lib_xnet_t_error=no 3636ac_cv_lib_xnet_t_error=no
4032fi 3637fi
4033rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3638rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4034LIBS=$ac_check_lib_save_LIBS 3639LIBS=$ac_check_lib_save_LIBS
4035fi 3640fi
4036echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5 3641echo "$as_me:3641: result: $ac_cv_lib_xnet_t_error" >&5
4037echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6 3642echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
4038if test $ac_cv_lib_xnet_t_error = yes; then 3643if test $ac_cv_lib_xnet_t_error = yes; then
4039 cat >>confdefs.h <<_ACEOF 3644 cat >>confdefs.h <<EOF
4040#define HAVE_LIBXNET 1 3645#define HAVE_LIBXNET 1
4041_ACEOF 3646EOF
4042 3647
4043 LIBS="-lxnet $LIBS" 3648 LIBS="-lxnet $LIBS"
4044 3649
4045else 3650else
4046 { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5 3651 { { echo "$as_me:3651: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
4047echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;} 3652echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
4048 { (exit 1); exit 1; }; } 3653 { (exit 1); exit 1; }; }
4049fi 3654fi
@@ -4056,33 +3661,37 @@ fi
4056 fi 3661 fi
4057 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" 3662 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
4058 IPADDR_IN_DISPLAY=yes 3663 IPADDR_IN_DISPLAY=yes
4059 cat >>confdefs.h <<\_ACEOF 3664 cat >>confdefs.h <<\EOF
4060#define USE_PIPES 1 3665#define USE_PIPES 1
4061_ACEOF 3666EOF
4062 3667
4063 cat >>confdefs.h <<\_ACEOF 3668 cat >>confdefs.h <<\EOF
4064#define LOGIN_NO_ENDOPT 1 3669#define LOGIN_NO_ENDOPT 1
4065_ACEOF 3670EOF
4066 3671
4067 cat >>confdefs.h <<\_ACEOF 3672 cat >>confdefs.h <<\EOF
4068#define LOGIN_NEEDS_UTMPX 1 3673#define LOGIN_NEEDS_UTMPX 1
4069_ACEOF 3674EOF
4070 3675
4071 cat >>confdefs.h <<\_ACEOF 3676 cat >>confdefs.h <<\EOF
4072#define DISABLE_SHADOW 1 3677#define DISABLE_SHADOW 1
4073_ACEOF 3678EOF
4074 3679
4075 cat >>confdefs.h <<\_ACEOF 3680 cat >>confdefs.h <<\EOF
4076#define DISABLE_UTMP 1 3681#define DISABLE_UTMP 1
4077_ACEOF 3682EOF
4078 3683
4079 cat >>confdefs.h <<\_ACEOF 3684 cat >>confdefs.h <<\EOF
4080#define SETPROCTITLE_STRATEGY PS_USE_PSTAT 3685#define LOCKED_PASSWD_STRING "*"
4081_ACEOF 3686EOF
3687
3688 cat >>confdefs.h <<\EOF
3689#define SPT_TYPE SPT_PSTAT
3690EOF
4082 3691
4083 LIBS="$LIBS -lsec" 3692 LIBS="$LIBS -lsec"
4084 3693
4085echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5 3694echo "$as_me:3694: checking for t_error in -lxnet" >&5
4086echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6 3695echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
4087if test "${ac_cv_lib_xnet_t_error+set}" = set; then 3696if test "${ac_cv_lib_xnet_t_error+set}" = set; then
4088 echo $ECHO_N "(cached) $ECHO_C" >&6 3697 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4090,12 +3699,8 @@ else
4090 ac_check_lib_save_LIBS=$LIBS 3699 ac_check_lib_save_LIBS=$LIBS
4091LIBS="-lxnet $LIBS" 3700LIBS="-lxnet $LIBS"
4092cat >conftest.$ac_ext <<_ACEOF 3701cat >conftest.$ac_ext <<_ACEOF
4093#line $LINENO "configure" 3702#line 3702 "configure"
4094/* confdefs.h. */ 3703#include "confdefs.h"
4095_ACEOF
4096cat confdefs.h >>conftest.$ac_ext
4097cat >>conftest.$ac_ext <<_ACEOF
4098/* end confdefs.h. */
4099 3704
4100/* Override any gcc2 internal prototype to avoid an error. */ 3705/* Override any gcc2 internal prototype to avoid an error. */
4101#ifdef __cplusplus 3706#ifdef __cplusplus
@@ -4113,38 +3718,37 @@ t_error ();
4113} 3718}
4114_ACEOF 3719_ACEOF
4115rm -f conftest.$ac_objext conftest$ac_exeext 3720rm -f conftest.$ac_objext conftest$ac_exeext
4116if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3721if { (eval echo "$as_me:3721: \"$ac_link\"") >&5
4117 (eval $ac_link) 2>&5 3722 (eval $ac_link) 2>&5
4118 ac_status=$? 3723 ac_status=$?
4119 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3724 echo "$as_me:3724: \$? = $ac_status" >&5
4120 (exit $ac_status); } && 3725 (exit $ac_status); } &&
4121 { ac_try='test -s conftest$ac_exeext' 3726 { ac_try='test -s conftest$ac_exeext'
4122 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3727 { (eval echo "$as_me:3727: \"$ac_try\"") >&5
4123 (eval $ac_try) 2>&5 3728 (eval $ac_try) 2>&5
4124 ac_status=$? 3729 ac_status=$?
4125 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3730 echo "$as_me:3730: \$? = $ac_status" >&5
4126 (exit $ac_status); }; }; then 3731 (exit $ac_status); }; }; then
4127 ac_cv_lib_xnet_t_error=yes 3732 ac_cv_lib_xnet_t_error=yes
4128else 3733else
4129 echo "$as_me: failed program was:" >&5 3734 echo "$as_me: failed program was:" >&5
4130sed 's/^/| /' conftest.$ac_ext >&5 3735cat conftest.$ac_ext >&5
4131
4132ac_cv_lib_xnet_t_error=no 3736ac_cv_lib_xnet_t_error=no
4133fi 3737fi
4134rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3738rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4135LIBS=$ac_check_lib_save_LIBS 3739LIBS=$ac_check_lib_save_LIBS
4136fi 3740fi
4137echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5 3741echo "$as_me:3741: result: $ac_cv_lib_xnet_t_error" >&5
4138echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6 3742echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
4139if test $ac_cv_lib_xnet_t_error = yes; then 3743if test $ac_cv_lib_xnet_t_error = yes; then
4140 cat >>confdefs.h <<_ACEOF 3744 cat >>confdefs.h <<EOF
4141#define HAVE_LIBXNET 1 3745#define HAVE_LIBXNET 1
4142_ACEOF 3746EOF
4143 3747
4144 LIBS="-lxnet $LIBS" 3748 LIBS="-lxnet $LIBS"
4145 3749
4146else 3750else
4147 { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5 3751 { { echo "$as_me:3751: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
4148echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;} 3752echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
4149 { (exit 1); exit 1; }; } 3753 { (exit 1); exit 1; }; }
4150fi 3754fi
@@ -4153,37 +3757,41 @@ fi
4153*-*-hpux11*) 3757*-*-hpux11*)
4154 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1" 3758 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
4155 IPADDR_IN_DISPLAY=yes 3759 IPADDR_IN_DISPLAY=yes
4156 cat >>confdefs.h <<\_ACEOF 3760 cat >>confdefs.h <<\EOF
4157#define PAM_SUN_CODEBASE 1 3761#define PAM_SUN_CODEBASE 1
4158_ACEOF 3762EOF
4159 3763
4160 cat >>confdefs.h <<\_ACEOF 3764 cat >>confdefs.h <<\EOF
4161#define USE_PIPES 1 3765#define USE_PIPES 1
4162_ACEOF 3766EOF
4163 3767
4164 cat >>confdefs.h <<\_ACEOF 3768 cat >>confdefs.h <<\EOF
4165#define LOGIN_NO_ENDOPT 1 3769#define LOGIN_NO_ENDOPT 1
4166_ACEOF 3770EOF
4167 3771
4168 cat >>confdefs.h <<\_ACEOF 3772 cat >>confdefs.h <<\EOF
4169#define LOGIN_NEEDS_UTMPX 1 3773#define LOGIN_NEEDS_UTMPX 1
4170_ACEOF 3774EOF
4171 3775
4172 cat >>confdefs.h <<\_ACEOF 3776 cat >>confdefs.h <<\EOF
4173#define DISABLE_SHADOW 1 3777#define DISABLE_SHADOW 1
4174_ACEOF 3778EOF
4175 3779
4176 cat >>confdefs.h <<\_ACEOF 3780 cat >>confdefs.h <<\EOF
4177#define DISABLE_UTMP 1 3781#define DISABLE_UTMP 1
4178_ACEOF 3782EOF
4179 3783
4180 cat >>confdefs.h <<\_ACEOF 3784 cat >>confdefs.h <<\EOF
4181#define SETPROCTITLE_STRATEGY PS_USE_PSTAT 3785#define LOCKED_PASSWD_STRING "*"
4182_ACEOF 3786EOF
3787
3788 cat >>confdefs.h <<\EOF
3789#define SPT_TYPE SPT_PSTAT
3790EOF
4183 3791
4184 LIBS="$LIBS -lsec" 3792 LIBS="$LIBS -lsec"
4185 3793
4186echo "$as_me:$LINENO: checking for t_error in -lxnet" >&5 3794echo "$as_me:3794: checking for t_error in -lxnet" >&5
4187echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6 3795echo $ECHO_N "checking for t_error in -lxnet... $ECHO_C" >&6
4188if test "${ac_cv_lib_xnet_t_error+set}" = set; then 3796if test "${ac_cv_lib_xnet_t_error+set}" = set; then
4189 echo $ECHO_N "(cached) $ECHO_C" >&6 3797 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -4191,12 +3799,8 @@ else
4191 ac_check_lib_save_LIBS=$LIBS 3799 ac_check_lib_save_LIBS=$LIBS
4192LIBS="-lxnet $LIBS" 3800LIBS="-lxnet $LIBS"
4193cat >conftest.$ac_ext <<_ACEOF 3801cat >conftest.$ac_ext <<_ACEOF
4194#line $LINENO "configure" 3802#line 3802 "configure"
4195/* confdefs.h. */ 3803#include "confdefs.h"
4196_ACEOF
4197cat confdefs.h >>conftest.$ac_ext
4198cat >>conftest.$ac_ext <<_ACEOF
4199/* end confdefs.h. */
4200 3804
4201/* Override any gcc2 internal prototype to avoid an error. */ 3805/* Override any gcc2 internal prototype to avoid an error. */
4202#ifdef __cplusplus 3806#ifdef __cplusplus
@@ -4214,38 +3818,37 @@ t_error ();
4214} 3818}
4215_ACEOF 3819_ACEOF
4216rm -f conftest.$ac_objext conftest$ac_exeext 3820rm -f conftest.$ac_objext conftest$ac_exeext
4217if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3821if { (eval echo "$as_me:3821: \"$ac_link\"") >&5
4218 (eval $ac_link) 2>&5 3822 (eval $ac_link) 2>&5
4219 ac_status=$? 3823 ac_status=$?
4220 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3824 echo "$as_me:3824: \$? = $ac_status" >&5
4221 (exit $ac_status); } && 3825 (exit $ac_status); } &&
4222 { ac_try='test -s conftest$ac_exeext' 3826 { ac_try='test -s conftest$ac_exeext'
4223 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3827 { (eval echo "$as_me:3827: \"$ac_try\"") >&5
4224 (eval $ac_try) 2>&5 3828 (eval $ac_try) 2>&5
4225 ac_status=$? 3829 ac_status=$?
4226 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3830 echo "$as_me:3830: \$? = $ac_status" >&5
4227 (exit $ac_status); }; }; then 3831 (exit $ac_status); }; }; then
4228 ac_cv_lib_xnet_t_error=yes 3832 ac_cv_lib_xnet_t_error=yes
4229else 3833else
4230 echo "$as_me: failed program was:" >&5 3834 echo "$as_me: failed program was:" >&5
4231sed 's/^/| /' conftest.$ac_ext >&5 3835cat conftest.$ac_ext >&5
4232
4233ac_cv_lib_xnet_t_error=no 3836ac_cv_lib_xnet_t_error=no
4234fi 3837fi
4235rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3838rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4236LIBS=$ac_check_lib_save_LIBS 3839LIBS=$ac_check_lib_save_LIBS
4237fi 3840fi
4238echo "$as_me:$LINENO: result: $ac_cv_lib_xnet_t_error" >&5 3841echo "$as_me:3841: result: $ac_cv_lib_xnet_t_error" >&5
4239echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6 3842echo "${ECHO_T}$ac_cv_lib_xnet_t_error" >&6
4240if test $ac_cv_lib_xnet_t_error = yes; then 3843if test $ac_cv_lib_xnet_t_error = yes; then
4241 cat >>confdefs.h <<_ACEOF 3844 cat >>confdefs.h <<EOF
4242#define HAVE_LIBXNET 1 3845#define HAVE_LIBXNET 1
4243_ACEOF 3846EOF
4244 3847
4245 LIBS="-lxnet $LIBS" 3848 LIBS="-lxnet $LIBS"
4246 3849
4247else 3850else
4248 { { echo "$as_me:$LINENO: error: *** -lxnet needed on HP-UX - check config.log ***" >&5 3851 { { echo "$as_me:3851: error: *** -lxnet needed on HP-UX - check config.log ***" >&5
4249echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;} 3852echo "$as_me: error: *** -lxnet needed on HP-UX - check config.log ***" >&2;}
4250 { (exit 1); exit 1; }; } 3853 { (exit 1); exit 1; }; }
4251fi 3854fi
@@ -4255,144 +3858,147 @@ fi
4255 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 3858 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4256 LDFLAGS="$LDFLAGS" 3859 LDFLAGS="$LDFLAGS"
4257 PATH="$PATH:/usr/etc" 3860 PATH="$PATH:/usr/etc"
4258 cat >>confdefs.h <<\_ACEOF 3861 cat >>confdefs.h <<\EOF
4259#define BROKEN_INET_NTOA 1 3862#define BROKEN_INET_NTOA 1
4260_ACEOF 3863EOF
4261 3864
4262 cat >>confdefs.h <<\_ACEOF 3865 cat >>confdefs.h <<\EOF
4263#define WITH_ABBREV_NO_TTY 1 3866#define WITH_ABBREV_NO_TTY 1
4264_ACEOF 3867EOF
3868
3869 cat >>confdefs.h <<\EOF
3870#define LOCKED_PASSWD_STRING "*LK*"
3871EOF
4265 3872
4266 ;; 3873 ;;
4267*-*-irix6*) 3874*-*-irix6*)
4268 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 3875 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4269 LDFLAGS="$LDFLAGS" 3876 LDFLAGS="$LDFLAGS"
4270 PATH="$PATH:/usr/etc" 3877 PATH="$PATH:/usr/etc"
4271 cat >>confdefs.h <<\_ACEOF 3878 cat >>confdefs.h <<\EOF
4272#define WITH_IRIX_ARRAY 1 3879#define WITH_IRIX_ARRAY 1
4273_ACEOF 3880EOF
4274 3881
4275 cat >>confdefs.h <<\_ACEOF 3882 cat >>confdefs.h <<\EOF
4276#define WITH_IRIX_PROJECT 1 3883#define WITH_IRIX_PROJECT 1
4277_ACEOF 3884EOF
4278 3885
4279 cat >>confdefs.h <<\_ACEOF 3886 cat >>confdefs.h <<\EOF
4280#define WITH_IRIX_AUDIT 1 3887#define WITH_IRIX_AUDIT 1
4281_ACEOF 3888EOF
4282 3889
4283 echo "$as_me:$LINENO: checking for jlimit_startjob" >&5 3890 echo "$as_me:3890: checking for jlimit_startjob" >&5
4284echo $ECHO_N "checking for jlimit_startjob... $ECHO_C" >&6 3891echo $ECHO_N "checking for jlimit_startjob... $ECHO_C" >&6
4285if test "${ac_cv_func_jlimit_startjob+set}" = set; then 3892if test "${ac_cv_func_jlimit_startjob+set}" = set; then
4286 echo $ECHO_N "(cached) $ECHO_C" >&6 3893 echo $ECHO_N "(cached) $ECHO_C" >&6
4287else 3894else
4288 cat >conftest.$ac_ext <<_ACEOF 3895 cat >conftest.$ac_ext <<_ACEOF
4289#line $LINENO "configure" 3896#line 3896 "configure"
4290/* confdefs.h. */ 3897#include "confdefs.h"
4291_ACEOF
4292cat confdefs.h >>conftest.$ac_ext
4293cat >>conftest.$ac_ext <<_ACEOF
4294/* end confdefs.h. */
4295/* System header to define __stub macros and hopefully few prototypes, 3898/* System header to define __stub macros and hopefully few prototypes,
4296 which can conflict with char jlimit_startjob (); below. 3899 which can conflict with char jlimit_startjob (); below. */
4297 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 3900#include <assert.h>
4298 <limits.h> exists even on freestanding compilers. */
4299#ifdef __STDC__
4300# include <limits.h>
4301#else
4302# include <assert.h>
4303#endif
4304/* Override any gcc2 internal prototype to avoid an error. */ 3901/* Override any gcc2 internal prototype to avoid an error. */
4305#ifdef __cplusplus 3902#ifdef __cplusplus
4306extern "C" 3903extern "C"
4307{
4308#endif 3904#endif
4309/* We use char because int might match the return type of a gcc2 3905/* We use char because int might match the return type of a gcc2
4310 builtin and then its argument prototype would still apply. */ 3906 builtin and then its argument prototype would still apply. */
4311char jlimit_startjob (); 3907char jlimit_startjob ();
3908char (*f) ();
3909
3910int
3911main ()
3912{
4312/* The GNU C library defines this for functions which it implements 3913/* The GNU C library defines this for functions which it implements
4313 to always fail with ENOSYS. Some functions are actually named 3914 to always fail with ENOSYS. Some functions are actually named
4314 something starting with __ and the normal name is an alias. */ 3915 something starting with __ and the normal name is an alias. */
4315#if defined (__stub_jlimit_startjob) || defined (__stub___jlimit_startjob) 3916#if defined (__stub_jlimit_startjob) || defined (__stub___jlimit_startjob)
4316choke me 3917choke me
4317#else 3918#else
4318char (*f) () = jlimit_startjob; 3919f = jlimit_startjob;
4319#endif
4320#ifdef __cplusplus
4321}
4322#endif 3920#endif
4323 3921
4324int
4325main ()
4326{
4327return f != jlimit_startjob;
4328 ; 3922 ;
4329 return 0; 3923 return 0;
4330} 3924}
4331_ACEOF 3925_ACEOF
4332rm -f conftest.$ac_objext conftest$ac_exeext 3926rm -f conftest.$ac_objext conftest$ac_exeext
4333if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 3927if { (eval echo "$as_me:3927: \"$ac_link\"") >&5
4334 (eval $ac_link) 2>&5 3928 (eval $ac_link) 2>&5
4335 ac_status=$? 3929 ac_status=$?
4336 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3930 echo "$as_me:3930: \$? = $ac_status" >&5
4337 (exit $ac_status); } && 3931 (exit $ac_status); } &&
4338 { ac_try='test -s conftest$ac_exeext' 3932 { ac_try='test -s conftest$ac_exeext'
4339 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 3933 { (eval echo "$as_me:3933: \"$ac_try\"") >&5
4340 (eval $ac_try) 2>&5 3934 (eval $ac_try) 2>&5
4341 ac_status=$? 3935 ac_status=$?
4342 echo "$as_me:$LINENO: \$? = $ac_status" >&5 3936 echo "$as_me:3936: \$? = $ac_status" >&5
4343 (exit $ac_status); }; }; then 3937 (exit $ac_status); }; }; then
4344 ac_cv_func_jlimit_startjob=yes 3938 ac_cv_func_jlimit_startjob=yes
4345else 3939else
4346 echo "$as_me: failed program was:" >&5 3940 echo "$as_me: failed program was:" >&5
4347sed 's/^/| /' conftest.$ac_ext >&5 3941cat conftest.$ac_ext >&5
4348
4349ac_cv_func_jlimit_startjob=no 3942ac_cv_func_jlimit_startjob=no
4350fi 3943fi
4351rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 3944rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4352fi 3945fi
4353echo "$as_me:$LINENO: result: $ac_cv_func_jlimit_startjob" >&5 3946echo "$as_me:3946: result: $ac_cv_func_jlimit_startjob" >&5
4354echo "${ECHO_T}$ac_cv_func_jlimit_startjob" >&6 3947echo "${ECHO_T}$ac_cv_func_jlimit_startjob" >&6
4355if test $ac_cv_func_jlimit_startjob = yes; then 3948if test $ac_cv_func_jlimit_startjob = yes; then
4356 cat >>confdefs.h <<\_ACEOF 3949 cat >>confdefs.h <<\EOF
4357#define WITH_IRIX_JOBS 1 3950#define WITH_IRIX_JOBS 1
4358_ACEOF 3951EOF
4359 3952
4360fi 3953fi
4361 3954
4362 cat >>confdefs.h <<\_ACEOF 3955 cat >>confdefs.h <<\EOF
4363#define BROKEN_INET_NTOA 1 3956#define BROKEN_INET_NTOA 1
4364_ACEOF 3957EOF
4365 3958
4366 cat >>confdefs.h <<\_ACEOF 3959 cat >>confdefs.h <<\EOF
4367#define WITH_ABBREV_NO_TTY 1 3960#define WITH_ABBREV_NO_TTY 1
4368_ACEOF 3961EOF
3962
3963 cat >>confdefs.h <<\EOF
3964#define LOCKED_PASSWD_STRING "*LK*"
3965EOF
4369 3966
4370 ;; 3967 ;;
4371*-*-linux*) 3968*-*-linux*)
4372 no_dev_ptmx=1 3969 no_dev_ptmx=1
4373 check_for_libcrypt_later=1 3970 check_for_libcrypt_later=1
4374 cat >>confdefs.h <<\_ACEOF 3971 check_for_openpty_ctty_bug=1
3972 cat >>confdefs.h <<\EOF
4375#define DONT_TRY_OTHER_AF 1 3973#define DONT_TRY_OTHER_AF 1
4376_ACEOF 3974EOF
4377 3975
4378 cat >>confdefs.h <<\_ACEOF 3976 cat >>confdefs.h <<\EOF
4379#define PAM_TTY_KLUDGE 1 3977#define PAM_TTY_KLUDGE 1
4380_ACEOF 3978EOF
4381 3979
4382 cat >>confdefs.h <<\_ACEOF 3980 cat >>confdefs.h <<\EOF
4383#define SETPROCTITLE_STRATEGY PS_USE_CLOBBER_ARGV 3981#define LOCKED_PASSWD_PREFIX "!!"
4384_ACEOF 3982EOF
4385 3983
4386 cat >>confdefs.h <<\_ACEOF 3984 cat >>confdefs.h <<\EOF
4387#define SETPROCTITLE_PS_PADDING '\0' 3985#define SPT_TYPE SPT_REUSEARGV
4388_ACEOF 3986EOF
4389 3987
4390 inet6_default_4in6=yes 3988 inet6_default_4in6=yes
3989 case `uname -r` in
3990 1.*|2.0.*)
3991 cat >>confdefs.h <<\EOF
3992#define BROKEN_CMSG_TYPE 1
3993EOF
3994
3995 ;;
3996 esac
4391 ;; 3997 ;;
4392mips-sony-bsd|mips-sony-newsos4) 3998mips-sony-bsd|mips-sony-newsos4)
4393 cat >>confdefs.h <<\_ACEOF 3999 cat >>confdefs.h <<\EOF
4394#define HAVE_NEWS4 1 4000#define HAVE_NEWS4 1
4395_ACEOF 4001EOF
4396 4002
4397 SONY=1 4003 SONY=1
4398 ;; 4004 ;;
@@ -4408,21 +4014,21 @@ _ACEOF
4408 conf_utmp_location=/etc/utmp 4014 conf_utmp_location=/etc/utmp
4409 conf_wtmp_location=/usr/adm/wtmp 4015 conf_wtmp_location=/usr/adm/wtmp
4410 MAIL=/usr/spool/mail 4016 MAIL=/usr/spool/mail
4411 cat >>confdefs.h <<\_ACEOF 4017 cat >>confdefs.h <<\EOF
4412#define HAVE_NEXT 1 4018#define HAVE_NEXT 1
4413_ACEOF 4019EOF
4414 4020
4415 cat >>confdefs.h <<\_ACEOF 4021 cat >>confdefs.h <<\EOF
4416#define BROKEN_REALPATH 1 4022#define BROKEN_REALPATH 1
4417_ACEOF 4023EOF
4418 4024
4419 cat >>confdefs.h <<\_ACEOF 4025 cat >>confdefs.h <<\EOF
4420#define USE_PIPES 1 4026#define USE_PIPES 1
4421_ACEOF 4027EOF
4422 4028
4423 cat >>confdefs.h <<\_ACEOF 4029 cat >>confdefs.h <<\EOF
4424#define BROKEN_SAVED_UIDS 1 4030#define BROKEN_SAVED_UIDS 1
4425_ACEOF 4031EOF
4426 4032
4427 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 4033 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4428 CFLAGS="$CFLAGS" 4034 CFLAGS="$CFLAGS"
@@ -4431,44 +4037,50 @@ _ACEOF
4431 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 4037 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4432 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib" 4038 LDFLAGS="$LDFLAGS -L/usr/local/lib -R/usr/local/lib"
4433 need_dash_r=1 4039 need_dash_r=1
4434 cat >>confdefs.h <<\_ACEOF 4040 cat >>confdefs.h <<\EOF
4435#define PAM_SUN_CODEBASE 1 4041#define PAM_SUN_CODEBASE 1
4436_ACEOF 4042EOF
4437 4043
4438 cat >>confdefs.h <<\_ACEOF 4044 cat >>confdefs.h <<\EOF
4439#define LOGIN_NEEDS_UTMPX 1 4045#define LOGIN_NEEDS_UTMPX 1
4440_ACEOF 4046EOF
4441 4047
4442 cat >>confdefs.h <<\_ACEOF 4048 cat >>confdefs.h <<\EOF
4443#define LOGIN_NEEDS_TERM 1 4049#define LOGIN_NEEDS_TERM 1
4444_ACEOF 4050EOF
4445 4051
4446 cat >>confdefs.h <<\_ACEOF 4052 cat >>confdefs.h <<\EOF
4447#define PAM_TTY_KLUDGE 1 4053#define PAM_TTY_KLUDGE 1
4448_ACEOF 4054EOF
4449 4055
4450 cat >>confdefs.h <<\_ACEOF 4056 cat >>confdefs.h <<\EOF
4451#define STREAMS_PUSH_ACQUIRES_CTTY 1 4057#define LOCKED_PASSWD_STRING "*LK*"
4452_ACEOF 4058EOF
4453 4059
4060 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
4061 cat >>confdefs.h <<\EOF
4062#define SSHD_ACQUIRES_CTTY 1
4063EOF
4064
4065 external_path_file=/etc/default/login
4454 # hardwire lastlog location (can't detect it on some versions) 4066 # hardwire lastlog location (can't detect it on some versions)
4455 conf_lastlog_location="/var/adm/lastlog" 4067 conf_lastlog_location="/var/adm/lastlog"
4456 echo "$as_me:$LINENO: checking for obsolete utmp and wtmp in solaris2.x" >&5 4068 echo "$as_me:4068: checking for obsolete utmp and wtmp in solaris2.x" >&5
4457echo $ECHO_N "checking for obsolete utmp and wtmp in solaris2.x... $ECHO_C" >&6 4069echo $ECHO_N "checking for obsolete utmp and wtmp in solaris2.x... $ECHO_C" >&6
4458 sol2ver=`echo "$host"| sed -e 's/.*[0-9]\.//'` 4070 sol2ver=`echo "$host"| sed -e 's/.*[0-9]\.//'`
4459 if test "$sol2ver" -ge 8; then 4071 if test "$sol2ver" -ge 8; then
4460 echo "$as_me:$LINENO: result: yes" >&5 4072 echo "$as_me:4072: result: yes" >&5
4461echo "${ECHO_T}yes" >&6 4073echo "${ECHO_T}yes" >&6
4462 cat >>confdefs.h <<\_ACEOF 4074 cat >>confdefs.h <<\EOF
4463#define DISABLE_UTMP 1 4075#define DISABLE_UTMP 1
4464_ACEOF 4076EOF
4465 4077
4466 cat >>confdefs.h <<\_ACEOF 4078 cat >>confdefs.h <<\EOF
4467#define DISABLE_WTMP 1 4079#define DISABLE_WTMP 1
4468_ACEOF 4080EOF
4469 4081
4470 else 4082 else
4471 echo "$as_me:$LINENO: result: no" >&5 4083 echo "$as_me:4083: result: no" >&5
4472echo "${ECHO_T}no" >&6 4084echo "${ECHO_T}no" >&6
4473 fi 4085 fi
4474 ;; 4086 ;;
@@ -4478,105 +4090,95 @@ echo "${ECHO_T}no" >&6
4478for ac_func in getpwanam 4090for ac_func in getpwanam
4479do 4091do
4480as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 4092as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
4481echo "$as_me:$LINENO: checking for $ac_func" >&5 4093echo "$as_me:4093: checking for $ac_func" >&5
4482echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 4094echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
4483if eval "test \"\${$as_ac_var+set}\" = set"; then 4095if eval "test \"\${$as_ac_var+set}\" = set"; then
4484 echo $ECHO_N "(cached) $ECHO_C" >&6 4096 echo $ECHO_N "(cached) $ECHO_C" >&6
4485else 4097else
4486 cat >conftest.$ac_ext <<_ACEOF 4098 cat >conftest.$ac_ext <<_ACEOF
4487#line $LINENO "configure" 4099#line 4099 "configure"
4488/* confdefs.h. */ 4100#include "confdefs.h"
4489_ACEOF
4490cat confdefs.h >>conftest.$ac_ext
4491cat >>conftest.$ac_ext <<_ACEOF
4492/* end confdefs.h. */
4493/* System header to define __stub macros and hopefully few prototypes, 4101/* System header to define __stub macros and hopefully few prototypes,
4494 which can conflict with char $ac_func (); below. 4102 which can conflict with char $ac_func (); below. */
4495 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 4103#include <assert.h>
4496 <limits.h> exists even on freestanding compilers. */
4497#ifdef __STDC__
4498# include <limits.h>
4499#else
4500# include <assert.h>
4501#endif
4502/* Override any gcc2 internal prototype to avoid an error. */ 4104/* Override any gcc2 internal prototype to avoid an error. */
4503#ifdef __cplusplus 4105#ifdef __cplusplus
4504extern "C" 4106extern "C"
4505{
4506#endif 4107#endif
4507/* We use char because int might match the return type of a gcc2 4108/* We use char because int might match the return type of a gcc2
4508 builtin and then its argument prototype would still apply. */ 4109 builtin and then its argument prototype would still apply. */
4509char $ac_func (); 4110char $ac_func ();
4111char (*f) ();
4112
4113int
4114main ()
4115{
4510/* The GNU C library defines this for functions which it implements 4116/* The GNU C library defines this for functions which it implements
4511 to always fail with ENOSYS. Some functions are actually named 4117 to always fail with ENOSYS. Some functions are actually named
4512 something starting with __ and the normal name is an alias. */ 4118 something starting with __ and the normal name is an alias. */
4513#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 4119#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4514choke me 4120choke me
4515#else 4121#else
4516char (*f) () = $ac_func; 4122f = $ac_func;
4517#endif
4518#ifdef __cplusplus
4519}
4520#endif 4123#endif
4521 4124
4522int
4523main ()
4524{
4525return f != $ac_func;
4526 ; 4125 ;
4527 return 0; 4126 return 0;
4528} 4127}
4529_ACEOF 4128_ACEOF
4530rm -f conftest.$ac_objext conftest$ac_exeext 4129rm -f conftest.$ac_objext conftest$ac_exeext
4531if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4130if { (eval echo "$as_me:4130: \"$ac_link\"") >&5
4532 (eval $ac_link) 2>&5 4131 (eval $ac_link) 2>&5
4533 ac_status=$? 4132 ac_status=$?
4534 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4133 echo "$as_me:4133: \$? = $ac_status" >&5
4535 (exit $ac_status); } && 4134 (exit $ac_status); } &&
4536 { ac_try='test -s conftest$ac_exeext' 4135 { ac_try='test -s conftest$ac_exeext'
4537 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4136 { (eval echo "$as_me:4136: \"$ac_try\"") >&5
4538 (eval $ac_try) 2>&5 4137 (eval $ac_try) 2>&5
4539 ac_status=$? 4138 ac_status=$?
4540 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4139 echo "$as_me:4139: \$? = $ac_status" >&5
4541 (exit $ac_status); }; }; then 4140 (exit $ac_status); }; }; then
4542 eval "$as_ac_var=yes" 4141 eval "$as_ac_var=yes"
4543else 4142else
4544 echo "$as_me: failed program was:" >&5 4143 echo "$as_me: failed program was:" >&5
4545sed 's/^/| /' conftest.$ac_ext >&5 4144cat conftest.$ac_ext >&5
4546
4547eval "$as_ac_var=no" 4145eval "$as_ac_var=no"
4548fi 4146fi
4549rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4147rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4550fi 4148fi
4551echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 4149echo "$as_me:4149: result: `eval echo '${'$as_ac_var'}'`" >&5
4552echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 4150echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
4553if test `eval echo '${'$as_ac_var'}'` = yes; then 4151if test `eval echo '${'$as_ac_var'}'` = yes; then
4554 cat >>confdefs.h <<_ACEOF 4152 cat >>confdefs.h <<EOF
4555#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 4153#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
4556_ACEOF 4154EOF
4557 4155
4558fi 4156fi
4559done 4157done
4560 4158
4561 cat >>confdefs.h <<\_ACEOF 4159 cat >>confdefs.h <<\EOF
4562#define PAM_SUN_CODEBASE 1 4160#define PAM_SUN_CODEBASE 1
4563_ACEOF 4161EOF
4564 4162
4565 conf_utmp_location=/etc/utmp 4163 conf_utmp_location=/etc/utmp
4566 conf_wtmp_location=/var/adm/wtmp 4164 conf_wtmp_location=/var/adm/wtmp
4567 conf_lastlog_location=/var/adm/lastlog 4165 conf_lastlog_location=/var/adm/lastlog
4568 cat >>confdefs.h <<\_ACEOF 4166 cat >>confdefs.h <<\EOF
4569#define USE_PIPES 1 4167#define USE_PIPES 1
4570_ACEOF 4168EOF
4571 4169
4572 ;; 4170 ;;
4573*-ncr-sysv*) 4171*-ncr-sysv*)
4574 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 4172 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4575 LDFLAGS="$LDFLAGS -L/usr/local/lib" 4173 LDFLAGS="$LDFLAGS -L/usr/local/lib"
4576 LIBS="$LIBS -lc89" 4174 LIBS="$LIBS -lc89"
4577 cat >>confdefs.h <<\_ACEOF 4175 cat >>confdefs.h <<\EOF
4578#define USE_PIPES 1 4176#define USE_PIPES 1
4579_ACEOF 4177EOF
4178
4179 cat >>confdefs.h <<\EOF
4180#define SSHD_ACQUIRES_CTTY 1
4181EOF
4580 4182
4581 ;; 4183 ;;
4582*-sni-sysv*) 4184*-sni-sysv*)
@@ -4584,14 +4186,19 @@ _ACEOF
4584 # /usr/ucblib MUST NOT be searched on ReliantUNIX 4186 # /usr/ucblib MUST NOT be searched on ReliantUNIX
4585 LDFLAGS="$LDFLAGS -L/usr/local/lib" 4187 LDFLAGS="$LDFLAGS -L/usr/local/lib"
4586 IPADDR_IN_DISPLAY=yes 4188 IPADDR_IN_DISPLAY=yes
4587 cat >>confdefs.h <<\_ACEOF 4189 cat >>confdefs.h <<\EOF
4588#define USE_PIPES 1 4190#define USE_PIPES 1
4589_ACEOF 4191EOF
4590 4192
4591 cat >>confdefs.h <<\_ACEOF 4193 cat >>confdefs.h <<\EOF
4592#define IP_TOS_IS_BROKEN 1 4194#define IP_TOS_IS_BROKEN 1
4593_ACEOF 4195EOF
4196
4197 cat >>confdefs.h <<\EOF
4198#define SSHD_ACQUIRES_CTTY 1
4199EOF
4594 4200
4201 external_path_file=/etc/default/login
4595 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX 4202 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
4596 # Attention: always take care to bind libsocket and libnsl before libc, 4203 # Attention: always take care to bind libsocket and libnsl before libc,
4597 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog 4204 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
@@ -4599,17 +4206,41 @@ _ACEOF
4599*-*-sysv4.2*) 4206*-*-sysv4.2*)
4600 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 4207 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4601 LDFLAGS="$LDFLAGS -L/usr/local/lib" 4208 LDFLAGS="$LDFLAGS -L/usr/local/lib"
4602 cat >>confdefs.h <<\_ACEOF 4209 cat >>confdefs.h <<\EOF
4603#define USE_PIPES 1 4210#define USE_PIPES 1
4604_ACEOF 4211EOF
4212
4213 cat >>confdefs.h <<\EOF
4214#define SETEUID_BREAKS_SETUID 1
4215EOF
4216
4217 cat >>confdefs.h <<\EOF
4218#define BROKEN_SETREUID 1
4219EOF
4220
4221 cat >>confdefs.h <<\EOF
4222#define BROKEN_SETREGID 1
4223EOF
4605 4224
4606 ;; 4225 ;;
4607*-*-sysv5*) 4226*-*-sysv5*)
4608 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 4227 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
4609 LDFLAGS="$LDFLAGS -L/usr/local/lib" 4228 LDFLAGS="$LDFLAGS -L/usr/local/lib"
4610 cat >>confdefs.h <<\_ACEOF 4229 cat >>confdefs.h <<\EOF
4611#define USE_PIPES 1 4230#define USE_PIPES 1
4612_ACEOF 4231EOF
4232
4233 cat >>confdefs.h <<\EOF
4234#define SETEUID_BREAKS_SETUID 1
4235EOF
4236
4237 cat >>confdefs.h <<\EOF
4238#define BROKEN_SETREUID 1
4239EOF
4240
4241 cat >>confdefs.h <<\EOF
4242#define BROKEN_SETREGID 1
4243EOF
4613 4244
4614 ;; 4245 ;;
4615*-*-sysv*) 4246*-*-sysv*)
@@ -4622,107 +4253,95 @@ _ACEOF
4622 LIBS="$LIBS -los -lprot -lx -ltinfo -lm" 4253 LIBS="$LIBS -los -lprot -lx -ltinfo -lm"
4623 RANLIB=true 4254 RANLIB=true
4624 no_dev_ptmx=1 4255 no_dev_ptmx=1
4625 cat >>confdefs.h <<\_ACEOF 4256 cat >>confdefs.h <<\EOF
4626#define BROKEN_SYS_TERMIO_H 1 4257#define BROKEN_SYS_TERMIO_H 1
4627_ACEOF 4258EOF
4628 4259
4629 cat >>confdefs.h <<\_ACEOF 4260 cat >>confdefs.h <<\EOF
4630#define USE_PIPES 1 4261#define USE_PIPES 1
4631_ACEOF 4262EOF
4632 4263
4633 cat >>confdefs.h <<\_ACEOF 4264 cat >>confdefs.h <<\EOF
4634#define HAVE_SECUREWARE 1 4265#define HAVE_SECUREWARE 1
4635_ACEOF 4266EOF
4636 4267
4637 cat >>confdefs.h <<\_ACEOF 4268 cat >>confdefs.h <<\EOF
4638#define DISABLE_SHADOW 1 4269#define DISABLE_SHADOW 1
4639_ACEOF 4270EOF
4640 4271
4641 cat >>confdefs.h <<\_ACEOF 4272 cat >>confdefs.h <<\EOF
4642#define BROKEN_SAVED_UIDS 1 4273#define BROKEN_SAVED_UIDS 1
4643_ACEOF 4274EOF
4644
4645 4275
4276 cat >>confdefs.h <<\EOF
4277#define WITH_ABBREV_NO_TTY 1
4278EOF
4646 4279
4647for ac_func in getluid setluid 4280for ac_func in getluid setluid
4648do 4281do
4649as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 4282as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
4650echo "$as_me:$LINENO: checking for $ac_func" >&5 4283echo "$as_me:4283: checking for $ac_func" >&5
4651echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 4284echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
4652if eval "test \"\${$as_ac_var+set}\" = set"; then 4285if eval "test \"\${$as_ac_var+set}\" = set"; then
4653 echo $ECHO_N "(cached) $ECHO_C" >&6 4286 echo $ECHO_N "(cached) $ECHO_C" >&6
4654else 4287else
4655 cat >conftest.$ac_ext <<_ACEOF 4288 cat >conftest.$ac_ext <<_ACEOF
4656#line $LINENO "configure" 4289#line 4289 "configure"
4657/* confdefs.h. */ 4290#include "confdefs.h"
4658_ACEOF
4659cat confdefs.h >>conftest.$ac_ext
4660cat >>conftest.$ac_ext <<_ACEOF
4661/* end confdefs.h. */
4662/* System header to define __stub macros and hopefully few prototypes, 4291/* System header to define __stub macros and hopefully few prototypes,
4663 which can conflict with char $ac_func (); below. 4292 which can conflict with char $ac_func (); below. */
4664 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 4293#include <assert.h>
4665 <limits.h> exists even on freestanding compilers. */
4666#ifdef __STDC__
4667# include <limits.h>
4668#else
4669# include <assert.h>
4670#endif
4671/* Override any gcc2 internal prototype to avoid an error. */ 4294/* Override any gcc2 internal prototype to avoid an error. */
4672#ifdef __cplusplus 4295#ifdef __cplusplus
4673extern "C" 4296extern "C"
4674{
4675#endif 4297#endif
4676/* We use char because int might match the return type of a gcc2 4298/* We use char because int might match the return type of a gcc2
4677 builtin and then its argument prototype would still apply. */ 4299 builtin and then its argument prototype would still apply. */
4678char $ac_func (); 4300char $ac_func ();
4301char (*f) ();
4302
4303int
4304main ()
4305{
4679/* The GNU C library defines this for functions which it implements 4306/* The GNU C library defines this for functions which it implements
4680 to always fail with ENOSYS. Some functions are actually named 4307 to always fail with ENOSYS. Some functions are actually named
4681 something starting with __ and the normal name is an alias. */ 4308 something starting with __ and the normal name is an alias. */
4682#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 4309#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4683choke me 4310choke me
4684#else 4311#else
4685char (*f) () = $ac_func; 4312f = $ac_func;
4686#endif
4687#ifdef __cplusplus
4688}
4689#endif 4313#endif
4690 4314
4691int
4692main ()
4693{
4694return f != $ac_func;
4695 ; 4315 ;
4696 return 0; 4316 return 0;
4697} 4317}
4698_ACEOF 4318_ACEOF
4699rm -f conftest.$ac_objext conftest$ac_exeext 4319rm -f conftest.$ac_objext conftest$ac_exeext
4700if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4320if { (eval echo "$as_me:4320: \"$ac_link\"") >&5
4701 (eval $ac_link) 2>&5 4321 (eval $ac_link) 2>&5
4702 ac_status=$? 4322 ac_status=$?
4703 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4323 echo "$as_me:4323: \$? = $ac_status" >&5
4704 (exit $ac_status); } && 4324 (exit $ac_status); } &&
4705 { ac_try='test -s conftest$ac_exeext' 4325 { ac_try='test -s conftest$ac_exeext'
4706 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4326 { (eval echo "$as_me:4326: \"$ac_try\"") >&5
4707 (eval $ac_try) 2>&5 4327 (eval $ac_try) 2>&5
4708 ac_status=$? 4328 ac_status=$?
4709 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4329 echo "$as_me:4329: \$? = $ac_status" >&5
4710 (exit $ac_status); }; }; then 4330 (exit $ac_status); }; }; then
4711 eval "$as_ac_var=yes" 4331 eval "$as_ac_var=yes"
4712else 4332else
4713 echo "$as_me: failed program was:" >&5 4333 echo "$as_me: failed program was:" >&5
4714sed 's/^/| /' conftest.$ac_ext >&5 4334cat conftest.$ac_ext >&5
4715
4716eval "$as_ac_var=no" 4335eval "$as_ac_var=no"
4717fi 4336fi
4718rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4337rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4719fi 4338fi
4720echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 4339echo "$as_me:4339: result: `eval echo '${'$as_ac_var'}'`" >&5
4721echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 4340echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
4722if test `eval echo '${'$as_ac_var'}'` = yes; then 4341if test `eval echo '${'$as_ac_var'}'` = yes; then
4723 cat >>confdefs.h <<_ACEOF 4342 cat >>confdefs.h <<EOF
4724#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 4343#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
4725_ACEOF 4344EOF
4726 4345
4727fi 4346fi
4728done 4347done
@@ -4738,103 +4357,103 @@ done
4738 LDFLAGS="$LDFLAGS -L/usr/local/lib" 4357 LDFLAGS="$LDFLAGS -L/usr/local/lib"
4739 LIBS="$LIBS -lprot -lx -ltinfo -lm" 4358 LIBS="$LIBS -lprot -lx -ltinfo -lm"
4740 no_dev_ptmx=1 4359 no_dev_ptmx=1
4741 cat >>confdefs.h <<\_ACEOF 4360 cat >>confdefs.h <<\EOF
4742#define USE_PIPES 1 4361#define USE_PIPES 1
4743_ACEOF 4362EOF
4744 4363
4745 cat >>confdefs.h <<\_ACEOF 4364 cat >>confdefs.h <<\EOF
4746#define HAVE_SECUREWARE 1 4365#define HAVE_SECUREWARE 1
4747_ACEOF 4366EOF
4748 4367
4749 cat >>confdefs.h <<\_ACEOF 4368 cat >>confdefs.h <<\EOF
4750#define DISABLE_SHADOW 1 4369#define DISABLE_SHADOW 1
4751_ACEOF 4370EOF
4752 4371
4753 cat >>confdefs.h <<\_ACEOF 4372 cat >>confdefs.h <<\EOF
4754#define DISABLE_FD_PASSING 1 4373#define DISABLE_FD_PASSING 1
4755_ACEOF 4374EOF
4375
4376 cat >>confdefs.h <<\EOF
4377#define SETEUID_BREAKS_SETUID 1
4378EOF
4756 4379
4380 cat >>confdefs.h <<\EOF
4381#define BROKEN_SETREUID 1
4382EOF
4757 4383
4384 cat >>confdefs.h <<\EOF
4385#define BROKEN_SETREGID 1
4386EOF
4387
4388 cat >>confdefs.h <<\EOF
4389#define WITH_ABBREV_NO_TTY 1
4390EOF
4758 4391
4759for ac_func in getluid setluid 4392for ac_func in getluid setluid
4760do 4393do
4761as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 4394as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
4762echo "$as_me:$LINENO: checking for $ac_func" >&5 4395echo "$as_me:4395: checking for $ac_func" >&5
4763echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 4396echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
4764if eval "test \"\${$as_ac_var+set}\" = set"; then 4397if eval "test \"\${$as_ac_var+set}\" = set"; then
4765 echo $ECHO_N "(cached) $ECHO_C" >&6 4398 echo $ECHO_N "(cached) $ECHO_C" >&6
4766else 4399else
4767 cat >conftest.$ac_ext <<_ACEOF 4400 cat >conftest.$ac_ext <<_ACEOF
4768#line $LINENO "configure" 4401#line 4401 "configure"
4769/* confdefs.h. */ 4402#include "confdefs.h"
4770_ACEOF
4771cat confdefs.h >>conftest.$ac_ext
4772cat >>conftest.$ac_ext <<_ACEOF
4773/* end confdefs.h. */
4774/* System header to define __stub macros and hopefully few prototypes, 4403/* System header to define __stub macros and hopefully few prototypes,
4775 which can conflict with char $ac_func (); below. 4404 which can conflict with char $ac_func (); below. */
4776 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 4405#include <assert.h>
4777 <limits.h> exists even on freestanding compilers. */
4778#ifdef __STDC__
4779# include <limits.h>
4780#else
4781# include <assert.h>
4782#endif
4783/* Override any gcc2 internal prototype to avoid an error. */ 4406/* Override any gcc2 internal prototype to avoid an error. */
4784#ifdef __cplusplus 4407#ifdef __cplusplus
4785extern "C" 4408extern "C"
4786{
4787#endif 4409#endif
4788/* We use char because int might match the return type of a gcc2 4410/* We use char because int might match the return type of a gcc2
4789 builtin and then its argument prototype would still apply. */ 4411 builtin and then its argument prototype would still apply. */
4790char $ac_func (); 4412char $ac_func ();
4413char (*f) ();
4414
4415int
4416main ()
4417{
4791/* The GNU C library defines this for functions which it implements 4418/* The GNU C library defines this for functions which it implements
4792 to always fail with ENOSYS. Some functions are actually named 4419 to always fail with ENOSYS. Some functions are actually named
4793 something starting with __ and the normal name is an alias. */ 4420 something starting with __ and the normal name is an alias. */
4794#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 4421#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
4795choke me 4422choke me
4796#else 4423#else
4797char (*f) () = $ac_func; 4424f = $ac_func;
4798#endif
4799#ifdef __cplusplus
4800}
4801#endif 4425#endif
4802 4426
4803int
4804main ()
4805{
4806return f != $ac_func;
4807 ; 4427 ;
4808 return 0; 4428 return 0;
4809} 4429}
4810_ACEOF 4430_ACEOF
4811rm -f conftest.$ac_objext conftest$ac_exeext 4431rm -f conftest.$ac_objext conftest$ac_exeext
4812if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4432if { (eval echo "$as_me:4432: \"$ac_link\"") >&5
4813 (eval $ac_link) 2>&5 4433 (eval $ac_link) 2>&5
4814 ac_status=$? 4434 ac_status=$?
4815 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4435 echo "$as_me:4435: \$? = $ac_status" >&5
4816 (exit $ac_status); } && 4436 (exit $ac_status); } &&
4817 { ac_try='test -s conftest$ac_exeext' 4437 { ac_try='test -s conftest$ac_exeext'
4818 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4438 { (eval echo "$as_me:4438: \"$ac_try\"") >&5
4819 (eval $ac_try) 2>&5 4439 (eval $ac_try) 2>&5
4820 ac_status=$? 4440 ac_status=$?
4821 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4441 echo "$as_me:4441: \$? = $ac_status" >&5
4822 (exit $ac_status); }; }; then 4442 (exit $ac_status); }; }; then
4823 eval "$as_ac_var=yes" 4443 eval "$as_ac_var=yes"
4824else 4444else
4825 echo "$as_me: failed program was:" >&5 4445 echo "$as_me: failed program was:" >&5
4826sed 's/^/| /' conftest.$ac_ext >&5 4446cat conftest.$ac_ext >&5
4827
4828eval "$as_ac_var=no" 4447eval "$as_ac_var=no"
4829fi 4448fi
4830rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4449rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4831fi 4450fi
4832echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 4451echo "$as_me:4451: result: `eval echo '${'$as_ac_var'}'`" >&5
4833echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 4452echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
4834if test `eval echo '${'$as_ac_var'}'` = yes; then 4453if test `eval echo '${'$as_ac_var'}'` = yes; then
4835 cat >>confdefs.h <<_ACEOF 4454 cat >>confdefs.h <<EOF
4836#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 4455#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
4837_ACEOF 4456EOF
4838 4457
4839fi 4458fi
4840done 4459done
@@ -4842,37 +4461,54 @@ done
4842 MANTYPE=man 4461 MANTYPE=man
4843 ;; 4462 ;;
4844*-*-unicosmk*) 4463*-*-unicosmk*)
4845 cat >>confdefs.h <<\_ACEOF 4464 cat >>confdefs.h <<\EOF
4846#define USE_PIPES 1 4465#define USE_PIPES 1
4847_ACEOF 4466EOF
4848 4467
4849 cat >>confdefs.h <<\_ACEOF 4468 cat >>confdefs.h <<\EOF
4850#define DISABLE_FD_PASSING 1 4469#define DISABLE_FD_PASSING 1
4851_ACEOF 4470EOF
4852 4471
4853 LDFLAGS="$LDFLAGS" 4472 LDFLAGS="$LDFLAGS"
4854 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" 4473 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
4855 MANTYPE=cat 4474 MANTYPE=cat
4856 ;; 4475 ;;
4476*-*-unicosmp*)
4477 cat >>confdefs.h <<\EOF
4478#define WITH_ABBREV_NO_TTY 1
4479EOF
4480
4481 cat >>confdefs.h <<\EOF
4482#define USE_PIPES 1
4483EOF
4484
4485 cat >>confdefs.h <<\EOF
4486#define DISABLE_FD_PASSING 1
4487EOF
4488
4489 LDFLAGS="$LDFLAGS"
4490 LIBS="$LIBS -lgen -lacid"
4491 MANTYPE=cat
4492 ;;
4857*-*-unicos*) 4493*-*-unicos*)
4858 cat >>confdefs.h <<\_ACEOF 4494 cat >>confdefs.h <<\EOF
4859#define USE_PIPES 1 4495#define USE_PIPES 1
4860_ACEOF 4496EOF
4861 4497
4862 cat >>confdefs.h <<\_ACEOF 4498 cat >>confdefs.h <<\EOF
4863#define DISABLE_FD_PASSING 1 4499#define DISABLE_FD_PASSING 1
4864_ACEOF 4500EOF
4865 4501
4866 cat >>confdefs.h <<\_ACEOF 4502 cat >>confdefs.h <<\EOF
4867#define NO_SSH_LASTLOG 1 4503#define NO_SSH_LASTLOG 1
4868_ACEOF 4504EOF
4869 4505
4870 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal" 4506 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
4871 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" 4507 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
4872 MANTYPE=cat 4508 MANTYPE=cat
4873 ;; 4509 ;;
4874*-dec-osf*) 4510*-dec-osf*)
4875 echo "$as_me:$LINENO: checking for Digital Unix SIA" >&5 4511 echo "$as_me:4511: checking for Digital Unix SIA" >&5
4876echo $ECHO_N "checking for Digital Unix SIA... $ECHO_C" >&6 4512echo $ECHO_N "checking for Digital Unix SIA... $ECHO_C" >&6
4877 no_osfsia="" 4513 no_osfsia=""
4878 4514
@@ -4881,7 +4517,7 @@ if test "${with_osfsia+set}" = set; then
4881 withval="$with_osfsia" 4517 withval="$with_osfsia"
4882 4518
4883 if test "x$withval" = "xno" ; then 4519 if test "x$withval" = "xno" ; then
4884 echo "$as_me:$LINENO: result: disabled" >&5 4520 echo "$as_me:4520: result: disabled" >&5
4885echo "${ECHO_T}disabled" >&6 4521echo "${ECHO_T}disabled" >&6
4886 no_osfsia=1 4522 no_osfsia=1
4887 fi 4523 fi
@@ -4889,52 +4525,60 @@ echo "${ECHO_T}disabled" >&6
4889fi; 4525fi;
4890 if test -z "$no_osfsia" ; then 4526 if test -z "$no_osfsia" ; then
4891 if test -f /etc/sia/matrix.conf; then 4527 if test -f /etc/sia/matrix.conf; then
4892 echo "$as_me:$LINENO: result: yes" >&5 4528 echo "$as_me:4528: result: yes" >&5
4893echo "${ECHO_T}yes" >&6 4529echo "${ECHO_T}yes" >&6
4894 cat >>confdefs.h <<\_ACEOF 4530 cat >>confdefs.h <<\EOF
4895#define HAVE_OSF_SIA 1 4531#define HAVE_OSF_SIA 1
4896_ACEOF 4532EOF
4897 4533
4898 cat >>confdefs.h <<\_ACEOF 4534 cat >>confdefs.h <<\EOF
4899#define DISABLE_LOGIN 1 4535#define DISABLE_LOGIN 1
4900_ACEOF 4536EOF
4901 4537
4902 cat >>confdefs.h <<\_ACEOF 4538 cat >>confdefs.h <<\EOF
4903#define DISABLE_FD_PASSING 1 4539#define DISABLE_FD_PASSING 1
4904_ACEOF 4540EOF
4905 4541
4906 LIBS="$LIBS -lsecurity -ldb -lm -laud" 4542 LIBS="$LIBS -lsecurity -ldb -lm -laud"
4907 else 4543 else
4908 echo "$as_me:$LINENO: result: no" >&5 4544 echo "$as_me:4544: result: no" >&5
4909echo "${ECHO_T}no" >&6 4545echo "${ECHO_T}no" >&6
4910 fi 4546 fi
4911 fi 4547 fi
4912 cat >>confdefs.h <<\_ACEOF 4548 cat >>confdefs.h <<\EOF
4913#define DISABLE_FD_PASSING 1 4549#define DISABLE_FD_PASSING 1
4914_ACEOF 4550EOF
4551
4552 cat >>confdefs.h <<\EOF
4553#define BROKEN_GETADDRINFO 1
4554EOF
4555
4556 cat >>confdefs.h <<\EOF
4557#define LOCKED_PASSWD_SUBSTR "Nologin"
4558EOF
4915 4559
4916 ;; 4560 ;;
4917 4561
4918*-*-nto-qnx) 4562*-*-nto-qnx)
4919 cat >>confdefs.h <<\_ACEOF 4563 cat >>confdefs.h <<\EOF
4920#define USE_PIPES 1 4564#define USE_PIPES 1
4921_ACEOF 4565EOF
4922 4566
4923 cat >>confdefs.h <<\_ACEOF 4567 cat >>confdefs.h <<\EOF
4924#define NO_X11_UNIX_SOCKETS 1 4568#define NO_X11_UNIX_SOCKETS 1
4925_ACEOF 4569EOF
4926 4570
4927 cat >>confdefs.h <<\_ACEOF 4571 cat >>confdefs.h <<\EOF
4928#define MISSING_NFDBITS 1 4572#define MISSING_NFDBITS 1
4929_ACEOF 4573EOF
4930 4574
4931 cat >>confdefs.h <<\_ACEOF 4575 cat >>confdefs.h <<\EOF
4932#define MISSING_HOWMANY 1 4576#define MISSING_HOWMANY 1
4933_ACEOF 4577EOF
4934 4578
4935 cat >>confdefs.h <<\_ACEOF 4579 cat >>confdefs.h <<\EOF
4936#define MISSING_FD_MASK 1 4580#define MISSING_FD_MASK 1
4937_ACEOF 4581EOF
4938 4582
4939 ;; 4583 ;;
4940esac 4584esac
@@ -4949,7 +4593,6 @@ if test "${with_cflags+set}" = set; then
4949 CFLAGS="$CFLAGS $withval" 4593 CFLAGS="$CFLAGS $withval"
4950 fi 4594 fi
4951 4595
4952
4953fi; 4596fi;
4954 4597
4955# Check whether --with-cppflags or --without-cppflags was given. 4598# Check whether --with-cppflags or --without-cppflags was given.
@@ -4960,7 +4603,6 @@ if test "${with_cppflags+set}" = set; then
4960 CPPFLAGS="$CPPFLAGS $withval" 4603 CPPFLAGS="$CPPFLAGS $withval"
4961 fi 4604 fi
4962 4605
4963
4964fi; 4606fi;
4965 4607
4966# Check whether --with-ldflags or --without-ldflags was given. 4608# Check whether --with-ldflags or --without-ldflags was given.
@@ -4971,7 +4613,6 @@ if test "${with_ldflags+set}" = set; then
4971 LDFLAGS="$LDFLAGS $withval" 4613 LDFLAGS="$LDFLAGS $withval"
4972 fi 4614 fi
4973 4615
4974
4975fi; 4616fi;
4976 4617
4977# Check whether --with-libs or --without-libs was given. 4618# Check whether --with-libs or --without-libs was given.
@@ -4982,370 +4623,82 @@ if test "${with_libs+set}" = set; then
4982 LIBS="$LIBS $withval" 4623 LIBS="$LIBS $withval"
4983 fi 4624 fi
4984 4625
4985
4986fi; 4626fi;
4987 4627
4988# Checks for header files. 4628echo "$as_me:4628: checking compiler and flags for sanity" >&5
4989 4629echo $ECHO_N "checking compiler and flags for sanity... $ECHO_C" >&6
4990echo "$as_me:$LINENO: checking for egrep" >&5 4630if test "$cross_compiling" = yes; then
4991echo $ECHO_N "checking for egrep... $ECHO_C" >&6 4631 { { echo "$as_me:4631: error: cannot run test program while cross compiling" >&5
4992if test "${ac_cv_prog_egrep+set}" = set; then 4632echo "$as_me: error: cannot run test program while cross compiling" >&2;}
4993 echo $ECHO_N "(cached) $ECHO_C" >&6 4633 { (exit 1); exit 1; }; }
4994else
4995 if echo a | (grep -E '(a|b)') >/dev/null 2>&1
4996 then ac_cv_prog_egrep='grep -E'
4997 else ac_cv_prog_egrep='egrep'
4998 fi
4999fi
5000echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
5001echo "${ECHO_T}$ac_cv_prog_egrep" >&6
5002 EGREP=$ac_cv_prog_egrep
5003
5004
5005echo "$as_me:$LINENO: checking for ANSI C header files" >&5
5006echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
5007if test "${ac_cv_header_stdc+set}" = set; then
5008 echo $ECHO_N "(cached) $ECHO_C" >&6
5009else
5010 cat >conftest.$ac_ext <<_ACEOF
5011#line $LINENO "configure"
5012/* confdefs.h. */
5013_ACEOF
5014cat confdefs.h >>conftest.$ac_ext
5015cat >>conftest.$ac_ext <<_ACEOF
5016/* end confdefs.h. */
5017#include <stdlib.h>
5018#include <stdarg.h>
5019#include <string.h>
5020#include <float.h>
5021
5022int
5023main ()
5024{
5025
5026 ;
5027 return 0;
5028}
5029_ACEOF
5030rm -f conftest.$ac_objext
5031if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5032 (eval $ac_compile) 2>&5
5033 ac_status=$?
5034 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5035 (exit $ac_status); } &&
5036 { ac_try='test -s conftest.$ac_objext'
5037 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5038 (eval $ac_try) 2>&5
5039 ac_status=$?
5040 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5041 (exit $ac_status); }; }; then
5042 ac_cv_header_stdc=yes
5043else 4634else
5044 echo "$as_me: failed program was:" >&5
5045sed 's/^/| /' conftest.$ac_ext >&5
5046
5047ac_cv_header_stdc=no
5048fi
5049rm -f conftest.$ac_objext conftest.$ac_ext
5050
5051if test $ac_cv_header_stdc = yes; then
5052 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
5053 cat >conftest.$ac_ext <<_ACEOF 4635 cat >conftest.$ac_ext <<_ACEOF
5054#line $LINENO "configure" 4636#line 4636 "configure"
5055/* confdefs.h. */ 4637#include "confdefs.h"
5056_ACEOF
5057cat confdefs.h >>conftest.$ac_ext
5058cat >>conftest.$ac_ext <<_ACEOF
5059/* end confdefs.h. */
5060#include <string.h>
5061
5062_ACEOF
5063if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5064 $EGREP "memchr" >/dev/null 2>&1; then
5065 :
5066else
5067 ac_cv_header_stdc=no
5068fi
5069rm -f conftest*
5070 4638
5071fi 4639#include <stdio.h>
5072 4640int main(){exit(0);}
5073if test $ac_cv_header_stdc = yes; then
5074 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
5075 cat >conftest.$ac_ext <<_ACEOF
5076#line $LINENO "configure"
5077/* confdefs.h. */
5078_ACEOF
5079cat confdefs.h >>conftest.$ac_ext
5080cat >>conftest.$ac_ext <<_ACEOF
5081/* end confdefs.h. */
5082#include <stdlib.h>
5083
5084_ACEOF
5085if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
5086 $EGREP "free" >/dev/null 2>&1; then
5087 :
5088else
5089 ac_cv_header_stdc=no
5090fi
5091rm -f conftest*
5092
5093fi
5094
5095if test $ac_cv_header_stdc = yes; then
5096 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
5097 if test "$cross_compiling" = yes; then
5098 :
5099else
5100 cat >conftest.$ac_ext <<_ACEOF
5101#line $LINENO "configure"
5102/* confdefs.h. */
5103_ACEOF
5104cat confdefs.h >>conftest.$ac_ext
5105cat >>conftest.$ac_ext <<_ACEOF
5106/* end confdefs.h. */
5107#include <ctype.h>
5108#if ((' ' & 0x0FF) == 0x020)
5109# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
5110# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
5111#else
5112# define ISLOWER(c) \
5113 (('a' <= (c) && (c) <= 'i') \
5114 || ('j' <= (c) && (c) <= 'r') \
5115 || ('s' <= (c) && (c) <= 'z'))
5116# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
5117#endif
5118 4641
5119#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
5120int
5121main ()
5122{
5123 int i;
5124 for (i = 0; i < 256; i++)
5125 if (XOR (islower (i), ISLOWER (i))
5126 || toupper (i) != TOUPPER (i))
5127 exit(2);
5128 exit (0);
5129}
5130_ACEOF 4642_ACEOF
5131rm -f conftest$ac_exeext 4643rm -f conftest$ac_exeext
5132if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4644if { (eval echo "$as_me:4644: \"$ac_link\"") >&5
5133 (eval $ac_link) 2>&5 4645 (eval $ac_link) 2>&5
5134 ac_status=$? 4646 ac_status=$?
5135 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4647 echo "$as_me:4647: \$? = $ac_status" >&5
5136 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 4648 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5137 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4649 { (eval echo "$as_me:4649: \"$ac_try\"") >&5
5138 (eval $ac_try) 2>&5 4650 (eval $ac_try) 2>&5
5139 ac_status=$? 4651 ac_status=$?
5140 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4652 echo "$as_me:4652: \$? = $ac_status" >&5
5141 (exit $ac_status); }; }; then 4653 (exit $ac_status); }; }; then
5142 : 4654 echo "$as_me:4654: result: yes" >&5
4655echo "${ECHO_T}yes" >&6
5143else 4656else
5144 echo "$as_me: program exited with status $ac_status" >&5 4657 echo "$as_me: program exited with status $ac_status" >&5
5145echo "$as_me: failed program was:" >&5 4658echo "$as_me: failed program was:" >&5
5146sed 's/^/| /' conftest.$ac_ext >&5 4659cat conftest.$ac_ext >&5
5147
5148( exit $ac_status )
5149ac_cv_header_stdc=no
5150fi
5151rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5152fi
5153fi
5154fi
5155echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
5156echo "${ECHO_T}$ac_cv_header_stdc" >&6
5157if test $ac_cv_header_stdc = yes; then
5158
5159cat >>confdefs.h <<\_ACEOF
5160#define STDC_HEADERS 1
5161_ACEOF
5162
5163fi
5164
5165# On IRIX 5.3, sys/types and inttypes.h are conflicting.
5166 4660
4661 echo "$as_me:4661: result: no" >&5
4662echo "${ECHO_T}no" >&6
4663 { { echo "$as_me:4663: error: *** compiler cannot create working executables, check config.log ***" >&5
4664echo "$as_me: error: *** compiler cannot create working executables, check config.log ***" >&2;}
4665 { (exit 1); exit 1; }; }
5167 4666
5168
5169
5170
5171
5172
5173
5174
5175for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
5176 inttypes.h stdint.h unistd.h
5177do
5178as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5179echo "$as_me:$LINENO: checking for $ac_header" >&5
5180echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5181if eval "test \"\${$as_ac_Header+set}\" = set"; then
5182 echo $ECHO_N "(cached) $ECHO_C" >&6
5183else
5184 cat >conftest.$ac_ext <<_ACEOF
5185#line $LINENO "configure"
5186/* confdefs.h. */
5187_ACEOF
5188cat confdefs.h >>conftest.$ac_ext
5189cat >>conftest.$ac_ext <<_ACEOF
5190/* end confdefs.h. */
5191$ac_includes_default
5192
5193#include <$ac_header>
5194_ACEOF
5195rm -f conftest.$ac_objext
5196if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5197 (eval $ac_compile) 2>&5
5198 ac_status=$?
5199 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5200 (exit $ac_status); } &&
5201 { ac_try='test -s conftest.$ac_objext'
5202 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5203 (eval $ac_try) 2>&5
5204 ac_status=$?
5205 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5206 (exit $ac_status); }; }; then
5207 eval "$as_ac_Header=yes"
5208else
5209 echo "$as_me: failed program was:" >&5
5210sed 's/^/| /' conftest.$ac_ext >&5
5211
5212eval "$as_ac_Header=no"
5213fi 4667fi
5214rm -f conftest.$ac_objext conftest.$ac_ext 4668rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5215fi
5216echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
5217echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5218if test `eval echo '${'$as_ac_Header'}'` = yes; then
5219 cat >>confdefs.h <<_ACEOF
5220#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5221_ACEOF
5222
5223fi 4669fi
5224 4670
5225done 4671# Checks for header files.
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272 4672
5273for ac_header in bstring.h crypt.h endian.h floatingpoint.h \ 4673for ac_header in bstring.h crypt.h endian.h features.h floatingpoint.h \
5274 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \ 4674 getopt.h glob.h ia.h lastlog.h limits.h login.h \
5275 login_cap.h maillock.h netdb.h netgroup.h \ 4675 login_cap.h maillock.h netdb.h netgroup.h \
5276 netinet/in_systm.h paths.h pty.h readpassphrase.h \ 4676 netinet/in_systm.h paths.h pty.h readpassphrase.h \
5277 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ 4677 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
5278 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ 4678 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
5279 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \ 4679 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
5280 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \ 4680 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
5281 sys/un.h time.h tmpdir.h ttyent.h usersec.h \ 4681 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
5282 util.h utime.h utmp.h utmpx.h 4682 util.h utime.h utmp.h utmpx.h
5283do 4683do
5284as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 4684as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5285if eval "test \"\${$as_ac_Header+set}\" = set"; then 4685echo "$as_me:4685: checking for $ac_header" >&5
5286 echo "$as_me:$LINENO: checking for $ac_header" >&5
5287echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 4686echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5288if eval "test \"\${$as_ac_Header+set}\" = set"; then 4687if eval "test \"\${$as_ac_Header+set}\" = set"; then
5289 echo $ECHO_N "(cached) $ECHO_C" >&6 4688 echo $ECHO_N "(cached) $ECHO_C" >&6
5290fi
5291echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
5292echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5293else
5294 # Is the header compilable?
5295echo "$as_me:$LINENO: checking $ac_header usability" >&5
5296echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
5297cat >conftest.$ac_ext <<_ACEOF
5298#line $LINENO "configure"
5299/* confdefs.h. */
5300_ACEOF
5301cat confdefs.h >>conftest.$ac_ext
5302cat >>conftest.$ac_ext <<_ACEOF
5303/* end confdefs.h. */
5304$ac_includes_default
5305#include <$ac_header>
5306_ACEOF
5307rm -f conftest.$ac_objext
5308if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
5309 (eval $ac_compile) 2>&5
5310 ac_status=$?
5311 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5312 (exit $ac_status); } &&
5313 { ac_try='test -s conftest.$ac_objext'
5314 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
5315 (eval $ac_try) 2>&5
5316 ac_status=$?
5317 echo "$as_me:$LINENO: \$? = $ac_status" >&5
5318 (exit $ac_status); }; }; then
5319 ac_header_compiler=yes
5320else 4689else
5321 echo "$as_me: failed program was:" >&5 4690 cat >conftest.$ac_ext <<_ACEOF
5322sed 's/^/| /' conftest.$ac_ext >&5 4691#line 4691 "configure"
5323 4692#include "confdefs.h"
5324ac_header_compiler=no
5325fi
5326rm -f conftest.$ac_objext conftest.$ac_ext
5327echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
5328echo "${ECHO_T}$ac_header_compiler" >&6
5329
5330# Is the header present?
5331echo "$as_me:$LINENO: checking $ac_header presence" >&5
5332echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
5333cat >conftest.$ac_ext <<_ACEOF
5334#line $LINENO "configure"
5335/* confdefs.h. */
5336_ACEOF
5337cat confdefs.h >>conftest.$ac_ext
5338cat >>conftest.$ac_ext <<_ACEOF
5339/* end confdefs.h. */
5340#include <$ac_header> 4693#include <$ac_header>
5341_ACEOF 4694_ACEOF
5342if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 4695if { (eval echo "$as_me:4695: \"$ac_cpp conftest.$ac_ext\"") >&5
5343 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 4696 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5344 ac_status=$? 4697 ac_status=$?
5345 grep -v '^ *+' conftest.er1 >conftest.err 4698 egrep -v '^ *\+' conftest.er1 >conftest.err
5346 rm -f conftest.er1 4699 rm -f conftest.er1
5347 cat conftest.err >&5 4700 cat conftest.err >&5
5348 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4701 echo "$as_me:4701: \$? = $ac_status" >&5
5349 (exit $ac_status); } >/dev/null; then 4702 (exit $ac_status); } >/dev/null; then
5350 if test -s conftest.err; then 4703 if test -s conftest.err; then
5351 ac_cpp_err=$ac_c_preproc_warn_flag 4704 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -5356,149 +4709,88 @@ else
5356 ac_cpp_err=yes 4709 ac_cpp_err=yes
5357fi 4710fi
5358if test -z "$ac_cpp_err"; then 4711if test -z "$ac_cpp_err"; then
5359 ac_header_preproc=yes 4712 eval "$as_ac_Header=yes"
5360else 4713else
5361 echo "$as_me: failed program was:" >&5 4714 echo "$as_me: failed program was:" >&5
5362sed 's/^/| /' conftest.$ac_ext >&5 4715 cat conftest.$ac_ext >&5
5363 4716 eval "$as_ac_Header=no"
5364 ac_header_preproc=no
5365fi 4717fi
5366rm -f conftest.err conftest.$ac_ext 4718rm -f conftest.err conftest.$ac_ext
5367echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
5368echo "${ECHO_T}$ac_header_preproc" >&6
5369
5370# So? What about this header?
5371case $ac_header_compiler:$ac_header_preproc in
5372 yes:no )
5373 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
5374echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
5375 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
5376echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
5377 (
5378 cat <<\_ASBOX
5379## ------------------------------------ ##
5380## Report this to bug-autoconf@gnu.org. ##
5381## ------------------------------------ ##
5382_ASBOX
5383 ) |
5384 sed "s/^/$as_me: WARNING: /" >&2
5385 ;;
5386 no:yes )
5387 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
5388echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
5389 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
5390echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
5391 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
5392echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
5393 (
5394 cat <<\_ASBOX
5395## ------------------------------------ ##
5396## Report this to bug-autoconf@gnu.org. ##
5397## ------------------------------------ ##
5398_ASBOX
5399 ) |
5400 sed "s/^/$as_me: WARNING: /" >&2
5401 ;;
5402esac
5403echo "$as_me:$LINENO: checking for $ac_header" >&5
5404echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5405if eval "test \"\${$as_ac_Header+set}\" = set"; then
5406 echo $ECHO_N "(cached) $ECHO_C" >&6
5407else
5408 eval "$as_ac_Header=$ac_header_preproc"
5409fi 4719fi
5410echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 4720echo "$as_me:4720: result: `eval echo '${'$as_ac_Header'}'`" >&5
5411echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 4721echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5412
5413fi
5414if test `eval echo '${'$as_ac_Header'}'` = yes; then 4722if test `eval echo '${'$as_ac_Header'}'` = yes; then
5415 cat >>confdefs.h <<_ACEOF 4723 cat >>confdefs.h <<EOF
5416#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 4724#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5417_ACEOF 4725EOF
5418 4726
5419fi 4727fi
5420
5421done 4728done
5422 4729
5423
5424# Checks for libraries. 4730# Checks for libraries.
5425echo "$as_me:$LINENO: checking for yp_match" >&5 4731echo "$as_me:4731: checking for yp_match" >&5
5426echo $ECHO_N "checking for yp_match... $ECHO_C" >&6 4732echo $ECHO_N "checking for yp_match... $ECHO_C" >&6
5427if test "${ac_cv_func_yp_match+set}" = set; then 4733if test "${ac_cv_func_yp_match+set}" = set; then
5428 echo $ECHO_N "(cached) $ECHO_C" >&6 4734 echo $ECHO_N "(cached) $ECHO_C" >&6
5429else 4735else
5430 cat >conftest.$ac_ext <<_ACEOF 4736 cat >conftest.$ac_ext <<_ACEOF
5431#line $LINENO "configure" 4737#line 4737 "configure"
5432/* confdefs.h. */ 4738#include "confdefs.h"
5433_ACEOF
5434cat confdefs.h >>conftest.$ac_ext
5435cat >>conftest.$ac_ext <<_ACEOF
5436/* end confdefs.h. */
5437/* System header to define __stub macros and hopefully few prototypes, 4739/* System header to define __stub macros and hopefully few prototypes,
5438 which can conflict with char yp_match (); below. 4740 which can conflict with char yp_match (); below. */
5439 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 4741#include <assert.h>
5440 <limits.h> exists even on freestanding compilers. */
5441#ifdef __STDC__
5442# include <limits.h>
5443#else
5444# include <assert.h>
5445#endif
5446/* Override any gcc2 internal prototype to avoid an error. */ 4742/* Override any gcc2 internal prototype to avoid an error. */
5447#ifdef __cplusplus 4743#ifdef __cplusplus
5448extern "C" 4744extern "C"
5449{
5450#endif 4745#endif
5451/* We use char because int might match the return type of a gcc2 4746/* We use char because int might match the return type of a gcc2
5452 builtin and then its argument prototype would still apply. */ 4747 builtin and then its argument prototype would still apply. */
5453char yp_match (); 4748char yp_match ();
4749char (*f) ();
4750
4751int
4752main ()
4753{
5454/* The GNU C library defines this for functions which it implements 4754/* The GNU C library defines this for functions which it implements
5455 to always fail with ENOSYS. Some functions are actually named 4755 to always fail with ENOSYS. Some functions are actually named
5456 something starting with __ and the normal name is an alias. */ 4756 something starting with __ and the normal name is an alias. */
5457#if defined (__stub_yp_match) || defined (__stub___yp_match) 4757#if defined (__stub_yp_match) || defined (__stub___yp_match)
5458choke me 4758choke me
5459#else 4759#else
5460char (*f) () = yp_match; 4760f = yp_match;
5461#endif
5462#ifdef __cplusplus
5463}
5464#endif 4761#endif
5465 4762
5466int
5467main ()
5468{
5469return f != yp_match;
5470 ; 4763 ;
5471 return 0; 4764 return 0;
5472} 4765}
5473_ACEOF 4766_ACEOF
5474rm -f conftest.$ac_objext conftest$ac_exeext 4767rm -f conftest.$ac_objext conftest$ac_exeext
5475if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4768if { (eval echo "$as_me:4768: \"$ac_link\"") >&5
5476 (eval $ac_link) 2>&5 4769 (eval $ac_link) 2>&5
5477 ac_status=$? 4770 ac_status=$?
5478 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4771 echo "$as_me:4771: \$? = $ac_status" >&5
5479 (exit $ac_status); } && 4772 (exit $ac_status); } &&
5480 { ac_try='test -s conftest$ac_exeext' 4773 { ac_try='test -s conftest$ac_exeext'
5481 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4774 { (eval echo "$as_me:4774: \"$ac_try\"") >&5
5482 (eval $ac_try) 2>&5 4775 (eval $ac_try) 2>&5
5483 ac_status=$? 4776 ac_status=$?
5484 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4777 echo "$as_me:4777: \$? = $ac_status" >&5
5485 (exit $ac_status); }; }; then 4778 (exit $ac_status); }; }; then
5486 ac_cv_func_yp_match=yes 4779 ac_cv_func_yp_match=yes
5487else 4780else
5488 echo "$as_me: failed program was:" >&5 4781 echo "$as_me: failed program was:" >&5
5489sed 's/^/| /' conftest.$ac_ext >&5 4782cat conftest.$ac_ext >&5
5490
5491ac_cv_func_yp_match=no 4783ac_cv_func_yp_match=no
5492fi 4784fi
5493rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4785rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5494fi 4786fi
5495echo "$as_me:$LINENO: result: $ac_cv_func_yp_match" >&5 4787echo "$as_me:4787: result: $ac_cv_func_yp_match" >&5
5496echo "${ECHO_T}$ac_cv_func_yp_match" >&6 4788echo "${ECHO_T}$ac_cv_func_yp_match" >&6
5497if test $ac_cv_func_yp_match = yes; then 4789if test $ac_cv_func_yp_match = yes; then
5498 : 4790 :
5499else 4791else
5500 4792
5501echo "$as_me:$LINENO: checking for yp_match in -lnsl" >&5 4793echo "$as_me:4793: checking for yp_match in -lnsl" >&5
5502echo $ECHO_N "checking for yp_match in -lnsl... $ECHO_C" >&6 4794echo $ECHO_N "checking for yp_match in -lnsl... $ECHO_C" >&6
5503if test "${ac_cv_lib_nsl_yp_match+set}" = set; then 4795if test "${ac_cv_lib_nsl_yp_match+set}" = set; then
5504 echo $ECHO_N "(cached) $ECHO_C" >&6 4796 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5506,12 +4798,8 @@ else
5506 ac_check_lib_save_LIBS=$LIBS 4798 ac_check_lib_save_LIBS=$LIBS
5507LIBS="-lnsl $LIBS" 4799LIBS="-lnsl $LIBS"
5508cat >conftest.$ac_ext <<_ACEOF 4800cat >conftest.$ac_ext <<_ACEOF
5509#line $LINENO "configure" 4801#line 4801 "configure"
5510/* confdefs.h. */ 4802#include "confdefs.h"
5511_ACEOF
5512cat confdefs.h >>conftest.$ac_ext
5513cat >>conftest.$ac_ext <<_ACEOF
5514/* end confdefs.h. */
5515 4803
5516/* Override any gcc2 internal prototype to avoid an error. */ 4804/* Override any gcc2 internal prototype to avoid an error. */
5517#ifdef __cplusplus 4805#ifdef __cplusplus
@@ -5529,33 +4817,32 @@ yp_match ();
5529} 4817}
5530_ACEOF 4818_ACEOF
5531rm -f conftest.$ac_objext conftest$ac_exeext 4819rm -f conftest.$ac_objext conftest$ac_exeext
5532if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4820if { (eval echo "$as_me:4820: \"$ac_link\"") >&5
5533 (eval $ac_link) 2>&5 4821 (eval $ac_link) 2>&5
5534 ac_status=$? 4822 ac_status=$?
5535 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4823 echo "$as_me:4823: \$? = $ac_status" >&5
5536 (exit $ac_status); } && 4824 (exit $ac_status); } &&
5537 { ac_try='test -s conftest$ac_exeext' 4825 { ac_try='test -s conftest$ac_exeext'
5538 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4826 { (eval echo "$as_me:4826: \"$ac_try\"") >&5
5539 (eval $ac_try) 2>&5 4827 (eval $ac_try) 2>&5
5540 ac_status=$? 4828 ac_status=$?
5541 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4829 echo "$as_me:4829: \$? = $ac_status" >&5
5542 (exit $ac_status); }; }; then 4830 (exit $ac_status); }; }; then
5543 ac_cv_lib_nsl_yp_match=yes 4831 ac_cv_lib_nsl_yp_match=yes
5544else 4832else
5545 echo "$as_me: failed program was:" >&5 4833 echo "$as_me: failed program was:" >&5
5546sed 's/^/| /' conftest.$ac_ext >&5 4834cat conftest.$ac_ext >&5
5547
5548ac_cv_lib_nsl_yp_match=no 4835ac_cv_lib_nsl_yp_match=no
5549fi 4836fi
5550rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4837rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5551LIBS=$ac_check_lib_save_LIBS 4838LIBS=$ac_check_lib_save_LIBS
5552fi 4839fi
5553echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_yp_match" >&5 4840echo "$as_me:4840: result: $ac_cv_lib_nsl_yp_match" >&5
5554echo "${ECHO_T}$ac_cv_lib_nsl_yp_match" >&6 4841echo "${ECHO_T}$ac_cv_lib_nsl_yp_match" >&6
5555if test $ac_cv_lib_nsl_yp_match = yes; then 4842if test $ac_cv_lib_nsl_yp_match = yes; then
5556 cat >>confdefs.h <<_ACEOF 4843 cat >>confdefs.h <<EOF
5557#define HAVE_LIBNSL 1 4844#define HAVE_LIBNSL 1
5558_ACEOF 4845EOF
5559 4846
5560 LIBS="-lnsl $LIBS" 4847 LIBS="-lnsl $LIBS"
5561 4848
@@ -5563,83 +4850,69 @@ fi
5563 4850
5564fi 4851fi
5565 4852
5566echo "$as_me:$LINENO: checking for setsockopt" >&5 4853echo "$as_me:4853: checking for setsockopt" >&5
5567echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 4854echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6
5568if test "${ac_cv_func_setsockopt+set}" = set; then 4855if test "${ac_cv_func_setsockopt+set}" = set; then
5569 echo $ECHO_N "(cached) $ECHO_C" >&6 4856 echo $ECHO_N "(cached) $ECHO_C" >&6
5570else 4857else
5571 cat >conftest.$ac_ext <<_ACEOF 4858 cat >conftest.$ac_ext <<_ACEOF
5572#line $LINENO "configure" 4859#line 4859 "configure"
5573/* confdefs.h. */ 4860#include "confdefs.h"
5574_ACEOF
5575cat confdefs.h >>conftest.$ac_ext
5576cat >>conftest.$ac_ext <<_ACEOF
5577/* end confdefs.h. */
5578/* System header to define __stub macros and hopefully few prototypes, 4861/* System header to define __stub macros and hopefully few prototypes,
5579 which can conflict with char setsockopt (); below. 4862 which can conflict with char setsockopt (); below. */
5580 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 4863#include <assert.h>
5581 <limits.h> exists even on freestanding compilers. */
5582#ifdef __STDC__
5583# include <limits.h>
5584#else
5585# include <assert.h>
5586#endif
5587/* Override any gcc2 internal prototype to avoid an error. */ 4864/* Override any gcc2 internal prototype to avoid an error. */
5588#ifdef __cplusplus 4865#ifdef __cplusplus
5589extern "C" 4866extern "C"
5590{
5591#endif 4867#endif
5592/* We use char because int might match the return type of a gcc2 4868/* We use char because int might match the return type of a gcc2
5593 builtin and then its argument prototype would still apply. */ 4869 builtin and then its argument prototype would still apply. */
5594char setsockopt (); 4870char setsockopt ();
4871char (*f) ();
4872
4873int
4874main ()
4875{
5595/* The GNU C library defines this for functions which it implements 4876/* The GNU C library defines this for functions which it implements
5596 to always fail with ENOSYS. Some functions are actually named 4877 to always fail with ENOSYS. Some functions are actually named
5597 something starting with __ and the normal name is an alias. */ 4878 something starting with __ and the normal name is an alias. */
5598#if defined (__stub_setsockopt) || defined (__stub___setsockopt) 4879#if defined (__stub_setsockopt) || defined (__stub___setsockopt)
5599choke me 4880choke me
5600#else 4881#else
5601char (*f) () = setsockopt; 4882f = setsockopt;
5602#endif
5603#ifdef __cplusplus
5604}
5605#endif 4883#endif
5606 4884
5607int
5608main ()
5609{
5610return f != setsockopt;
5611 ; 4885 ;
5612 return 0; 4886 return 0;
5613} 4887}
5614_ACEOF 4888_ACEOF
5615rm -f conftest.$ac_objext conftest$ac_exeext 4889rm -f conftest.$ac_objext conftest$ac_exeext
5616if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4890if { (eval echo "$as_me:4890: \"$ac_link\"") >&5
5617 (eval $ac_link) 2>&5 4891 (eval $ac_link) 2>&5
5618 ac_status=$? 4892 ac_status=$?
5619 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4893 echo "$as_me:4893: \$? = $ac_status" >&5
5620 (exit $ac_status); } && 4894 (exit $ac_status); } &&
5621 { ac_try='test -s conftest$ac_exeext' 4895 { ac_try='test -s conftest$ac_exeext'
5622 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4896 { (eval echo "$as_me:4896: \"$ac_try\"") >&5
5623 (eval $ac_try) 2>&5 4897 (eval $ac_try) 2>&5
5624 ac_status=$? 4898 ac_status=$?
5625 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4899 echo "$as_me:4899: \$? = $ac_status" >&5
5626 (exit $ac_status); }; }; then 4900 (exit $ac_status); }; }; then
5627 ac_cv_func_setsockopt=yes 4901 ac_cv_func_setsockopt=yes
5628else 4902else
5629 echo "$as_me: failed program was:" >&5 4903 echo "$as_me: failed program was:" >&5
5630sed 's/^/| /' conftest.$ac_ext >&5 4904cat conftest.$ac_ext >&5
5631
5632ac_cv_func_setsockopt=no 4905ac_cv_func_setsockopt=no
5633fi 4906fi
5634rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4907rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5635fi 4908fi
5636echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 4909echo "$as_me:4909: result: $ac_cv_func_setsockopt" >&5
5637echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 4910echo "${ECHO_T}$ac_cv_func_setsockopt" >&6
5638if test $ac_cv_func_setsockopt = yes; then 4911if test $ac_cv_func_setsockopt = yes; then
5639 : 4912 :
5640else 4913else
5641 4914
5642echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 4915echo "$as_me:4915: checking for setsockopt in -lsocket" >&5
5643echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 4916echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6
5644if test "${ac_cv_lib_socket_setsockopt+set}" = set; then 4917if test "${ac_cv_lib_socket_setsockopt+set}" = set; then
5645 echo $ECHO_N "(cached) $ECHO_C" >&6 4918 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5647,12 +4920,8 @@ else
5647 ac_check_lib_save_LIBS=$LIBS 4920 ac_check_lib_save_LIBS=$LIBS
5648LIBS="-lsocket $LIBS" 4921LIBS="-lsocket $LIBS"
5649cat >conftest.$ac_ext <<_ACEOF 4922cat >conftest.$ac_ext <<_ACEOF
5650#line $LINENO "configure" 4923#line 4923 "configure"
5651/* confdefs.h. */ 4924#include "confdefs.h"
5652_ACEOF
5653cat confdefs.h >>conftest.$ac_ext
5654cat >>conftest.$ac_ext <<_ACEOF
5655/* end confdefs.h. */
5656 4925
5657/* Override any gcc2 internal prototype to avoid an error. */ 4926/* Override any gcc2 internal prototype to avoid an error. */
5658#ifdef __cplusplus 4927#ifdef __cplusplus
@@ -5670,33 +4939,32 @@ setsockopt ();
5670} 4939}
5671_ACEOF 4940_ACEOF
5672rm -f conftest.$ac_objext conftest$ac_exeext 4941rm -f conftest.$ac_objext conftest$ac_exeext
5673if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 4942if { (eval echo "$as_me:4942: \"$ac_link\"") >&5
5674 (eval $ac_link) 2>&5 4943 (eval $ac_link) 2>&5
5675 ac_status=$? 4944 ac_status=$?
5676 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4945 echo "$as_me:4945: \$? = $ac_status" >&5
5677 (exit $ac_status); } && 4946 (exit $ac_status); } &&
5678 { ac_try='test -s conftest$ac_exeext' 4947 { ac_try='test -s conftest$ac_exeext'
5679 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 4948 { (eval echo "$as_me:4948: \"$ac_try\"") >&5
5680 (eval $ac_try) 2>&5 4949 (eval $ac_try) 2>&5
5681 ac_status=$? 4950 ac_status=$?
5682 echo "$as_me:$LINENO: \$? = $ac_status" >&5 4951 echo "$as_me:4951: \$? = $ac_status" >&5
5683 (exit $ac_status); }; }; then 4952 (exit $ac_status); }; }; then
5684 ac_cv_lib_socket_setsockopt=yes 4953 ac_cv_lib_socket_setsockopt=yes
5685else 4954else
5686 echo "$as_me: failed program was:" >&5 4955 echo "$as_me: failed program was:" >&5
5687sed 's/^/| /' conftest.$ac_ext >&5 4956cat conftest.$ac_ext >&5
5688
5689ac_cv_lib_socket_setsockopt=no 4957ac_cv_lib_socket_setsockopt=no
5690fi 4958fi
5691rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 4959rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5692LIBS=$ac_check_lib_save_LIBS 4960LIBS=$ac_check_lib_save_LIBS
5693fi 4961fi
5694echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 4962echo "$as_me:4962: result: $ac_cv_lib_socket_setsockopt" >&5
5695echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 4963echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6
5696if test $ac_cv_lib_socket_setsockopt = yes; then 4964if test $ac_cv_lib_socket_setsockopt = yes; then
5697 cat >>confdefs.h <<_ACEOF 4965 cat >>confdefs.h <<EOF
5698#define HAVE_LIBSOCKET 1 4966#define HAVE_LIBSOCKET 1
5699_ACEOF 4967EOF
5700 4968
5701 LIBS="-lsocket $LIBS" 4969 LIBS="-lsocket $LIBS"
5702 4970
@@ -5704,10 +4972,9 @@ fi
5704 4972
5705fi 4973fi
5706 4974
5707
5708if test "x$with_tcp_wrappers" != "xno" ; then 4975if test "x$with_tcp_wrappers" != "xno" ; then
5709 if test "x$do_sco3_extra_lib_check" = "xyes" ; then 4976 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
5710 echo "$as_me:$LINENO: checking for innetgr in -lrpc" >&5 4977 echo "$as_me:4977: checking for innetgr in -lrpc" >&5
5711echo $ECHO_N "checking for innetgr in -lrpc... $ECHO_C" >&6 4978echo $ECHO_N "checking for innetgr in -lrpc... $ECHO_C" >&6
5712if test "${ac_cv_lib_rpc_innetgr+set}" = set; then 4979if test "${ac_cv_lib_rpc_innetgr+set}" = set; then
5713 echo $ECHO_N "(cached) $ECHO_C" >&6 4980 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5715,12 +4982,8 @@ else
5715 ac_check_lib_save_LIBS=$LIBS 4982 ac_check_lib_save_LIBS=$LIBS
5716LIBS="-lrpc -lyp -lrpc $LIBS" 4983LIBS="-lrpc -lyp -lrpc $LIBS"
5717cat >conftest.$ac_ext <<_ACEOF 4984cat >conftest.$ac_ext <<_ACEOF
5718#line $LINENO "configure" 4985#line 4985 "configure"
5719/* confdefs.h. */ 4986#include "confdefs.h"
5720_ACEOF
5721cat confdefs.h >>conftest.$ac_ext
5722cat >>conftest.$ac_ext <<_ACEOF
5723/* end confdefs.h. */
5724 4987
5725/* Override any gcc2 internal prototype to avoid an error. */ 4988/* Override any gcc2 internal prototype to avoid an error. */
5726#ifdef __cplusplus 4989#ifdef __cplusplus
@@ -5738,28 +5001,27 @@ innetgr ();
5738} 5001}
5739_ACEOF 5002_ACEOF
5740rm -f conftest.$ac_objext conftest$ac_exeext 5003rm -f conftest.$ac_objext conftest$ac_exeext
5741if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5004if { (eval echo "$as_me:5004: \"$ac_link\"") >&5
5742 (eval $ac_link) 2>&5 5005 (eval $ac_link) 2>&5
5743 ac_status=$? 5006 ac_status=$?
5744 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5007 echo "$as_me:5007: \$? = $ac_status" >&5
5745 (exit $ac_status); } && 5008 (exit $ac_status); } &&
5746 { ac_try='test -s conftest$ac_exeext' 5009 { ac_try='test -s conftest$ac_exeext'
5747 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5010 { (eval echo "$as_me:5010: \"$ac_try\"") >&5
5748 (eval $ac_try) 2>&5 5011 (eval $ac_try) 2>&5
5749 ac_status=$? 5012 ac_status=$?
5750 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5013 echo "$as_me:5013: \$? = $ac_status" >&5
5751 (exit $ac_status); }; }; then 5014 (exit $ac_status); }; }; then
5752 ac_cv_lib_rpc_innetgr=yes 5015 ac_cv_lib_rpc_innetgr=yes
5753else 5016else
5754 echo "$as_me: failed program was:" >&5 5017 echo "$as_me: failed program was:" >&5
5755sed 's/^/| /' conftest.$ac_ext >&5 5018cat conftest.$ac_ext >&5
5756
5757ac_cv_lib_rpc_innetgr=no 5019ac_cv_lib_rpc_innetgr=no
5758fi 5020fi
5759rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5021rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5760LIBS=$ac_check_lib_save_LIBS 5022LIBS=$ac_check_lib_save_LIBS
5761fi 5023fi
5762echo "$as_me:$LINENO: result: $ac_cv_lib_rpc_innetgr" >&5 5024echo "$as_me:5024: result: $ac_cv_lib_rpc_innetgr" >&5
5763echo "${ECHO_T}$ac_cv_lib_rpc_innetgr" >&6 5025echo "${ECHO_T}$ac_cv_lib_rpc_innetgr" >&6
5764if test $ac_cv_lib_rpc_innetgr = yes; then 5026if test $ac_cv_lib_rpc_innetgr = yes; then
5765 LIBS="-lrpc -lyp -lrpc $LIBS" 5027 LIBS="-lrpc -lyp -lrpc $LIBS"
@@ -5768,82 +5030,355 @@ fi
5768 fi 5030 fi
5769fi 5031fi
5770 5032
5771echo "$as_me:$LINENO: checking for getspnam" >&5 5033for ac_func in dirname
5772echo $ECHO_N "checking for getspnam... $ECHO_C" >&6 5034do
5773if test "${ac_cv_func_getspnam+set}" = set; then 5035as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
5036echo "$as_me:5036: checking for $ac_func" >&5
5037echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
5038if eval "test \"\${$as_ac_var+set}\" = set"; then
5774 echo $ECHO_N "(cached) $ECHO_C" >&6 5039 echo $ECHO_N "(cached) $ECHO_C" >&6
5775else 5040else
5776 cat >conftest.$ac_ext <<_ACEOF 5041 cat >conftest.$ac_ext <<_ACEOF
5777#line $LINENO "configure" 5042#line 5042 "configure"
5778/* confdefs.h. */ 5043#include "confdefs.h"
5779_ACEOF
5780cat confdefs.h >>conftest.$ac_ext
5781cat >>conftest.$ac_ext <<_ACEOF
5782/* end confdefs.h. */
5783/* System header to define __stub macros and hopefully few prototypes, 5044/* System header to define __stub macros and hopefully few prototypes,
5784 which can conflict with char getspnam (); below. 5045 which can conflict with char $ac_func (); below. */
5785 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 5046#include <assert.h>
5786 <limits.h> exists even on freestanding compilers. */
5787#ifdef __STDC__
5788# include <limits.h>
5789#else
5790# include <assert.h>
5791#endif
5792/* Override any gcc2 internal prototype to avoid an error. */ 5047/* Override any gcc2 internal prototype to avoid an error. */
5793#ifdef __cplusplus 5048#ifdef __cplusplus
5794extern "C" 5049extern "C"
5795{
5796#endif 5050#endif
5797/* We use char because int might match the return type of a gcc2 5051/* We use char because int might match the return type of a gcc2
5798 builtin and then its argument prototype would still apply. */ 5052 builtin and then its argument prototype would still apply. */
5799char getspnam (); 5053char $ac_func ();
5054char (*f) ();
5055
5056int
5057main ()
5058{
5800/* The GNU C library defines this for functions which it implements 5059/* The GNU C library defines this for functions which it implements
5801 to always fail with ENOSYS. Some functions are actually named 5060 to always fail with ENOSYS. Some functions are actually named
5802 something starting with __ and the normal name is an alias. */ 5061 something starting with __ and the normal name is an alias. */
5803#if defined (__stub_getspnam) || defined (__stub___getspnam) 5062#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
5804choke me 5063choke me
5805#else 5064#else
5806char (*f) () = getspnam; 5065f = $ac_func;
5807#endif 5066#endif
5067
5068 ;
5069 return 0;
5070}
5071_ACEOF
5072rm -f conftest.$ac_objext conftest$ac_exeext
5073if { (eval echo "$as_me:5073: \"$ac_link\"") >&5
5074 (eval $ac_link) 2>&5
5075 ac_status=$?
5076 echo "$as_me:5076: \$? = $ac_status" >&5
5077 (exit $ac_status); } &&
5078 { ac_try='test -s conftest$ac_exeext'
5079 { (eval echo "$as_me:5079: \"$ac_try\"") >&5
5080 (eval $ac_try) 2>&5
5081 ac_status=$?
5082 echo "$as_me:5082: \$? = $ac_status" >&5
5083 (exit $ac_status); }; }; then
5084 eval "$as_ac_var=yes"
5085else
5086 echo "$as_me: failed program was:" >&5
5087cat conftest.$ac_ext >&5
5088eval "$as_ac_var=no"
5089fi
5090rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5091fi
5092echo "$as_me:5092: result: `eval echo '${'$as_ac_var'}'`" >&5
5093echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
5094if test `eval echo '${'$as_ac_var'}'` = yes; then
5095 cat >>confdefs.h <<EOF
5096#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
5097EOF
5098
5099for ac_header in libgen.h
5100do
5101as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5102echo "$as_me:5102: checking for $ac_header" >&5
5103echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5104if eval "test \"\${$as_ac_Header+set}\" = set"; then
5105 echo $ECHO_N "(cached) $ECHO_C" >&6
5106else
5107 cat >conftest.$ac_ext <<_ACEOF
5108#line 5108 "configure"
5109#include "confdefs.h"
5110#include <$ac_header>
5111_ACEOF
5112if { (eval echo "$as_me:5112: \"$ac_cpp conftest.$ac_ext\"") >&5
5113 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5114 ac_status=$?
5115 egrep -v '^ *\+' conftest.er1 >conftest.err
5116 rm -f conftest.er1
5117 cat conftest.err >&5
5118 echo "$as_me:5118: \$? = $ac_status" >&5
5119 (exit $ac_status); } >/dev/null; then
5120 if test -s conftest.err; then
5121 ac_cpp_err=$ac_c_preproc_warn_flag
5122 else
5123 ac_cpp_err=
5124 fi
5125else
5126 ac_cpp_err=yes
5127fi
5128if test -z "$ac_cpp_err"; then
5129 eval "$as_ac_Header=yes"
5130else
5131 echo "$as_me: failed program was:" >&5
5132 cat conftest.$ac_ext >&5
5133 eval "$as_ac_Header=no"
5134fi
5135rm -f conftest.err conftest.$ac_ext
5136fi
5137echo "$as_me:5137: result: `eval echo '${'$as_ac_Header'}'`" >&5
5138echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5139if test `eval echo '${'$as_ac_Header'}'` = yes; then
5140 cat >>confdefs.h <<EOF
5141#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5142EOF
5143
5144fi
5145done
5146
5147else
5148
5149 echo "$as_me:5149: checking for dirname in -lgen" >&5
5150echo $ECHO_N "checking for dirname in -lgen... $ECHO_C" >&6
5151if test "${ac_cv_lib_gen_dirname+set}" = set; then
5152 echo $ECHO_N "(cached) $ECHO_C" >&6
5153else
5154 ac_check_lib_save_LIBS=$LIBS
5155LIBS="-lgen $LIBS"
5156cat >conftest.$ac_ext <<_ACEOF
5157#line 5157 "configure"
5158#include "confdefs.h"
5159
5160/* Override any gcc2 internal prototype to avoid an error. */
5808#ifdef __cplusplus 5161#ifdef __cplusplus
5162extern "C"
5163#endif
5164/* We use char because int might match the return type of a gcc2
5165 builtin and then its argument prototype would still apply. */
5166char dirname ();
5167int
5168main ()
5169{
5170dirname ();
5171 ;
5172 return 0;
5173}
5174_ACEOF
5175rm -f conftest.$ac_objext conftest$ac_exeext
5176if { (eval echo "$as_me:5176: \"$ac_link\"") >&5
5177 (eval $ac_link) 2>&5
5178 ac_status=$?
5179 echo "$as_me:5179: \$? = $ac_status" >&5
5180 (exit $ac_status); } &&
5181 { ac_try='test -s conftest$ac_exeext'
5182 { (eval echo "$as_me:5182: \"$ac_try\"") >&5
5183 (eval $ac_try) 2>&5
5184 ac_status=$?
5185 echo "$as_me:5185: \$? = $ac_status" >&5
5186 (exit $ac_status); }; }; then
5187 ac_cv_lib_gen_dirname=yes
5188else
5189 echo "$as_me: failed program was:" >&5
5190cat conftest.$ac_ext >&5
5191ac_cv_lib_gen_dirname=no
5192fi
5193rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5194LIBS=$ac_check_lib_save_LIBS
5195fi
5196echo "$as_me:5196: result: $ac_cv_lib_gen_dirname" >&5
5197echo "${ECHO_T}$ac_cv_lib_gen_dirname" >&6
5198if test $ac_cv_lib_gen_dirname = yes; then
5199
5200 echo "$as_me:5200: checking for broken dirname" >&5
5201echo $ECHO_N "checking for broken dirname... $ECHO_C" >&6
5202if test "${ac_cv_have_broken_dirname+set}" = set; then
5203 echo $ECHO_N "(cached) $ECHO_C" >&6
5204else
5205
5206 save_LIBS="$LIBS"
5207 LIBS="$LIBS -lgen"
5208 if test "$cross_compiling" = yes; then
5209 { { echo "$as_me:5209: error: cannot run test program while cross compiling" >&5
5210echo "$as_me: error: cannot run test program while cross compiling" >&2;}
5211 { (exit 1); exit 1; }; }
5212else
5213 cat >conftest.$ac_ext <<_ACEOF
5214#line 5214 "configure"
5215#include "confdefs.h"
5216
5217#include <libgen.h>
5218#include <string.h>
5219
5220int main(int argc, char **argv) {
5221 char *s, buf[32];
5222
5223 strncpy(buf,"/etc", 32);
5224 s = dirname(buf);
5225 if (!s || strncmp(s, "/", 32) != 0) {
5226 exit(1);
5227 } else {
5228 exit(0);
5229 }
5809} 5230}
5231
5232_ACEOF
5233rm -f conftest$ac_exeext
5234if { (eval echo "$as_me:5234: \"$ac_link\"") >&5
5235 (eval $ac_link) 2>&5
5236 ac_status=$?
5237 echo "$as_me:5237: \$? = $ac_status" >&5
5238 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5239 { (eval echo "$as_me:5239: \"$ac_try\"") >&5
5240 (eval $ac_try) 2>&5
5241 ac_status=$?
5242 echo "$as_me:5242: \$? = $ac_status" >&5
5243 (exit $ac_status); }; }; then
5244 ac_cv_have_broken_dirname="no"
5245else
5246 echo "$as_me: program exited with status $ac_status" >&5
5247echo "$as_me: failed program was:" >&5
5248cat conftest.$ac_ext >&5
5249 ac_cv_have_broken_dirname="yes"
5250
5251fi
5252rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5253fi
5254 LIBS="$save_LIBS"
5255
5256fi
5257echo "$as_me:5257: result: $ac_cv_have_broken_dirname" >&5
5258echo "${ECHO_T}$ac_cv_have_broken_dirname" >&6
5259 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
5260 LIBS="$LIBS -lgen"
5261 cat >>confdefs.h <<\EOF
5262#define HAVE_DIRNAME 1
5263EOF
5264
5265for ac_header in libgen.h
5266do
5267as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5268echo "$as_me:5268: checking for $ac_header" >&5
5269echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5270if eval "test \"\${$as_ac_Header+set}\" = set"; then
5271 echo $ECHO_N "(cached) $ECHO_C" >&6
5272else
5273 cat >conftest.$ac_ext <<_ACEOF
5274#line 5274 "configure"
5275#include "confdefs.h"
5276#include <$ac_header>
5277_ACEOF
5278if { (eval echo "$as_me:5278: \"$ac_cpp conftest.$ac_ext\"") >&5
5279 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5280 ac_status=$?
5281 egrep -v '^ *\+' conftest.er1 >conftest.err
5282 rm -f conftest.er1
5283 cat conftest.err >&5
5284 echo "$as_me:5284: \$? = $ac_status" >&5
5285 (exit $ac_status); } >/dev/null; then
5286 if test -s conftest.err; then
5287 ac_cpp_err=$ac_c_preproc_warn_flag
5288 else
5289 ac_cpp_err=
5290 fi
5291else
5292 ac_cpp_err=yes
5293fi
5294if test -z "$ac_cpp_err"; then
5295 eval "$as_ac_Header=yes"
5296else
5297 echo "$as_me: failed program was:" >&5
5298 cat conftest.$ac_ext >&5
5299 eval "$as_ac_Header=no"
5300fi
5301rm -f conftest.err conftest.$ac_ext
5302fi
5303echo "$as_me:5303: result: `eval echo '${'$as_ac_Header'}'`" >&5
5304echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5305if test `eval echo '${'$as_ac_Header'}'` = yes; then
5306 cat >>confdefs.h <<EOF
5307#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5308EOF
5309
5310fi
5311done
5312
5313 fi
5314
5315fi
5316
5317fi
5318done
5319
5320echo "$as_me:5320: checking for getspnam" >&5
5321echo $ECHO_N "checking for getspnam... $ECHO_C" >&6
5322if test "${ac_cv_func_getspnam+set}" = set; then
5323 echo $ECHO_N "(cached) $ECHO_C" >&6
5324else
5325 cat >conftest.$ac_ext <<_ACEOF
5326#line 5326 "configure"
5327#include "confdefs.h"
5328/* System header to define __stub macros and hopefully few prototypes,
5329 which can conflict with char getspnam (); below. */
5330#include <assert.h>
5331/* Override any gcc2 internal prototype to avoid an error. */
5332#ifdef __cplusplus
5333extern "C"
5810#endif 5334#endif
5335/* We use char because int might match the return type of a gcc2
5336 builtin and then its argument prototype would still apply. */
5337char getspnam ();
5338char (*f) ();
5811 5339
5812int 5340int
5813main () 5341main ()
5814{ 5342{
5815return f != getspnam; 5343/* The GNU C library defines this for functions which it implements
5344 to always fail with ENOSYS. Some functions are actually named
5345 something starting with __ and the normal name is an alias. */
5346#if defined (__stub_getspnam) || defined (__stub___getspnam)
5347choke me
5348#else
5349f = getspnam;
5350#endif
5351
5816 ; 5352 ;
5817 return 0; 5353 return 0;
5818} 5354}
5819_ACEOF 5355_ACEOF
5820rm -f conftest.$ac_objext conftest$ac_exeext 5356rm -f conftest.$ac_objext conftest$ac_exeext
5821if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5357if { (eval echo "$as_me:5357: \"$ac_link\"") >&5
5822 (eval $ac_link) 2>&5 5358 (eval $ac_link) 2>&5
5823 ac_status=$? 5359 ac_status=$?
5824 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5360 echo "$as_me:5360: \$? = $ac_status" >&5
5825 (exit $ac_status); } && 5361 (exit $ac_status); } &&
5826 { ac_try='test -s conftest$ac_exeext' 5362 { ac_try='test -s conftest$ac_exeext'
5827 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5363 { (eval echo "$as_me:5363: \"$ac_try\"") >&5
5828 (eval $ac_try) 2>&5 5364 (eval $ac_try) 2>&5
5829 ac_status=$? 5365 ac_status=$?
5830 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5366 echo "$as_me:5366: \$? = $ac_status" >&5
5831 (exit $ac_status); }; }; then 5367 (exit $ac_status); }; }; then
5832 ac_cv_func_getspnam=yes 5368 ac_cv_func_getspnam=yes
5833else 5369else
5834 echo "$as_me: failed program was:" >&5 5370 echo "$as_me: failed program was:" >&5
5835sed 's/^/| /' conftest.$ac_ext >&5 5371cat conftest.$ac_ext >&5
5836
5837ac_cv_func_getspnam=no 5372ac_cv_func_getspnam=no
5838fi 5373fi
5839rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5374rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5840fi 5375fi
5841echo "$as_me:$LINENO: result: $ac_cv_func_getspnam" >&5 5376echo "$as_me:5376: result: $ac_cv_func_getspnam" >&5
5842echo "${ECHO_T}$ac_cv_func_getspnam" >&6 5377echo "${ECHO_T}$ac_cv_func_getspnam" >&6
5843if test $ac_cv_func_getspnam = yes; then 5378if test $ac_cv_func_getspnam = yes; then
5844 : 5379 :
5845else 5380else
5846 echo "$as_me:$LINENO: checking for getspnam in -lgen" >&5 5381 echo "$as_me:5381: checking for getspnam in -lgen" >&5
5847echo $ECHO_N "checking for getspnam in -lgen... $ECHO_C" >&6 5382echo $ECHO_N "checking for getspnam in -lgen... $ECHO_C" >&6
5848if test "${ac_cv_lib_gen_getspnam+set}" = set; then 5383if test "${ac_cv_lib_gen_getspnam+set}" = set; then
5849 echo $ECHO_N "(cached) $ECHO_C" >&6 5384 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5851,12 +5386,8 @@ else
5851 ac_check_lib_save_LIBS=$LIBS 5386 ac_check_lib_save_LIBS=$LIBS
5852LIBS="-lgen $LIBS" 5387LIBS="-lgen $LIBS"
5853cat >conftest.$ac_ext <<_ACEOF 5388cat >conftest.$ac_ext <<_ACEOF
5854#line $LINENO "configure" 5389#line 5389 "configure"
5855/* confdefs.h. */ 5390#include "confdefs.h"
5856_ACEOF
5857cat confdefs.h >>conftest.$ac_ext
5858cat >>conftest.$ac_ext <<_ACEOF
5859/* end confdefs.h. */
5860 5391
5861/* Override any gcc2 internal prototype to avoid an error. */ 5392/* Override any gcc2 internal prototype to avoid an error. */
5862#ifdef __cplusplus 5393#ifdef __cplusplus
@@ -5874,28 +5405,27 @@ getspnam ();
5874} 5405}
5875_ACEOF 5406_ACEOF
5876rm -f conftest.$ac_objext conftest$ac_exeext 5407rm -f conftest.$ac_objext conftest$ac_exeext
5877if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5408if { (eval echo "$as_me:5408: \"$ac_link\"") >&5
5878 (eval $ac_link) 2>&5 5409 (eval $ac_link) 2>&5
5879 ac_status=$? 5410 ac_status=$?
5880 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5411 echo "$as_me:5411: \$? = $ac_status" >&5
5881 (exit $ac_status); } && 5412 (exit $ac_status); } &&
5882 { ac_try='test -s conftest$ac_exeext' 5413 { ac_try='test -s conftest$ac_exeext'
5883 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5414 { (eval echo "$as_me:5414: \"$ac_try\"") >&5
5884 (eval $ac_try) 2>&5 5415 (eval $ac_try) 2>&5
5885 ac_status=$? 5416 ac_status=$?
5886 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5417 echo "$as_me:5417: \$? = $ac_status" >&5
5887 (exit $ac_status); }; }; then 5418 (exit $ac_status); }; }; then
5888 ac_cv_lib_gen_getspnam=yes 5419 ac_cv_lib_gen_getspnam=yes
5889else 5420else
5890 echo "$as_me: failed program was:" >&5 5421 echo "$as_me: failed program was:" >&5
5891sed 's/^/| /' conftest.$ac_ext >&5 5422cat conftest.$ac_ext >&5
5892
5893ac_cv_lib_gen_getspnam=no 5423ac_cv_lib_gen_getspnam=no
5894fi 5424fi
5895rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5425rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5896LIBS=$ac_check_lib_save_LIBS 5426LIBS=$ac_check_lib_save_LIBS
5897fi 5427fi
5898echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getspnam" >&5 5428echo "$as_me:5428: result: $ac_cv_lib_gen_getspnam" >&5
5899echo "${ECHO_T}$ac_cv_lib_gen_getspnam" >&6 5429echo "${ECHO_T}$ac_cv_lib_gen_getspnam" >&6
5900if test $ac_cv_lib_gen_getspnam = yes; then 5430if test $ac_cv_lib_gen_getspnam = yes; then
5901 LIBS="$LIBS -lgen" 5431 LIBS="$LIBS -lgen"
@@ -5903,7 +5433,104 @@ fi
5903 5433
5904fi 5434fi
5905 5435
5436echo "$as_me:5436: checking for library containing basename" >&5
5437echo $ECHO_N "checking for library containing basename... $ECHO_C" >&6
5438if test "${ac_cv_search_basename+set}" = set; then
5439 echo $ECHO_N "(cached) $ECHO_C" >&6
5440else
5441 ac_func_search_save_LIBS=$LIBS
5442ac_cv_search_basename=no
5443cat >conftest.$ac_ext <<_ACEOF
5444#line 5444 "configure"
5445#include "confdefs.h"
5446
5447/* Override any gcc2 internal prototype to avoid an error. */
5448#ifdef __cplusplus
5449extern "C"
5450#endif
5451/* We use char because int might match the return type of a gcc2
5452 builtin and then its argument prototype would still apply. */
5453char basename ();
5454int
5455main ()
5456{
5457basename ();
5458 ;
5459 return 0;
5460}
5461_ACEOF
5462rm -f conftest.$ac_objext conftest$ac_exeext
5463if { (eval echo "$as_me:5463: \"$ac_link\"") >&5
5464 (eval $ac_link) 2>&5
5465 ac_status=$?
5466 echo "$as_me:5466: \$? = $ac_status" >&5
5467 (exit $ac_status); } &&
5468 { ac_try='test -s conftest$ac_exeext'
5469 { (eval echo "$as_me:5469: \"$ac_try\"") >&5
5470 (eval $ac_try) 2>&5
5471 ac_status=$?
5472 echo "$as_me:5472: \$? = $ac_status" >&5
5473 (exit $ac_status); }; }; then
5474 ac_cv_search_basename="none required"
5475else
5476 echo "$as_me: failed program was:" >&5
5477cat conftest.$ac_ext >&5
5478fi
5479rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5480if test "$ac_cv_search_basename" = no; then
5481 for ac_lib in gen; do
5482 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
5483 cat >conftest.$ac_ext <<_ACEOF
5484#line 5484 "configure"
5485#include "confdefs.h"
5486
5487/* Override any gcc2 internal prototype to avoid an error. */
5488#ifdef __cplusplus
5489extern "C"
5490#endif
5491/* We use char because int might match the return type of a gcc2
5492 builtin and then its argument prototype would still apply. */
5493char basename ();
5494int
5495main ()
5496{
5497basename ();
5498 ;
5499 return 0;
5500}
5501_ACEOF
5502rm -f conftest.$ac_objext conftest$ac_exeext
5503if { (eval echo "$as_me:5503: \"$ac_link\"") >&5
5504 (eval $ac_link) 2>&5
5505 ac_status=$?
5506 echo "$as_me:5506: \$? = $ac_status" >&5
5507 (exit $ac_status); } &&
5508 { ac_try='test -s conftest$ac_exeext'
5509 { (eval echo "$as_me:5509: \"$ac_try\"") >&5
5510 (eval $ac_try) 2>&5
5511 ac_status=$?
5512 echo "$as_me:5512: \$? = $ac_status" >&5
5513 (exit $ac_status); }; }; then
5514 ac_cv_search_basename="-l$ac_lib"
5515break
5516else
5517 echo "$as_me: failed program was:" >&5
5518cat conftest.$ac_ext >&5
5519fi
5520rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5521 done
5522fi
5523LIBS=$ac_func_search_save_LIBS
5524fi
5525echo "$as_me:5525: result: $ac_cv_search_basename" >&5
5526echo "${ECHO_T}$ac_cv_search_basename" >&6
5527if test "$ac_cv_search_basename" != no; then
5528 test "$ac_cv_search_basename" = "none required" || LIBS="$ac_cv_search_basename $LIBS"
5529 cat >>confdefs.h <<\EOF
5530#define HAVE_BASENAME 1
5531EOF
5906 5532
5533fi
5907 5534
5908# Check whether --with-rpath or --without-rpath was given. 5535# Check whether --with-rpath or --without-rpath was given.
5909if test "${with_rpath+set}" = set; then 5536if test "${with_rpath+set}" = set; then
@@ -5916,16 +5543,14 @@ if test "${with_rpath+set}" = set; then
5916 need_dash_r=1 5543 need_dash_r=1
5917 fi 5544 fi
5918 5545
5919
5920fi; 5546fi;
5921 5547
5922
5923# Check whether --with-zlib or --without-zlib was given. 5548# Check whether --with-zlib or --without-zlib was given.
5924if test "${with_zlib+set}" = set; then 5549if test "${with_zlib+set}" = set; then
5925 withval="$with_zlib" 5550 withval="$with_zlib"
5926 5551
5927 if test "x$withval" = "xno" ; then 5552 if test "x$withval" = "xno" ; then
5928 { { echo "$as_me:$LINENO: error: *** zlib is required ***" >&5 5553 { { echo "$as_me:5553: error: *** zlib is required ***" >&5
5929echo "$as_me: error: *** zlib is required ***" >&2;} 5554echo "$as_me: error: *** zlib is required ***" >&2;}
5930 { (exit 1); exit 1; }; } 5555 { (exit 1); exit 1; }; }
5931 fi 5556 fi
@@ -5948,11 +5573,9 @@ echo "$as_me: error: *** zlib is required ***" >&2;}
5948 CPPFLAGS="-I${withval} ${CPPFLAGS}" 5573 CPPFLAGS="-I${withval} ${CPPFLAGS}"
5949 fi 5574 fi
5950 5575
5951
5952fi; 5576fi;
5953 5577
5954 5578echo "$as_me:5578: checking for deflate in -lz" >&5
5955echo "$as_me:$LINENO: checking for deflate in -lz" >&5
5956echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6 5579echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6
5957if test "${ac_cv_lib_z_deflate+set}" = set; then 5580if test "${ac_cv_lib_z_deflate+set}" = set; then
5958 echo $ECHO_N "(cached) $ECHO_C" >&6 5581 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5960,12 +5583,8 @@ else
5960 ac_check_lib_save_LIBS=$LIBS 5583 ac_check_lib_save_LIBS=$LIBS
5961LIBS="-lz $LIBS" 5584LIBS="-lz $LIBS"
5962cat >conftest.$ac_ext <<_ACEOF 5585cat >conftest.$ac_ext <<_ACEOF
5963#line $LINENO "configure" 5586#line 5586 "configure"
5964/* confdefs.h. */ 5587#include "confdefs.h"
5965_ACEOF
5966cat confdefs.h >>conftest.$ac_ext
5967cat >>conftest.$ac_ext <<_ACEOF
5968/* end confdefs.h. */
5969 5588
5970/* Override any gcc2 internal prototype to avoid an error. */ 5589/* Override any gcc2 internal prototype to avoid an error. */
5971#ifdef __cplusplus 5590#ifdef __cplusplus
@@ -5983,119 +5602,103 @@ deflate ();
5983} 5602}
5984_ACEOF 5603_ACEOF
5985rm -f conftest.$ac_objext conftest$ac_exeext 5604rm -f conftest.$ac_objext conftest$ac_exeext
5986if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5605if { (eval echo "$as_me:5605: \"$ac_link\"") >&5
5987 (eval $ac_link) 2>&5 5606 (eval $ac_link) 2>&5
5988 ac_status=$? 5607 ac_status=$?
5989 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5608 echo "$as_me:5608: \$? = $ac_status" >&5
5990 (exit $ac_status); } && 5609 (exit $ac_status); } &&
5991 { ac_try='test -s conftest$ac_exeext' 5610 { ac_try='test -s conftest$ac_exeext'
5992 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5611 { (eval echo "$as_me:5611: \"$ac_try\"") >&5
5993 (eval $ac_try) 2>&5 5612 (eval $ac_try) 2>&5
5994 ac_status=$? 5613 ac_status=$?
5995 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5614 echo "$as_me:5614: \$? = $ac_status" >&5
5996 (exit $ac_status); }; }; then 5615 (exit $ac_status); }; }; then
5997 ac_cv_lib_z_deflate=yes 5616 ac_cv_lib_z_deflate=yes
5998else 5617else
5999 echo "$as_me: failed program was:" >&5 5618 echo "$as_me: failed program was:" >&5
6000sed 's/^/| /' conftest.$ac_ext >&5 5619cat conftest.$ac_ext >&5
6001
6002ac_cv_lib_z_deflate=no 5620ac_cv_lib_z_deflate=no
6003fi 5621fi
6004rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5622rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6005LIBS=$ac_check_lib_save_LIBS 5623LIBS=$ac_check_lib_save_LIBS
6006fi 5624fi
6007echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5 5625echo "$as_me:5625: result: $ac_cv_lib_z_deflate" >&5
6008echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6 5626echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6
6009if test $ac_cv_lib_z_deflate = yes; then 5627if test $ac_cv_lib_z_deflate = yes; then
6010 cat >>confdefs.h <<_ACEOF 5628 cat >>confdefs.h <<EOF
6011#define HAVE_LIBZ 1 5629#define HAVE_LIBZ 1
6012_ACEOF 5630EOF
6013 5631
6014 LIBS="-lz $LIBS" 5632 LIBS="-lz $LIBS"
6015 5633
6016else 5634else
6017 { { echo "$as_me:$LINENO: error: *** zlib missing - please install first or check config.log ***" >&5 5635 { { echo "$as_me:5635: error: *** zlib missing - please install first or check config.log ***" >&5
6018echo "$as_me: error: *** zlib missing - please install first or check config.log ***" >&2;} 5636echo "$as_me: error: *** zlib missing - please install first or check config.log ***" >&2;}
6019 { (exit 1); exit 1; }; } 5637 { (exit 1); exit 1; }; }
6020fi 5638fi
6021 5639
6022 5640echo "$as_me:5640: checking for strcasecmp" >&5
6023echo "$as_me:$LINENO: checking for strcasecmp" >&5
6024echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6 5641echo $ECHO_N "checking for strcasecmp... $ECHO_C" >&6
6025if test "${ac_cv_func_strcasecmp+set}" = set; then 5642if test "${ac_cv_func_strcasecmp+set}" = set; then
6026 echo $ECHO_N "(cached) $ECHO_C" >&6 5643 echo $ECHO_N "(cached) $ECHO_C" >&6
6027else 5644else
6028 cat >conftest.$ac_ext <<_ACEOF 5645 cat >conftest.$ac_ext <<_ACEOF
6029#line $LINENO "configure" 5646#line 5646 "configure"
6030/* confdefs.h. */ 5647#include "confdefs.h"
6031_ACEOF
6032cat confdefs.h >>conftest.$ac_ext
6033cat >>conftest.$ac_ext <<_ACEOF
6034/* end confdefs.h. */
6035/* System header to define __stub macros and hopefully few prototypes, 5648/* System header to define __stub macros and hopefully few prototypes,
6036 which can conflict with char strcasecmp (); below. 5649 which can conflict with char strcasecmp (); below. */
6037 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 5650#include <assert.h>
6038 <limits.h> exists even on freestanding compilers. */
6039#ifdef __STDC__
6040# include <limits.h>
6041#else
6042# include <assert.h>
6043#endif
6044/* Override any gcc2 internal prototype to avoid an error. */ 5651/* Override any gcc2 internal prototype to avoid an error. */
6045#ifdef __cplusplus 5652#ifdef __cplusplus
6046extern "C" 5653extern "C"
6047{
6048#endif 5654#endif
6049/* We use char because int might match the return type of a gcc2 5655/* We use char because int might match the return type of a gcc2
6050 builtin and then its argument prototype would still apply. */ 5656 builtin and then its argument prototype would still apply. */
6051char strcasecmp (); 5657char strcasecmp ();
5658char (*f) ();
5659
5660int
5661main ()
5662{
6052/* The GNU C library defines this for functions which it implements 5663/* The GNU C library defines this for functions which it implements
6053 to always fail with ENOSYS. Some functions are actually named 5664 to always fail with ENOSYS. Some functions are actually named
6054 something starting with __ and the normal name is an alias. */ 5665 something starting with __ and the normal name is an alias. */
6055#if defined (__stub_strcasecmp) || defined (__stub___strcasecmp) 5666#if defined (__stub_strcasecmp) || defined (__stub___strcasecmp)
6056choke me 5667choke me
6057#else 5668#else
6058char (*f) () = strcasecmp; 5669f = strcasecmp;
6059#endif
6060#ifdef __cplusplus
6061}
6062#endif 5670#endif
6063 5671
6064int
6065main ()
6066{
6067return f != strcasecmp;
6068 ; 5672 ;
6069 return 0; 5673 return 0;
6070} 5674}
6071_ACEOF 5675_ACEOF
6072rm -f conftest.$ac_objext conftest$ac_exeext 5676rm -f conftest.$ac_objext conftest$ac_exeext
6073if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5677if { (eval echo "$as_me:5677: \"$ac_link\"") >&5
6074 (eval $ac_link) 2>&5 5678 (eval $ac_link) 2>&5
6075 ac_status=$? 5679 ac_status=$?
6076 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5680 echo "$as_me:5680: \$? = $ac_status" >&5
6077 (exit $ac_status); } && 5681 (exit $ac_status); } &&
6078 { ac_try='test -s conftest$ac_exeext' 5682 { ac_try='test -s conftest$ac_exeext'
6079 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5683 { (eval echo "$as_me:5683: \"$ac_try\"") >&5
6080 (eval $ac_try) 2>&5 5684 (eval $ac_try) 2>&5
6081 ac_status=$? 5685 ac_status=$?
6082 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5686 echo "$as_me:5686: \$? = $ac_status" >&5
6083 (exit $ac_status); }; }; then 5687 (exit $ac_status); }; }; then
6084 ac_cv_func_strcasecmp=yes 5688 ac_cv_func_strcasecmp=yes
6085else 5689else
6086 echo "$as_me: failed program was:" >&5 5690 echo "$as_me: failed program was:" >&5
6087sed 's/^/| /' conftest.$ac_ext >&5 5691cat conftest.$ac_ext >&5
6088
6089ac_cv_func_strcasecmp=no 5692ac_cv_func_strcasecmp=no
6090fi 5693fi
6091rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5694rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6092fi 5695fi
6093echo "$as_me:$LINENO: result: $ac_cv_func_strcasecmp" >&5 5696echo "$as_me:5696: result: $ac_cv_func_strcasecmp" >&5
6094echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6 5697echo "${ECHO_T}$ac_cv_func_strcasecmp" >&6
6095if test $ac_cv_func_strcasecmp = yes; then 5698if test $ac_cv_func_strcasecmp = yes; then
6096 : 5699 :
6097else 5700else
6098 echo "$as_me:$LINENO: checking for strcasecmp in -lresolv" >&5 5701 echo "$as_me:5701: checking for strcasecmp in -lresolv" >&5
6099echo $ECHO_N "checking for strcasecmp in -lresolv... $ECHO_C" >&6 5702echo $ECHO_N "checking for strcasecmp in -lresolv... $ECHO_C" >&6
6100if test "${ac_cv_lib_resolv_strcasecmp+set}" = set; then 5703if test "${ac_cv_lib_resolv_strcasecmp+set}" = set; then
6101 echo $ECHO_N "(cached) $ECHO_C" >&6 5704 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6103,12 +5706,8 @@ else
6103 ac_check_lib_save_LIBS=$LIBS 5706 ac_check_lib_save_LIBS=$LIBS
6104LIBS="-lresolv $LIBS" 5707LIBS="-lresolv $LIBS"
6105cat >conftest.$ac_ext <<_ACEOF 5708cat >conftest.$ac_ext <<_ACEOF
6106#line $LINENO "configure" 5709#line 5709 "configure"
6107/* confdefs.h. */ 5710#include "confdefs.h"
6108_ACEOF
6109cat confdefs.h >>conftest.$ac_ext
6110cat >>conftest.$ac_ext <<_ACEOF
6111/* end confdefs.h. */
6112 5711
6113/* Override any gcc2 internal prototype to avoid an error. */ 5712/* Override any gcc2 internal prototype to avoid an error. */
6114#ifdef __cplusplus 5713#ifdef __cplusplus
@@ -6126,112 +5725,96 @@ strcasecmp ();
6126} 5725}
6127_ACEOF 5726_ACEOF
6128rm -f conftest.$ac_objext conftest$ac_exeext 5727rm -f conftest.$ac_objext conftest$ac_exeext
6129if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5728if { (eval echo "$as_me:5728: \"$ac_link\"") >&5
6130 (eval $ac_link) 2>&5 5729 (eval $ac_link) 2>&5
6131 ac_status=$? 5730 ac_status=$?
6132 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5731 echo "$as_me:5731: \$? = $ac_status" >&5
6133 (exit $ac_status); } && 5732 (exit $ac_status); } &&
6134 { ac_try='test -s conftest$ac_exeext' 5733 { ac_try='test -s conftest$ac_exeext'
6135 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5734 { (eval echo "$as_me:5734: \"$ac_try\"") >&5
6136 (eval $ac_try) 2>&5 5735 (eval $ac_try) 2>&5
6137 ac_status=$? 5736 ac_status=$?
6138 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5737 echo "$as_me:5737: \$? = $ac_status" >&5
6139 (exit $ac_status); }; }; then 5738 (exit $ac_status); }; }; then
6140 ac_cv_lib_resolv_strcasecmp=yes 5739 ac_cv_lib_resolv_strcasecmp=yes
6141else 5740else
6142 echo "$as_me: failed program was:" >&5 5741 echo "$as_me: failed program was:" >&5
6143sed 's/^/| /' conftest.$ac_ext >&5 5742cat conftest.$ac_ext >&5
6144
6145ac_cv_lib_resolv_strcasecmp=no 5743ac_cv_lib_resolv_strcasecmp=no
6146fi 5744fi
6147rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5745rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6148LIBS=$ac_check_lib_save_LIBS 5746LIBS=$ac_check_lib_save_LIBS
6149fi 5747fi
6150echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_strcasecmp" >&5 5748echo "$as_me:5748: result: $ac_cv_lib_resolv_strcasecmp" >&5
6151echo "${ECHO_T}$ac_cv_lib_resolv_strcasecmp" >&6 5749echo "${ECHO_T}$ac_cv_lib_resolv_strcasecmp" >&6
6152if test $ac_cv_lib_resolv_strcasecmp = yes; then 5750if test $ac_cv_lib_resolv_strcasecmp = yes; then
6153 LIBS="$LIBS -lresolv" 5751 LIBS="$LIBS -lresolv"
6154fi 5752fi
6155 5753
6156
6157fi 5754fi
6158 5755
6159echo "$as_me:$LINENO: checking for utimes" >&5 5756echo "$as_me:5756: checking for utimes" >&5
6160echo $ECHO_N "checking for utimes... $ECHO_C" >&6 5757echo $ECHO_N "checking for utimes... $ECHO_C" >&6
6161if test "${ac_cv_func_utimes+set}" = set; then 5758if test "${ac_cv_func_utimes+set}" = set; then
6162 echo $ECHO_N "(cached) $ECHO_C" >&6 5759 echo $ECHO_N "(cached) $ECHO_C" >&6
6163else 5760else
6164 cat >conftest.$ac_ext <<_ACEOF 5761 cat >conftest.$ac_ext <<_ACEOF
6165#line $LINENO "configure" 5762#line 5762 "configure"
6166/* confdefs.h. */ 5763#include "confdefs.h"
6167_ACEOF
6168cat confdefs.h >>conftest.$ac_ext
6169cat >>conftest.$ac_ext <<_ACEOF
6170/* end confdefs.h. */
6171/* System header to define __stub macros and hopefully few prototypes, 5764/* System header to define __stub macros and hopefully few prototypes,
6172 which can conflict with char utimes (); below. 5765 which can conflict with char utimes (); below. */
6173 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 5766#include <assert.h>
6174 <limits.h> exists even on freestanding compilers. */
6175#ifdef __STDC__
6176# include <limits.h>
6177#else
6178# include <assert.h>
6179#endif
6180/* Override any gcc2 internal prototype to avoid an error. */ 5767/* Override any gcc2 internal prototype to avoid an error. */
6181#ifdef __cplusplus 5768#ifdef __cplusplus
6182extern "C" 5769extern "C"
6183{
6184#endif 5770#endif
6185/* We use char because int might match the return type of a gcc2 5771/* We use char because int might match the return type of a gcc2
6186 builtin and then its argument prototype would still apply. */ 5772 builtin and then its argument prototype would still apply. */
6187char utimes (); 5773char utimes ();
5774char (*f) ();
5775
5776int
5777main ()
5778{
6188/* The GNU C library defines this for functions which it implements 5779/* The GNU C library defines this for functions which it implements
6189 to always fail with ENOSYS. Some functions are actually named 5780 to always fail with ENOSYS. Some functions are actually named
6190 something starting with __ and the normal name is an alias. */ 5781 something starting with __ and the normal name is an alias. */
6191#if defined (__stub_utimes) || defined (__stub___utimes) 5782#if defined (__stub_utimes) || defined (__stub___utimes)
6192choke me 5783choke me
6193#else 5784#else
6194char (*f) () = utimes; 5785f = utimes;
6195#endif
6196#ifdef __cplusplus
6197}
6198#endif 5786#endif
6199 5787
6200int
6201main ()
6202{
6203return f != utimes;
6204 ; 5788 ;
6205 return 0; 5789 return 0;
6206} 5790}
6207_ACEOF 5791_ACEOF
6208rm -f conftest.$ac_objext conftest$ac_exeext 5792rm -f conftest.$ac_objext conftest$ac_exeext
6209if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5793if { (eval echo "$as_me:5793: \"$ac_link\"") >&5
6210 (eval $ac_link) 2>&5 5794 (eval $ac_link) 2>&5
6211 ac_status=$? 5795 ac_status=$?
6212 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5796 echo "$as_me:5796: \$? = $ac_status" >&5
6213 (exit $ac_status); } && 5797 (exit $ac_status); } &&
6214 { ac_try='test -s conftest$ac_exeext' 5798 { ac_try='test -s conftest$ac_exeext'
6215 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5799 { (eval echo "$as_me:5799: \"$ac_try\"") >&5
6216 (eval $ac_try) 2>&5 5800 (eval $ac_try) 2>&5
6217 ac_status=$? 5801 ac_status=$?
6218 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5802 echo "$as_me:5802: \$? = $ac_status" >&5
6219 (exit $ac_status); }; }; then 5803 (exit $ac_status); }; }; then
6220 ac_cv_func_utimes=yes 5804 ac_cv_func_utimes=yes
6221else 5805else
6222 echo "$as_me: failed program was:" >&5 5806 echo "$as_me: failed program was:" >&5
6223sed 's/^/| /' conftest.$ac_ext >&5 5807cat conftest.$ac_ext >&5
6224
6225ac_cv_func_utimes=no 5808ac_cv_func_utimes=no
6226fi 5809fi
6227rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5810rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6228fi 5811fi
6229echo "$as_me:$LINENO: result: $ac_cv_func_utimes" >&5 5812echo "$as_me:5812: result: $ac_cv_func_utimes" >&5
6230echo "${ECHO_T}$ac_cv_func_utimes" >&6 5813echo "${ECHO_T}$ac_cv_func_utimes" >&6
6231if test $ac_cv_func_utimes = yes; then 5814if test $ac_cv_func_utimes = yes; then
6232 : 5815 :
6233else 5816else
6234 echo "$as_me:$LINENO: checking for utimes in -lc89" >&5 5817 echo "$as_me:5817: checking for utimes in -lc89" >&5
6235echo $ECHO_N "checking for utimes in -lc89... $ECHO_C" >&6 5818echo $ECHO_N "checking for utimes in -lc89... $ECHO_C" >&6
6236if test "${ac_cv_lib_c89_utimes+set}" = set; then 5819if test "${ac_cv_lib_c89_utimes+set}" = set; then
6237 echo $ECHO_N "(cached) $ECHO_C" >&6 5820 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6239,12 +5822,8 @@ else
6239 ac_check_lib_save_LIBS=$LIBS 5822 ac_check_lib_save_LIBS=$LIBS
6240LIBS="-lc89 $LIBS" 5823LIBS="-lc89 $LIBS"
6241cat >conftest.$ac_ext <<_ACEOF 5824cat >conftest.$ac_ext <<_ACEOF
6242#line $LINENO "configure" 5825#line 5825 "configure"
6243/* confdefs.h. */ 5826#include "confdefs.h"
6244_ACEOF
6245cat confdefs.h >>conftest.$ac_ext
6246cat >>conftest.$ac_ext <<_ACEOF
6247/* end confdefs.h. */
6248 5827
6249/* Override any gcc2 internal prototype to avoid an error. */ 5828/* Override any gcc2 internal prototype to avoid an error. */
6250#ifdef __cplusplus 5829#ifdef __cplusplus
@@ -6262,109 +5841,58 @@ utimes ();
6262} 5841}
6263_ACEOF 5842_ACEOF
6264rm -f conftest.$ac_objext conftest$ac_exeext 5843rm -f conftest.$ac_objext conftest$ac_exeext
6265if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5844if { (eval echo "$as_me:5844: \"$ac_link\"") >&5
6266 (eval $ac_link) 2>&5 5845 (eval $ac_link) 2>&5
6267 ac_status=$? 5846 ac_status=$?
6268 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5847 echo "$as_me:5847: \$? = $ac_status" >&5
6269 (exit $ac_status); } && 5848 (exit $ac_status); } &&
6270 { ac_try='test -s conftest$ac_exeext' 5849 { ac_try='test -s conftest$ac_exeext'
6271 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5850 { (eval echo "$as_me:5850: \"$ac_try\"") >&5
6272 (eval $ac_try) 2>&5 5851 (eval $ac_try) 2>&5
6273 ac_status=$? 5852 ac_status=$?
6274 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5853 echo "$as_me:5853: \$? = $ac_status" >&5
6275 (exit $ac_status); }; }; then 5854 (exit $ac_status); }; }; then
6276 ac_cv_lib_c89_utimes=yes 5855 ac_cv_lib_c89_utimes=yes
6277else 5856else
6278 echo "$as_me: failed program was:" >&5 5857 echo "$as_me: failed program was:" >&5
6279sed 's/^/| /' conftest.$ac_ext >&5 5858cat conftest.$ac_ext >&5
6280
6281ac_cv_lib_c89_utimes=no 5859ac_cv_lib_c89_utimes=no
6282fi 5860fi
6283rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5861rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6284LIBS=$ac_check_lib_save_LIBS 5862LIBS=$ac_check_lib_save_LIBS
6285fi 5863fi
6286echo "$as_me:$LINENO: result: $ac_cv_lib_c89_utimes" >&5 5864echo "$as_me:5864: result: $ac_cv_lib_c89_utimes" >&5
6287echo "${ECHO_T}$ac_cv_lib_c89_utimes" >&6 5865echo "${ECHO_T}$ac_cv_lib_c89_utimes" >&6
6288if test $ac_cv_lib_c89_utimes = yes; then 5866if test $ac_cv_lib_c89_utimes = yes; then
6289 cat >>confdefs.h <<\_ACEOF 5867 cat >>confdefs.h <<\EOF
6290#define HAVE_UTIMES 1 5868#define HAVE_UTIMES 1
6291_ACEOF 5869EOF
6292 5870
6293 LIBS="$LIBS -lc89" 5871 LIBS="$LIBS -lc89"
6294fi 5872fi
6295 5873
6296
6297fi 5874fi
6298 5875
6299
6300
6301for ac_header in libutil.h 5876for ac_header in libutil.h
6302do 5877do
6303as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 5878as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6304if eval "test \"\${$as_ac_Header+set}\" = set"; then 5879echo "$as_me:5879: checking for $ac_header" >&5
6305 echo "$as_me:$LINENO: checking for $ac_header" >&5
6306echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 5880echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6307if eval "test \"\${$as_ac_Header+set}\" = set"; then 5881if eval "test \"\${$as_ac_Header+set}\" = set"; then
6308 echo $ECHO_N "(cached) $ECHO_C" >&6 5882 echo $ECHO_N "(cached) $ECHO_C" >&6
6309fi
6310echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
6311echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6312else
6313 # Is the header compilable?
6314echo "$as_me:$LINENO: checking $ac_header usability" >&5
6315echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
6316cat >conftest.$ac_ext <<_ACEOF
6317#line $LINENO "configure"
6318/* confdefs.h. */
6319_ACEOF
6320cat confdefs.h >>conftest.$ac_ext
6321cat >>conftest.$ac_ext <<_ACEOF
6322/* end confdefs.h. */
6323$ac_includes_default
6324#include <$ac_header>
6325_ACEOF
6326rm -f conftest.$ac_objext
6327if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
6328 (eval $ac_compile) 2>&5
6329 ac_status=$?
6330 echo "$as_me:$LINENO: \$? = $ac_status" >&5
6331 (exit $ac_status); } &&
6332 { ac_try='test -s conftest.$ac_objext'
6333 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
6334 (eval $ac_try) 2>&5
6335 ac_status=$?
6336 echo "$as_me:$LINENO: \$? = $ac_status" >&5
6337 (exit $ac_status); }; }; then
6338 ac_header_compiler=yes
6339else 5883else
6340 echo "$as_me: failed program was:" >&5 5884 cat >conftest.$ac_ext <<_ACEOF
6341sed 's/^/| /' conftest.$ac_ext >&5 5885#line 5885 "configure"
6342 5886#include "confdefs.h"
6343ac_header_compiler=no
6344fi
6345rm -f conftest.$ac_objext conftest.$ac_ext
6346echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
6347echo "${ECHO_T}$ac_header_compiler" >&6
6348
6349# Is the header present?
6350echo "$as_me:$LINENO: checking $ac_header presence" >&5
6351echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
6352cat >conftest.$ac_ext <<_ACEOF
6353#line $LINENO "configure"
6354/* confdefs.h. */
6355_ACEOF
6356cat confdefs.h >>conftest.$ac_ext
6357cat >>conftest.$ac_ext <<_ACEOF
6358/* end confdefs.h. */
6359#include <$ac_header> 5887#include <$ac_header>
6360_ACEOF 5888_ACEOF
6361if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 5889if { (eval echo "$as_me:5889: \"$ac_cpp conftest.$ac_ext\"") >&5
6362 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 5890 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6363 ac_status=$? 5891 ac_status=$?
6364 grep -v '^ *+' conftest.er1 >conftest.err 5892 egrep -v '^ *\+' conftest.er1 >conftest.err
6365 rm -f conftest.er1 5893 rm -f conftest.er1
6366 cat conftest.err >&5 5894 cat conftest.err >&5
6367 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5895 echo "$as_me:5895: \$? = $ac_status" >&5
6368 (exit $ac_status); } >/dev/null; then 5896 (exit $ac_status); } >/dev/null; then
6369 if test -s conftest.err; then 5897 if test -s conftest.err; then
6370 ac_cpp_err=$ac_c_preproc_warn_flag 5898 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -6375,71 +5903,25 @@ else
6375 ac_cpp_err=yes 5903 ac_cpp_err=yes
6376fi 5904fi
6377if test -z "$ac_cpp_err"; then 5905if test -z "$ac_cpp_err"; then
6378 ac_header_preproc=yes 5906 eval "$as_ac_Header=yes"
6379else 5907else
6380 echo "$as_me: failed program was:" >&5 5908 echo "$as_me: failed program was:" >&5
6381sed 's/^/| /' conftest.$ac_ext >&5 5909 cat conftest.$ac_ext >&5
6382 5910 eval "$as_ac_Header=no"
6383 ac_header_preproc=no
6384fi 5911fi
6385rm -f conftest.err conftest.$ac_ext 5912rm -f conftest.err conftest.$ac_ext
6386echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
6387echo "${ECHO_T}$ac_header_preproc" >&6
6388
6389# So? What about this header?
6390case $ac_header_compiler:$ac_header_preproc in
6391 yes:no )
6392 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
6393echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
6394 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
6395echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
6396 (
6397 cat <<\_ASBOX
6398## ------------------------------------ ##
6399## Report this to bug-autoconf@gnu.org. ##
6400## ------------------------------------ ##
6401_ASBOX
6402 ) |
6403 sed "s/^/$as_me: WARNING: /" >&2
6404 ;;
6405 no:yes )
6406 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
6407echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
6408 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
6409echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
6410 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
6411echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
6412 (
6413 cat <<\_ASBOX
6414## ------------------------------------ ##
6415## Report this to bug-autoconf@gnu.org. ##
6416## ------------------------------------ ##
6417_ASBOX
6418 ) |
6419 sed "s/^/$as_me: WARNING: /" >&2
6420 ;;
6421esac
6422echo "$as_me:$LINENO: checking for $ac_header" >&5
6423echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6424if eval "test \"\${$as_ac_Header+set}\" = set"; then
6425 echo $ECHO_N "(cached) $ECHO_C" >&6
6426else
6427 eval "$as_ac_Header=$ac_header_preproc"
6428fi 5913fi
6429echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 5914echo "$as_me:5914: result: `eval echo '${'$as_ac_Header'}'`" >&5
6430echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 5915echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6431
6432fi
6433if test `eval echo '${'$as_ac_Header'}'` = yes; then 5916if test `eval echo '${'$as_ac_Header'}'` = yes; then
6434 cat >>confdefs.h <<_ACEOF 5917 cat >>confdefs.h <<EOF
6435#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 5918#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6436_ACEOF 5919EOF
6437 5920
6438fi 5921fi
6439
6440done 5922done
6441 5923
6442echo "$as_me:$LINENO: checking for library containing login" >&5 5924echo "$as_me:5924: checking for library containing login" >&5
6443echo $ECHO_N "checking for library containing login... $ECHO_C" >&6 5925echo $ECHO_N "checking for library containing login... $ECHO_C" >&6
6444if test "${ac_cv_search_login+set}" = set; then 5926if test "${ac_cv_search_login+set}" = set; then
6445 echo $ECHO_N "(cached) $ECHO_C" >&6 5927 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6447,12 +5929,8 @@ else
6447 ac_func_search_save_LIBS=$LIBS 5929 ac_func_search_save_LIBS=$LIBS
6448ac_cv_search_login=no 5930ac_cv_search_login=no
6449cat >conftest.$ac_ext <<_ACEOF 5931cat >conftest.$ac_ext <<_ACEOF
6450#line $LINENO "configure" 5932#line 5932 "configure"
6451/* confdefs.h. */ 5933#include "confdefs.h"
6452_ACEOF
6453cat confdefs.h >>conftest.$ac_ext
6454cat >>conftest.$ac_ext <<_ACEOF
6455/* end confdefs.h. */
6456 5934
6457/* Override any gcc2 internal prototype to avoid an error. */ 5935/* Override any gcc2 internal prototype to avoid an error. */
6458#ifdef __cplusplus 5936#ifdef __cplusplus
@@ -6470,34 +5948,29 @@ login ();
6470} 5948}
6471_ACEOF 5949_ACEOF
6472rm -f conftest.$ac_objext conftest$ac_exeext 5950rm -f conftest.$ac_objext conftest$ac_exeext
6473if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5951if { (eval echo "$as_me:5951: \"$ac_link\"") >&5
6474 (eval $ac_link) 2>&5 5952 (eval $ac_link) 2>&5
6475 ac_status=$? 5953 ac_status=$?
6476 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5954 echo "$as_me:5954: \$? = $ac_status" >&5
6477 (exit $ac_status); } && 5955 (exit $ac_status); } &&
6478 { ac_try='test -s conftest$ac_exeext' 5956 { ac_try='test -s conftest$ac_exeext'
6479 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5957 { (eval echo "$as_me:5957: \"$ac_try\"") >&5
6480 (eval $ac_try) 2>&5 5958 (eval $ac_try) 2>&5
6481 ac_status=$? 5959 ac_status=$?
6482 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5960 echo "$as_me:5960: \$? = $ac_status" >&5
6483 (exit $ac_status); }; }; then 5961 (exit $ac_status); }; }; then
6484 ac_cv_search_login="none required" 5962 ac_cv_search_login="none required"
6485else 5963else
6486 echo "$as_me: failed program was:" >&5 5964 echo "$as_me: failed program was:" >&5
6487sed 's/^/| /' conftest.$ac_ext >&5 5965cat conftest.$ac_ext >&5
6488
6489fi 5966fi
6490rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 5967rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6491if test "$ac_cv_search_login" = no; then 5968if test "$ac_cv_search_login" = no; then
6492 for ac_lib in util bsd; do 5969 for ac_lib in util bsd; do
6493 LIBS="-l$ac_lib $ac_func_search_save_LIBS" 5970 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
6494 cat >conftest.$ac_ext <<_ACEOF 5971 cat >conftest.$ac_ext <<_ACEOF
6495#line $LINENO "configure" 5972#line 5972 "configure"
6496/* confdefs.h. */ 5973#include "confdefs.h"
6497_ACEOF
6498cat confdefs.h >>conftest.$ac_ext
6499cat >>conftest.$ac_ext <<_ACEOF
6500/* end confdefs.h. */
6501 5974
6502/* Override any gcc2 internal prototype to avoid an error. */ 5975/* Override any gcc2 internal prototype to avoid an error. */
6503#ifdef __cplusplus 5976#ifdef __cplusplus
@@ -6515,210 +5988,176 @@ login ();
6515} 5988}
6516_ACEOF 5989_ACEOF
6517rm -f conftest.$ac_objext conftest$ac_exeext 5990rm -f conftest.$ac_objext conftest$ac_exeext
6518if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 5991if { (eval echo "$as_me:5991: \"$ac_link\"") >&5
6519 (eval $ac_link) 2>&5 5992 (eval $ac_link) 2>&5
6520 ac_status=$? 5993 ac_status=$?
6521 echo "$as_me:$LINENO: \$? = $ac_status" >&5 5994 echo "$as_me:5994: \$? = $ac_status" >&5
6522 (exit $ac_status); } && 5995 (exit $ac_status); } &&
6523 { ac_try='test -s conftest$ac_exeext' 5996 { ac_try='test -s conftest$ac_exeext'
6524 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 5997 { (eval echo "$as_me:5997: \"$ac_try\"") >&5
6525 (eval $ac_try) 2>&5 5998 (eval $ac_try) 2>&5
6526 ac_status=$? 5999 ac_status=$?
6527 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6000 echo "$as_me:6000: \$? = $ac_status" >&5
6528 (exit $ac_status); }; }; then 6001 (exit $ac_status); }; }; then
6529 ac_cv_search_login="-l$ac_lib" 6002 ac_cv_search_login="-l$ac_lib"
6530break 6003break
6531else 6004else
6532 echo "$as_me: failed program was:" >&5 6005 echo "$as_me: failed program was:" >&5
6533sed 's/^/| /' conftest.$ac_ext >&5 6006cat conftest.$ac_ext >&5
6534
6535fi 6007fi
6536rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6008rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6537 done 6009 done
6538fi 6010fi
6539LIBS=$ac_func_search_save_LIBS 6011LIBS=$ac_func_search_save_LIBS
6540fi 6012fi
6541echo "$as_me:$LINENO: result: $ac_cv_search_login" >&5 6013echo "$as_me:6013: result: $ac_cv_search_login" >&5
6542echo "${ECHO_T}$ac_cv_search_login" >&6 6014echo "${ECHO_T}$ac_cv_search_login" >&6
6543if test "$ac_cv_search_login" != no; then 6015if test "$ac_cv_search_login" != no; then
6544 test "$ac_cv_search_login" = "none required" || LIBS="$ac_cv_search_login $LIBS" 6016 test "$ac_cv_search_login" = "none required" || LIBS="$ac_cv_search_login $LIBS"
6545 cat >>confdefs.h <<\_ACEOF 6017 cat >>confdefs.h <<\EOF
6546#define HAVE_LOGIN 1 6018#define HAVE_LOGIN 1
6547_ACEOF 6019EOF
6548 6020
6549fi 6021fi
6550 6022
6551
6552
6553
6554for ac_func in logout updwtmp logwtmp 6023for ac_func in logout updwtmp logwtmp
6555do 6024do
6556as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 6025as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
6557echo "$as_me:$LINENO: checking for $ac_func" >&5 6026echo "$as_me:6026: checking for $ac_func" >&5
6558echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 6027echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
6559if eval "test \"\${$as_ac_var+set}\" = set"; then 6028if eval "test \"\${$as_ac_var+set}\" = set"; then
6560 echo $ECHO_N "(cached) $ECHO_C" >&6 6029 echo $ECHO_N "(cached) $ECHO_C" >&6
6561else 6030else
6562 cat >conftest.$ac_ext <<_ACEOF 6031 cat >conftest.$ac_ext <<_ACEOF
6563#line $LINENO "configure" 6032#line 6032 "configure"
6564/* confdefs.h. */ 6033#include "confdefs.h"
6565_ACEOF
6566cat confdefs.h >>conftest.$ac_ext
6567cat >>conftest.$ac_ext <<_ACEOF
6568/* end confdefs.h. */
6569/* System header to define __stub macros and hopefully few prototypes, 6034/* System header to define __stub macros and hopefully few prototypes,
6570 which can conflict with char $ac_func (); below. 6035 which can conflict with char $ac_func (); below. */
6571 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 6036#include <assert.h>
6572 <limits.h> exists even on freestanding compilers. */
6573#ifdef __STDC__
6574# include <limits.h>
6575#else
6576# include <assert.h>
6577#endif
6578/* Override any gcc2 internal prototype to avoid an error. */ 6037/* Override any gcc2 internal prototype to avoid an error. */
6579#ifdef __cplusplus 6038#ifdef __cplusplus
6580extern "C" 6039extern "C"
6581{
6582#endif 6040#endif
6583/* We use char because int might match the return type of a gcc2 6041/* We use char because int might match the return type of a gcc2
6584 builtin and then its argument prototype would still apply. */ 6042 builtin and then its argument prototype would still apply. */
6585char $ac_func (); 6043char $ac_func ();
6044char (*f) ();
6045
6046int
6047main ()
6048{
6586/* The GNU C library defines this for functions which it implements 6049/* The GNU C library defines this for functions which it implements
6587 to always fail with ENOSYS. Some functions are actually named 6050 to always fail with ENOSYS. Some functions are actually named
6588 something starting with __ and the normal name is an alias. */ 6051 something starting with __ and the normal name is an alias. */
6589#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 6052#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6590choke me 6053choke me
6591#else 6054#else
6592char (*f) () = $ac_func; 6055f = $ac_func;
6593#endif
6594#ifdef __cplusplus
6595}
6596#endif 6056#endif
6597 6057
6598int
6599main ()
6600{
6601return f != $ac_func;
6602 ; 6058 ;
6603 return 0; 6059 return 0;
6604} 6060}
6605_ACEOF 6061_ACEOF
6606rm -f conftest.$ac_objext conftest$ac_exeext 6062rm -f conftest.$ac_objext conftest$ac_exeext
6607if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6063if { (eval echo "$as_me:6063: \"$ac_link\"") >&5
6608 (eval $ac_link) 2>&5 6064 (eval $ac_link) 2>&5
6609 ac_status=$? 6065 ac_status=$?
6610 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6066 echo "$as_me:6066: \$? = $ac_status" >&5
6611 (exit $ac_status); } && 6067 (exit $ac_status); } &&
6612 { ac_try='test -s conftest$ac_exeext' 6068 { ac_try='test -s conftest$ac_exeext'
6613 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6069 { (eval echo "$as_me:6069: \"$ac_try\"") >&5
6614 (eval $ac_try) 2>&5 6070 (eval $ac_try) 2>&5
6615 ac_status=$? 6071 ac_status=$?
6616 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6072 echo "$as_me:6072: \$? = $ac_status" >&5
6617 (exit $ac_status); }; }; then 6073 (exit $ac_status); }; }; then
6618 eval "$as_ac_var=yes" 6074 eval "$as_ac_var=yes"
6619else 6075else
6620 echo "$as_me: failed program was:" >&5 6076 echo "$as_me: failed program was:" >&5
6621sed 's/^/| /' conftest.$ac_ext >&5 6077cat conftest.$ac_ext >&5
6622
6623eval "$as_ac_var=no" 6078eval "$as_ac_var=no"
6624fi 6079fi
6625rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6080rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6626fi 6081fi
6627echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 6082echo "$as_me:6082: result: `eval echo '${'$as_ac_var'}'`" >&5
6628echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 6083echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
6629if test `eval echo '${'$as_ac_var'}'` = yes; then 6084if test `eval echo '${'$as_ac_var'}'` = yes; then
6630 cat >>confdefs.h <<_ACEOF 6085 cat >>confdefs.h <<EOF
6631#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 6086#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
6632_ACEOF 6087EOF
6633 6088
6634fi 6089fi
6635done 6090done
6636 6091
6637
6638
6639for ac_func in strftime 6092for ac_func in strftime
6640do 6093do
6641as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 6094as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
6642echo "$as_me:$LINENO: checking for $ac_func" >&5 6095echo "$as_me:6095: checking for $ac_func" >&5
6643echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 6096echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
6644if eval "test \"\${$as_ac_var+set}\" = set"; then 6097if eval "test \"\${$as_ac_var+set}\" = set"; then
6645 echo $ECHO_N "(cached) $ECHO_C" >&6 6098 echo $ECHO_N "(cached) $ECHO_C" >&6
6646else 6099else
6647 cat >conftest.$ac_ext <<_ACEOF 6100 cat >conftest.$ac_ext <<_ACEOF
6648#line $LINENO "configure" 6101#line 6101 "configure"
6649/* confdefs.h. */ 6102#include "confdefs.h"
6650_ACEOF
6651cat confdefs.h >>conftest.$ac_ext
6652cat >>conftest.$ac_ext <<_ACEOF
6653/* end confdefs.h. */
6654/* System header to define __stub macros and hopefully few prototypes, 6103/* System header to define __stub macros and hopefully few prototypes,
6655 which can conflict with char $ac_func (); below. 6104 which can conflict with char $ac_func (); below. */
6656 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 6105#include <assert.h>
6657 <limits.h> exists even on freestanding compilers. */
6658#ifdef __STDC__
6659# include <limits.h>
6660#else
6661# include <assert.h>
6662#endif
6663/* Override any gcc2 internal prototype to avoid an error. */ 6106/* Override any gcc2 internal prototype to avoid an error. */
6664#ifdef __cplusplus 6107#ifdef __cplusplus
6665extern "C" 6108extern "C"
6666{
6667#endif 6109#endif
6668/* We use char because int might match the return type of a gcc2 6110/* We use char because int might match the return type of a gcc2
6669 builtin and then its argument prototype would still apply. */ 6111 builtin and then its argument prototype would still apply. */
6670char $ac_func (); 6112char $ac_func ();
6113char (*f) ();
6114
6115int
6116main ()
6117{
6671/* The GNU C library defines this for functions which it implements 6118/* The GNU C library defines this for functions which it implements
6672 to always fail with ENOSYS. Some functions are actually named 6119 to always fail with ENOSYS. Some functions are actually named
6673 something starting with __ and the normal name is an alias. */ 6120 something starting with __ and the normal name is an alias. */
6674#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 6121#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
6675choke me 6122choke me
6676#else 6123#else
6677char (*f) () = $ac_func; 6124f = $ac_func;
6678#endif
6679#ifdef __cplusplus
6680}
6681#endif 6125#endif
6682 6126
6683int
6684main ()
6685{
6686return f != $ac_func;
6687 ; 6127 ;
6688 return 0; 6128 return 0;
6689} 6129}
6690_ACEOF 6130_ACEOF
6691rm -f conftest.$ac_objext conftest$ac_exeext 6131rm -f conftest.$ac_objext conftest$ac_exeext
6692if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6132if { (eval echo "$as_me:6132: \"$ac_link\"") >&5
6693 (eval $ac_link) 2>&5 6133 (eval $ac_link) 2>&5
6694 ac_status=$? 6134 ac_status=$?
6695 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6135 echo "$as_me:6135: \$? = $ac_status" >&5
6696 (exit $ac_status); } && 6136 (exit $ac_status); } &&
6697 { ac_try='test -s conftest$ac_exeext' 6137 { ac_try='test -s conftest$ac_exeext'
6698 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6138 { (eval echo "$as_me:6138: \"$ac_try\"") >&5
6699 (eval $ac_try) 2>&5 6139 (eval $ac_try) 2>&5
6700 ac_status=$? 6140 ac_status=$?
6701 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6141 echo "$as_me:6141: \$? = $ac_status" >&5
6702 (exit $ac_status); }; }; then 6142 (exit $ac_status); }; }; then
6703 eval "$as_ac_var=yes" 6143 eval "$as_ac_var=yes"
6704else 6144else
6705 echo "$as_me: failed program was:" >&5 6145 echo "$as_me: failed program was:" >&5
6706sed 's/^/| /' conftest.$ac_ext >&5 6146cat conftest.$ac_ext >&5
6707
6708eval "$as_ac_var=no" 6147eval "$as_ac_var=no"
6709fi 6148fi
6710rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6149rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6711fi 6150fi
6712echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 6151echo "$as_me:6151: result: `eval echo '${'$as_ac_var'}'`" >&5
6713echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 6152echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
6714if test `eval echo '${'$as_ac_var'}'` = yes; then 6153if test `eval echo '${'$as_ac_var'}'` = yes; then
6715 cat >>confdefs.h <<_ACEOF 6154 cat >>confdefs.h <<EOF
6716#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 6155#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
6717_ACEOF 6156EOF
6718 6157
6719else 6158else
6720 # strftime is in -lintl on SCO UNIX. 6159 # strftime is in -lintl on SCO UNIX.
6721echo "$as_me:$LINENO: checking for strftime in -lintl" >&5 6160echo "$as_me:6160: checking for strftime in -lintl" >&5
6722echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 6161echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
6723if test "${ac_cv_lib_intl_strftime+set}" = set; then 6162if test "${ac_cv_lib_intl_strftime+set}" = set; then
6724 echo $ECHO_N "(cached) $ECHO_C" >&6 6163 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6726,12 +6165,8 @@ else
6726 ac_check_lib_save_LIBS=$LIBS 6165 ac_check_lib_save_LIBS=$LIBS
6727LIBS="-lintl $LIBS" 6166LIBS="-lintl $LIBS"
6728cat >conftest.$ac_ext <<_ACEOF 6167cat >conftest.$ac_ext <<_ACEOF
6729#line $LINENO "configure" 6168#line 6168 "configure"
6730/* confdefs.h. */ 6169#include "confdefs.h"
6731_ACEOF
6732cat confdefs.h >>conftest.$ac_ext
6733cat >>conftest.$ac_ext <<_ACEOF
6734/* end confdefs.h. */
6735 6170
6736/* Override any gcc2 internal prototype to avoid an error. */ 6171/* Override any gcc2 internal prototype to avoid an error. */
6737#ifdef __cplusplus 6172#ifdef __cplusplus
@@ -6749,33 +6184,32 @@ strftime ();
6749} 6184}
6750_ACEOF 6185_ACEOF
6751rm -f conftest.$ac_objext conftest$ac_exeext 6186rm -f conftest.$ac_objext conftest$ac_exeext
6752if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6187if { (eval echo "$as_me:6187: \"$ac_link\"") >&5
6753 (eval $ac_link) 2>&5 6188 (eval $ac_link) 2>&5
6754 ac_status=$? 6189 ac_status=$?
6755 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6190 echo "$as_me:6190: \$? = $ac_status" >&5
6756 (exit $ac_status); } && 6191 (exit $ac_status); } &&
6757 { ac_try='test -s conftest$ac_exeext' 6192 { ac_try='test -s conftest$ac_exeext'
6758 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6193 { (eval echo "$as_me:6193: \"$ac_try\"") >&5
6759 (eval $ac_try) 2>&5 6194 (eval $ac_try) 2>&5
6760 ac_status=$? 6195 ac_status=$?
6761 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6196 echo "$as_me:6196: \$? = $ac_status" >&5
6762 (exit $ac_status); }; }; then 6197 (exit $ac_status); }; }; then
6763 ac_cv_lib_intl_strftime=yes 6198 ac_cv_lib_intl_strftime=yes
6764else 6199else
6765 echo "$as_me: failed program was:" >&5 6200 echo "$as_me: failed program was:" >&5
6766sed 's/^/| /' conftest.$ac_ext >&5 6201cat conftest.$ac_ext >&5
6767
6768ac_cv_lib_intl_strftime=no 6202ac_cv_lib_intl_strftime=no
6769fi 6203fi
6770rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6204rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6771LIBS=$ac_check_lib_save_LIBS 6205LIBS=$ac_check_lib_save_LIBS
6772fi 6206fi
6773echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5 6207echo "$as_me:6207: result: $ac_cv_lib_intl_strftime" >&5
6774echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 6208echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
6775if test $ac_cv_lib_intl_strftime = yes; then 6209if test $ac_cv_lib_intl_strftime = yes; then
6776 cat >>confdefs.h <<\_ACEOF 6210 cat >>confdefs.h <<\EOF
6777#define HAVE_STRFTIME 1 6211#define HAVE_STRFTIME 1
6778_ACEOF 6212EOF
6779 6213
6780LIBS="-lintl $LIBS" 6214LIBS="-lintl $LIBS"
6781fi 6215fi
@@ -6783,17 +6217,12 @@ fi
6783fi 6217fi
6784done 6218done
6785 6219
6786
6787# Check for ALTDIRFUNC glob() extension 6220# Check for ALTDIRFUNC glob() extension
6788echo "$as_me:$LINENO: checking for GLOB_ALTDIRFUNC support" >&5 6221echo "$as_me:6221: checking for GLOB_ALTDIRFUNC support" >&5
6789echo $ECHO_N "checking for GLOB_ALTDIRFUNC support... $ECHO_C" >&6 6222echo $ECHO_N "checking for GLOB_ALTDIRFUNC support... $ECHO_C" >&6
6790cat >conftest.$ac_ext <<_ACEOF 6223cat >conftest.$ac_ext <<_ACEOF
6791#line $LINENO "configure" 6224#line 6224 "configure"
6792/* confdefs.h. */ 6225#include "confdefs.h"
6793_ACEOF
6794cat confdefs.h >>conftest.$ac_ext
6795cat >>conftest.$ac_ext <<_ACEOF
6796/* end confdefs.h. */
6797 6226
6798 #include <glob.h> 6227 #include <glob.h>
6799 #ifdef GLOB_ALTDIRFUNC 6228 #ifdef GLOB_ALTDIRFUNC
@@ -6802,76 +6231,62 @@ cat >>conftest.$ac_ext <<_ACEOF
6802 6231
6803_ACEOF 6232_ACEOF
6804if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 6233if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6805 $EGREP "FOUNDIT" >/dev/null 2>&1; then 6234 egrep "FOUNDIT" >/dev/null 2>&1; then
6806 6235
6807 cat >>confdefs.h <<\_ACEOF 6236 cat >>confdefs.h <<\EOF
6808#define GLOB_HAS_ALTDIRFUNC 1 6237#define GLOB_HAS_ALTDIRFUNC 1
6809_ACEOF 6238EOF
6810 6239
6811 echo "$as_me:$LINENO: result: yes" >&5 6240 echo "$as_me:6240: result: yes" >&5
6812echo "${ECHO_T}yes" >&6 6241echo "${ECHO_T}yes" >&6
6813 6242
6814else 6243else
6815 6244
6816 echo "$as_me:$LINENO: result: no" >&5 6245 echo "$as_me:6245: result: no" >&5
6817echo "${ECHO_T}no" >&6 6246echo "${ECHO_T}no" >&6
6818 6247
6819
6820fi 6248fi
6821rm -f conftest* 6249rm -f conftest*
6822 6250
6823
6824# Check for g.gl_matchc glob() extension 6251# Check for g.gl_matchc glob() extension
6825echo "$as_me:$LINENO: checking for gl_matchc field in glob_t" >&5 6252echo "$as_me:6252: checking for gl_matchc field in glob_t" >&5
6826echo $ECHO_N "checking for gl_matchc field in glob_t... $ECHO_C" >&6 6253echo $ECHO_N "checking for gl_matchc field in glob_t... $ECHO_C" >&6
6827cat >conftest.$ac_ext <<_ACEOF 6254cat >conftest.$ac_ext <<_ACEOF
6828#line $LINENO "configure" 6255#line 6255 "configure"
6829/* confdefs.h. */ 6256#include "confdefs.h"
6830_ACEOF
6831cat confdefs.h >>conftest.$ac_ext
6832cat >>conftest.$ac_ext <<_ACEOF
6833/* end confdefs.h. */
6834 6257
6835 #include <glob.h> 6258 #include <glob.h>
6836 int main(void){glob_t g; g.gl_matchc = 1;} 6259 int main(void){glob_t g; g.gl_matchc = 1;}
6837 6260
6838_ACEOF 6261_ACEOF
6839if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 6262if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6840 $EGREP "FOUNDIT" >/dev/null 2>&1; then 6263 egrep "FOUNDIT" >/dev/null 2>&1; then
6841 6264
6842 cat >>confdefs.h <<\_ACEOF 6265 cat >>confdefs.h <<\EOF
6843#define GLOB_HAS_GL_MATCHC 1 6266#define GLOB_HAS_GL_MATCHC 1
6844_ACEOF 6267EOF
6845 6268
6846 echo "$as_me:$LINENO: result: yes" >&5 6269 echo "$as_me:6269: result: yes" >&5
6847echo "${ECHO_T}yes" >&6 6270echo "${ECHO_T}yes" >&6
6848 6271
6849else 6272else
6850 6273
6851 echo "$as_me:$LINENO: result: no" >&5 6274 echo "$as_me:6274: result: no" >&5
6852echo "${ECHO_T}no" >&6 6275echo "${ECHO_T}no" >&6
6853 6276
6854
6855fi 6277fi
6856rm -f conftest* 6278rm -f conftest*
6857 6279
6858 6280echo "$as_me:6280: checking whether struct dirent allocates space for d_name" >&5
6859echo "$as_me:$LINENO: checking whether struct dirent allocates space for d_name" >&5
6860echo $ECHO_N "checking whether struct dirent allocates space for d_name... $ECHO_C" >&6 6281echo $ECHO_N "checking whether struct dirent allocates space for d_name... $ECHO_C" >&6
6861if test "$cross_compiling" = yes; then 6282if test "$cross_compiling" = yes; then
6862 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 6283 { { echo "$as_me:6283: error: cannot run test program while cross compiling" >&5
6863See \`config.log' for more details." >&5 6284echo "$as_me: error: cannot run test program while cross compiling" >&2;}
6864echo "$as_me: error: cannot run test program while cross compiling
6865See \`config.log' for more details." >&2;}
6866 { (exit 1); exit 1; }; } 6285 { (exit 1); exit 1; }; }
6867else 6286else
6868 cat >conftest.$ac_ext <<_ACEOF 6287 cat >conftest.$ac_ext <<_ACEOF
6869#line $LINENO "configure" 6288#line 6288 "configure"
6870/* confdefs.h. */ 6289#include "confdefs.h"
6871_ACEOF
6872cat confdefs.h >>conftest.$ac_ext
6873cat >>conftest.$ac_ext <<_ACEOF
6874/* end confdefs.h. */
6875 6290
6876#include <sys/types.h> 6291#include <sys/types.h>
6877#include <dirent.h> 6292#include <dirent.h>
@@ -6879,35 +6294,31 @@ int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
6879 6294
6880_ACEOF 6295_ACEOF
6881rm -f conftest$ac_exeext 6296rm -f conftest$ac_exeext
6882if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6297if { (eval echo "$as_me:6297: \"$ac_link\"") >&5
6883 (eval $ac_link) 2>&5 6298 (eval $ac_link) 2>&5
6884 ac_status=$? 6299 ac_status=$?
6885 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6300 echo "$as_me:6300: \$? = $ac_status" >&5
6886 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 6301 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6887 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6302 { (eval echo "$as_me:6302: \"$ac_try\"") >&5
6888 (eval $ac_try) 2>&5 6303 (eval $ac_try) 2>&5
6889 ac_status=$? 6304 ac_status=$?
6890 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6305 echo "$as_me:6305: \$? = $ac_status" >&5
6891 (exit $ac_status); }; }; then 6306 (exit $ac_status); }; }; then
6892 echo "$as_me:$LINENO: result: yes" >&5 6307 echo "$as_me:6307: result: yes" >&5
6893echo "${ECHO_T}yes" >&6 6308echo "${ECHO_T}yes" >&6
6894else 6309else
6895 echo "$as_me: program exited with status $ac_status" >&5 6310 echo "$as_me: program exited with status $ac_status" >&5
6896echo "$as_me: failed program was:" >&5 6311echo "$as_me: failed program was:" >&5
6897sed 's/^/| /' conftest.$ac_ext >&5 6312cat conftest.$ac_ext >&5
6898 6313
6899( exit $ac_status ) 6314 echo "$as_me:6314: result: no" >&5
6900
6901 echo "$as_me:$LINENO: result: no" >&5
6902echo "${ECHO_T}no" >&6 6315echo "${ECHO_T}no" >&6
6903 cat >>confdefs.h <<\_ACEOF 6316 cat >>confdefs.h <<\EOF
6904#define BROKEN_ONE_BYTE_DIRENT_D_NAME 1 6317#define BROKEN_ONE_BYTE_DIRENT_D_NAME 1
6905_ACEOF 6318EOF
6906
6907
6908 6319
6909fi 6320fi
6910rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 6321rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6911fi 6322fi
6912 6323
6913# Check whether user wants S/Key support 6324# Check whether user wants S/Key support
@@ -6924,29 +6335,23 @@ if test "${with_skey+set}" = set; then
6924 LDFLAGS="$LDFLAGS -L${withval}/lib" 6335 LDFLAGS="$LDFLAGS -L${withval}/lib"
6925 fi 6336 fi
6926 6337
6927 cat >>confdefs.h <<\_ACEOF 6338 cat >>confdefs.h <<\EOF
6928#define SKEY 1 6339#define SKEY 1
6929_ACEOF 6340EOF
6930 6341
6931 LIBS="-lskey $LIBS" 6342 LIBS="-lskey $LIBS"
6932 SKEY_MSG="yes" 6343 SKEY_MSG="yes"
6933 6344
6934 echo "$as_me:$LINENO: checking for s/key support" >&5 6345 echo "$as_me:6345: checking for s/key support" >&5
6935echo $ECHO_N "checking for s/key support... $ECHO_C" >&6 6346echo $ECHO_N "checking for s/key support... $ECHO_C" >&6
6936 if test "$cross_compiling" = yes; then 6347 if test "$cross_compiling" = yes; then
6937 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 6348 { { echo "$as_me:6348: error: cannot run test program while cross compiling" >&5
6938See \`config.log' for more details." >&5 6349echo "$as_me: error: cannot run test program while cross compiling" >&2;}
6939echo "$as_me: error: cannot run test program while cross compiling
6940See \`config.log' for more details." >&2;}
6941 { (exit 1); exit 1; }; } 6350 { (exit 1); exit 1; }; }
6942else 6351else
6943 cat >conftest.$ac_ext <<_ACEOF 6352 cat >conftest.$ac_ext <<_ACEOF
6944#line $LINENO "configure" 6353#line 6353 "configure"
6945/* confdefs.h. */ 6354#include "confdefs.h"
6946_ACEOF
6947cat confdefs.h >>conftest.$ac_ext
6948cat >>conftest.$ac_ext <<_ACEOF
6949/* end confdefs.h. */
6950 6355
6951#include <stdio.h> 6356#include <stdio.h>
6952#include <skey.h> 6357#include <skey.h>
@@ -6954,37 +6359,34 @@ int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
6954 6359
6955_ACEOF 6360_ACEOF
6956rm -f conftest$ac_exeext 6361rm -f conftest$ac_exeext
6957if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6362if { (eval echo "$as_me:6362: \"$ac_link\"") >&5
6958 (eval $ac_link) 2>&5 6363 (eval $ac_link) 2>&5
6959 ac_status=$? 6364 ac_status=$?
6960 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6365 echo "$as_me:6365: \$? = $ac_status" >&5
6961 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 6366 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6962 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6367 { (eval echo "$as_me:6367: \"$ac_try\"") >&5
6963 (eval $ac_try) 2>&5 6368 (eval $ac_try) 2>&5
6964 ac_status=$? 6369 ac_status=$?
6965 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6370 echo "$as_me:6370: \$? = $ac_status" >&5
6966 (exit $ac_status); }; }; then 6371 (exit $ac_status); }; }; then
6967 echo "$as_me:$LINENO: result: yes" >&5 6372 echo "$as_me:6372: result: yes" >&5
6968echo "${ECHO_T}yes" >&6 6373echo "${ECHO_T}yes" >&6
6969else 6374else
6970 echo "$as_me: program exited with status $ac_status" >&5 6375 echo "$as_me: program exited with status $ac_status" >&5
6971echo "$as_me: failed program was:" >&5 6376echo "$as_me: failed program was:" >&5
6972sed 's/^/| /' conftest.$ac_ext >&5 6377cat conftest.$ac_ext >&5
6973 6378
6974( exit $ac_status ) 6379 echo "$as_me:6379: result: no" >&5
6975
6976 echo "$as_me:$LINENO: result: no" >&5
6977echo "${ECHO_T}no" >&6 6380echo "${ECHO_T}no" >&6
6978 { { echo "$as_me:$LINENO: error: ** Incomplete or missing s/key libraries." >&5 6381 { { echo "$as_me:6381: error: ** Incomplete or missing s/key libraries." >&5
6979echo "$as_me: error: ** Incomplete or missing s/key libraries." >&2;} 6382echo "$as_me: error: ** Incomplete or missing s/key libraries." >&2;}
6980 { (exit 1); exit 1; }; } 6383 { (exit 1); exit 1; }; }
6981 6384
6982fi 6385fi
6983rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 6386rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6984fi 6387fi
6985 fi 6388 fi
6986 6389
6987
6988fi; 6390fi;
6989 6391
6990# Check whether user wants TCP wrappers support 6392# Check whether user wants TCP wrappers support
@@ -7020,15 +6422,11 @@ if test "${with_tcp_wrappers+set}" = set; then
7020 fi 6422 fi
7021 LIBWRAP="-lwrap" 6423 LIBWRAP="-lwrap"
7022 LIBS="$LIBWRAP $LIBS" 6424 LIBS="$LIBWRAP $LIBS"
7023 echo "$as_me:$LINENO: checking for libwrap" >&5 6425 echo "$as_me:6425: checking for libwrap" >&5
7024echo $ECHO_N "checking for libwrap... $ECHO_C" >&6 6426echo $ECHO_N "checking for libwrap... $ECHO_C" >&6
7025 cat >conftest.$ac_ext <<_ACEOF 6427 cat >conftest.$ac_ext <<_ACEOF
7026#line $LINENO "configure" 6428#line 6428 "configure"
7027/* confdefs.h. */ 6429#include "confdefs.h"
7028_ACEOF
7029cat confdefs.h >>conftest.$ac_ext
7030cat >>conftest.$ac_ext <<_ACEOF
7031/* end confdefs.h. */
7032 6430
7033#include <tcpd.h> 6431#include <tcpd.h>
7034 int deny_severity = 0, allow_severity = 0; 6432 int deny_severity = 0, allow_severity = 0;
@@ -7042,215 +6440,124 @@ hosts_access(0);
7042} 6440}
7043_ACEOF 6441_ACEOF
7044rm -f conftest.$ac_objext conftest$ac_exeext 6442rm -f conftest.$ac_objext conftest$ac_exeext
7045if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6443if { (eval echo "$as_me:6443: \"$ac_link\"") >&5
7046 (eval $ac_link) 2>&5 6444 (eval $ac_link) 2>&5
7047 ac_status=$? 6445 ac_status=$?
7048 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6446 echo "$as_me:6446: \$? = $ac_status" >&5
7049 (exit $ac_status); } && 6447 (exit $ac_status); } &&
7050 { ac_try='test -s conftest$ac_exeext' 6448 { ac_try='test -s conftest$ac_exeext'
7051 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6449 { (eval echo "$as_me:6449: \"$ac_try\"") >&5
7052 (eval $ac_try) 2>&5 6450 (eval $ac_try) 2>&5
7053 ac_status=$? 6451 ac_status=$?
7054 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6452 echo "$as_me:6452: \$? = $ac_status" >&5
7055 (exit $ac_status); }; }; then 6453 (exit $ac_status); }; }; then
7056 6454
7057 echo "$as_me:$LINENO: result: yes" >&5 6455 echo "$as_me:6455: result: yes" >&5
7058echo "${ECHO_T}yes" >&6 6456echo "${ECHO_T}yes" >&6
7059 cat >>confdefs.h <<\_ACEOF 6457 cat >>confdefs.h <<\EOF
7060#define LIBWRAP 1 6458#define LIBWRAP 1
7061_ACEOF 6459EOF
7062
7063 6460
7064 TCPW_MSG="yes" 6461 TCPW_MSG="yes"
7065 6462
7066else 6463else
7067 echo "$as_me: failed program was:" >&5 6464 echo "$as_me: failed program was:" >&5
7068sed 's/^/| /' conftest.$ac_ext >&5 6465cat conftest.$ac_ext >&5
7069
7070 6466
7071 { { echo "$as_me:$LINENO: error: *** libwrap missing" >&5 6467 { { echo "$as_me:6467: error: *** libwrap missing" >&5
7072echo "$as_me: error: *** libwrap missing" >&2;} 6468echo "$as_me: error: *** libwrap missing" >&2;}
7073 { (exit 1); exit 1; }; } 6469 { (exit 1); exit 1; }; }
7074 6470
7075
7076fi 6471fi
7077rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6472rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7078 LIBS="$saved_LIBS" 6473 LIBS="$saved_LIBS"
7079 fi 6474 fi
7080 6475
7081
7082fi; 6476fi;
7083 6477
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157for ac_func in \ 6478for ac_func in \
7158 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \ 6479 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
7159 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \ 6480 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
7160 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \ 6481 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
7161 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \ 6482 getpeereid _getpty getrlimit getttyent glob inet_aton \
7162 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ 6483 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
7163 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \ 6484 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
7164 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \ 6485 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
7165 setegid setenv seteuid setgroups setlogin setpcred setproctitle \ 6486 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
7166 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \ 6487 setproctitle setregid setresgid setresuid setreuid setrlimit \
7167 snprintf socketpair strerror strlcat strlcpy strmode strnvis \ 6488 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
7168 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \ 6489 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
6490 truncate utimes vhangup vsnprintf waitpid \
7169 6491
7170do 6492do
7171as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 6493as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
7172echo "$as_me:$LINENO: checking for $ac_func" >&5 6494echo "$as_me:6494: checking for $ac_func" >&5
7173echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 6495echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
7174if eval "test \"\${$as_ac_var+set}\" = set"; then 6496if eval "test \"\${$as_ac_var+set}\" = set"; then
7175 echo $ECHO_N "(cached) $ECHO_C" >&6 6497 echo $ECHO_N "(cached) $ECHO_C" >&6
7176else 6498else
7177 cat >conftest.$ac_ext <<_ACEOF 6499 cat >conftest.$ac_ext <<_ACEOF
7178#line $LINENO "configure" 6500#line 6500 "configure"
7179/* confdefs.h. */ 6501#include "confdefs.h"
7180_ACEOF
7181cat confdefs.h >>conftest.$ac_ext
7182cat >>conftest.$ac_ext <<_ACEOF
7183/* end confdefs.h. */
7184/* System header to define __stub macros and hopefully few prototypes, 6502/* System header to define __stub macros and hopefully few prototypes,
7185 which can conflict with char $ac_func (); below. 6503 which can conflict with char $ac_func (); below. */
7186 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 6504#include <assert.h>
7187 <limits.h> exists even on freestanding compilers. */
7188#ifdef __STDC__
7189# include <limits.h>
7190#else
7191# include <assert.h>
7192#endif
7193/* Override any gcc2 internal prototype to avoid an error. */ 6505/* Override any gcc2 internal prototype to avoid an error. */
7194#ifdef __cplusplus 6506#ifdef __cplusplus
7195extern "C" 6507extern "C"
7196{
7197#endif 6508#endif
7198/* We use char because int might match the return type of a gcc2 6509/* We use char because int might match the return type of a gcc2
7199 builtin and then its argument prototype would still apply. */ 6510 builtin and then its argument prototype would still apply. */
7200char $ac_func (); 6511char $ac_func ();
6512char (*f) ();
6513
6514int
6515main ()
6516{
7201/* The GNU C library defines this for functions which it implements 6517/* The GNU C library defines this for functions which it implements
7202 to always fail with ENOSYS. Some functions are actually named 6518 to always fail with ENOSYS. Some functions are actually named
7203 something starting with __ and the normal name is an alias. */ 6519 something starting with __ and the normal name is an alias. */
7204#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 6520#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7205choke me 6521choke me
7206#else 6522#else
7207char (*f) () = $ac_func; 6523f = $ac_func;
7208#endif
7209#ifdef __cplusplus
7210}
7211#endif 6524#endif
7212 6525
7213int
7214main ()
7215{
7216return f != $ac_func;
7217 ; 6526 ;
7218 return 0; 6527 return 0;
7219} 6528}
7220_ACEOF 6529_ACEOF
7221rm -f conftest.$ac_objext conftest$ac_exeext 6530rm -f conftest.$ac_objext conftest$ac_exeext
7222if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6531if { (eval echo "$as_me:6531: \"$ac_link\"") >&5
7223 (eval $ac_link) 2>&5 6532 (eval $ac_link) 2>&5
7224 ac_status=$? 6533 ac_status=$?
7225 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6534 echo "$as_me:6534: \$? = $ac_status" >&5
7226 (exit $ac_status); } && 6535 (exit $ac_status); } &&
7227 { ac_try='test -s conftest$ac_exeext' 6536 { ac_try='test -s conftest$ac_exeext'
7228 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6537 { (eval echo "$as_me:6537: \"$ac_try\"") >&5
7229 (eval $ac_try) 2>&5 6538 (eval $ac_try) 2>&5
7230 ac_status=$? 6539 ac_status=$?
7231 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6540 echo "$as_me:6540: \$? = $ac_status" >&5
7232 (exit $ac_status); }; }; then 6541 (exit $ac_status); }; }; then
7233 eval "$as_ac_var=yes" 6542 eval "$as_ac_var=yes"
7234else 6543else
7235 echo "$as_me: failed program was:" >&5 6544 echo "$as_me: failed program was:" >&5
7236sed 's/^/| /' conftest.$ac_ext >&5 6545cat conftest.$ac_ext >&5
7237
7238eval "$as_ac_var=no" 6546eval "$as_ac_var=no"
7239fi 6547fi
7240rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6548rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7241fi 6549fi
7242echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 6550echo "$as_me:6550: result: `eval echo '${'$as_ac_var'}'`" >&5
7243echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 6551echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
7244if test `eval echo '${'$as_ac_var'}'` = yes; then 6552if test `eval echo '${'$as_ac_var'}'` = yes; then
7245 cat >>confdefs.h <<_ACEOF 6553 cat >>confdefs.h <<EOF
7246#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 6554#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
7247_ACEOF 6555EOF
7248 6556
7249fi 6557fi
7250done 6558done
7251 6559
7252 6560echo "$as_me:6560: checking for library containing nanosleep" >&5
7253echo "$as_me:$LINENO: checking for library containing nanosleep" >&5
7254echo $ECHO_N "checking for library containing nanosleep... $ECHO_C" >&6 6561echo $ECHO_N "checking for library containing nanosleep... $ECHO_C" >&6
7255if test "${ac_cv_search_nanosleep+set}" = set; then 6562if test "${ac_cv_search_nanosleep+set}" = set; then
7256 echo $ECHO_N "(cached) $ECHO_C" >&6 6563 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -7258,12 +6565,8 @@ else
7258 ac_func_search_save_LIBS=$LIBS 6565 ac_func_search_save_LIBS=$LIBS
7259ac_cv_search_nanosleep=no 6566ac_cv_search_nanosleep=no
7260cat >conftest.$ac_ext <<_ACEOF 6567cat >conftest.$ac_ext <<_ACEOF
7261#line $LINENO "configure" 6568#line 6568 "configure"
7262/* confdefs.h. */ 6569#include "confdefs.h"
7263_ACEOF
7264cat confdefs.h >>conftest.$ac_ext
7265cat >>conftest.$ac_ext <<_ACEOF
7266/* end confdefs.h. */
7267 6570
7268/* Override any gcc2 internal prototype to avoid an error. */ 6571/* Override any gcc2 internal prototype to avoid an error. */
7269#ifdef __cplusplus 6572#ifdef __cplusplus
@@ -7281,34 +6584,29 @@ nanosleep ();
7281} 6584}
7282_ACEOF 6585_ACEOF
7283rm -f conftest.$ac_objext conftest$ac_exeext 6586rm -f conftest.$ac_objext conftest$ac_exeext
7284if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6587if { (eval echo "$as_me:6587: \"$ac_link\"") >&5
7285 (eval $ac_link) 2>&5 6588 (eval $ac_link) 2>&5
7286 ac_status=$? 6589 ac_status=$?
7287 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6590 echo "$as_me:6590: \$? = $ac_status" >&5
7288 (exit $ac_status); } && 6591 (exit $ac_status); } &&
7289 { ac_try='test -s conftest$ac_exeext' 6592 { ac_try='test -s conftest$ac_exeext'
7290 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6593 { (eval echo "$as_me:6593: \"$ac_try\"") >&5
7291 (eval $ac_try) 2>&5 6594 (eval $ac_try) 2>&5
7292 ac_status=$? 6595 ac_status=$?
7293 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6596 echo "$as_me:6596: \$? = $ac_status" >&5
7294 (exit $ac_status); }; }; then 6597 (exit $ac_status); }; }; then
7295 ac_cv_search_nanosleep="none required" 6598 ac_cv_search_nanosleep="none required"
7296else 6599else
7297 echo "$as_me: failed program was:" >&5 6600 echo "$as_me: failed program was:" >&5
7298sed 's/^/| /' conftest.$ac_ext >&5 6601cat conftest.$ac_ext >&5
7299
7300fi 6602fi
7301rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6603rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7302if test "$ac_cv_search_nanosleep" = no; then 6604if test "$ac_cv_search_nanosleep" = no; then
7303 for ac_lib in rt posix4; do 6605 for ac_lib in rt posix4; do
7304 LIBS="-l$ac_lib $ac_func_search_save_LIBS" 6606 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
7305 cat >conftest.$ac_ext <<_ACEOF 6607 cat >conftest.$ac_ext <<_ACEOF
7306#line $LINENO "configure" 6608#line 6608 "configure"
7307/* confdefs.h. */ 6609#include "confdefs.h"
7308_ACEOF
7309cat confdefs.h >>conftest.$ac_ext
7310cat >>conftest.$ac_ext <<_ACEOF
7311/* end confdefs.h. */
7312 6610
7313/* Override any gcc2 internal prototype to avoid an error. */ 6611/* Override any gcc2 internal prototype to avoid an error. */
7314#ifdef __cplusplus 6612#ifdef __cplusplus
@@ -7326,161 +6624,231 @@ nanosleep ();
7326} 6624}
7327_ACEOF 6625_ACEOF
7328rm -f conftest.$ac_objext conftest$ac_exeext 6626rm -f conftest.$ac_objext conftest$ac_exeext
7329if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6627if { (eval echo "$as_me:6627: \"$ac_link\"") >&5
7330 (eval $ac_link) 2>&5 6628 (eval $ac_link) 2>&5
7331 ac_status=$? 6629 ac_status=$?
7332 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6630 echo "$as_me:6630: \$? = $ac_status" >&5
7333 (exit $ac_status); } && 6631 (exit $ac_status); } &&
7334 { ac_try='test -s conftest$ac_exeext' 6632 { ac_try='test -s conftest$ac_exeext'
7335 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6633 { (eval echo "$as_me:6633: \"$ac_try\"") >&5
7336 (eval $ac_try) 2>&5 6634 (eval $ac_try) 2>&5
7337 ac_status=$? 6635 ac_status=$?
7338 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6636 echo "$as_me:6636: \$? = $ac_status" >&5
7339 (exit $ac_status); }; }; then 6637 (exit $ac_status); }; }; then
7340 ac_cv_search_nanosleep="-l$ac_lib" 6638 ac_cv_search_nanosleep="-l$ac_lib"
7341break 6639break
7342else 6640else
7343 echo "$as_me: failed program was:" >&5 6641 echo "$as_me: failed program was:" >&5
7344sed 's/^/| /' conftest.$ac_ext >&5 6642cat conftest.$ac_ext >&5
7345
7346fi 6643fi
7347rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6644rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7348 done 6645 done
7349fi 6646fi
7350LIBS=$ac_func_search_save_LIBS 6647LIBS=$ac_func_search_save_LIBS
7351fi 6648fi
7352echo "$as_me:$LINENO: result: $ac_cv_search_nanosleep" >&5 6649echo "$as_me:6649: result: $ac_cv_search_nanosleep" >&5
7353echo "${ECHO_T}$ac_cv_search_nanosleep" >&6 6650echo "${ECHO_T}$ac_cv_search_nanosleep" >&6
7354if test "$ac_cv_search_nanosleep" != no; then 6651if test "$ac_cv_search_nanosleep" != no; then
7355 test "$ac_cv_search_nanosleep" = "none required" || LIBS="$ac_cv_search_nanosleep $LIBS" 6652 test "$ac_cv_search_nanosleep" = "none required" || LIBS="$ac_cv_search_nanosleep $LIBS"
7356 cat >>confdefs.h <<\_ACEOF 6653 cat >>confdefs.h <<\EOF
7357#define HAVE_NANOSLEEP 1 6654#define HAVE_NANOSLEEP 1
7358_ACEOF 6655EOF
7359 6656
7360fi 6657fi
7361 6658
7362echo "$as_me:$LINENO: checking for library containing basename" >&5 6659echo "$as_me:6659: checking for ANSI C header files" >&5
7363echo $ECHO_N "checking for library containing basename... $ECHO_C" >&6 6660echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
7364if test "${ac_cv_search_basename+set}" = set; then 6661if test "${ac_cv_header_stdc+set}" = set; then
7365 echo $ECHO_N "(cached) $ECHO_C" >&6 6662 echo $ECHO_N "(cached) $ECHO_C" >&6
7366else 6663else
7367 ac_func_search_save_LIBS=$LIBS 6664 cat >conftest.$ac_ext <<_ACEOF
7368ac_cv_search_basename=no 6665#line 6665 "configure"
7369cat >conftest.$ac_ext <<_ACEOF 6666#include "confdefs.h"
7370#line $LINENO "configure" 6667#include <stdlib.h>
7371/* confdefs.h. */ 6668#include <stdarg.h>
6669#include <string.h>
6670#include <float.h>
6671
7372_ACEOF 6672_ACEOF
7373cat confdefs.h >>conftest.$ac_ext 6673if { (eval echo "$as_me:6673: \"$ac_cpp conftest.$ac_ext\"") >&5
7374cat >>conftest.$ac_ext <<_ACEOF 6674 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7375/* end confdefs.h. */ 6675 ac_status=$?
6676 egrep -v '^ *\+' conftest.er1 >conftest.err
6677 rm -f conftest.er1
6678 cat conftest.err >&5
6679 echo "$as_me:6679: \$? = $ac_status" >&5
6680 (exit $ac_status); } >/dev/null; then
6681 if test -s conftest.err; then
6682 ac_cpp_err=$ac_c_preproc_warn_flag
6683 else
6684 ac_cpp_err=
6685 fi
6686else
6687 ac_cpp_err=yes
6688fi
6689if test -z "$ac_cpp_err"; then
6690 ac_cv_header_stdc=yes
6691else
6692 echo "$as_me: failed program was:" >&5
6693 cat conftest.$ac_ext >&5
6694 ac_cv_header_stdc=no
6695fi
6696rm -f conftest.err conftest.$ac_ext
7376 6697
7377/* Override any gcc2 internal prototype to avoid an error. */ 6698if test $ac_cv_header_stdc = yes; then
7378#ifdef __cplusplus 6699 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7379extern "C" 6700 cat >conftest.$ac_ext <<_ACEOF
6701#line 6701 "configure"
6702#include "confdefs.h"
6703#include <string.h>
6704
6705_ACEOF
6706if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6707 egrep "memchr" >/dev/null 2>&1; then
6708 :
6709else
6710 ac_cv_header_stdc=no
6711fi
6712rm -f conftest*
6713
6714fi
6715
6716if test $ac_cv_header_stdc = yes; then
6717 # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
6718 cat >conftest.$ac_ext <<_ACEOF
6719#line 6719 "configure"
6720#include "confdefs.h"
6721#include <stdlib.h>
6722
6723_ACEOF
6724if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
6725 egrep "free" >/dev/null 2>&1; then
6726 :
6727else
6728 ac_cv_header_stdc=no
6729fi
6730rm -f conftest*
6731
6732fi
6733
6734if test $ac_cv_header_stdc = yes; then
6735 # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
6736 if test "$cross_compiling" = yes; then
6737 :
6738else
6739 cat >conftest.$ac_ext <<_ACEOF
6740#line 6740 "configure"
6741#include "confdefs.h"
6742#include <ctype.h>
6743#if ((' ' & 0x0FF) == 0x020)
6744# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
6745# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
6746#else
6747# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
6748 || ('j' <= (c) && (c) <= 'r') \
6749 || ('s' <= (c) && (c) <= 'z'))
6750# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7380#endif 6751#endif
7381/* We use char because int might match the return type of a gcc2 6752
7382 builtin and then its argument prototype would still apply. */ 6753#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7383char basename ();
7384int 6754int
7385main () 6755main ()
7386{ 6756{
7387basename (); 6757 int i;
7388 ; 6758 for (i = 0; i < 256; i++)
7389 return 0; 6759 if (XOR (islower (i), ISLOWER (i))
6760 || toupper (i) != TOUPPER (i))
6761 exit(2);
6762 exit (0);
7390} 6763}
7391_ACEOF 6764_ACEOF
7392rm -f conftest.$ac_objext conftest$ac_exeext 6765rm -f conftest$ac_exeext
7393if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6766if { (eval echo "$as_me:6766: \"$ac_link\"") >&5
7394 (eval $ac_link) 2>&5 6767 (eval $ac_link) 2>&5
7395 ac_status=$? 6768 ac_status=$?
7396 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6769 echo "$as_me:6769: \$? = $ac_status" >&5
7397 (exit $ac_status); } && 6770 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7398 { ac_try='test -s conftest$ac_exeext' 6771 { (eval echo "$as_me:6771: \"$ac_try\"") >&5
7399 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7400 (eval $ac_try) 2>&5 6772 (eval $ac_try) 2>&5
7401 ac_status=$? 6773 ac_status=$?
7402 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6774 echo "$as_me:6774: \$? = $ac_status" >&5
7403 (exit $ac_status); }; }; then 6775 (exit $ac_status); }; }; then
7404 ac_cv_search_basename="none required" 6776 :
7405else 6777else
7406 echo "$as_me: failed program was:" >&5 6778 echo "$as_me: program exited with status $ac_status" >&5
7407sed 's/^/| /' conftest.$ac_ext >&5 6779echo "$as_me: failed program was:" >&5
6780cat conftest.$ac_ext >&5
6781ac_cv_header_stdc=no
6782fi
6783rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6784fi
6785fi
6786fi
6787echo "$as_me:6787: result: $ac_cv_header_stdc" >&5
6788echo "${ECHO_T}$ac_cv_header_stdc" >&6
6789if test $ac_cv_header_stdc = yes; then
6790
6791cat >>confdefs.h <<\EOF
6792#define STDC_HEADERS 1
6793EOF
7408 6794
7409fi 6795fi
7410rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7411if test "$ac_cv_search_basename" = no; then
7412 for ac_lib in gen; do
7413 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
7414 cat >conftest.$ac_ext <<_ACEOF
7415#line $LINENO "configure"
7416/* confdefs.h. */
7417_ACEOF
7418cat confdefs.h >>conftest.$ac_ext
7419cat >>conftest.$ac_ext <<_ACEOF
7420/* end confdefs.h. */
7421 6796
7422/* Override any gcc2 internal prototype to avoid an error. */ 6797# On IRIX 5.3, sys/types and inttypes.h are conflicting.
7423#ifdef __cplusplus 6798
7424extern "C" 6799for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7425#endif 6800 inttypes.h stdint.h unistd.h
7426/* We use char because int might match the return type of a gcc2 6801do
7427 builtin and then its argument prototype would still apply. */ 6802as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7428char basename (); 6803echo "$as_me:6803: checking for $ac_header" >&5
7429int 6804echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7430main () 6805if eval "test \"\${$as_ac_Header+set}\" = set"; then
7431{ 6806 echo $ECHO_N "(cached) $ECHO_C" >&6
7432basename (); 6807else
7433 ; 6808 cat >conftest.$ac_ext <<_ACEOF
7434 return 0; 6809#line 6809 "configure"
7435} 6810#include "confdefs.h"
6811$ac_includes_default
6812#include <$ac_header>
7436_ACEOF 6813_ACEOF
7437rm -f conftest.$ac_objext conftest$ac_exeext 6814rm -f conftest.$ac_objext
7438if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6815if { (eval echo "$as_me:6815: \"$ac_compile\"") >&5
7439 (eval $ac_link) 2>&5 6816 (eval $ac_compile) 2>&5
7440 ac_status=$? 6817 ac_status=$?
7441 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6818 echo "$as_me:6818: \$? = $ac_status" >&5
7442 (exit $ac_status); } && 6819 (exit $ac_status); } &&
7443 { ac_try='test -s conftest$ac_exeext' 6820 { ac_try='test -s conftest.$ac_objext'
7444 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6821 { (eval echo "$as_me:6821: \"$ac_try\"") >&5
7445 (eval $ac_try) 2>&5 6822 (eval $ac_try) 2>&5
7446 ac_status=$? 6823 ac_status=$?
7447 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6824 echo "$as_me:6824: \$? = $ac_status" >&5
7448 (exit $ac_status); }; }; then 6825 (exit $ac_status); }; }; then
7449 ac_cv_search_basename="-l$ac_lib" 6826 eval "$as_ac_Header=yes"
7450break
7451else 6827else
7452 echo "$as_me: failed program was:" >&5 6828 echo "$as_me: failed program was:" >&5
7453sed 's/^/| /' conftest.$ac_ext >&5 6829cat conftest.$ac_ext >&5
7454 6830eval "$as_ac_Header=no"
7455fi
7456rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7457 done
7458fi 6831fi
7459LIBS=$ac_func_search_save_LIBS 6832rm -f conftest.$ac_objext conftest.$ac_ext
7460fi 6833fi
7461echo "$as_me:$LINENO: result: $ac_cv_search_basename" >&5 6834echo "$as_me:6834: result: `eval echo '${'$as_ac_Header'}'`" >&5
7462echo "${ECHO_T}$ac_cv_search_basename" >&6 6835echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7463if test "$ac_cv_search_basename" != no; then 6836if test `eval echo '${'$as_ac_Header'}'` = yes; then
7464 test "$ac_cv_search_basename" = "none required" || LIBS="$ac_cv_search_basename $LIBS" 6837 cat >>confdefs.h <<EOF
7465 cat >>confdefs.h <<\_ACEOF 6838#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7466#define HAVE_BASENAME 1 6839EOF
7467_ACEOF
7468 6840
7469fi 6841fi
6842done
7470 6843
7471 6844echo "$as_me:6844: checking whether strsep is declared" >&5
7472echo "$as_me:$LINENO: checking whether strsep is declared" >&5
7473echo $ECHO_N "checking whether strsep is declared... $ECHO_C" >&6 6845echo $ECHO_N "checking whether strsep is declared... $ECHO_C" >&6
7474if test "${ac_cv_have_decl_strsep+set}" = set; then 6846if test "${ac_cv_have_decl_strsep+set}" = set; then
7475 echo $ECHO_N "(cached) $ECHO_C" >&6 6847 echo $ECHO_N "(cached) $ECHO_C" >&6
7476else 6848else
7477 cat >conftest.$ac_ext <<_ACEOF 6849 cat >conftest.$ac_ext <<_ACEOF
7478#line $LINENO "configure" 6850#line 6850 "configure"
7479/* confdefs.h. */ 6851#include "confdefs.h"
7480_ACEOF
7481cat confdefs.h >>conftest.$ac_ext
7482cat >>conftest.$ac_ext <<_ACEOF
7483/* end confdefs.h. */
7484$ac_includes_default 6852$ac_includes_default
7485int 6853int
7486main () 6854main ()
@@ -7494,1131 +6862,746 @@ main ()
7494} 6862}
7495_ACEOF 6863_ACEOF
7496rm -f conftest.$ac_objext 6864rm -f conftest.$ac_objext
7497if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 6865if { (eval echo "$as_me:6865: \"$ac_compile\"") >&5
7498 (eval $ac_compile) 2>&5 6866 (eval $ac_compile) 2>&5
7499 ac_status=$? 6867 ac_status=$?
7500 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6868 echo "$as_me:6868: \$? = $ac_status" >&5
7501 (exit $ac_status); } && 6869 (exit $ac_status); } &&
7502 { ac_try='test -s conftest.$ac_objext' 6870 { ac_try='test -s conftest.$ac_objext'
7503 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6871 { (eval echo "$as_me:6871: \"$ac_try\"") >&5
7504 (eval $ac_try) 2>&5 6872 (eval $ac_try) 2>&5
7505 ac_status=$? 6873 ac_status=$?
7506 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6874 echo "$as_me:6874: \$? = $ac_status" >&5
7507 (exit $ac_status); }; }; then 6875 (exit $ac_status); }; }; then
7508 ac_cv_have_decl_strsep=yes 6876 ac_cv_have_decl_strsep=yes
7509else 6877else
7510 echo "$as_me: failed program was:" >&5 6878 echo "$as_me: failed program was:" >&5
7511sed 's/^/| /' conftest.$ac_ext >&5 6879cat conftest.$ac_ext >&5
7512
7513ac_cv_have_decl_strsep=no 6880ac_cv_have_decl_strsep=no
7514fi 6881fi
7515rm -f conftest.$ac_objext conftest.$ac_ext 6882rm -f conftest.$ac_objext conftest.$ac_ext
7516fi 6883fi
7517echo "$as_me:$LINENO: result: $ac_cv_have_decl_strsep" >&5 6884echo "$as_me:6884: result: $ac_cv_have_decl_strsep" >&5
7518echo "${ECHO_T}$ac_cv_have_decl_strsep" >&6 6885echo "${ECHO_T}$ac_cv_have_decl_strsep" >&6
7519if test $ac_cv_have_decl_strsep = yes; then 6886if test $ac_cv_have_decl_strsep = yes; then
7520 6887
7521for ac_func in strsep 6888for ac_func in strsep
7522do 6889do
7523as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 6890as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
7524echo "$as_me:$LINENO: checking for $ac_func" >&5 6891echo "$as_me:6891: checking for $ac_func" >&5
7525echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 6892echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
7526if eval "test \"\${$as_ac_var+set}\" = set"; then 6893if eval "test \"\${$as_ac_var+set}\" = set"; then
7527 echo $ECHO_N "(cached) $ECHO_C" >&6 6894 echo $ECHO_N "(cached) $ECHO_C" >&6
7528else 6895else
7529 cat >conftest.$ac_ext <<_ACEOF 6896 cat >conftest.$ac_ext <<_ACEOF
7530#line $LINENO "configure" 6897#line 6897 "configure"
7531/* confdefs.h. */ 6898#include "confdefs.h"
7532_ACEOF
7533cat confdefs.h >>conftest.$ac_ext
7534cat >>conftest.$ac_ext <<_ACEOF
7535/* end confdefs.h. */
7536/* System header to define __stub macros and hopefully few prototypes, 6899/* System header to define __stub macros and hopefully few prototypes,
7537 which can conflict with char $ac_func (); below. 6900 which can conflict with char $ac_func (); below. */
7538 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 6901#include <assert.h>
7539 <limits.h> exists even on freestanding compilers. */
7540#ifdef __STDC__
7541# include <limits.h>
7542#else
7543# include <assert.h>
7544#endif
7545/* Override any gcc2 internal prototype to avoid an error. */ 6902/* Override any gcc2 internal prototype to avoid an error. */
7546#ifdef __cplusplus 6903#ifdef __cplusplus
7547extern "C" 6904extern "C"
7548{
7549#endif 6905#endif
7550/* We use char because int might match the return type of a gcc2 6906/* We use char because int might match the return type of a gcc2
7551 builtin and then its argument prototype would still apply. */ 6907 builtin and then its argument prototype would still apply. */
7552char $ac_func (); 6908char $ac_func ();
6909char (*f) ();
6910
6911int
6912main ()
6913{
7553/* The GNU C library defines this for functions which it implements 6914/* The GNU C library defines this for functions which it implements
7554 to always fail with ENOSYS. Some functions are actually named 6915 to always fail with ENOSYS. Some functions are actually named
7555 something starting with __ and the normal name is an alias. */ 6916 something starting with __ and the normal name is an alias. */
7556#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 6917#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7557choke me 6918choke me
7558#else 6919#else
7559char (*f) () = $ac_func; 6920f = $ac_func;
7560#endif
7561#ifdef __cplusplus
7562}
7563#endif 6921#endif
7564 6922
7565int
7566main ()
7567{
7568return f != $ac_func;
7569 ; 6923 ;
7570 return 0; 6924 return 0;
7571} 6925}
7572_ACEOF 6926_ACEOF
7573rm -f conftest.$ac_objext conftest$ac_exeext 6927rm -f conftest.$ac_objext conftest$ac_exeext
7574if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 6928if { (eval echo "$as_me:6928: \"$ac_link\"") >&5
7575 (eval $ac_link) 2>&5 6929 (eval $ac_link) 2>&5
7576 ac_status=$? 6930 ac_status=$?
7577 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6931 echo "$as_me:6931: \$? = $ac_status" >&5
7578 (exit $ac_status); } && 6932 (exit $ac_status); } &&
7579 { ac_try='test -s conftest$ac_exeext' 6933 { ac_try='test -s conftest$ac_exeext'
7580 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 6934 { (eval echo "$as_me:6934: \"$ac_try\"") >&5
7581 (eval $ac_try) 2>&5 6935 (eval $ac_try) 2>&5
7582 ac_status=$? 6936 ac_status=$?
7583 echo "$as_me:$LINENO: \$? = $ac_status" >&5 6937 echo "$as_me:6937: \$? = $ac_status" >&5
7584 (exit $ac_status); }; }; then 6938 (exit $ac_status); }; }; then
7585 eval "$as_ac_var=yes" 6939 eval "$as_ac_var=yes"
7586else 6940else
7587 echo "$as_me: failed program was:" >&5 6941 echo "$as_me: failed program was:" >&5
7588sed 's/^/| /' conftest.$ac_ext >&5 6942cat conftest.$ac_ext >&5
7589
7590eval "$as_ac_var=no" 6943eval "$as_ac_var=no"
7591fi 6944fi
7592rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 6945rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7593fi 6946fi
7594echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 6947echo "$as_me:6947: result: `eval echo '${'$as_ac_var'}'`" >&5
7595echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 6948echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
7596if test `eval echo '${'$as_ac_var'}'` = yes; then 6949if test `eval echo '${'$as_ac_var'}'` = yes; then
7597 cat >>confdefs.h <<_ACEOF 6950 cat >>confdefs.h <<EOF
7598#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 6951#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
7599_ACEOF 6952EOF
7600 6953
7601fi 6954fi
7602done 6955done
7603 6956
7604fi 6957fi
7605 6958
6959echo "$as_me:6959: checking whether getrusage is declared" >&5
6960echo $ECHO_N "checking whether getrusage is declared... $ECHO_C" >&6
6961if test "${ac_cv_have_decl_getrusage+set}" = set; then
6962 echo $ECHO_N "(cached) $ECHO_C" >&6
6963else
6964 cat >conftest.$ac_ext <<_ACEOF
6965#line 6965 "configure"
6966#include "confdefs.h"
6967$ac_includes_default
6968int
6969main ()
6970{
6971#ifndef getrusage
6972 char *p = (char *) getrusage;
6973#endif
7606 6974
6975 ;
6976 return 0;
6977}
6978_ACEOF
6979rm -f conftest.$ac_objext
6980if { (eval echo "$as_me:6980: \"$ac_compile\"") >&5
6981 (eval $ac_compile) 2>&5
6982 ac_status=$?
6983 echo "$as_me:6983: \$? = $ac_status" >&5
6984 (exit $ac_status); } &&
6985 { ac_try='test -s conftest.$ac_objext'
6986 { (eval echo "$as_me:6986: \"$ac_try\"") >&5
6987 (eval $ac_try) 2>&5
6988 ac_status=$?
6989 echo "$as_me:6989: \$? = $ac_status" >&5
6990 (exit $ac_status); }; }; then
6991 ac_cv_have_decl_getrusage=yes
6992else
6993 echo "$as_me: failed program was:" >&5
6994cat conftest.$ac_ext >&5
6995ac_cv_have_decl_getrusage=no
6996fi
6997rm -f conftest.$ac_objext conftest.$ac_ext
6998fi
6999echo "$as_me:6999: result: $ac_cv_have_decl_getrusage" >&5
7000echo "${ECHO_T}$ac_cv_have_decl_getrusage" >&6
7001if test $ac_cv_have_decl_getrusage = yes; then
7607 7002
7608for ac_func in dirname 7003for ac_func in getrusage
7609do 7004do
7610as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7005as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
7611echo "$as_me:$LINENO: checking for $ac_func" >&5 7006echo "$as_me:7006: checking for $ac_func" >&5
7612echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7007echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
7613if eval "test \"\${$as_ac_var+set}\" = set"; then 7008if eval "test \"\${$as_ac_var+set}\" = set"; then
7614 echo $ECHO_N "(cached) $ECHO_C" >&6 7009 echo $ECHO_N "(cached) $ECHO_C" >&6
7615else 7010else
7616 cat >conftest.$ac_ext <<_ACEOF 7011 cat >conftest.$ac_ext <<_ACEOF
7617#line $LINENO "configure" 7012#line 7012 "configure"
7618/* confdefs.h. */ 7013#include "confdefs.h"
7619_ACEOF
7620cat confdefs.h >>conftest.$ac_ext
7621cat >>conftest.$ac_ext <<_ACEOF
7622/* end confdefs.h. */
7623/* System header to define __stub macros and hopefully few prototypes, 7014/* System header to define __stub macros and hopefully few prototypes,
7624 which can conflict with char $ac_func (); below. 7015 which can conflict with char $ac_func (); below. */
7625 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7016#include <assert.h>
7626 <limits.h> exists even on freestanding compilers. */
7627#ifdef __STDC__
7628# include <limits.h>
7629#else
7630# include <assert.h>
7631#endif
7632/* Override any gcc2 internal prototype to avoid an error. */ 7017/* Override any gcc2 internal prototype to avoid an error. */
7633#ifdef __cplusplus 7018#ifdef __cplusplus
7634extern "C" 7019extern "C"
7635{
7636#endif 7020#endif
7637/* We use char because int might match the return type of a gcc2 7021/* We use char because int might match the return type of a gcc2
7638 builtin and then its argument prototype would still apply. */ 7022 builtin and then its argument prototype would still apply. */
7639char $ac_func (); 7023char $ac_func ();
7024char (*f) ();
7025
7026int
7027main ()
7028{
7640/* The GNU C library defines this for functions which it implements 7029/* The GNU C library defines this for functions which it implements
7641 to always fail with ENOSYS. Some functions are actually named 7030 to always fail with ENOSYS. Some functions are actually named
7642 something starting with __ and the normal name is an alias. */ 7031 something starting with __ and the normal name is an alias. */
7643#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7032#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7644choke me 7033choke me
7645#else 7034#else
7646char (*f) () = $ac_func; 7035f = $ac_func;
7647#endif
7648#ifdef __cplusplus
7649}
7650#endif 7036#endif
7651 7037
7652int
7653main ()
7654{
7655return f != $ac_func;
7656 ; 7038 ;
7657 return 0; 7039 return 0;
7658} 7040}
7659_ACEOF 7041_ACEOF
7660rm -f conftest.$ac_objext conftest$ac_exeext 7042rm -f conftest.$ac_objext conftest$ac_exeext
7661if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7043if { (eval echo "$as_me:7043: \"$ac_link\"") >&5
7662 (eval $ac_link) 2>&5 7044 (eval $ac_link) 2>&5
7663 ac_status=$? 7045 ac_status=$?
7664 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7046 echo "$as_me:7046: \$? = $ac_status" >&5
7665 (exit $ac_status); } && 7047 (exit $ac_status); } &&
7666 { ac_try='test -s conftest$ac_exeext' 7048 { ac_try='test -s conftest$ac_exeext'
7667 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7049 { (eval echo "$as_me:7049: \"$ac_try\"") >&5
7668 (eval $ac_try) 2>&5 7050 (eval $ac_try) 2>&5
7669 ac_status=$? 7051 ac_status=$?
7670 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7052 echo "$as_me:7052: \$? = $ac_status" >&5
7671 (exit $ac_status); }; }; then 7053 (exit $ac_status); }; }; then
7672 eval "$as_ac_var=yes" 7054 eval "$as_ac_var=yes"
7673else 7055else
7674 echo "$as_me: failed program was:" >&5 7056 echo "$as_me: failed program was:" >&5
7675sed 's/^/| /' conftest.$ac_ext >&5 7057cat conftest.$ac_ext >&5
7676
7677eval "$as_ac_var=no" 7058eval "$as_ac_var=no"
7678fi 7059fi
7679rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7060rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7680fi 7061fi
7681echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7062echo "$as_me:7062: result: `eval echo '${'$as_ac_var'}'`" >&5
7682echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7063echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
7683if test `eval echo '${'$as_ac_var'}'` = yes; then 7064if test `eval echo '${'$as_ac_var'}'` = yes; then
7684 cat >>confdefs.h <<_ACEOF 7065 cat >>confdefs.h <<EOF
7685#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7066#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
7686_ACEOF 7067EOF
7687 7068
7688for ac_header in libgen.h
7689do
7690as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7691if eval "test \"\${$as_ac_Header+set}\" = set"; then
7692 echo "$as_me:$LINENO: checking for $ac_header" >&5
7693echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7694if eval "test \"\${$as_ac_Header+set}\" = set"; then
7695 echo $ECHO_N "(cached) $ECHO_C" >&6
7696fi 7069fi
7697echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 7070done
7698echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 7071
7072fi
7073
7074echo "$as_me:7074: checking whether tcsendbreak is declared" >&5
7075echo $ECHO_N "checking whether tcsendbreak is declared... $ECHO_C" >&6
7076if test "${ac_cv_have_decl_tcsendbreak+set}" = set; then
7077 echo $ECHO_N "(cached) $ECHO_C" >&6
7699else 7078else
7700 # Is the header compilable? 7079 cat >conftest.$ac_ext <<_ACEOF
7701echo "$as_me:$LINENO: checking $ac_header usability" >&5 7080#line 7080 "configure"
7702echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 7081#include "confdefs.h"
7703cat >conftest.$ac_ext <<_ACEOF 7082#include <termios.h>
7704#line $LINENO "configure" 7083
7705/* confdefs.h. */ 7084int
7706_ACEOF 7085main ()
7707cat confdefs.h >>conftest.$ac_ext 7086{
7708cat >>conftest.$ac_ext <<_ACEOF 7087#ifndef tcsendbreak
7709/* end confdefs.h. */ 7088 char *p = (char *) tcsendbreak;
7710$ac_includes_default 7089#endif
7711#include <$ac_header> 7090
7091 ;
7092 return 0;
7093}
7712_ACEOF 7094_ACEOF
7713rm -f conftest.$ac_objext 7095rm -f conftest.$ac_objext
7714if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 7096if { (eval echo "$as_me:7096: \"$ac_compile\"") >&5
7715 (eval $ac_compile) 2>&5 7097 (eval $ac_compile) 2>&5
7716 ac_status=$? 7098 ac_status=$?
7717 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7099 echo "$as_me:7099: \$? = $ac_status" >&5
7718 (exit $ac_status); } && 7100 (exit $ac_status); } &&
7719 { ac_try='test -s conftest.$ac_objext' 7101 { ac_try='test -s conftest.$ac_objext'
7720 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7102 { (eval echo "$as_me:7102: \"$ac_try\"") >&5
7721 (eval $ac_try) 2>&5 7103 (eval $ac_try) 2>&5
7722 ac_status=$? 7104 ac_status=$?
7723 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7105 echo "$as_me:7105: \$? = $ac_status" >&5
7724 (exit $ac_status); }; }; then 7106 (exit $ac_status); }; }; then
7725 ac_header_compiler=yes 7107 ac_cv_have_decl_tcsendbreak=yes
7726else 7108else
7727 echo "$as_me: failed program was:" >&5 7109 echo "$as_me: failed program was:" >&5
7728sed 's/^/| /' conftest.$ac_ext >&5 7110cat conftest.$ac_ext >&5
7729 7111ac_cv_have_decl_tcsendbreak=no
7730ac_header_compiler=no
7731fi 7112fi
7732rm -f conftest.$ac_objext conftest.$ac_ext 7113rm -f conftest.$ac_objext conftest.$ac_ext
7733echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
7734echo "${ECHO_T}$ac_header_compiler" >&6
7735
7736# Is the header present?
7737echo "$as_me:$LINENO: checking $ac_header presence" >&5
7738echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
7739cat >conftest.$ac_ext <<_ACEOF
7740#line $LINENO "configure"
7741/* confdefs.h. */
7742_ACEOF
7743cat confdefs.h >>conftest.$ac_ext
7744cat >>conftest.$ac_ext <<_ACEOF
7745/* end confdefs.h. */
7746#include <$ac_header>
7747_ACEOF
7748if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
7749 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7750 ac_status=$?
7751 grep -v '^ *+' conftest.er1 >conftest.err
7752 rm -f conftest.er1
7753 cat conftest.err >&5
7754 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7755 (exit $ac_status); } >/dev/null; then
7756 if test -s conftest.err; then
7757 ac_cpp_err=$ac_c_preproc_warn_flag
7758 else
7759 ac_cpp_err=
7760 fi
7761else
7762 ac_cpp_err=yes
7763fi 7114fi
7764if test -z "$ac_cpp_err"; then 7115echo "$as_me:7115: result: $ac_cv_have_decl_tcsendbreak" >&5
7765 ac_header_preproc=yes 7116echo "${ECHO_T}$ac_cv_have_decl_tcsendbreak" >&6
7766else 7117if test $ac_cv_have_decl_tcsendbreak = yes; then
7767 echo "$as_me: failed program was:" >&5 7118 cat >>confdefs.h <<\EOF
7768sed 's/^/| /' conftest.$ac_ext >&5 7119#define HAVE_TCSENDBREAK 1
7769 7120EOF
7770 ac_header_preproc=no
7771fi
7772rm -f conftest.err conftest.$ac_ext
7773echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
7774echo "${ECHO_T}$ac_header_preproc" >&6
7775
7776# So? What about this header?
7777case $ac_header_compiler:$ac_header_preproc in
7778 yes:no )
7779 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
7780echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
7781 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
7782echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
7783 (
7784 cat <<\_ASBOX
7785## ------------------------------------ ##
7786## Report this to bug-autoconf@gnu.org. ##
7787## ------------------------------------ ##
7788_ASBOX
7789 ) |
7790 sed "s/^/$as_me: WARNING: /" >&2
7791 ;;
7792 no:yes )
7793 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
7794echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
7795 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
7796echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
7797 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
7798echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
7799 (
7800 cat <<\_ASBOX
7801## ------------------------------------ ##
7802## Report this to bug-autoconf@gnu.org. ##
7803## ------------------------------------ ##
7804_ASBOX
7805 ) |
7806 sed "s/^/$as_me: WARNING: /" >&2
7807 ;;
7808esac
7809echo "$as_me:$LINENO: checking for $ac_header" >&5
7810echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7811if eval "test \"\${$as_ac_Header+set}\" = set"; then
7812 echo $ECHO_N "(cached) $ECHO_C" >&6
7813else
7814 eval "$as_ac_Header=$ac_header_preproc"
7815fi
7816echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
7817echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7818
7819fi
7820if test `eval echo '${'$as_ac_Header'}'` = yes; then
7821 cat >>confdefs.h <<_ACEOF
7822#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7823_ACEOF
7824
7825fi
7826
7827done
7828 7121
7829else 7122else
7830 7123
7831 echo "$as_me:$LINENO: checking for dirname in -lgen" >&5 7124for ac_func in tcsendbreak
7832echo $ECHO_N "checking for dirname in -lgen... $ECHO_C" >&6 7125do
7833if test "${ac_cv_lib_gen_dirname+set}" = set; then 7126as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
7127echo "$as_me:7127: checking for $ac_func" >&5
7128echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
7129if eval "test \"\${$as_ac_var+set}\" = set"; then
7834 echo $ECHO_N "(cached) $ECHO_C" >&6 7130 echo $ECHO_N "(cached) $ECHO_C" >&6
7835else 7131else
7836 ac_check_lib_save_LIBS=$LIBS 7132 cat >conftest.$ac_ext <<_ACEOF
7837LIBS="-lgen $LIBS" 7133#line 7133 "configure"
7838cat >conftest.$ac_ext <<_ACEOF 7134#include "confdefs.h"
7839#line $LINENO "configure" 7135/* System header to define __stub macros and hopefully few prototypes,
7840/* confdefs.h. */ 7136 which can conflict with char $ac_func (); below. */
7841_ACEOF 7137#include <assert.h>
7842cat confdefs.h >>conftest.$ac_ext
7843cat >>conftest.$ac_ext <<_ACEOF
7844/* end confdefs.h. */
7845
7846/* Override any gcc2 internal prototype to avoid an error. */ 7138/* Override any gcc2 internal prototype to avoid an error. */
7847#ifdef __cplusplus 7139#ifdef __cplusplus
7848extern "C" 7140extern "C"
7849#endif 7141#endif
7850/* We use char because int might match the return type of a gcc2 7142/* We use char because int might match the return type of a gcc2
7851 builtin and then its argument prototype would still apply. */ 7143 builtin and then its argument prototype would still apply. */
7852char dirname (); 7144char $ac_func ();
7145char (*f) ();
7146
7853int 7147int
7854main () 7148main ()
7855{ 7149{
7856dirname (); 7150/* The GNU C library defines this for functions which it implements
7151 to always fail with ENOSYS. Some functions are actually named
7152 something starting with __ and the normal name is an alias. */
7153#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
7154choke me
7155#else
7156f = $ac_func;
7157#endif
7158
7857 ; 7159 ;
7858 return 0; 7160 return 0;
7859} 7161}
7860_ACEOF 7162_ACEOF
7861rm -f conftest.$ac_objext conftest$ac_exeext 7163rm -f conftest.$ac_objext conftest$ac_exeext
7862if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7164if { (eval echo "$as_me:7164: \"$ac_link\"") >&5
7863 (eval $ac_link) 2>&5 7165 (eval $ac_link) 2>&5
7864 ac_status=$? 7166 ac_status=$?
7865 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7167 echo "$as_me:7167: \$? = $ac_status" >&5
7866 (exit $ac_status); } && 7168 (exit $ac_status); } &&
7867 { ac_try='test -s conftest$ac_exeext' 7169 { ac_try='test -s conftest$ac_exeext'
7868 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7170 { (eval echo "$as_me:7170: \"$ac_try\"") >&5
7869 (eval $ac_try) 2>&5 7171 (eval $ac_try) 2>&5
7870 ac_status=$? 7172 ac_status=$?
7871 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7173 echo "$as_me:7173: \$? = $ac_status" >&5
7872 (exit $ac_status); }; }; then 7174 (exit $ac_status); }; }; then
7873 ac_cv_lib_gen_dirname=yes 7175 eval "$as_ac_var=yes"
7874else 7176else
7875 echo "$as_me: failed program was:" >&5 7177 echo "$as_me: failed program was:" >&5
7876sed 's/^/| /' conftest.$ac_ext >&5 7178cat conftest.$ac_ext >&5
7877 7179eval "$as_ac_var=no"
7878ac_cv_lib_gen_dirname=no
7879fi 7180fi
7880rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7181rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7881LIBS=$ac_check_lib_save_LIBS
7882fi
7883echo "$as_me:$LINENO: result: $ac_cv_lib_gen_dirname" >&5
7884echo "${ECHO_T}$ac_cv_lib_gen_dirname" >&6
7885if test $ac_cv_lib_gen_dirname = yes; then
7886
7887 echo "$as_me:$LINENO: checking for broken dirname" >&5
7888echo $ECHO_N "checking for broken dirname... $ECHO_C" >&6
7889if test "${ac_cv_have_broken_dirname+set}" = set; then
7890 echo $ECHO_N "(cached) $ECHO_C" >&6
7891else
7892
7893 save_LIBS="$LIBS"
7894 LIBS="$LIBS -lgen"
7895 if test "$cross_compiling" = yes; then
7896 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
7897See \`config.log' for more details." >&5
7898echo "$as_me: error: cannot run test program while cross compiling
7899See \`config.log' for more details." >&2;}
7900 { (exit 1); exit 1; }; }
7901else
7902 cat >conftest.$ac_ext <<_ACEOF
7903#line $LINENO "configure"
7904/* confdefs.h. */
7905_ACEOF
7906cat confdefs.h >>conftest.$ac_ext
7907cat >>conftest.$ac_ext <<_ACEOF
7908/* end confdefs.h. */
7909
7910#include <libgen.h>
7911#include <string.h>
7912
7913int main(int argc, char **argv) {
7914 char *s, buf[32];
7915
7916 strncpy(buf,"/etc", 32);
7917 s = dirname(buf);
7918 if (!s || strncmp(s, "/", 32) != 0) {
7919 exit(1);
7920 } else {
7921 exit(0);
7922 }
7923}
7924
7925_ACEOF
7926rm -f conftest$ac_exeext
7927if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
7928 (eval $ac_link) 2>&5
7929 ac_status=$?
7930 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7931 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7932 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7933 (eval $ac_try) 2>&5
7934 ac_status=$?
7935 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7936 (exit $ac_status); }; }; then
7937 ac_cv_have_broken_dirname="no"
7938else
7939 echo "$as_me: program exited with status $ac_status" >&5
7940echo "$as_me: failed program was:" >&5
7941sed 's/^/| /' conftest.$ac_ext >&5
7942
7943( exit $ac_status )
7944 ac_cv_have_broken_dirname="yes"
7945
7946fi
7947rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7948fi
7949 LIBS="$save_LIBS"
7950
7951fi
7952echo "$as_me:$LINENO: result: $ac_cv_have_broken_dirname" >&5
7953echo "${ECHO_T}$ac_cv_have_broken_dirname" >&6
7954 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
7955 LIBS="$LIBS -lgen"
7956 cat >>confdefs.h <<\_ACEOF
7957#define HAVE_DIRNAME 1
7958_ACEOF
7959
7960
7961for ac_header in libgen.h
7962do
7963as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7964if eval "test \"\${$as_ac_Header+set}\" = set"; then
7965 echo "$as_me:$LINENO: checking for $ac_header" >&5
7966echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7967if eval "test \"\${$as_ac_Header+set}\" = set"; then
7968 echo $ECHO_N "(cached) $ECHO_C" >&6
7969fi
7970echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
7971echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7972else
7973 # Is the header compilable?
7974echo "$as_me:$LINENO: checking $ac_header usability" >&5
7975echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
7976cat >conftest.$ac_ext <<_ACEOF
7977#line $LINENO "configure"
7978/* confdefs.h. */
7979_ACEOF
7980cat confdefs.h >>conftest.$ac_ext
7981cat >>conftest.$ac_ext <<_ACEOF
7982/* end confdefs.h. */
7983$ac_includes_default
7984#include <$ac_header>
7985_ACEOF
7986rm -f conftest.$ac_objext
7987if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
7988 (eval $ac_compile) 2>&5
7989 ac_status=$?
7990 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7991 (exit $ac_status); } &&
7992 { ac_try='test -s conftest.$ac_objext'
7993 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
7994 (eval $ac_try) 2>&5
7995 ac_status=$?
7996 echo "$as_me:$LINENO: \$? = $ac_status" >&5
7997 (exit $ac_status); }; }; then
7998 ac_header_compiler=yes
7999else
8000 echo "$as_me: failed program was:" >&5
8001sed 's/^/| /' conftest.$ac_ext >&5
8002
8003ac_header_compiler=no
8004fi
8005rm -f conftest.$ac_objext conftest.$ac_ext
8006echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
8007echo "${ECHO_T}$ac_header_compiler" >&6
8008
8009# Is the header present?
8010echo "$as_me:$LINENO: checking $ac_header presence" >&5
8011echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
8012cat >conftest.$ac_ext <<_ACEOF
8013#line $LINENO "configure"
8014/* confdefs.h. */
8015_ACEOF
8016cat confdefs.h >>conftest.$ac_ext
8017cat >>conftest.$ac_ext <<_ACEOF
8018/* end confdefs.h. */
8019#include <$ac_header>
8020_ACEOF
8021if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
8022 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8023 ac_status=$?
8024 grep -v '^ *+' conftest.er1 >conftest.err
8025 rm -f conftest.er1
8026 cat conftest.err >&5
8027 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8028 (exit $ac_status); } >/dev/null; then
8029 if test -s conftest.err; then
8030 ac_cpp_err=$ac_c_preproc_warn_flag
8031 else
8032 ac_cpp_err=
8033 fi
8034else
8035 ac_cpp_err=yes
8036fi
8037if test -z "$ac_cpp_err"; then
8038 ac_header_preproc=yes
8039else
8040 echo "$as_me: failed program was:" >&5
8041sed 's/^/| /' conftest.$ac_ext >&5
8042
8043 ac_header_preproc=no
8044fi
8045rm -f conftest.err conftest.$ac_ext
8046echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
8047echo "${ECHO_T}$ac_header_preproc" >&6
8048
8049# So? What about this header?
8050case $ac_header_compiler:$ac_header_preproc in
8051 yes:no )
8052 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
8053echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
8054 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
8055echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
8056 (
8057 cat <<\_ASBOX
8058## ------------------------------------ ##
8059## Report this to bug-autoconf@gnu.org. ##
8060## ------------------------------------ ##
8061_ASBOX
8062 ) |
8063 sed "s/^/$as_me: WARNING: /" >&2
8064 ;;
8065 no:yes )
8066 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
8067echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
8068 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
8069echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
8070 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
8071echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
8072 (
8073 cat <<\_ASBOX
8074## ------------------------------------ ##
8075## Report this to bug-autoconf@gnu.org. ##
8076## ------------------------------------ ##
8077_ASBOX
8078 ) |
8079 sed "s/^/$as_me: WARNING: /" >&2
8080 ;;
8081esac
8082echo "$as_me:$LINENO: checking for $ac_header" >&5
8083echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8084if eval "test \"\${$as_ac_Header+set}\" = set"; then
8085 echo $ECHO_N "(cached) $ECHO_C" >&6
8086else
8087 eval "$as_ac_Header=$ac_header_preproc"
8088fi 7182fi
8089echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 7183echo "$as_me:7183: result: `eval echo '${'$as_ac_var'}'`" >&5
8090echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 7184echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8091 7185if test `eval echo '${'$as_ac_var'}'` = yes; then
8092fi 7186 cat >>confdefs.h <<EOF
8093if test `eval echo '${'$as_ac_Header'}'` = yes; then 7187#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8094 cat >>confdefs.h <<_ACEOF 7188EOF
8095#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8096_ACEOF
8097 7189
8098fi 7190fi
8099
8100done 7191done
8101 7192
8102 fi
8103
8104fi 7193fi
8105 7194
8106
8107fi
8108done
8109
8110
8111
8112
8113for ac_func in gettimeofday time 7195for ac_func in gettimeofday time
8114do 7196do
8115as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7197as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8116echo "$as_me:$LINENO: checking for $ac_func" >&5 7198echo "$as_me:7198: checking for $ac_func" >&5
8117echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7199echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8118if eval "test \"\${$as_ac_var+set}\" = set"; then 7200if eval "test \"\${$as_ac_var+set}\" = set"; then
8119 echo $ECHO_N "(cached) $ECHO_C" >&6 7201 echo $ECHO_N "(cached) $ECHO_C" >&6
8120else 7202else
8121 cat >conftest.$ac_ext <<_ACEOF 7203 cat >conftest.$ac_ext <<_ACEOF
8122#line $LINENO "configure" 7204#line 7204 "configure"
8123/* confdefs.h. */ 7205#include "confdefs.h"
8124_ACEOF
8125cat confdefs.h >>conftest.$ac_ext
8126cat >>conftest.$ac_ext <<_ACEOF
8127/* end confdefs.h. */
8128/* System header to define __stub macros and hopefully few prototypes, 7206/* System header to define __stub macros and hopefully few prototypes,
8129 which can conflict with char $ac_func (); below. 7207 which can conflict with char $ac_func (); below. */
8130 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7208#include <assert.h>
8131 <limits.h> exists even on freestanding compilers. */
8132#ifdef __STDC__
8133# include <limits.h>
8134#else
8135# include <assert.h>
8136#endif
8137/* Override any gcc2 internal prototype to avoid an error. */ 7209/* Override any gcc2 internal prototype to avoid an error. */
8138#ifdef __cplusplus 7210#ifdef __cplusplus
8139extern "C" 7211extern "C"
8140{
8141#endif 7212#endif
8142/* We use char because int might match the return type of a gcc2 7213/* We use char because int might match the return type of a gcc2
8143 builtin and then its argument prototype would still apply. */ 7214 builtin and then its argument prototype would still apply. */
8144char $ac_func (); 7215char $ac_func ();
7216char (*f) ();
7217
7218int
7219main ()
7220{
8145/* The GNU C library defines this for functions which it implements 7221/* The GNU C library defines this for functions which it implements
8146 to always fail with ENOSYS. Some functions are actually named 7222 to always fail with ENOSYS. Some functions are actually named
8147 something starting with __ and the normal name is an alias. */ 7223 something starting with __ and the normal name is an alias. */
8148#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7224#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8149choke me 7225choke me
8150#else 7226#else
8151char (*f) () = $ac_func; 7227f = $ac_func;
8152#endif
8153#ifdef __cplusplus
8154}
8155#endif 7228#endif
8156 7229
8157int
8158main ()
8159{
8160return f != $ac_func;
8161 ; 7230 ;
8162 return 0; 7231 return 0;
8163} 7232}
8164_ACEOF 7233_ACEOF
8165rm -f conftest.$ac_objext conftest$ac_exeext 7234rm -f conftest.$ac_objext conftest$ac_exeext
8166if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7235if { (eval echo "$as_me:7235: \"$ac_link\"") >&5
8167 (eval $ac_link) 2>&5 7236 (eval $ac_link) 2>&5
8168 ac_status=$? 7237 ac_status=$?
8169 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7238 echo "$as_me:7238: \$? = $ac_status" >&5
8170 (exit $ac_status); } && 7239 (exit $ac_status); } &&
8171 { ac_try='test -s conftest$ac_exeext' 7240 { ac_try='test -s conftest$ac_exeext'
8172 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7241 { (eval echo "$as_me:7241: \"$ac_try\"") >&5
8173 (eval $ac_try) 2>&5 7242 (eval $ac_try) 2>&5
8174 ac_status=$? 7243 ac_status=$?
8175 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7244 echo "$as_me:7244: \$? = $ac_status" >&5
8176 (exit $ac_status); }; }; then 7245 (exit $ac_status); }; }; then
8177 eval "$as_ac_var=yes" 7246 eval "$as_ac_var=yes"
8178else 7247else
8179 echo "$as_me: failed program was:" >&5 7248 echo "$as_me: failed program was:" >&5
8180sed 's/^/| /' conftest.$ac_ext >&5 7249cat conftest.$ac_ext >&5
8181
8182eval "$as_ac_var=no" 7250eval "$as_ac_var=no"
8183fi 7251fi
8184rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7252rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8185fi 7253fi
8186echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7254echo "$as_me:7254: result: `eval echo '${'$as_ac_var'}'`" >&5
8187echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7255echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8188if test `eval echo '${'$as_ac_var'}'` = yes; then 7256if test `eval echo '${'$as_ac_var'}'` = yes; then
8189 cat >>confdefs.h <<_ACEOF 7257 cat >>confdefs.h <<EOF
8190#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7258#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8191_ACEOF 7259EOF
8192 7260
8193fi 7261fi
8194done 7262done
8195 7263
8196
8197
8198
8199
8200
8201
8202for ac_func in endutent getutent getutid getutline pututline setutent 7264for ac_func in endutent getutent getutid getutline pututline setutent
8203do 7265do
8204as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7266as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8205echo "$as_me:$LINENO: checking for $ac_func" >&5 7267echo "$as_me:7267: checking for $ac_func" >&5
8206echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7268echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8207if eval "test \"\${$as_ac_var+set}\" = set"; then 7269if eval "test \"\${$as_ac_var+set}\" = set"; then
8208 echo $ECHO_N "(cached) $ECHO_C" >&6 7270 echo $ECHO_N "(cached) $ECHO_C" >&6
8209else 7271else
8210 cat >conftest.$ac_ext <<_ACEOF 7272 cat >conftest.$ac_ext <<_ACEOF
8211#line $LINENO "configure" 7273#line 7273 "configure"
8212/* confdefs.h. */ 7274#include "confdefs.h"
8213_ACEOF
8214cat confdefs.h >>conftest.$ac_ext
8215cat >>conftest.$ac_ext <<_ACEOF
8216/* end confdefs.h. */
8217/* System header to define __stub macros and hopefully few prototypes, 7275/* System header to define __stub macros and hopefully few prototypes,
8218 which can conflict with char $ac_func (); below. 7276 which can conflict with char $ac_func (); below. */
8219 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7277#include <assert.h>
8220 <limits.h> exists even on freestanding compilers. */
8221#ifdef __STDC__
8222# include <limits.h>
8223#else
8224# include <assert.h>
8225#endif
8226/* Override any gcc2 internal prototype to avoid an error. */ 7278/* Override any gcc2 internal prototype to avoid an error. */
8227#ifdef __cplusplus 7279#ifdef __cplusplus
8228extern "C" 7280extern "C"
8229{
8230#endif 7281#endif
8231/* We use char because int might match the return type of a gcc2 7282/* We use char because int might match the return type of a gcc2
8232 builtin and then its argument prototype would still apply. */ 7283 builtin and then its argument prototype would still apply. */
8233char $ac_func (); 7284char $ac_func ();
7285char (*f) ();
7286
7287int
7288main ()
7289{
8234/* The GNU C library defines this for functions which it implements 7290/* The GNU C library defines this for functions which it implements
8235 to always fail with ENOSYS. Some functions are actually named 7291 to always fail with ENOSYS. Some functions are actually named
8236 something starting with __ and the normal name is an alias. */ 7292 something starting with __ and the normal name is an alias. */
8237#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7293#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8238choke me 7294choke me
8239#else 7295#else
8240char (*f) () = $ac_func; 7296f = $ac_func;
8241#endif
8242#ifdef __cplusplus
8243}
8244#endif 7297#endif
8245 7298
8246int
8247main ()
8248{
8249return f != $ac_func;
8250 ; 7299 ;
8251 return 0; 7300 return 0;
8252} 7301}
8253_ACEOF 7302_ACEOF
8254rm -f conftest.$ac_objext conftest$ac_exeext 7303rm -f conftest.$ac_objext conftest$ac_exeext
8255if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7304if { (eval echo "$as_me:7304: \"$ac_link\"") >&5
8256 (eval $ac_link) 2>&5 7305 (eval $ac_link) 2>&5
8257 ac_status=$? 7306 ac_status=$?
8258 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7307 echo "$as_me:7307: \$? = $ac_status" >&5
8259 (exit $ac_status); } && 7308 (exit $ac_status); } &&
8260 { ac_try='test -s conftest$ac_exeext' 7309 { ac_try='test -s conftest$ac_exeext'
8261 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7310 { (eval echo "$as_me:7310: \"$ac_try\"") >&5
8262 (eval $ac_try) 2>&5 7311 (eval $ac_try) 2>&5
8263 ac_status=$? 7312 ac_status=$?
8264 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7313 echo "$as_me:7313: \$? = $ac_status" >&5
8265 (exit $ac_status); }; }; then 7314 (exit $ac_status); }; }; then
8266 eval "$as_ac_var=yes" 7315 eval "$as_ac_var=yes"
8267else 7316else
8268 echo "$as_me: failed program was:" >&5 7317 echo "$as_me: failed program was:" >&5
8269sed 's/^/| /' conftest.$ac_ext >&5 7318cat conftest.$ac_ext >&5
8270
8271eval "$as_ac_var=no" 7319eval "$as_ac_var=no"
8272fi 7320fi
8273rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7321rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8274fi 7322fi
8275echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7323echo "$as_me:7323: result: `eval echo '${'$as_ac_var'}'`" >&5
8276echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7324echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8277if test `eval echo '${'$as_ac_var'}'` = yes; then 7325if test `eval echo '${'$as_ac_var'}'` = yes; then
8278 cat >>confdefs.h <<_ACEOF 7326 cat >>confdefs.h <<EOF
8279#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7327#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8280_ACEOF 7328EOF
8281 7329
8282fi 7330fi
8283done 7331done
8284 7332
8285
8286for ac_func in utmpname 7333for ac_func in utmpname
8287do 7334do
8288as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7335as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8289echo "$as_me:$LINENO: checking for $ac_func" >&5 7336echo "$as_me:7336: checking for $ac_func" >&5
8290echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7337echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8291if eval "test \"\${$as_ac_var+set}\" = set"; then 7338if eval "test \"\${$as_ac_var+set}\" = set"; then
8292 echo $ECHO_N "(cached) $ECHO_C" >&6 7339 echo $ECHO_N "(cached) $ECHO_C" >&6
8293else 7340else
8294 cat >conftest.$ac_ext <<_ACEOF 7341 cat >conftest.$ac_ext <<_ACEOF
8295#line $LINENO "configure" 7342#line 7342 "configure"
8296/* confdefs.h. */ 7343#include "confdefs.h"
8297_ACEOF
8298cat confdefs.h >>conftest.$ac_ext
8299cat >>conftest.$ac_ext <<_ACEOF
8300/* end confdefs.h. */
8301/* System header to define __stub macros and hopefully few prototypes, 7344/* System header to define __stub macros and hopefully few prototypes,
8302 which can conflict with char $ac_func (); below. 7345 which can conflict with char $ac_func (); below. */
8303 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7346#include <assert.h>
8304 <limits.h> exists even on freestanding compilers. */
8305#ifdef __STDC__
8306# include <limits.h>
8307#else
8308# include <assert.h>
8309#endif
8310/* Override any gcc2 internal prototype to avoid an error. */ 7347/* Override any gcc2 internal prototype to avoid an error. */
8311#ifdef __cplusplus 7348#ifdef __cplusplus
8312extern "C" 7349extern "C"
8313{
8314#endif 7350#endif
8315/* We use char because int might match the return type of a gcc2 7351/* We use char because int might match the return type of a gcc2
8316 builtin and then its argument prototype would still apply. */ 7352 builtin and then its argument prototype would still apply. */
8317char $ac_func (); 7353char $ac_func ();
7354char (*f) ();
7355
7356int
7357main ()
7358{
8318/* The GNU C library defines this for functions which it implements 7359/* The GNU C library defines this for functions which it implements
8319 to always fail with ENOSYS. Some functions are actually named 7360 to always fail with ENOSYS. Some functions are actually named
8320 something starting with __ and the normal name is an alias. */ 7361 something starting with __ and the normal name is an alias. */
8321#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7362#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8322choke me 7363choke me
8323#else 7364#else
8324char (*f) () = $ac_func; 7365f = $ac_func;
8325#endif
8326#ifdef __cplusplus
8327}
8328#endif 7366#endif
8329 7367
8330int
8331main ()
8332{
8333return f != $ac_func;
8334 ; 7368 ;
8335 return 0; 7369 return 0;
8336} 7370}
8337_ACEOF 7371_ACEOF
8338rm -f conftest.$ac_objext conftest$ac_exeext 7372rm -f conftest.$ac_objext conftest$ac_exeext
8339if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7373if { (eval echo "$as_me:7373: \"$ac_link\"") >&5
8340 (eval $ac_link) 2>&5 7374 (eval $ac_link) 2>&5
8341 ac_status=$? 7375 ac_status=$?
8342 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7376 echo "$as_me:7376: \$? = $ac_status" >&5
8343 (exit $ac_status); } && 7377 (exit $ac_status); } &&
8344 { ac_try='test -s conftest$ac_exeext' 7378 { ac_try='test -s conftest$ac_exeext'
8345 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7379 { (eval echo "$as_me:7379: \"$ac_try\"") >&5
8346 (eval $ac_try) 2>&5 7380 (eval $ac_try) 2>&5
8347 ac_status=$? 7381 ac_status=$?
8348 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7382 echo "$as_me:7382: \$? = $ac_status" >&5
8349 (exit $ac_status); }; }; then 7383 (exit $ac_status); }; }; then
8350 eval "$as_ac_var=yes" 7384 eval "$as_ac_var=yes"
8351else 7385else
8352 echo "$as_me: failed program was:" >&5 7386 echo "$as_me: failed program was:" >&5
8353sed 's/^/| /' conftest.$ac_ext >&5 7387cat conftest.$ac_ext >&5
8354
8355eval "$as_ac_var=no" 7388eval "$as_ac_var=no"
8356fi 7389fi
8357rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7390rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8358fi 7391fi
8359echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7392echo "$as_me:7392: result: `eval echo '${'$as_ac_var'}'`" >&5
8360echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7393echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8361if test `eval echo '${'$as_ac_var'}'` = yes; then 7394if test `eval echo '${'$as_ac_var'}'` = yes; then
8362 cat >>confdefs.h <<_ACEOF 7395 cat >>confdefs.h <<EOF
8363#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7396#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8364_ACEOF 7397EOF
8365 7398
8366fi 7399fi
8367done 7400done
8368 7401
8369
8370
8371
8372
8373
8374for ac_func in endutxent getutxent getutxid getutxline pututxline 7402for ac_func in endutxent getutxent getutxid getutxline pututxline
8375do 7403do
8376as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7404as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8377echo "$as_me:$LINENO: checking for $ac_func" >&5 7405echo "$as_me:7405: checking for $ac_func" >&5
8378echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7406echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8379if eval "test \"\${$as_ac_var+set}\" = set"; then 7407if eval "test \"\${$as_ac_var+set}\" = set"; then
8380 echo $ECHO_N "(cached) $ECHO_C" >&6 7408 echo $ECHO_N "(cached) $ECHO_C" >&6
8381else 7409else
8382 cat >conftest.$ac_ext <<_ACEOF 7410 cat >conftest.$ac_ext <<_ACEOF
8383#line $LINENO "configure" 7411#line 7411 "configure"
8384/* confdefs.h. */ 7412#include "confdefs.h"
8385_ACEOF
8386cat confdefs.h >>conftest.$ac_ext
8387cat >>conftest.$ac_ext <<_ACEOF
8388/* end confdefs.h. */
8389/* System header to define __stub macros and hopefully few prototypes, 7413/* System header to define __stub macros and hopefully few prototypes,
8390 which can conflict with char $ac_func (); below. 7414 which can conflict with char $ac_func (); below. */
8391 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7415#include <assert.h>
8392 <limits.h> exists even on freestanding compilers. */
8393#ifdef __STDC__
8394# include <limits.h>
8395#else
8396# include <assert.h>
8397#endif
8398/* Override any gcc2 internal prototype to avoid an error. */ 7416/* Override any gcc2 internal prototype to avoid an error. */
8399#ifdef __cplusplus 7417#ifdef __cplusplus
8400extern "C" 7418extern "C"
8401{
8402#endif 7419#endif
8403/* We use char because int might match the return type of a gcc2 7420/* We use char because int might match the return type of a gcc2
8404 builtin and then its argument prototype would still apply. */ 7421 builtin and then its argument prototype would still apply. */
8405char $ac_func (); 7422char $ac_func ();
7423char (*f) ();
7424
7425int
7426main ()
7427{
8406/* The GNU C library defines this for functions which it implements 7428/* The GNU C library defines this for functions which it implements
8407 to always fail with ENOSYS. Some functions are actually named 7429 to always fail with ENOSYS. Some functions are actually named
8408 something starting with __ and the normal name is an alias. */ 7430 something starting with __ and the normal name is an alias. */
8409#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7431#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8410choke me 7432choke me
8411#else 7433#else
8412char (*f) () = $ac_func; 7434f = $ac_func;
8413#endif
8414#ifdef __cplusplus
8415}
8416#endif 7435#endif
8417 7436
8418int
8419main ()
8420{
8421return f != $ac_func;
8422 ; 7437 ;
8423 return 0; 7438 return 0;
8424} 7439}
8425_ACEOF 7440_ACEOF
8426rm -f conftest.$ac_objext conftest$ac_exeext 7441rm -f conftest.$ac_objext conftest$ac_exeext
8427if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7442if { (eval echo "$as_me:7442: \"$ac_link\"") >&5
8428 (eval $ac_link) 2>&5 7443 (eval $ac_link) 2>&5
8429 ac_status=$? 7444 ac_status=$?
8430 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7445 echo "$as_me:7445: \$? = $ac_status" >&5
8431 (exit $ac_status); } && 7446 (exit $ac_status); } &&
8432 { ac_try='test -s conftest$ac_exeext' 7447 { ac_try='test -s conftest$ac_exeext'
8433 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7448 { (eval echo "$as_me:7448: \"$ac_try\"") >&5
8434 (eval $ac_try) 2>&5 7449 (eval $ac_try) 2>&5
8435 ac_status=$? 7450 ac_status=$?
8436 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7451 echo "$as_me:7451: \$? = $ac_status" >&5
8437 (exit $ac_status); }; }; then 7452 (exit $ac_status); }; }; then
8438 eval "$as_ac_var=yes" 7453 eval "$as_ac_var=yes"
8439else 7454else
8440 echo "$as_me: failed program was:" >&5 7455 echo "$as_me: failed program was:" >&5
8441sed 's/^/| /' conftest.$ac_ext >&5 7456cat conftest.$ac_ext >&5
8442
8443eval "$as_ac_var=no" 7457eval "$as_ac_var=no"
8444fi 7458fi
8445rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7459rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8446fi 7460fi
8447echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7461echo "$as_me:7461: result: `eval echo '${'$as_ac_var'}'`" >&5
8448echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7462echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8449if test `eval echo '${'$as_ac_var'}'` = yes; then 7463if test `eval echo '${'$as_ac_var'}'` = yes; then
8450 cat >>confdefs.h <<_ACEOF 7464 cat >>confdefs.h <<EOF
8451#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7465#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8452_ACEOF 7466EOF
8453 7467
8454fi 7468fi
8455done 7469done
8456 7470
8457
8458
8459for ac_func in setutxent utmpxname 7471for ac_func in setutxent utmpxname
8460do 7472do
8461as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 7473as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8462echo "$as_me:$LINENO: checking for $ac_func" >&5 7474echo "$as_me:7474: checking for $ac_func" >&5
8463echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 7475echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8464if eval "test \"\${$as_ac_var+set}\" = set"; then 7476if eval "test \"\${$as_ac_var+set}\" = set"; then
8465 echo $ECHO_N "(cached) $ECHO_C" >&6 7477 echo $ECHO_N "(cached) $ECHO_C" >&6
8466else 7478else
8467 cat >conftest.$ac_ext <<_ACEOF 7479 cat >conftest.$ac_ext <<_ACEOF
8468#line $LINENO "configure" 7480#line 7480 "configure"
8469/* confdefs.h. */ 7481#include "confdefs.h"
8470_ACEOF
8471cat confdefs.h >>conftest.$ac_ext
8472cat >>conftest.$ac_ext <<_ACEOF
8473/* end confdefs.h. */
8474/* System header to define __stub macros and hopefully few prototypes, 7482/* System header to define __stub macros and hopefully few prototypes,
8475 which can conflict with char $ac_func (); below. 7483 which can conflict with char $ac_func (); below. */
8476 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7484#include <assert.h>
8477 <limits.h> exists even on freestanding compilers. */
8478#ifdef __STDC__
8479# include <limits.h>
8480#else
8481# include <assert.h>
8482#endif
8483/* Override any gcc2 internal prototype to avoid an error. */ 7485/* Override any gcc2 internal prototype to avoid an error. */
8484#ifdef __cplusplus 7486#ifdef __cplusplus
8485extern "C" 7487extern "C"
8486{
8487#endif 7488#endif
8488/* We use char because int might match the return type of a gcc2 7489/* We use char because int might match the return type of a gcc2
8489 builtin and then its argument prototype would still apply. */ 7490 builtin and then its argument prototype would still apply. */
8490char $ac_func (); 7491char $ac_func ();
7492char (*f) ();
7493
7494int
7495main ()
7496{
8491/* The GNU C library defines this for functions which it implements 7497/* The GNU C library defines this for functions which it implements
8492 to always fail with ENOSYS. Some functions are actually named 7498 to always fail with ENOSYS. Some functions are actually named
8493 something starting with __ and the normal name is an alias. */ 7499 something starting with __ and the normal name is an alias. */
8494#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 7500#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8495choke me 7501choke me
8496#else 7502#else
8497char (*f) () = $ac_func; 7503f = $ac_func;
8498#endif
8499#ifdef __cplusplus
8500}
8501#endif 7504#endif
8502 7505
8503int
8504main ()
8505{
8506return f != $ac_func;
8507 ; 7506 ;
8508 return 0; 7507 return 0;
8509} 7508}
8510_ACEOF 7509_ACEOF
8511rm -f conftest.$ac_objext conftest$ac_exeext 7510rm -f conftest.$ac_objext conftest$ac_exeext
8512if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7511if { (eval echo "$as_me:7511: \"$ac_link\"") >&5
8513 (eval $ac_link) 2>&5 7512 (eval $ac_link) 2>&5
8514 ac_status=$? 7513 ac_status=$?
8515 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7514 echo "$as_me:7514: \$? = $ac_status" >&5
8516 (exit $ac_status); } && 7515 (exit $ac_status); } &&
8517 { ac_try='test -s conftest$ac_exeext' 7516 { ac_try='test -s conftest$ac_exeext'
8518 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7517 { (eval echo "$as_me:7517: \"$ac_try\"") >&5
8519 (eval $ac_try) 2>&5 7518 (eval $ac_try) 2>&5
8520 ac_status=$? 7519 ac_status=$?
8521 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7520 echo "$as_me:7520: \$? = $ac_status" >&5
8522 (exit $ac_status); }; }; then 7521 (exit $ac_status); }; }; then
8523 eval "$as_ac_var=yes" 7522 eval "$as_ac_var=yes"
8524else 7523else
8525 echo "$as_me: failed program was:" >&5 7524 echo "$as_me: failed program was:" >&5
8526sed 's/^/| /' conftest.$ac_ext >&5 7525cat conftest.$ac_ext >&5
8527
8528eval "$as_ac_var=no" 7526eval "$as_ac_var=no"
8529fi 7527fi
8530rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7528rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8531fi 7529fi
8532echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 7530echo "$as_me:7530: result: `eval echo '${'$as_ac_var'}'`" >&5
8533echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 7531echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8534if test `eval echo '${'$as_ac_var'}'` = yes; then 7532if test `eval echo '${'$as_ac_var'}'` = yes; then
8535 cat >>confdefs.h <<_ACEOF 7533 cat >>confdefs.h <<EOF
8536#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 7534#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8537_ACEOF 7535EOF
8538 7536
8539fi 7537fi
8540done 7538done
8541 7539
8542 7540echo "$as_me:7540: checking for daemon" >&5
8543echo "$as_me:$LINENO: checking for daemon" >&5
8544echo $ECHO_N "checking for daemon... $ECHO_C" >&6 7541echo $ECHO_N "checking for daemon... $ECHO_C" >&6
8545if test "${ac_cv_func_daemon+set}" = set; then 7542if test "${ac_cv_func_daemon+set}" = set; then
8546 echo $ECHO_N "(cached) $ECHO_C" >&6 7543 echo $ECHO_N "(cached) $ECHO_C" >&6
8547else 7544else
8548 cat >conftest.$ac_ext <<_ACEOF 7545 cat >conftest.$ac_ext <<_ACEOF
8549#line $LINENO "configure" 7546#line 7546 "configure"
8550/* confdefs.h. */ 7547#include "confdefs.h"
8551_ACEOF
8552cat confdefs.h >>conftest.$ac_ext
8553cat >>conftest.$ac_ext <<_ACEOF
8554/* end confdefs.h. */
8555/* System header to define __stub macros and hopefully few prototypes, 7548/* System header to define __stub macros and hopefully few prototypes,
8556 which can conflict with char daemon (); below. 7549 which can conflict with char daemon (); below. */
8557 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7550#include <assert.h>
8558 <limits.h> exists even on freestanding compilers. */
8559#ifdef __STDC__
8560# include <limits.h>
8561#else
8562# include <assert.h>
8563#endif
8564/* Override any gcc2 internal prototype to avoid an error. */ 7551/* Override any gcc2 internal prototype to avoid an error. */
8565#ifdef __cplusplus 7552#ifdef __cplusplus
8566extern "C" 7553extern "C"
8567{
8568#endif 7554#endif
8569/* We use char because int might match the return type of a gcc2 7555/* We use char because int might match the return type of a gcc2
8570 builtin and then its argument prototype would still apply. */ 7556 builtin and then its argument prototype would still apply. */
8571char daemon (); 7557char daemon ();
7558char (*f) ();
7559
7560int
7561main ()
7562{
8572/* The GNU C library defines this for functions which it implements 7563/* The GNU C library defines this for functions which it implements
8573 to always fail with ENOSYS. Some functions are actually named 7564 to always fail with ENOSYS. Some functions are actually named
8574 something starting with __ and the normal name is an alias. */ 7565 something starting with __ and the normal name is an alias. */
8575#if defined (__stub_daemon) || defined (__stub___daemon) 7566#if defined (__stub_daemon) || defined (__stub___daemon)
8576choke me 7567choke me
8577#else 7568#else
8578char (*f) () = daemon; 7569f = daemon;
8579#endif
8580#ifdef __cplusplus
8581}
8582#endif 7570#endif
8583 7571
8584int
8585main ()
8586{
8587return f != daemon;
8588 ; 7572 ;
8589 return 0; 7573 return 0;
8590} 7574}
8591_ACEOF 7575_ACEOF
8592rm -f conftest.$ac_objext conftest$ac_exeext 7576rm -f conftest.$ac_objext conftest$ac_exeext
8593if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7577if { (eval echo "$as_me:7577: \"$ac_link\"") >&5
8594 (eval $ac_link) 2>&5 7578 (eval $ac_link) 2>&5
8595 ac_status=$? 7579 ac_status=$?
8596 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7580 echo "$as_me:7580: \$? = $ac_status" >&5
8597 (exit $ac_status); } && 7581 (exit $ac_status); } &&
8598 { ac_try='test -s conftest$ac_exeext' 7582 { ac_try='test -s conftest$ac_exeext'
8599 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7583 { (eval echo "$as_me:7583: \"$ac_try\"") >&5
8600 (eval $ac_try) 2>&5 7584 (eval $ac_try) 2>&5
8601 ac_status=$? 7585 ac_status=$?
8602 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7586 echo "$as_me:7586: \$? = $ac_status" >&5
8603 (exit $ac_status); }; }; then 7587 (exit $ac_status); }; }; then
8604 ac_cv_func_daemon=yes 7588 ac_cv_func_daemon=yes
8605else 7589else
8606 echo "$as_me: failed program was:" >&5 7590 echo "$as_me: failed program was:" >&5
8607sed 's/^/| /' conftest.$ac_ext >&5 7591cat conftest.$ac_ext >&5
8608
8609ac_cv_func_daemon=no 7592ac_cv_func_daemon=no
8610fi 7593fi
8611rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7594rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8612fi 7595fi
8613echo "$as_me:$LINENO: result: $ac_cv_func_daemon" >&5 7596echo "$as_me:7596: result: $ac_cv_func_daemon" >&5
8614echo "${ECHO_T}$ac_cv_func_daemon" >&6 7597echo "${ECHO_T}$ac_cv_func_daemon" >&6
8615if test $ac_cv_func_daemon = yes; then 7598if test $ac_cv_func_daemon = yes; then
8616 cat >>confdefs.h <<\_ACEOF 7599 cat >>confdefs.h <<\EOF
8617#define HAVE_DAEMON 1 7600#define HAVE_DAEMON 1
8618_ACEOF 7601EOF
8619 7602
8620else 7603else
8621 echo "$as_me:$LINENO: checking for daemon in -lbsd" >&5 7604 echo "$as_me:7604: checking for daemon in -lbsd" >&5
8622echo $ECHO_N "checking for daemon in -lbsd... $ECHO_C" >&6 7605echo $ECHO_N "checking for daemon in -lbsd... $ECHO_C" >&6
8623if test "${ac_cv_lib_bsd_daemon+set}" = set; then 7606if test "${ac_cv_lib_bsd_daemon+set}" = set; then
8624 echo $ECHO_N "(cached) $ECHO_C" >&6 7607 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8626,12 +7609,8 @@ else
8626 ac_check_lib_save_LIBS=$LIBS 7609 ac_check_lib_save_LIBS=$LIBS
8627LIBS="-lbsd $LIBS" 7610LIBS="-lbsd $LIBS"
8628cat >conftest.$ac_ext <<_ACEOF 7611cat >conftest.$ac_ext <<_ACEOF
8629#line $LINENO "configure" 7612#line 7612 "configure"
8630/* confdefs.h. */ 7613#include "confdefs.h"
8631_ACEOF
8632cat confdefs.h >>conftest.$ac_ext
8633cat >>conftest.$ac_ext <<_ACEOF
8634/* end confdefs.h. */
8635 7614
8636/* Override any gcc2 internal prototype to avoid an error. */ 7615/* Override any gcc2 internal prototype to avoid an error. */
8637#ifdef __cplusplus 7616#ifdef __cplusplus
@@ -8649,119 +7628,102 @@ daemon ();
8649} 7628}
8650_ACEOF 7629_ACEOF
8651rm -f conftest.$ac_objext conftest$ac_exeext 7630rm -f conftest.$ac_objext conftest$ac_exeext
8652if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7631if { (eval echo "$as_me:7631: \"$ac_link\"") >&5
8653 (eval $ac_link) 2>&5 7632 (eval $ac_link) 2>&5
8654 ac_status=$? 7633 ac_status=$?
8655 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7634 echo "$as_me:7634: \$? = $ac_status" >&5
8656 (exit $ac_status); } && 7635 (exit $ac_status); } &&
8657 { ac_try='test -s conftest$ac_exeext' 7636 { ac_try='test -s conftest$ac_exeext'
8658 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7637 { (eval echo "$as_me:7637: \"$ac_try\"") >&5
8659 (eval $ac_try) 2>&5 7638 (eval $ac_try) 2>&5
8660 ac_status=$? 7639 ac_status=$?
8661 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7640 echo "$as_me:7640: \$? = $ac_status" >&5
8662 (exit $ac_status); }; }; then 7641 (exit $ac_status); }; }; then
8663 ac_cv_lib_bsd_daemon=yes 7642 ac_cv_lib_bsd_daemon=yes
8664else 7643else
8665 echo "$as_me: failed program was:" >&5 7644 echo "$as_me: failed program was:" >&5
8666sed 's/^/| /' conftest.$ac_ext >&5 7645cat conftest.$ac_ext >&5
8667
8668ac_cv_lib_bsd_daemon=no 7646ac_cv_lib_bsd_daemon=no
8669fi 7647fi
8670rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7648rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8671LIBS=$ac_check_lib_save_LIBS 7649LIBS=$ac_check_lib_save_LIBS
8672fi 7650fi
8673echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_daemon" >&5 7651echo "$as_me:7651: result: $ac_cv_lib_bsd_daemon" >&5
8674echo "${ECHO_T}$ac_cv_lib_bsd_daemon" >&6 7652echo "${ECHO_T}$ac_cv_lib_bsd_daemon" >&6
8675if test $ac_cv_lib_bsd_daemon = yes; then 7653if test $ac_cv_lib_bsd_daemon = yes; then
8676 LIBS="$LIBS -lbsd"; cat >>confdefs.h <<\_ACEOF 7654 LIBS="$LIBS -lbsd"; cat >>confdefs.h <<\EOF
8677#define HAVE_DAEMON 1 7655#define HAVE_DAEMON 1
8678_ACEOF 7656EOF
8679 7657
8680fi 7658fi
8681 7659
8682
8683fi 7660fi
8684 7661
8685 7662echo "$as_me:7662: checking for getpagesize" >&5
8686echo "$as_me:$LINENO: checking for getpagesize" >&5
8687echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6 7663echo $ECHO_N "checking for getpagesize... $ECHO_C" >&6
8688if test "${ac_cv_func_getpagesize+set}" = set; then 7664if test "${ac_cv_func_getpagesize+set}" = set; then
8689 echo $ECHO_N "(cached) $ECHO_C" >&6 7665 echo $ECHO_N "(cached) $ECHO_C" >&6
8690else 7666else
8691 cat >conftest.$ac_ext <<_ACEOF 7667 cat >conftest.$ac_ext <<_ACEOF
8692#line $LINENO "configure" 7668#line 7668 "configure"
8693/* confdefs.h. */ 7669#include "confdefs.h"
8694_ACEOF
8695cat confdefs.h >>conftest.$ac_ext
8696cat >>conftest.$ac_ext <<_ACEOF
8697/* end confdefs.h. */
8698/* System header to define __stub macros and hopefully few prototypes, 7670/* System header to define __stub macros and hopefully few prototypes,
8699 which can conflict with char getpagesize (); below. 7671 which can conflict with char getpagesize (); below. */
8700 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 7672#include <assert.h>
8701 <limits.h> exists even on freestanding compilers. */
8702#ifdef __STDC__
8703# include <limits.h>
8704#else
8705# include <assert.h>
8706#endif
8707/* Override any gcc2 internal prototype to avoid an error. */ 7673/* Override any gcc2 internal prototype to avoid an error. */
8708#ifdef __cplusplus 7674#ifdef __cplusplus
8709extern "C" 7675extern "C"
8710{
8711#endif 7676#endif
8712/* We use char because int might match the return type of a gcc2 7677/* We use char because int might match the return type of a gcc2
8713 builtin and then its argument prototype would still apply. */ 7678 builtin and then its argument prototype would still apply. */
8714char getpagesize (); 7679char getpagesize ();
7680char (*f) ();
7681
7682int
7683main ()
7684{
8715/* The GNU C library defines this for functions which it implements 7685/* The GNU C library defines this for functions which it implements
8716 to always fail with ENOSYS. Some functions are actually named 7686 to always fail with ENOSYS. Some functions are actually named
8717 something starting with __ and the normal name is an alias. */ 7687 something starting with __ and the normal name is an alias. */
8718#if defined (__stub_getpagesize) || defined (__stub___getpagesize) 7688#if defined (__stub_getpagesize) || defined (__stub___getpagesize)
8719choke me 7689choke me
8720#else 7690#else
8721char (*f) () = getpagesize; 7691f = getpagesize;
8722#endif
8723#ifdef __cplusplus
8724}
8725#endif 7692#endif
8726 7693
8727int
8728main ()
8729{
8730return f != getpagesize;
8731 ; 7694 ;
8732 return 0; 7695 return 0;
8733} 7696}
8734_ACEOF 7697_ACEOF
8735rm -f conftest.$ac_objext conftest$ac_exeext 7698rm -f conftest.$ac_objext conftest$ac_exeext
8736if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7699if { (eval echo "$as_me:7699: \"$ac_link\"") >&5
8737 (eval $ac_link) 2>&5 7700 (eval $ac_link) 2>&5
8738 ac_status=$? 7701 ac_status=$?
8739 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7702 echo "$as_me:7702: \$? = $ac_status" >&5
8740 (exit $ac_status); } && 7703 (exit $ac_status); } &&
8741 { ac_try='test -s conftest$ac_exeext' 7704 { ac_try='test -s conftest$ac_exeext'
8742 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7705 { (eval echo "$as_me:7705: \"$ac_try\"") >&5
8743 (eval $ac_try) 2>&5 7706 (eval $ac_try) 2>&5
8744 ac_status=$? 7707 ac_status=$?
8745 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7708 echo "$as_me:7708: \$? = $ac_status" >&5
8746 (exit $ac_status); }; }; then 7709 (exit $ac_status); }; }; then
8747 ac_cv_func_getpagesize=yes 7710 ac_cv_func_getpagesize=yes
8748else 7711else
8749 echo "$as_me: failed program was:" >&5 7712 echo "$as_me: failed program was:" >&5
8750sed 's/^/| /' conftest.$ac_ext >&5 7713cat conftest.$ac_ext >&5
8751
8752ac_cv_func_getpagesize=no 7714ac_cv_func_getpagesize=no
8753fi 7715fi
8754rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7716rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8755fi 7717fi
8756echo "$as_me:$LINENO: result: $ac_cv_func_getpagesize" >&5 7718echo "$as_me:7718: result: $ac_cv_func_getpagesize" >&5
8757echo "${ECHO_T}$ac_cv_func_getpagesize" >&6 7719echo "${ECHO_T}$ac_cv_func_getpagesize" >&6
8758if test $ac_cv_func_getpagesize = yes; then 7720if test $ac_cv_func_getpagesize = yes; then
8759 cat >>confdefs.h <<\_ACEOF 7721 cat >>confdefs.h <<\EOF
8760#define HAVE_GETPAGESIZE 1 7722#define HAVE_GETPAGESIZE 1
8761_ACEOF 7723EOF
8762 7724
8763else 7725else
8764 echo "$as_me:$LINENO: checking for getpagesize in -lucb" >&5 7726 echo "$as_me:7726: checking for getpagesize in -lucb" >&5
8765echo $ECHO_N "checking for getpagesize in -lucb... $ECHO_C" >&6 7727echo $ECHO_N "checking for getpagesize in -lucb... $ECHO_C" >&6
8766if test "${ac_cv_lib_ucb_getpagesize+set}" = set; then 7728if test "${ac_cv_lib_ucb_getpagesize+set}" = set; then
8767 echo $ECHO_N "(cached) $ECHO_C" >&6 7729 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -8769,12 +7731,8 @@ else
8769 ac_check_lib_save_LIBS=$LIBS 7731 ac_check_lib_save_LIBS=$LIBS
8770LIBS="-lucb $LIBS" 7732LIBS="-lucb $LIBS"
8771cat >conftest.$ac_ext <<_ACEOF 7733cat >conftest.$ac_ext <<_ACEOF
8772#line $LINENO "configure" 7734#line 7734 "configure"
8773/* confdefs.h. */ 7735#include "confdefs.h"
8774_ACEOF
8775cat confdefs.h >>conftest.$ac_ext
8776cat >>conftest.$ac_ext <<_ACEOF
8777/* end confdefs.h. */
8778 7736
8779/* Override any gcc2 internal prototype to avoid an error. */ 7737/* Override any gcc2 internal prototype to avoid an error. */
8780#ifdef __cplusplus 7738#ifdef __cplusplus
@@ -8792,119 +7750,101 @@ getpagesize ();
8792} 7750}
8793_ACEOF 7751_ACEOF
8794rm -f conftest.$ac_objext conftest$ac_exeext 7752rm -f conftest.$ac_objext conftest$ac_exeext
8795if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7753if { (eval echo "$as_me:7753: \"$ac_link\"") >&5
8796 (eval $ac_link) 2>&5 7754 (eval $ac_link) 2>&5
8797 ac_status=$? 7755 ac_status=$?
8798 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7756 echo "$as_me:7756: \$? = $ac_status" >&5
8799 (exit $ac_status); } && 7757 (exit $ac_status); } &&
8800 { ac_try='test -s conftest$ac_exeext' 7758 { ac_try='test -s conftest$ac_exeext'
8801 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7759 { (eval echo "$as_me:7759: \"$ac_try\"") >&5
8802 (eval $ac_try) 2>&5 7760 (eval $ac_try) 2>&5
8803 ac_status=$? 7761 ac_status=$?
8804 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7762 echo "$as_me:7762: \$? = $ac_status" >&5
8805 (exit $ac_status); }; }; then 7763 (exit $ac_status); }; }; then
8806 ac_cv_lib_ucb_getpagesize=yes 7764 ac_cv_lib_ucb_getpagesize=yes
8807else 7765else
8808 echo "$as_me: failed program was:" >&5 7766 echo "$as_me: failed program was:" >&5
8809sed 's/^/| /' conftest.$ac_ext >&5 7767cat conftest.$ac_ext >&5
8810
8811ac_cv_lib_ucb_getpagesize=no 7768ac_cv_lib_ucb_getpagesize=no
8812fi 7769fi
8813rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 7770rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8814LIBS=$ac_check_lib_save_LIBS 7771LIBS=$ac_check_lib_save_LIBS
8815fi 7772fi
8816echo "$as_me:$LINENO: result: $ac_cv_lib_ucb_getpagesize" >&5 7773echo "$as_me:7773: result: $ac_cv_lib_ucb_getpagesize" >&5
8817echo "${ECHO_T}$ac_cv_lib_ucb_getpagesize" >&6 7774echo "${ECHO_T}$ac_cv_lib_ucb_getpagesize" >&6
8818if test $ac_cv_lib_ucb_getpagesize = yes; then 7775if test $ac_cv_lib_ucb_getpagesize = yes; then
8819 LIBS="$LIBS -lucb"; cat >>confdefs.h <<\_ACEOF 7776 LIBS="$LIBS -lucb"; cat >>confdefs.h <<\EOF
8820#define HAVE_GETPAGESIZE 1 7777#define HAVE_GETPAGESIZE 1
8821_ACEOF 7778EOF
8822 7779
8823fi 7780fi
8824 7781
8825
8826fi 7782fi
8827 7783
8828
8829# Check for broken snprintf 7784# Check for broken snprintf
8830if test "x$ac_cv_func_snprintf" = "xyes" ; then 7785if test "x$ac_cv_func_snprintf" = "xyes" ; then
8831 echo "$as_me:$LINENO: checking whether snprintf correctly terminates long strings" >&5 7786 echo "$as_me:7786: checking whether snprintf correctly terminates long strings" >&5
8832echo $ECHO_N "checking whether snprintf correctly terminates long strings... $ECHO_C" >&6 7787echo $ECHO_N "checking whether snprintf correctly terminates long strings... $ECHO_C" >&6
8833 if test "$cross_compiling" = yes; then 7788 if test "$cross_compiling" = yes; then
8834 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 7789 { { echo "$as_me:7789: error: cannot run test program while cross compiling" >&5
8835See \`config.log' for more details." >&5 7790echo "$as_me: error: cannot run test program while cross compiling" >&2;}
8836echo "$as_me: error: cannot run test program while cross compiling
8837See \`config.log' for more details." >&2;}
8838 { (exit 1); exit 1; }; } 7791 { (exit 1); exit 1; }; }
8839else 7792else
8840 cat >conftest.$ac_ext <<_ACEOF 7793 cat >conftest.$ac_ext <<_ACEOF
8841#line $LINENO "configure" 7794#line 7794 "configure"
8842/* confdefs.h. */ 7795#include "confdefs.h"
8843_ACEOF
8844cat confdefs.h >>conftest.$ac_ext
8845cat >>conftest.$ac_ext <<_ACEOF
8846/* end confdefs.h. */
8847 7796
8848#include <stdio.h> 7797#include <stdio.h>
8849int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');} 7798int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
8850 7799
8851_ACEOF 7800_ACEOF
8852rm -f conftest$ac_exeext 7801rm -f conftest$ac_exeext
8853if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7802if { (eval echo "$as_me:7802: \"$ac_link\"") >&5
8854 (eval $ac_link) 2>&5 7803 (eval $ac_link) 2>&5
8855 ac_status=$? 7804 ac_status=$?
8856 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7805 echo "$as_me:7805: \$? = $ac_status" >&5
8857 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 7806 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8858 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7807 { (eval echo "$as_me:7807: \"$ac_try\"") >&5
8859 (eval $ac_try) 2>&5 7808 (eval $ac_try) 2>&5
8860 ac_status=$? 7809 ac_status=$?
8861 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7810 echo "$as_me:7810: \$? = $ac_status" >&5
8862 (exit $ac_status); }; }; then 7811 (exit $ac_status); }; }; then
8863 echo "$as_me:$LINENO: result: yes" >&5 7812 echo "$as_me:7812: result: yes" >&5
8864echo "${ECHO_T}yes" >&6 7813echo "${ECHO_T}yes" >&6
8865else 7814else
8866 echo "$as_me: program exited with status $ac_status" >&5 7815 echo "$as_me: program exited with status $ac_status" >&5
8867echo "$as_me: failed program was:" >&5 7816echo "$as_me: failed program was:" >&5
8868sed 's/^/| /' conftest.$ac_ext >&5 7817cat conftest.$ac_ext >&5
8869
8870( exit $ac_status )
8871 7818
8872 echo "$as_me:$LINENO: result: no" >&5 7819 echo "$as_me:7819: result: no" >&5
8873echo "${ECHO_T}no" >&6 7820echo "${ECHO_T}no" >&6
8874 cat >>confdefs.h <<\_ACEOF 7821 cat >>confdefs.h <<\EOF
8875#define BROKEN_SNPRINTF 1 7822#define BROKEN_SNPRINTF 1
8876_ACEOF 7823EOF
8877 7824
8878 { echo "$as_me:$LINENO: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5 7825 { echo "$as_me:7825: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&5
8879echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;} 7826echo "$as_me: WARNING: ****** Your snprintf() function is broken, complain to your vendor" >&2;}
8880 7827
8881
8882fi 7828fi
8883rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 7829rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8884fi 7830fi
8885fi 7831fi
8886 7832
8887if test "x$ac_cv_func_mkdtemp" = "xyes" ; then 7833if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
8888echo "$as_me:$LINENO: checking for (overly) strict mkstemp" >&5 7834echo "$as_me:7834: checking for (overly) strict mkstemp" >&5
8889echo $ECHO_N "checking for (overly) strict mkstemp... $ECHO_C" >&6 7835echo $ECHO_N "checking for (overly) strict mkstemp... $ECHO_C" >&6
8890if test "$cross_compiling" = yes; then 7836if test "$cross_compiling" = yes; then
8891 7837
8892 echo "$as_me:$LINENO: result: yes" >&5 7838 echo "$as_me:7838: result: yes" >&5
8893echo "${ECHO_T}yes" >&6 7839echo "${ECHO_T}yes" >&6
8894 cat >>confdefs.h <<\_ACEOF 7840 cat >>confdefs.h <<\EOF
8895#define HAVE_STRICT_MKSTEMP 1 7841#define HAVE_STRICT_MKSTEMP 1
8896_ACEOF 7842EOF
8897
8898
8899 7843
8900else 7844else
8901 cat >conftest.$ac_ext <<_ACEOF 7845 cat >conftest.$ac_ext <<_ACEOF
8902#line $LINENO "configure" 7846#line 7846 "configure"
8903/* confdefs.h. */ 7847#include "confdefs.h"
8904_ACEOF
8905cat confdefs.h >>conftest.$ac_ext
8906cat >>conftest.$ac_ext <<_ACEOF
8907/* end confdefs.h. */
8908 7848
8909#include <stdlib.h> 7849#include <stdlib.h>
8910main() { char template[]="conftest.mkstemp-test"; 7850main() { char template[]="conftest.mkstemp-test";
@@ -8915,52 +7855,121 @@ unlink(template); exit(0);
8915 7855
8916_ACEOF 7856_ACEOF
8917rm -f conftest$ac_exeext 7857rm -f conftest$ac_exeext
8918if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 7858if { (eval echo "$as_me:7858: \"$ac_link\"") >&5
8919 (eval $ac_link) 2>&5 7859 (eval $ac_link) 2>&5
8920 ac_status=$? 7860 ac_status=$?
8921 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7861 echo "$as_me:7861: \$? = $ac_status" >&5
8922 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 7862 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8923 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7863 { (eval echo "$as_me:7863: \"$ac_try\"") >&5
8924 (eval $ac_try) 2>&5 7864 (eval $ac_try) 2>&5
8925 ac_status=$? 7865 ac_status=$?
8926 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7866 echo "$as_me:7866: \$? = $ac_status" >&5
8927 (exit $ac_status); }; }; then 7867 (exit $ac_status); }; }; then
8928 7868
8929 echo "$as_me:$LINENO: result: no" >&5 7869 echo "$as_me:7869: result: no" >&5
8930echo "${ECHO_T}no" >&6 7870echo "${ECHO_T}no" >&6
8931 7871
8932else 7872else
8933 echo "$as_me: program exited with status $ac_status" >&5 7873 echo "$as_me: program exited with status $ac_status" >&5
8934echo "$as_me: failed program was:" >&5 7874echo "$as_me: failed program was:" >&5
8935sed 's/^/| /' conftest.$ac_ext >&5 7875cat conftest.$ac_ext >&5
8936 7876
8937( exit $ac_status ) 7877 echo "$as_me:7877: result: yes" >&5
8938
8939 echo "$as_me:$LINENO: result: yes" >&5
8940echo "${ECHO_T}yes" >&6 7878echo "${ECHO_T}yes" >&6
8941 cat >>confdefs.h <<\_ACEOF 7879 cat >>confdefs.h <<\EOF
8942#define HAVE_STRICT_MKSTEMP 1 7880#define HAVE_STRICT_MKSTEMP 1
7881EOF
7882
7883fi
7884rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7885fi
7886fi
7887
7888if test ! -z "$check_for_openpty_ctty_bug"; then
7889 echo "$as_me:7889: checking if openpty correctly handles controlling tty" >&5
7890echo $ECHO_N "checking if openpty correctly handles controlling tty... $ECHO_C" >&6
7891 if test "$cross_compiling" = yes; then
7892 { { echo "$as_me:7892: error: cannot run test program while cross compiling" >&5
7893echo "$as_me: error: cannot run test program while cross compiling" >&2;}
7894 { (exit 1); exit 1; }; }
7895else
7896 cat >conftest.$ac_ext <<_ACEOF
7897#line 7897 "configure"
7898#include "confdefs.h"
7899
7900#include <stdio.h>
7901#include <sys/fcntl.h>
7902#include <sys/types.h>
7903#include <sys/wait.h>
7904
7905int
7906main()
7907{
7908 pid_t pid;
7909 int fd, ptyfd, ttyfd, status;
7910
7911 pid = fork();
7912 if (pid < 0) { /* failed */
7913 exit(1);
7914 } else if (pid > 0) { /* parent */
7915 waitpid(pid, &status, 0);
7916 if (WIFEXITED(status))
7917 exit(WEXITSTATUS(status));
7918 else
7919 exit(2);
7920 } else { /* child */
7921 close(0); close(1); close(2);
7922 setsid();
7923 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
7924 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
7925 if (fd >= 0)
7926 exit(3); /* Acquired ctty: broken */
7927 else
7928 exit(0); /* Did not acquire ctty: OK */
7929 }
7930}
7931
8943_ACEOF 7932_ACEOF
7933rm -f conftest$ac_exeext
7934if { (eval echo "$as_me:7934: \"$ac_link\"") >&5
7935 (eval $ac_link) 2>&5
7936 ac_status=$?
7937 echo "$as_me:7937: \$? = $ac_status" >&5
7938 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7939 { (eval echo "$as_me:7939: \"$ac_try\"") >&5
7940 (eval $ac_try) 2>&5
7941 ac_status=$?
7942 echo "$as_me:7942: \$? = $ac_status" >&5
7943 (exit $ac_status); }; }; then
7944
7945 echo "$as_me:7945: result: yes" >&5
7946echo "${ECHO_T}yes" >&6
8944 7947
7948else
7949 echo "$as_me: program exited with status $ac_status" >&5
7950echo "$as_me: failed program was:" >&5
7951cat conftest.$ac_ext >&5
7952
7953 echo "$as_me:7953: result: no" >&5
7954echo "${ECHO_T}no" >&6
7955 cat >>confdefs.h <<\EOF
7956#define SSHD_ACQUIRES_CTTY 1
7957EOF
8945 7958
8946fi 7959fi
8947rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 7960rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8948fi 7961fi
8949fi 7962fi
8950 7963
8951echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 7964echo "$as_me:7964: checking whether getpgrp takes no argument" >&5
8952echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6 7965echo $ECHO_N "checking whether getpgrp takes no argument... $ECHO_C" >&6
8953if test "${ac_cv_func_getpgrp_void+set}" = set; then 7966if test "${ac_cv_func_getpgrp_void+set}" = set; then
8954 echo $ECHO_N "(cached) $ECHO_C" >&6 7967 echo $ECHO_N "(cached) $ECHO_C" >&6
8955else 7968else
8956 # Use it with a single arg. 7969 # Use it with a single arg.
8957cat >conftest.$ac_ext <<_ACEOF 7970cat >conftest.$ac_ext <<_ACEOF
8958#line $LINENO "configure" 7971#line 7971 "configure"
8959/* confdefs.h. */ 7972#include "confdefs.h"
8960_ACEOF
8961cat confdefs.h >>conftest.$ac_ext
8962cat >>conftest.$ac_ext <<_ACEOF
8963/* end confdefs.h. */
8964$ac_includes_default 7973$ac_includes_default
8965int 7974int
8966main () 7975main ()
@@ -8971,38 +7980,152 @@ getpgrp (0);
8971} 7980}
8972_ACEOF 7981_ACEOF
8973rm -f conftest.$ac_objext 7982rm -f conftest.$ac_objext
8974if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 7983if { (eval echo "$as_me:7983: \"$ac_compile\"") >&5
8975 (eval $ac_compile) 2>&5 7984 (eval $ac_compile) 2>&5
8976 ac_status=$? 7985 ac_status=$?
8977 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7986 echo "$as_me:7986: \$? = $ac_status" >&5
8978 (exit $ac_status); } && 7987 (exit $ac_status); } &&
8979 { ac_try='test -s conftest.$ac_objext' 7988 { ac_try='test -s conftest.$ac_objext'
8980 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 7989 { (eval echo "$as_me:7989: \"$ac_try\"") >&5
8981 (eval $ac_try) 2>&5 7990 (eval $ac_try) 2>&5
8982 ac_status=$? 7991 ac_status=$?
8983 echo "$as_me:$LINENO: \$? = $ac_status" >&5 7992 echo "$as_me:7992: \$? = $ac_status" >&5
8984 (exit $ac_status); }; }; then 7993 (exit $ac_status); }; }; then
8985 ac_cv_func_getpgrp_void=no 7994 ac_func_getpgrp_1=yes
8986else 7995else
8987 echo "$as_me: failed program was:" >&5 7996 echo "$as_me: failed program was:" >&5
8988sed 's/^/| /' conftest.$ac_ext >&5 7997cat conftest.$ac_ext >&5
8989 7998ac_func_getpgrp_1=no
8990ac_cv_func_getpgrp_void=yes 7999fi
8000rm -f conftest.$ac_objext conftest.$ac_ext
8001# Use it with no arg.
8002cat >conftest.$ac_ext <<_ACEOF
8003#line 8003 "configure"
8004#include "confdefs.h"
8005$ac_includes_default
8006int
8007main ()
8008{
8009getpgrp ();
8010 ;
8011 return 0;
8012}
8013_ACEOF
8014rm -f conftest.$ac_objext
8015if { (eval echo "$as_me:8015: \"$ac_compile\"") >&5
8016 (eval $ac_compile) 2>&5
8017 ac_status=$?
8018 echo "$as_me:8018: \$? = $ac_status" >&5
8019 (exit $ac_status); } &&
8020 { ac_try='test -s conftest.$ac_objext'
8021 { (eval echo "$as_me:8021: \"$ac_try\"") >&5
8022 (eval $ac_try) 2>&5
8023 ac_status=$?
8024 echo "$as_me:8024: \$? = $ac_status" >&5
8025 (exit $ac_status); }; }; then
8026 ac_func_getpgrp_0=yes
8027else
8028 echo "$as_me: failed program was:" >&5
8029cat conftest.$ac_ext >&5
8030ac_func_getpgrp_0=no
8991fi 8031fi
8992rm -f conftest.$ac_objext conftest.$ac_ext 8032rm -f conftest.$ac_objext conftest.$ac_ext
8033# If both static checks agree, we are done.
8034case $ac_func_getpgrp_0:$ac_func_getpgrp_1 in
8035 yes:no) ac_cv_func_getpgrp_void=yes;;
8036 no:yes) ac_cv_func_getpgrp_void=false;;
8037 *) if test "$cross_compiling" = yes; then
8038 { { echo "$as_me:8038: error: cannot check getpgrp if cross compiling" >&5
8039echo "$as_me: error: cannot check getpgrp if cross compiling" >&2;}
8040 { (exit 1); exit 1; }; }
8041else
8042 cat >conftest.$ac_ext <<_ACEOF
8043#line 8043 "configure"
8044#include "confdefs.h"
8045$ac_includes_default
8046
8047/*
8048 * If this system has a BSD-style getpgrp(),
8049 * which takes a pid argument, exit unsuccessfully.
8050 *
8051 * Snarfed from Chet Ramey's bash pgrp.c test program
8052 */
8053
8054int pid;
8055int pg1, pg2, pg3, pg4;
8056int ng, np, s, child;
8057
8058int
8059main ()
8060{
8061 pid = getpid ();
8062 pg1 = getpgrp (0);
8063 pg2 = getpgrp ();
8064 pg3 = getpgrp (pid);
8065 pg4 = getpgrp (1);
8066
8067 /* If all of these values are the same, it's pretty sure that we're
8068 on a system that ignores getpgrp's first argument. */
8069 if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
8070 exit (0);
8071
8072 child = fork ();
8073 if (child < 0)
8074 exit(1);
8075 else if (child == 0)
8076 {
8077 np = getpid ();
8078 /* If this is Sys V, this will not work; pgrp will be set to np
8079 because setpgrp just changes a pgrp to be the same as the
8080 pid. */
8081 setpgrp (np, pg1);
8082 ng = getpgrp (0); /* Same result for Sys V and BSD */
8083 if (ng == pg1)
8084 exit (1);
8085 else
8086 exit (0);
8087 }
8088 else
8089 {
8090 wait (&s);
8091 exit (s>>8);
8092 }
8093}
8094
8095_ACEOF
8096rm -f conftest$ac_exeext
8097if { (eval echo "$as_me:8097: \"$ac_link\"") >&5
8098 (eval $ac_link) 2>&5
8099 ac_status=$?
8100 echo "$as_me:8100: \$? = $ac_status" >&5
8101 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8102 { (eval echo "$as_me:8102: \"$ac_try\"") >&5
8103 (eval $ac_try) 2>&5
8104 ac_status=$?
8105 echo "$as_me:8105: \$? = $ac_status" >&5
8106 (exit $ac_status); }; }; then
8107 ac_cv_func_getpgrp_void=yes
8108else
8109 echo "$as_me: program exited with status $ac_status" >&5
8110echo "$as_me: failed program was:" >&5
8111cat conftest.$ac_ext >&5
8112ac_cv_func_getpgrp_void=no
8113fi
8114rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8115fi;;
8116esac # $ac_func_getpgrp_0:$ac_func_getpgrp_1
8993 8117
8994fi 8118fi
8995echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 8119echo "$as_me:8119: result: $ac_cv_func_getpgrp_void" >&5
8996echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6 8120echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
8997if test $ac_cv_func_getpgrp_void = yes; then 8121if test $ac_cv_func_getpgrp_void = yes; then
8998 8122
8999cat >>confdefs.h <<\_ACEOF 8123cat >>confdefs.h <<\EOF
9000#define GETPGRP_VOID 1 8124#define GETPGRP_VOID 1
9001_ACEOF 8125EOF
9002 8126
9003fi 8127fi
9004 8128
9005
9006# Check for PAM libs 8129# Check for PAM libs
9007PAM_MSG="no" 8130PAM_MSG="no"
9008 8131
@@ -9012,13 +8135,12 @@ if test "${with_pam+set}" = set; then
9012 8135
9013 if test "x$withval" != "xno" ; then 8136 if test "x$withval" != "xno" ; then
9014 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then 8137 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" ; then
9015 { { echo "$as_me:$LINENO: error: PAM headers not found" >&5 8138 { { echo "$as_me:8138: error: PAM headers not found" >&5
9016echo "$as_me: error: PAM headers not found" >&2;} 8139echo "$as_me: error: PAM headers not found" >&2;}
9017 { (exit 1); exit 1; }; } 8140 { (exit 1); exit 1; }; }
9018 fi 8141 fi
9019 8142
9020 8143echo "$as_me:8143: checking for dlopen in -ldl" >&5
9021echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
9022echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 8144echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
9023if test "${ac_cv_lib_dl_dlopen+set}" = set; then 8145if test "${ac_cv_lib_dl_dlopen+set}" = set; then
9024 echo $ECHO_N "(cached) $ECHO_C" >&6 8146 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9026,12 +8148,8 @@ else
9026 ac_check_lib_save_LIBS=$LIBS 8148 ac_check_lib_save_LIBS=$LIBS
9027LIBS="-ldl $LIBS" 8149LIBS="-ldl $LIBS"
9028cat >conftest.$ac_ext <<_ACEOF 8150cat >conftest.$ac_ext <<_ACEOF
9029#line $LINENO "configure" 8151#line 8151 "configure"
9030/* confdefs.h. */ 8152#include "confdefs.h"
9031_ACEOF
9032cat confdefs.h >>conftest.$ac_ext
9033cat >>conftest.$ac_ext <<_ACEOF
9034/* end confdefs.h. */
9035 8153
9036/* Override any gcc2 internal prototype to avoid an error. */ 8154/* Override any gcc2 internal prototype to avoid an error. */
9037#ifdef __cplusplus 8155#ifdef __cplusplus
@@ -9049,40 +8167,38 @@ dlopen ();
9049} 8167}
9050_ACEOF 8168_ACEOF
9051rm -f conftest.$ac_objext conftest$ac_exeext 8169rm -f conftest.$ac_objext conftest$ac_exeext
9052if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8170if { (eval echo "$as_me:8170: \"$ac_link\"") >&5
9053 (eval $ac_link) 2>&5 8171 (eval $ac_link) 2>&5
9054 ac_status=$? 8172 ac_status=$?
9055 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8173 echo "$as_me:8173: \$? = $ac_status" >&5
9056 (exit $ac_status); } && 8174 (exit $ac_status); } &&
9057 { ac_try='test -s conftest$ac_exeext' 8175 { ac_try='test -s conftest$ac_exeext'
9058 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8176 { (eval echo "$as_me:8176: \"$ac_try\"") >&5
9059 (eval $ac_try) 2>&5 8177 (eval $ac_try) 2>&5
9060 ac_status=$? 8178 ac_status=$?
9061 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8179 echo "$as_me:8179: \$? = $ac_status" >&5
9062 (exit $ac_status); }; }; then 8180 (exit $ac_status); }; }; then
9063 ac_cv_lib_dl_dlopen=yes 8181 ac_cv_lib_dl_dlopen=yes
9064else 8182else
9065 echo "$as_me: failed program was:" >&5 8183 echo "$as_me: failed program was:" >&5
9066sed 's/^/| /' conftest.$ac_ext >&5 8184cat conftest.$ac_ext >&5
9067
9068ac_cv_lib_dl_dlopen=no 8185ac_cv_lib_dl_dlopen=no
9069fi 8186fi
9070rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8187rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9071LIBS=$ac_check_lib_save_LIBS 8188LIBS=$ac_check_lib_save_LIBS
9072fi 8189fi
9073echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 8190echo "$as_me:8190: result: $ac_cv_lib_dl_dlopen" >&5
9074echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 8191echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
9075if test $ac_cv_lib_dl_dlopen = yes; then 8192if test $ac_cv_lib_dl_dlopen = yes; then
9076 cat >>confdefs.h <<_ACEOF 8193 cat >>confdefs.h <<EOF
9077#define HAVE_LIBDL 1 8194#define HAVE_LIBDL 1
9078_ACEOF 8195EOF
9079 8196
9080 LIBS="-ldl $LIBS" 8197 LIBS="-ldl $LIBS"
9081 8198
9082fi 8199fi
9083 8200
9084 8201echo "$as_me:8201: checking for pam_set_item in -lpam" >&5
9085echo "$as_me:$LINENO: checking for pam_set_item in -lpam" >&5
9086echo $ECHO_N "checking for pam_set_item in -lpam... $ECHO_C" >&6 8202echo $ECHO_N "checking for pam_set_item in -lpam... $ECHO_C" >&6
9087if test "${ac_cv_lib_pam_pam_set_item+set}" = set; then 8203if test "${ac_cv_lib_pam_pam_set_item+set}" = set; then
9088 echo $ECHO_N "(cached) $ECHO_C" >&6 8204 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9090,12 +8206,8 @@ else
9090 ac_check_lib_save_LIBS=$LIBS 8206 ac_check_lib_save_LIBS=$LIBS
9091LIBS="-lpam $LIBS" 8207LIBS="-lpam $LIBS"
9092cat >conftest.$ac_ext <<_ACEOF 8208cat >conftest.$ac_ext <<_ACEOF
9093#line $LINENO "configure" 8209#line 8209 "configure"
9094/* confdefs.h. */ 8210#include "confdefs.h"
9095_ACEOF
9096cat confdefs.h >>conftest.$ac_ext
9097cat >>conftest.$ac_ext <<_ACEOF
9098/* end confdefs.h. */
9099 8211
9100/* Override any gcc2 internal prototype to avoid an error. */ 8212/* Override any gcc2 internal prototype to avoid an error. */
9101#ifdef __cplusplus 8213#ifdef __cplusplus
@@ -9113,133 +8225,185 @@ pam_set_item ();
9113} 8225}
9114_ACEOF 8226_ACEOF
9115rm -f conftest.$ac_objext conftest$ac_exeext 8227rm -f conftest.$ac_objext conftest$ac_exeext
9116if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8228if { (eval echo "$as_me:8228: \"$ac_link\"") >&5
9117 (eval $ac_link) 2>&5 8229 (eval $ac_link) 2>&5
9118 ac_status=$? 8230 ac_status=$?
9119 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8231 echo "$as_me:8231: \$? = $ac_status" >&5
9120 (exit $ac_status); } && 8232 (exit $ac_status); } &&
9121 { ac_try='test -s conftest$ac_exeext' 8233 { ac_try='test -s conftest$ac_exeext'
9122 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8234 { (eval echo "$as_me:8234: \"$ac_try\"") >&5
9123 (eval $ac_try) 2>&5 8235 (eval $ac_try) 2>&5
9124 ac_status=$? 8236 ac_status=$?
9125 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8237 echo "$as_me:8237: \$? = $ac_status" >&5
9126 (exit $ac_status); }; }; then 8238 (exit $ac_status); }; }; then
9127 ac_cv_lib_pam_pam_set_item=yes 8239 ac_cv_lib_pam_pam_set_item=yes
9128else 8240else
9129 echo "$as_me: failed program was:" >&5 8241 echo "$as_me: failed program was:" >&5
9130sed 's/^/| /' conftest.$ac_ext >&5 8242cat conftest.$ac_ext >&5
9131
9132ac_cv_lib_pam_pam_set_item=no 8243ac_cv_lib_pam_pam_set_item=no
9133fi 8244fi
9134rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8245rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9135LIBS=$ac_check_lib_save_LIBS 8246LIBS=$ac_check_lib_save_LIBS
9136fi 8247fi
9137echo "$as_me:$LINENO: result: $ac_cv_lib_pam_pam_set_item" >&5 8248echo "$as_me:8248: result: $ac_cv_lib_pam_pam_set_item" >&5
9138echo "${ECHO_T}$ac_cv_lib_pam_pam_set_item" >&6 8249echo "${ECHO_T}$ac_cv_lib_pam_pam_set_item" >&6
9139if test $ac_cv_lib_pam_pam_set_item = yes; then 8250if test $ac_cv_lib_pam_pam_set_item = yes; then
9140 cat >>confdefs.h <<_ACEOF 8251 cat >>confdefs.h <<EOF
9141#define HAVE_LIBPAM 1 8252#define HAVE_LIBPAM 1
9142_ACEOF 8253EOF
9143 8254
9144 LIBS="-lpam $LIBS" 8255 LIBS="-lpam $LIBS"
9145 8256
9146else 8257else
9147 { { echo "$as_me:$LINENO: error: *** libpam missing" >&5 8258 { { echo "$as_me:8258: error: *** libpam missing" >&5
9148echo "$as_me: error: *** libpam missing" >&2;} 8259echo "$as_me: error: *** libpam missing" >&2;}
9149 { (exit 1); exit 1; }; } 8260 { (exit 1); exit 1; }; }
9150fi 8261fi
9151 8262
9152
9153for ac_func in pam_getenvlist 8263for ac_func in pam_getenvlist
9154do 8264do
9155as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` 8265as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
9156echo "$as_me:$LINENO: checking for $ac_func" >&5 8266echo "$as_me:8266: checking for $ac_func" >&5
9157echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 8267echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
9158if eval "test \"\${$as_ac_var+set}\" = set"; then 8268if eval "test \"\${$as_ac_var+set}\" = set"; then
9159 echo $ECHO_N "(cached) $ECHO_C" >&6 8269 echo $ECHO_N "(cached) $ECHO_C" >&6
9160else 8270else
9161 cat >conftest.$ac_ext <<_ACEOF 8271 cat >conftest.$ac_ext <<_ACEOF
9162#line $LINENO "configure" 8272#line 8272 "configure"
9163/* confdefs.h. */ 8273#include "confdefs.h"
9164_ACEOF
9165cat confdefs.h >>conftest.$ac_ext
9166cat >>conftest.$ac_ext <<_ACEOF
9167/* end confdefs.h. */
9168/* System header to define __stub macros and hopefully few prototypes, 8274/* System header to define __stub macros and hopefully few prototypes,
9169 which can conflict with char $ac_func (); below. 8275 which can conflict with char $ac_func (); below. */
9170 Prefer <limits.h> to <assert.h> if __STDC__ is defined, since 8276#include <assert.h>
9171 <limits.h> exists even on freestanding compilers. */
9172#ifdef __STDC__
9173# include <limits.h>
9174#else
9175# include <assert.h>
9176#endif
9177/* Override any gcc2 internal prototype to avoid an error. */ 8277/* Override any gcc2 internal prototype to avoid an error. */
9178#ifdef __cplusplus 8278#ifdef __cplusplus
9179extern "C" 8279extern "C"
9180{
9181#endif 8280#endif
9182/* We use char because int might match the return type of a gcc2 8281/* We use char because int might match the return type of a gcc2
9183 builtin and then its argument prototype would still apply. */ 8282 builtin and then its argument prototype would still apply. */
9184char $ac_func (); 8283char $ac_func ();
8284char (*f) ();
8285
8286int
8287main ()
8288{
9185/* The GNU C library defines this for functions which it implements 8289/* The GNU C library defines this for functions which it implements
9186 to always fail with ENOSYS. Some functions are actually named 8290 to always fail with ENOSYS. Some functions are actually named
9187 something starting with __ and the normal name is an alias. */ 8291 something starting with __ and the normal name is an alias. */
9188#if defined (__stub_$ac_func) || defined (__stub___$ac_func) 8292#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9189choke me 8293choke me
9190#else 8294#else
9191char (*f) () = $ac_func; 8295f = $ac_func;
9192#endif 8296#endif
9193#ifdef __cplusplus 8297
8298 ;
8299 return 0;
9194} 8300}
8301_ACEOF
8302rm -f conftest.$ac_objext conftest$ac_exeext
8303if { (eval echo "$as_me:8303: \"$ac_link\"") >&5
8304 (eval $ac_link) 2>&5
8305 ac_status=$?
8306 echo "$as_me:8306: \$? = $ac_status" >&5
8307 (exit $ac_status); } &&
8308 { ac_try='test -s conftest$ac_exeext'
8309 { (eval echo "$as_me:8309: \"$ac_try\"") >&5
8310 (eval $ac_try) 2>&5
8311 ac_status=$?
8312 echo "$as_me:8312: \$? = $ac_status" >&5
8313 (exit $ac_status); }; }; then
8314 eval "$as_ac_var=yes"
8315else
8316 echo "$as_me: failed program was:" >&5
8317cat conftest.$ac_ext >&5
8318eval "$as_ac_var=no"
8319fi
8320rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8321fi
8322echo "$as_me:8322: result: `eval echo '${'$as_ac_var'}'`" >&5
8323echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
8324if test `eval echo '${'$as_ac_var'}'` = yes; then
8325 cat >>confdefs.h <<EOF
8326#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
8327EOF
8328
8329fi
8330done
8331
8332for ac_func in pam_putenv
8333do
8334as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
8335echo "$as_me:8335: checking for $ac_func" >&5
8336echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
8337if eval "test \"\${$as_ac_var+set}\" = set"; then
8338 echo $ECHO_N "(cached) $ECHO_C" >&6
8339else
8340 cat >conftest.$ac_ext <<_ACEOF
8341#line 8341 "configure"
8342#include "confdefs.h"
8343/* System header to define __stub macros and hopefully few prototypes,
8344 which can conflict with char $ac_func (); below. */
8345#include <assert.h>
8346/* Override any gcc2 internal prototype to avoid an error. */
8347#ifdef __cplusplus
8348extern "C"
9195#endif 8349#endif
8350/* We use char because int might match the return type of a gcc2
8351 builtin and then its argument prototype would still apply. */
8352char $ac_func ();
8353char (*f) ();
9196 8354
9197int 8355int
9198main () 8356main ()
9199{ 8357{
9200return f != $ac_func; 8358/* The GNU C library defines this for functions which it implements
8359 to always fail with ENOSYS. Some functions are actually named
8360 something starting with __ and the normal name is an alias. */
8361#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
8362choke me
8363#else
8364f = $ac_func;
8365#endif
8366
9201 ; 8367 ;
9202 return 0; 8368 return 0;
9203} 8369}
9204_ACEOF 8370_ACEOF
9205rm -f conftest.$ac_objext conftest$ac_exeext 8371rm -f conftest.$ac_objext conftest$ac_exeext
9206if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8372if { (eval echo "$as_me:8372: \"$ac_link\"") >&5
9207 (eval $ac_link) 2>&5 8373 (eval $ac_link) 2>&5
9208 ac_status=$? 8374 ac_status=$?
9209 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8375 echo "$as_me:8375: \$? = $ac_status" >&5
9210 (exit $ac_status); } && 8376 (exit $ac_status); } &&
9211 { ac_try='test -s conftest$ac_exeext' 8377 { ac_try='test -s conftest$ac_exeext'
9212 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8378 { (eval echo "$as_me:8378: \"$ac_try\"") >&5
9213 (eval $ac_try) 2>&5 8379 (eval $ac_try) 2>&5
9214 ac_status=$? 8380 ac_status=$?
9215 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8381 echo "$as_me:8381: \$? = $ac_status" >&5
9216 (exit $ac_status); }; }; then 8382 (exit $ac_status); }; }; then
9217 eval "$as_ac_var=yes" 8383 eval "$as_ac_var=yes"
9218else 8384else
9219 echo "$as_me: failed program was:" >&5 8385 echo "$as_me: failed program was:" >&5
9220sed 's/^/| /' conftest.$ac_ext >&5 8386cat conftest.$ac_ext >&5
9221
9222eval "$as_ac_var=no" 8387eval "$as_ac_var=no"
9223fi 8388fi
9224rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8389rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9225fi 8390fi
9226echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 8391echo "$as_me:8391: result: `eval echo '${'$as_ac_var'}'`" >&5
9227echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 8392echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
9228if test `eval echo '${'$as_ac_var'}'` = yes; then 8393if test `eval echo '${'$as_ac_var'}'` = yes; then
9229 cat >>confdefs.h <<_ACEOF 8394 cat >>confdefs.h <<EOF
9230#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 8395#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
9231_ACEOF 8396EOF
9232 8397
9233fi 8398fi
9234done 8399done
9235 8400
9236
9237 disable_shadow=yes 8401 disable_shadow=yes
9238 PAM_MSG="yes" 8402 PAM_MSG="yes"
9239 8403
9240 cat >>confdefs.h <<\_ACEOF 8404 cat >>confdefs.h <<\EOF
9241#define USE_PAM 1 8405#define USE_PAM 1
9242_ACEOF 8406EOF
9243 8407
9244 if test $ac_cv_lib_dl_dlopen = yes; then 8408 if test $ac_cv_lib_dl_dlopen = yes; then
9245 LIBPAM="-lpam -ldl" 8409 LIBPAM="-lpam -ldl"
@@ -9249,21 +8413,16 @@ _ACEOF
9249 8413
9250 fi 8414 fi
9251 8415
9252
9253fi; 8416fi;
9254 8417
9255# Check for older PAM 8418# Check for older PAM
9256if test "x$PAM_MSG" = "xyes" ; then 8419if test "x$PAM_MSG" = "xyes" ; then
9257 # Check PAM strerror arguments (old PAM) 8420 # Check PAM strerror arguments (old PAM)
9258 echo "$as_me:$LINENO: checking whether pam_strerror takes only one argument" >&5 8421 echo "$as_me:8421: checking whether pam_strerror takes only one argument" >&5
9259echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6 8422echo $ECHO_N "checking whether pam_strerror takes only one argument... $ECHO_C" >&6
9260 cat >conftest.$ac_ext <<_ACEOF 8423 cat >conftest.$ac_ext <<_ACEOF
9261#line $LINENO "configure" 8424#line 8424 "configure"
9262/* confdefs.h. */ 8425#include "confdefs.h"
9263_ACEOF
9264cat confdefs.h >>conftest.$ac_ext
9265cat >>conftest.$ac_ext <<_ACEOF
9266/* end confdefs.h. */
9267 8426
9268#include <stdlib.h> 8427#include <stdlib.h>
9269#include <security/pam_appl.h> 8428#include <security/pam_appl.h>
@@ -9277,33 +8436,31 @@ main ()
9277} 8436}
9278_ACEOF 8437_ACEOF
9279rm -f conftest.$ac_objext 8438rm -f conftest.$ac_objext
9280if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 8439if { (eval echo "$as_me:8439: \"$ac_compile\"") >&5
9281 (eval $ac_compile) 2>&5 8440 (eval $ac_compile) 2>&5
9282 ac_status=$? 8441 ac_status=$?
9283 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8442 echo "$as_me:8442: \$? = $ac_status" >&5
9284 (exit $ac_status); } && 8443 (exit $ac_status); } &&
9285 { ac_try='test -s conftest.$ac_objext' 8444 { ac_try='test -s conftest.$ac_objext'
9286 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8445 { (eval echo "$as_me:8445: \"$ac_try\"") >&5
9287 (eval $ac_try) 2>&5 8446 (eval $ac_try) 2>&5
9288 ac_status=$? 8447 ac_status=$?
9289 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8448 echo "$as_me:8448: \$? = $ac_status" >&5
9290 (exit $ac_status); }; }; then 8449 (exit $ac_status); }; }; then
9291 echo "$as_me:$LINENO: result: no" >&5 8450 echo "$as_me:8450: result: no" >&5
9292echo "${ECHO_T}no" >&6 8451echo "${ECHO_T}no" >&6
9293else 8452else
9294 echo "$as_me: failed program was:" >&5 8453 echo "$as_me: failed program was:" >&5
9295sed 's/^/| /' conftest.$ac_ext >&5 8454cat conftest.$ac_ext >&5
9296 8455
9297 8456 cat >>confdefs.h <<\EOF
9298 cat >>confdefs.h <<\_ACEOF
9299#define HAVE_OLD_PAM 1 8457#define HAVE_OLD_PAM 1
9300_ACEOF 8458EOF
9301 8459
9302 echo "$as_me:$LINENO: result: yes" >&5 8460 echo "$as_me:8460: result: yes" >&5
9303echo "${ECHO_T}yes" >&6 8461echo "${ECHO_T}yes" >&6
9304 PAM_MSG="yes (old library)" 8462 PAM_MSG="yes (old library)"
9305 8463
9306
9307fi 8464fi
9308rm -f conftest.$ac_objext conftest.$ac_ext 8465rm -f conftest.$ac_objext conftest.$ac_ext
9309fi 8466fi
@@ -9312,7 +8469,7 @@ fi
9312# because the system crypt() is more featureful. 8469# because the system crypt() is more featureful.
9313if test "x$check_for_libcrypt_before" = "x1"; then 8470if test "x$check_for_libcrypt_before" = "x1"; then
9314 8471
9315echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 8472echo "$as_me:8472: checking for crypt in -lcrypt" >&5
9316echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 8473echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
9317if test "${ac_cv_lib_crypt_crypt+set}" = set; then 8474if test "${ac_cv_lib_crypt_crypt+set}" = set; then
9318 echo $ECHO_N "(cached) $ECHO_C" >&6 8475 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9320,12 +8477,8 @@ else
9320 ac_check_lib_save_LIBS=$LIBS 8477 ac_check_lib_save_LIBS=$LIBS
9321LIBS="-lcrypt $LIBS" 8478LIBS="-lcrypt $LIBS"
9322cat >conftest.$ac_ext <<_ACEOF 8479cat >conftest.$ac_ext <<_ACEOF
9323#line $LINENO "configure" 8480#line 8480 "configure"
9324/* confdefs.h. */ 8481#include "confdefs.h"
9325_ACEOF
9326cat confdefs.h >>conftest.$ac_ext
9327cat >>conftest.$ac_ext <<_ACEOF
9328/* end confdefs.h. */
9329 8482
9330/* Override any gcc2 internal prototype to avoid an error. */ 8483/* Override any gcc2 internal prototype to avoid an error. */
9331#ifdef __cplusplus 8484#ifdef __cplusplus
@@ -9343,33 +8496,32 @@ crypt ();
9343} 8496}
9344_ACEOF 8497_ACEOF
9345rm -f conftest.$ac_objext conftest$ac_exeext 8498rm -f conftest.$ac_objext conftest$ac_exeext
9346if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8499if { (eval echo "$as_me:8499: \"$ac_link\"") >&5
9347 (eval $ac_link) 2>&5 8500 (eval $ac_link) 2>&5
9348 ac_status=$? 8501 ac_status=$?
9349 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8502 echo "$as_me:8502: \$? = $ac_status" >&5
9350 (exit $ac_status); } && 8503 (exit $ac_status); } &&
9351 { ac_try='test -s conftest$ac_exeext' 8504 { ac_try='test -s conftest$ac_exeext'
9352 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8505 { (eval echo "$as_me:8505: \"$ac_try\"") >&5
9353 (eval $ac_try) 2>&5 8506 (eval $ac_try) 2>&5
9354 ac_status=$? 8507 ac_status=$?
9355 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8508 echo "$as_me:8508: \$? = $ac_status" >&5
9356 (exit $ac_status); }; }; then 8509 (exit $ac_status); }; }; then
9357 ac_cv_lib_crypt_crypt=yes 8510 ac_cv_lib_crypt_crypt=yes
9358else 8511else
9359 echo "$as_me: failed program was:" >&5 8512 echo "$as_me: failed program was:" >&5
9360sed 's/^/| /' conftest.$ac_ext >&5 8513cat conftest.$ac_ext >&5
9361
9362ac_cv_lib_crypt_crypt=no 8514ac_cv_lib_crypt_crypt=no
9363fi 8515fi
9364rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8516rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9365LIBS=$ac_check_lib_save_LIBS 8517LIBS=$ac_check_lib_save_LIBS
9366fi 8518fi
9367echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 8519echo "$as_me:8519: result: $ac_cv_lib_crypt_crypt" >&5
9368echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 8520echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
9369if test $ac_cv_lib_crypt_crypt = yes; then 8521if test $ac_cv_lib_crypt_crypt = yes; then
9370 cat >>confdefs.h <<_ACEOF 8522 cat >>confdefs.h <<EOF
9371#define HAVE_LIBCRYPT 1 8523#define HAVE_LIBCRYPT 1
9372_ACEOF 8524EOF
9373 8525
9374 LIBS="-lcrypt $LIBS" 8526 LIBS="-lcrypt $LIBS"
9375 8527
@@ -9406,16 +8558,11 @@ if test "${with_ssl_dir+set}" = set; then
9406 fi 8558 fi
9407 fi 8559 fi
9408 8560
9409
9410fi; 8561fi;
9411LIBS="$LIBS -lcrypto" 8562LIBS="$LIBS -lcrypto"
9412cat >conftest.$ac_ext <<_ACEOF 8563cat >conftest.$ac_ext <<_ACEOF
9413#line $LINENO "configure" 8564#line 8564 "configure"
9414/* confdefs.h. */ 8565#include "confdefs.h"
9415_ACEOF
9416cat confdefs.h >>conftest.$ac_ext
9417cat >>conftest.$ac_ext <<_ACEOF
9418/* end confdefs.h. */
9419 8566
9420/* Override any gcc2 internal prototype to avoid an error. */ 8567/* Override any gcc2 internal prototype to avoid an error. */
9421#ifdef __cplusplus 8568#ifdef __cplusplus
@@ -9433,25 +8580,24 @@ RAND_add ();
9433} 8580}
9434_ACEOF 8581_ACEOF
9435rm -f conftest.$ac_objext conftest$ac_exeext 8582rm -f conftest.$ac_objext conftest$ac_exeext
9436if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8583if { (eval echo "$as_me:8583: \"$ac_link\"") >&5
9437 (eval $ac_link) 2>&5 8584 (eval $ac_link) 2>&5
9438 ac_status=$? 8585 ac_status=$?
9439 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8586 echo "$as_me:8586: \$? = $ac_status" >&5
9440 (exit $ac_status); } && 8587 (exit $ac_status); } &&
9441 { ac_try='test -s conftest$ac_exeext' 8588 { ac_try='test -s conftest$ac_exeext'
9442 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8589 { (eval echo "$as_me:8589: \"$ac_try\"") >&5
9443 (eval $ac_try) 2>&5 8590 (eval $ac_try) 2>&5
9444 ac_status=$? 8591 ac_status=$?
9445 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8592 echo "$as_me:8592: \$? = $ac_status" >&5
9446 (exit $ac_status); }; }; then 8593 (exit $ac_status); }; }; then
9447 cat >>confdefs.h <<\_ACEOF 8594 cat >>confdefs.h <<\EOF
9448#define HAVE_OPENSSL 1 8595#define HAVE_OPENSSL 1
9449_ACEOF 8596EOF
9450 8597
9451else 8598else
9452 echo "$as_me: failed program was:" >&5 8599 echo "$as_me: failed program was:" >&5
9453sed 's/^/| /' conftest.$ac_ext >&5 8600cat conftest.$ac_ext >&5
9454
9455 8601
9456 if test -n "${need_dash_r}"; then 8602 if test -n "${need_dash_r}"; then
9457 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}" 8603 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
@@ -9460,12 +8606,8 @@ sed 's/^/| /' conftest.$ac_ext >&5
9460 fi 8606 fi
9461 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}" 8607 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
9462 cat >conftest.$ac_ext <<_ACEOF 8608 cat >conftest.$ac_ext <<_ACEOF
9463#line $LINENO "configure" 8609#line 8609 "configure"
9464/* confdefs.h. */ 8610#include "confdefs.h"
9465_ACEOF
9466cat confdefs.h >>conftest.$ac_ext
9467cat >>conftest.$ac_ext <<_ACEOF
9468/* end confdefs.h. */
9469 8611
9470/* Override any gcc2 internal prototype to avoid an error. */ 8612/* Override any gcc2 internal prototype to avoid an error. */
9471#ifdef __cplusplus 8613#ifdef __cplusplus
@@ -9483,55 +8625,46 @@ RAND_add ();
9483} 8625}
9484_ACEOF 8626_ACEOF
9485rm -f conftest.$ac_objext conftest$ac_exeext 8627rm -f conftest.$ac_objext conftest$ac_exeext
9486if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8628if { (eval echo "$as_me:8628: \"$ac_link\"") >&5
9487 (eval $ac_link) 2>&5 8629 (eval $ac_link) 2>&5
9488 ac_status=$? 8630 ac_status=$?
9489 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8631 echo "$as_me:8631: \$? = $ac_status" >&5
9490 (exit $ac_status); } && 8632 (exit $ac_status); } &&
9491 { ac_try='test -s conftest$ac_exeext' 8633 { ac_try='test -s conftest$ac_exeext'
9492 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8634 { (eval echo "$as_me:8634: \"$ac_try\"") >&5
9493 (eval $ac_try) 2>&5 8635 (eval $ac_try) 2>&5
9494 ac_status=$? 8636 ac_status=$?
9495 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8637 echo "$as_me:8637: \$? = $ac_status" >&5
9496 (exit $ac_status); }; }; then 8638 (exit $ac_status); }; }; then
9497 cat >>confdefs.h <<\_ACEOF 8639 cat >>confdefs.h <<\EOF
9498#define HAVE_OPENSSL 1 8640#define HAVE_OPENSSL 1
9499_ACEOF 8641EOF
9500 8642
9501else 8643else
9502 echo "$as_me: failed program was:" >&5 8644 echo "$as_me: failed program was:" >&5
9503sed 's/^/| /' conftest.$ac_ext >&5 8645cat conftest.$ac_ext >&5
9504 8646
9505 8647 { { echo "$as_me:8647: error: *** Can't find recent OpenSSL libcrypto (see config.log for details) ***" >&5
9506 { { echo "$as_me:$LINENO: error: *** Can't find recent OpenSSL libcrypto (see config.log for details) ***" >&5
9507echo "$as_me: error: *** Can't find recent OpenSSL libcrypto (see config.log for details) ***" >&2;} 8648echo "$as_me: error: *** Can't find recent OpenSSL libcrypto (see config.log for details) ***" >&2;}
9508 { (exit 1); exit 1; }; } 8649 { (exit 1); exit 1; }; }
9509 8650
9510
9511fi 8651fi
9512rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8652rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9513 8653
9514
9515fi 8654fi
9516rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8655rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9517 8656
9518# Determine OpenSSL header version 8657# Determine OpenSSL header version
9519echo "$as_me:$LINENO: checking OpenSSL header version" >&5 8658echo "$as_me:8658: checking OpenSSL header version" >&5
9520echo $ECHO_N "checking OpenSSL header version... $ECHO_C" >&6 8659echo $ECHO_N "checking OpenSSL header version... $ECHO_C" >&6
9521if test "$cross_compiling" = yes; then 8660if test "$cross_compiling" = yes; then
9522 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 8661 { { echo "$as_me:8661: error: cannot run test program while cross compiling" >&5
9523See \`config.log' for more details." >&5 8662echo "$as_me: error: cannot run test program while cross compiling" >&2;}
9524echo "$as_me: error: cannot run test program while cross compiling
9525See \`config.log' for more details." >&2;}
9526 { (exit 1); exit 1; }; } 8663 { (exit 1); exit 1; }; }
9527else 8664else
9528 cat >conftest.$ac_ext <<_ACEOF 8665 cat >conftest.$ac_ext <<_ACEOF
9529#line $LINENO "configure" 8666#line 8666 "configure"
9530/* confdefs.h. */ 8667#include "confdefs.h"
9531_ACEOF
9532cat confdefs.h >>conftest.$ac_ext
9533cat >>conftest.$ac_ext <<_ACEOF
9534/* end confdefs.h. */
9535 8668
9536#include <stdio.h> 8669#include <stdio.h>
9537#include <string.h> 8670#include <string.h>
@@ -9553,56 +8686,47 @@ int main(void) {
9553 8686
9554_ACEOF 8687_ACEOF
9555rm -f conftest$ac_exeext 8688rm -f conftest$ac_exeext
9556if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8689if { (eval echo "$as_me:8689: \"$ac_link\"") >&5
9557 (eval $ac_link) 2>&5 8690 (eval $ac_link) 2>&5
9558 ac_status=$? 8691 ac_status=$?
9559 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8692 echo "$as_me:8692: \$? = $ac_status" >&5
9560 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 8693 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9561 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8694 { (eval echo "$as_me:8694: \"$ac_try\"") >&5
9562 (eval $ac_try) 2>&5 8695 (eval $ac_try) 2>&5
9563 ac_status=$? 8696 ac_status=$?
9564 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8697 echo "$as_me:8697: \$? = $ac_status" >&5
9565 (exit $ac_status); }; }; then 8698 (exit $ac_status); }; }; then
9566 8699
9567 ssl_header_ver=`cat conftest.sslincver` 8700 ssl_header_ver=`cat conftest.sslincver`
9568 echo "$as_me:$LINENO: result: $ssl_header_ver" >&5 8701 echo "$as_me:8701: result: $ssl_header_ver" >&5
9569echo "${ECHO_T}$ssl_header_ver" >&6 8702echo "${ECHO_T}$ssl_header_ver" >&6
9570 8703
9571else 8704else
9572 echo "$as_me: program exited with status $ac_status" >&5 8705 echo "$as_me: program exited with status $ac_status" >&5
9573echo "$as_me: failed program was:" >&5 8706echo "$as_me: failed program was:" >&5
9574sed 's/^/| /' conftest.$ac_ext >&5 8707cat conftest.$ac_ext >&5
9575 8708
9576( exit $ac_status ) 8709 echo "$as_me:8709: result: not found" >&5
9577
9578 echo "$as_me:$LINENO: result: not found" >&5
9579echo "${ECHO_T}not found" >&6 8710echo "${ECHO_T}not found" >&6
9580 { { echo "$as_me:$LINENO: error: OpenSSL version header not found." >&5 8711 { { echo "$as_me:8711: error: OpenSSL version header not found." >&5
9581echo "$as_me: error: OpenSSL version header not found." >&2;} 8712echo "$as_me: error: OpenSSL version header not found." >&2;}
9582 { (exit 1); exit 1; }; } 8713 { (exit 1); exit 1; }; }
9583 8714
9584
9585fi 8715fi
9586rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 8716rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9587fi 8717fi
9588 8718
9589# Determine OpenSSL library version 8719# Determine OpenSSL library version
9590echo "$as_me:$LINENO: checking OpenSSL library version" >&5 8720echo "$as_me:8720: checking OpenSSL library version" >&5
9591echo $ECHO_N "checking OpenSSL library version... $ECHO_C" >&6 8721echo $ECHO_N "checking OpenSSL library version... $ECHO_C" >&6
9592if test "$cross_compiling" = yes; then 8722if test "$cross_compiling" = yes; then
9593 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 8723 { { echo "$as_me:8723: error: cannot run test program while cross compiling" >&5
9594See \`config.log' for more details." >&5 8724echo "$as_me: error: cannot run test program while cross compiling" >&2;}
9595echo "$as_me: error: cannot run test program while cross compiling
9596See \`config.log' for more details." >&2;}
9597 { (exit 1); exit 1; }; } 8725 { (exit 1); exit 1; }; }
9598else 8726else
9599 cat >conftest.$ac_ext <<_ACEOF 8727 cat >conftest.$ac_ext <<_ACEOF
9600#line $LINENO "configure" 8728#line 8728 "configure"
9601/* confdefs.h. */ 8729#include "confdefs.h"
9602_ACEOF
9603cat confdefs.h >>conftest.$ac_ext
9604cat >>conftest.$ac_ext <<_ACEOF
9605/* end confdefs.h. */
9606 8730
9607#include <stdio.h> 8731#include <stdio.h>
9608#include <string.h> 8732#include <string.h>
@@ -9625,56 +8749,47 @@ int main(void) {
9625 8749
9626_ACEOF 8750_ACEOF
9627rm -f conftest$ac_exeext 8751rm -f conftest$ac_exeext
9628if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8752if { (eval echo "$as_me:8752: \"$ac_link\"") >&5
9629 (eval $ac_link) 2>&5 8753 (eval $ac_link) 2>&5
9630 ac_status=$? 8754 ac_status=$?
9631 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8755 echo "$as_me:8755: \$? = $ac_status" >&5
9632 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 8756 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9633 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8757 { (eval echo "$as_me:8757: \"$ac_try\"") >&5
9634 (eval $ac_try) 2>&5 8758 (eval $ac_try) 2>&5
9635 ac_status=$? 8759 ac_status=$?
9636 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8760 echo "$as_me:8760: \$? = $ac_status" >&5
9637 (exit $ac_status); }; }; then 8761 (exit $ac_status); }; }; then
9638 8762
9639 ssl_library_ver=`cat conftest.ssllibver` 8763 ssl_library_ver=`cat conftest.ssllibver`
9640 echo "$as_me:$LINENO: result: $ssl_library_ver" >&5 8764 echo "$as_me:8764: result: $ssl_library_ver" >&5
9641echo "${ECHO_T}$ssl_library_ver" >&6 8765echo "${ECHO_T}$ssl_library_ver" >&6
9642 8766
9643else 8767else
9644 echo "$as_me: program exited with status $ac_status" >&5 8768 echo "$as_me: program exited with status $ac_status" >&5
9645echo "$as_me: failed program was:" >&5 8769echo "$as_me: failed program was:" >&5
9646sed 's/^/| /' conftest.$ac_ext >&5 8770cat conftest.$ac_ext >&5
9647
9648( exit $ac_status )
9649 8771
9650 echo "$as_me:$LINENO: result: not found" >&5 8772 echo "$as_me:8772: result: not found" >&5
9651echo "${ECHO_T}not found" >&6 8773echo "${ECHO_T}not found" >&6
9652 { { echo "$as_me:$LINENO: error: OpenSSL library not found." >&5 8774 { { echo "$as_me:8774: error: OpenSSL library not found." >&5
9653echo "$as_me: error: OpenSSL library not found." >&2;} 8775echo "$as_me: error: OpenSSL library not found." >&2;}
9654 { (exit 1); exit 1; }; } 8776 { (exit 1); exit 1; }; }
9655 8777
9656
9657fi 8778fi
9658rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 8779rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9659fi 8780fi
9660 8781
9661# Sanity check OpenSSL headers 8782# Sanity check OpenSSL headers
9662echo "$as_me:$LINENO: checking whether OpenSSL's headers match the library" >&5 8783echo "$as_me:8783: checking whether OpenSSL's headers match the library" >&5
9663echo $ECHO_N "checking whether OpenSSL's headers match the library... $ECHO_C" >&6 8784echo $ECHO_N "checking whether OpenSSL's headers match the library... $ECHO_C" >&6
9664if test "$cross_compiling" = yes; then 8785if test "$cross_compiling" = yes; then
9665 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 8786 { { echo "$as_me:8786: error: cannot run test program while cross compiling" >&5
9666See \`config.log' for more details." >&5 8787echo "$as_me: error: cannot run test program while cross compiling" >&2;}
9667echo "$as_me: error: cannot run test program while cross compiling
9668See \`config.log' for more details." >&2;}
9669 { (exit 1); exit 1; }; } 8788 { (exit 1); exit 1; }; }
9670else 8789else
9671 cat >conftest.$ac_ext <<_ACEOF 8790 cat >conftest.$ac_ext <<_ACEOF
9672#line $LINENO "configure" 8791#line 8791 "configure"
9673/* confdefs.h. */ 8792#include "confdefs.h"
9674_ACEOF
9675cat confdefs.h >>conftest.$ac_ext
9676cat >>conftest.$ac_ext <<_ACEOF
9677/* end confdefs.h. */
9678 8793
9679#include <string.h> 8794#include <string.h>
9680#include <openssl/opensslv.h> 8795#include <openssl/opensslv.h>
@@ -9682,42 +8797,43 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
9682 8797
9683_ACEOF 8798_ACEOF
9684rm -f conftest$ac_exeext 8799rm -f conftest$ac_exeext
9685if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8800if { (eval echo "$as_me:8800: \"$ac_link\"") >&5
9686 (eval $ac_link) 2>&5 8801 (eval $ac_link) 2>&5
9687 ac_status=$? 8802 ac_status=$?
9688 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8803 echo "$as_me:8803: \$? = $ac_status" >&5
9689 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 8804 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9690 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8805 { (eval echo "$as_me:8805: \"$ac_try\"") >&5
9691 (eval $ac_try) 2>&5 8806 (eval $ac_try) 2>&5
9692 ac_status=$? 8807 ac_status=$?
9693 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8808 echo "$as_me:8808: \$? = $ac_status" >&5
9694 (exit $ac_status); }; }; then 8809 (exit $ac_status); }; }; then
9695 8810
9696 echo "$as_me:$LINENO: result: yes" >&5 8811 echo "$as_me:8811: result: yes" >&5
9697echo "${ECHO_T}yes" >&6 8812echo "${ECHO_T}yes" >&6
9698 8813
9699else 8814else
9700 echo "$as_me: program exited with status $ac_status" >&5 8815 echo "$as_me: program exited with status $ac_status" >&5
9701echo "$as_me: failed program was:" >&5 8816echo "$as_me: failed program was:" >&5
9702sed 's/^/| /' conftest.$ac_ext >&5 8817cat conftest.$ac_ext >&5
9703 8818
9704( exit $ac_status ) 8819 echo "$as_me:8819: result: no" >&5
9705
9706 echo "$as_me:$LINENO: result: no" >&5
9707echo "${ECHO_T}no" >&6 8820echo "${ECHO_T}no" >&6
9708 { { echo "$as_me:$LINENO: error: Your OpenSSL headers do not match your library" >&5 8821 { { echo "$as_me:8821: error: Your OpenSSL headers do not match your library.
9709echo "$as_me: error: Your OpenSSL headers do not match your library" >&2;} 8822Check config.log for details.
8823Also see contrib/findssl.sh for help identifying header/library mismatches." >&5
8824echo "$as_me: error: Your OpenSSL headers do not match your library.
8825Check config.log for details.
8826Also see contrib/findssl.sh for help identifying header/library mismatches." >&2;}
9710 { (exit 1); exit 1; }; } 8827 { (exit 1); exit 1; }; }
9711 8828
9712
9713fi 8829fi
9714rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 8830rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9715fi 8831fi
9716 8832
9717# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the 8833# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
9718# version in OpenSSL. Skip this for PAM 8834# version in OpenSSL. Skip this for PAM
9719if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then 8835if test "x$check_for_libcrypt_later" = "x1"; then
9720 echo "$as_me:$LINENO: checking for crypt in -lcrypt" >&5 8836 echo "$as_me:8836: checking for crypt in -lcrypt" >&5
9721echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6 8837echo $ECHO_N "checking for crypt in -lcrypt... $ECHO_C" >&6
9722if test "${ac_cv_lib_crypt_crypt+set}" = set; then 8838if test "${ac_cv_lib_crypt_crypt+set}" = set; then
9723 echo $ECHO_N "(cached) $ECHO_C" >&6 8839 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -9725,12 +8841,8 @@ else
9725 ac_check_lib_save_LIBS=$LIBS 8841 ac_check_lib_save_LIBS=$LIBS
9726LIBS="-lcrypt $LIBS" 8842LIBS="-lcrypt $LIBS"
9727cat >conftest.$ac_ext <<_ACEOF 8843cat >conftest.$ac_ext <<_ACEOF
9728#line $LINENO "configure" 8844#line 8844 "configure"
9729/* confdefs.h. */ 8845#include "confdefs.h"
9730_ACEOF
9731cat confdefs.h >>conftest.$ac_ext
9732cat >>conftest.$ac_ext <<_ACEOF
9733/* end confdefs.h. */
9734 8846
9735/* Override any gcc2 internal prototype to avoid an error. */ 8847/* Override any gcc2 internal prototype to avoid an error. */
9736#ifdef __cplusplus 8848#ifdef __cplusplus
@@ -9748,28 +8860,27 @@ crypt ();
9748} 8860}
9749_ACEOF 8861_ACEOF
9750rm -f conftest.$ac_objext conftest$ac_exeext 8862rm -f conftest.$ac_objext conftest$ac_exeext
9751if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8863if { (eval echo "$as_me:8863: \"$ac_link\"") >&5
9752 (eval $ac_link) 2>&5 8864 (eval $ac_link) 2>&5
9753 ac_status=$? 8865 ac_status=$?
9754 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8866 echo "$as_me:8866: \$? = $ac_status" >&5
9755 (exit $ac_status); } && 8867 (exit $ac_status); } &&
9756 { ac_try='test -s conftest$ac_exeext' 8868 { ac_try='test -s conftest$ac_exeext'
9757 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8869 { (eval echo "$as_me:8869: \"$ac_try\"") >&5
9758 (eval $ac_try) 2>&5 8870 (eval $ac_try) 2>&5
9759 ac_status=$? 8871 ac_status=$?
9760 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8872 echo "$as_me:8872: \$? = $ac_status" >&5
9761 (exit $ac_status); }; }; then 8873 (exit $ac_status); }; }; then
9762 ac_cv_lib_crypt_crypt=yes 8874 ac_cv_lib_crypt_crypt=yes
9763else 8875else
9764 echo "$as_me: failed program was:" >&5 8876 echo "$as_me: failed program was:" >&5
9765sed 's/^/| /' conftest.$ac_ext >&5 8877cat conftest.$ac_ext >&5
9766
9767ac_cv_lib_crypt_crypt=no 8878ac_cv_lib_crypt_crypt=no
9768fi 8879fi
9769rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 8880rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9770LIBS=$ac_check_lib_save_LIBS 8881LIBS=$ac_check_lib_save_LIBS
9771fi 8882fi
9772echo "$as_me:$LINENO: result: $ac_cv_lib_crypt_crypt" >&5 8883echo "$as_me:8883: result: $ac_cv_lib_crypt_crypt" >&5
9773echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6 8884echo "${ECHO_T}$ac_cv_lib_crypt_crypt" >&6
9774if test $ac_cv_lib_crypt_crypt = yes; then 8885if test $ac_cv_lib_crypt_crypt = yes; then
9775 LIBS="$LIBS -lcrypt" 8886 LIBS="$LIBS -lcrypt"
@@ -9777,26 +8888,19 @@ fi
9777 8888
9778fi 8889fi
9779 8890
9780
9781### Configure cryptographic random number support 8891### Configure cryptographic random number support
9782 8892
9783# Check wheter OpenSSL seeds itself 8893# Check wheter OpenSSL seeds itself
9784echo "$as_me:$LINENO: checking whether OpenSSL's PRNG is internally seeded" >&5 8894echo "$as_me:8894: checking whether OpenSSL's PRNG is internally seeded" >&5
9785echo $ECHO_N "checking whether OpenSSL's PRNG is internally seeded... $ECHO_C" >&6 8895echo $ECHO_N "checking whether OpenSSL's PRNG is internally seeded... $ECHO_C" >&6
9786if test "$cross_compiling" = yes; then 8896if test "$cross_compiling" = yes; then
9787 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 8897 { { echo "$as_me:8897: error: cannot run test program while cross compiling" >&5
9788See \`config.log' for more details." >&5 8898echo "$as_me: error: cannot run test program while cross compiling" >&2;}
9789echo "$as_me: error: cannot run test program while cross compiling
9790See \`config.log' for more details." >&2;}
9791 { (exit 1); exit 1; }; } 8899 { (exit 1); exit 1; }; }
9792else 8900else
9793 cat >conftest.$ac_ext <<_ACEOF 8901 cat >conftest.$ac_ext <<_ACEOF
9794#line $LINENO "configure" 8902#line 8902 "configure"
9795/* confdefs.h. */ 8903#include "confdefs.h"
9796_ACEOF
9797cat confdefs.h >>conftest.$ac_ext
9798cat >>conftest.$ac_ext <<_ACEOF
9799/* end confdefs.h. */
9800 8904
9801#include <string.h> 8905#include <string.h>
9802#include <openssl/rand.h> 8906#include <openssl/rand.h>
@@ -9804,40 +8908,36 @@ int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
9804 8908
9805_ACEOF 8909_ACEOF
9806rm -f conftest$ac_exeext 8910rm -f conftest$ac_exeext
9807if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 8911if { (eval echo "$as_me:8911: \"$ac_link\"") >&5
9808 (eval $ac_link) 2>&5 8912 (eval $ac_link) 2>&5
9809 ac_status=$? 8913 ac_status=$?
9810 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8914 echo "$as_me:8914: \$? = $ac_status" >&5
9811 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 8915 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9812 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 8916 { (eval echo "$as_me:8916: \"$ac_try\"") >&5
9813 (eval $ac_try) 2>&5 8917 (eval $ac_try) 2>&5
9814 ac_status=$? 8918 ac_status=$?
9815 echo "$as_me:$LINENO: \$? = $ac_status" >&5 8919 echo "$as_me:8919: \$? = $ac_status" >&5
9816 (exit $ac_status); }; }; then 8920 (exit $ac_status); }; }; then
9817 8921
9818 OPENSSL_SEEDS_ITSELF=yes 8922 OPENSSL_SEEDS_ITSELF=yes
9819 echo "$as_me:$LINENO: result: yes" >&5 8923 echo "$as_me:8923: result: yes" >&5
9820echo "${ECHO_T}yes" >&6 8924echo "${ECHO_T}yes" >&6
9821 8925
9822else 8926else
9823 echo "$as_me: program exited with status $ac_status" >&5 8927 echo "$as_me: program exited with status $ac_status" >&5
9824echo "$as_me: failed program was:" >&5 8928echo "$as_me: failed program was:" >&5
9825sed 's/^/| /' conftest.$ac_ext >&5 8929cat conftest.$ac_ext >&5
9826 8930
9827( exit $ac_status ) 8931 echo "$as_me:8931: result: no" >&5
9828
9829 echo "$as_me:$LINENO: result: no" >&5
9830echo "${ECHO_T}no" >&6 8932echo "${ECHO_T}no" >&6
9831 # Default to use of the rand helper if OpenSSL doesn't 8933 # Default to use of the rand helper if OpenSSL doesn't
9832 # seed itself 8934 # seed itself
9833 USE_RAND_HELPER=yes 8935 USE_RAND_HELPER=yes
9834 8936
9835
9836fi 8937fi
9837rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 8938rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9838fi 8939fi
9839 8940
9840
9841# Do we want to force the use of the rand helper? 8941# Do we want to force the use of the rand helper?
9842 8942
9843# Check whether --with-rand-helper or --without-rand-helper was given. 8943# Check whether --with-rand-helper or --without-rand-helper was given.
@@ -9848,7 +8948,7 @@ if test "${with_rand_helper+set}" = set; then
9848 # Force use of OpenSSL's internal RNG, even if 8948 # Force use of OpenSSL's internal RNG, even if
9849 # the previous test showed it to be unseeded. 8949 # the previous test showed it to be unseeded.
9850 if test -z "$OPENSSL_SEEDS_ITSELF" ; then 8950 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
9851 { echo "$as_me:$LINENO: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&5 8951 { echo "$as_me:8951: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&5
9852echo "$as_me: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&2;} 8952echo "$as_me: WARNING: *** Forcing use of OpenSSL's non-self-seeding PRNG" >&2;}
9853 OPENSSL_SEEDS_ITSELF=yes 8953 OPENSSL_SEEDS_ITSELF=yes
9854 USE_RAND_HELPER="" 8954 USE_RAND_HELPER=""
@@ -9862,9 +8962,9 @@ fi;
9862# Which randomness source do we use? 8962# Which randomness source do we use?
9863if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then 8963if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
9864 # OpenSSL only 8964 # OpenSSL only
9865 cat >>confdefs.h <<\_ACEOF 8965 cat >>confdefs.h <<\EOF
9866#define OPENSSL_PRNG_ONLY 1 8966#define OPENSSL_PRNG_ONLY 1
9867_ACEOF 8967EOF
9868 8968
9869 RAND_MSG="OpenSSL internal ONLY" 8969 RAND_MSG="OpenSSL internal ONLY"
9870 INSTALL_SSH_RAND_HELPER="" 8970 INSTALL_SSH_RAND_HELPER=""
@@ -9874,7 +8974,6 @@ elif test ! -z "$USE_RAND_HELPER" ; then
9874 INSTALL_SSH_RAND_HELPER="yes" 8974 INSTALL_SSH_RAND_HELPER="yes"
9875fi 8975fi
9876 8976
9877
9878### Configuration of ssh-rand-helper 8977### Configuration of ssh-rand-helper
9879 8978
9880# PRNGD TCP socket 8979# PRNGD TCP socket
@@ -9890,20 +8989,19 @@ if test "${with_prngd_port+set}" = set; then
9890 [0-9]*) 8989 [0-9]*)
9891 ;; 8990 ;;
9892 *) 8991 *)
9893 { { echo "$as_me:$LINENO: error: You must specify a numeric port number for --with-prngd-port" >&5 8992 { { echo "$as_me:8992: error: You must specify a numeric port number for --with-prngd-port" >&5
9894echo "$as_me: error: You must specify a numeric port number for --with-prngd-port" >&2;} 8993echo "$as_me: error: You must specify a numeric port number for --with-prngd-port" >&2;}
9895 { (exit 1); exit 1; }; } 8994 { (exit 1); exit 1; }; }
9896 ;; 8995 ;;
9897 esac 8996 esac
9898 if test ! -z "$withval" ; then 8997 if test ! -z "$withval" ; then
9899 PRNGD_PORT="$withval" 8998 PRNGD_PORT="$withval"
9900 cat >>confdefs.h <<_ACEOF 8999 cat >>confdefs.h <<EOF
9901#define PRNGD_PORT $PRNGD_PORT 9000#define PRNGD_PORT $PRNGD_PORT
9902_ACEOF 9001EOF
9903 9002
9904 fi 9003 fi
9905 9004
9906
9907fi; 9005fi;
9908 9006
9909# PRNGD Unix domain socket 9007# PRNGD Unix domain socket
@@ -9922,7 +9020,7 @@ if test "${with_prngd_socket+set}" = set; then
9922 /*) 9020 /*)
9923 ;; 9021 ;;
9924 *) 9022 *)
9925 { { echo "$as_me:$LINENO: error: You must specify an absolute path to the entropy socket" >&5 9023 { { echo "$as_me:9023: error: You must specify an absolute path to the entropy socket" >&5
9926echo "$as_me: error: You must specify an absolute path to the entropy socket" >&2;} 9024echo "$as_me: error: You must specify an absolute path to the entropy socket" >&2;}
9927 { (exit 1); exit 1; }; } 9025 { (exit 1); exit 1; }; }
9928 ;; 9026 ;;
@@ -9930,18 +9028,18 @@ echo "$as_me: error: You must specify an absolute path to the entropy socket" >&
9930 9028
9931 if test ! -z "$withval" ; then 9029 if test ! -z "$withval" ; then
9932 if test ! -z "$PRNGD_PORT" ; then 9030 if test ! -z "$PRNGD_PORT" ; then
9933 { { echo "$as_me:$LINENO: error: You may not specify both a PRNGD/EGD port and socket" >&5 9031 { { echo "$as_me:9031: error: You may not specify both a PRNGD/EGD port and socket" >&5
9934echo "$as_me: error: You may not specify both a PRNGD/EGD port and socket" >&2;} 9032echo "$as_me: error: You may not specify both a PRNGD/EGD port and socket" >&2;}
9935 { (exit 1); exit 1; }; } 9033 { (exit 1); exit 1; }; }
9936 fi 9034 fi
9937 if test ! -r "$withval" ; then 9035 if test ! -r "$withval" ; then
9938 { echo "$as_me:$LINENO: WARNING: Entropy socket is not readable" >&5 9036 { echo "$as_me:9036: WARNING: Entropy socket is not readable" >&5
9939echo "$as_me: WARNING: Entropy socket is not readable" >&2;} 9037echo "$as_me: WARNING: Entropy socket is not readable" >&2;}
9940 fi 9038 fi
9941 PRNGD_SOCKET="$withval" 9039 PRNGD_SOCKET="$withval"
9942 cat >>confdefs.h <<_ACEOF 9040 cat >>confdefs.h <<EOF
9943#define PRNGD_SOCKET "$PRNGD_SOCKET" 9041#define PRNGD_SOCKET "$PRNGD_SOCKET"
9944_ACEOF 9042EOF
9945 9043
9946 fi 9044 fi
9947 9045
@@ -9949,29 +9047,28 @@ else
9949 9047
9950 # Check for existing socket only if we don't have a random device already 9048 # Check for existing socket only if we don't have a random device already
9951 if test "$USE_RAND_HELPER" = yes ; then 9049 if test "$USE_RAND_HELPER" = yes ; then
9952 echo "$as_me:$LINENO: checking for PRNGD/EGD socket" >&5 9050 echo "$as_me:9050: checking for PRNGD/EGD socket" >&5
9953echo $ECHO_N "checking for PRNGD/EGD socket... $ECHO_C" >&6 9051echo $ECHO_N "checking for PRNGD/EGD socket... $ECHO_C" >&6
9954 # Insert other locations here 9052 # Insert other locations here
9955 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do 9053 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
9956 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then 9054 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
9957 PRNGD_SOCKET="$sock" 9055 PRNGD_SOCKET="$sock"
9958 cat >>confdefs.h <<_ACEOF 9056 cat >>confdefs.h <<EOF
9959#define PRNGD_SOCKET "$PRNGD_SOCKET" 9057#define PRNGD_SOCKET "$PRNGD_SOCKET"
9960_ACEOF 9058EOF
9961 9059
9962 break; 9060 break;
9963 fi 9061 fi
9964 done 9062 done
9965 if test ! -z "$PRNGD_SOCKET" ; then 9063 if test ! -z "$PRNGD_SOCKET" ; then
9966 echo "$as_me:$LINENO: result: $PRNGD_SOCKET" >&5 9064 echo "$as_me:9064: result: $PRNGD_SOCKET" >&5
9967echo "${ECHO_T}$PRNGD_SOCKET" >&6 9065echo "${ECHO_T}$PRNGD_SOCKET" >&6
9968 else 9066 else
9969 echo "$as_me:$LINENO: result: not found" >&5 9067 echo "$as_me:9067: result: not found" >&5
9970echo "${ECHO_T}not found" >&6 9068echo "${ECHO_T}not found" >&6
9971 fi 9069 fi
9972 fi 9070 fi
9973 9071
9974
9975fi; 9072fi;
9976 9073
9977# Change default command timeout for hashing entropy source 9074# Change default command timeout for hashing entropy source
@@ -9985,12 +9082,10 @@ if test "${with_entropy_timeout+set}" = set; then
9985 entropy_timeout=$withval 9082 entropy_timeout=$withval
9986 fi 9083 fi
9987 9084
9988
9989fi; 9085fi;
9990cat >>confdefs.h <<_ACEOF 9086cat >>confdefs.h <<EOF
9991#define ENTROPY_TIMEOUT_MSEC $entropy_timeout 9087#define ENTROPY_TIMEOUT_MSEC $entropy_timeout
9992_ACEOF 9088EOF
9993
9994 9089
9995SSH_PRIVSEP_USER=sshd 9090SSH_PRIVSEP_USER=sshd
9996 9091
@@ -10002,13 +9097,10 @@ if test "${with_privsep_user+set}" = set; then
10002 SSH_PRIVSEP_USER=$withval 9097 SSH_PRIVSEP_USER=$withval
10003 fi 9098 fi
10004 9099
10005
10006fi; 9100fi;
10007cat >>confdefs.h <<_ACEOF 9101cat >>confdefs.h <<EOF
10008#define SSH_PRIVSEP_USER "$SSH_PRIVSEP_USER" 9102#define SSH_PRIVSEP_USER "$SSH_PRIVSEP_USER"
10009_ACEOF 9103EOF
10010
10011
10012 9104
10013# We do this little dance with the search path to insure 9105# We do this little dance with the search path to insure
10014# that programs that we select for use by installed programs 9106# that programs that we select for use by installed programs
@@ -10028,7 +9120,7 @@ PATH=$PATH:/etc:$OPATH
10028 9120
10029 # Extract the first word of "ls", so it can be a program name with args. 9121 # Extract the first word of "ls", so it can be a program name with args.
10030set dummy ls; ac_word=$2 9122set dummy ls; ac_word=$2
10031echo "$as_me:$LINENO: checking for $ac_word" >&5 9123echo "$as_me:9123: checking for $ac_word" >&5
10032echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9124echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10033if test "${ac_cv_path_PROG_LS+set}" = set; then 9125if test "${ac_cv_path_PROG_LS+set}" = set; then
10034 echo $ECHO_N "(cached) $ECHO_C" >&6 9126 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10038,18 +9130,16 @@ else
10038 ac_cv_path_PROG_LS="$PROG_LS" # Let the user override the test with a path. 9130 ac_cv_path_PROG_LS="$PROG_LS" # Let the user override the test with a path.
10039 ;; 9131 ;;
10040 *) 9132 *)
10041 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9133 ac_save_IFS=$IFS; IFS=$ac_path_separator
10042for as_dir in $PATH 9134ac_dummy="$PATH"
10043do 9135for ac_dir in $ac_dummy; do
10044 IFS=$as_save_IFS 9136 IFS=$ac_save_IFS
10045 test -z "$as_dir" && as_dir=. 9137 test -z "$ac_dir" && ac_dir=.
10046 for ac_exec_ext in '' $ac_executable_extensions; do 9138 if $as_executable_p "$ac_dir/$ac_word"; then
10047 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9139 ac_cv_path_PROG_LS="$ac_dir/$ac_word"
10048 ac_cv_path_PROG_LS="$as_dir/$ac_word$ac_exec_ext" 9140 echo "$as_me:9140: found $ac_dir/$ac_word" >&5
10049 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9141 break
10050 break 2 9142fi
10051 fi
10052done
10053done 9143done
10054 9144
10055 ;; 9145 ;;
@@ -10058,10 +9148,10 @@ fi
10058PROG_LS=$ac_cv_path_PROG_LS 9148PROG_LS=$ac_cv_path_PROG_LS
10059 9149
10060if test -n "$PROG_LS"; then 9150if test -n "$PROG_LS"; then
10061 echo "$as_me:$LINENO: result: $PROG_LS" >&5 9151 echo "$as_me:9151: result: $PROG_LS" >&5
10062echo "${ECHO_T}$PROG_LS" >&6 9152echo "${ECHO_T}$PROG_LS" >&6
10063else 9153else
10064 echo "$as_me:$LINENO: result: no" >&5 9154 echo "$as_me:9154: result: no" >&5
10065echo "${ECHO_T}no" >&6 9155echo "${ECHO_T}no" >&6
10066fi 9156fi
10067 9157
@@ -10069,11 +9159,9 @@ fi
10069 PROG_LS="undef" 9159 PROG_LS="undef"
10070 fi 9160 fi
10071 9161
10072
10073
10074 # Extract the first word of "netstat", so it can be a program name with args. 9162 # Extract the first word of "netstat", so it can be a program name with args.
10075set dummy netstat; ac_word=$2 9163set dummy netstat; ac_word=$2
10076echo "$as_me:$LINENO: checking for $ac_word" >&5 9164echo "$as_me:9164: checking for $ac_word" >&5
10077echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9165echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10078if test "${ac_cv_path_PROG_NETSTAT+set}" = set; then 9166if test "${ac_cv_path_PROG_NETSTAT+set}" = set; then
10079 echo $ECHO_N "(cached) $ECHO_C" >&6 9167 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10083,18 +9171,16 @@ else
10083 ac_cv_path_PROG_NETSTAT="$PROG_NETSTAT" # Let the user override the test with a path. 9171 ac_cv_path_PROG_NETSTAT="$PROG_NETSTAT" # Let the user override the test with a path.
10084 ;; 9172 ;;
10085 *) 9173 *)
10086 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9174 ac_save_IFS=$IFS; IFS=$ac_path_separator
10087for as_dir in $PATH 9175ac_dummy="$PATH"
10088do 9176for ac_dir in $ac_dummy; do
10089 IFS=$as_save_IFS 9177 IFS=$ac_save_IFS
10090 test -z "$as_dir" && as_dir=. 9178 test -z "$ac_dir" && ac_dir=.
10091 for ac_exec_ext in '' $ac_executable_extensions; do 9179 if $as_executable_p "$ac_dir/$ac_word"; then
10092 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9180 ac_cv_path_PROG_NETSTAT="$ac_dir/$ac_word"
10093 ac_cv_path_PROG_NETSTAT="$as_dir/$ac_word$ac_exec_ext" 9181 echo "$as_me:9181: found $ac_dir/$ac_word" >&5
10094 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9182 break
10095 break 2 9183fi
10096 fi
10097done
10098done 9184done
10099 9185
10100 ;; 9186 ;;
@@ -10103,10 +9189,10 @@ fi
10103PROG_NETSTAT=$ac_cv_path_PROG_NETSTAT 9189PROG_NETSTAT=$ac_cv_path_PROG_NETSTAT
10104 9190
10105if test -n "$PROG_NETSTAT"; then 9191if test -n "$PROG_NETSTAT"; then
10106 echo "$as_me:$LINENO: result: $PROG_NETSTAT" >&5 9192 echo "$as_me:9192: result: $PROG_NETSTAT" >&5
10107echo "${ECHO_T}$PROG_NETSTAT" >&6 9193echo "${ECHO_T}$PROG_NETSTAT" >&6
10108else 9194else
10109 echo "$as_me:$LINENO: result: no" >&5 9195 echo "$as_me:9195: result: no" >&5
10110echo "${ECHO_T}no" >&6 9196echo "${ECHO_T}no" >&6
10111fi 9197fi
10112 9198
@@ -10114,11 +9200,9 @@ fi
10114 PROG_NETSTAT="undef" 9200 PROG_NETSTAT="undef"
10115 fi 9201 fi
10116 9202
10117
10118
10119 # Extract the first word of "arp", so it can be a program name with args. 9203 # Extract the first word of "arp", so it can be a program name with args.
10120set dummy arp; ac_word=$2 9204set dummy arp; ac_word=$2
10121echo "$as_me:$LINENO: checking for $ac_word" >&5 9205echo "$as_me:9205: checking for $ac_word" >&5
10122echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9206echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10123if test "${ac_cv_path_PROG_ARP+set}" = set; then 9207if test "${ac_cv_path_PROG_ARP+set}" = set; then
10124 echo $ECHO_N "(cached) $ECHO_C" >&6 9208 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10128,18 +9212,16 @@ else
10128 ac_cv_path_PROG_ARP="$PROG_ARP" # Let the user override the test with a path. 9212 ac_cv_path_PROG_ARP="$PROG_ARP" # Let the user override the test with a path.
10129 ;; 9213 ;;
10130 *) 9214 *)
10131 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9215 ac_save_IFS=$IFS; IFS=$ac_path_separator
10132for as_dir in $PATH 9216ac_dummy="$PATH"
10133do 9217for ac_dir in $ac_dummy; do
10134 IFS=$as_save_IFS 9218 IFS=$ac_save_IFS
10135 test -z "$as_dir" && as_dir=. 9219 test -z "$ac_dir" && ac_dir=.
10136 for ac_exec_ext in '' $ac_executable_extensions; do 9220 if $as_executable_p "$ac_dir/$ac_word"; then
10137 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9221 ac_cv_path_PROG_ARP="$ac_dir/$ac_word"
10138 ac_cv_path_PROG_ARP="$as_dir/$ac_word$ac_exec_ext" 9222 echo "$as_me:9222: found $ac_dir/$ac_word" >&5
10139 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9223 break
10140 break 2 9224fi
10141 fi
10142done
10143done 9225done
10144 9226
10145 ;; 9227 ;;
@@ -10148,10 +9230,10 @@ fi
10148PROG_ARP=$ac_cv_path_PROG_ARP 9230PROG_ARP=$ac_cv_path_PROG_ARP
10149 9231
10150if test -n "$PROG_ARP"; then 9232if test -n "$PROG_ARP"; then
10151 echo "$as_me:$LINENO: result: $PROG_ARP" >&5 9233 echo "$as_me:9233: result: $PROG_ARP" >&5
10152echo "${ECHO_T}$PROG_ARP" >&6 9234echo "${ECHO_T}$PROG_ARP" >&6
10153else 9235else
10154 echo "$as_me:$LINENO: result: no" >&5 9236 echo "$as_me:9236: result: no" >&5
10155echo "${ECHO_T}no" >&6 9237echo "${ECHO_T}no" >&6
10156fi 9238fi
10157 9239
@@ -10159,11 +9241,9 @@ fi
10159 PROG_ARP="undef" 9241 PROG_ARP="undef"
10160 fi 9242 fi
10161 9243
10162
10163
10164 # Extract the first word of "ifconfig", so it can be a program name with args. 9244 # Extract the first word of "ifconfig", so it can be a program name with args.
10165set dummy ifconfig; ac_word=$2 9245set dummy ifconfig; ac_word=$2
10166echo "$as_me:$LINENO: checking for $ac_word" >&5 9246echo "$as_me:9246: checking for $ac_word" >&5
10167echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9247echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10168if test "${ac_cv_path_PROG_IFCONFIG+set}" = set; then 9248if test "${ac_cv_path_PROG_IFCONFIG+set}" = set; then
10169 echo $ECHO_N "(cached) $ECHO_C" >&6 9249 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10173,18 +9253,16 @@ else
10173 ac_cv_path_PROG_IFCONFIG="$PROG_IFCONFIG" # Let the user override the test with a path. 9253 ac_cv_path_PROG_IFCONFIG="$PROG_IFCONFIG" # Let the user override the test with a path.
10174 ;; 9254 ;;
10175 *) 9255 *)
10176 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9256 ac_save_IFS=$IFS; IFS=$ac_path_separator
10177for as_dir in $PATH 9257ac_dummy="$PATH"
10178do 9258for ac_dir in $ac_dummy; do
10179 IFS=$as_save_IFS 9259 IFS=$ac_save_IFS
10180 test -z "$as_dir" && as_dir=. 9260 test -z "$ac_dir" && ac_dir=.
10181 for ac_exec_ext in '' $ac_executable_extensions; do 9261 if $as_executable_p "$ac_dir/$ac_word"; then
10182 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9262 ac_cv_path_PROG_IFCONFIG="$ac_dir/$ac_word"
10183 ac_cv_path_PROG_IFCONFIG="$as_dir/$ac_word$ac_exec_ext" 9263 echo "$as_me:9263: found $ac_dir/$ac_word" >&5
10184 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9264 break
10185 break 2 9265fi
10186 fi
10187done
10188done 9266done
10189 9267
10190 ;; 9268 ;;
@@ -10193,10 +9271,10 @@ fi
10193PROG_IFCONFIG=$ac_cv_path_PROG_IFCONFIG 9271PROG_IFCONFIG=$ac_cv_path_PROG_IFCONFIG
10194 9272
10195if test -n "$PROG_IFCONFIG"; then 9273if test -n "$PROG_IFCONFIG"; then
10196 echo "$as_me:$LINENO: result: $PROG_IFCONFIG" >&5 9274 echo "$as_me:9274: result: $PROG_IFCONFIG" >&5
10197echo "${ECHO_T}$PROG_IFCONFIG" >&6 9275echo "${ECHO_T}$PROG_IFCONFIG" >&6
10198else 9276else
10199 echo "$as_me:$LINENO: result: no" >&5 9277 echo "$as_me:9277: result: no" >&5
10200echo "${ECHO_T}no" >&6 9278echo "${ECHO_T}no" >&6
10201fi 9279fi
10202 9280
@@ -10204,11 +9282,9 @@ fi
10204 PROG_IFCONFIG="undef" 9282 PROG_IFCONFIG="undef"
10205 fi 9283 fi
10206 9284
10207
10208
10209 # Extract the first word of "jstat", so it can be a program name with args. 9285 # Extract the first word of "jstat", so it can be a program name with args.
10210set dummy jstat; ac_word=$2 9286set dummy jstat; ac_word=$2
10211echo "$as_me:$LINENO: checking for $ac_word" >&5 9287echo "$as_me:9287: checking for $ac_word" >&5
10212echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9288echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10213if test "${ac_cv_path_PROG_JSTAT+set}" = set; then 9289if test "${ac_cv_path_PROG_JSTAT+set}" = set; then
10214 echo $ECHO_N "(cached) $ECHO_C" >&6 9290 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10218,18 +9294,16 @@ else
10218 ac_cv_path_PROG_JSTAT="$PROG_JSTAT" # Let the user override the test with a path. 9294 ac_cv_path_PROG_JSTAT="$PROG_JSTAT" # Let the user override the test with a path.
10219 ;; 9295 ;;
10220 *) 9296 *)
10221 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9297 ac_save_IFS=$IFS; IFS=$ac_path_separator
10222for as_dir in $PATH 9298ac_dummy="$PATH"
10223do 9299for ac_dir in $ac_dummy; do
10224 IFS=$as_save_IFS 9300 IFS=$ac_save_IFS
10225 test -z "$as_dir" && as_dir=. 9301 test -z "$ac_dir" && ac_dir=.
10226 for ac_exec_ext in '' $ac_executable_extensions; do 9302 if $as_executable_p "$ac_dir/$ac_word"; then
10227 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9303 ac_cv_path_PROG_JSTAT="$ac_dir/$ac_word"
10228 ac_cv_path_PROG_JSTAT="$as_dir/$ac_word$ac_exec_ext" 9304 echo "$as_me:9304: found $ac_dir/$ac_word" >&5
10229 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9305 break
10230 break 2 9306fi
10231 fi
10232done
10233done 9307done
10234 9308
10235 ;; 9309 ;;
@@ -10238,10 +9312,10 @@ fi
10238PROG_JSTAT=$ac_cv_path_PROG_JSTAT 9312PROG_JSTAT=$ac_cv_path_PROG_JSTAT
10239 9313
10240if test -n "$PROG_JSTAT"; then 9314if test -n "$PROG_JSTAT"; then
10241 echo "$as_me:$LINENO: result: $PROG_JSTAT" >&5 9315 echo "$as_me:9315: result: $PROG_JSTAT" >&5
10242echo "${ECHO_T}$PROG_JSTAT" >&6 9316echo "${ECHO_T}$PROG_JSTAT" >&6
10243else 9317else
10244 echo "$as_me:$LINENO: result: no" >&5 9318 echo "$as_me:9318: result: no" >&5
10245echo "${ECHO_T}no" >&6 9319echo "${ECHO_T}no" >&6
10246fi 9320fi
10247 9321
@@ -10249,11 +9323,9 @@ fi
10249 PROG_JSTAT="undef" 9323 PROG_JSTAT="undef"
10250 fi 9324 fi
10251 9325
10252
10253
10254 # Extract the first word of "ps", so it can be a program name with args. 9326 # Extract the first word of "ps", so it can be a program name with args.
10255set dummy ps; ac_word=$2 9327set dummy ps; ac_word=$2
10256echo "$as_me:$LINENO: checking for $ac_word" >&5 9328echo "$as_me:9328: checking for $ac_word" >&5
10257echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9329echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10258if test "${ac_cv_path_PROG_PS+set}" = set; then 9330if test "${ac_cv_path_PROG_PS+set}" = set; then
10259 echo $ECHO_N "(cached) $ECHO_C" >&6 9331 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10263,18 +9335,16 @@ else
10263 ac_cv_path_PROG_PS="$PROG_PS" # Let the user override the test with a path. 9335 ac_cv_path_PROG_PS="$PROG_PS" # Let the user override the test with a path.
10264 ;; 9336 ;;
10265 *) 9337 *)
10266 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9338 ac_save_IFS=$IFS; IFS=$ac_path_separator
10267for as_dir in $PATH 9339ac_dummy="$PATH"
10268do 9340for ac_dir in $ac_dummy; do
10269 IFS=$as_save_IFS 9341 IFS=$ac_save_IFS
10270 test -z "$as_dir" && as_dir=. 9342 test -z "$ac_dir" && ac_dir=.
10271 for ac_exec_ext in '' $ac_executable_extensions; do 9343 if $as_executable_p "$ac_dir/$ac_word"; then
10272 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9344 ac_cv_path_PROG_PS="$ac_dir/$ac_word"
10273 ac_cv_path_PROG_PS="$as_dir/$ac_word$ac_exec_ext" 9345 echo "$as_me:9345: found $ac_dir/$ac_word" >&5
10274 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9346 break
10275 break 2 9347fi
10276 fi
10277done
10278done 9348done
10279 9349
10280 ;; 9350 ;;
@@ -10283,10 +9353,10 @@ fi
10283PROG_PS=$ac_cv_path_PROG_PS 9353PROG_PS=$ac_cv_path_PROG_PS
10284 9354
10285if test -n "$PROG_PS"; then 9355if test -n "$PROG_PS"; then
10286 echo "$as_me:$LINENO: result: $PROG_PS" >&5 9356 echo "$as_me:9356: result: $PROG_PS" >&5
10287echo "${ECHO_T}$PROG_PS" >&6 9357echo "${ECHO_T}$PROG_PS" >&6
10288else 9358else
10289 echo "$as_me:$LINENO: result: no" >&5 9359 echo "$as_me:9359: result: no" >&5
10290echo "${ECHO_T}no" >&6 9360echo "${ECHO_T}no" >&6
10291fi 9361fi
10292 9362
@@ -10294,11 +9364,9 @@ fi
10294 PROG_PS="undef" 9364 PROG_PS="undef"
10295 fi 9365 fi
10296 9366
10297
10298
10299 # Extract the first word of "sar", so it can be a program name with args. 9367 # Extract the first word of "sar", so it can be a program name with args.
10300set dummy sar; ac_word=$2 9368set dummy sar; ac_word=$2
10301echo "$as_me:$LINENO: checking for $ac_word" >&5 9369echo "$as_me:9369: checking for $ac_word" >&5
10302echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9370echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10303if test "${ac_cv_path_PROG_SAR+set}" = set; then 9371if test "${ac_cv_path_PROG_SAR+set}" = set; then
10304 echo $ECHO_N "(cached) $ECHO_C" >&6 9372 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10308,18 +9376,16 @@ else
10308 ac_cv_path_PROG_SAR="$PROG_SAR" # Let the user override the test with a path. 9376 ac_cv_path_PROG_SAR="$PROG_SAR" # Let the user override the test with a path.
10309 ;; 9377 ;;
10310 *) 9378 *)
10311 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9379 ac_save_IFS=$IFS; IFS=$ac_path_separator
10312for as_dir in $PATH 9380ac_dummy="$PATH"
10313do 9381for ac_dir in $ac_dummy; do
10314 IFS=$as_save_IFS 9382 IFS=$ac_save_IFS
10315 test -z "$as_dir" && as_dir=. 9383 test -z "$ac_dir" && ac_dir=.
10316 for ac_exec_ext in '' $ac_executable_extensions; do 9384 if $as_executable_p "$ac_dir/$ac_word"; then
10317 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9385 ac_cv_path_PROG_SAR="$ac_dir/$ac_word"
10318 ac_cv_path_PROG_SAR="$as_dir/$ac_word$ac_exec_ext" 9386 echo "$as_me:9386: found $ac_dir/$ac_word" >&5
10319 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9387 break
10320 break 2 9388fi
10321 fi
10322done
10323done 9389done
10324 9390
10325 ;; 9391 ;;
@@ -10328,10 +9394,10 @@ fi
10328PROG_SAR=$ac_cv_path_PROG_SAR 9394PROG_SAR=$ac_cv_path_PROG_SAR
10329 9395
10330if test -n "$PROG_SAR"; then 9396if test -n "$PROG_SAR"; then
10331 echo "$as_me:$LINENO: result: $PROG_SAR" >&5 9397 echo "$as_me:9397: result: $PROG_SAR" >&5
10332echo "${ECHO_T}$PROG_SAR" >&6 9398echo "${ECHO_T}$PROG_SAR" >&6
10333else 9399else
10334 echo "$as_me:$LINENO: result: no" >&5 9400 echo "$as_me:9400: result: no" >&5
10335echo "${ECHO_T}no" >&6 9401echo "${ECHO_T}no" >&6
10336fi 9402fi
10337 9403
@@ -10339,11 +9405,9 @@ fi
10339 PROG_SAR="undef" 9405 PROG_SAR="undef"
10340 fi 9406 fi
10341 9407
10342
10343
10344 # Extract the first word of "w", so it can be a program name with args. 9408 # Extract the first word of "w", so it can be a program name with args.
10345set dummy w; ac_word=$2 9409set dummy w; ac_word=$2
10346echo "$as_me:$LINENO: checking for $ac_word" >&5 9410echo "$as_me:9410: checking for $ac_word" >&5
10347echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9411echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10348if test "${ac_cv_path_PROG_W+set}" = set; then 9412if test "${ac_cv_path_PROG_W+set}" = set; then
10349 echo $ECHO_N "(cached) $ECHO_C" >&6 9413 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10353,18 +9417,16 @@ else
10353 ac_cv_path_PROG_W="$PROG_W" # Let the user override the test with a path. 9417 ac_cv_path_PROG_W="$PROG_W" # Let the user override the test with a path.
10354 ;; 9418 ;;
10355 *) 9419 *)
10356 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9420 ac_save_IFS=$IFS; IFS=$ac_path_separator
10357for as_dir in $PATH 9421ac_dummy="$PATH"
10358do 9422for ac_dir in $ac_dummy; do
10359 IFS=$as_save_IFS 9423 IFS=$ac_save_IFS
10360 test -z "$as_dir" && as_dir=. 9424 test -z "$ac_dir" && ac_dir=.
10361 for ac_exec_ext in '' $ac_executable_extensions; do 9425 if $as_executable_p "$ac_dir/$ac_word"; then
10362 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9426 ac_cv_path_PROG_W="$ac_dir/$ac_word"
10363 ac_cv_path_PROG_W="$as_dir/$ac_word$ac_exec_ext" 9427 echo "$as_me:9427: found $ac_dir/$ac_word" >&5
10364 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9428 break
10365 break 2 9429fi
10366 fi
10367done
10368done 9430done
10369 9431
10370 ;; 9432 ;;
@@ -10373,10 +9435,10 @@ fi
10373PROG_W=$ac_cv_path_PROG_W 9435PROG_W=$ac_cv_path_PROG_W
10374 9436
10375if test -n "$PROG_W"; then 9437if test -n "$PROG_W"; then
10376 echo "$as_me:$LINENO: result: $PROG_W" >&5 9438 echo "$as_me:9438: result: $PROG_W" >&5
10377echo "${ECHO_T}$PROG_W" >&6 9439echo "${ECHO_T}$PROG_W" >&6
10378else 9440else
10379 echo "$as_me:$LINENO: result: no" >&5 9441 echo "$as_me:9441: result: no" >&5
10380echo "${ECHO_T}no" >&6 9442echo "${ECHO_T}no" >&6
10381fi 9443fi
10382 9444
@@ -10384,11 +9446,9 @@ fi
10384 PROG_W="undef" 9446 PROG_W="undef"
10385 fi 9447 fi
10386 9448
10387
10388
10389 # Extract the first word of "who", so it can be a program name with args. 9449 # Extract the first word of "who", so it can be a program name with args.
10390set dummy who; ac_word=$2 9450set dummy who; ac_word=$2
10391echo "$as_me:$LINENO: checking for $ac_word" >&5 9451echo "$as_me:9451: checking for $ac_word" >&5
10392echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9452echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10393if test "${ac_cv_path_PROG_WHO+set}" = set; then 9453if test "${ac_cv_path_PROG_WHO+set}" = set; then
10394 echo $ECHO_N "(cached) $ECHO_C" >&6 9454 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10398,18 +9458,16 @@ else
10398 ac_cv_path_PROG_WHO="$PROG_WHO" # Let the user override the test with a path. 9458 ac_cv_path_PROG_WHO="$PROG_WHO" # Let the user override the test with a path.
10399 ;; 9459 ;;
10400 *) 9460 *)
10401 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9461 ac_save_IFS=$IFS; IFS=$ac_path_separator
10402for as_dir in $PATH 9462ac_dummy="$PATH"
10403do 9463for ac_dir in $ac_dummy; do
10404 IFS=$as_save_IFS 9464 IFS=$ac_save_IFS
10405 test -z "$as_dir" && as_dir=. 9465 test -z "$ac_dir" && ac_dir=.
10406 for ac_exec_ext in '' $ac_executable_extensions; do 9466 if $as_executable_p "$ac_dir/$ac_word"; then
10407 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9467 ac_cv_path_PROG_WHO="$ac_dir/$ac_word"
10408 ac_cv_path_PROG_WHO="$as_dir/$ac_word$ac_exec_ext" 9468 echo "$as_me:9468: found $ac_dir/$ac_word" >&5
10409 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9469 break
10410 break 2 9470fi
10411 fi
10412done
10413done 9471done
10414 9472
10415 ;; 9473 ;;
@@ -10418,10 +9476,10 @@ fi
10418PROG_WHO=$ac_cv_path_PROG_WHO 9476PROG_WHO=$ac_cv_path_PROG_WHO
10419 9477
10420if test -n "$PROG_WHO"; then 9478if test -n "$PROG_WHO"; then
10421 echo "$as_me:$LINENO: result: $PROG_WHO" >&5 9479 echo "$as_me:9479: result: $PROG_WHO" >&5
10422echo "${ECHO_T}$PROG_WHO" >&6 9480echo "${ECHO_T}$PROG_WHO" >&6
10423else 9481else
10424 echo "$as_me:$LINENO: result: no" >&5 9482 echo "$as_me:9482: result: no" >&5
10425echo "${ECHO_T}no" >&6 9483echo "${ECHO_T}no" >&6
10426fi 9484fi
10427 9485
@@ -10429,11 +9487,9 @@ fi
10429 PROG_WHO="undef" 9487 PROG_WHO="undef"
10430 fi 9488 fi
10431 9489
10432
10433
10434 # Extract the first word of "last", so it can be a program name with args. 9490 # Extract the first word of "last", so it can be a program name with args.
10435set dummy last; ac_word=$2 9491set dummy last; ac_word=$2
10436echo "$as_me:$LINENO: checking for $ac_word" >&5 9492echo "$as_me:9492: checking for $ac_word" >&5
10437echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9493echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10438if test "${ac_cv_path_PROG_LAST+set}" = set; then 9494if test "${ac_cv_path_PROG_LAST+set}" = set; then
10439 echo $ECHO_N "(cached) $ECHO_C" >&6 9495 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10443,18 +9499,16 @@ else
10443 ac_cv_path_PROG_LAST="$PROG_LAST" # Let the user override the test with a path. 9499 ac_cv_path_PROG_LAST="$PROG_LAST" # Let the user override the test with a path.
10444 ;; 9500 ;;
10445 *) 9501 *)
10446 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9502 ac_save_IFS=$IFS; IFS=$ac_path_separator
10447for as_dir in $PATH 9503ac_dummy="$PATH"
10448do 9504for ac_dir in $ac_dummy; do
10449 IFS=$as_save_IFS 9505 IFS=$ac_save_IFS
10450 test -z "$as_dir" && as_dir=. 9506 test -z "$ac_dir" && ac_dir=.
10451 for ac_exec_ext in '' $ac_executable_extensions; do 9507 if $as_executable_p "$ac_dir/$ac_word"; then
10452 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9508 ac_cv_path_PROG_LAST="$ac_dir/$ac_word"
10453 ac_cv_path_PROG_LAST="$as_dir/$ac_word$ac_exec_ext" 9509 echo "$as_me:9509: found $ac_dir/$ac_word" >&5
10454 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9510 break
10455 break 2 9511fi
10456 fi
10457done
10458done 9512done
10459 9513
10460 ;; 9514 ;;
@@ -10463,10 +9517,10 @@ fi
10463PROG_LAST=$ac_cv_path_PROG_LAST 9517PROG_LAST=$ac_cv_path_PROG_LAST
10464 9518
10465if test -n "$PROG_LAST"; then 9519if test -n "$PROG_LAST"; then
10466 echo "$as_me:$LINENO: result: $PROG_LAST" >&5 9520 echo "$as_me:9520: result: $PROG_LAST" >&5
10467echo "${ECHO_T}$PROG_LAST" >&6 9521echo "${ECHO_T}$PROG_LAST" >&6
10468else 9522else
10469 echo "$as_me:$LINENO: result: no" >&5 9523 echo "$as_me:9523: result: no" >&5
10470echo "${ECHO_T}no" >&6 9524echo "${ECHO_T}no" >&6
10471fi 9525fi
10472 9526
@@ -10474,11 +9528,9 @@ fi
10474 PROG_LAST="undef" 9528 PROG_LAST="undef"
10475 fi 9529 fi
10476 9530
10477
10478
10479 # Extract the first word of "lastlog", so it can be a program name with args. 9531 # Extract the first word of "lastlog", so it can be a program name with args.
10480set dummy lastlog; ac_word=$2 9532set dummy lastlog; ac_word=$2
10481echo "$as_me:$LINENO: checking for $ac_word" >&5 9533echo "$as_me:9533: checking for $ac_word" >&5
10482echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9534echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10483if test "${ac_cv_path_PROG_LASTLOG+set}" = set; then 9535if test "${ac_cv_path_PROG_LASTLOG+set}" = set; then
10484 echo $ECHO_N "(cached) $ECHO_C" >&6 9536 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10488,18 +9540,16 @@ else
10488 ac_cv_path_PROG_LASTLOG="$PROG_LASTLOG" # Let the user override the test with a path. 9540 ac_cv_path_PROG_LASTLOG="$PROG_LASTLOG" # Let the user override the test with a path.
10489 ;; 9541 ;;
10490 *) 9542 *)
10491 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9543 ac_save_IFS=$IFS; IFS=$ac_path_separator
10492for as_dir in $PATH 9544ac_dummy="$PATH"
10493do 9545for ac_dir in $ac_dummy; do
10494 IFS=$as_save_IFS 9546 IFS=$ac_save_IFS
10495 test -z "$as_dir" && as_dir=. 9547 test -z "$ac_dir" && ac_dir=.
10496 for ac_exec_ext in '' $ac_executable_extensions; do 9548 if $as_executable_p "$ac_dir/$ac_word"; then
10497 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9549 ac_cv_path_PROG_LASTLOG="$ac_dir/$ac_word"
10498 ac_cv_path_PROG_LASTLOG="$as_dir/$ac_word$ac_exec_ext" 9550 echo "$as_me:9550: found $ac_dir/$ac_word" >&5
10499 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9551 break
10500 break 2 9552fi
10501 fi
10502done
10503done 9553done
10504 9554
10505 ;; 9555 ;;
@@ -10508,10 +9558,10 @@ fi
10508PROG_LASTLOG=$ac_cv_path_PROG_LASTLOG 9558PROG_LASTLOG=$ac_cv_path_PROG_LASTLOG
10509 9559
10510if test -n "$PROG_LASTLOG"; then 9560if test -n "$PROG_LASTLOG"; then
10511 echo "$as_me:$LINENO: result: $PROG_LASTLOG" >&5 9561 echo "$as_me:9561: result: $PROG_LASTLOG" >&5
10512echo "${ECHO_T}$PROG_LASTLOG" >&6 9562echo "${ECHO_T}$PROG_LASTLOG" >&6
10513else 9563else
10514 echo "$as_me:$LINENO: result: no" >&5 9564 echo "$as_me:9564: result: no" >&5
10515echo "${ECHO_T}no" >&6 9565echo "${ECHO_T}no" >&6
10516fi 9566fi
10517 9567
@@ -10519,11 +9569,9 @@ fi
10519 PROG_LASTLOG="undef" 9569 PROG_LASTLOG="undef"
10520 fi 9570 fi
10521 9571
10522
10523
10524 # Extract the first word of "df", so it can be a program name with args. 9572 # Extract the first word of "df", so it can be a program name with args.
10525set dummy df; ac_word=$2 9573set dummy df; ac_word=$2
10526echo "$as_me:$LINENO: checking for $ac_word" >&5 9574echo "$as_me:9574: checking for $ac_word" >&5
10527echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9575echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10528if test "${ac_cv_path_PROG_DF+set}" = set; then 9576if test "${ac_cv_path_PROG_DF+set}" = set; then
10529 echo $ECHO_N "(cached) $ECHO_C" >&6 9577 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10533,18 +9581,16 @@ else
10533 ac_cv_path_PROG_DF="$PROG_DF" # Let the user override the test with a path. 9581 ac_cv_path_PROG_DF="$PROG_DF" # Let the user override the test with a path.
10534 ;; 9582 ;;
10535 *) 9583 *)
10536 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9584 ac_save_IFS=$IFS; IFS=$ac_path_separator
10537for as_dir in $PATH 9585ac_dummy="$PATH"
10538do 9586for ac_dir in $ac_dummy; do
10539 IFS=$as_save_IFS 9587 IFS=$ac_save_IFS
10540 test -z "$as_dir" && as_dir=. 9588 test -z "$ac_dir" && ac_dir=.
10541 for ac_exec_ext in '' $ac_executable_extensions; do 9589 if $as_executable_p "$ac_dir/$ac_word"; then
10542 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9590 ac_cv_path_PROG_DF="$ac_dir/$ac_word"
10543 ac_cv_path_PROG_DF="$as_dir/$ac_word$ac_exec_ext" 9591 echo "$as_me:9591: found $ac_dir/$ac_word" >&5
10544 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9592 break
10545 break 2 9593fi
10546 fi
10547done
10548done 9594done
10549 9595
10550 ;; 9596 ;;
@@ -10553,10 +9599,10 @@ fi
10553PROG_DF=$ac_cv_path_PROG_DF 9599PROG_DF=$ac_cv_path_PROG_DF
10554 9600
10555if test -n "$PROG_DF"; then 9601if test -n "$PROG_DF"; then
10556 echo "$as_me:$LINENO: result: $PROG_DF" >&5 9602 echo "$as_me:9602: result: $PROG_DF" >&5
10557echo "${ECHO_T}$PROG_DF" >&6 9603echo "${ECHO_T}$PROG_DF" >&6
10558else 9604else
10559 echo "$as_me:$LINENO: result: no" >&5 9605 echo "$as_me:9605: result: no" >&5
10560echo "${ECHO_T}no" >&6 9606echo "${ECHO_T}no" >&6
10561fi 9607fi
10562 9608
@@ -10564,11 +9610,9 @@ fi
10564 PROG_DF="undef" 9610 PROG_DF="undef"
10565 fi 9611 fi
10566 9612
10567
10568
10569 # Extract the first word of "vmstat", so it can be a program name with args. 9613 # Extract the first word of "vmstat", so it can be a program name with args.
10570set dummy vmstat; ac_word=$2 9614set dummy vmstat; ac_word=$2
10571echo "$as_me:$LINENO: checking for $ac_word" >&5 9615echo "$as_me:9615: checking for $ac_word" >&5
10572echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9616echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10573if test "${ac_cv_path_PROG_VMSTAT+set}" = set; then 9617if test "${ac_cv_path_PROG_VMSTAT+set}" = set; then
10574 echo $ECHO_N "(cached) $ECHO_C" >&6 9618 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10578,18 +9622,16 @@ else
10578 ac_cv_path_PROG_VMSTAT="$PROG_VMSTAT" # Let the user override the test with a path. 9622 ac_cv_path_PROG_VMSTAT="$PROG_VMSTAT" # Let the user override the test with a path.
10579 ;; 9623 ;;
10580 *) 9624 *)
10581 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9625 ac_save_IFS=$IFS; IFS=$ac_path_separator
10582for as_dir in $PATH 9626ac_dummy="$PATH"
10583do 9627for ac_dir in $ac_dummy; do
10584 IFS=$as_save_IFS 9628 IFS=$ac_save_IFS
10585 test -z "$as_dir" && as_dir=. 9629 test -z "$ac_dir" && ac_dir=.
10586 for ac_exec_ext in '' $ac_executable_extensions; do 9630 if $as_executable_p "$ac_dir/$ac_word"; then
10587 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9631 ac_cv_path_PROG_VMSTAT="$ac_dir/$ac_word"
10588 ac_cv_path_PROG_VMSTAT="$as_dir/$ac_word$ac_exec_ext" 9632 echo "$as_me:9632: found $ac_dir/$ac_word" >&5
10589 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9633 break
10590 break 2 9634fi
10591 fi
10592done
10593done 9635done
10594 9636
10595 ;; 9637 ;;
@@ -10598,10 +9640,10 @@ fi
10598PROG_VMSTAT=$ac_cv_path_PROG_VMSTAT 9640PROG_VMSTAT=$ac_cv_path_PROG_VMSTAT
10599 9641
10600if test -n "$PROG_VMSTAT"; then 9642if test -n "$PROG_VMSTAT"; then
10601 echo "$as_me:$LINENO: result: $PROG_VMSTAT" >&5 9643 echo "$as_me:9643: result: $PROG_VMSTAT" >&5
10602echo "${ECHO_T}$PROG_VMSTAT" >&6 9644echo "${ECHO_T}$PROG_VMSTAT" >&6
10603else 9645else
10604 echo "$as_me:$LINENO: result: no" >&5 9646 echo "$as_me:9646: result: no" >&5
10605echo "${ECHO_T}no" >&6 9647echo "${ECHO_T}no" >&6
10606fi 9648fi
10607 9649
@@ -10609,11 +9651,9 @@ fi
10609 PROG_VMSTAT="undef" 9651 PROG_VMSTAT="undef"
10610 fi 9652 fi
10611 9653
10612
10613
10614 # Extract the first word of "uptime", so it can be a program name with args. 9654 # Extract the first word of "uptime", so it can be a program name with args.
10615set dummy uptime; ac_word=$2 9655set dummy uptime; ac_word=$2
10616echo "$as_me:$LINENO: checking for $ac_word" >&5 9656echo "$as_me:9656: checking for $ac_word" >&5
10617echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9657echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10618if test "${ac_cv_path_PROG_UPTIME+set}" = set; then 9658if test "${ac_cv_path_PROG_UPTIME+set}" = set; then
10619 echo $ECHO_N "(cached) $ECHO_C" >&6 9659 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10623,18 +9663,16 @@ else
10623 ac_cv_path_PROG_UPTIME="$PROG_UPTIME" # Let the user override the test with a path. 9663 ac_cv_path_PROG_UPTIME="$PROG_UPTIME" # Let the user override the test with a path.
10624 ;; 9664 ;;
10625 *) 9665 *)
10626 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9666 ac_save_IFS=$IFS; IFS=$ac_path_separator
10627for as_dir in $PATH 9667ac_dummy="$PATH"
10628do 9668for ac_dir in $ac_dummy; do
10629 IFS=$as_save_IFS 9669 IFS=$ac_save_IFS
10630 test -z "$as_dir" && as_dir=. 9670 test -z "$ac_dir" && ac_dir=.
10631 for ac_exec_ext in '' $ac_executable_extensions; do 9671 if $as_executable_p "$ac_dir/$ac_word"; then
10632 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9672 ac_cv_path_PROG_UPTIME="$ac_dir/$ac_word"
10633 ac_cv_path_PROG_UPTIME="$as_dir/$ac_word$ac_exec_ext" 9673 echo "$as_me:9673: found $ac_dir/$ac_word" >&5
10634 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9674 break
10635 break 2 9675fi
10636 fi
10637done
10638done 9676done
10639 9677
10640 ;; 9678 ;;
@@ -10643,10 +9681,10 @@ fi
10643PROG_UPTIME=$ac_cv_path_PROG_UPTIME 9681PROG_UPTIME=$ac_cv_path_PROG_UPTIME
10644 9682
10645if test -n "$PROG_UPTIME"; then 9683if test -n "$PROG_UPTIME"; then
10646 echo "$as_me:$LINENO: result: $PROG_UPTIME" >&5 9684 echo "$as_me:9684: result: $PROG_UPTIME" >&5
10647echo "${ECHO_T}$PROG_UPTIME" >&6 9685echo "${ECHO_T}$PROG_UPTIME" >&6
10648else 9686else
10649 echo "$as_me:$LINENO: result: no" >&5 9687 echo "$as_me:9687: result: no" >&5
10650echo "${ECHO_T}no" >&6 9688echo "${ECHO_T}no" >&6
10651fi 9689fi
10652 9690
@@ -10654,11 +9692,9 @@ fi
10654 PROG_UPTIME="undef" 9692 PROG_UPTIME="undef"
10655 fi 9693 fi
10656 9694
10657
10658
10659 # Extract the first word of "ipcs", so it can be a program name with args. 9695 # Extract the first word of "ipcs", so it can be a program name with args.
10660set dummy ipcs; ac_word=$2 9696set dummy ipcs; ac_word=$2
10661echo "$as_me:$LINENO: checking for $ac_word" >&5 9697echo "$as_me:9697: checking for $ac_word" >&5
10662echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9698echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10663if test "${ac_cv_path_PROG_IPCS+set}" = set; then 9699if test "${ac_cv_path_PROG_IPCS+set}" = set; then
10664 echo $ECHO_N "(cached) $ECHO_C" >&6 9700 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10668,18 +9704,16 @@ else
10668 ac_cv_path_PROG_IPCS="$PROG_IPCS" # Let the user override the test with a path. 9704 ac_cv_path_PROG_IPCS="$PROG_IPCS" # Let the user override the test with a path.
10669 ;; 9705 ;;
10670 *) 9706 *)
10671 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9707 ac_save_IFS=$IFS; IFS=$ac_path_separator
10672for as_dir in $PATH 9708ac_dummy="$PATH"
10673do 9709for ac_dir in $ac_dummy; do
10674 IFS=$as_save_IFS 9710 IFS=$ac_save_IFS
10675 test -z "$as_dir" && as_dir=. 9711 test -z "$ac_dir" && ac_dir=.
10676 for ac_exec_ext in '' $ac_executable_extensions; do 9712 if $as_executable_p "$ac_dir/$ac_word"; then
10677 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9713 ac_cv_path_PROG_IPCS="$ac_dir/$ac_word"
10678 ac_cv_path_PROG_IPCS="$as_dir/$ac_word$ac_exec_ext" 9714 echo "$as_me:9714: found $ac_dir/$ac_word" >&5
10679 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9715 break
10680 break 2 9716fi
10681 fi
10682done
10683done 9717done
10684 9718
10685 ;; 9719 ;;
@@ -10688,10 +9722,10 @@ fi
10688PROG_IPCS=$ac_cv_path_PROG_IPCS 9722PROG_IPCS=$ac_cv_path_PROG_IPCS
10689 9723
10690if test -n "$PROG_IPCS"; then 9724if test -n "$PROG_IPCS"; then
10691 echo "$as_me:$LINENO: result: $PROG_IPCS" >&5 9725 echo "$as_me:9725: result: $PROG_IPCS" >&5
10692echo "${ECHO_T}$PROG_IPCS" >&6 9726echo "${ECHO_T}$PROG_IPCS" >&6
10693else 9727else
10694 echo "$as_me:$LINENO: result: no" >&5 9728 echo "$as_me:9728: result: no" >&5
10695echo "${ECHO_T}no" >&6 9729echo "${ECHO_T}no" >&6
10696fi 9730fi
10697 9731
@@ -10699,11 +9733,9 @@ fi
10699 PROG_IPCS="undef" 9733 PROG_IPCS="undef"
10700 fi 9734 fi
10701 9735
10702
10703
10704 # Extract the first word of "tail", so it can be a program name with args. 9736 # Extract the first word of "tail", so it can be a program name with args.
10705set dummy tail; ac_word=$2 9737set dummy tail; ac_word=$2
10706echo "$as_me:$LINENO: checking for $ac_word" >&5 9738echo "$as_me:9738: checking for $ac_word" >&5
10707echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 9739echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10708if test "${ac_cv_path_PROG_TAIL+set}" = set; then 9740if test "${ac_cv_path_PROG_TAIL+set}" = set; then
10709 echo $ECHO_N "(cached) $ECHO_C" >&6 9741 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -10713,18 +9745,16 @@ else
10713 ac_cv_path_PROG_TAIL="$PROG_TAIL" # Let the user override the test with a path. 9745 ac_cv_path_PROG_TAIL="$PROG_TAIL" # Let the user override the test with a path.
10714 ;; 9746 ;;
10715 *) 9747 *)
10716 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 9748 ac_save_IFS=$IFS; IFS=$ac_path_separator
10717for as_dir in $PATH 9749ac_dummy="$PATH"
10718do 9750for ac_dir in $ac_dummy; do
10719 IFS=$as_save_IFS 9751 IFS=$ac_save_IFS
10720 test -z "$as_dir" && as_dir=. 9752 test -z "$ac_dir" && ac_dir=.
10721 for ac_exec_ext in '' $ac_executable_extensions; do 9753 if $as_executable_p "$ac_dir/$ac_word"; then
10722 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 9754 ac_cv_path_PROG_TAIL="$ac_dir/$ac_word"
10723 ac_cv_path_PROG_TAIL="$as_dir/$ac_word$ac_exec_ext" 9755 echo "$as_me:9755: found $ac_dir/$ac_word" >&5
10724 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 9756 break
10725 break 2 9757fi
10726 fi
10727done
10728done 9758done
10729 9759
10730 ;; 9760 ;;
@@ -10733,10 +9763,10 @@ fi
10733PROG_TAIL=$ac_cv_path_PROG_TAIL 9763PROG_TAIL=$ac_cv_path_PROG_TAIL
10734 9764
10735if test -n "$PROG_TAIL"; then 9765if test -n "$PROG_TAIL"; then
10736 echo "$as_me:$LINENO: result: $PROG_TAIL" >&5 9766 echo "$as_me:9766: result: $PROG_TAIL" >&5
10737echo "${ECHO_T}$PROG_TAIL" >&6 9767echo "${ECHO_T}$PROG_TAIL" >&6
10738else 9768else
10739 echo "$as_me:$LINENO: result: no" >&5 9769 echo "$as_me:9769: result: no" >&5
10740echo "${ECHO_T}no" >&6 9770echo "${ECHO_T}no" >&6
10741fi 9771fi
10742 9772
@@ -10744,7 +9774,6 @@ fi
10744 PROG_TAIL="undef" 9774 PROG_TAIL="undef"
10745 fi 9775 fi
10746 9776
10747
10748# restore PATH 9777# restore PATH
10749PATH=$OPATH 9778PATH=$OPATH
10750 9779
@@ -10762,26 +9791,20 @@ if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
10762 fi 9791 fi
10763fi 9792fi
10764 9793
10765
10766
10767# Cheap hack to ensure NEWS-OS libraries are arranged right. 9794# Cheap hack to ensure NEWS-OS libraries are arranged right.
10768if test ! -z "$SONY" ; then 9795if test ! -z "$SONY" ; then
10769 LIBS="$LIBS -liberty"; 9796 LIBS="$LIBS -liberty";
10770fi 9797fi
10771 9798
10772# Checks for data types 9799# Checks for data types
10773echo "$as_me:$LINENO: checking for char" >&5 9800echo "$as_me:9800: checking for char" >&5
10774echo $ECHO_N "checking for char... $ECHO_C" >&6 9801echo $ECHO_N "checking for char... $ECHO_C" >&6
10775if test "${ac_cv_type_char+set}" = set; then 9802if test "${ac_cv_type_char+set}" = set; then
10776 echo $ECHO_N "(cached) $ECHO_C" >&6 9803 echo $ECHO_N "(cached) $ECHO_C" >&6
10777else 9804else
10778 cat >conftest.$ac_ext <<_ACEOF 9805 cat >conftest.$ac_ext <<_ACEOF
10779#line $LINENO "configure" 9806#line 9806 "configure"
10780/* confdefs.h. */ 9807#include "confdefs.h"
10781_ACEOF
10782cat confdefs.h >>conftest.$ac_ext
10783cat >>conftest.$ac_ext <<_ACEOF
10784/* end confdefs.h. */
10785$ac_includes_default 9808$ac_includes_default
10786int 9809int
10787main () 9810main ()
@@ -10795,328 +9818,209 @@ if (sizeof (char))
10795} 9818}
10796_ACEOF 9819_ACEOF
10797rm -f conftest.$ac_objext 9820rm -f conftest.$ac_objext
10798if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 9821if { (eval echo "$as_me:9821: \"$ac_compile\"") >&5
10799 (eval $ac_compile) 2>&5 9822 (eval $ac_compile) 2>&5
10800 ac_status=$? 9823 ac_status=$?
10801 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9824 echo "$as_me:9824: \$? = $ac_status" >&5
10802 (exit $ac_status); } && 9825 (exit $ac_status); } &&
10803 { ac_try='test -s conftest.$ac_objext' 9826 { ac_try='test -s conftest.$ac_objext'
10804 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 9827 { (eval echo "$as_me:9827: \"$ac_try\"") >&5
10805 (eval $ac_try) 2>&5 9828 (eval $ac_try) 2>&5
10806 ac_status=$? 9829 ac_status=$?
10807 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9830 echo "$as_me:9830: \$? = $ac_status" >&5
10808 (exit $ac_status); }; }; then 9831 (exit $ac_status); }; }; then
10809 ac_cv_type_char=yes 9832 ac_cv_type_char=yes
10810else 9833else
10811 echo "$as_me: failed program was:" >&5 9834 echo "$as_me: failed program was:" >&5
10812sed 's/^/| /' conftest.$ac_ext >&5 9835cat conftest.$ac_ext >&5
10813
10814ac_cv_type_char=no 9836ac_cv_type_char=no
10815fi 9837fi
10816rm -f conftest.$ac_objext conftest.$ac_ext 9838rm -f conftest.$ac_objext conftest.$ac_ext
10817fi 9839fi
10818echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 9840echo "$as_me:9840: result: $ac_cv_type_char" >&5
10819echo "${ECHO_T}$ac_cv_type_char" >&6 9841echo "${ECHO_T}$ac_cv_type_char" >&6
10820 9842
10821echo "$as_me:$LINENO: checking size of char" >&5 9843echo "$as_me:9843: checking size of char" >&5
10822echo $ECHO_N "checking size of char... $ECHO_C" >&6 9844echo $ECHO_N "checking size of char... $ECHO_C" >&6
10823if test "${ac_cv_sizeof_char+set}" = set; then 9845if test "${ac_cv_sizeof_char+set}" = set; then
10824 echo $ECHO_N "(cached) $ECHO_C" >&6 9846 echo $ECHO_N "(cached) $ECHO_C" >&6
10825else 9847else
10826 if test "$ac_cv_type_char" = yes; then 9848 if test "$ac_cv_type_char" = yes; then
10827 # The cast to unsigned long works around a bug in the HP C Compiler
10828 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
10829 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
10830 # This bug is HP SR number 8606223364.
10831 if test "$cross_compiling" = yes; then 9849 if test "$cross_compiling" = yes; then
10832 # Depending upon the size, compute the lo and hi bounds. 9850 # Depending upon the size, compute the lo and hi bounds.
10833cat >conftest.$ac_ext <<_ACEOF 9851cat >conftest.$ac_ext <<_ACEOF
10834#line $LINENO "configure" 9852#line 9852 "configure"
10835/* confdefs.h. */ 9853#include "confdefs.h"
10836_ACEOF
10837cat confdefs.h >>conftest.$ac_ext
10838cat >>conftest.$ac_ext <<_ACEOF
10839/* end confdefs.h. */
10840$ac_includes_default 9854$ac_includes_default
10841int 9855int
10842main () 9856main ()
10843{ 9857{
10844static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; 9858int _array_ [1 - 2 * !((sizeof (char)) >= 0)]
10845test_array [0] = 0
10846
10847 ; 9859 ;
10848 return 0; 9860 return 0;
10849} 9861}
10850_ACEOF 9862_ACEOF
10851rm -f conftest.$ac_objext 9863rm -f conftest.$ac_objext
10852if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 9864if { (eval echo "$as_me:9864: \"$ac_compile\"") >&5
10853 (eval $ac_compile) 2>&5 9865 (eval $ac_compile) 2>&5
10854 ac_status=$? 9866 ac_status=$?
10855 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9867 echo "$as_me:9867: \$? = $ac_status" >&5
10856 (exit $ac_status); } && 9868 (exit $ac_status); } &&
10857 { ac_try='test -s conftest.$ac_objext' 9869 { ac_try='test -s conftest.$ac_objext'
10858 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 9870 { (eval echo "$as_me:9870: \"$ac_try\"") >&5
10859 (eval $ac_try) 2>&5 9871 (eval $ac_try) 2>&5
10860 ac_status=$? 9872 ac_status=$?
10861 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9873 echo "$as_me:9873: \$? = $ac_status" >&5
10862 (exit $ac_status); }; }; then 9874 (exit $ac_status); }; }; then
10863 ac_lo=0 ac_mid=0 9875 ac_lo=0 ac_mid=0
10864 while :; do 9876 while :; do
10865 cat >conftest.$ac_ext <<_ACEOF 9877 cat >conftest.$ac_ext <<_ACEOF
10866#line $LINENO "configure" 9878#line 9878 "configure"
10867/* confdefs.h. */ 9879#include "confdefs.h"
10868_ACEOF
10869cat confdefs.h >>conftest.$ac_ext
10870cat >>conftest.$ac_ext <<_ACEOF
10871/* end confdefs.h. */
10872$ac_includes_default 9880$ac_includes_default
10873int 9881int
10874main () 9882main ()
10875{ 9883{
10876static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; 9884int _array_ [1 - 2 * !((sizeof (char)) <= $ac_mid)]
10877test_array [0] = 0
10878
10879 ; 9885 ;
10880 return 0; 9886 return 0;
10881} 9887}
10882_ACEOF 9888_ACEOF
10883rm -f conftest.$ac_objext 9889rm -f conftest.$ac_objext
10884if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 9890if { (eval echo "$as_me:9890: \"$ac_compile\"") >&5
10885 (eval $ac_compile) 2>&5 9891 (eval $ac_compile) 2>&5
10886 ac_status=$? 9892 ac_status=$?
10887 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9893 echo "$as_me:9893: \$? = $ac_status" >&5
10888 (exit $ac_status); } && 9894 (exit $ac_status); } &&
10889 { ac_try='test -s conftest.$ac_objext' 9895 { ac_try='test -s conftest.$ac_objext'
10890 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 9896 { (eval echo "$as_me:9896: \"$ac_try\"") >&5
10891 (eval $ac_try) 2>&5 9897 (eval $ac_try) 2>&5
10892 ac_status=$? 9898 ac_status=$?
10893 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9899 echo "$as_me:9899: \$? = $ac_status" >&5
10894 (exit $ac_status); }; }; then 9900 (exit $ac_status); }; }; then
10895 ac_hi=$ac_mid; break 9901 ac_hi=$ac_mid; break
10896else 9902else
10897 echo "$as_me: failed program was:" >&5 9903 echo "$as_me: failed program was:" >&5
10898sed 's/^/| /' conftest.$ac_ext >&5 9904cat conftest.$ac_ext >&5
10899 9905ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
10900ac_lo=`expr $ac_mid + 1`
10901 if test $ac_lo -le $ac_mid; then
10902 ac_lo= ac_hi=
10903 break
10904 fi
10905 ac_mid=`expr 2 '*' $ac_mid + 1`
10906fi 9906fi
10907rm -f conftest.$ac_objext conftest.$ac_ext 9907rm -f conftest.$ac_objext conftest.$ac_ext
10908 done 9908 done
10909else 9909else
10910 echo "$as_me: failed program was:" >&5 9910 echo "$as_me: failed program was:" >&5
10911sed 's/^/| /' conftest.$ac_ext >&5 9911cat conftest.$ac_ext >&5
10912 9912ac_hi=-1 ac_mid=-1
10913cat >conftest.$ac_ext <<_ACEOF
10914#line $LINENO "configure"
10915/* confdefs.h. */
10916_ACEOF
10917cat confdefs.h >>conftest.$ac_ext
10918cat >>conftest.$ac_ext <<_ACEOF
10919/* end confdefs.h. */
10920$ac_includes_default
10921int
10922main ()
10923{
10924static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)];
10925test_array [0] = 0
10926
10927 ;
10928 return 0;
10929}
10930_ACEOF
10931rm -f conftest.$ac_objext
10932if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10933 (eval $ac_compile) 2>&5
10934 ac_status=$?
10935 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10936 (exit $ac_status); } &&
10937 { ac_try='test -s conftest.$ac_objext'
10938 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10939 (eval $ac_try) 2>&5
10940 ac_status=$?
10941 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10942 (exit $ac_status); }; }; then
10943 ac_hi=-1 ac_mid=-1
10944 while :; do 9913 while :; do
10945 cat >conftest.$ac_ext <<_ACEOF 9914 cat >conftest.$ac_ext <<_ACEOF
10946#line $LINENO "configure" 9915#line 9915 "configure"
10947/* confdefs.h. */ 9916#include "confdefs.h"
10948_ACEOF
10949cat confdefs.h >>conftest.$ac_ext
10950cat >>conftest.$ac_ext <<_ACEOF
10951/* end confdefs.h. */
10952$ac_includes_default 9917$ac_includes_default
10953int 9918int
10954main () 9919main ()
10955{ 9920{
10956static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; 9921int _array_ [1 - 2 * !((sizeof (char)) >= $ac_mid)]
10957test_array [0] = 0
10958
10959 ; 9922 ;
10960 return 0; 9923 return 0;
10961} 9924}
10962_ACEOF 9925_ACEOF
10963rm -f conftest.$ac_objext 9926rm -f conftest.$ac_objext
10964if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 9927if { (eval echo "$as_me:9927: \"$ac_compile\"") >&5
10965 (eval $ac_compile) 2>&5 9928 (eval $ac_compile) 2>&5
10966 ac_status=$? 9929 ac_status=$?
10967 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9930 echo "$as_me:9930: \$? = $ac_status" >&5
10968 (exit $ac_status); } && 9931 (exit $ac_status); } &&
10969 { ac_try='test -s conftest.$ac_objext' 9932 { ac_try='test -s conftest.$ac_objext'
10970 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 9933 { (eval echo "$as_me:9933: \"$ac_try\"") >&5
10971 (eval $ac_try) 2>&5 9934 (eval $ac_try) 2>&5
10972 ac_status=$? 9935 ac_status=$?
10973 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9936 echo "$as_me:9936: \$? = $ac_status" >&5
10974 (exit $ac_status); }; }; then 9937 (exit $ac_status); }; }; then
10975 ac_lo=$ac_mid; break 9938 ac_lo=$ac_mid; break
10976else 9939else
10977 echo "$as_me: failed program was:" >&5 9940 echo "$as_me: failed program was:" >&5
10978sed 's/^/| /' conftest.$ac_ext >&5 9941cat conftest.$ac_ext >&5
10979 9942ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
10980ac_hi=`expr '(' $ac_mid ')' - 1`
10981 if test $ac_mid -le $ac_hi; then
10982 ac_lo= ac_hi=
10983 break
10984 fi
10985 ac_mid=`expr 2 '*' $ac_mid`
10986fi 9943fi
10987rm -f conftest.$ac_objext conftest.$ac_ext 9944rm -f conftest.$ac_objext conftest.$ac_ext
10988 done 9945 done
10989else
10990 echo "$as_me: failed program was:" >&5
10991sed 's/^/| /' conftest.$ac_ext >&5
10992
10993ac_lo= ac_hi=
10994fi
10995rm -f conftest.$ac_objext conftest.$ac_ext
10996fi 9946fi
10997rm -f conftest.$ac_objext conftest.$ac_ext 9947rm -f conftest.$ac_objext conftest.$ac_ext
10998# Binary search between lo and hi bounds. 9948# Binary search between lo and hi bounds.
10999while test "x$ac_lo" != "x$ac_hi"; do 9949while test "x$ac_lo" != "x$ac_hi"; do
11000 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 9950 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
11001 cat >conftest.$ac_ext <<_ACEOF 9951 cat >conftest.$ac_ext <<_ACEOF
11002#line $LINENO "configure" 9952#line 9952 "configure"
11003/* confdefs.h. */ 9953#include "confdefs.h"
11004_ACEOF
11005cat confdefs.h >>conftest.$ac_ext
11006cat >>conftest.$ac_ext <<_ACEOF
11007/* end confdefs.h. */
11008$ac_includes_default 9954$ac_includes_default
11009int 9955int
11010main () 9956main ()
11011{ 9957{
11012static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; 9958int _array_ [1 - 2 * !((sizeof (char)) <= $ac_mid)]
11013test_array [0] = 0
11014
11015 ; 9959 ;
11016 return 0; 9960 return 0;
11017} 9961}
11018_ACEOF 9962_ACEOF
11019rm -f conftest.$ac_objext 9963rm -f conftest.$ac_objext
11020if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 9964if { (eval echo "$as_me:9964: \"$ac_compile\"") >&5
11021 (eval $ac_compile) 2>&5 9965 (eval $ac_compile) 2>&5
11022 ac_status=$? 9966 ac_status=$?
11023 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9967 echo "$as_me:9967: \$? = $ac_status" >&5
11024 (exit $ac_status); } && 9968 (exit $ac_status); } &&
11025 { ac_try='test -s conftest.$ac_objext' 9969 { ac_try='test -s conftest.$ac_objext'
11026 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 9970 { (eval echo "$as_me:9970: \"$ac_try\"") >&5
11027 (eval $ac_try) 2>&5 9971 (eval $ac_try) 2>&5
11028 ac_status=$? 9972 ac_status=$?
11029 echo "$as_me:$LINENO: \$? = $ac_status" >&5 9973 echo "$as_me:9973: \$? = $ac_status" >&5
11030 (exit $ac_status); }; }; then 9974 (exit $ac_status); }; }; then
11031 ac_hi=$ac_mid 9975 ac_hi=$ac_mid
11032else 9976else
11033 echo "$as_me: failed program was:" >&5 9977 echo "$as_me: failed program was:" >&5
11034sed 's/^/| /' conftest.$ac_ext >&5 9978cat conftest.$ac_ext >&5
11035 9979ac_lo=`expr $ac_mid + 1`
11036ac_lo=`expr '(' $ac_mid ')' + 1`
11037fi 9980fi
11038rm -f conftest.$ac_objext conftest.$ac_ext 9981rm -f conftest.$ac_objext conftest.$ac_ext
11039done 9982done
11040case $ac_lo in 9983ac_cv_sizeof_char=$ac_lo
11041?*) ac_cv_sizeof_char=$ac_lo;;
11042'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
11043See \`config.log' for more details." >&5
11044echo "$as_me: error: cannot compute sizeof (char), 77
11045See \`config.log' for more details." >&2;}
11046 { (exit 1); exit 1; }; } ;;
11047esac
11048else 9984else
11049 if test "$cross_compiling" = yes; then 9985 if test "$cross_compiling" = yes; then
11050 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 9986 { { echo "$as_me:9986: error: cannot run test program while cross compiling" >&5
11051See \`config.log' for more details." >&5 9987echo "$as_me: error: cannot run test program while cross compiling" >&2;}
11052echo "$as_me: error: cannot run test program while cross compiling
11053See \`config.log' for more details." >&2;}
11054 { (exit 1); exit 1; }; } 9988 { (exit 1); exit 1; }; }
11055else 9989else
11056 cat >conftest.$ac_ext <<_ACEOF 9990 cat >conftest.$ac_ext <<_ACEOF
11057#line $LINENO "configure" 9991#line 9991 "configure"
11058/* confdefs.h. */ 9992#include "confdefs.h"
11059_ACEOF
11060cat confdefs.h >>conftest.$ac_ext
11061cat >>conftest.$ac_ext <<_ACEOF
11062/* end confdefs.h. */
11063$ac_includes_default 9993$ac_includes_default
11064long longval () { return (long) (sizeof (char)); }
11065unsigned long ulongval () { return (long) (sizeof (char)); }
11066#include <stdio.h>
11067#include <stdlib.h>
11068int 9994int
11069main () 9995main ()
11070{ 9996{
11071 9997FILE *f = fopen ("conftest.val", "w");
11072 FILE *f = fopen ("conftest.val", "w"); 9998if (!f)
11073 if (! f) 9999 exit (1);
11074 exit (1); 10000fprintf (f, "%d", (sizeof (char)));
11075 if (((long) (sizeof (char))) < 0) 10001fclose (f);
11076 {
11077 long i = longval ();
11078 if (i != ((long) (sizeof (char))))
11079 exit (1);
11080 fprintf (f, "%ld\n", i);
11081 }
11082 else
11083 {
11084 unsigned long i = ulongval ();
11085 if (i != ((long) (sizeof (char))))
11086 exit (1);
11087 fprintf (f, "%lu\n", i);
11088 }
11089 exit (ferror (f) || fclose (f) != 0);
11090
11091 ; 10002 ;
11092 return 0; 10003 return 0;
11093} 10004}
11094_ACEOF 10005_ACEOF
11095rm -f conftest$ac_exeext 10006rm -f conftest$ac_exeext
11096if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 10007if { (eval echo "$as_me:10007: \"$ac_link\"") >&5
11097 (eval $ac_link) 2>&5 10008 (eval $ac_link) 2>&5
11098 ac_status=$? 10009 ac_status=$?
11099 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10010 echo "$as_me:10010: \$? = $ac_status" >&5
11100 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 10011 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11101 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10012 { (eval echo "$as_me:10012: \"$ac_try\"") >&5
11102 (eval $ac_try) 2>&5 10013 (eval $ac_try) 2>&5
11103 ac_status=$? 10014 ac_status=$?
11104 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10015 echo "$as_me:10015: \$? = $ac_status" >&5
11105 (exit $ac_status); }; }; then 10016 (exit $ac_status); }; }; then
11106 ac_cv_sizeof_char=`cat conftest.val` 10017 ac_cv_sizeof_char=`cat conftest.val`
11107else 10018else
11108 echo "$as_me: program exited with status $ac_status" >&5 10019 echo "$as_me: program exited with status $ac_status" >&5
11109echo "$as_me: failed program was:" >&5 10020echo "$as_me: failed program was:" >&5
11110sed 's/^/| /' conftest.$ac_ext >&5 10021cat conftest.$ac_ext >&5
11111
11112( exit $ac_status )
11113{ { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77
11114See \`config.log' for more details." >&5
11115echo "$as_me: error: cannot compute sizeof (char), 77
11116See \`config.log' for more details." >&2;}
11117 { (exit 1); exit 1; }; }
11118fi 10022fi
11119rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 10023rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11120fi 10024fi
11121fi 10025fi
11122rm -f conftest.val 10026rm -f conftest.val
@@ -11124,25 +10028,20 @@ else
11124 ac_cv_sizeof_char=0 10028 ac_cv_sizeof_char=0
11125fi 10029fi
11126fi 10030fi
11127echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 10031echo "$as_me:10031: result: $ac_cv_sizeof_char" >&5
11128echo "${ECHO_T}$ac_cv_sizeof_char" >&6 10032echo "${ECHO_T}$ac_cv_sizeof_char" >&6
11129cat >>confdefs.h <<_ACEOF 10033cat >>confdefs.h <<EOF
11130#define SIZEOF_CHAR $ac_cv_sizeof_char 10034#define SIZEOF_CHAR $ac_cv_sizeof_char
11131_ACEOF 10035EOF
11132
11133 10036
11134echo "$as_me:$LINENO: checking for short int" >&5 10037echo "$as_me:10037: checking for short int" >&5
11135echo $ECHO_N "checking for short int... $ECHO_C" >&6 10038echo $ECHO_N "checking for short int... $ECHO_C" >&6
11136if test "${ac_cv_type_short_int+set}" = set; then 10039if test "${ac_cv_type_short_int+set}" = set; then
11137 echo $ECHO_N "(cached) $ECHO_C" >&6 10040 echo $ECHO_N "(cached) $ECHO_C" >&6
11138else 10041else
11139 cat >conftest.$ac_ext <<_ACEOF 10042 cat >conftest.$ac_ext <<_ACEOF
11140#line $LINENO "configure" 10043#line 10043 "configure"
11141/* confdefs.h. */ 10044#include "confdefs.h"
11142_ACEOF
11143cat confdefs.h >>conftest.$ac_ext
11144cat >>conftest.$ac_ext <<_ACEOF
11145/* end confdefs.h. */
11146$ac_includes_default 10045$ac_includes_default
11147int 10046int
11148main () 10047main ()
@@ -11156,328 +10055,209 @@ if (sizeof (short int))
11156} 10055}
11157_ACEOF 10056_ACEOF
11158rm -f conftest.$ac_objext 10057rm -f conftest.$ac_objext
11159if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10058if { (eval echo "$as_me:10058: \"$ac_compile\"") >&5
11160 (eval $ac_compile) 2>&5 10059 (eval $ac_compile) 2>&5
11161 ac_status=$? 10060 ac_status=$?
11162 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10061 echo "$as_me:10061: \$? = $ac_status" >&5
11163 (exit $ac_status); } && 10062 (exit $ac_status); } &&
11164 { ac_try='test -s conftest.$ac_objext' 10063 { ac_try='test -s conftest.$ac_objext'
11165 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10064 { (eval echo "$as_me:10064: \"$ac_try\"") >&5
11166 (eval $ac_try) 2>&5 10065 (eval $ac_try) 2>&5
11167 ac_status=$? 10066 ac_status=$?
11168 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10067 echo "$as_me:10067: \$? = $ac_status" >&5
11169 (exit $ac_status); }; }; then 10068 (exit $ac_status); }; }; then
11170 ac_cv_type_short_int=yes 10069 ac_cv_type_short_int=yes
11171else 10070else
11172 echo "$as_me: failed program was:" >&5 10071 echo "$as_me: failed program was:" >&5
11173sed 's/^/| /' conftest.$ac_ext >&5 10072cat conftest.$ac_ext >&5
11174
11175ac_cv_type_short_int=no 10073ac_cv_type_short_int=no
11176fi 10074fi
11177rm -f conftest.$ac_objext conftest.$ac_ext 10075rm -f conftest.$ac_objext conftest.$ac_ext
11178fi 10076fi
11179echo "$as_me:$LINENO: result: $ac_cv_type_short_int" >&5 10077echo "$as_me:10077: result: $ac_cv_type_short_int" >&5
11180echo "${ECHO_T}$ac_cv_type_short_int" >&6 10078echo "${ECHO_T}$ac_cv_type_short_int" >&6
11181 10079
11182echo "$as_me:$LINENO: checking size of short int" >&5 10080echo "$as_me:10080: checking size of short int" >&5
11183echo $ECHO_N "checking size of short int... $ECHO_C" >&6 10081echo $ECHO_N "checking size of short int... $ECHO_C" >&6
11184if test "${ac_cv_sizeof_short_int+set}" = set; then 10082if test "${ac_cv_sizeof_short_int+set}" = set; then
11185 echo $ECHO_N "(cached) $ECHO_C" >&6 10083 echo $ECHO_N "(cached) $ECHO_C" >&6
11186else 10084else
11187 if test "$ac_cv_type_short_int" = yes; then 10085 if test "$ac_cv_type_short_int" = yes; then
11188 # The cast to unsigned long works around a bug in the HP C Compiler
11189 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
11190 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
11191 # This bug is HP SR number 8606223364.
11192 if test "$cross_compiling" = yes; then 10086 if test "$cross_compiling" = yes; then
11193 # Depending upon the size, compute the lo and hi bounds. 10087 # Depending upon the size, compute the lo and hi bounds.
11194cat >conftest.$ac_ext <<_ACEOF 10088cat >conftest.$ac_ext <<_ACEOF
11195#line $LINENO "configure" 10089#line 10089 "configure"
11196/* confdefs.h. */ 10090#include "confdefs.h"
11197_ACEOF
11198cat confdefs.h >>conftest.$ac_ext
11199cat >>conftest.$ac_ext <<_ACEOF
11200/* end confdefs.h. */
11201$ac_includes_default 10091$ac_includes_default
11202int 10092int
11203main () 10093main ()
11204{ 10094{
11205static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= 0)]; 10095int _array_ [1 - 2 * !((sizeof (short int)) >= 0)]
11206test_array [0] = 0
11207
11208 ; 10096 ;
11209 return 0; 10097 return 0;
11210} 10098}
11211_ACEOF 10099_ACEOF
11212rm -f conftest.$ac_objext 10100rm -f conftest.$ac_objext
11213if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10101if { (eval echo "$as_me:10101: \"$ac_compile\"") >&5
11214 (eval $ac_compile) 2>&5 10102 (eval $ac_compile) 2>&5
11215 ac_status=$? 10103 ac_status=$?
11216 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10104 echo "$as_me:10104: \$? = $ac_status" >&5
11217 (exit $ac_status); } && 10105 (exit $ac_status); } &&
11218 { ac_try='test -s conftest.$ac_objext' 10106 { ac_try='test -s conftest.$ac_objext'
11219 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10107 { (eval echo "$as_me:10107: \"$ac_try\"") >&5
11220 (eval $ac_try) 2>&5 10108 (eval $ac_try) 2>&5
11221 ac_status=$? 10109 ac_status=$?
11222 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10110 echo "$as_me:10110: \$? = $ac_status" >&5
11223 (exit $ac_status); }; }; then 10111 (exit $ac_status); }; }; then
11224 ac_lo=0 ac_mid=0 10112 ac_lo=0 ac_mid=0
11225 while :; do 10113 while :; do
11226 cat >conftest.$ac_ext <<_ACEOF 10114 cat >conftest.$ac_ext <<_ACEOF
11227#line $LINENO "configure" 10115#line 10115 "configure"
11228/* confdefs.h. */ 10116#include "confdefs.h"
11229_ACEOF
11230cat confdefs.h >>conftest.$ac_ext
11231cat >>conftest.$ac_ext <<_ACEOF
11232/* end confdefs.h. */
11233$ac_includes_default 10117$ac_includes_default
11234int 10118int
11235main () 10119main ()
11236{ 10120{
11237static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)]; 10121int _array_ [1 - 2 * !((sizeof (short int)) <= $ac_mid)]
11238test_array [0] = 0
11239
11240 ; 10122 ;
11241 return 0; 10123 return 0;
11242} 10124}
11243_ACEOF 10125_ACEOF
11244rm -f conftest.$ac_objext 10126rm -f conftest.$ac_objext
11245if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10127if { (eval echo "$as_me:10127: \"$ac_compile\"") >&5
11246 (eval $ac_compile) 2>&5 10128 (eval $ac_compile) 2>&5
11247 ac_status=$? 10129 ac_status=$?
11248 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10130 echo "$as_me:10130: \$? = $ac_status" >&5
11249 (exit $ac_status); } && 10131 (exit $ac_status); } &&
11250 { ac_try='test -s conftest.$ac_objext' 10132 { ac_try='test -s conftest.$ac_objext'
11251 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10133 { (eval echo "$as_me:10133: \"$ac_try\"") >&5
11252 (eval $ac_try) 2>&5 10134 (eval $ac_try) 2>&5
11253 ac_status=$? 10135 ac_status=$?
11254 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10136 echo "$as_me:10136: \$? = $ac_status" >&5
11255 (exit $ac_status); }; }; then 10137 (exit $ac_status); }; }; then
11256 ac_hi=$ac_mid; break 10138 ac_hi=$ac_mid; break
11257else 10139else
11258 echo "$as_me: failed program was:" >&5 10140 echo "$as_me: failed program was:" >&5
11259sed 's/^/| /' conftest.$ac_ext >&5 10141cat conftest.$ac_ext >&5
11260 10142ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
11261ac_lo=`expr $ac_mid + 1`
11262 if test $ac_lo -le $ac_mid; then
11263 ac_lo= ac_hi=
11264 break
11265 fi
11266 ac_mid=`expr 2 '*' $ac_mid + 1`
11267fi 10143fi
11268rm -f conftest.$ac_objext conftest.$ac_ext 10144rm -f conftest.$ac_objext conftest.$ac_ext
11269 done 10145 done
11270else 10146else
11271 echo "$as_me: failed program was:" >&5 10147 echo "$as_me: failed program was:" >&5
11272sed 's/^/| /' conftest.$ac_ext >&5 10148cat conftest.$ac_ext >&5
11273 10149ac_hi=-1 ac_mid=-1
11274cat >conftest.$ac_ext <<_ACEOF
11275#line $LINENO "configure"
11276/* confdefs.h. */
11277_ACEOF
11278cat confdefs.h >>conftest.$ac_ext
11279cat >>conftest.$ac_ext <<_ACEOF
11280/* end confdefs.h. */
11281$ac_includes_default
11282int
11283main ()
11284{
11285static int test_array [1 - 2 * !(((long) (sizeof (short int))) < 0)];
11286test_array [0] = 0
11287
11288 ;
11289 return 0;
11290}
11291_ACEOF
11292rm -f conftest.$ac_objext
11293if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11294 (eval $ac_compile) 2>&5
11295 ac_status=$?
11296 echo "$as_me:$LINENO: \$? = $ac_status" >&5
11297 (exit $ac_status); } &&
11298 { ac_try='test -s conftest.$ac_objext'
11299 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11300 (eval $ac_try) 2>&5
11301 ac_status=$?
11302 echo "$as_me:$LINENO: \$? = $ac_status" >&5
11303 (exit $ac_status); }; }; then
11304 ac_hi=-1 ac_mid=-1
11305 while :; do 10150 while :; do
11306 cat >conftest.$ac_ext <<_ACEOF 10151 cat >conftest.$ac_ext <<_ACEOF
11307#line $LINENO "configure" 10152#line 10152 "configure"
11308/* confdefs.h. */ 10153#include "confdefs.h"
11309_ACEOF
11310cat confdefs.h >>conftest.$ac_ext
11311cat >>conftest.$ac_ext <<_ACEOF
11312/* end confdefs.h. */
11313$ac_includes_default 10154$ac_includes_default
11314int 10155int
11315main () 10156main ()
11316{ 10157{
11317static int test_array [1 - 2 * !(((long) (sizeof (short int))) >= $ac_mid)]; 10158int _array_ [1 - 2 * !((sizeof (short int)) >= $ac_mid)]
11318test_array [0] = 0
11319
11320 ; 10159 ;
11321 return 0; 10160 return 0;
11322} 10161}
11323_ACEOF 10162_ACEOF
11324rm -f conftest.$ac_objext 10163rm -f conftest.$ac_objext
11325if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10164if { (eval echo "$as_me:10164: \"$ac_compile\"") >&5
11326 (eval $ac_compile) 2>&5 10165 (eval $ac_compile) 2>&5
11327 ac_status=$? 10166 ac_status=$?
11328 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10167 echo "$as_me:10167: \$? = $ac_status" >&5
11329 (exit $ac_status); } && 10168 (exit $ac_status); } &&
11330 { ac_try='test -s conftest.$ac_objext' 10169 { ac_try='test -s conftest.$ac_objext'
11331 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10170 { (eval echo "$as_me:10170: \"$ac_try\"") >&5
11332 (eval $ac_try) 2>&5 10171 (eval $ac_try) 2>&5
11333 ac_status=$? 10172 ac_status=$?
11334 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10173 echo "$as_me:10173: \$? = $ac_status" >&5
11335 (exit $ac_status); }; }; then 10174 (exit $ac_status); }; }; then
11336 ac_lo=$ac_mid; break 10175 ac_lo=$ac_mid; break
11337else 10176else
11338 echo "$as_me: failed program was:" >&5 10177 echo "$as_me: failed program was:" >&5
11339sed 's/^/| /' conftest.$ac_ext >&5 10178cat conftest.$ac_ext >&5
11340 10179ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
11341ac_hi=`expr '(' $ac_mid ')' - 1`
11342 if test $ac_mid -le $ac_hi; then
11343 ac_lo= ac_hi=
11344 break
11345 fi
11346 ac_mid=`expr 2 '*' $ac_mid`
11347fi 10180fi
11348rm -f conftest.$ac_objext conftest.$ac_ext 10181rm -f conftest.$ac_objext conftest.$ac_ext
11349 done 10182 done
11350else
11351 echo "$as_me: failed program was:" >&5
11352sed 's/^/| /' conftest.$ac_ext >&5
11353
11354ac_lo= ac_hi=
11355fi
11356rm -f conftest.$ac_objext conftest.$ac_ext
11357fi 10183fi
11358rm -f conftest.$ac_objext conftest.$ac_ext 10184rm -f conftest.$ac_objext conftest.$ac_ext
11359# Binary search between lo and hi bounds. 10185# Binary search between lo and hi bounds.
11360while test "x$ac_lo" != "x$ac_hi"; do 10186while test "x$ac_lo" != "x$ac_hi"; do
11361 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 10187 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
11362 cat >conftest.$ac_ext <<_ACEOF 10188 cat >conftest.$ac_ext <<_ACEOF
11363#line $LINENO "configure" 10189#line 10189 "configure"
11364/* confdefs.h. */ 10190#include "confdefs.h"
11365_ACEOF
11366cat confdefs.h >>conftest.$ac_ext
11367cat >>conftest.$ac_ext <<_ACEOF
11368/* end confdefs.h. */
11369$ac_includes_default 10191$ac_includes_default
11370int 10192int
11371main () 10193main ()
11372{ 10194{
11373static int test_array [1 - 2 * !(((long) (sizeof (short int))) <= $ac_mid)]; 10195int _array_ [1 - 2 * !((sizeof (short int)) <= $ac_mid)]
11374test_array [0] = 0
11375
11376 ; 10196 ;
11377 return 0; 10197 return 0;
11378} 10198}
11379_ACEOF 10199_ACEOF
11380rm -f conftest.$ac_objext 10200rm -f conftest.$ac_objext
11381if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10201if { (eval echo "$as_me:10201: \"$ac_compile\"") >&5
11382 (eval $ac_compile) 2>&5 10202 (eval $ac_compile) 2>&5
11383 ac_status=$? 10203 ac_status=$?
11384 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10204 echo "$as_me:10204: \$? = $ac_status" >&5
11385 (exit $ac_status); } && 10205 (exit $ac_status); } &&
11386 { ac_try='test -s conftest.$ac_objext' 10206 { ac_try='test -s conftest.$ac_objext'
11387 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10207 { (eval echo "$as_me:10207: \"$ac_try\"") >&5
11388 (eval $ac_try) 2>&5 10208 (eval $ac_try) 2>&5
11389 ac_status=$? 10209 ac_status=$?
11390 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10210 echo "$as_me:10210: \$? = $ac_status" >&5
11391 (exit $ac_status); }; }; then 10211 (exit $ac_status); }; }; then
11392 ac_hi=$ac_mid 10212 ac_hi=$ac_mid
11393else 10213else
11394 echo "$as_me: failed program was:" >&5 10214 echo "$as_me: failed program was:" >&5
11395sed 's/^/| /' conftest.$ac_ext >&5 10215cat conftest.$ac_ext >&5
11396 10216ac_lo=`expr $ac_mid + 1`
11397ac_lo=`expr '(' $ac_mid ')' + 1`
11398fi 10217fi
11399rm -f conftest.$ac_objext conftest.$ac_ext 10218rm -f conftest.$ac_objext conftest.$ac_ext
11400done 10219done
11401case $ac_lo in 10220ac_cv_sizeof_short_int=$ac_lo
11402?*) ac_cv_sizeof_short_int=$ac_lo;;
11403'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77
11404See \`config.log' for more details." >&5
11405echo "$as_me: error: cannot compute sizeof (short int), 77
11406See \`config.log' for more details." >&2;}
11407 { (exit 1); exit 1; }; } ;;
11408esac
11409else 10221else
11410 if test "$cross_compiling" = yes; then 10222 if test "$cross_compiling" = yes; then
11411 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 10223 { { echo "$as_me:10223: error: cannot run test program while cross compiling" >&5
11412See \`config.log' for more details." >&5 10224echo "$as_me: error: cannot run test program while cross compiling" >&2;}
11413echo "$as_me: error: cannot run test program while cross compiling
11414See \`config.log' for more details." >&2;}
11415 { (exit 1); exit 1; }; } 10225 { (exit 1); exit 1; }; }
11416else 10226else
11417 cat >conftest.$ac_ext <<_ACEOF 10227 cat >conftest.$ac_ext <<_ACEOF
11418#line $LINENO "configure" 10228#line 10228 "configure"
11419/* confdefs.h. */ 10229#include "confdefs.h"
11420_ACEOF
11421cat confdefs.h >>conftest.$ac_ext
11422cat >>conftest.$ac_ext <<_ACEOF
11423/* end confdefs.h. */
11424$ac_includes_default 10230$ac_includes_default
11425long longval () { return (long) (sizeof (short int)); }
11426unsigned long ulongval () { return (long) (sizeof (short int)); }
11427#include <stdio.h>
11428#include <stdlib.h>
11429int 10231int
11430main () 10232main ()
11431{ 10233{
11432 10234FILE *f = fopen ("conftest.val", "w");
11433 FILE *f = fopen ("conftest.val", "w"); 10235if (!f)
11434 if (! f) 10236 exit (1);
11435 exit (1); 10237fprintf (f, "%d", (sizeof (short int)));
11436 if (((long) (sizeof (short int))) < 0) 10238fclose (f);
11437 {
11438 long i = longval ();
11439 if (i != ((long) (sizeof (short int))))
11440 exit (1);
11441 fprintf (f, "%ld\n", i);
11442 }
11443 else
11444 {
11445 unsigned long i = ulongval ();
11446 if (i != ((long) (sizeof (short int))))
11447 exit (1);
11448 fprintf (f, "%lu\n", i);
11449 }
11450 exit (ferror (f) || fclose (f) != 0);
11451
11452 ; 10239 ;
11453 return 0; 10240 return 0;
11454} 10241}
11455_ACEOF 10242_ACEOF
11456rm -f conftest$ac_exeext 10243rm -f conftest$ac_exeext
11457if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 10244if { (eval echo "$as_me:10244: \"$ac_link\"") >&5
11458 (eval $ac_link) 2>&5 10245 (eval $ac_link) 2>&5
11459 ac_status=$? 10246 ac_status=$?
11460 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10247 echo "$as_me:10247: \$? = $ac_status" >&5
11461 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 10248 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11462 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10249 { (eval echo "$as_me:10249: \"$ac_try\"") >&5
11463 (eval $ac_try) 2>&5 10250 (eval $ac_try) 2>&5
11464 ac_status=$? 10251 ac_status=$?
11465 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10252 echo "$as_me:10252: \$? = $ac_status" >&5
11466 (exit $ac_status); }; }; then 10253 (exit $ac_status); }; }; then
11467 ac_cv_sizeof_short_int=`cat conftest.val` 10254 ac_cv_sizeof_short_int=`cat conftest.val`
11468else 10255else
11469 echo "$as_me: program exited with status $ac_status" >&5 10256 echo "$as_me: program exited with status $ac_status" >&5
11470echo "$as_me: failed program was:" >&5 10257echo "$as_me: failed program was:" >&5
11471sed 's/^/| /' conftest.$ac_ext >&5 10258cat conftest.$ac_ext >&5
11472
11473( exit $ac_status )
11474{ { echo "$as_me:$LINENO: error: cannot compute sizeof (short int), 77
11475See \`config.log' for more details." >&5
11476echo "$as_me: error: cannot compute sizeof (short int), 77
11477See \`config.log' for more details." >&2;}
11478 { (exit 1); exit 1; }; }
11479fi 10259fi
11480rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 10260rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11481fi 10261fi
11482fi 10262fi
11483rm -f conftest.val 10263rm -f conftest.val
@@ -11485,25 +10265,20 @@ else
11485 ac_cv_sizeof_short_int=0 10265 ac_cv_sizeof_short_int=0
11486fi 10266fi
11487fi 10267fi
11488echo "$as_me:$LINENO: result: $ac_cv_sizeof_short_int" >&5 10268echo "$as_me:10268: result: $ac_cv_sizeof_short_int" >&5
11489echo "${ECHO_T}$ac_cv_sizeof_short_int" >&6 10269echo "${ECHO_T}$ac_cv_sizeof_short_int" >&6
11490cat >>confdefs.h <<_ACEOF 10270cat >>confdefs.h <<EOF
11491#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int 10271#define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int
11492_ACEOF 10272EOF
11493
11494 10273
11495echo "$as_me:$LINENO: checking for int" >&5 10274echo "$as_me:10274: checking for int" >&5
11496echo $ECHO_N "checking for int... $ECHO_C" >&6 10275echo $ECHO_N "checking for int... $ECHO_C" >&6
11497if test "${ac_cv_type_int+set}" = set; then 10276if test "${ac_cv_type_int+set}" = set; then
11498 echo $ECHO_N "(cached) $ECHO_C" >&6 10277 echo $ECHO_N "(cached) $ECHO_C" >&6
11499else 10278else
11500 cat >conftest.$ac_ext <<_ACEOF 10279 cat >conftest.$ac_ext <<_ACEOF
11501#line $LINENO "configure" 10280#line 10280 "configure"
11502/* confdefs.h. */ 10281#include "confdefs.h"
11503_ACEOF
11504cat confdefs.h >>conftest.$ac_ext
11505cat >>conftest.$ac_ext <<_ACEOF
11506/* end confdefs.h. */
11507$ac_includes_default 10282$ac_includes_default
11508int 10283int
11509main () 10284main ()
@@ -11517,328 +10292,209 @@ if (sizeof (int))
11517} 10292}
11518_ACEOF 10293_ACEOF
11519rm -f conftest.$ac_objext 10294rm -f conftest.$ac_objext
11520if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10295if { (eval echo "$as_me:10295: \"$ac_compile\"") >&5
11521 (eval $ac_compile) 2>&5 10296 (eval $ac_compile) 2>&5
11522 ac_status=$? 10297 ac_status=$?
11523 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10298 echo "$as_me:10298: \$? = $ac_status" >&5
11524 (exit $ac_status); } && 10299 (exit $ac_status); } &&
11525 { ac_try='test -s conftest.$ac_objext' 10300 { ac_try='test -s conftest.$ac_objext'
11526 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10301 { (eval echo "$as_me:10301: \"$ac_try\"") >&5
11527 (eval $ac_try) 2>&5 10302 (eval $ac_try) 2>&5
11528 ac_status=$? 10303 ac_status=$?
11529 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10304 echo "$as_me:10304: \$? = $ac_status" >&5
11530 (exit $ac_status); }; }; then 10305 (exit $ac_status); }; }; then
11531 ac_cv_type_int=yes 10306 ac_cv_type_int=yes
11532else 10307else
11533 echo "$as_me: failed program was:" >&5 10308 echo "$as_me: failed program was:" >&5
11534sed 's/^/| /' conftest.$ac_ext >&5 10309cat conftest.$ac_ext >&5
11535
11536ac_cv_type_int=no 10310ac_cv_type_int=no
11537fi 10311fi
11538rm -f conftest.$ac_objext conftest.$ac_ext 10312rm -f conftest.$ac_objext conftest.$ac_ext
11539fi 10313fi
11540echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 10314echo "$as_me:10314: result: $ac_cv_type_int" >&5
11541echo "${ECHO_T}$ac_cv_type_int" >&6 10315echo "${ECHO_T}$ac_cv_type_int" >&6
11542 10316
11543echo "$as_me:$LINENO: checking size of int" >&5 10317echo "$as_me:10317: checking size of int" >&5
11544echo $ECHO_N "checking size of int... $ECHO_C" >&6 10318echo $ECHO_N "checking size of int... $ECHO_C" >&6
11545if test "${ac_cv_sizeof_int+set}" = set; then 10319if test "${ac_cv_sizeof_int+set}" = set; then
11546 echo $ECHO_N "(cached) $ECHO_C" >&6 10320 echo $ECHO_N "(cached) $ECHO_C" >&6
11547else 10321else
11548 if test "$ac_cv_type_int" = yes; then 10322 if test "$ac_cv_type_int" = yes; then
11549 # The cast to unsigned long works around a bug in the HP C Compiler
11550 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
11551 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
11552 # This bug is HP SR number 8606223364.
11553 if test "$cross_compiling" = yes; then 10323 if test "$cross_compiling" = yes; then
11554 # Depending upon the size, compute the lo and hi bounds. 10324 # Depending upon the size, compute the lo and hi bounds.
11555cat >conftest.$ac_ext <<_ACEOF 10325cat >conftest.$ac_ext <<_ACEOF
11556#line $LINENO "configure" 10326#line 10326 "configure"
11557/* confdefs.h. */ 10327#include "confdefs.h"
11558_ACEOF
11559cat confdefs.h >>conftest.$ac_ext
11560cat >>conftest.$ac_ext <<_ACEOF
11561/* end confdefs.h. */
11562$ac_includes_default 10328$ac_includes_default
11563int 10329int
11564main () 10330main ()
11565{ 10331{
11566static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; 10332int _array_ [1 - 2 * !((sizeof (int)) >= 0)]
11567test_array [0] = 0
11568
11569 ; 10333 ;
11570 return 0; 10334 return 0;
11571} 10335}
11572_ACEOF 10336_ACEOF
11573rm -f conftest.$ac_objext 10337rm -f conftest.$ac_objext
11574if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10338if { (eval echo "$as_me:10338: \"$ac_compile\"") >&5
11575 (eval $ac_compile) 2>&5 10339 (eval $ac_compile) 2>&5
11576 ac_status=$? 10340 ac_status=$?
11577 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10341 echo "$as_me:10341: \$? = $ac_status" >&5
11578 (exit $ac_status); } && 10342 (exit $ac_status); } &&
11579 { ac_try='test -s conftest.$ac_objext' 10343 { ac_try='test -s conftest.$ac_objext'
11580 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10344 { (eval echo "$as_me:10344: \"$ac_try\"") >&5
11581 (eval $ac_try) 2>&5 10345 (eval $ac_try) 2>&5
11582 ac_status=$? 10346 ac_status=$?
11583 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10347 echo "$as_me:10347: \$? = $ac_status" >&5
11584 (exit $ac_status); }; }; then 10348 (exit $ac_status); }; }; then
11585 ac_lo=0 ac_mid=0 10349 ac_lo=0 ac_mid=0
11586 while :; do 10350 while :; do
11587 cat >conftest.$ac_ext <<_ACEOF 10351 cat >conftest.$ac_ext <<_ACEOF
11588#line $LINENO "configure" 10352#line 10352 "configure"
11589/* confdefs.h. */ 10353#include "confdefs.h"
11590_ACEOF
11591cat confdefs.h >>conftest.$ac_ext
11592cat >>conftest.$ac_ext <<_ACEOF
11593/* end confdefs.h. */
11594$ac_includes_default 10354$ac_includes_default
11595int 10355int
11596main () 10356main ()
11597{ 10357{
11598static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; 10358int _array_ [1 - 2 * !((sizeof (int)) <= $ac_mid)]
11599test_array [0] = 0
11600
11601 ; 10359 ;
11602 return 0; 10360 return 0;
11603} 10361}
11604_ACEOF 10362_ACEOF
11605rm -f conftest.$ac_objext 10363rm -f conftest.$ac_objext
11606if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10364if { (eval echo "$as_me:10364: \"$ac_compile\"") >&5
11607 (eval $ac_compile) 2>&5 10365 (eval $ac_compile) 2>&5
11608 ac_status=$? 10366 ac_status=$?
11609 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10367 echo "$as_me:10367: \$? = $ac_status" >&5
11610 (exit $ac_status); } && 10368 (exit $ac_status); } &&
11611 { ac_try='test -s conftest.$ac_objext' 10369 { ac_try='test -s conftest.$ac_objext'
11612 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10370 { (eval echo "$as_me:10370: \"$ac_try\"") >&5
11613 (eval $ac_try) 2>&5 10371 (eval $ac_try) 2>&5
11614 ac_status=$? 10372 ac_status=$?
11615 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10373 echo "$as_me:10373: \$? = $ac_status" >&5
11616 (exit $ac_status); }; }; then 10374 (exit $ac_status); }; }; then
11617 ac_hi=$ac_mid; break 10375 ac_hi=$ac_mid; break
11618else 10376else
11619 echo "$as_me: failed program was:" >&5 10377 echo "$as_me: failed program was:" >&5
11620sed 's/^/| /' conftest.$ac_ext >&5 10378cat conftest.$ac_ext >&5
11621 10379ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
11622ac_lo=`expr $ac_mid + 1`
11623 if test $ac_lo -le $ac_mid; then
11624 ac_lo= ac_hi=
11625 break
11626 fi
11627 ac_mid=`expr 2 '*' $ac_mid + 1`
11628fi 10380fi
11629rm -f conftest.$ac_objext conftest.$ac_ext 10381rm -f conftest.$ac_objext conftest.$ac_ext
11630 done 10382 done
11631else 10383else
11632 echo "$as_me: failed program was:" >&5 10384 echo "$as_me: failed program was:" >&5
11633sed 's/^/| /' conftest.$ac_ext >&5 10385cat conftest.$ac_ext >&5
11634 10386ac_hi=-1 ac_mid=-1
11635cat >conftest.$ac_ext <<_ACEOF
11636#line $LINENO "configure"
11637/* confdefs.h. */
11638_ACEOF
11639cat confdefs.h >>conftest.$ac_ext
11640cat >>conftest.$ac_ext <<_ACEOF
11641/* end confdefs.h. */
11642$ac_includes_default
11643int
11644main ()
11645{
11646static int test_array [1 - 2 * !(((long) (sizeof (int))) < 0)];
11647test_array [0] = 0
11648
11649 ;
11650 return 0;
11651}
11652_ACEOF
11653rm -f conftest.$ac_objext
11654if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
11655 (eval $ac_compile) 2>&5
11656 ac_status=$?
11657 echo "$as_me:$LINENO: \$? = $ac_status" >&5
11658 (exit $ac_status); } &&
11659 { ac_try='test -s conftest.$ac_objext'
11660 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
11661 (eval $ac_try) 2>&5
11662 ac_status=$?
11663 echo "$as_me:$LINENO: \$? = $ac_status" >&5
11664 (exit $ac_status); }; }; then
11665 ac_hi=-1 ac_mid=-1
11666 while :; do 10387 while :; do
11667 cat >conftest.$ac_ext <<_ACEOF 10388 cat >conftest.$ac_ext <<_ACEOF
11668#line $LINENO "configure" 10389#line 10389 "configure"
11669/* confdefs.h. */ 10390#include "confdefs.h"
11670_ACEOF
11671cat confdefs.h >>conftest.$ac_ext
11672cat >>conftest.$ac_ext <<_ACEOF
11673/* end confdefs.h. */
11674$ac_includes_default 10391$ac_includes_default
11675int 10392int
11676main () 10393main ()
11677{ 10394{
11678static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; 10395int _array_ [1 - 2 * !((sizeof (int)) >= $ac_mid)]
11679test_array [0] = 0
11680
11681 ; 10396 ;
11682 return 0; 10397 return 0;
11683} 10398}
11684_ACEOF 10399_ACEOF
11685rm -f conftest.$ac_objext 10400rm -f conftest.$ac_objext
11686if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10401if { (eval echo "$as_me:10401: \"$ac_compile\"") >&5
11687 (eval $ac_compile) 2>&5 10402 (eval $ac_compile) 2>&5
11688 ac_status=$? 10403 ac_status=$?
11689 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10404 echo "$as_me:10404: \$? = $ac_status" >&5
11690 (exit $ac_status); } && 10405 (exit $ac_status); } &&
11691 { ac_try='test -s conftest.$ac_objext' 10406 { ac_try='test -s conftest.$ac_objext'
11692 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10407 { (eval echo "$as_me:10407: \"$ac_try\"") >&5
11693 (eval $ac_try) 2>&5 10408 (eval $ac_try) 2>&5
11694 ac_status=$? 10409 ac_status=$?
11695 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10410 echo "$as_me:10410: \$? = $ac_status" >&5
11696 (exit $ac_status); }; }; then 10411 (exit $ac_status); }; }; then
11697 ac_lo=$ac_mid; break 10412 ac_lo=$ac_mid; break
11698else 10413else
11699 echo "$as_me: failed program was:" >&5 10414 echo "$as_me: failed program was:" >&5
11700sed 's/^/| /' conftest.$ac_ext >&5 10415cat conftest.$ac_ext >&5
11701 10416ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
11702ac_hi=`expr '(' $ac_mid ')' - 1`
11703 if test $ac_mid -le $ac_hi; then
11704 ac_lo= ac_hi=
11705 break
11706 fi
11707 ac_mid=`expr 2 '*' $ac_mid`
11708fi 10417fi
11709rm -f conftest.$ac_objext conftest.$ac_ext 10418rm -f conftest.$ac_objext conftest.$ac_ext
11710 done 10419 done
11711else
11712 echo "$as_me: failed program was:" >&5
11713sed 's/^/| /' conftest.$ac_ext >&5
11714
11715ac_lo= ac_hi=
11716fi
11717rm -f conftest.$ac_objext conftest.$ac_ext
11718fi 10420fi
11719rm -f conftest.$ac_objext conftest.$ac_ext 10421rm -f conftest.$ac_objext conftest.$ac_ext
11720# Binary search between lo and hi bounds. 10422# Binary search between lo and hi bounds.
11721while test "x$ac_lo" != "x$ac_hi"; do 10423while test "x$ac_lo" != "x$ac_hi"; do
11722 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 10424 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
11723 cat >conftest.$ac_ext <<_ACEOF 10425 cat >conftest.$ac_ext <<_ACEOF
11724#line $LINENO "configure" 10426#line 10426 "configure"
11725/* confdefs.h. */ 10427#include "confdefs.h"
11726_ACEOF
11727cat confdefs.h >>conftest.$ac_ext
11728cat >>conftest.$ac_ext <<_ACEOF
11729/* end confdefs.h. */
11730$ac_includes_default 10428$ac_includes_default
11731int 10429int
11732main () 10430main ()
11733{ 10431{
11734static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; 10432int _array_ [1 - 2 * !((sizeof (int)) <= $ac_mid)]
11735test_array [0] = 0
11736
11737 ; 10433 ;
11738 return 0; 10434 return 0;
11739} 10435}
11740_ACEOF 10436_ACEOF
11741rm -f conftest.$ac_objext 10437rm -f conftest.$ac_objext
11742if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10438if { (eval echo "$as_me:10438: \"$ac_compile\"") >&5
11743 (eval $ac_compile) 2>&5 10439 (eval $ac_compile) 2>&5
11744 ac_status=$? 10440 ac_status=$?
11745 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10441 echo "$as_me:10441: \$? = $ac_status" >&5
11746 (exit $ac_status); } && 10442 (exit $ac_status); } &&
11747 { ac_try='test -s conftest.$ac_objext' 10443 { ac_try='test -s conftest.$ac_objext'
11748 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10444 { (eval echo "$as_me:10444: \"$ac_try\"") >&5
11749 (eval $ac_try) 2>&5 10445 (eval $ac_try) 2>&5
11750 ac_status=$? 10446 ac_status=$?
11751 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10447 echo "$as_me:10447: \$? = $ac_status" >&5
11752 (exit $ac_status); }; }; then 10448 (exit $ac_status); }; }; then
11753 ac_hi=$ac_mid 10449 ac_hi=$ac_mid
11754else 10450else
11755 echo "$as_me: failed program was:" >&5 10451 echo "$as_me: failed program was:" >&5
11756sed 's/^/| /' conftest.$ac_ext >&5 10452cat conftest.$ac_ext >&5
11757 10453ac_lo=`expr $ac_mid + 1`
11758ac_lo=`expr '(' $ac_mid ')' + 1`
11759fi 10454fi
11760rm -f conftest.$ac_objext conftest.$ac_ext 10455rm -f conftest.$ac_objext conftest.$ac_ext
11761done 10456done
11762case $ac_lo in 10457ac_cv_sizeof_int=$ac_lo
11763?*) ac_cv_sizeof_int=$ac_lo;;
11764'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
11765See \`config.log' for more details." >&5
11766echo "$as_me: error: cannot compute sizeof (int), 77
11767See \`config.log' for more details." >&2;}
11768 { (exit 1); exit 1; }; } ;;
11769esac
11770else 10458else
11771 if test "$cross_compiling" = yes; then 10459 if test "$cross_compiling" = yes; then
11772 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 10460 { { echo "$as_me:10460: error: cannot run test program while cross compiling" >&5
11773See \`config.log' for more details." >&5 10461echo "$as_me: error: cannot run test program while cross compiling" >&2;}
11774echo "$as_me: error: cannot run test program while cross compiling
11775See \`config.log' for more details." >&2;}
11776 { (exit 1); exit 1; }; } 10462 { (exit 1); exit 1; }; }
11777else 10463else
11778 cat >conftest.$ac_ext <<_ACEOF 10464 cat >conftest.$ac_ext <<_ACEOF
11779#line $LINENO "configure" 10465#line 10465 "configure"
11780/* confdefs.h. */ 10466#include "confdefs.h"
11781_ACEOF
11782cat confdefs.h >>conftest.$ac_ext
11783cat >>conftest.$ac_ext <<_ACEOF
11784/* end confdefs.h. */
11785$ac_includes_default 10467$ac_includes_default
11786long longval () { return (long) (sizeof (int)); }
11787unsigned long ulongval () { return (long) (sizeof (int)); }
11788#include <stdio.h>
11789#include <stdlib.h>
11790int 10468int
11791main () 10469main ()
11792{ 10470{
11793 10471FILE *f = fopen ("conftest.val", "w");
11794 FILE *f = fopen ("conftest.val", "w"); 10472if (!f)
11795 if (! f) 10473 exit (1);
11796 exit (1); 10474fprintf (f, "%d", (sizeof (int)));
11797 if (((long) (sizeof (int))) < 0) 10475fclose (f);
11798 {
11799 long i = longval ();
11800 if (i != ((long) (sizeof (int))))
11801 exit (1);
11802 fprintf (f, "%ld\n", i);
11803 }
11804 else
11805 {
11806 unsigned long i = ulongval ();
11807 if (i != ((long) (sizeof (int))))
11808 exit (1);
11809 fprintf (f, "%lu\n", i);
11810 }
11811 exit (ferror (f) || fclose (f) != 0);
11812
11813 ; 10476 ;
11814 return 0; 10477 return 0;
11815} 10478}
11816_ACEOF 10479_ACEOF
11817rm -f conftest$ac_exeext 10480rm -f conftest$ac_exeext
11818if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 10481if { (eval echo "$as_me:10481: \"$ac_link\"") >&5
11819 (eval $ac_link) 2>&5 10482 (eval $ac_link) 2>&5
11820 ac_status=$? 10483 ac_status=$?
11821 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10484 echo "$as_me:10484: \$? = $ac_status" >&5
11822 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 10485 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11823 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10486 { (eval echo "$as_me:10486: \"$ac_try\"") >&5
11824 (eval $ac_try) 2>&5 10487 (eval $ac_try) 2>&5
11825 ac_status=$? 10488 ac_status=$?
11826 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10489 echo "$as_me:10489: \$? = $ac_status" >&5
11827 (exit $ac_status); }; }; then 10490 (exit $ac_status); }; }; then
11828 ac_cv_sizeof_int=`cat conftest.val` 10491 ac_cv_sizeof_int=`cat conftest.val`
11829else 10492else
11830 echo "$as_me: program exited with status $ac_status" >&5 10493 echo "$as_me: program exited with status $ac_status" >&5
11831echo "$as_me: failed program was:" >&5 10494echo "$as_me: failed program was:" >&5
11832sed 's/^/| /' conftest.$ac_ext >&5 10495cat conftest.$ac_ext >&5
11833
11834( exit $ac_status )
11835{ { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77
11836See \`config.log' for more details." >&5
11837echo "$as_me: error: cannot compute sizeof (int), 77
11838See \`config.log' for more details." >&2;}
11839 { (exit 1); exit 1; }; }
11840fi 10496fi
11841rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 10497rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11842fi 10498fi
11843fi 10499fi
11844rm -f conftest.val 10500rm -f conftest.val
@@ -11846,25 +10502,20 @@ else
11846 ac_cv_sizeof_int=0 10502 ac_cv_sizeof_int=0
11847fi 10503fi
11848fi 10504fi
11849echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 10505echo "$as_me:10505: result: $ac_cv_sizeof_int" >&5
11850echo "${ECHO_T}$ac_cv_sizeof_int" >&6 10506echo "${ECHO_T}$ac_cv_sizeof_int" >&6
11851cat >>confdefs.h <<_ACEOF 10507cat >>confdefs.h <<EOF
11852#define SIZEOF_INT $ac_cv_sizeof_int 10508#define SIZEOF_INT $ac_cv_sizeof_int
11853_ACEOF 10509EOF
11854
11855 10510
11856echo "$as_me:$LINENO: checking for long int" >&5 10511echo "$as_me:10511: checking for long int" >&5
11857echo $ECHO_N "checking for long int... $ECHO_C" >&6 10512echo $ECHO_N "checking for long int... $ECHO_C" >&6
11858if test "${ac_cv_type_long_int+set}" = set; then 10513if test "${ac_cv_type_long_int+set}" = set; then
11859 echo $ECHO_N "(cached) $ECHO_C" >&6 10514 echo $ECHO_N "(cached) $ECHO_C" >&6
11860else 10515else
11861 cat >conftest.$ac_ext <<_ACEOF 10516 cat >conftest.$ac_ext <<_ACEOF
11862#line $LINENO "configure" 10517#line 10517 "configure"
11863/* confdefs.h. */ 10518#include "confdefs.h"
11864_ACEOF
11865cat confdefs.h >>conftest.$ac_ext
11866cat >>conftest.$ac_ext <<_ACEOF
11867/* end confdefs.h. */
11868$ac_includes_default 10519$ac_includes_default
11869int 10520int
11870main () 10521main ()
@@ -11878,328 +10529,209 @@ if (sizeof (long int))
11878} 10529}
11879_ACEOF 10530_ACEOF
11880rm -f conftest.$ac_objext 10531rm -f conftest.$ac_objext
11881if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10532if { (eval echo "$as_me:10532: \"$ac_compile\"") >&5
11882 (eval $ac_compile) 2>&5 10533 (eval $ac_compile) 2>&5
11883 ac_status=$? 10534 ac_status=$?
11884 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10535 echo "$as_me:10535: \$? = $ac_status" >&5
11885 (exit $ac_status); } && 10536 (exit $ac_status); } &&
11886 { ac_try='test -s conftest.$ac_objext' 10537 { ac_try='test -s conftest.$ac_objext'
11887 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10538 { (eval echo "$as_me:10538: \"$ac_try\"") >&5
11888 (eval $ac_try) 2>&5 10539 (eval $ac_try) 2>&5
11889 ac_status=$? 10540 ac_status=$?
11890 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10541 echo "$as_me:10541: \$? = $ac_status" >&5
11891 (exit $ac_status); }; }; then 10542 (exit $ac_status); }; }; then
11892 ac_cv_type_long_int=yes 10543 ac_cv_type_long_int=yes
11893else 10544else
11894 echo "$as_me: failed program was:" >&5 10545 echo "$as_me: failed program was:" >&5
11895sed 's/^/| /' conftest.$ac_ext >&5 10546cat conftest.$ac_ext >&5
11896
11897ac_cv_type_long_int=no 10547ac_cv_type_long_int=no
11898fi 10548fi
11899rm -f conftest.$ac_objext conftest.$ac_ext 10549rm -f conftest.$ac_objext conftest.$ac_ext
11900fi 10550fi
11901echo "$as_me:$LINENO: result: $ac_cv_type_long_int" >&5 10551echo "$as_me:10551: result: $ac_cv_type_long_int" >&5
11902echo "${ECHO_T}$ac_cv_type_long_int" >&6 10552echo "${ECHO_T}$ac_cv_type_long_int" >&6
11903 10553
11904echo "$as_me:$LINENO: checking size of long int" >&5 10554echo "$as_me:10554: checking size of long int" >&5
11905echo $ECHO_N "checking size of long int... $ECHO_C" >&6 10555echo $ECHO_N "checking size of long int... $ECHO_C" >&6
11906if test "${ac_cv_sizeof_long_int+set}" = set; then 10556if test "${ac_cv_sizeof_long_int+set}" = set; then
11907 echo $ECHO_N "(cached) $ECHO_C" >&6 10557 echo $ECHO_N "(cached) $ECHO_C" >&6
11908else 10558else
11909 if test "$ac_cv_type_long_int" = yes; then 10559 if test "$ac_cv_type_long_int" = yes; then
11910 # The cast to unsigned long works around a bug in the HP C Compiler
11911 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
11912 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
11913 # This bug is HP SR number 8606223364.
11914 if test "$cross_compiling" = yes; then 10560 if test "$cross_compiling" = yes; then
11915 # Depending upon the size, compute the lo and hi bounds. 10561 # Depending upon the size, compute the lo and hi bounds.
11916cat >conftest.$ac_ext <<_ACEOF 10562cat >conftest.$ac_ext <<_ACEOF
11917#line $LINENO "configure" 10563#line 10563 "configure"
11918/* confdefs.h. */ 10564#include "confdefs.h"
11919_ACEOF
11920cat confdefs.h >>conftest.$ac_ext
11921cat >>conftest.$ac_ext <<_ACEOF
11922/* end confdefs.h. */
11923$ac_includes_default 10565$ac_includes_default
11924int 10566int
11925main () 10567main ()
11926{ 10568{
11927static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= 0)]; 10569int _array_ [1 - 2 * !((sizeof (long int)) >= 0)]
11928test_array [0] = 0
11929
11930 ; 10570 ;
11931 return 0; 10571 return 0;
11932} 10572}
11933_ACEOF 10573_ACEOF
11934rm -f conftest.$ac_objext 10574rm -f conftest.$ac_objext
11935if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10575if { (eval echo "$as_me:10575: \"$ac_compile\"") >&5
11936 (eval $ac_compile) 2>&5 10576 (eval $ac_compile) 2>&5
11937 ac_status=$? 10577 ac_status=$?
11938 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10578 echo "$as_me:10578: \$? = $ac_status" >&5
11939 (exit $ac_status); } && 10579 (exit $ac_status); } &&
11940 { ac_try='test -s conftest.$ac_objext' 10580 { ac_try='test -s conftest.$ac_objext'
11941 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10581 { (eval echo "$as_me:10581: \"$ac_try\"") >&5
11942 (eval $ac_try) 2>&5 10582 (eval $ac_try) 2>&5
11943 ac_status=$? 10583 ac_status=$?
11944 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10584 echo "$as_me:10584: \$? = $ac_status" >&5
11945 (exit $ac_status); }; }; then 10585 (exit $ac_status); }; }; then
11946 ac_lo=0 ac_mid=0 10586 ac_lo=0 ac_mid=0
11947 while :; do 10587 while :; do
11948 cat >conftest.$ac_ext <<_ACEOF 10588 cat >conftest.$ac_ext <<_ACEOF
11949#line $LINENO "configure" 10589#line 10589 "configure"
11950/* confdefs.h. */ 10590#include "confdefs.h"
11951_ACEOF
11952cat confdefs.h >>conftest.$ac_ext
11953cat >>conftest.$ac_ext <<_ACEOF
11954/* end confdefs.h. */
11955$ac_includes_default 10591$ac_includes_default
11956int 10592int
11957main () 10593main ()
11958{ 10594{
11959static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)]; 10595int _array_ [1 - 2 * !((sizeof (long int)) <= $ac_mid)]
11960test_array [0] = 0
11961
11962 ; 10596 ;
11963 return 0; 10597 return 0;
11964} 10598}
11965_ACEOF 10599_ACEOF
11966rm -f conftest.$ac_objext 10600rm -f conftest.$ac_objext
11967if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10601if { (eval echo "$as_me:10601: \"$ac_compile\"") >&5
11968 (eval $ac_compile) 2>&5 10602 (eval $ac_compile) 2>&5
11969 ac_status=$? 10603 ac_status=$?
11970 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10604 echo "$as_me:10604: \$? = $ac_status" >&5
11971 (exit $ac_status); } && 10605 (exit $ac_status); } &&
11972 { ac_try='test -s conftest.$ac_objext' 10606 { ac_try='test -s conftest.$ac_objext'
11973 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10607 { (eval echo "$as_me:10607: \"$ac_try\"") >&5
11974 (eval $ac_try) 2>&5 10608 (eval $ac_try) 2>&5
11975 ac_status=$? 10609 ac_status=$?
11976 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10610 echo "$as_me:10610: \$? = $ac_status" >&5
11977 (exit $ac_status); }; }; then 10611 (exit $ac_status); }; }; then
11978 ac_hi=$ac_mid; break 10612 ac_hi=$ac_mid; break
11979else 10613else
11980 echo "$as_me: failed program was:" >&5 10614 echo "$as_me: failed program was:" >&5
11981sed 's/^/| /' conftest.$ac_ext >&5 10615cat conftest.$ac_ext >&5
11982 10616ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
11983ac_lo=`expr $ac_mid + 1`
11984 if test $ac_lo -le $ac_mid; then
11985 ac_lo= ac_hi=
11986 break
11987 fi
11988 ac_mid=`expr 2 '*' $ac_mid + 1`
11989fi 10617fi
11990rm -f conftest.$ac_objext conftest.$ac_ext 10618rm -f conftest.$ac_objext conftest.$ac_ext
11991 done 10619 done
11992else 10620else
11993 echo "$as_me: failed program was:" >&5 10621 echo "$as_me: failed program was:" >&5
11994sed 's/^/| /' conftest.$ac_ext >&5 10622cat conftest.$ac_ext >&5
11995 10623ac_hi=-1 ac_mid=-1
11996cat >conftest.$ac_ext <<_ACEOF
11997#line $LINENO "configure"
11998/* confdefs.h. */
11999_ACEOF
12000cat confdefs.h >>conftest.$ac_ext
12001cat >>conftest.$ac_ext <<_ACEOF
12002/* end confdefs.h. */
12003$ac_includes_default
12004int
12005main ()
12006{
12007static int test_array [1 - 2 * !(((long) (sizeof (long int))) < 0)];
12008test_array [0] = 0
12009
12010 ;
12011 return 0;
12012}
12013_ACEOF
12014rm -f conftest.$ac_objext
12015if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12016 (eval $ac_compile) 2>&5
12017 ac_status=$?
12018 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12019 (exit $ac_status); } &&
12020 { ac_try='test -s conftest.$ac_objext'
12021 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12022 (eval $ac_try) 2>&5
12023 ac_status=$?
12024 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12025 (exit $ac_status); }; }; then
12026 ac_hi=-1 ac_mid=-1
12027 while :; do 10624 while :; do
12028 cat >conftest.$ac_ext <<_ACEOF 10625 cat >conftest.$ac_ext <<_ACEOF
12029#line $LINENO "configure" 10626#line 10626 "configure"
12030/* confdefs.h. */ 10627#include "confdefs.h"
12031_ACEOF
12032cat confdefs.h >>conftest.$ac_ext
12033cat >>conftest.$ac_ext <<_ACEOF
12034/* end confdefs.h. */
12035$ac_includes_default 10628$ac_includes_default
12036int 10629int
12037main () 10630main ()
12038{ 10631{
12039static int test_array [1 - 2 * !(((long) (sizeof (long int))) >= $ac_mid)]; 10632int _array_ [1 - 2 * !((sizeof (long int)) >= $ac_mid)]
12040test_array [0] = 0
12041
12042 ; 10633 ;
12043 return 0; 10634 return 0;
12044} 10635}
12045_ACEOF 10636_ACEOF
12046rm -f conftest.$ac_objext 10637rm -f conftest.$ac_objext
12047if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10638if { (eval echo "$as_me:10638: \"$ac_compile\"") >&5
12048 (eval $ac_compile) 2>&5 10639 (eval $ac_compile) 2>&5
12049 ac_status=$? 10640 ac_status=$?
12050 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10641 echo "$as_me:10641: \$? = $ac_status" >&5
12051 (exit $ac_status); } && 10642 (exit $ac_status); } &&
12052 { ac_try='test -s conftest.$ac_objext' 10643 { ac_try='test -s conftest.$ac_objext'
12053 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10644 { (eval echo "$as_me:10644: \"$ac_try\"") >&5
12054 (eval $ac_try) 2>&5 10645 (eval $ac_try) 2>&5
12055 ac_status=$? 10646 ac_status=$?
12056 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10647 echo "$as_me:10647: \$? = $ac_status" >&5
12057 (exit $ac_status); }; }; then 10648 (exit $ac_status); }; }; then
12058 ac_lo=$ac_mid; break 10649 ac_lo=$ac_mid; break
12059else 10650else
12060 echo "$as_me: failed program was:" >&5 10651 echo "$as_me: failed program was:" >&5
12061sed 's/^/| /' conftest.$ac_ext >&5 10652cat conftest.$ac_ext >&5
12062 10653ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12063ac_hi=`expr '(' $ac_mid ')' - 1`
12064 if test $ac_mid -le $ac_hi; then
12065 ac_lo= ac_hi=
12066 break
12067 fi
12068 ac_mid=`expr 2 '*' $ac_mid`
12069fi 10654fi
12070rm -f conftest.$ac_objext conftest.$ac_ext 10655rm -f conftest.$ac_objext conftest.$ac_ext
12071 done 10656 done
12072else
12073 echo "$as_me: failed program was:" >&5
12074sed 's/^/| /' conftest.$ac_ext >&5
12075
12076ac_lo= ac_hi=
12077fi
12078rm -f conftest.$ac_objext conftest.$ac_ext
12079fi 10657fi
12080rm -f conftest.$ac_objext conftest.$ac_ext 10658rm -f conftest.$ac_objext conftest.$ac_ext
12081# Binary search between lo and hi bounds. 10659# Binary search between lo and hi bounds.
12082while test "x$ac_lo" != "x$ac_hi"; do 10660while test "x$ac_lo" != "x$ac_hi"; do
12083 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 10661 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12084 cat >conftest.$ac_ext <<_ACEOF 10662 cat >conftest.$ac_ext <<_ACEOF
12085#line $LINENO "configure" 10663#line 10663 "configure"
12086/* confdefs.h. */ 10664#include "confdefs.h"
12087_ACEOF
12088cat confdefs.h >>conftest.$ac_ext
12089cat >>conftest.$ac_ext <<_ACEOF
12090/* end confdefs.h. */
12091$ac_includes_default 10665$ac_includes_default
12092int 10666int
12093main () 10667main ()
12094{ 10668{
12095static int test_array [1 - 2 * !(((long) (sizeof (long int))) <= $ac_mid)]; 10669int _array_ [1 - 2 * !((sizeof (long int)) <= $ac_mid)]
12096test_array [0] = 0
12097
12098 ; 10670 ;
12099 return 0; 10671 return 0;
12100} 10672}
12101_ACEOF 10673_ACEOF
12102rm -f conftest.$ac_objext 10674rm -f conftest.$ac_objext
12103if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10675if { (eval echo "$as_me:10675: \"$ac_compile\"") >&5
12104 (eval $ac_compile) 2>&5 10676 (eval $ac_compile) 2>&5
12105 ac_status=$? 10677 ac_status=$?
12106 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10678 echo "$as_me:10678: \$? = $ac_status" >&5
12107 (exit $ac_status); } && 10679 (exit $ac_status); } &&
12108 { ac_try='test -s conftest.$ac_objext' 10680 { ac_try='test -s conftest.$ac_objext'
12109 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10681 { (eval echo "$as_me:10681: \"$ac_try\"") >&5
12110 (eval $ac_try) 2>&5 10682 (eval $ac_try) 2>&5
12111 ac_status=$? 10683 ac_status=$?
12112 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10684 echo "$as_me:10684: \$? = $ac_status" >&5
12113 (exit $ac_status); }; }; then 10685 (exit $ac_status); }; }; then
12114 ac_hi=$ac_mid 10686 ac_hi=$ac_mid
12115else 10687else
12116 echo "$as_me: failed program was:" >&5 10688 echo "$as_me: failed program was:" >&5
12117sed 's/^/| /' conftest.$ac_ext >&5 10689cat conftest.$ac_ext >&5
12118 10690ac_lo=`expr $ac_mid + 1`
12119ac_lo=`expr '(' $ac_mid ')' + 1`
12120fi 10691fi
12121rm -f conftest.$ac_objext conftest.$ac_ext 10692rm -f conftest.$ac_objext conftest.$ac_ext
12122done 10693done
12123case $ac_lo in 10694ac_cv_sizeof_long_int=$ac_lo
12124?*) ac_cv_sizeof_long_int=$ac_lo;;
12125'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77
12126See \`config.log' for more details." >&5
12127echo "$as_me: error: cannot compute sizeof (long int), 77
12128See \`config.log' for more details." >&2;}
12129 { (exit 1); exit 1; }; } ;;
12130esac
12131else 10695else
12132 if test "$cross_compiling" = yes; then 10696 if test "$cross_compiling" = yes; then
12133 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 10697 { { echo "$as_me:10697: error: cannot run test program while cross compiling" >&5
12134See \`config.log' for more details." >&5 10698echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12135echo "$as_me: error: cannot run test program while cross compiling
12136See \`config.log' for more details." >&2;}
12137 { (exit 1); exit 1; }; } 10699 { (exit 1); exit 1; }; }
12138else 10700else
12139 cat >conftest.$ac_ext <<_ACEOF 10701 cat >conftest.$ac_ext <<_ACEOF
12140#line $LINENO "configure" 10702#line 10702 "configure"
12141/* confdefs.h. */ 10703#include "confdefs.h"
12142_ACEOF
12143cat confdefs.h >>conftest.$ac_ext
12144cat >>conftest.$ac_ext <<_ACEOF
12145/* end confdefs.h. */
12146$ac_includes_default 10704$ac_includes_default
12147long longval () { return (long) (sizeof (long int)); }
12148unsigned long ulongval () { return (long) (sizeof (long int)); }
12149#include <stdio.h>
12150#include <stdlib.h>
12151int 10705int
12152main () 10706main ()
12153{ 10707{
12154 10708FILE *f = fopen ("conftest.val", "w");
12155 FILE *f = fopen ("conftest.val", "w"); 10709if (!f)
12156 if (! f) 10710 exit (1);
12157 exit (1); 10711fprintf (f, "%d", (sizeof (long int)));
12158 if (((long) (sizeof (long int))) < 0) 10712fclose (f);
12159 {
12160 long i = longval ();
12161 if (i != ((long) (sizeof (long int))))
12162 exit (1);
12163 fprintf (f, "%ld\n", i);
12164 }
12165 else
12166 {
12167 unsigned long i = ulongval ();
12168 if (i != ((long) (sizeof (long int))))
12169 exit (1);
12170 fprintf (f, "%lu\n", i);
12171 }
12172 exit (ferror (f) || fclose (f) != 0);
12173
12174 ; 10713 ;
12175 return 0; 10714 return 0;
12176} 10715}
12177_ACEOF 10716_ACEOF
12178rm -f conftest$ac_exeext 10717rm -f conftest$ac_exeext
12179if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 10718if { (eval echo "$as_me:10718: \"$ac_link\"") >&5
12180 (eval $ac_link) 2>&5 10719 (eval $ac_link) 2>&5
12181 ac_status=$? 10720 ac_status=$?
12182 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10721 echo "$as_me:10721: \$? = $ac_status" >&5
12183 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 10722 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12184 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10723 { (eval echo "$as_me:10723: \"$ac_try\"") >&5
12185 (eval $ac_try) 2>&5 10724 (eval $ac_try) 2>&5
12186 ac_status=$? 10725 ac_status=$?
12187 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10726 echo "$as_me:10726: \$? = $ac_status" >&5
12188 (exit $ac_status); }; }; then 10727 (exit $ac_status); }; }; then
12189 ac_cv_sizeof_long_int=`cat conftest.val` 10728 ac_cv_sizeof_long_int=`cat conftest.val`
12190else 10729else
12191 echo "$as_me: program exited with status $ac_status" >&5 10730 echo "$as_me: program exited with status $ac_status" >&5
12192echo "$as_me: failed program was:" >&5 10731echo "$as_me: failed program was:" >&5
12193sed 's/^/| /' conftest.$ac_ext >&5 10732cat conftest.$ac_ext >&5
12194
12195( exit $ac_status )
12196{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long int), 77
12197See \`config.log' for more details." >&5
12198echo "$as_me: error: cannot compute sizeof (long int), 77
12199See \`config.log' for more details." >&2;}
12200 { (exit 1); exit 1; }; }
12201fi 10733fi
12202rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 10734rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12203fi 10735fi
12204fi 10736fi
12205rm -f conftest.val 10737rm -f conftest.val
@@ -12207,25 +10739,20 @@ else
12207 ac_cv_sizeof_long_int=0 10739 ac_cv_sizeof_long_int=0
12208fi 10740fi
12209fi 10741fi
12210echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_int" >&5 10742echo "$as_me:10742: result: $ac_cv_sizeof_long_int" >&5
12211echo "${ECHO_T}$ac_cv_sizeof_long_int" >&6 10743echo "${ECHO_T}$ac_cv_sizeof_long_int" >&6
12212cat >>confdefs.h <<_ACEOF 10744cat >>confdefs.h <<EOF
12213#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int 10745#define SIZEOF_LONG_INT $ac_cv_sizeof_long_int
12214_ACEOF 10746EOF
12215
12216 10747
12217echo "$as_me:$LINENO: checking for long long int" >&5 10748echo "$as_me:10748: checking for long long int" >&5
12218echo $ECHO_N "checking for long long int... $ECHO_C" >&6 10749echo $ECHO_N "checking for long long int... $ECHO_C" >&6
12219if test "${ac_cv_type_long_long_int+set}" = set; then 10750if test "${ac_cv_type_long_long_int+set}" = set; then
12220 echo $ECHO_N "(cached) $ECHO_C" >&6 10751 echo $ECHO_N "(cached) $ECHO_C" >&6
12221else 10752else
12222 cat >conftest.$ac_ext <<_ACEOF 10753 cat >conftest.$ac_ext <<_ACEOF
12223#line $LINENO "configure" 10754#line 10754 "configure"
12224/* confdefs.h. */ 10755#include "confdefs.h"
12225_ACEOF
12226cat confdefs.h >>conftest.$ac_ext
12227cat >>conftest.$ac_ext <<_ACEOF
12228/* end confdefs.h. */
12229$ac_includes_default 10756$ac_includes_default
12230int 10757int
12231main () 10758main ()
@@ -12239,328 +10766,209 @@ if (sizeof (long long int))
12239} 10766}
12240_ACEOF 10767_ACEOF
12241rm -f conftest.$ac_objext 10768rm -f conftest.$ac_objext
12242if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10769if { (eval echo "$as_me:10769: \"$ac_compile\"") >&5
12243 (eval $ac_compile) 2>&5 10770 (eval $ac_compile) 2>&5
12244 ac_status=$? 10771 ac_status=$?
12245 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10772 echo "$as_me:10772: \$? = $ac_status" >&5
12246 (exit $ac_status); } && 10773 (exit $ac_status); } &&
12247 { ac_try='test -s conftest.$ac_objext' 10774 { ac_try='test -s conftest.$ac_objext'
12248 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10775 { (eval echo "$as_me:10775: \"$ac_try\"") >&5
12249 (eval $ac_try) 2>&5 10776 (eval $ac_try) 2>&5
12250 ac_status=$? 10777 ac_status=$?
12251 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10778 echo "$as_me:10778: \$? = $ac_status" >&5
12252 (exit $ac_status); }; }; then 10779 (exit $ac_status); }; }; then
12253 ac_cv_type_long_long_int=yes 10780 ac_cv_type_long_long_int=yes
12254else 10781else
12255 echo "$as_me: failed program was:" >&5 10782 echo "$as_me: failed program was:" >&5
12256sed 's/^/| /' conftest.$ac_ext >&5 10783cat conftest.$ac_ext >&5
12257
12258ac_cv_type_long_long_int=no 10784ac_cv_type_long_long_int=no
12259fi 10785fi
12260rm -f conftest.$ac_objext conftest.$ac_ext 10786rm -f conftest.$ac_objext conftest.$ac_ext
12261fi 10787fi
12262echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 10788echo "$as_me:10788: result: $ac_cv_type_long_long_int" >&5
12263echo "${ECHO_T}$ac_cv_type_long_long_int" >&6 10789echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
12264 10790
12265echo "$as_me:$LINENO: checking size of long long int" >&5 10791echo "$as_me:10791: checking size of long long int" >&5
12266echo $ECHO_N "checking size of long long int... $ECHO_C" >&6 10792echo $ECHO_N "checking size of long long int... $ECHO_C" >&6
12267if test "${ac_cv_sizeof_long_long_int+set}" = set; then 10793if test "${ac_cv_sizeof_long_long_int+set}" = set; then
12268 echo $ECHO_N "(cached) $ECHO_C" >&6 10794 echo $ECHO_N "(cached) $ECHO_C" >&6
12269else 10795else
12270 if test "$ac_cv_type_long_long_int" = yes; then 10796 if test "$ac_cv_type_long_long_int" = yes; then
12271 # The cast to unsigned long works around a bug in the HP C Compiler
12272 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
12273 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
12274 # This bug is HP SR number 8606223364.
12275 if test "$cross_compiling" = yes; then 10797 if test "$cross_compiling" = yes; then
12276 # Depending upon the size, compute the lo and hi bounds. 10798 # Depending upon the size, compute the lo and hi bounds.
12277cat >conftest.$ac_ext <<_ACEOF 10799cat >conftest.$ac_ext <<_ACEOF
12278#line $LINENO "configure" 10800#line 10800 "configure"
12279/* confdefs.h. */ 10801#include "confdefs.h"
12280_ACEOF
12281cat confdefs.h >>conftest.$ac_ext
12282cat >>conftest.$ac_ext <<_ACEOF
12283/* end confdefs.h. */
12284$ac_includes_default 10802$ac_includes_default
12285int 10803int
12286main () 10804main ()
12287{ 10805{
12288static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= 0)]; 10806int _array_ [1 - 2 * !((sizeof (long long int)) >= 0)]
12289test_array [0] = 0
12290
12291 ; 10807 ;
12292 return 0; 10808 return 0;
12293} 10809}
12294_ACEOF 10810_ACEOF
12295rm -f conftest.$ac_objext 10811rm -f conftest.$ac_objext
12296if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10812if { (eval echo "$as_me:10812: \"$ac_compile\"") >&5
12297 (eval $ac_compile) 2>&5 10813 (eval $ac_compile) 2>&5
12298 ac_status=$? 10814 ac_status=$?
12299 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10815 echo "$as_me:10815: \$? = $ac_status" >&5
12300 (exit $ac_status); } && 10816 (exit $ac_status); } &&
12301 { ac_try='test -s conftest.$ac_objext' 10817 { ac_try='test -s conftest.$ac_objext'
12302 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10818 { (eval echo "$as_me:10818: \"$ac_try\"") >&5
12303 (eval $ac_try) 2>&5 10819 (eval $ac_try) 2>&5
12304 ac_status=$? 10820 ac_status=$?
12305 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10821 echo "$as_me:10821: \$? = $ac_status" >&5
12306 (exit $ac_status); }; }; then 10822 (exit $ac_status); }; }; then
12307 ac_lo=0 ac_mid=0 10823 ac_lo=0 ac_mid=0
12308 while :; do 10824 while :; do
12309 cat >conftest.$ac_ext <<_ACEOF 10825 cat >conftest.$ac_ext <<_ACEOF
12310#line $LINENO "configure" 10826#line 10826 "configure"
12311/* confdefs.h. */ 10827#include "confdefs.h"
12312_ACEOF
12313cat confdefs.h >>conftest.$ac_ext
12314cat >>conftest.$ac_ext <<_ACEOF
12315/* end confdefs.h. */
12316$ac_includes_default 10828$ac_includes_default
12317int 10829int
12318main () 10830main ()
12319{ 10831{
12320static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)]; 10832int _array_ [1 - 2 * !((sizeof (long long int)) <= $ac_mid)]
12321test_array [0] = 0
12322
12323 ; 10833 ;
12324 return 0; 10834 return 0;
12325} 10835}
12326_ACEOF 10836_ACEOF
12327rm -f conftest.$ac_objext 10837rm -f conftest.$ac_objext
12328if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10838if { (eval echo "$as_me:10838: \"$ac_compile\"") >&5
12329 (eval $ac_compile) 2>&5 10839 (eval $ac_compile) 2>&5
12330 ac_status=$? 10840 ac_status=$?
12331 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10841 echo "$as_me:10841: \$? = $ac_status" >&5
12332 (exit $ac_status); } && 10842 (exit $ac_status); } &&
12333 { ac_try='test -s conftest.$ac_objext' 10843 { ac_try='test -s conftest.$ac_objext'
12334 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10844 { (eval echo "$as_me:10844: \"$ac_try\"") >&5
12335 (eval $ac_try) 2>&5 10845 (eval $ac_try) 2>&5
12336 ac_status=$? 10846 ac_status=$?
12337 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10847 echo "$as_me:10847: \$? = $ac_status" >&5
12338 (exit $ac_status); }; }; then 10848 (exit $ac_status); }; }; then
12339 ac_hi=$ac_mid; break 10849 ac_hi=$ac_mid; break
12340else 10850else
12341 echo "$as_me: failed program was:" >&5 10851 echo "$as_me: failed program was:" >&5
12342sed 's/^/| /' conftest.$ac_ext >&5 10852cat conftest.$ac_ext >&5
12343 10853ac_lo=`expr $ac_mid + 1`; ac_mid=`expr 2 '*' $ac_mid + 1`
12344ac_lo=`expr $ac_mid + 1`
12345 if test $ac_lo -le $ac_mid; then
12346 ac_lo= ac_hi=
12347 break
12348 fi
12349 ac_mid=`expr 2 '*' $ac_mid + 1`
12350fi 10854fi
12351rm -f conftest.$ac_objext conftest.$ac_ext 10855rm -f conftest.$ac_objext conftest.$ac_ext
12352 done 10856 done
12353else 10857else
12354 echo "$as_me: failed program was:" >&5 10858 echo "$as_me: failed program was:" >&5
12355sed 's/^/| /' conftest.$ac_ext >&5 10859cat conftest.$ac_ext >&5
12356 10860ac_hi=-1 ac_mid=-1
12357cat >conftest.$ac_ext <<_ACEOF
12358#line $LINENO "configure"
12359/* confdefs.h. */
12360_ACEOF
12361cat confdefs.h >>conftest.$ac_ext
12362cat >>conftest.$ac_ext <<_ACEOF
12363/* end confdefs.h. */
12364$ac_includes_default
12365int
12366main ()
12367{
12368static int test_array [1 - 2 * !(((long) (sizeof (long long int))) < 0)];
12369test_array [0] = 0
12370
12371 ;
12372 return 0;
12373}
12374_ACEOF
12375rm -f conftest.$ac_objext
12376if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
12377 (eval $ac_compile) 2>&5
12378 ac_status=$?
12379 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12380 (exit $ac_status); } &&
12381 { ac_try='test -s conftest.$ac_objext'
12382 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
12383 (eval $ac_try) 2>&5
12384 ac_status=$?
12385 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12386 (exit $ac_status); }; }; then
12387 ac_hi=-1 ac_mid=-1
12388 while :; do 10861 while :; do
12389 cat >conftest.$ac_ext <<_ACEOF 10862 cat >conftest.$ac_ext <<_ACEOF
12390#line $LINENO "configure" 10863#line 10863 "configure"
12391/* confdefs.h. */ 10864#include "confdefs.h"
12392_ACEOF
12393cat confdefs.h >>conftest.$ac_ext
12394cat >>conftest.$ac_ext <<_ACEOF
12395/* end confdefs.h. */
12396$ac_includes_default 10865$ac_includes_default
12397int 10866int
12398main () 10867main ()
12399{ 10868{
12400static int test_array [1 - 2 * !(((long) (sizeof (long long int))) >= $ac_mid)]; 10869int _array_ [1 - 2 * !((sizeof (long long int)) >= $ac_mid)]
12401test_array [0] = 0
12402
12403 ; 10870 ;
12404 return 0; 10871 return 0;
12405} 10872}
12406_ACEOF 10873_ACEOF
12407rm -f conftest.$ac_objext 10874rm -f conftest.$ac_objext
12408if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10875if { (eval echo "$as_me:10875: \"$ac_compile\"") >&5
12409 (eval $ac_compile) 2>&5 10876 (eval $ac_compile) 2>&5
12410 ac_status=$? 10877 ac_status=$?
12411 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10878 echo "$as_me:10878: \$? = $ac_status" >&5
12412 (exit $ac_status); } && 10879 (exit $ac_status); } &&
12413 { ac_try='test -s conftest.$ac_objext' 10880 { ac_try='test -s conftest.$ac_objext'
12414 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10881 { (eval echo "$as_me:10881: \"$ac_try\"") >&5
12415 (eval $ac_try) 2>&5 10882 (eval $ac_try) 2>&5
12416 ac_status=$? 10883 ac_status=$?
12417 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10884 echo "$as_me:10884: \$? = $ac_status" >&5
12418 (exit $ac_status); }; }; then 10885 (exit $ac_status); }; }; then
12419 ac_lo=$ac_mid; break 10886 ac_lo=$ac_mid; break
12420else 10887else
12421 echo "$as_me: failed program was:" >&5 10888 echo "$as_me: failed program was:" >&5
12422sed 's/^/| /' conftest.$ac_ext >&5 10889cat conftest.$ac_ext >&5
12423 10890ac_hi=`expr $ac_mid - 1`; ac_mid=`expr 2 '*' $ac_mid`
12424ac_hi=`expr '(' $ac_mid ')' - 1`
12425 if test $ac_mid -le $ac_hi; then
12426 ac_lo= ac_hi=
12427 break
12428 fi
12429 ac_mid=`expr 2 '*' $ac_mid`
12430fi 10891fi
12431rm -f conftest.$ac_objext conftest.$ac_ext 10892rm -f conftest.$ac_objext conftest.$ac_ext
12432 done 10893 done
12433else
12434 echo "$as_me: failed program was:" >&5
12435sed 's/^/| /' conftest.$ac_ext >&5
12436
12437ac_lo= ac_hi=
12438fi
12439rm -f conftest.$ac_objext conftest.$ac_ext
12440fi 10894fi
12441rm -f conftest.$ac_objext conftest.$ac_ext 10895rm -f conftest.$ac_objext conftest.$ac_ext
12442# Binary search between lo and hi bounds. 10896# Binary search between lo and hi bounds.
12443while test "x$ac_lo" != "x$ac_hi"; do 10897while test "x$ac_lo" != "x$ac_hi"; do
12444 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` 10898 ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
12445 cat >conftest.$ac_ext <<_ACEOF 10899 cat >conftest.$ac_ext <<_ACEOF
12446#line $LINENO "configure" 10900#line 10900 "configure"
12447/* confdefs.h. */ 10901#include "confdefs.h"
12448_ACEOF
12449cat confdefs.h >>conftest.$ac_ext
12450cat >>conftest.$ac_ext <<_ACEOF
12451/* end confdefs.h. */
12452$ac_includes_default 10902$ac_includes_default
12453int 10903int
12454main () 10904main ()
12455{ 10905{
12456static int test_array [1 - 2 * !(((long) (sizeof (long long int))) <= $ac_mid)]; 10906int _array_ [1 - 2 * !((sizeof (long long int)) <= $ac_mid)]
12457test_array [0] = 0
12458
12459 ; 10907 ;
12460 return 0; 10908 return 0;
12461} 10909}
12462_ACEOF 10910_ACEOF
12463rm -f conftest.$ac_objext 10911rm -f conftest.$ac_objext
12464if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 10912if { (eval echo "$as_me:10912: \"$ac_compile\"") >&5
12465 (eval $ac_compile) 2>&5 10913 (eval $ac_compile) 2>&5
12466 ac_status=$? 10914 ac_status=$?
12467 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10915 echo "$as_me:10915: \$? = $ac_status" >&5
12468 (exit $ac_status); } && 10916 (exit $ac_status); } &&
12469 { ac_try='test -s conftest.$ac_objext' 10917 { ac_try='test -s conftest.$ac_objext'
12470 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10918 { (eval echo "$as_me:10918: \"$ac_try\"") >&5
12471 (eval $ac_try) 2>&5 10919 (eval $ac_try) 2>&5
12472 ac_status=$? 10920 ac_status=$?
12473 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10921 echo "$as_me:10921: \$? = $ac_status" >&5
12474 (exit $ac_status); }; }; then 10922 (exit $ac_status); }; }; then
12475 ac_hi=$ac_mid 10923 ac_hi=$ac_mid
12476else 10924else
12477 echo "$as_me: failed program was:" >&5 10925 echo "$as_me: failed program was:" >&5
12478sed 's/^/| /' conftest.$ac_ext >&5 10926cat conftest.$ac_ext >&5
12479 10927ac_lo=`expr $ac_mid + 1`
12480ac_lo=`expr '(' $ac_mid ')' + 1`
12481fi 10928fi
12482rm -f conftest.$ac_objext conftest.$ac_ext 10929rm -f conftest.$ac_objext conftest.$ac_ext
12483done 10930done
12484case $ac_lo in 10931ac_cv_sizeof_long_long_int=$ac_lo
12485?*) ac_cv_sizeof_long_long_int=$ac_lo;;
12486'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
12487See \`config.log' for more details." >&5
12488echo "$as_me: error: cannot compute sizeof (long long int), 77
12489See \`config.log' for more details." >&2;}
12490 { (exit 1); exit 1; }; } ;;
12491esac
12492else 10932else
12493 if test "$cross_compiling" = yes; then 10933 if test "$cross_compiling" = yes; then
12494 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 10934 { { echo "$as_me:10934: error: cannot run test program while cross compiling" >&5
12495See \`config.log' for more details." >&5 10935echo "$as_me: error: cannot run test program while cross compiling" >&2;}
12496echo "$as_me: error: cannot run test program while cross compiling
12497See \`config.log' for more details." >&2;}
12498 { (exit 1); exit 1; }; } 10936 { (exit 1); exit 1; }; }
12499else 10937else
12500 cat >conftest.$ac_ext <<_ACEOF 10938 cat >conftest.$ac_ext <<_ACEOF
12501#line $LINENO "configure" 10939#line 10939 "configure"
12502/* confdefs.h. */ 10940#include "confdefs.h"
12503_ACEOF
12504cat confdefs.h >>conftest.$ac_ext
12505cat >>conftest.$ac_ext <<_ACEOF
12506/* end confdefs.h. */
12507$ac_includes_default 10941$ac_includes_default
12508long longval () { return (long) (sizeof (long long int)); }
12509unsigned long ulongval () { return (long) (sizeof (long long int)); }
12510#include <stdio.h>
12511#include <stdlib.h>
12512int 10942int
12513main () 10943main ()
12514{ 10944{
12515 10945FILE *f = fopen ("conftest.val", "w");
12516 FILE *f = fopen ("conftest.val", "w"); 10946if (!f)
12517 if (! f) 10947 exit (1);
12518 exit (1); 10948fprintf (f, "%d", (sizeof (long long int)));
12519 if (((long) (sizeof (long long int))) < 0) 10949fclose (f);
12520 {
12521 long i = longval ();
12522 if (i != ((long) (sizeof (long long int))))
12523 exit (1);
12524 fprintf (f, "%ld\n", i);
12525 }
12526 else
12527 {
12528 unsigned long i = ulongval ();
12529 if (i != ((long) (sizeof (long long int))))
12530 exit (1);
12531 fprintf (f, "%lu\n", i);
12532 }
12533 exit (ferror (f) || fclose (f) != 0);
12534
12535 ; 10950 ;
12536 return 0; 10951 return 0;
12537} 10952}
12538_ACEOF 10953_ACEOF
12539rm -f conftest$ac_exeext 10954rm -f conftest$ac_exeext
12540if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 10955if { (eval echo "$as_me:10955: \"$ac_link\"") >&5
12541 (eval $ac_link) 2>&5 10956 (eval $ac_link) 2>&5
12542 ac_status=$? 10957 ac_status=$?
12543 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10958 echo "$as_me:10958: \$? = $ac_status" >&5
12544 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 10959 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
12545 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 10960 { (eval echo "$as_me:10960: \"$ac_try\"") >&5
12546 (eval $ac_try) 2>&5 10961 (eval $ac_try) 2>&5
12547 ac_status=$? 10962 ac_status=$?
12548 echo "$as_me:$LINENO: \$? = $ac_status" >&5 10963 echo "$as_me:10963: \$? = $ac_status" >&5
12549 (exit $ac_status); }; }; then 10964 (exit $ac_status); }; }; then
12550 ac_cv_sizeof_long_long_int=`cat conftest.val` 10965 ac_cv_sizeof_long_long_int=`cat conftest.val`
12551else 10966else
12552 echo "$as_me: program exited with status $ac_status" >&5 10967 echo "$as_me: program exited with status $ac_status" >&5
12553echo "$as_me: failed program was:" >&5 10968echo "$as_me: failed program was:" >&5
12554sed 's/^/| /' conftest.$ac_ext >&5 10969cat conftest.$ac_ext >&5
12555
12556( exit $ac_status )
12557{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long long int), 77
12558See \`config.log' for more details." >&5
12559echo "$as_me: error: cannot compute sizeof (long long int), 77
12560See \`config.log' for more details." >&2;}
12561 { (exit 1); exit 1; }; }
12562fi 10970fi
12563rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 10971rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
12564fi 10972fi
12565fi 10973fi
12566rm -f conftest.val 10974rm -f conftest.val
@@ -12568,13 +10976,11 @@ else
12568 ac_cv_sizeof_long_long_int=0 10976 ac_cv_sizeof_long_long_int=0
12569fi 10977fi
12570fi 10978fi
12571echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long_int" >&5 10979echo "$as_me:10979: result: $ac_cv_sizeof_long_long_int" >&5
12572echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6 10980echo "${ECHO_T}$ac_cv_sizeof_long_long_int" >&6
12573cat >>confdefs.h <<_ACEOF 10981cat >>confdefs.h <<EOF
12574#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int 10982#define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int
12575_ACEOF 10983EOF
12576
12577
12578 10984
12579# Sanity check long long for some platforms (AIX) 10985# Sanity check long long for some platforms (AIX)
12580if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then 10986if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
@@ -12582,19 +10988,15 @@ if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
12582fi 10988fi
12583 10989
12584# More checks for data types 10990# More checks for data types
12585echo "$as_me:$LINENO: checking for u_int type" >&5 10991echo "$as_me:10991: checking for u_int type" >&5
12586echo $ECHO_N "checking for u_int type... $ECHO_C" >&6 10992echo $ECHO_N "checking for u_int type... $ECHO_C" >&6
12587if test "${ac_cv_have_u_int+set}" = set; then 10993if test "${ac_cv_have_u_int+set}" = set; then
12588 echo $ECHO_N "(cached) $ECHO_C" >&6 10994 echo $ECHO_N "(cached) $ECHO_C" >&6
12589else 10995else
12590 10996
12591 cat >conftest.$ac_ext <<_ACEOF 10997 cat >conftest.$ac_ext <<_ACEOF
12592#line $LINENO "configure" 10998#line 10998 "configure"
12593/* confdefs.h. */ 10999#include "confdefs.h"
12594_ACEOF
12595cat confdefs.h >>conftest.$ac_ext
12596cat >>conftest.$ac_ext <<_ACEOF
12597/* end confdefs.h. */
12598 #include <sys/types.h> 11000 #include <sys/types.h>
12599int 11001int
12600main () 11002main ()
@@ -12605,51 +11007,46 @@ main ()
12605} 11007}
12606_ACEOF 11008_ACEOF
12607rm -f conftest.$ac_objext 11009rm -f conftest.$ac_objext
12608if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11010if { (eval echo "$as_me:11010: \"$ac_compile\"") >&5
12609 (eval $ac_compile) 2>&5 11011 (eval $ac_compile) 2>&5
12610 ac_status=$? 11012 ac_status=$?
12611 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11013 echo "$as_me:11013: \$? = $ac_status" >&5
12612 (exit $ac_status); } && 11014 (exit $ac_status); } &&
12613 { ac_try='test -s conftest.$ac_objext' 11015 { ac_try='test -s conftest.$ac_objext'
12614 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11016 { (eval echo "$as_me:11016: \"$ac_try\"") >&5
12615 (eval $ac_try) 2>&5 11017 (eval $ac_try) 2>&5
12616 ac_status=$? 11018 ac_status=$?
12617 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11019 echo "$as_me:11019: \$? = $ac_status" >&5
12618 (exit $ac_status); }; }; then 11020 (exit $ac_status); }; }; then
12619 ac_cv_have_u_int="yes" 11021 ac_cv_have_u_int="yes"
12620else 11022else
12621 echo "$as_me: failed program was:" >&5 11023 echo "$as_me: failed program was:" >&5
12622sed 's/^/| /' conftest.$ac_ext >&5 11024cat conftest.$ac_ext >&5
12623
12624 ac_cv_have_u_int="no" 11025 ac_cv_have_u_int="no"
12625 11026
12626fi 11027fi
12627rm -f conftest.$ac_objext conftest.$ac_ext 11028rm -f conftest.$ac_objext conftest.$ac_ext
12628 11029
12629fi 11030fi
12630echo "$as_me:$LINENO: result: $ac_cv_have_u_int" >&5 11031echo "$as_me:11031: result: $ac_cv_have_u_int" >&5
12631echo "${ECHO_T}$ac_cv_have_u_int" >&6 11032echo "${ECHO_T}$ac_cv_have_u_int" >&6
12632if test "x$ac_cv_have_u_int" = "xyes" ; then 11033if test "x$ac_cv_have_u_int" = "xyes" ; then
12633 cat >>confdefs.h <<\_ACEOF 11034 cat >>confdefs.h <<\EOF
12634#define HAVE_U_INT 1 11035#define HAVE_U_INT 1
12635_ACEOF 11036EOF
12636 11037
12637 have_u_int=1 11038 have_u_int=1
12638fi 11039fi
12639 11040
12640echo "$as_me:$LINENO: checking for intXX_t types" >&5 11041echo "$as_me:11041: checking for intXX_t types" >&5
12641echo $ECHO_N "checking for intXX_t types... $ECHO_C" >&6 11042echo $ECHO_N "checking for intXX_t types... $ECHO_C" >&6
12642if test "${ac_cv_have_intxx_t+set}" = set; then 11043if test "${ac_cv_have_intxx_t+set}" = set; then
12643 echo $ECHO_N "(cached) $ECHO_C" >&6 11044 echo $ECHO_N "(cached) $ECHO_C" >&6
12644else 11045else
12645 11046
12646 cat >conftest.$ac_ext <<_ACEOF 11047 cat >conftest.$ac_ext <<_ACEOF
12647#line $LINENO "configure" 11048#line 11048 "configure"
12648/* confdefs.h. */ 11049#include "confdefs.h"
12649_ACEOF
12650cat confdefs.h >>conftest.$ac_ext
12651cat >>conftest.$ac_ext <<_ACEOF
12652/* end confdefs.h. */
12653 #include <sys/types.h> 11050 #include <sys/types.h>
12654int 11051int
12655main () 11052main ()
@@ -12660,34 +11057,33 @@ main ()
12660} 11057}
12661_ACEOF 11058_ACEOF
12662rm -f conftest.$ac_objext 11059rm -f conftest.$ac_objext
12663if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11060if { (eval echo "$as_me:11060: \"$ac_compile\"") >&5
12664 (eval $ac_compile) 2>&5 11061 (eval $ac_compile) 2>&5
12665 ac_status=$? 11062 ac_status=$?
12666 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11063 echo "$as_me:11063: \$? = $ac_status" >&5
12667 (exit $ac_status); } && 11064 (exit $ac_status); } &&
12668 { ac_try='test -s conftest.$ac_objext' 11065 { ac_try='test -s conftest.$ac_objext'
12669 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11066 { (eval echo "$as_me:11066: \"$ac_try\"") >&5
12670 (eval $ac_try) 2>&5 11067 (eval $ac_try) 2>&5
12671 ac_status=$? 11068 ac_status=$?
12672 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11069 echo "$as_me:11069: \$? = $ac_status" >&5
12673 (exit $ac_status); }; }; then 11070 (exit $ac_status); }; }; then
12674 ac_cv_have_intxx_t="yes" 11071 ac_cv_have_intxx_t="yes"
12675else 11072else
12676 echo "$as_me: failed program was:" >&5 11073 echo "$as_me: failed program was:" >&5
12677sed 's/^/| /' conftest.$ac_ext >&5 11074cat conftest.$ac_ext >&5
12678
12679 ac_cv_have_intxx_t="no" 11075 ac_cv_have_intxx_t="no"
12680 11076
12681fi 11077fi
12682rm -f conftest.$ac_objext conftest.$ac_ext 11078rm -f conftest.$ac_objext conftest.$ac_ext
12683 11079
12684fi 11080fi
12685echo "$as_me:$LINENO: result: $ac_cv_have_intxx_t" >&5 11081echo "$as_me:11081: result: $ac_cv_have_intxx_t" >&5
12686echo "${ECHO_T}$ac_cv_have_intxx_t" >&6 11082echo "${ECHO_T}$ac_cv_have_intxx_t" >&6
12687if test "x$ac_cv_have_intxx_t" = "xyes" ; then 11083if test "x$ac_cv_have_intxx_t" = "xyes" ; then
12688 cat >>confdefs.h <<\_ACEOF 11084 cat >>confdefs.h <<\EOF
12689#define HAVE_INTXX_T 1 11085#define HAVE_INTXX_T 1
12690_ACEOF 11086EOF
12691 11087
12692 have_intxx_t=1 11088 have_intxx_t=1
12693fi 11089fi
@@ -12695,15 +11091,11 @@ fi
12695if (test -z "$have_intxx_t" && \ 11091if (test -z "$have_intxx_t" && \
12696 test "x$ac_cv_header_stdint_h" = "xyes") 11092 test "x$ac_cv_header_stdint_h" = "xyes")
12697then 11093then
12698 echo "$as_me:$LINENO: checking for intXX_t types in stdint.h" >&5 11094 echo "$as_me:11094: checking for intXX_t types in stdint.h" >&5
12699echo $ECHO_N "checking for intXX_t types in stdint.h... $ECHO_C" >&6 11095echo $ECHO_N "checking for intXX_t types in stdint.h... $ECHO_C" >&6
12700 cat >conftest.$ac_ext <<_ACEOF 11096 cat >conftest.$ac_ext <<_ACEOF
12701#line $LINENO "configure" 11097#line 11097 "configure"
12702/* confdefs.h. */ 11098#include "confdefs.h"
12703_ACEOF
12704cat confdefs.h >>conftest.$ac_ext
12705cat >>conftest.$ac_ext <<_ACEOF
12706/* end confdefs.h. */
12707 #include <stdint.h> 11099 #include <stdint.h>
12708int 11100int
12709main () 11101main ()
@@ -12714,49 +11106,44 @@ main ()
12714} 11106}
12715_ACEOF 11107_ACEOF
12716rm -f conftest.$ac_objext 11108rm -f conftest.$ac_objext
12717if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11109if { (eval echo "$as_me:11109: \"$ac_compile\"") >&5
12718 (eval $ac_compile) 2>&5 11110 (eval $ac_compile) 2>&5
12719 ac_status=$? 11111 ac_status=$?
12720 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11112 echo "$as_me:11112: \$? = $ac_status" >&5
12721 (exit $ac_status); } && 11113 (exit $ac_status); } &&
12722 { ac_try='test -s conftest.$ac_objext' 11114 { ac_try='test -s conftest.$ac_objext'
12723 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11115 { (eval echo "$as_me:11115: \"$ac_try\"") >&5
12724 (eval $ac_try) 2>&5 11116 (eval $ac_try) 2>&5
12725 ac_status=$? 11117 ac_status=$?
12726 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11118 echo "$as_me:11118: \$? = $ac_status" >&5
12727 (exit $ac_status); }; }; then 11119 (exit $ac_status); }; }; then
12728 11120
12729 cat >>confdefs.h <<\_ACEOF 11121 cat >>confdefs.h <<\EOF
12730#define HAVE_INTXX_T 1 11122#define HAVE_INTXX_T 1
12731_ACEOF 11123EOF
12732 11124
12733 echo "$as_me:$LINENO: result: yes" >&5 11125 echo "$as_me:11125: result: yes" >&5
12734echo "${ECHO_T}yes" >&6 11126echo "${ECHO_T}yes" >&6
12735 11127
12736else 11128else
12737 echo "$as_me: failed program was:" >&5 11129 echo "$as_me: failed program was:" >&5
12738sed 's/^/| /' conftest.$ac_ext >&5 11130cat conftest.$ac_ext >&5
12739 11131 echo "$as_me:11131: result: no" >&5
12740 echo "$as_me:$LINENO: result: no" >&5
12741echo "${ECHO_T}no" >&6 11132echo "${ECHO_T}no" >&6
12742 11133
12743fi 11134fi
12744rm -f conftest.$ac_objext conftest.$ac_ext 11135rm -f conftest.$ac_objext conftest.$ac_ext
12745fi 11136fi
12746 11137
12747echo "$as_me:$LINENO: checking for int64_t type" >&5 11138echo "$as_me:11138: checking for int64_t type" >&5
12748echo $ECHO_N "checking for int64_t type... $ECHO_C" >&6 11139echo $ECHO_N "checking for int64_t type... $ECHO_C" >&6
12749if test "${ac_cv_have_int64_t+set}" = set; then 11140if test "${ac_cv_have_int64_t+set}" = set; then
12750 echo $ECHO_N "(cached) $ECHO_C" >&6 11141 echo $ECHO_N "(cached) $ECHO_C" >&6
12751else 11142else
12752 11143
12753 cat >conftest.$ac_ext <<_ACEOF 11144 cat >conftest.$ac_ext <<_ACEOF
12754#line $LINENO "configure" 11145#line 11145 "configure"
12755/* confdefs.h. */ 11146#include "confdefs.h"
12756_ACEOF
12757cat confdefs.h >>conftest.$ac_ext
12758cat >>conftest.$ac_ext <<_ACEOF
12759/* end confdefs.h. */
12760 11147
12761#include <sys/types.h> 11148#include <sys/types.h>
12762#ifdef HAVE_STDINT_H 11149#ifdef HAVE_STDINT_H
@@ -12776,50 +11163,45 @@ main ()
12776} 11163}
12777_ACEOF 11164_ACEOF
12778rm -f conftest.$ac_objext 11165rm -f conftest.$ac_objext
12779if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11166if { (eval echo "$as_me:11166: \"$ac_compile\"") >&5
12780 (eval $ac_compile) 2>&5 11167 (eval $ac_compile) 2>&5
12781 ac_status=$? 11168 ac_status=$?
12782 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11169 echo "$as_me:11169: \$? = $ac_status" >&5
12783 (exit $ac_status); } && 11170 (exit $ac_status); } &&
12784 { ac_try='test -s conftest.$ac_objext' 11171 { ac_try='test -s conftest.$ac_objext'
12785 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11172 { (eval echo "$as_me:11172: \"$ac_try\"") >&5
12786 (eval $ac_try) 2>&5 11173 (eval $ac_try) 2>&5
12787 ac_status=$? 11174 ac_status=$?
12788 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11175 echo "$as_me:11175: \$? = $ac_status" >&5
12789 (exit $ac_status); }; }; then 11176 (exit $ac_status); }; }; then
12790 ac_cv_have_int64_t="yes" 11177 ac_cv_have_int64_t="yes"
12791else 11178else
12792 echo "$as_me: failed program was:" >&5 11179 echo "$as_me: failed program was:" >&5
12793sed 's/^/| /' conftest.$ac_ext >&5 11180cat conftest.$ac_ext >&5
12794
12795 ac_cv_have_int64_t="no" 11181 ac_cv_have_int64_t="no"
12796 11182
12797fi 11183fi
12798rm -f conftest.$ac_objext conftest.$ac_ext 11184rm -f conftest.$ac_objext conftest.$ac_ext
12799 11185
12800fi 11186fi
12801echo "$as_me:$LINENO: result: $ac_cv_have_int64_t" >&5 11187echo "$as_me:11187: result: $ac_cv_have_int64_t" >&5
12802echo "${ECHO_T}$ac_cv_have_int64_t" >&6 11188echo "${ECHO_T}$ac_cv_have_int64_t" >&6
12803if test "x$ac_cv_have_int64_t" = "xyes" ; then 11189if test "x$ac_cv_have_int64_t" = "xyes" ; then
12804 cat >>confdefs.h <<\_ACEOF 11190 cat >>confdefs.h <<\EOF
12805#define HAVE_INT64_T 1 11191#define HAVE_INT64_T 1
12806_ACEOF 11192EOF
12807 11193
12808fi 11194fi
12809 11195
12810echo "$as_me:$LINENO: checking for u_intXX_t types" >&5 11196echo "$as_me:11196: checking for u_intXX_t types" >&5
12811echo $ECHO_N "checking for u_intXX_t types... $ECHO_C" >&6 11197echo $ECHO_N "checking for u_intXX_t types... $ECHO_C" >&6
12812if test "${ac_cv_have_u_intxx_t+set}" = set; then 11198if test "${ac_cv_have_u_intxx_t+set}" = set; then
12813 echo $ECHO_N "(cached) $ECHO_C" >&6 11199 echo $ECHO_N "(cached) $ECHO_C" >&6
12814else 11200else
12815 11201
12816 cat >conftest.$ac_ext <<_ACEOF 11202 cat >conftest.$ac_ext <<_ACEOF
12817#line $LINENO "configure" 11203#line 11203 "configure"
12818/* confdefs.h. */ 11204#include "confdefs.h"
12819_ACEOF
12820cat confdefs.h >>conftest.$ac_ext
12821cat >>conftest.$ac_ext <<_ACEOF
12822/* end confdefs.h. */
12823 #include <sys/types.h> 11205 #include <sys/types.h>
12824int 11206int
12825main () 11207main ()
@@ -12830,48 +11212,43 @@ main ()
12830} 11212}
12831_ACEOF 11213_ACEOF
12832rm -f conftest.$ac_objext 11214rm -f conftest.$ac_objext
12833if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11215if { (eval echo "$as_me:11215: \"$ac_compile\"") >&5
12834 (eval $ac_compile) 2>&5 11216 (eval $ac_compile) 2>&5
12835 ac_status=$? 11217 ac_status=$?
12836 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11218 echo "$as_me:11218: \$? = $ac_status" >&5
12837 (exit $ac_status); } && 11219 (exit $ac_status); } &&
12838 { ac_try='test -s conftest.$ac_objext' 11220 { ac_try='test -s conftest.$ac_objext'
12839 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11221 { (eval echo "$as_me:11221: \"$ac_try\"") >&5
12840 (eval $ac_try) 2>&5 11222 (eval $ac_try) 2>&5
12841 ac_status=$? 11223 ac_status=$?
12842 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11224 echo "$as_me:11224: \$? = $ac_status" >&5
12843 (exit $ac_status); }; }; then 11225 (exit $ac_status); }; }; then
12844 ac_cv_have_u_intxx_t="yes" 11226 ac_cv_have_u_intxx_t="yes"
12845else 11227else
12846 echo "$as_me: failed program was:" >&5 11228 echo "$as_me: failed program was:" >&5
12847sed 's/^/| /' conftest.$ac_ext >&5 11229cat conftest.$ac_ext >&5
12848
12849 ac_cv_have_u_intxx_t="no" 11230 ac_cv_have_u_intxx_t="no"
12850 11231
12851fi 11232fi
12852rm -f conftest.$ac_objext conftest.$ac_ext 11233rm -f conftest.$ac_objext conftest.$ac_ext
12853 11234
12854fi 11235fi
12855echo "$as_me:$LINENO: result: $ac_cv_have_u_intxx_t" >&5 11236echo "$as_me:11236: result: $ac_cv_have_u_intxx_t" >&5
12856echo "${ECHO_T}$ac_cv_have_u_intxx_t" >&6 11237echo "${ECHO_T}$ac_cv_have_u_intxx_t" >&6
12857if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then 11238if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
12858 cat >>confdefs.h <<\_ACEOF 11239 cat >>confdefs.h <<\EOF
12859#define HAVE_U_INTXX_T 1 11240#define HAVE_U_INTXX_T 1
12860_ACEOF 11241EOF
12861 11242
12862 have_u_intxx_t=1 11243 have_u_intxx_t=1
12863fi 11244fi
12864 11245
12865if test -z "$have_u_intxx_t" ; then 11246if test -z "$have_u_intxx_t" ; then
12866 echo "$as_me:$LINENO: checking for u_intXX_t types in sys/socket.h" >&5 11247 echo "$as_me:11247: checking for u_intXX_t types in sys/socket.h" >&5
12867echo $ECHO_N "checking for u_intXX_t types in sys/socket.h... $ECHO_C" >&6 11248echo $ECHO_N "checking for u_intXX_t types in sys/socket.h... $ECHO_C" >&6
12868 cat >conftest.$ac_ext <<_ACEOF 11249 cat >conftest.$ac_ext <<_ACEOF
12869#line $LINENO "configure" 11250#line 11250 "configure"
12870/* confdefs.h. */ 11251#include "confdefs.h"
12871_ACEOF
12872cat confdefs.h >>conftest.$ac_ext
12873cat >>conftest.$ac_ext <<_ACEOF
12874/* end confdefs.h. */
12875 #include <sys/socket.h> 11252 #include <sys/socket.h>
12876int 11253int
12877main () 11254main ()
@@ -12882,49 +11259,44 @@ main ()
12882} 11259}
12883_ACEOF 11260_ACEOF
12884rm -f conftest.$ac_objext 11261rm -f conftest.$ac_objext
12885if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11262if { (eval echo "$as_me:11262: \"$ac_compile\"") >&5
12886 (eval $ac_compile) 2>&5 11263 (eval $ac_compile) 2>&5
12887 ac_status=$? 11264 ac_status=$?
12888 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11265 echo "$as_me:11265: \$? = $ac_status" >&5
12889 (exit $ac_status); } && 11266 (exit $ac_status); } &&
12890 { ac_try='test -s conftest.$ac_objext' 11267 { ac_try='test -s conftest.$ac_objext'
12891 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11268 { (eval echo "$as_me:11268: \"$ac_try\"") >&5
12892 (eval $ac_try) 2>&5 11269 (eval $ac_try) 2>&5
12893 ac_status=$? 11270 ac_status=$?
12894 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11271 echo "$as_me:11271: \$? = $ac_status" >&5
12895 (exit $ac_status); }; }; then 11272 (exit $ac_status); }; }; then
12896 11273
12897 cat >>confdefs.h <<\_ACEOF 11274 cat >>confdefs.h <<\EOF
12898#define HAVE_U_INTXX_T 1 11275#define HAVE_U_INTXX_T 1
12899_ACEOF 11276EOF
12900 11277
12901 echo "$as_me:$LINENO: result: yes" >&5 11278 echo "$as_me:11278: result: yes" >&5
12902echo "${ECHO_T}yes" >&6 11279echo "${ECHO_T}yes" >&6
12903 11280
12904else 11281else
12905 echo "$as_me: failed program was:" >&5 11282 echo "$as_me: failed program was:" >&5
12906sed 's/^/| /' conftest.$ac_ext >&5 11283cat conftest.$ac_ext >&5
12907 11284 echo "$as_me:11284: result: no" >&5
12908 echo "$as_me:$LINENO: result: no" >&5
12909echo "${ECHO_T}no" >&6 11285echo "${ECHO_T}no" >&6
12910 11286
12911fi 11287fi
12912rm -f conftest.$ac_objext conftest.$ac_ext 11288rm -f conftest.$ac_objext conftest.$ac_ext
12913fi 11289fi
12914 11290
12915echo "$as_me:$LINENO: checking for u_int64_t types" >&5 11291echo "$as_me:11291: checking for u_int64_t types" >&5
12916echo $ECHO_N "checking for u_int64_t types... $ECHO_C" >&6 11292echo $ECHO_N "checking for u_int64_t types... $ECHO_C" >&6
12917if test "${ac_cv_have_u_int64_t+set}" = set; then 11293if test "${ac_cv_have_u_int64_t+set}" = set; then
12918 echo $ECHO_N "(cached) $ECHO_C" >&6 11294 echo $ECHO_N "(cached) $ECHO_C" >&6
12919else 11295else
12920 11296
12921 cat >conftest.$ac_ext <<_ACEOF 11297 cat >conftest.$ac_ext <<_ACEOF
12922#line $LINENO "configure" 11298#line 11298 "configure"
12923/* confdefs.h. */ 11299#include "confdefs.h"
12924_ACEOF
12925cat confdefs.h >>conftest.$ac_ext
12926cat >>conftest.$ac_ext <<_ACEOF
12927/* end confdefs.h. */
12928 #include <sys/types.h> 11300 #include <sys/types.h>
12929int 11301int
12930main () 11302main ()
@@ -12935,48 +11307,43 @@ main ()
12935} 11307}
12936_ACEOF 11308_ACEOF
12937rm -f conftest.$ac_objext 11309rm -f conftest.$ac_objext
12938if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11310if { (eval echo "$as_me:11310: \"$ac_compile\"") >&5
12939 (eval $ac_compile) 2>&5 11311 (eval $ac_compile) 2>&5
12940 ac_status=$? 11312 ac_status=$?
12941 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11313 echo "$as_me:11313: \$? = $ac_status" >&5
12942 (exit $ac_status); } && 11314 (exit $ac_status); } &&
12943 { ac_try='test -s conftest.$ac_objext' 11315 { ac_try='test -s conftest.$ac_objext'
12944 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11316 { (eval echo "$as_me:11316: \"$ac_try\"") >&5
12945 (eval $ac_try) 2>&5 11317 (eval $ac_try) 2>&5
12946 ac_status=$? 11318 ac_status=$?
12947 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11319 echo "$as_me:11319: \$? = $ac_status" >&5
12948 (exit $ac_status); }; }; then 11320 (exit $ac_status); }; }; then
12949 ac_cv_have_u_int64_t="yes" 11321 ac_cv_have_u_int64_t="yes"
12950else 11322else
12951 echo "$as_me: failed program was:" >&5 11323 echo "$as_me: failed program was:" >&5
12952sed 's/^/| /' conftest.$ac_ext >&5 11324cat conftest.$ac_ext >&5
12953
12954 ac_cv_have_u_int64_t="no" 11325 ac_cv_have_u_int64_t="no"
12955 11326
12956fi 11327fi
12957rm -f conftest.$ac_objext conftest.$ac_ext 11328rm -f conftest.$ac_objext conftest.$ac_ext
12958 11329
12959fi 11330fi
12960echo "$as_me:$LINENO: result: $ac_cv_have_u_int64_t" >&5 11331echo "$as_me:11331: result: $ac_cv_have_u_int64_t" >&5
12961echo "${ECHO_T}$ac_cv_have_u_int64_t" >&6 11332echo "${ECHO_T}$ac_cv_have_u_int64_t" >&6
12962if test "x$ac_cv_have_u_int64_t" = "xyes" ; then 11333if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
12963 cat >>confdefs.h <<\_ACEOF 11334 cat >>confdefs.h <<\EOF
12964#define HAVE_U_INT64_T 1 11335#define HAVE_U_INT64_T 1
12965_ACEOF 11336EOF
12966 11337
12967 have_u_int64_t=1 11338 have_u_int64_t=1
12968fi 11339fi
12969 11340
12970if test -z "$have_u_int64_t" ; then 11341if test -z "$have_u_int64_t" ; then
12971 echo "$as_me:$LINENO: checking for u_int64_t type in sys/bitypes.h" >&5 11342 echo "$as_me:11342: checking for u_int64_t type in sys/bitypes.h" >&5
12972echo $ECHO_N "checking for u_int64_t type in sys/bitypes.h... $ECHO_C" >&6 11343echo $ECHO_N "checking for u_int64_t type in sys/bitypes.h... $ECHO_C" >&6
12973 cat >conftest.$ac_ext <<_ACEOF 11344 cat >conftest.$ac_ext <<_ACEOF
12974#line $LINENO "configure" 11345#line 11345 "configure"
12975/* confdefs.h. */ 11346#include "confdefs.h"
12976_ACEOF
12977cat confdefs.h >>conftest.$ac_ext
12978cat >>conftest.$ac_ext <<_ACEOF
12979/* end confdefs.h. */
12980 #include <sys/bitypes.h> 11347 #include <sys/bitypes.h>
12981int 11348int
12982main () 11349main ()
@@ -12987,30 +11354,29 @@ main ()
12987} 11354}
12988_ACEOF 11355_ACEOF
12989rm -f conftest.$ac_objext 11356rm -f conftest.$ac_objext
12990if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11357if { (eval echo "$as_me:11357: \"$ac_compile\"") >&5
12991 (eval $ac_compile) 2>&5 11358 (eval $ac_compile) 2>&5
12992 ac_status=$? 11359 ac_status=$?
12993 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11360 echo "$as_me:11360: \$? = $ac_status" >&5
12994 (exit $ac_status); } && 11361 (exit $ac_status); } &&
12995 { ac_try='test -s conftest.$ac_objext' 11362 { ac_try='test -s conftest.$ac_objext'
12996 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11363 { (eval echo "$as_me:11363: \"$ac_try\"") >&5
12997 (eval $ac_try) 2>&5 11364 (eval $ac_try) 2>&5
12998 ac_status=$? 11365 ac_status=$?
12999 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11366 echo "$as_me:11366: \$? = $ac_status" >&5
13000 (exit $ac_status); }; }; then 11367 (exit $ac_status); }; }; then
13001 11368
13002 cat >>confdefs.h <<\_ACEOF 11369 cat >>confdefs.h <<\EOF
13003#define HAVE_U_INT64_T 1 11370#define HAVE_U_INT64_T 1
13004_ACEOF 11371EOF
13005 11372
13006 echo "$as_me:$LINENO: result: yes" >&5 11373 echo "$as_me:11373: result: yes" >&5
13007echo "${ECHO_T}yes" >&6 11374echo "${ECHO_T}yes" >&6
13008 11375
13009else 11376else
13010 echo "$as_me: failed program was:" >&5 11377 echo "$as_me: failed program was:" >&5
13011sed 's/^/| /' conftest.$ac_ext >&5 11378cat conftest.$ac_ext >&5
13012 11379 echo "$as_me:11379: result: no" >&5
13013 echo "$as_me:$LINENO: result: no" >&5
13014echo "${ECHO_T}no" >&6 11380echo "${ECHO_T}no" >&6
13015 11381
13016fi 11382fi
@@ -13018,19 +11384,15 @@ rm -f conftest.$ac_objext conftest.$ac_ext
13018fi 11384fi
13019 11385
13020if test -z "$have_u_intxx_t" ; then 11386if test -z "$have_u_intxx_t" ; then
13021 echo "$as_me:$LINENO: checking for uintXX_t types" >&5 11387 echo "$as_me:11387: checking for uintXX_t types" >&5
13022echo $ECHO_N "checking for uintXX_t types... $ECHO_C" >&6 11388echo $ECHO_N "checking for uintXX_t types... $ECHO_C" >&6
13023if test "${ac_cv_have_uintxx_t+set}" = set; then 11389if test "${ac_cv_have_uintxx_t+set}" = set; then
13024 echo $ECHO_N "(cached) $ECHO_C" >&6 11390 echo $ECHO_N "(cached) $ECHO_C" >&6
13025else 11391else
13026 11392
13027 cat >conftest.$ac_ext <<_ACEOF 11393 cat >conftest.$ac_ext <<_ACEOF
13028#line $LINENO "configure" 11394#line 11394 "configure"
13029/* confdefs.h. */ 11395#include "confdefs.h"
13030_ACEOF
13031cat confdefs.h >>conftest.$ac_ext
13032cat >>conftest.$ac_ext <<_ACEOF
13033/* end confdefs.h. */
13034 11396
13035#include <sys/types.h> 11397#include <sys/types.h>
13036 11398
@@ -13043,48 +11405,43 @@ main ()
13043} 11405}
13044_ACEOF 11406_ACEOF
13045rm -f conftest.$ac_objext 11407rm -f conftest.$ac_objext
13046if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11408if { (eval echo "$as_me:11408: \"$ac_compile\"") >&5
13047 (eval $ac_compile) 2>&5 11409 (eval $ac_compile) 2>&5
13048 ac_status=$? 11410 ac_status=$?
13049 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11411 echo "$as_me:11411: \$? = $ac_status" >&5
13050 (exit $ac_status); } && 11412 (exit $ac_status); } &&
13051 { ac_try='test -s conftest.$ac_objext' 11413 { ac_try='test -s conftest.$ac_objext'
13052 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11414 { (eval echo "$as_me:11414: \"$ac_try\"") >&5
13053 (eval $ac_try) 2>&5 11415 (eval $ac_try) 2>&5
13054 ac_status=$? 11416 ac_status=$?
13055 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11417 echo "$as_me:11417: \$? = $ac_status" >&5
13056 (exit $ac_status); }; }; then 11418 (exit $ac_status); }; }; then
13057 ac_cv_have_uintxx_t="yes" 11419 ac_cv_have_uintxx_t="yes"
13058else 11420else
13059 echo "$as_me: failed program was:" >&5 11421 echo "$as_me: failed program was:" >&5
13060sed 's/^/| /' conftest.$ac_ext >&5 11422cat conftest.$ac_ext >&5
13061
13062 ac_cv_have_uintxx_t="no" 11423 ac_cv_have_uintxx_t="no"
13063 11424
13064fi 11425fi
13065rm -f conftest.$ac_objext conftest.$ac_ext 11426rm -f conftest.$ac_objext conftest.$ac_ext
13066 11427
13067fi 11428fi
13068echo "$as_me:$LINENO: result: $ac_cv_have_uintxx_t" >&5 11429echo "$as_me:11429: result: $ac_cv_have_uintxx_t" >&5
13069echo "${ECHO_T}$ac_cv_have_uintxx_t" >&6 11430echo "${ECHO_T}$ac_cv_have_uintxx_t" >&6
13070 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then 11431 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
13071 cat >>confdefs.h <<\_ACEOF 11432 cat >>confdefs.h <<\EOF
13072#define HAVE_UINTXX_T 1 11433#define HAVE_UINTXX_T 1
13073_ACEOF 11434EOF
13074 11435
13075 fi 11436 fi
13076fi 11437fi
13077 11438
13078if test -z "$have_uintxx_t" ; then 11439if test -z "$have_uintxx_t" ; then
13079 echo "$as_me:$LINENO: checking for uintXX_t types in stdint.h" >&5 11440 echo "$as_me:11440: checking for uintXX_t types in stdint.h" >&5
13080echo $ECHO_N "checking for uintXX_t types in stdint.h... $ECHO_C" >&6 11441echo $ECHO_N "checking for uintXX_t types in stdint.h... $ECHO_C" >&6
13081 cat >conftest.$ac_ext <<_ACEOF 11442 cat >conftest.$ac_ext <<_ACEOF
13082#line $LINENO "configure" 11443#line 11443 "configure"
13083/* confdefs.h. */ 11444#include "confdefs.h"
13084_ACEOF
13085cat confdefs.h >>conftest.$ac_ext
13086cat >>conftest.$ac_ext <<_ACEOF
13087/* end confdefs.h. */
13088 #include <stdint.h> 11445 #include <stdint.h>
13089int 11446int
13090main () 11447main ()
@@ -13095,30 +11452,29 @@ main ()
13095} 11452}
13096_ACEOF 11453_ACEOF
13097rm -f conftest.$ac_objext 11454rm -f conftest.$ac_objext
13098if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11455if { (eval echo "$as_me:11455: \"$ac_compile\"") >&5
13099 (eval $ac_compile) 2>&5 11456 (eval $ac_compile) 2>&5
13100 ac_status=$? 11457 ac_status=$?
13101 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11458 echo "$as_me:11458: \$? = $ac_status" >&5
13102 (exit $ac_status); } && 11459 (exit $ac_status); } &&
13103 { ac_try='test -s conftest.$ac_objext' 11460 { ac_try='test -s conftest.$ac_objext'
13104 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11461 { (eval echo "$as_me:11461: \"$ac_try\"") >&5
13105 (eval $ac_try) 2>&5 11462 (eval $ac_try) 2>&5
13106 ac_status=$? 11463 ac_status=$?
13107 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11464 echo "$as_me:11464: \$? = $ac_status" >&5
13108 (exit $ac_status); }; }; then 11465 (exit $ac_status); }; }; then
13109 11466
13110 cat >>confdefs.h <<\_ACEOF 11467 cat >>confdefs.h <<\EOF
13111#define HAVE_UINTXX_T 1 11468#define HAVE_UINTXX_T 1
13112_ACEOF 11469EOF
13113 11470
13114 echo "$as_me:$LINENO: result: yes" >&5 11471 echo "$as_me:11471: result: yes" >&5
13115echo "${ECHO_T}yes" >&6 11472echo "${ECHO_T}yes" >&6
13116 11473
13117else 11474else
13118 echo "$as_me: failed program was:" >&5 11475 echo "$as_me: failed program was:" >&5
13119sed 's/^/| /' conftest.$ac_ext >&5 11476cat conftest.$ac_ext >&5
13120 11477 echo "$as_me:11477: result: no" >&5
13121 echo "$as_me:$LINENO: result: no" >&5
13122echo "${ECHO_T}no" >&6 11478echo "${ECHO_T}no" >&6
13123 11479
13124fi 11480fi
@@ -13128,15 +11484,11 @@ fi
13128if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \ 11484if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
13129 test "x$ac_cv_header_sys_bitypes_h" = "xyes") 11485 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
13130then 11486then
13131 echo "$as_me:$LINENO: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5 11487 echo "$as_me:11487: checking for intXX_t and u_intXX_t types in sys/bitypes.h" >&5
13132echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6 11488echo $ECHO_N "checking for intXX_t and u_intXX_t types in sys/bitypes.h... $ECHO_C" >&6
13133 cat >conftest.$ac_ext <<_ACEOF 11489 cat >conftest.$ac_ext <<_ACEOF
13134#line $LINENO "configure" 11490#line 11490 "configure"
13135/* confdefs.h. */ 11491#include "confdefs.h"
13136_ACEOF
13137cat confdefs.h >>conftest.$ac_ext
13138cat >>conftest.$ac_ext <<_ACEOF
13139/* end confdefs.h. */
13140 11492
13141#include <sys/bitypes.h> 11493#include <sys/bitypes.h>
13142 11494
@@ -13153,54 +11505,48 @@ main ()
13153} 11505}
13154_ACEOF 11506_ACEOF
13155rm -f conftest.$ac_objext 11507rm -f conftest.$ac_objext
13156if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11508if { (eval echo "$as_me:11508: \"$ac_compile\"") >&5
13157 (eval $ac_compile) 2>&5 11509 (eval $ac_compile) 2>&5
13158 ac_status=$? 11510 ac_status=$?
13159 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11511 echo "$as_me:11511: \$? = $ac_status" >&5
13160 (exit $ac_status); } && 11512 (exit $ac_status); } &&
13161 { ac_try='test -s conftest.$ac_objext' 11513 { ac_try='test -s conftest.$ac_objext'
13162 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11514 { (eval echo "$as_me:11514: \"$ac_try\"") >&5
13163 (eval $ac_try) 2>&5 11515 (eval $ac_try) 2>&5
13164 ac_status=$? 11516 ac_status=$?
13165 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11517 echo "$as_me:11517: \$? = $ac_status" >&5
13166 (exit $ac_status); }; }; then 11518 (exit $ac_status); }; }; then
13167 11519
13168 cat >>confdefs.h <<\_ACEOF 11520 cat >>confdefs.h <<\EOF
13169#define HAVE_U_INTXX_T 1 11521#define HAVE_U_INTXX_T 1
13170_ACEOF 11522EOF
13171 11523
13172 cat >>confdefs.h <<\_ACEOF 11524 cat >>confdefs.h <<\EOF
13173#define HAVE_INTXX_T 1 11525#define HAVE_INTXX_T 1
13174_ACEOF 11526EOF
13175 11527
13176 echo "$as_me:$LINENO: result: yes" >&5 11528 echo "$as_me:11528: result: yes" >&5
13177echo "${ECHO_T}yes" >&6 11529echo "${ECHO_T}yes" >&6
13178 11530
13179else 11531else
13180 echo "$as_me: failed program was:" >&5 11532 echo "$as_me: failed program was:" >&5
13181sed 's/^/| /' conftest.$ac_ext >&5 11533cat conftest.$ac_ext >&5
13182 11534echo "$as_me:11534: result: no" >&5
13183echo "$as_me:$LINENO: result: no" >&5
13184echo "${ECHO_T}no" >&6 11535echo "${ECHO_T}no" >&6
13185 11536
13186fi 11537fi
13187rm -f conftest.$ac_objext conftest.$ac_ext 11538rm -f conftest.$ac_objext conftest.$ac_ext
13188fi 11539fi
13189 11540
13190 11541echo "$as_me:11541: checking for u_char" >&5
13191echo "$as_me:$LINENO: checking for u_char" >&5
13192echo $ECHO_N "checking for u_char... $ECHO_C" >&6 11542echo $ECHO_N "checking for u_char... $ECHO_C" >&6
13193if test "${ac_cv_have_u_char+set}" = set; then 11543if test "${ac_cv_have_u_char+set}" = set; then
13194 echo $ECHO_N "(cached) $ECHO_C" >&6 11544 echo $ECHO_N "(cached) $ECHO_C" >&6
13195else 11545else
13196 11546
13197 cat >conftest.$ac_ext <<_ACEOF 11547 cat >conftest.$ac_ext <<_ACEOF
13198#line $LINENO "configure" 11548#line 11548 "configure"
13199/* confdefs.h. */ 11549#include "confdefs.h"
13200_ACEOF
13201cat confdefs.h >>conftest.$ac_ext
13202cat >>conftest.$ac_ext <<_ACEOF
13203/* end confdefs.h. */
13204 11550
13205#include <sys/types.h> 11551#include <sys/types.h>
13206 11552
@@ -13213,50 +11559,44 @@ main ()
13213} 11559}
13214_ACEOF 11560_ACEOF
13215rm -f conftest.$ac_objext 11561rm -f conftest.$ac_objext
13216if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11562if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5
13217 (eval $ac_compile) 2>&5 11563 (eval $ac_compile) 2>&5
13218 ac_status=$? 11564 ac_status=$?
13219 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11565 echo "$as_me:11565: \$? = $ac_status" >&5
13220 (exit $ac_status); } && 11566 (exit $ac_status); } &&
13221 { ac_try='test -s conftest.$ac_objext' 11567 { ac_try='test -s conftest.$ac_objext'
13222 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11568 { (eval echo "$as_me:11568: \"$ac_try\"") >&5
13223 (eval $ac_try) 2>&5 11569 (eval $ac_try) 2>&5
13224 ac_status=$? 11570 ac_status=$?
13225 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11571 echo "$as_me:11571: \$? = $ac_status" >&5
13226 (exit $ac_status); }; }; then 11572 (exit $ac_status); }; }; then
13227 ac_cv_have_u_char="yes" 11573 ac_cv_have_u_char="yes"
13228else 11574else
13229 echo "$as_me: failed program was:" >&5 11575 echo "$as_me: failed program was:" >&5
13230sed 's/^/| /' conftest.$ac_ext >&5 11576cat conftest.$ac_ext >&5
13231
13232 ac_cv_have_u_char="no" 11577 ac_cv_have_u_char="no"
13233 11578
13234fi 11579fi
13235rm -f conftest.$ac_objext conftest.$ac_ext 11580rm -f conftest.$ac_objext conftest.$ac_ext
13236 11581
13237fi 11582fi
13238echo "$as_me:$LINENO: result: $ac_cv_have_u_char" >&5 11583echo "$as_me:11583: result: $ac_cv_have_u_char" >&5
13239echo "${ECHO_T}$ac_cv_have_u_char" >&6 11584echo "${ECHO_T}$ac_cv_have_u_char" >&6
13240if test "x$ac_cv_have_u_char" = "xyes" ; then 11585if test "x$ac_cv_have_u_char" = "xyes" ; then
13241 cat >>confdefs.h <<\_ACEOF 11586 cat >>confdefs.h <<\EOF
13242#define HAVE_U_CHAR 1 11587#define HAVE_U_CHAR 1
13243_ACEOF 11588EOF
13244 11589
13245fi 11590fi
13246 11591
13247 11592 echo "$as_me:11592: checking for socklen_t" >&5
13248 echo "$as_me:$LINENO: checking for socklen_t" >&5
13249echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 11593echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
13250if test "${ac_cv_type_socklen_t+set}" = set; then 11594if test "${ac_cv_type_socklen_t+set}" = set; then
13251 echo $ECHO_N "(cached) $ECHO_C" >&6 11595 echo $ECHO_N "(cached) $ECHO_C" >&6
13252else 11596else
13253 cat >conftest.$ac_ext <<_ACEOF 11597 cat >conftest.$ac_ext <<_ACEOF
13254#line $LINENO "configure" 11598#line 11598 "configure"
13255/* confdefs.h. */ 11599#include "confdefs.h"
13256_ACEOF
13257cat confdefs.h >>conftest.$ac_ext
13258cat >>conftest.$ac_ext <<_ACEOF
13259/* end confdefs.h. */
13260#include <sys/types.h> 11600#include <sys/types.h>
13261#include <sys/socket.h> 11601#include <sys/socket.h>
13262 11602
@@ -13272,33 +11612,32 @@ if (sizeof (socklen_t))
13272} 11612}
13273_ACEOF 11613_ACEOF
13274rm -f conftest.$ac_objext 11614rm -f conftest.$ac_objext
13275if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11615if { (eval echo "$as_me:11615: \"$ac_compile\"") >&5
13276 (eval $ac_compile) 2>&5 11616 (eval $ac_compile) 2>&5
13277 ac_status=$? 11617 ac_status=$?
13278 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11618 echo "$as_me:11618: \$? = $ac_status" >&5
13279 (exit $ac_status); } && 11619 (exit $ac_status); } &&
13280 { ac_try='test -s conftest.$ac_objext' 11620 { ac_try='test -s conftest.$ac_objext'
13281 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11621 { (eval echo "$as_me:11621: \"$ac_try\"") >&5
13282 (eval $ac_try) 2>&5 11622 (eval $ac_try) 2>&5
13283 ac_status=$? 11623 ac_status=$?
13284 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11624 echo "$as_me:11624: \$? = $ac_status" >&5
13285 (exit $ac_status); }; }; then 11625 (exit $ac_status); }; }; then
13286 ac_cv_type_socklen_t=yes 11626 ac_cv_type_socklen_t=yes
13287else 11627else
13288 echo "$as_me: failed program was:" >&5 11628 echo "$as_me: failed program was:" >&5
13289sed 's/^/| /' conftest.$ac_ext >&5 11629cat conftest.$ac_ext >&5
13290
13291ac_cv_type_socklen_t=no 11630ac_cv_type_socklen_t=no
13292fi 11631fi
13293rm -f conftest.$ac_objext conftest.$ac_ext 11632rm -f conftest.$ac_objext conftest.$ac_ext
13294fi 11633fi
13295echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 11634echo "$as_me:11634: result: $ac_cv_type_socklen_t" >&5
13296echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 11635echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
13297if test $ac_cv_type_socklen_t = yes; then 11636if test $ac_cv_type_socklen_t = yes; then
13298 : 11637 :
13299else 11638else
13300 11639
13301 echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5 11640 echo "$as_me:11640: checking for socklen_t equivalent" >&5
13302echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6 11641echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6
13303 if test "${curl_cv_socklen_t_equiv+set}" = set; then 11642 if test "${curl_cv_socklen_t_equiv+set}" = set; then
13304 echo $ECHO_N "(cached) $ECHO_C" >&6 11643 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -13310,12 +11649,8 @@ else
13310 for arg2 in "struct sockaddr" void; do 11649 for arg2 in "struct sockaddr" void; do
13311 for t in int size_t unsigned long "unsigned long"; do 11650 for t in int size_t unsigned long "unsigned long"; do
13312 cat >conftest.$ac_ext <<_ACEOF 11651 cat >conftest.$ac_ext <<_ACEOF
13313#line $LINENO "configure" 11652#line 11652 "configure"
13314/* confdefs.h. */ 11653#include "confdefs.h"
13315_ACEOF
13316cat confdefs.h >>conftest.$ac_ext
13317cat >>conftest.$ac_ext <<_ACEOF
13318/* end confdefs.h. */
13319 11654
13320 #include <sys/types.h> 11655 #include <sys/types.h>
13321 #include <sys/socket.h> 11656 #include <sys/socket.h>
@@ -13334,16 +11669,16 @@ main ()
13334} 11669}
13335_ACEOF 11670_ACEOF
13336rm -f conftest.$ac_objext 11671rm -f conftest.$ac_objext
13337if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11672if { (eval echo "$as_me:11672: \"$ac_compile\"") >&5
13338 (eval $ac_compile) 2>&5 11673 (eval $ac_compile) 2>&5
13339 ac_status=$? 11674 ac_status=$?
13340 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11675 echo "$as_me:11675: \$? = $ac_status" >&5
13341 (exit $ac_status); } && 11676 (exit $ac_status); } &&
13342 { ac_try='test -s conftest.$ac_objext' 11677 { ac_try='test -s conftest.$ac_objext'
13343 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11678 { (eval echo "$as_me:11678: \"$ac_try\"") >&5
13344 (eval $ac_try) 2>&5 11679 (eval $ac_try) 2>&5
13345 ac_status=$? 11680 ac_status=$?
13346 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11681 echo "$as_me:11681: \$? = $ac_status" >&5
13347 (exit $ac_status); }; }; then 11682 (exit $ac_status); }; }; then
13348 11683
13349 curl_cv_socklen_t_equiv="$t" 11684 curl_cv_socklen_t_equiv="$t"
@@ -13351,44 +11686,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
13351 11686
13352else 11687else
13353 echo "$as_me: failed program was:" >&5 11688 echo "$as_me: failed program was:" >&5
13354sed 's/^/| /' conftest.$ac_ext >&5 11689cat conftest.$ac_ext >&5
13355
13356fi 11690fi
13357rm -f conftest.$ac_objext conftest.$ac_ext 11691rm -f conftest.$ac_objext conftest.$ac_ext
13358 done 11692 done
13359 done 11693 done
13360 11694
13361 if test "x$curl_cv_socklen_t_equiv" = x; then 11695 if test "x$curl_cv_socklen_t_equiv" = x; then
13362 { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5 11696 { { echo "$as_me:11696: error: Cannot find a type to use in place of socklen_t" >&5
13363echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;} 11697echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
13364 { (exit 1); exit 1; }; } 11698 { (exit 1); exit 1; }; }
13365 fi 11699 fi
13366 11700
13367fi 11701fi
13368 11702
13369 echo "$as_me:$LINENO: result: $curl_cv_socklen_t_equiv" >&5 11703 echo "$as_me:11703: result: $curl_cv_socklen_t_equiv" >&5
13370echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6 11704echo "${ECHO_T}$curl_cv_socklen_t_equiv" >&6
13371 11705
13372cat >>confdefs.h <<_ACEOF 11706cat >>confdefs.h <<EOF
13373#define socklen_t $curl_cv_socklen_t_equiv 11707#define socklen_t $curl_cv_socklen_t_equiv
13374_ACEOF 11708EOF
13375 11709
13376fi 11710fi
13377 11711
13378 11712echo "$as_me:11712: checking for sig_atomic_t" >&5
13379
13380echo "$as_me:$LINENO: checking for sig_atomic_t" >&5
13381echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6 11713echo $ECHO_N "checking for sig_atomic_t... $ECHO_C" >&6
13382if test "${ac_cv_type_sig_atomic_t+set}" = set; then 11714if test "${ac_cv_type_sig_atomic_t+set}" = set; then
13383 echo $ECHO_N "(cached) $ECHO_C" >&6 11715 echo $ECHO_N "(cached) $ECHO_C" >&6
13384else 11716else
13385 cat >conftest.$ac_ext <<_ACEOF 11717 cat >conftest.$ac_ext <<_ACEOF
13386#line $LINENO "configure" 11718#line 11718 "configure"
13387/* confdefs.h. */ 11719#include "confdefs.h"
13388_ACEOF
13389cat confdefs.h >>conftest.$ac_ext
13390cat >>conftest.$ac_ext <<_ACEOF
13391/* end confdefs.h. */
13392#include <signal.h> 11720#include <signal.h>
13393 11721
13394int 11722int
@@ -13403,51 +11731,44 @@ if (sizeof (sig_atomic_t))
13403} 11731}
13404_ACEOF 11732_ACEOF
13405rm -f conftest.$ac_objext 11733rm -f conftest.$ac_objext
13406if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11734if { (eval echo "$as_me:11734: \"$ac_compile\"") >&5
13407 (eval $ac_compile) 2>&5 11735 (eval $ac_compile) 2>&5
13408 ac_status=$? 11736 ac_status=$?
13409 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11737 echo "$as_me:11737: \$? = $ac_status" >&5
13410 (exit $ac_status); } && 11738 (exit $ac_status); } &&
13411 { ac_try='test -s conftest.$ac_objext' 11739 { ac_try='test -s conftest.$ac_objext'
13412 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11740 { (eval echo "$as_me:11740: \"$ac_try\"") >&5
13413 (eval $ac_try) 2>&5 11741 (eval $ac_try) 2>&5
13414 ac_status=$? 11742 ac_status=$?
13415 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11743 echo "$as_me:11743: \$? = $ac_status" >&5
13416 (exit $ac_status); }; }; then 11744 (exit $ac_status); }; }; then
13417 ac_cv_type_sig_atomic_t=yes 11745 ac_cv_type_sig_atomic_t=yes
13418else 11746else
13419 echo "$as_me: failed program was:" >&5 11747 echo "$as_me: failed program was:" >&5
13420sed 's/^/| /' conftest.$ac_ext >&5 11748cat conftest.$ac_ext >&5
13421
13422ac_cv_type_sig_atomic_t=no 11749ac_cv_type_sig_atomic_t=no
13423fi 11750fi
13424rm -f conftest.$ac_objext conftest.$ac_ext 11751rm -f conftest.$ac_objext conftest.$ac_ext
13425fi 11752fi
13426echo "$as_me:$LINENO: result: $ac_cv_type_sig_atomic_t" >&5 11753echo "$as_me:11753: result: $ac_cv_type_sig_atomic_t" >&5
13427echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6 11754echo "${ECHO_T}$ac_cv_type_sig_atomic_t" >&6
13428if test $ac_cv_type_sig_atomic_t = yes; then 11755if test $ac_cv_type_sig_atomic_t = yes; then
13429 11756
13430cat >>confdefs.h <<_ACEOF 11757cat >>confdefs.h <<EOF
13431#define HAVE_SIG_ATOMIC_T 1 11758#define HAVE_SIG_ATOMIC_T 1
13432_ACEOF 11759EOF
13433
13434 11760
13435fi 11761fi
13436 11762
13437 11763echo "$as_me:11763: checking for size_t" >&5
13438echo "$as_me:$LINENO: checking for size_t" >&5
13439echo $ECHO_N "checking for size_t... $ECHO_C" >&6 11764echo $ECHO_N "checking for size_t... $ECHO_C" >&6
13440if test "${ac_cv_have_size_t+set}" = set; then 11765if test "${ac_cv_have_size_t+set}" = set; then
13441 echo $ECHO_N "(cached) $ECHO_C" >&6 11766 echo $ECHO_N "(cached) $ECHO_C" >&6
13442else 11767else
13443 11768
13444 cat >conftest.$ac_ext <<_ACEOF 11769 cat >conftest.$ac_ext <<_ACEOF
13445#line $LINENO "configure" 11770#line 11770 "configure"
13446/* confdefs.h. */ 11771#include "confdefs.h"
13447_ACEOF
13448cat confdefs.h >>conftest.$ac_ext
13449cat >>conftest.$ac_ext <<_ACEOF
13450/* end confdefs.h. */
13451 11772
13452#include <sys/types.h> 11773#include <sys/types.h>
13453 11774
@@ -13460,50 +11781,45 @@ main ()
13460} 11781}
13461_ACEOF 11782_ACEOF
13462rm -f conftest.$ac_objext 11783rm -f conftest.$ac_objext
13463if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11784if { (eval echo "$as_me:11784: \"$ac_compile\"") >&5
13464 (eval $ac_compile) 2>&5 11785 (eval $ac_compile) 2>&5
13465 ac_status=$? 11786 ac_status=$?
13466 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11787 echo "$as_me:11787: \$? = $ac_status" >&5
13467 (exit $ac_status); } && 11788 (exit $ac_status); } &&
13468 { ac_try='test -s conftest.$ac_objext' 11789 { ac_try='test -s conftest.$ac_objext'
13469 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11790 { (eval echo "$as_me:11790: \"$ac_try\"") >&5
13470 (eval $ac_try) 2>&5 11791 (eval $ac_try) 2>&5
13471 ac_status=$? 11792 ac_status=$?
13472 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11793 echo "$as_me:11793: \$? = $ac_status" >&5
13473 (exit $ac_status); }; }; then 11794 (exit $ac_status); }; }; then
13474 ac_cv_have_size_t="yes" 11795 ac_cv_have_size_t="yes"
13475else 11796else
13476 echo "$as_me: failed program was:" >&5 11797 echo "$as_me: failed program was:" >&5
13477sed 's/^/| /' conftest.$ac_ext >&5 11798cat conftest.$ac_ext >&5
13478
13479 ac_cv_have_size_t="no" 11799 ac_cv_have_size_t="no"
13480 11800
13481fi 11801fi
13482rm -f conftest.$ac_objext conftest.$ac_ext 11802rm -f conftest.$ac_objext conftest.$ac_ext
13483 11803
13484fi 11804fi
13485echo "$as_me:$LINENO: result: $ac_cv_have_size_t" >&5 11805echo "$as_me:11805: result: $ac_cv_have_size_t" >&5
13486echo "${ECHO_T}$ac_cv_have_size_t" >&6 11806echo "${ECHO_T}$ac_cv_have_size_t" >&6
13487if test "x$ac_cv_have_size_t" = "xyes" ; then 11807if test "x$ac_cv_have_size_t" = "xyes" ; then
13488 cat >>confdefs.h <<\_ACEOF 11808 cat >>confdefs.h <<\EOF
13489#define HAVE_SIZE_T 1 11809#define HAVE_SIZE_T 1
13490_ACEOF 11810EOF
13491 11811
13492fi 11812fi
13493 11813
13494echo "$as_me:$LINENO: checking for ssize_t" >&5 11814echo "$as_me:11814: checking for ssize_t" >&5
13495echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6 11815echo $ECHO_N "checking for ssize_t... $ECHO_C" >&6
13496if test "${ac_cv_have_ssize_t+set}" = set; then 11816if test "${ac_cv_have_ssize_t+set}" = set; then
13497 echo $ECHO_N "(cached) $ECHO_C" >&6 11817 echo $ECHO_N "(cached) $ECHO_C" >&6
13498else 11818else
13499 11819
13500 cat >conftest.$ac_ext <<_ACEOF 11820 cat >conftest.$ac_ext <<_ACEOF
13501#line $LINENO "configure" 11821#line 11821 "configure"
13502/* confdefs.h. */ 11822#include "confdefs.h"
13503_ACEOF
13504cat confdefs.h >>conftest.$ac_ext
13505cat >>conftest.$ac_ext <<_ACEOF
13506/* end confdefs.h. */
13507 11823
13508#include <sys/types.h> 11824#include <sys/types.h>
13509 11825
@@ -13516,50 +11832,45 @@ main ()
13516} 11832}
13517_ACEOF 11833_ACEOF
13518rm -f conftest.$ac_objext 11834rm -f conftest.$ac_objext
13519if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11835if { (eval echo "$as_me:11835: \"$ac_compile\"") >&5
13520 (eval $ac_compile) 2>&5 11836 (eval $ac_compile) 2>&5
13521 ac_status=$? 11837 ac_status=$?
13522 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11838 echo "$as_me:11838: \$? = $ac_status" >&5
13523 (exit $ac_status); } && 11839 (exit $ac_status); } &&
13524 { ac_try='test -s conftest.$ac_objext' 11840 { ac_try='test -s conftest.$ac_objext'
13525 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11841 { (eval echo "$as_me:11841: \"$ac_try\"") >&5
13526 (eval $ac_try) 2>&5 11842 (eval $ac_try) 2>&5
13527 ac_status=$? 11843 ac_status=$?
13528 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11844 echo "$as_me:11844: \$? = $ac_status" >&5
13529 (exit $ac_status); }; }; then 11845 (exit $ac_status); }; }; then
13530 ac_cv_have_ssize_t="yes" 11846 ac_cv_have_ssize_t="yes"
13531else 11847else
13532 echo "$as_me: failed program was:" >&5 11848 echo "$as_me: failed program was:" >&5
13533sed 's/^/| /' conftest.$ac_ext >&5 11849cat conftest.$ac_ext >&5
13534
13535 ac_cv_have_ssize_t="no" 11850 ac_cv_have_ssize_t="no"
13536 11851
13537fi 11852fi
13538rm -f conftest.$ac_objext conftest.$ac_ext 11853rm -f conftest.$ac_objext conftest.$ac_ext
13539 11854
13540fi 11855fi
13541echo "$as_me:$LINENO: result: $ac_cv_have_ssize_t" >&5 11856echo "$as_me:11856: result: $ac_cv_have_ssize_t" >&5
13542echo "${ECHO_T}$ac_cv_have_ssize_t" >&6 11857echo "${ECHO_T}$ac_cv_have_ssize_t" >&6
13543if test "x$ac_cv_have_ssize_t" = "xyes" ; then 11858if test "x$ac_cv_have_ssize_t" = "xyes" ; then
13544 cat >>confdefs.h <<\_ACEOF 11859 cat >>confdefs.h <<\EOF
13545#define HAVE_SSIZE_T 1 11860#define HAVE_SSIZE_T 1
13546_ACEOF 11861EOF
13547 11862
13548fi 11863fi
13549 11864
13550echo "$as_me:$LINENO: checking for clock_t" >&5 11865echo "$as_me:11865: checking for clock_t" >&5
13551echo $ECHO_N "checking for clock_t... $ECHO_C" >&6 11866echo $ECHO_N "checking for clock_t... $ECHO_C" >&6
13552if test "${ac_cv_have_clock_t+set}" = set; then 11867if test "${ac_cv_have_clock_t+set}" = set; then
13553 echo $ECHO_N "(cached) $ECHO_C" >&6 11868 echo $ECHO_N "(cached) $ECHO_C" >&6
13554else 11869else
13555 11870
13556 cat >conftest.$ac_ext <<_ACEOF 11871 cat >conftest.$ac_ext <<_ACEOF
13557#line $LINENO "configure" 11872#line 11872 "configure"
13558/* confdefs.h. */ 11873#include "confdefs.h"
13559_ACEOF
13560cat confdefs.h >>conftest.$ac_ext
13561cat >>conftest.$ac_ext <<_ACEOF
13562/* end confdefs.h. */
13563 11874
13564#include <time.h> 11875#include <time.h>
13565 11876
@@ -13572,50 +11883,45 @@ main ()
13572} 11883}
13573_ACEOF 11884_ACEOF
13574rm -f conftest.$ac_objext 11885rm -f conftest.$ac_objext
13575if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11886if { (eval echo "$as_me:11886: \"$ac_compile\"") >&5
13576 (eval $ac_compile) 2>&5 11887 (eval $ac_compile) 2>&5
13577 ac_status=$? 11888 ac_status=$?
13578 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11889 echo "$as_me:11889: \$? = $ac_status" >&5
13579 (exit $ac_status); } && 11890 (exit $ac_status); } &&
13580 { ac_try='test -s conftest.$ac_objext' 11891 { ac_try='test -s conftest.$ac_objext'
13581 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11892 { (eval echo "$as_me:11892: \"$ac_try\"") >&5
13582 (eval $ac_try) 2>&5 11893 (eval $ac_try) 2>&5
13583 ac_status=$? 11894 ac_status=$?
13584 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11895 echo "$as_me:11895: \$? = $ac_status" >&5
13585 (exit $ac_status); }; }; then 11896 (exit $ac_status); }; }; then
13586 ac_cv_have_clock_t="yes" 11897 ac_cv_have_clock_t="yes"
13587else 11898else
13588 echo "$as_me: failed program was:" >&5 11899 echo "$as_me: failed program was:" >&5
13589sed 's/^/| /' conftest.$ac_ext >&5 11900cat conftest.$ac_ext >&5
13590
13591 ac_cv_have_clock_t="no" 11901 ac_cv_have_clock_t="no"
13592 11902
13593fi 11903fi
13594rm -f conftest.$ac_objext conftest.$ac_ext 11904rm -f conftest.$ac_objext conftest.$ac_ext
13595 11905
13596fi 11906fi
13597echo "$as_me:$LINENO: result: $ac_cv_have_clock_t" >&5 11907echo "$as_me:11907: result: $ac_cv_have_clock_t" >&5
13598echo "${ECHO_T}$ac_cv_have_clock_t" >&6 11908echo "${ECHO_T}$ac_cv_have_clock_t" >&6
13599if test "x$ac_cv_have_clock_t" = "xyes" ; then 11909if test "x$ac_cv_have_clock_t" = "xyes" ; then
13600 cat >>confdefs.h <<\_ACEOF 11910 cat >>confdefs.h <<\EOF
13601#define HAVE_CLOCK_T 1 11911#define HAVE_CLOCK_T 1
13602_ACEOF 11912EOF
13603 11913
13604fi 11914fi
13605 11915
13606echo "$as_me:$LINENO: checking for sa_family_t" >&5 11916echo "$as_me:11916: checking for sa_family_t" >&5
13607echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6 11917echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6
13608if test "${ac_cv_have_sa_family_t+set}" = set; then 11918if test "${ac_cv_have_sa_family_t+set}" = set; then
13609 echo $ECHO_N "(cached) $ECHO_C" >&6 11919 echo $ECHO_N "(cached) $ECHO_C" >&6
13610else 11920else
13611 11921
13612 cat >conftest.$ac_ext <<_ACEOF 11922 cat >conftest.$ac_ext <<_ACEOF
13613#line $LINENO "configure" 11923#line 11923 "configure"
13614/* confdefs.h. */ 11924#include "confdefs.h"
13615_ACEOF
13616cat confdefs.h >>conftest.$ac_ext
13617cat >>conftest.$ac_ext <<_ACEOF
13618/* end confdefs.h. */
13619 11925
13620#include <sys/types.h> 11926#include <sys/types.h>
13621#include <sys/socket.h> 11927#include <sys/socket.h>
@@ -13629,29 +11935,24 @@ main ()
13629} 11935}
13630_ACEOF 11936_ACEOF
13631rm -f conftest.$ac_objext 11937rm -f conftest.$ac_objext
13632if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11938if { (eval echo "$as_me:11938: \"$ac_compile\"") >&5
13633 (eval $ac_compile) 2>&5 11939 (eval $ac_compile) 2>&5
13634 ac_status=$? 11940 ac_status=$?
13635 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11941 echo "$as_me:11941: \$? = $ac_status" >&5
13636 (exit $ac_status); } && 11942 (exit $ac_status); } &&
13637 { ac_try='test -s conftest.$ac_objext' 11943 { ac_try='test -s conftest.$ac_objext'
13638 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11944 { (eval echo "$as_me:11944: \"$ac_try\"") >&5
13639 (eval $ac_try) 2>&5 11945 (eval $ac_try) 2>&5
13640 ac_status=$? 11946 ac_status=$?
13641 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11947 echo "$as_me:11947: \$? = $ac_status" >&5
13642 (exit $ac_status); }; }; then 11948 (exit $ac_status); }; }; then
13643 ac_cv_have_sa_family_t="yes" 11949 ac_cv_have_sa_family_t="yes"
13644else 11950else
13645 echo "$as_me: failed program was:" >&5 11951 echo "$as_me: failed program was:" >&5
13646sed 's/^/| /' conftest.$ac_ext >&5 11952cat conftest.$ac_ext >&5
13647
13648 cat >conftest.$ac_ext <<_ACEOF 11953 cat >conftest.$ac_ext <<_ACEOF
13649#line $LINENO "configure" 11954#line 11954 "configure"
13650/* confdefs.h. */ 11955#include "confdefs.h"
13651_ACEOF
13652cat confdefs.h >>conftest.$ac_ext
13653cat >>conftest.$ac_ext <<_ACEOF
13654/* end confdefs.h. */
13655 11956
13656#include <sys/types.h> 11957#include <sys/types.h>
13657#include <sys/socket.h> 11958#include <sys/socket.h>
@@ -13666,22 +11967,21 @@ main ()
13666} 11967}
13667_ACEOF 11968_ACEOF
13668rm -f conftest.$ac_objext 11969rm -f conftest.$ac_objext
13669if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 11970if { (eval echo "$as_me:11970: \"$ac_compile\"") >&5
13670 (eval $ac_compile) 2>&5 11971 (eval $ac_compile) 2>&5
13671 ac_status=$? 11972 ac_status=$?
13672 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11973 echo "$as_me:11973: \$? = $ac_status" >&5
13673 (exit $ac_status); } && 11974 (exit $ac_status); } &&
13674 { ac_try='test -s conftest.$ac_objext' 11975 { ac_try='test -s conftest.$ac_objext'
13675 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 11976 { (eval echo "$as_me:11976: \"$ac_try\"") >&5
13676 (eval $ac_try) 2>&5 11977 (eval $ac_try) 2>&5
13677 ac_status=$? 11978 ac_status=$?
13678 echo "$as_me:$LINENO: \$? = $ac_status" >&5 11979 echo "$as_me:11979: \$? = $ac_status" >&5
13679 (exit $ac_status); }; }; then 11980 (exit $ac_status); }; }; then
13680 ac_cv_have_sa_family_t="yes" 11981 ac_cv_have_sa_family_t="yes"
13681else 11982else
13682 echo "$as_me: failed program was:" >&5 11983 echo "$as_me: failed program was:" >&5
13683sed 's/^/| /' conftest.$ac_ext >&5 11984cat conftest.$ac_ext >&5
13684
13685 ac_cv_have_sa_family_t="no" 11985 ac_cv_have_sa_family_t="no"
13686 11986
13687fi 11987fi
@@ -13691,28 +11991,24 @@ fi
13691rm -f conftest.$ac_objext conftest.$ac_ext 11991rm -f conftest.$ac_objext conftest.$ac_ext
13692 11992
13693fi 11993fi
13694echo "$as_me:$LINENO: result: $ac_cv_have_sa_family_t" >&5 11994echo "$as_me:11994: result: $ac_cv_have_sa_family_t" >&5
13695echo "${ECHO_T}$ac_cv_have_sa_family_t" >&6 11995echo "${ECHO_T}$ac_cv_have_sa_family_t" >&6
13696if test "x$ac_cv_have_sa_family_t" = "xyes" ; then 11996if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
13697 cat >>confdefs.h <<\_ACEOF 11997 cat >>confdefs.h <<\EOF
13698#define HAVE_SA_FAMILY_T 1 11998#define HAVE_SA_FAMILY_T 1
13699_ACEOF 11999EOF
13700 12000
13701fi 12001fi
13702 12002
13703echo "$as_me:$LINENO: checking for pid_t" >&5 12003echo "$as_me:12003: checking for pid_t" >&5
13704echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 12004echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
13705if test "${ac_cv_have_pid_t+set}" = set; then 12005if test "${ac_cv_have_pid_t+set}" = set; then
13706 echo $ECHO_N "(cached) $ECHO_C" >&6 12006 echo $ECHO_N "(cached) $ECHO_C" >&6
13707else 12007else
13708 12008
13709 cat >conftest.$ac_ext <<_ACEOF 12009 cat >conftest.$ac_ext <<_ACEOF
13710#line $LINENO "configure" 12010#line 12010 "configure"
13711/* confdefs.h. */ 12011#include "confdefs.h"
13712_ACEOF
13713cat confdefs.h >>conftest.$ac_ext
13714cat >>conftest.$ac_ext <<_ACEOF
13715/* end confdefs.h. */
13716 12012
13717#include <sys/types.h> 12013#include <sys/types.h>
13718 12014
@@ -13725,50 +12021,45 @@ main ()
13725} 12021}
13726_ACEOF 12022_ACEOF
13727rm -f conftest.$ac_objext 12023rm -f conftest.$ac_objext
13728if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12024if { (eval echo "$as_me:12024: \"$ac_compile\"") >&5
13729 (eval $ac_compile) 2>&5 12025 (eval $ac_compile) 2>&5
13730 ac_status=$? 12026 ac_status=$?
13731 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12027 echo "$as_me:12027: \$? = $ac_status" >&5
13732 (exit $ac_status); } && 12028 (exit $ac_status); } &&
13733 { ac_try='test -s conftest.$ac_objext' 12029 { ac_try='test -s conftest.$ac_objext'
13734 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12030 { (eval echo "$as_me:12030: \"$ac_try\"") >&5
13735 (eval $ac_try) 2>&5 12031 (eval $ac_try) 2>&5
13736 ac_status=$? 12032 ac_status=$?
13737 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12033 echo "$as_me:12033: \$? = $ac_status" >&5
13738 (exit $ac_status); }; }; then 12034 (exit $ac_status); }; }; then
13739 ac_cv_have_pid_t="yes" 12035 ac_cv_have_pid_t="yes"
13740else 12036else
13741 echo "$as_me: failed program was:" >&5 12037 echo "$as_me: failed program was:" >&5
13742sed 's/^/| /' conftest.$ac_ext >&5 12038cat conftest.$ac_ext >&5
13743
13744 ac_cv_have_pid_t="no" 12039 ac_cv_have_pid_t="no"
13745 12040
13746fi 12041fi
13747rm -f conftest.$ac_objext conftest.$ac_ext 12042rm -f conftest.$ac_objext conftest.$ac_ext
13748 12043
13749fi 12044fi
13750echo "$as_me:$LINENO: result: $ac_cv_have_pid_t" >&5 12045echo "$as_me:12045: result: $ac_cv_have_pid_t" >&5
13751echo "${ECHO_T}$ac_cv_have_pid_t" >&6 12046echo "${ECHO_T}$ac_cv_have_pid_t" >&6
13752if test "x$ac_cv_have_pid_t" = "xyes" ; then 12047if test "x$ac_cv_have_pid_t" = "xyes" ; then
13753 cat >>confdefs.h <<\_ACEOF 12048 cat >>confdefs.h <<\EOF
13754#define HAVE_PID_T 1 12049#define HAVE_PID_T 1
13755_ACEOF 12050EOF
13756 12051
13757fi 12052fi
13758 12053
13759echo "$as_me:$LINENO: checking for mode_t" >&5 12054echo "$as_me:12054: checking for mode_t" >&5
13760echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 12055echo $ECHO_N "checking for mode_t... $ECHO_C" >&6
13761if test "${ac_cv_have_mode_t+set}" = set; then 12056if test "${ac_cv_have_mode_t+set}" = set; then
13762 echo $ECHO_N "(cached) $ECHO_C" >&6 12057 echo $ECHO_N "(cached) $ECHO_C" >&6
13763else 12058else
13764 12059
13765 cat >conftest.$ac_ext <<_ACEOF 12060 cat >conftest.$ac_ext <<_ACEOF
13766#line $LINENO "configure" 12061#line 12061 "configure"
13767/* confdefs.h. */ 12062#include "confdefs.h"
13768_ACEOF
13769cat confdefs.h >>conftest.$ac_ext
13770cat >>conftest.$ac_ext <<_ACEOF
13771/* end confdefs.h. */
13772 12063
13773#include <sys/types.h> 12064#include <sys/types.h>
13774 12065
@@ -13781,51 +12072,45 @@ main ()
13781} 12072}
13782_ACEOF 12073_ACEOF
13783rm -f conftest.$ac_objext 12074rm -f conftest.$ac_objext
13784if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12075if { (eval echo "$as_me:12075: \"$ac_compile\"") >&5
13785 (eval $ac_compile) 2>&5 12076 (eval $ac_compile) 2>&5
13786 ac_status=$? 12077 ac_status=$?
13787 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12078 echo "$as_me:12078: \$? = $ac_status" >&5
13788 (exit $ac_status); } && 12079 (exit $ac_status); } &&
13789 { ac_try='test -s conftest.$ac_objext' 12080 { ac_try='test -s conftest.$ac_objext'
13790 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12081 { (eval echo "$as_me:12081: \"$ac_try\"") >&5
13791 (eval $ac_try) 2>&5 12082 (eval $ac_try) 2>&5
13792 ac_status=$? 12083 ac_status=$?
13793 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12084 echo "$as_me:12084: \$? = $ac_status" >&5
13794 (exit $ac_status); }; }; then 12085 (exit $ac_status); }; }; then
13795 ac_cv_have_mode_t="yes" 12086 ac_cv_have_mode_t="yes"
13796else 12087else
13797 echo "$as_me: failed program was:" >&5 12088 echo "$as_me: failed program was:" >&5
13798sed 's/^/| /' conftest.$ac_ext >&5 12089cat conftest.$ac_ext >&5
13799
13800 ac_cv_have_mode_t="no" 12090 ac_cv_have_mode_t="no"
13801 12091
13802fi 12092fi
13803rm -f conftest.$ac_objext conftest.$ac_ext 12093rm -f conftest.$ac_objext conftest.$ac_ext
13804 12094
13805fi 12095fi
13806echo "$as_me:$LINENO: result: $ac_cv_have_mode_t" >&5 12096echo "$as_me:12096: result: $ac_cv_have_mode_t" >&5
13807echo "${ECHO_T}$ac_cv_have_mode_t" >&6 12097echo "${ECHO_T}$ac_cv_have_mode_t" >&6
13808if test "x$ac_cv_have_mode_t" = "xyes" ; then 12098if test "x$ac_cv_have_mode_t" = "xyes" ; then
13809 cat >>confdefs.h <<\_ACEOF 12099 cat >>confdefs.h <<\EOF
13810#define HAVE_MODE_T 1 12100#define HAVE_MODE_T 1
13811_ACEOF 12101EOF
13812 12102
13813fi 12103fi
13814 12104
13815 12105echo "$as_me:12105: checking for struct sockaddr_storage" >&5
13816echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5
13817echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6 12106echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6
13818if test "${ac_cv_have_struct_sockaddr_storage+set}" = set; then 12107if test "${ac_cv_have_struct_sockaddr_storage+set}" = set; then
13819 echo $ECHO_N "(cached) $ECHO_C" >&6 12108 echo $ECHO_N "(cached) $ECHO_C" >&6
13820else 12109else
13821 12110
13822 cat >conftest.$ac_ext <<_ACEOF 12111 cat >conftest.$ac_ext <<_ACEOF
13823#line $LINENO "configure" 12112#line 12112 "configure"
13824/* confdefs.h. */ 12113#include "confdefs.h"
13825_ACEOF
13826cat confdefs.h >>conftest.$ac_ext
13827cat >>conftest.$ac_ext <<_ACEOF
13828/* end confdefs.h. */
13829 12114
13830#include <sys/types.h> 12115#include <sys/types.h>
13831#include <sys/socket.h> 12116#include <sys/socket.h>
@@ -13839,50 +12124,45 @@ main ()
13839} 12124}
13840_ACEOF 12125_ACEOF
13841rm -f conftest.$ac_objext 12126rm -f conftest.$ac_objext
13842if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12127if { (eval echo "$as_me:12127: \"$ac_compile\"") >&5
13843 (eval $ac_compile) 2>&5 12128 (eval $ac_compile) 2>&5
13844 ac_status=$? 12129 ac_status=$?
13845 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12130 echo "$as_me:12130: \$? = $ac_status" >&5
13846 (exit $ac_status); } && 12131 (exit $ac_status); } &&
13847 { ac_try='test -s conftest.$ac_objext' 12132 { ac_try='test -s conftest.$ac_objext'
13848 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12133 { (eval echo "$as_me:12133: \"$ac_try\"") >&5
13849 (eval $ac_try) 2>&5 12134 (eval $ac_try) 2>&5
13850 ac_status=$? 12135 ac_status=$?
13851 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12136 echo "$as_me:12136: \$? = $ac_status" >&5
13852 (exit $ac_status); }; }; then 12137 (exit $ac_status); }; }; then
13853 ac_cv_have_struct_sockaddr_storage="yes" 12138 ac_cv_have_struct_sockaddr_storage="yes"
13854else 12139else
13855 echo "$as_me: failed program was:" >&5 12140 echo "$as_me: failed program was:" >&5
13856sed 's/^/| /' conftest.$ac_ext >&5 12141cat conftest.$ac_ext >&5
13857
13858 ac_cv_have_struct_sockaddr_storage="no" 12142 ac_cv_have_struct_sockaddr_storage="no"
13859 12143
13860fi 12144fi
13861rm -f conftest.$ac_objext conftest.$ac_ext 12145rm -f conftest.$ac_objext conftest.$ac_ext
13862 12146
13863fi 12147fi
13864echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_storage" >&5 12148echo "$as_me:12148: result: $ac_cv_have_struct_sockaddr_storage" >&5
13865echo "${ECHO_T}$ac_cv_have_struct_sockaddr_storage" >&6 12149echo "${ECHO_T}$ac_cv_have_struct_sockaddr_storage" >&6
13866if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then 12150if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
13867 cat >>confdefs.h <<\_ACEOF 12151 cat >>confdefs.h <<\EOF
13868#define HAVE_STRUCT_SOCKADDR_STORAGE 1 12152#define HAVE_STRUCT_SOCKADDR_STORAGE 1
13869_ACEOF 12153EOF
13870 12154
13871fi 12155fi
13872 12156
13873echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 12157echo "$as_me:12157: checking for struct sockaddr_in6" >&5
13874echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6 12158echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6
13875if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then 12159if test "${ac_cv_have_struct_sockaddr_in6+set}" = set; then
13876 echo $ECHO_N "(cached) $ECHO_C" >&6 12160 echo $ECHO_N "(cached) $ECHO_C" >&6
13877else 12161else
13878 12162
13879 cat >conftest.$ac_ext <<_ACEOF 12163 cat >conftest.$ac_ext <<_ACEOF
13880#line $LINENO "configure" 12164#line 12164 "configure"
13881/* confdefs.h. */ 12165#include "confdefs.h"
13882_ACEOF
13883cat confdefs.h >>conftest.$ac_ext
13884cat >>conftest.$ac_ext <<_ACEOF
13885/* end confdefs.h. */
13886 12166
13887#include <sys/types.h> 12167#include <sys/types.h>
13888#include <netinet/in.h> 12168#include <netinet/in.h>
@@ -13896,50 +12176,45 @@ main ()
13896} 12176}
13897_ACEOF 12177_ACEOF
13898rm -f conftest.$ac_objext 12178rm -f conftest.$ac_objext
13899if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12179if { (eval echo "$as_me:12179: \"$ac_compile\"") >&5
13900 (eval $ac_compile) 2>&5 12180 (eval $ac_compile) 2>&5
13901 ac_status=$? 12181 ac_status=$?
13902 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12182 echo "$as_me:12182: \$? = $ac_status" >&5
13903 (exit $ac_status); } && 12183 (exit $ac_status); } &&
13904 { ac_try='test -s conftest.$ac_objext' 12184 { ac_try='test -s conftest.$ac_objext'
13905 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12185 { (eval echo "$as_me:12185: \"$ac_try\"") >&5
13906 (eval $ac_try) 2>&5 12186 (eval $ac_try) 2>&5
13907 ac_status=$? 12187 ac_status=$?
13908 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12188 echo "$as_me:12188: \$? = $ac_status" >&5
13909 (exit $ac_status); }; }; then 12189 (exit $ac_status); }; }; then
13910 ac_cv_have_struct_sockaddr_in6="yes" 12190 ac_cv_have_struct_sockaddr_in6="yes"
13911else 12191else
13912 echo "$as_me: failed program was:" >&5 12192 echo "$as_me: failed program was:" >&5
13913sed 's/^/| /' conftest.$ac_ext >&5 12193cat conftest.$ac_ext >&5
13914
13915 ac_cv_have_struct_sockaddr_in6="no" 12194 ac_cv_have_struct_sockaddr_in6="no"
13916 12195
13917fi 12196fi
13918rm -f conftest.$ac_objext conftest.$ac_ext 12197rm -f conftest.$ac_objext conftest.$ac_ext
13919 12198
13920fi 12199fi
13921echo "$as_me:$LINENO: result: $ac_cv_have_struct_sockaddr_in6" >&5 12200echo "$as_me:12200: result: $ac_cv_have_struct_sockaddr_in6" >&5
13922echo "${ECHO_T}$ac_cv_have_struct_sockaddr_in6" >&6 12201echo "${ECHO_T}$ac_cv_have_struct_sockaddr_in6" >&6
13923if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then 12202if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
13924 cat >>confdefs.h <<\_ACEOF 12203 cat >>confdefs.h <<\EOF
13925#define HAVE_STRUCT_SOCKADDR_IN6 1 12204#define HAVE_STRUCT_SOCKADDR_IN6 1
13926_ACEOF 12205EOF
13927 12206
13928fi 12207fi
13929 12208
13930echo "$as_me:$LINENO: checking for struct in6_addr" >&5 12209echo "$as_me:12209: checking for struct in6_addr" >&5
13931echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6 12210echo $ECHO_N "checking for struct in6_addr... $ECHO_C" >&6
13932if test "${ac_cv_have_struct_in6_addr+set}" = set; then 12211if test "${ac_cv_have_struct_in6_addr+set}" = set; then
13933 echo $ECHO_N "(cached) $ECHO_C" >&6 12212 echo $ECHO_N "(cached) $ECHO_C" >&6
13934else 12213else
13935 12214
13936 cat >conftest.$ac_ext <<_ACEOF 12215 cat >conftest.$ac_ext <<_ACEOF
13937#line $LINENO "configure" 12216#line 12216 "configure"
13938/* confdefs.h. */ 12217#include "confdefs.h"
13939_ACEOF
13940cat confdefs.h >>conftest.$ac_ext
13941cat >>conftest.$ac_ext <<_ACEOF
13942/* end confdefs.h. */
13943 12218
13944#include <sys/types.h> 12219#include <sys/types.h>
13945#include <netinet/in.h> 12220#include <netinet/in.h>
@@ -13953,50 +12228,45 @@ main ()
13953} 12228}
13954_ACEOF 12229_ACEOF
13955rm -f conftest.$ac_objext 12230rm -f conftest.$ac_objext
13956if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12231if { (eval echo "$as_me:12231: \"$ac_compile\"") >&5
13957 (eval $ac_compile) 2>&5 12232 (eval $ac_compile) 2>&5
13958 ac_status=$? 12233 ac_status=$?
13959 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12234 echo "$as_me:12234: \$? = $ac_status" >&5
13960 (exit $ac_status); } && 12235 (exit $ac_status); } &&
13961 { ac_try='test -s conftest.$ac_objext' 12236 { ac_try='test -s conftest.$ac_objext'
13962 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12237 { (eval echo "$as_me:12237: \"$ac_try\"") >&5
13963 (eval $ac_try) 2>&5 12238 (eval $ac_try) 2>&5
13964 ac_status=$? 12239 ac_status=$?
13965 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12240 echo "$as_me:12240: \$? = $ac_status" >&5
13966 (exit $ac_status); }; }; then 12241 (exit $ac_status); }; }; then
13967 ac_cv_have_struct_in6_addr="yes" 12242 ac_cv_have_struct_in6_addr="yes"
13968else 12243else
13969 echo "$as_me: failed program was:" >&5 12244 echo "$as_me: failed program was:" >&5
13970sed 's/^/| /' conftest.$ac_ext >&5 12245cat conftest.$ac_ext >&5
13971
13972 ac_cv_have_struct_in6_addr="no" 12246 ac_cv_have_struct_in6_addr="no"
13973 12247
13974fi 12248fi
13975rm -f conftest.$ac_objext conftest.$ac_ext 12249rm -f conftest.$ac_objext conftest.$ac_ext
13976 12250
13977fi 12251fi
13978echo "$as_me:$LINENO: result: $ac_cv_have_struct_in6_addr" >&5 12252echo "$as_me:12252: result: $ac_cv_have_struct_in6_addr" >&5
13979echo "${ECHO_T}$ac_cv_have_struct_in6_addr" >&6 12253echo "${ECHO_T}$ac_cv_have_struct_in6_addr" >&6
13980if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then 12254if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
13981 cat >>confdefs.h <<\_ACEOF 12255 cat >>confdefs.h <<\EOF
13982#define HAVE_STRUCT_IN6_ADDR 1 12256#define HAVE_STRUCT_IN6_ADDR 1
13983_ACEOF 12257EOF
13984 12258
13985fi 12259fi
13986 12260
13987echo "$as_me:$LINENO: checking for struct addrinfo" >&5 12261echo "$as_me:12261: checking for struct addrinfo" >&5
13988echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6 12262echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
13989if test "${ac_cv_have_struct_addrinfo+set}" = set; then 12263if test "${ac_cv_have_struct_addrinfo+set}" = set; then
13990 echo $ECHO_N "(cached) $ECHO_C" >&6 12264 echo $ECHO_N "(cached) $ECHO_C" >&6
13991else 12265else
13992 12266
13993 cat >conftest.$ac_ext <<_ACEOF 12267 cat >conftest.$ac_ext <<_ACEOF
13994#line $LINENO "configure" 12268#line 12268 "configure"
13995/* confdefs.h. */ 12269#include "confdefs.h"
13996_ACEOF
13997cat confdefs.h >>conftest.$ac_ext
13998cat >>conftest.$ac_ext <<_ACEOF
13999/* end confdefs.h. */
14000 12270
14001#include <sys/types.h> 12271#include <sys/types.h>
14002#include <sys/socket.h> 12272#include <sys/socket.h>
@@ -14011,50 +12281,45 @@ main ()
14011} 12281}
14012_ACEOF 12282_ACEOF
14013rm -f conftest.$ac_objext 12283rm -f conftest.$ac_objext
14014if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12284if { (eval echo "$as_me:12284: \"$ac_compile\"") >&5
14015 (eval $ac_compile) 2>&5 12285 (eval $ac_compile) 2>&5
14016 ac_status=$? 12286 ac_status=$?
14017 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12287 echo "$as_me:12287: \$? = $ac_status" >&5
14018 (exit $ac_status); } && 12288 (exit $ac_status); } &&
14019 { ac_try='test -s conftest.$ac_objext' 12289 { ac_try='test -s conftest.$ac_objext'
14020 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12290 { (eval echo "$as_me:12290: \"$ac_try\"") >&5
14021 (eval $ac_try) 2>&5 12291 (eval $ac_try) 2>&5
14022 ac_status=$? 12292 ac_status=$?
14023 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12293 echo "$as_me:12293: \$? = $ac_status" >&5
14024 (exit $ac_status); }; }; then 12294 (exit $ac_status); }; }; then
14025 ac_cv_have_struct_addrinfo="yes" 12295 ac_cv_have_struct_addrinfo="yes"
14026else 12296else
14027 echo "$as_me: failed program was:" >&5 12297 echo "$as_me: failed program was:" >&5
14028sed 's/^/| /' conftest.$ac_ext >&5 12298cat conftest.$ac_ext >&5
14029
14030 ac_cv_have_struct_addrinfo="no" 12299 ac_cv_have_struct_addrinfo="no"
14031 12300
14032fi 12301fi
14033rm -f conftest.$ac_objext conftest.$ac_ext 12302rm -f conftest.$ac_objext conftest.$ac_ext
14034 12303
14035fi 12304fi
14036echo "$as_me:$LINENO: result: $ac_cv_have_struct_addrinfo" >&5 12305echo "$as_me:12305: result: $ac_cv_have_struct_addrinfo" >&5
14037echo "${ECHO_T}$ac_cv_have_struct_addrinfo" >&6 12306echo "${ECHO_T}$ac_cv_have_struct_addrinfo" >&6
14038if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then 12307if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
14039 cat >>confdefs.h <<\_ACEOF 12308 cat >>confdefs.h <<\EOF
14040#define HAVE_STRUCT_ADDRINFO 1 12309#define HAVE_STRUCT_ADDRINFO 1
14041_ACEOF 12310EOF
14042 12311
14043fi 12312fi
14044 12313
14045echo "$as_me:$LINENO: checking for struct timeval" >&5 12314echo "$as_me:12314: checking for struct timeval" >&5
14046echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6 12315echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6
14047if test "${ac_cv_have_struct_timeval+set}" = set; then 12316if test "${ac_cv_have_struct_timeval+set}" = set; then
14048 echo $ECHO_N "(cached) $ECHO_C" >&6 12317 echo $ECHO_N "(cached) $ECHO_C" >&6
14049else 12318else
14050 12319
14051 cat >conftest.$ac_ext <<_ACEOF 12320 cat >conftest.$ac_ext <<_ACEOF
14052#line $LINENO "configure" 12321#line 12321 "configure"
14053/* confdefs.h. */ 12322#include "confdefs.h"
14054_ACEOF
14055cat confdefs.h >>conftest.$ac_ext
14056cat >>conftest.$ac_ext <<_ACEOF
14057/* end confdefs.h. */
14058 #include <sys/time.h> 12323 #include <sys/time.h>
14059int 12324int
14060main () 12325main ()
@@ -14065,50 +12330,45 @@ main ()
14065} 12330}
14066_ACEOF 12331_ACEOF
14067rm -f conftest.$ac_objext 12332rm -f conftest.$ac_objext
14068if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12333if { (eval echo "$as_me:12333: \"$ac_compile\"") >&5
14069 (eval $ac_compile) 2>&5 12334 (eval $ac_compile) 2>&5
14070 ac_status=$? 12335 ac_status=$?
14071 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12336 echo "$as_me:12336: \$? = $ac_status" >&5
14072 (exit $ac_status); } && 12337 (exit $ac_status); } &&
14073 { ac_try='test -s conftest.$ac_objext' 12338 { ac_try='test -s conftest.$ac_objext'
14074 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12339 { (eval echo "$as_me:12339: \"$ac_try\"") >&5
14075 (eval $ac_try) 2>&5 12340 (eval $ac_try) 2>&5
14076 ac_status=$? 12341 ac_status=$?
14077 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12342 echo "$as_me:12342: \$? = $ac_status" >&5
14078 (exit $ac_status); }; }; then 12343 (exit $ac_status); }; }; then
14079 ac_cv_have_struct_timeval="yes" 12344 ac_cv_have_struct_timeval="yes"
14080else 12345else
14081 echo "$as_me: failed program was:" >&5 12346 echo "$as_me: failed program was:" >&5
14082sed 's/^/| /' conftest.$ac_ext >&5 12347cat conftest.$ac_ext >&5
14083
14084 ac_cv_have_struct_timeval="no" 12348 ac_cv_have_struct_timeval="no"
14085 12349
14086fi 12350fi
14087rm -f conftest.$ac_objext conftest.$ac_ext 12351rm -f conftest.$ac_objext conftest.$ac_ext
14088 12352
14089fi 12353fi
14090echo "$as_me:$LINENO: result: $ac_cv_have_struct_timeval" >&5 12354echo "$as_me:12354: result: $ac_cv_have_struct_timeval" >&5
14091echo "${ECHO_T}$ac_cv_have_struct_timeval" >&6 12355echo "${ECHO_T}$ac_cv_have_struct_timeval" >&6
14092if test "x$ac_cv_have_struct_timeval" = "xyes" ; then 12356if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
14093 cat >>confdefs.h <<\_ACEOF 12357 cat >>confdefs.h <<\EOF
14094#define HAVE_STRUCT_TIMEVAL 1 12358#define HAVE_STRUCT_TIMEVAL 1
14095_ACEOF 12359EOF
14096 12360
14097 have_struct_timeval=1 12361 have_struct_timeval=1
14098fi 12362fi
14099 12363
14100echo "$as_me:$LINENO: checking for struct timespec" >&5 12364echo "$as_me:12364: checking for struct timespec" >&5
14101echo $ECHO_N "checking for struct timespec... $ECHO_C" >&6 12365echo $ECHO_N "checking for struct timespec... $ECHO_C" >&6
14102if test "${ac_cv_type_struct_timespec+set}" = set; then 12366if test "${ac_cv_type_struct_timespec+set}" = set; then
14103 echo $ECHO_N "(cached) $ECHO_C" >&6 12367 echo $ECHO_N "(cached) $ECHO_C" >&6
14104else 12368else
14105 cat >conftest.$ac_ext <<_ACEOF 12369 cat >conftest.$ac_ext <<_ACEOF
14106#line $LINENO "configure" 12370#line 12370 "configure"
14107/* confdefs.h. */ 12371#include "confdefs.h"
14108_ACEOF
14109cat confdefs.h >>conftest.$ac_ext
14110cat >>conftest.$ac_ext <<_ACEOF
14111/* end confdefs.h. */
14112$ac_includes_default 12372$ac_includes_default
14113int 12373int
14114main () 12374main ()
@@ -14122,38 +12382,35 @@ if (sizeof (struct timespec))
14122} 12382}
14123_ACEOF 12383_ACEOF
14124rm -f conftest.$ac_objext 12384rm -f conftest.$ac_objext
14125if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 12385if { (eval echo "$as_me:12385: \"$ac_compile\"") >&5
14126 (eval $ac_compile) 2>&5 12386 (eval $ac_compile) 2>&5
14127 ac_status=$? 12387 ac_status=$?
14128 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12388 echo "$as_me:12388: \$? = $ac_status" >&5
14129 (exit $ac_status); } && 12389 (exit $ac_status); } &&
14130 { ac_try='test -s conftest.$ac_objext' 12390 { ac_try='test -s conftest.$ac_objext'
14131 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12391 { (eval echo "$as_me:12391: \"$ac_try\"") >&5
14132 (eval $ac_try) 2>&5 12392 (eval $ac_try) 2>&5
14133 ac_status=$? 12393 ac_status=$?
14134 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12394 echo "$as_me:12394: \$? = $ac_status" >&5
14135 (exit $ac_status); }; }; then 12395 (exit $ac_status); }; }; then
14136 ac_cv_type_struct_timespec=yes 12396 ac_cv_type_struct_timespec=yes
14137else 12397else
14138 echo "$as_me: failed program was:" >&5 12398 echo "$as_me: failed program was:" >&5
14139sed 's/^/| /' conftest.$ac_ext >&5 12399cat conftest.$ac_ext >&5
14140
14141ac_cv_type_struct_timespec=no 12400ac_cv_type_struct_timespec=no
14142fi 12401fi
14143rm -f conftest.$ac_objext conftest.$ac_ext 12402rm -f conftest.$ac_objext conftest.$ac_ext
14144fi 12403fi
14145echo "$as_me:$LINENO: result: $ac_cv_type_struct_timespec" >&5 12404echo "$as_me:12404: result: $ac_cv_type_struct_timespec" >&5
14146echo "${ECHO_T}$ac_cv_type_struct_timespec" >&6 12405echo "${ECHO_T}$ac_cv_type_struct_timespec" >&6
14147if test $ac_cv_type_struct_timespec = yes; then 12406if test $ac_cv_type_struct_timespec = yes; then
14148 12407
14149cat >>confdefs.h <<_ACEOF 12408cat >>confdefs.h <<EOF
14150#define HAVE_STRUCT_TIMESPEC 1 12409#define HAVE_STRUCT_TIMESPEC 1
14151_ACEOF 12410EOF
14152
14153 12411
14154fi 12412fi
14155 12413
14156
14157# We need int64_t or else certian parts of the compile will fail. 12414# We need int64_t or else certian parts of the compile will fail.
14158if test "x$ac_cv_have_int64_t" = "xno" -a \ 12415if test "x$ac_cv_have_int64_t" = "xno" -a \
14159 "x$ac_cv_sizeof_long_int" != "x8" -a \ 12416 "x$ac_cv_sizeof_long_int" != "x8" -a \
@@ -14164,19 +12421,13 @@ if test "x$ac_cv_have_int64_t" = "xno" -a \
14164 exit 1; 12421 exit 1;
14165else 12422else
14166 if test "$cross_compiling" = yes; then 12423 if test "$cross_compiling" = yes; then
14167 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 12424 { { echo "$as_me:12424: error: cannot run test program while cross compiling" >&5
14168See \`config.log' for more details." >&5 12425echo "$as_me: error: cannot run test program while cross compiling" >&2;}
14169echo "$as_me: error: cannot run test program while cross compiling
14170See \`config.log' for more details." >&2;}
14171 { (exit 1); exit 1; }; } 12426 { (exit 1); exit 1; }; }
14172else 12427else
14173 cat >conftest.$ac_ext <<_ACEOF 12428 cat >conftest.$ac_ext <<_ACEOF
14174#line $LINENO "configure" 12429#line 12429 "configure"
14175/* confdefs.h. */ 12430#include "confdefs.h"
14176_ACEOF
14177cat confdefs.h >>conftest.$ac_ext
14178cat >>conftest.$ac_ext <<_ACEOF
14179/* end confdefs.h. */
14180 12431
14181#include <stdio.h> 12432#include <stdio.h>
14182#include <string.h> 12433#include <string.h>
@@ -14203,55 +12454,47 @@ main() { exit(0); }
14203 12454
14204_ACEOF 12455_ACEOF
14205rm -f conftest$ac_exeext 12456rm -f conftest$ac_exeext
14206if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 12457if { (eval echo "$as_me:12457: \"$ac_link\"") >&5
14207 (eval $ac_link) 2>&5 12458 (eval $ac_link) 2>&5
14208 ac_status=$? 12459 ac_status=$?
14209 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12460 echo "$as_me:12460: \$? = $ac_status" >&5
14210 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 12461 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14211 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 12462 { (eval echo "$as_me:12462: \"$ac_try\"") >&5
14212 (eval $ac_try) 2>&5 12463 (eval $ac_try) 2>&5
14213 ac_status=$? 12464 ac_status=$?
14214 echo "$as_me:$LINENO: \$? = $ac_status" >&5 12465 echo "$as_me:12465: \$? = $ac_status" >&5
14215 (exit $ac_status); }; }; then 12466 (exit $ac_status); }; }; then
14216 true 12467 true
14217else 12468else
14218 echo "$as_me: program exited with status $ac_status" >&5 12469 echo "$as_me: program exited with status $ac_status" >&5
14219echo "$as_me: failed program was:" >&5 12470echo "$as_me: failed program was:" >&5
14220sed 's/^/| /' conftest.$ac_ext >&5 12471cat conftest.$ac_ext >&5
14221 12472 cat >>confdefs.h <<\EOF
14222( exit $ac_status )
14223 cat >>confdefs.h <<\_ACEOF
14224#define BROKEN_SNPRINTF 1 12473#define BROKEN_SNPRINTF 1
14225_ACEOF 12474EOF
14226
14227 12475
14228fi 12476fi
14229rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 12477rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14230fi 12478fi
14231fi 12479fi
14232 12480
14233
14234# look for field 'ut_host' in header 'utmp.h' 12481# look for field 'ut_host' in header 'utmp.h'
14235 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12482 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14236 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host 12483 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
14237 echo "$as_me:$LINENO: checking for ut_host field in utmp.h" >&5 12484 echo "$as_me:12484: checking for ut_host field in utmp.h" >&5
14238echo $ECHO_N "checking for ut_host field in utmp.h... $ECHO_C" >&6 12485echo $ECHO_N "checking for ut_host field in utmp.h... $ECHO_C" >&6
14239 if eval "test \"\${$ossh_varname+set}\" = set"; then 12486 if eval "test \"\${$ossh_varname+set}\" = set"; then
14240 echo $ECHO_N "(cached) $ECHO_C" >&6 12487 echo $ECHO_N "(cached) $ECHO_C" >&6
14241else 12488else
14242 12489
14243 cat >conftest.$ac_ext <<_ACEOF 12490 cat >conftest.$ac_ext <<_ACEOF
14244#line $LINENO "configure" 12491#line 12491 "configure"
14245/* confdefs.h. */ 12492#include "confdefs.h"
14246_ACEOF
14247cat confdefs.h >>conftest.$ac_ext
14248cat >>conftest.$ac_ext <<_ACEOF
14249/* end confdefs.h. */
14250#include <utmp.h> 12493#include <utmp.h>
14251 12494
14252_ACEOF 12495_ACEOF
14253if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12496if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14254 $EGREP "ut_host" >/dev/null 2>&1; then 12497 egrep "ut_host" >/dev/null 2>&1; then
14255 eval "$ossh_varname=yes" 12498 eval "$ossh_varname=yes"
14256else 12499else
14257 eval "$ossh_varname=no" 12500 eval "$ossh_varname=no"
@@ -14262,41 +12505,36 @@ fi
14262 12505
14263 ossh_result=`eval 'echo $'"$ossh_varname"` 12506 ossh_result=`eval 'echo $'"$ossh_varname"`
14264 if test -n "`echo $ossh_varname`"; then 12507 if test -n "`echo $ossh_varname`"; then
14265 echo "$as_me:$LINENO: result: $ossh_result" >&5 12508 echo "$as_me:12508: result: $ossh_result" >&5
14266echo "${ECHO_T}$ossh_result" >&6 12509echo "${ECHO_T}$ossh_result" >&6
14267 if test "x$ossh_result" = "xyes"; then 12510 if test "x$ossh_result" = "xyes"; then
14268 cat >>confdefs.h <<\_ACEOF 12511 cat >>confdefs.h <<\EOF
14269#define HAVE_HOST_IN_UTMP 1 12512#define HAVE_HOST_IN_UTMP 1
14270_ACEOF 12513EOF
14271 12514
14272 fi 12515 fi
14273 else 12516 else
14274 echo "$as_me:$LINENO: result: no" >&5 12517 echo "$as_me:12517: result: no" >&5
14275echo "${ECHO_T}no" >&6 12518echo "${ECHO_T}no" >&6
14276 fi 12519 fi
14277 12520
14278
14279# look for field 'ut_host' in header 'utmpx.h' 12521# look for field 'ut_host' in header 'utmpx.h'
14280 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12522 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14281 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host 12523 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_host
14282 echo "$as_me:$LINENO: checking for ut_host field in utmpx.h" >&5 12524 echo "$as_me:12524: checking for ut_host field in utmpx.h" >&5
14283echo $ECHO_N "checking for ut_host field in utmpx.h... $ECHO_C" >&6 12525echo $ECHO_N "checking for ut_host field in utmpx.h... $ECHO_C" >&6
14284 if eval "test \"\${$ossh_varname+set}\" = set"; then 12526 if eval "test \"\${$ossh_varname+set}\" = set"; then
14285 echo $ECHO_N "(cached) $ECHO_C" >&6 12527 echo $ECHO_N "(cached) $ECHO_C" >&6
14286else 12528else
14287 12529
14288 cat >conftest.$ac_ext <<_ACEOF 12530 cat >conftest.$ac_ext <<_ACEOF
14289#line $LINENO "configure" 12531#line 12531 "configure"
14290/* confdefs.h. */ 12532#include "confdefs.h"
14291_ACEOF
14292cat confdefs.h >>conftest.$ac_ext
14293cat >>conftest.$ac_ext <<_ACEOF
14294/* end confdefs.h. */
14295#include <utmpx.h> 12533#include <utmpx.h>
14296 12534
14297_ACEOF 12535_ACEOF
14298if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12536if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14299 $EGREP "ut_host" >/dev/null 2>&1; then 12537 egrep "ut_host" >/dev/null 2>&1; then
14300 eval "$ossh_varname=yes" 12538 eval "$ossh_varname=yes"
14301else 12539else
14302 eval "$ossh_varname=no" 12540 eval "$ossh_varname=no"
@@ -14307,41 +12545,36 @@ fi
14307 12545
14308 ossh_result=`eval 'echo $'"$ossh_varname"` 12546 ossh_result=`eval 'echo $'"$ossh_varname"`
14309 if test -n "`echo $ossh_varname`"; then 12547 if test -n "`echo $ossh_varname`"; then
14310 echo "$as_me:$LINENO: result: $ossh_result" >&5 12548 echo "$as_me:12548: result: $ossh_result" >&5
14311echo "${ECHO_T}$ossh_result" >&6 12549echo "${ECHO_T}$ossh_result" >&6
14312 if test "x$ossh_result" = "xyes"; then 12550 if test "x$ossh_result" = "xyes"; then
14313 cat >>confdefs.h <<\_ACEOF 12551 cat >>confdefs.h <<\EOF
14314#define HAVE_HOST_IN_UTMPX 1 12552#define HAVE_HOST_IN_UTMPX 1
14315_ACEOF 12553EOF
14316 12554
14317 fi 12555 fi
14318 else 12556 else
14319 echo "$as_me:$LINENO: result: no" >&5 12557 echo "$as_me:12557: result: no" >&5
14320echo "${ECHO_T}no" >&6 12558echo "${ECHO_T}no" >&6
14321 fi 12559 fi
14322 12560
14323
14324# look for field 'syslen' in header 'utmpx.h' 12561# look for field 'syslen' in header 'utmpx.h'
14325 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12562 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14326 ossh_varname="ossh_cv_$ossh_safe""_has_"syslen 12563 ossh_varname="ossh_cv_$ossh_safe""_has_"syslen
14327 echo "$as_me:$LINENO: checking for syslen field in utmpx.h" >&5 12564 echo "$as_me:12564: checking for syslen field in utmpx.h" >&5
14328echo $ECHO_N "checking for syslen field in utmpx.h... $ECHO_C" >&6 12565echo $ECHO_N "checking for syslen field in utmpx.h... $ECHO_C" >&6
14329 if eval "test \"\${$ossh_varname+set}\" = set"; then 12566 if eval "test \"\${$ossh_varname+set}\" = set"; then
14330 echo $ECHO_N "(cached) $ECHO_C" >&6 12567 echo $ECHO_N "(cached) $ECHO_C" >&6
14331else 12568else
14332 12569
14333 cat >conftest.$ac_ext <<_ACEOF 12570 cat >conftest.$ac_ext <<_ACEOF
14334#line $LINENO "configure" 12571#line 12571 "configure"
14335/* confdefs.h. */ 12572#include "confdefs.h"
14336_ACEOF
14337cat confdefs.h >>conftest.$ac_ext
14338cat >>conftest.$ac_ext <<_ACEOF
14339/* end confdefs.h. */
14340#include <utmpx.h> 12573#include <utmpx.h>
14341 12574
14342_ACEOF 12575_ACEOF
14343if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12576if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14344 $EGREP "syslen" >/dev/null 2>&1; then 12577 egrep "syslen" >/dev/null 2>&1; then
14345 eval "$ossh_varname=yes" 12578 eval "$ossh_varname=yes"
14346else 12579else
14347 eval "$ossh_varname=no" 12580 eval "$ossh_varname=no"
@@ -14352,41 +12585,36 @@ fi
14352 12585
14353 ossh_result=`eval 'echo $'"$ossh_varname"` 12586 ossh_result=`eval 'echo $'"$ossh_varname"`
14354 if test -n "`echo $ossh_varname`"; then 12587 if test -n "`echo $ossh_varname`"; then
14355 echo "$as_me:$LINENO: result: $ossh_result" >&5 12588 echo "$as_me:12588: result: $ossh_result" >&5
14356echo "${ECHO_T}$ossh_result" >&6 12589echo "${ECHO_T}$ossh_result" >&6
14357 if test "x$ossh_result" = "xyes"; then 12590 if test "x$ossh_result" = "xyes"; then
14358 cat >>confdefs.h <<\_ACEOF 12591 cat >>confdefs.h <<\EOF
14359#define HAVE_SYSLEN_IN_UTMPX 1 12592#define HAVE_SYSLEN_IN_UTMPX 1
14360_ACEOF 12593EOF
14361 12594
14362 fi 12595 fi
14363 else 12596 else
14364 echo "$as_me:$LINENO: result: no" >&5 12597 echo "$as_me:12597: result: no" >&5
14365echo "${ECHO_T}no" >&6 12598echo "${ECHO_T}no" >&6
14366 fi 12599 fi
14367 12600
14368
14369# look for field 'ut_pid' in header 'utmp.h' 12601# look for field 'ut_pid' in header 'utmp.h'
14370 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12602 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14371 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_pid 12603 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_pid
14372 echo "$as_me:$LINENO: checking for ut_pid field in utmp.h" >&5 12604 echo "$as_me:12604: checking for ut_pid field in utmp.h" >&5
14373echo $ECHO_N "checking for ut_pid field in utmp.h... $ECHO_C" >&6 12605echo $ECHO_N "checking for ut_pid field in utmp.h... $ECHO_C" >&6
14374 if eval "test \"\${$ossh_varname+set}\" = set"; then 12606 if eval "test \"\${$ossh_varname+set}\" = set"; then
14375 echo $ECHO_N "(cached) $ECHO_C" >&6 12607 echo $ECHO_N "(cached) $ECHO_C" >&6
14376else 12608else
14377 12609
14378 cat >conftest.$ac_ext <<_ACEOF 12610 cat >conftest.$ac_ext <<_ACEOF
14379#line $LINENO "configure" 12611#line 12611 "configure"
14380/* confdefs.h. */ 12612#include "confdefs.h"
14381_ACEOF
14382cat confdefs.h >>conftest.$ac_ext
14383cat >>conftest.$ac_ext <<_ACEOF
14384/* end confdefs.h. */
14385#include <utmp.h> 12613#include <utmp.h>
14386 12614
14387_ACEOF 12615_ACEOF
14388if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12616if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14389 $EGREP "ut_pid" >/dev/null 2>&1; then 12617 egrep "ut_pid" >/dev/null 2>&1; then
14390 eval "$ossh_varname=yes" 12618 eval "$ossh_varname=yes"
14391else 12619else
14392 eval "$ossh_varname=no" 12620 eval "$ossh_varname=no"
@@ -14397,41 +12625,36 @@ fi
14397 12625
14398 ossh_result=`eval 'echo $'"$ossh_varname"` 12626 ossh_result=`eval 'echo $'"$ossh_varname"`
14399 if test -n "`echo $ossh_varname`"; then 12627 if test -n "`echo $ossh_varname`"; then
14400 echo "$as_me:$LINENO: result: $ossh_result" >&5 12628 echo "$as_me:12628: result: $ossh_result" >&5
14401echo "${ECHO_T}$ossh_result" >&6 12629echo "${ECHO_T}$ossh_result" >&6
14402 if test "x$ossh_result" = "xyes"; then 12630 if test "x$ossh_result" = "xyes"; then
14403 cat >>confdefs.h <<\_ACEOF 12631 cat >>confdefs.h <<\EOF
14404#define HAVE_PID_IN_UTMP 1 12632#define HAVE_PID_IN_UTMP 1
14405_ACEOF 12633EOF
14406 12634
14407 fi 12635 fi
14408 else 12636 else
14409 echo "$as_me:$LINENO: result: no" >&5 12637 echo "$as_me:12637: result: no" >&5
14410echo "${ECHO_T}no" >&6 12638echo "${ECHO_T}no" >&6
14411 fi 12639 fi
14412 12640
14413
14414# look for field 'ut_type' in header 'utmp.h' 12641# look for field 'ut_type' in header 'utmp.h'
14415 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12642 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14416 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type 12643 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
14417 echo "$as_me:$LINENO: checking for ut_type field in utmp.h" >&5 12644 echo "$as_me:12644: checking for ut_type field in utmp.h" >&5
14418echo $ECHO_N "checking for ut_type field in utmp.h... $ECHO_C" >&6 12645echo $ECHO_N "checking for ut_type field in utmp.h... $ECHO_C" >&6
14419 if eval "test \"\${$ossh_varname+set}\" = set"; then 12646 if eval "test \"\${$ossh_varname+set}\" = set"; then
14420 echo $ECHO_N "(cached) $ECHO_C" >&6 12647 echo $ECHO_N "(cached) $ECHO_C" >&6
14421else 12648else
14422 12649
14423 cat >conftest.$ac_ext <<_ACEOF 12650 cat >conftest.$ac_ext <<_ACEOF
14424#line $LINENO "configure" 12651#line 12651 "configure"
14425/* confdefs.h. */ 12652#include "confdefs.h"
14426_ACEOF
14427cat confdefs.h >>conftest.$ac_ext
14428cat >>conftest.$ac_ext <<_ACEOF
14429/* end confdefs.h. */
14430#include <utmp.h> 12653#include <utmp.h>
14431 12654
14432_ACEOF 12655_ACEOF
14433if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12656if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14434 $EGREP "ut_type" >/dev/null 2>&1; then 12657 egrep "ut_type" >/dev/null 2>&1; then
14435 eval "$ossh_varname=yes" 12658 eval "$ossh_varname=yes"
14436else 12659else
14437 eval "$ossh_varname=no" 12660 eval "$ossh_varname=no"
@@ -14442,41 +12665,36 @@ fi
14442 12665
14443 ossh_result=`eval 'echo $'"$ossh_varname"` 12666 ossh_result=`eval 'echo $'"$ossh_varname"`
14444 if test -n "`echo $ossh_varname`"; then 12667 if test -n "`echo $ossh_varname`"; then
14445 echo "$as_me:$LINENO: result: $ossh_result" >&5 12668 echo "$as_me:12668: result: $ossh_result" >&5
14446echo "${ECHO_T}$ossh_result" >&6 12669echo "${ECHO_T}$ossh_result" >&6
14447 if test "x$ossh_result" = "xyes"; then 12670 if test "x$ossh_result" = "xyes"; then
14448 cat >>confdefs.h <<\_ACEOF 12671 cat >>confdefs.h <<\EOF
14449#define HAVE_TYPE_IN_UTMP 1 12672#define HAVE_TYPE_IN_UTMP 1
14450_ACEOF 12673EOF
14451 12674
14452 fi 12675 fi
14453 else 12676 else
14454 echo "$as_me:$LINENO: result: no" >&5 12677 echo "$as_me:12677: result: no" >&5
14455echo "${ECHO_T}no" >&6 12678echo "${ECHO_T}no" >&6
14456 fi 12679 fi
14457 12680
14458
14459# look for field 'ut_type' in header 'utmpx.h' 12681# look for field 'ut_type' in header 'utmpx.h'
14460 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12682 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14461 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type 12683 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_type
14462 echo "$as_me:$LINENO: checking for ut_type field in utmpx.h" >&5 12684 echo "$as_me:12684: checking for ut_type field in utmpx.h" >&5
14463echo $ECHO_N "checking for ut_type field in utmpx.h... $ECHO_C" >&6 12685echo $ECHO_N "checking for ut_type field in utmpx.h... $ECHO_C" >&6
14464 if eval "test \"\${$ossh_varname+set}\" = set"; then 12686 if eval "test \"\${$ossh_varname+set}\" = set"; then
14465 echo $ECHO_N "(cached) $ECHO_C" >&6 12687 echo $ECHO_N "(cached) $ECHO_C" >&6
14466else 12688else
14467 12689
14468 cat >conftest.$ac_ext <<_ACEOF 12690 cat >conftest.$ac_ext <<_ACEOF
14469#line $LINENO "configure" 12691#line 12691 "configure"
14470/* confdefs.h. */ 12692#include "confdefs.h"
14471_ACEOF
14472cat confdefs.h >>conftest.$ac_ext
14473cat >>conftest.$ac_ext <<_ACEOF
14474/* end confdefs.h. */
14475#include <utmpx.h> 12693#include <utmpx.h>
14476 12694
14477_ACEOF 12695_ACEOF
14478if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12696if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14479 $EGREP "ut_type" >/dev/null 2>&1; then 12697 egrep "ut_type" >/dev/null 2>&1; then
14480 eval "$ossh_varname=yes" 12698 eval "$ossh_varname=yes"
14481else 12699else
14482 eval "$ossh_varname=no" 12700 eval "$ossh_varname=no"
@@ -14487,41 +12705,36 @@ fi
14487 12705
14488 ossh_result=`eval 'echo $'"$ossh_varname"` 12706 ossh_result=`eval 'echo $'"$ossh_varname"`
14489 if test -n "`echo $ossh_varname`"; then 12707 if test -n "`echo $ossh_varname`"; then
14490 echo "$as_me:$LINENO: result: $ossh_result" >&5 12708 echo "$as_me:12708: result: $ossh_result" >&5
14491echo "${ECHO_T}$ossh_result" >&6 12709echo "${ECHO_T}$ossh_result" >&6
14492 if test "x$ossh_result" = "xyes"; then 12710 if test "x$ossh_result" = "xyes"; then
14493 cat >>confdefs.h <<\_ACEOF 12711 cat >>confdefs.h <<\EOF
14494#define HAVE_TYPE_IN_UTMPX 1 12712#define HAVE_TYPE_IN_UTMPX 1
14495_ACEOF 12713EOF
14496 12714
14497 fi 12715 fi
14498 else 12716 else
14499 echo "$as_me:$LINENO: result: no" >&5 12717 echo "$as_me:12717: result: no" >&5
14500echo "${ECHO_T}no" >&6 12718echo "${ECHO_T}no" >&6
14501 fi 12719 fi
14502 12720
14503
14504# look for field 'ut_tv' in header 'utmp.h' 12721# look for field 'ut_tv' in header 'utmp.h'
14505 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12722 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14506 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv 12723 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
14507 echo "$as_me:$LINENO: checking for ut_tv field in utmp.h" >&5 12724 echo "$as_me:12724: checking for ut_tv field in utmp.h" >&5
14508echo $ECHO_N "checking for ut_tv field in utmp.h... $ECHO_C" >&6 12725echo $ECHO_N "checking for ut_tv field in utmp.h... $ECHO_C" >&6
14509 if eval "test \"\${$ossh_varname+set}\" = set"; then 12726 if eval "test \"\${$ossh_varname+set}\" = set"; then
14510 echo $ECHO_N "(cached) $ECHO_C" >&6 12727 echo $ECHO_N "(cached) $ECHO_C" >&6
14511else 12728else
14512 12729
14513 cat >conftest.$ac_ext <<_ACEOF 12730 cat >conftest.$ac_ext <<_ACEOF
14514#line $LINENO "configure" 12731#line 12731 "configure"
14515/* confdefs.h. */ 12732#include "confdefs.h"
14516_ACEOF
14517cat confdefs.h >>conftest.$ac_ext
14518cat >>conftest.$ac_ext <<_ACEOF
14519/* end confdefs.h. */
14520#include <utmp.h> 12733#include <utmp.h>
14521 12734
14522_ACEOF 12735_ACEOF
14523if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12736if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14524 $EGREP "ut_tv" >/dev/null 2>&1; then 12737 egrep "ut_tv" >/dev/null 2>&1; then
14525 eval "$ossh_varname=yes" 12738 eval "$ossh_varname=yes"
14526else 12739else
14527 eval "$ossh_varname=no" 12740 eval "$ossh_varname=no"
@@ -14532,41 +12745,36 @@ fi
14532 12745
14533 ossh_result=`eval 'echo $'"$ossh_varname"` 12746 ossh_result=`eval 'echo $'"$ossh_varname"`
14534 if test -n "`echo $ossh_varname`"; then 12747 if test -n "`echo $ossh_varname`"; then
14535 echo "$as_me:$LINENO: result: $ossh_result" >&5 12748 echo "$as_me:12748: result: $ossh_result" >&5
14536echo "${ECHO_T}$ossh_result" >&6 12749echo "${ECHO_T}$ossh_result" >&6
14537 if test "x$ossh_result" = "xyes"; then 12750 if test "x$ossh_result" = "xyes"; then
14538 cat >>confdefs.h <<\_ACEOF 12751 cat >>confdefs.h <<\EOF
14539#define HAVE_TV_IN_UTMP 1 12752#define HAVE_TV_IN_UTMP 1
14540_ACEOF 12753EOF
14541 12754
14542 fi 12755 fi
14543 else 12756 else
14544 echo "$as_me:$LINENO: result: no" >&5 12757 echo "$as_me:12757: result: no" >&5
14545echo "${ECHO_T}no" >&6 12758echo "${ECHO_T}no" >&6
14546 fi 12759 fi
14547 12760
14548
14549# look for field 'ut_id' in header 'utmp.h' 12761# look for field 'ut_id' in header 'utmp.h'
14550 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12762 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14551 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id 12763 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
14552 echo "$as_me:$LINENO: checking for ut_id field in utmp.h" >&5 12764 echo "$as_me:12764: checking for ut_id field in utmp.h" >&5
14553echo $ECHO_N "checking for ut_id field in utmp.h... $ECHO_C" >&6 12765echo $ECHO_N "checking for ut_id field in utmp.h... $ECHO_C" >&6
14554 if eval "test \"\${$ossh_varname+set}\" = set"; then 12766 if eval "test \"\${$ossh_varname+set}\" = set"; then
14555 echo $ECHO_N "(cached) $ECHO_C" >&6 12767 echo $ECHO_N "(cached) $ECHO_C" >&6
14556else 12768else
14557 12769
14558 cat >conftest.$ac_ext <<_ACEOF 12770 cat >conftest.$ac_ext <<_ACEOF
14559#line $LINENO "configure" 12771#line 12771 "configure"
14560/* confdefs.h. */ 12772#include "confdefs.h"
14561_ACEOF
14562cat confdefs.h >>conftest.$ac_ext
14563cat >>conftest.$ac_ext <<_ACEOF
14564/* end confdefs.h. */
14565#include <utmp.h> 12773#include <utmp.h>
14566 12774
14567_ACEOF 12775_ACEOF
14568if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12776if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14569 $EGREP "ut_id" >/dev/null 2>&1; then 12777 egrep "ut_id" >/dev/null 2>&1; then
14570 eval "$ossh_varname=yes" 12778 eval "$ossh_varname=yes"
14571else 12779else
14572 eval "$ossh_varname=no" 12780 eval "$ossh_varname=no"
@@ -14577,41 +12785,36 @@ fi
14577 12785
14578 ossh_result=`eval 'echo $'"$ossh_varname"` 12786 ossh_result=`eval 'echo $'"$ossh_varname"`
14579 if test -n "`echo $ossh_varname`"; then 12787 if test -n "`echo $ossh_varname`"; then
14580 echo "$as_me:$LINENO: result: $ossh_result" >&5 12788 echo "$as_me:12788: result: $ossh_result" >&5
14581echo "${ECHO_T}$ossh_result" >&6 12789echo "${ECHO_T}$ossh_result" >&6
14582 if test "x$ossh_result" = "xyes"; then 12790 if test "x$ossh_result" = "xyes"; then
14583 cat >>confdefs.h <<\_ACEOF 12791 cat >>confdefs.h <<\EOF
14584#define HAVE_ID_IN_UTMP 1 12792#define HAVE_ID_IN_UTMP 1
14585_ACEOF 12793EOF
14586 12794
14587 fi 12795 fi
14588 else 12796 else
14589 echo "$as_me:$LINENO: result: no" >&5 12797 echo "$as_me:12797: result: no" >&5
14590echo "${ECHO_T}no" >&6 12798echo "${ECHO_T}no" >&6
14591 fi 12799 fi
14592 12800
14593
14594# look for field 'ut_id' in header 'utmpx.h' 12801# look for field 'ut_id' in header 'utmpx.h'
14595 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12802 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14596 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id 12803 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_id
14597 echo "$as_me:$LINENO: checking for ut_id field in utmpx.h" >&5 12804 echo "$as_me:12804: checking for ut_id field in utmpx.h" >&5
14598echo $ECHO_N "checking for ut_id field in utmpx.h... $ECHO_C" >&6 12805echo $ECHO_N "checking for ut_id field in utmpx.h... $ECHO_C" >&6
14599 if eval "test \"\${$ossh_varname+set}\" = set"; then 12806 if eval "test \"\${$ossh_varname+set}\" = set"; then
14600 echo $ECHO_N "(cached) $ECHO_C" >&6 12807 echo $ECHO_N "(cached) $ECHO_C" >&6
14601else 12808else
14602 12809
14603 cat >conftest.$ac_ext <<_ACEOF 12810 cat >conftest.$ac_ext <<_ACEOF
14604#line $LINENO "configure" 12811#line 12811 "configure"
14605/* confdefs.h. */ 12812#include "confdefs.h"
14606_ACEOF
14607cat confdefs.h >>conftest.$ac_ext
14608cat >>conftest.$ac_ext <<_ACEOF
14609/* end confdefs.h. */
14610#include <utmpx.h> 12813#include <utmpx.h>
14611 12814
14612_ACEOF 12815_ACEOF
14613if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12816if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14614 $EGREP "ut_id" >/dev/null 2>&1; then 12817 egrep "ut_id" >/dev/null 2>&1; then
14615 eval "$ossh_varname=yes" 12818 eval "$ossh_varname=yes"
14616else 12819else
14617 eval "$ossh_varname=no" 12820 eval "$ossh_varname=no"
@@ -14622,41 +12825,36 @@ fi
14622 12825
14623 ossh_result=`eval 'echo $'"$ossh_varname"` 12826 ossh_result=`eval 'echo $'"$ossh_varname"`
14624 if test -n "`echo $ossh_varname`"; then 12827 if test -n "`echo $ossh_varname`"; then
14625 echo "$as_me:$LINENO: result: $ossh_result" >&5 12828 echo "$as_me:12828: result: $ossh_result" >&5
14626echo "${ECHO_T}$ossh_result" >&6 12829echo "${ECHO_T}$ossh_result" >&6
14627 if test "x$ossh_result" = "xyes"; then 12830 if test "x$ossh_result" = "xyes"; then
14628 cat >>confdefs.h <<\_ACEOF 12831 cat >>confdefs.h <<\EOF
14629#define HAVE_ID_IN_UTMPX 1 12832#define HAVE_ID_IN_UTMPX 1
14630_ACEOF 12833EOF
14631 12834
14632 fi 12835 fi
14633 else 12836 else
14634 echo "$as_me:$LINENO: result: no" >&5 12837 echo "$as_me:12837: result: no" >&5
14635echo "${ECHO_T}no" >&6 12838echo "${ECHO_T}no" >&6
14636 fi 12839 fi
14637 12840
14638
14639# look for field 'ut_addr' in header 'utmp.h' 12841# look for field 'ut_addr' in header 'utmp.h'
14640 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12842 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14641 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr 12843 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
14642 echo "$as_me:$LINENO: checking for ut_addr field in utmp.h" >&5 12844 echo "$as_me:12844: checking for ut_addr field in utmp.h" >&5
14643echo $ECHO_N "checking for ut_addr field in utmp.h... $ECHO_C" >&6 12845echo $ECHO_N "checking for ut_addr field in utmp.h... $ECHO_C" >&6
14644 if eval "test \"\${$ossh_varname+set}\" = set"; then 12846 if eval "test \"\${$ossh_varname+set}\" = set"; then
14645 echo $ECHO_N "(cached) $ECHO_C" >&6 12847 echo $ECHO_N "(cached) $ECHO_C" >&6
14646else 12848else
14647 12849
14648 cat >conftest.$ac_ext <<_ACEOF 12850 cat >conftest.$ac_ext <<_ACEOF
14649#line $LINENO "configure" 12851#line 12851 "configure"
14650/* confdefs.h. */ 12852#include "confdefs.h"
14651_ACEOF
14652cat confdefs.h >>conftest.$ac_ext
14653cat >>conftest.$ac_ext <<_ACEOF
14654/* end confdefs.h. */
14655#include <utmp.h> 12853#include <utmp.h>
14656 12854
14657_ACEOF 12855_ACEOF
14658if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12856if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14659 $EGREP "ut_addr" >/dev/null 2>&1; then 12857 egrep "ut_addr" >/dev/null 2>&1; then
14660 eval "$ossh_varname=yes" 12858 eval "$ossh_varname=yes"
14661else 12859else
14662 eval "$ossh_varname=no" 12860 eval "$ossh_varname=no"
@@ -14667,41 +12865,36 @@ fi
14667 12865
14668 ossh_result=`eval 'echo $'"$ossh_varname"` 12866 ossh_result=`eval 'echo $'"$ossh_varname"`
14669 if test -n "`echo $ossh_varname`"; then 12867 if test -n "`echo $ossh_varname`"; then
14670 echo "$as_me:$LINENO: result: $ossh_result" >&5 12868 echo "$as_me:12868: result: $ossh_result" >&5
14671echo "${ECHO_T}$ossh_result" >&6 12869echo "${ECHO_T}$ossh_result" >&6
14672 if test "x$ossh_result" = "xyes"; then 12870 if test "x$ossh_result" = "xyes"; then
14673 cat >>confdefs.h <<\_ACEOF 12871 cat >>confdefs.h <<\EOF
14674#define HAVE_ADDR_IN_UTMP 1 12872#define HAVE_ADDR_IN_UTMP 1
14675_ACEOF 12873EOF
14676 12874
14677 fi 12875 fi
14678 else 12876 else
14679 echo "$as_me:$LINENO: result: no" >&5 12877 echo "$as_me:12877: result: no" >&5
14680echo "${ECHO_T}no" >&6 12878echo "${ECHO_T}no" >&6
14681 fi 12879 fi
14682 12880
14683
14684# look for field 'ut_addr' in header 'utmpx.h' 12881# look for field 'ut_addr' in header 'utmpx.h'
14685 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12882 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14686 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr 12883 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr
14687 echo "$as_me:$LINENO: checking for ut_addr field in utmpx.h" >&5 12884 echo "$as_me:12884: checking for ut_addr field in utmpx.h" >&5
14688echo $ECHO_N "checking for ut_addr field in utmpx.h... $ECHO_C" >&6 12885echo $ECHO_N "checking for ut_addr field in utmpx.h... $ECHO_C" >&6
14689 if eval "test \"\${$ossh_varname+set}\" = set"; then 12886 if eval "test \"\${$ossh_varname+set}\" = set"; then
14690 echo $ECHO_N "(cached) $ECHO_C" >&6 12887 echo $ECHO_N "(cached) $ECHO_C" >&6
14691else 12888else
14692 12889
14693 cat >conftest.$ac_ext <<_ACEOF 12890 cat >conftest.$ac_ext <<_ACEOF
14694#line $LINENO "configure" 12891#line 12891 "configure"
14695/* confdefs.h. */ 12892#include "confdefs.h"
14696_ACEOF
14697cat confdefs.h >>conftest.$ac_ext
14698cat >>conftest.$ac_ext <<_ACEOF
14699/* end confdefs.h. */
14700#include <utmpx.h> 12893#include <utmpx.h>
14701 12894
14702_ACEOF 12895_ACEOF
14703if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12896if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14704 $EGREP "ut_addr" >/dev/null 2>&1; then 12897 egrep "ut_addr" >/dev/null 2>&1; then
14705 eval "$ossh_varname=yes" 12898 eval "$ossh_varname=yes"
14706else 12899else
14707 eval "$ossh_varname=no" 12900 eval "$ossh_varname=no"
@@ -14712,41 +12905,36 @@ fi
14712 12905
14713 ossh_result=`eval 'echo $'"$ossh_varname"` 12906 ossh_result=`eval 'echo $'"$ossh_varname"`
14714 if test -n "`echo $ossh_varname`"; then 12907 if test -n "`echo $ossh_varname`"; then
14715 echo "$as_me:$LINENO: result: $ossh_result" >&5 12908 echo "$as_me:12908: result: $ossh_result" >&5
14716echo "${ECHO_T}$ossh_result" >&6 12909echo "${ECHO_T}$ossh_result" >&6
14717 if test "x$ossh_result" = "xyes"; then 12910 if test "x$ossh_result" = "xyes"; then
14718 cat >>confdefs.h <<\_ACEOF 12911 cat >>confdefs.h <<\EOF
14719#define HAVE_ADDR_IN_UTMPX 1 12912#define HAVE_ADDR_IN_UTMPX 1
14720_ACEOF 12913EOF
14721 12914
14722 fi 12915 fi
14723 else 12916 else
14724 echo "$as_me:$LINENO: result: no" >&5 12917 echo "$as_me:12917: result: no" >&5
14725echo "${ECHO_T}no" >&6 12918echo "${ECHO_T}no" >&6
14726 fi 12919 fi
14727 12920
14728
14729# look for field 'ut_addr_v6' in header 'utmp.h' 12921# look for field 'ut_addr_v6' in header 'utmp.h'
14730 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 12922 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14731 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6 12923 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
14732 echo "$as_me:$LINENO: checking for ut_addr_v6 field in utmp.h" >&5 12924 echo "$as_me:12924: checking for ut_addr_v6 field in utmp.h" >&5
14733echo $ECHO_N "checking for ut_addr_v6 field in utmp.h... $ECHO_C" >&6 12925echo $ECHO_N "checking for ut_addr_v6 field in utmp.h... $ECHO_C" >&6
14734 if eval "test \"\${$ossh_varname+set}\" = set"; then 12926 if eval "test \"\${$ossh_varname+set}\" = set"; then
14735 echo $ECHO_N "(cached) $ECHO_C" >&6 12927 echo $ECHO_N "(cached) $ECHO_C" >&6
14736else 12928else
14737 12929
14738 cat >conftest.$ac_ext <<_ACEOF 12930 cat >conftest.$ac_ext <<_ACEOF
14739#line $LINENO "configure" 12931#line 12931 "configure"
14740/* confdefs.h. */ 12932#include "confdefs.h"
14741_ACEOF
14742cat confdefs.h >>conftest.$ac_ext
14743cat >>conftest.$ac_ext <<_ACEOF
14744/* end confdefs.h. */
14745#include <utmp.h> 12933#include <utmp.h>
14746 12934
14747_ACEOF 12935_ACEOF
14748if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12936if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14749 $EGREP "ut_addr_v6" >/dev/null 2>&1; then 12937 egrep "ut_addr_v6" >/dev/null 2>&1; then
14750 eval "$ossh_varname=yes" 12938 eval "$ossh_varname=yes"
14751else 12939else
14752 eval "$ossh_varname=no" 12940 eval "$ossh_varname=no"
@@ -14757,41 +12945,36 @@ fi
14757 12945
14758 ossh_result=`eval 'echo $'"$ossh_varname"` 12946 ossh_result=`eval 'echo $'"$ossh_varname"`
14759 if test -n "`echo $ossh_varname`"; then 12947 if test -n "`echo $ossh_varname`"; then
14760 echo "$as_me:$LINENO: result: $ossh_result" >&5 12948 echo "$as_me:12948: result: $ossh_result" >&5
14761echo "${ECHO_T}$ossh_result" >&6 12949echo "${ECHO_T}$ossh_result" >&6
14762 if test "x$ossh_result" = "xyes"; then 12950 if test "x$ossh_result" = "xyes"; then
14763 cat >>confdefs.h <<\_ACEOF 12951 cat >>confdefs.h <<\EOF
14764#define HAVE_ADDR_V6_IN_UTMP 1 12952#define HAVE_ADDR_V6_IN_UTMP 1
14765_ACEOF 12953EOF
14766 12954
14767 fi 12955 fi
14768 else 12956 else
14769 echo "$as_me:$LINENO: result: no" >&5 12957 echo "$as_me:12957: result: no" >&5
14770echo "${ECHO_T}no" >&6 12958echo "${ECHO_T}no" >&6
14771 fi 12959 fi
14772 12960
14773
14774# look for field 'ut_addr_v6' in header 'utmpx.h' 12961# look for field 'ut_addr_v6' in header 'utmpx.h'
14775 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 12962 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14776 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6 12963 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_addr_v6
14777 echo "$as_me:$LINENO: checking for ut_addr_v6 field in utmpx.h" >&5 12964 echo "$as_me:12964: checking for ut_addr_v6 field in utmpx.h" >&5
14778echo $ECHO_N "checking for ut_addr_v6 field in utmpx.h... $ECHO_C" >&6 12965echo $ECHO_N "checking for ut_addr_v6 field in utmpx.h... $ECHO_C" >&6
14779 if eval "test \"\${$ossh_varname+set}\" = set"; then 12966 if eval "test \"\${$ossh_varname+set}\" = set"; then
14780 echo $ECHO_N "(cached) $ECHO_C" >&6 12967 echo $ECHO_N "(cached) $ECHO_C" >&6
14781else 12968else
14782 12969
14783 cat >conftest.$ac_ext <<_ACEOF 12970 cat >conftest.$ac_ext <<_ACEOF
14784#line $LINENO "configure" 12971#line 12971 "configure"
14785/* confdefs.h. */ 12972#include "confdefs.h"
14786_ACEOF
14787cat confdefs.h >>conftest.$ac_ext
14788cat >>conftest.$ac_ext <<_ACEOF
14789/* end confdefs.h. */
14790#include <utmpx.h> 12973#include <utmpx.h>
14791 12974
14792_ACEOF 12975_ACEOF
14793if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 12976if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14794 $EGREP "ut_addr_v6" >/dev/null 2>&1; then 12977 egrep "ut_addr_v6" >/dev/null 2>&1; then
14795 eval "$ossh_varname=yes" 12978 eval "$ossh_varname=yes"
14796else 12979else
14797 eval "$ossh_varname=no" 12980 eval "$ossh_varname=no"
@@ -14802,41 +12985,36 @@ fi
14802 12985
14803 ossh_result=`eval 'echo $'"$ossh_varname"` 12986 ossh_result=`eval 'echo $'"$ossh_varname"`
14804 if test -n "`echo $ossh_varname`"; then 12987 if test -n "`echo $ossh_varname`"; then
14805 echo "$as_me:$LINENO: result: $ossh_result" >&5 12988 echo "$as_me:12988: result: $ossh_result" >&5
14806echo "${ECHO_T}$ossh_result" >&6 12989echo "${ECHO_T}$ossh_result" >&6
14807 if test "x$ossh_result" = "xyes"; then 12990 if test "x$ossh_result" = "xyes"; then
14808 cat >>confdefs.h <<\_ACEOF 12991 cat >>confdefs.h <<\EOF
14809#define HAVE_ADDR_V6_IN_UTMPX 1 12992#define HAVE_ADDR_V6_IN_UTMPX 1
14810_ACEOF 12993EOF
14811 12994
14812 fi 12995 fi
14813 else 12996 else
14814 echo "$as_me:$LINENO: result: no" >&5 12997 echo "$as_me:12997: result: no" >&5
14815echo "${ECHO_T}no" >&6 12998echo "${ECHO_T}no" >&6
14816 fi 12999 fi
14817 13000
14818
14819# look for field 'ut_exit' in header 'utmp.h' 13001# look for field 'ut_exit' in header 'utmp.h'
14820 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 13002 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14821 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_exit 13003 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_exit
14822 echo "$as_me:$LINENO: checking for ut_exit field in utmp.h" >&5 13004 echo "$as_me:13004: checking for ut_exit field in utmp.h" >&5
14823echo $ECHO_N "checking for ut_exit field in utmp.h... $ECHO_C" >&6 13005echo $ECHO_N "checking for ut_exit field in utmp.h... $ECHO_C" >&6
14824 if eval "test \"\${$ossh_varname+set}\" = set"; then 13006 if eval "test \"\${$ossh_varname+set}\" = set"; then
14825 echo $ECHO_N "(cached) $ECHO_C" >&6 13007 echo $ECHO_N "(cached) $ECHO_C" >&6
14826else 13008else
14827 13009
14828 cat >conftest.$ac_ext <<_ACEOF 13010 cat >conftest.$ac_ext <<_ACEOF
14829#line $LINENO "configure" 13011#line 13011 "configure"
14830/* confdefs.h. */ 13012#include "confdefs.h"
14831_ACEOF
14832cat confdefs.h >>conftest.$ac_ext
14833cat >>conftest.$ac_ext <<_ACEOF
14834/* end confdefs.h. */
14835#include <utmp.h> 13013#include <utmp.h>
14836 13014
14837_ACEOF 13015_ACEOF
14838if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 13016if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14839 $EGREP "ut_exit" >/dev/null 2>&1; then 13017 egrep "ut_exit" >/dev/null 2>&1; then
14840 eval "$ossh_varname=yes" 13018 eval "$ossh_varname=yes"
14841else 13019else
14842 eval "$ossh_varname=no" 13020 eval "$ossh_varname=no"
@@ -14847,41 +13025,36 @@ fi
14847 13025
14848 ossh_result=`eval 'echo $'"$ossh_varname"` 13026 ossh_result=`eval 'echo $'"$ossh_varname"`
14849 if test -n "`echo $ossh_varname`"; then 13027 if test -n "`echo $ossh_varname`"; then
14850 echo "$as_me:$LINENO: result: $ossh_result" >&5 13028 echo "$as_me:13028: result: $ossh_result" >&5
14851echo "${ECHO_T}$ossh_result" >&6 13029echo "${ECHO_T}$ossh_result" >&6
14852 if test "x$ossh_result" = "xyes"; then 13030 if test "x$ossh_result" = "xyes"; then
14853 cat >>confdefs.h <<\_ACEOF 13031 cat >>confdefs.h <<\EOF
14854#define HAVE_EXIT_IN_UTMP 1 13032#define HAVE_EXIT_IN_UTMP 1
14855_ACEOF 13033EOF
14856 13034
14857 fi 13035 fi
14858 else 13036 else
14859 echo "$as_me:$LINENO: result: no" >&5 13037 echo "$as_me:13037: result: no" >&5
14860echo "${ECHO_T}no" >&6 13038echo "${ECHO_T}no" >&6
14861 fi 13039 fi
14862 13040
14863
14864# look for field 'ut_time' in header 'utmp.h' 13041# look for field 'ut_time' in header 'utmp.h'
14865 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'` 13042 ossh_safe=`echo "utmp.h" | sed 'y%./+-%__p_%'`
14866 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time 13043 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
14867 echo "$as_me:$LINENO: checking for ut_time field in utmp.h" >&5 13044 echo "$as_me:13044: checking for ut_time field in utmp.h" >&5
14868echo $ECHO_N "checking for ut_time field in utmp.h... $ECHO_C" >&6 13045echo $ECHO_N "checking for ut_time field in utmp.h... $ECHO_C" >&6
14869 if eval "test \"\${$ossh_varname+set}\" = set"; then 13046 if eval "test \"\${$ossh_varname+set}\" = set"; then
14870 echo $ECHO_N "(cached) $ECHO_C" >&6 13047 echo $ECHO_N "(cached) $ECHO_C" >&6
14871else 13048else
14872 13049
14873 cat >conftest.$ac_ext <<_ACEOF 13050 cat >conftest.$ac_ext <<_ACEOF
14874#line $LINENO "configure" 13051#line 13051 "configure"
14875/* confdefs.h. */ 13052#include "confdefs.h"
14876_ACEOF
14877cat confdefs.h >>conftest.$ac_ext
14878cat >>conftest.$ac_ext <<_ACEOF
14879/* end confdefs.h. */
14880#include <utmp.h> 13053#include <utmp.h>
14881 13054
14882_ACEOF 13055_ACEOF
14883if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 13056if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14884 $EGREP "ut_time" >/dev/null 2>&1; then 13057 egrep "ut_time" >/dev/null 2>&1; then
14885 eval "$ossh_varname=yes" 13058 eval "$ossh_varname=yes"
14886else 13059else
14887 eval "$ossh_varname=no" 13060 eval "$ossh_varname=no"
@@ -14892,41 +13065,36 @@ fi
14892 13065
14893 ossh_result=`eval 'echo $'"$ossh_varname"` 13066 ossh_result=`eval 'echo $'"$ossh_varname"`
14894 if test -n "`echo $ossh_varname`"; then 13067 if test -n "`echo $ossh_varname`"; then
14895 echo "$as_me:$LINENO: result: $ossh_result" >&5 13068 echo "$as_me:13068: result: $ossh_result" >&5
14896echo "${ECHO_T}$ossh_result" >&6 13069echo "${ECHO_T}$ossh_result" >&6
14897 if test "x$ossh_result" = "xyes"; then 13070 if test "x$ossh_result" = "xyes"; then
14898 cat >>confdefs.h <<\_ACEOF 13071 cat >>confdefs.h <<\EOF
14899#define HAVE_TIME_IN_UTMP 1 13072#define HAVE_TIME_IN_UTMP 1
14900_ACEOF 13073EOF
14901 13074
14902 fi 13075 fi
14903 else 13076 else
14904 echo "$as_me:$LINENO: result: no" >&5 13077 echo "$as_me:13077: result: no" >&5
14905echo "${ECHO_T}no" >&6 13078echo "${ECHO_T}no" >&6
14906 fi 13079 fi
14907 13080
14908
14909# look for field 'ut_time' in header 'utmpx.h' 13081# look for field 'ut_time' in header 'utmpx.h'
14910 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 13082 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14911 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time 13083 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_time
14912 echo "$as_me:$LINENO: checking for ut_time field in utmpx.h" >&5 13084 echo "$as_me:13084: checking for ut_time field in utmpx.h" >&5
14913echo $ECHO_N "checking for ut_time field in utmpx.h... $ECHO_C" >&6 13085echo $ECHO_N "checking for ut_time field in utmpx.h... $ECHO_C" >&6
14914 if eval "test \"\${$ossh_varname+set}\" = set"; then 13086 if eval "test \"\${$ossh_varname+set}\" = set"; then
14915 echo $ECHO_N "(cached) $ECHO_C" >&6 13087 echo $ECHO_N "(cached) $ECHO_C" >&6
14916else 13088else
14917 13089
14918 cat >conftest.$ac_ext <<_ACEOF 13090 cat >conftest.$ac_ext <<_ACEOF
14919#line $LINENO "configure" 13091#line 13091 "configure"
14920/* confdefs.h. */ 13092#include "confdefs.h"
14921_ACEOF
14922cat confdefs.h >>conftest.$ac_ext
14923cat >>conftest.$ac_ext <<_ACEOF
14924/* end confdefs.h. */
14925#include <utmpx.h> 13093#include <utmpx.h>
14926 13094
14927_ACEOF 13095_ACEOF
14928if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 13096if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14929 $EGREP "ut_time" >/dev/null 2>&1; then 13097 egrep "ut_time" >/dev/null 2>&1; then
14930 eval "$ossh_varname=yes" 13098 eval "$ossh_varname=yes"
14931else 13099else
14932 eval "$ossh_varname=no" 13100 eval "$ossh_varname=no"
@@ -14937,41 +13105,36 @@ fi
14937 13105
14938 ossh_result=`eval 'echo $'"$ossh_varname"` 13106 ossh_result=`eval 'echo $'"$ossh_varname"`
14939 if test -n "`echo $ossh_varname`"; then 13107 if test -n "`echo $ossh_varname`"; then
14940 echo "$as_me:$LINENO: result: $ossh_result" >&5 13108 echo "$as_me:13108: result: $ossh_result" >&5
14941echo "${ECHO_T}$ossh_result" >&6 13109echo "${ECHO_T}$ossh_result" >&6
14942 if test "x$ossh_result" = "xyes"; then 13110 if test "x$ossh_result" = "xyes"; then
14943 cat >>confdefs.h <<\_ACEOF 13111 cat >>confdefs.h <<\EOF
14944#define HAVE_TIME_IN_UTMPX 1 13112#define HAVE_TIME_IN_UTMPX 1
14945_ACEOF 13113EOF
14946 13114
14947 fi 13115 fi
14948 else 13116 else
14949 echo "$as_me:$LINENO: result: no" >&5 13117 echo "$as_me:13117: result: no" >&5
14950echo "${ECHO_T}no" >&6 13118echo "${ECHO_T}no" >&6
14951 fi 13119 fi
14952 13120
14953
14954# look for field 'ut_tv' in header 'utmpx.h' 13121# look for field 'ut_tv' in header 'utmpx.h'
14955 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'` 13122 ossh_safe=`echo "utmpx.h" | sed 'y%./+-%__p_%'`
14956 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv 13123 ossh_varname="ossh_cv_$ossh_safe""_has_"ut_tv
14957 echo "$as_me:$LINENO: checking for ut_tv field in utmpx.h" >&5 13124 echo "$as_me:13124: checking for ut_tv field in utmpx.h" >&5
14958echo $ECHO_N "checking for ut_tv field in utmpx.h... $ECHO_C" >&6 13125echo $ECHO_N "checking for ut_tv field in utmpx.h... $ECHO_C" >&6
14959 if eval "test \"\${$ossh_varname+set}\" = set"; then 13126 if eval "test \"\${$ossh_varname+set}\" = set"; then
14960 echo $ECHO_N "(cached) $ECHO_C" >&6 13127 echo $ECHO_N "(cached) $ECHO_C" >&6
14961else 13128else
14962 13129
14963 cat >conftest.$ac_ext <<_ACEOF 13130 cat >conftest.$ac_ext <<_ACEOF
14964#line $LINENO "configure" 13131#line 13131 "configure"
14965/* confdefs.h. */ 13132#include "confdefs.h"
14966_ACEOF
14967cat confdefs.h >>conftest.$ac_ext
14968cat >>conftest.$ac_ext <<_ACEOF
14969/* end confdefs.h. */
14970#include <utmpx.h> 13133#include <utmpx.h>
14971 13134
14972_ACEOF 13135_ACEOF
14973if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | 13136if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
14974 $EGREP "ut_tv" >/dev/null 2>&1; then 13137 egrep "ut_tv" >/dev/null 2>&1; then
14975 eval "$ossh_varname=yes" 13138 eval "$ossh_varname=yes"
14976else 13139else
14977 eval "$ossh_varname=no" 13140 eval "$ossh_varname=no"
@@ -14982,32 +13145,27 @@ fi
14982 13145
14983 ossh_result=`eval 'echo $'"$ossh_varname"` 13146 ossh_result=`eval 'echo $'"$ossh_varname"`
14984 if test -n "`echo $ossh_varname`"; then 13147 if test -n "`echo $ossh_varname`"; then
14985 echo "$as_me:$LINENO: result: $ossh_result" >&5 13148 echo "$as_me:13148: result: $ossh_result" >&5
14986echo "${ECHO_T}$ossh_result" >&6 13149echo "${ECHO_T}$ossh_result" >&6
14987 if test "x$ossh_result" = "xyes"; then 13150 if test "x$ossh_result" = "xyes"; then
14988 cat >>confdefs.h <<\_ACEOF 13151 cat >>confdefs.h <<\EOF
14989#define HAVE_TV_IN_UTMPX 1 13152#define HAVE_TV_IN_UTMPX 1
14990_ACEOF 13153EOF
14991 13154
14992 fi 13155 fi
14993 else 13156 else
14994 echo "$as_me:$LINENO: result: no" >&5 13157 echo "$as_me:13157: result: no" >&5
14995echo "${ECHO_T}no" >&6 13158echo "${ECHO_T}no" >&6
14996 fi 13159 fi
14997 13160
14998 13161echo "$as_me:13161: checking for struct stat.st_blksize" >&5
14999echo "$as_me:$LINENO: checking for struct stat.st_blksize" >&5
15000echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6 13162echo $ECHO_N "checking for struct stat.st_blksize... $ECHO_C" >&6
15001if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then 13163if test "${ac_cv_member_struct_stat_st_blksize+set}" = set; then
15002 echo $ECHO_N "(cached) $ECHO_C" >&6 13164 echo $ECHO_N "(cached) $ECHO_C" >&6
15003else 13165else
15004 cat >conftest.$ac_ext <<_ACEOF 13166 cat >conftest.$ac_ext <<_ACEOF
15005#line $LINENO "configure" 13167#line 13167 "configure"
15006/* confdefs.h. */ 13168#include "confdefs.h"
15007_ACEOF
15008cat confdefs.h >>conftest.$ac_ext
15009cat >>conftest.$ac_ext <<_ACEOF
15010/* end confdefs.h. */
15011$ac_includes_default 13169$ac_includes_default
15012int 13170int
15013main () 13171main ()
@@ -15020,88 +13178,44 @@ return 0;
15020} 13178}
15021_ACEOF 13179_ACEOF
15022rm -f conftest.$ac_objext 13180rm -f conftest.$ac_objext
15023if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13181if { (eval echo "$as_me:13181: \"$ac_compile\"") >&5
15024 (eval $ac_compile) 2>&5
15025 ac_status=$?
15026 echo "$as_me:$LINENO: \$? = $ac_status" >&5
15027 (exit $ac_status); } &&
15028 { ac_try='test -s conftest.$ac_objext'
15029 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
15030 (eval $ac_try) 2>&5
15031 ac_status=$?
15032 echo "$as_me:$LINENO: \$? = $ac_status" >&5
15033 (exit $ac_status); }; }; then
15034 ac_cv_member_struct_stat_st_blksize=yes
15035else
15036 echo "$as_me: failed program was:" >&5
15037sed 's/^/| /' conftest.$ac_ext >&5
15038
15039cat >conftest.$ac_ext <<_ACEOF
15040#line $LINENO "configure"
15041/* confdefs.h. */
15042_ACEOF
15043cat confdefs.h >>conftest.$ac_ext
15044cat >>conftest.$ac_ext <<_ACEOF
15045/* end confdefs.h. */
15046$ac_includes_default
15047int
15048main ()
15049{
15050static struct stat ac_aggr;
15051if (sizeof ac_aggr.st_blksize)
15052return 0;
15053 ;
15054 return 0;
15055}
15056_ACEOF
15057rm -f conftest.$ac_objext
15058if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
15059 (eval $ac_compile) 2>&5 13182 (eval $ac_compile) 2>&5
15060 ac_status=$? 13183 ac_status=$?
15061 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13184 echo "$as_me:13184: \$? = $ac_status" >&5
15062 (exit $ac_status); } && 13185 (exit $ac_status); } &&
15063 { ac_try='test -s conftest.$ac_objext' 13186 { ac_try='test -s conftest.$ac_objext'
15064 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13187 { (eval echo "$as_me:13187: \"$ac_try\"") >&5
15065 (eval $ac_try) 2>&5 13188 (eval $ac_try) 2>&5
15066 ac_status=$? 13189 ac_status=$?
15067 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13190 echo "$as_me:13190: \$? = $ac_status" >&5
15068 (exit $ac_status); }; }; then 13191 (exit $ac_status); }; }; then
15069 ac_cv_member_struct_stat_st_blksize=yes 13192 ac_cv_member_struct_stat_st_blksize=yes
15070else 13193else
15071 echo "$as_me: failed program was:" >&5 13194 echo "$as_me: failed program was:" >&5
15072sed 's/^/| /' conftest.$ac_ext >&5 13195cat conftest.$ac_ext >&5
15073
15074ac_cv_member_struct_stat_st_blksize=no 13196ac_cv_member_struct_stat_st_blksize=no
15075fi 13197fi
15076rm -f conftest.$ac_objext conftest.$ac_ext 13198rm -f conftest.$ac_objext conftest.$ac_ext
15077fi 13199fi
15078rm -f conftest.$ac_objext conftest.$ac_ext 13200echo "$as_me:13200: result: $ac_cv_member_struct_stat_st_blksize" >&5
15079fi
15080echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_blksize" >&5
15081echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6 13201echo "${ECHO_T}$ac_cv_member_struct_stat_st_blksize" >&6
15082if test $ac_cv_member_struct_stat_st_blksize = yes; then 13202if test $ac_cv_member_struct_stat_st_blksize = yes; then
15083 13203
15084cat >>confdefs.h <<_ACEOF 13204cat >>confdefs.h <<EOF
15085#define HAVE_STRUCT_STAT_ST_BLKSIZE 1 13205#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
15086_ACEOF 13206EOF
15087
15088 13207
15089fi 13208fi
15090 13209
15091 13210echo "$as_me:13210: checking for ss_family field in struct sockaddr_storage" >&5
15092echo "$as_me:$LINENO: checking for ss_family field in struct sockaddr_storage" >&5
15093echo $ECHO_N "checking for ss_family field in struct sockaddr_storage... $ECHO_C" >&6 13211echo $ECHO_N "checking for ss_family field in struct sockaddr_storage... $ECHO_C" >&6
15094if test "${ac_cv_have_ss_family_in_struct_ss+set}" = set; then 13212if test "${ac_cv_have_ss_family_in_struct_ss+set}" = set; then
15095 echo $ECHO_N "(cached) $ECHO_C" >&6 13213 echo $ECHO_N "(cached) $ECHO_C" >&6
15096else 13214else
15097 13215
15098 cat >conftest.$ac_ext <<_ACEOF 13216 cat >conftest.$ac_ext <<_ACEOF
15099#line $LINENO "configure" 13217#line 13217 "configure"
15100/* confdefs.h. */ 13218#include "confdefs.h"
15101_ACEOF
15102cat confdefs.h >>conftest.$ac_ext
15103cat >>conftest.$ac_ext <<_ACEOF
15104/* end confdefs.h. */
15105 13219
15106#include <sys/types.h> 13220#include <sys/types.h>
15107#include <sys/socket.h> 13221#include <sys/socket.h>
@@ -15115,49 +13229,44 @@ main ()
15115} 13229}
15116_ACEOF 13230_ACEOF
15117rm -f conftest.$ac_objext 13231rm -f conftest.$ac_objext
15118if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13232if { (eval echo "$as_me:13232: \"$ac_compile\"") >&5
15119 (eval $ac_compile) 2>&5 13233 (eval $ac_compile) 2>&5
15120 ac_status=$? 13234 ac_status=$?
15121 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13235 echo "$as_me:13235: \$? = $ac_status" >&5
15122 (exit $ac_status); } && 13236 (exit $ac_status); } &&
15123 { ac_try='test -s conftest.$ac_objext' 13237 { ac_try='test -s conftest.$ac_objext'
15124 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13238 { (eval echo "$as_me:13238: \"$ac_try\"") >&5
15125 (eval $ac_try) 2>&5 13239 (eval $ac_try) 2>&5
15126 ac_status=$? 13240 ac_status=$?
15127 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13241 echo "$as_me:13241: \$? = $ac_status" >&5
15128 (exit $ac_status); }; }; then 13242 (exit $ac_status); }; }; then
15129 ac_cv_have_ss_family_in_struct_ss="yes" 13243 ac_cv_have_ss_family_in_struct_ss="yes"
15130else 13244else
15131 echo "$as_me: failed program was:" >&5 13245 echo "$as_me: failed program was:" >&5
15132sed 's/^/| /' conftest.$ac_ext >&5 13246cat conftest.$ac_ext >&5
15133
15134 ac_cv_have_ss_family_in_struct_ss="no" 13247 ac_cv_have_ss_family_in_struct_ss="no"
15135fi 13248fi
15136rm -f conftest.$ac_objext conftest.$ac_ext 13249rm -f conftest.$ac_objext conftest.$ac_ext
15137 13250
15138fi 13251fi
15139echo "$as_me:$LINENO: result: $ac_cv_have_ss_family_in_struct_ss" >&5 13252echo "$as_me:13252: result: $ac_cv_have_ss_family_in_struct_ss" >&5
15140echo "${ECHO_T}$ac_cv_have_ss_family_in_struct_ss" >&6 13253echo "${ECHO_T}$ac_cv_have_ss_family_in_struct_ss" >&6
15141if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then 13254if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
15142 cat >>confdefs.h <<\_ACEOF 13255 cat >>confdefs.h <<\EOF
15143#define HAVE_SS_FAMILY_IN_SS 1 13256#define HAVE_SS_FAMILY_IN_SS 1
15144_ACEOF 13257EOF
15145 13258
15146fi 13259fi
15147 13260
15148echo "$as_me:$LINENO: checking for __ss_family field in struct sockaddr_storage" >&5 13261echo "$as_me:13261: checking for __ss_family field in struct sockaddr_storage" >&5
15149echo $ECHO_N "checking for __ss_family field in struct sockaddr_storage... $ECHO_C" >&6 13262echo $ECHO_N "checking for __ss_family field in struct sockaddr_storage... $ECHO_C" >&6
15150if test "${ac_cv_have___ss_family_in_struct_ss+set}" = set; then 13263if test "${ac_cv_have___ss_family_in_struct_ss+set}" = set; then
15151 echo $ECHO_N "(cached) $ECHO_C" >&6 13264 echo $ECHO_N "(cached) $ECHO_C" >&6
15152else 13265else
15153 13266
15154 cat >conftest.$ac_ext <<_ACEOF 13267 cat >conftest.$ac_ext <<_ACEOF
15155#line $LINENO "configure" 13268#line 13268 "configure"
15156/* confdefs.h. */ 13269#include "confdefs.h"
15157_ACEOF
15158cat confdefs.h >>conftest.$ac_ext
15159cat >>conftest.$ac_ext <<_ACEOF
15160/* end confdefs.h. */
15161 13270
15162#include <sys/types.h> 13271#include <sys/types.h>
15163#include <sys/socket.h> 13272#include <sys/socket.h>
@@ -15171,50 +13280,45 @@ main ()
15171} 13280}
15172_ACEOF 13281_ACEOF
15173rm -f conftest.$ac_objext 13282rm -f conftest.$ac_objext
15174if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13283if { (eval echo "$as_me:13283: \"$ac_compile\"") >&5
15175 (eval $ac_compile) 2>&5 13284 (eval $ac_compile) 2>&5
15176 ac_status=$? 13285 ac_status=$?
15177 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13286 echo "$as_me:13286: \$? = $ac_status" >&5
15178 (exit $ac_status); } && 13287 (exit $ac_status); } &&
15179 { ac_try='test -s conftest.$ac_objext' 13288 { ac_try='test -s conftest.$ac_objext'
15180 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13289 { (eval echo "$as_me:13289: \"$ac_try\"") >&5
15181 (eval $ac_try) 2>&5 13290 (eval $ac_try) 2>&5
15182 ac_status=$? 13291 ac_status=$?
15183 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13292 echo "$as_me:13292: \$? = $ac_status" >&5
15184 (exit $ac_status); }; }; then 13293 (exit $ac_status); }; }; then
15185 ac_cv_have___ss_family_in_struct_ss="yes" 13294 ac_cv_have___ss_family_in_struct_ss="yes"
15186else 13295else
15187 echo "$as_me: failed program was:" >&5 13296 echo "$as_me: failed program was:" >&5
15188sed 's/^/| /' conftest.$ac_ext >&5 13297cat conftest.$ac_ext >&5
15189
15190 ac_cv_have___ss_family_in_struct_ss="no" 13298 ac_cv_have___ss_family_in_struct_ss="no"
15191 13299
15192fi 13300fi
15193rm -f conftest.$ac_objext conftest.$ac_ext 13301rm -f conftest.$ac_objext conftest.$ac_ext
15194 13302
15195fi 13303fi
15196echo "$as_me:$LINENO: result: $ac_cv_have___ss_family_in_struct_ss" >&5 13304echo "$as_me:13304: result: $ac_cv_have___ss_family_in_struct_ss" >&5
15197echo "${ECHO_T}$ac_cv_have___ss_family_in_struct_ss" >&6 13305echo "${ECHO_T}$ac_cv_have___ss_family_in_struct_ss" >&6
15198if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then 13306if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
15199 cat >>confdefs.h <<\_ACEOF 13307 cat >>confdefs.h <<\EOF
15200#define HAVE___SS_FAMILY_IN_SS 1 13308#define HAVE___SS_FAMILY_IN_SS 1
15201_ACEOF 13309EOF
15202 13310
15203fi 13311fi
15204 13312
15205echo "$as_me:$LINENO: checking for pw_class field in struct passwd" >&5 13313echo "$as_me:13313: checking for pw_class field in struct passwd" >&5
15206echo $ECHO_N "checking for pw_class field in struct passwd... $ECHO_C" >&6 13314echo $ECHO_N "checking for pw_class field in struct passwd... $ECHO_C" >&6
15207if test "${ac_cv_have_pw_class_in_struct_passwd+set}" = set; then 13315if test "${ac_cv_have_pw_class_in_struct_passwd+set}" = set; then
15208 echo $ECHO_N "(cached) $ECHO_C" >&6 13316 echo $ECHO_N "(cached) $ECHO_C" >&6
15209else 13317else
15210 13318
15211 cat >conftest.$ac_ext <<_ACEOF 13319 cat >conftest.$ac_ext <<_ACEOF
15212#line $LINENO "configure" 13320#line 13320 "configure"
15213/* confdefs.h. */ 13321#include "confdefs.h"
15214_ACEOF
15215cat confdefs.h >>conftest.$ac_ext
15216cat >>conftest.$ac_ext <<_ACEOF
15217/* end confdefs.h. */
15218 13322
15219#include <pwd.h> 13323#include <pwd.h>
15220 13324
@@ -15227,50 +13331,45 @@ main ()
15227} 13331}
15228_ACEOF 13332_ACEOF
15229rm -f conftest.$ac_objext 13333rm -f conftest.$ac_objext
15230if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13334if { (eval echo "$as_me:13334: \"$ac_compile\"") >&5
15231 (eval $ac_compile) 2>&5 13335 (eval $ac_compile) 2>&5
15232 ac_status=$? 13336 ac_status=$?
15233 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13337 echo "$as_me:13337: \$? = $ac_status" >&5
15234 (exit $ac_status); } && 13338 (exit $ac_status); } &&
15235 { ac_try='test -s conftest.$ac_objext' 13339 { ac_try='test -s conftest.$ac_objext'
15236 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13340 { (eval echo "$as_me:13340: \"$ac_try\"") >&5
15237 (eval $ac_try) 2>&5 13341 (eval $ac_try) 2>&5
15238 ac_status=$? 13342 ac_status=$?
15239 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13343 echo "$as_me:13343: \$? = $ac_status" >&5
15240 (exit $ac_status); }; }; then 13344 (exit $ac_status); }; }; then
15241 ac_cv_have_pw_class_in_struct_passwd="yes" 13345 ac_cv_have_pw_class_in_struct_passwd="yes"
15242else 13346else
15243 echo "$as_me: failed program was:" >&5 13347 echo "$as_me: failed program was:" >&5
15244sed 's/^/| /' conftest.$ac_ext >&5 13348cat conftest.$ac_ext >&5
15245
15246 ac_cv_have_pw_class_in_struct_passwd="no" 13349 ac_cv_have_pw_class_in_struct_passwd="no"
15247 13350
15248fi 13351fi
15249rm -f conftest.$ac_objext conftest.$ac_ext 13352rm -f conftest.$ac_objext conftest.$ac_ext
15250 13353
15251fi 13354fi
15252echo "$as_me:$LINENO: result: $ac_cv_have_pw_class_in_struct_passwd" >&5 13355echo "$as_me:13355: result: $ac_cv_have_pw_class_in_struct_passwd" >&5
15253echo "${ECHO_T}$ac_cv_have_pw_class_in_struct_passwd" >&6 13356echo "${ECHO_T}$ac_cv_have_pw_class_in_struct_passwd" >&6
15254if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then 13357if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
15255 cat >>confdefs.h <<\_ACEOF 13358 cat >>confdefs.h <<\EOF
15256#define HAVE_PW_CLASS_IN_PASSWD 1 13359#define HAVE_PW_CLASS_IN_PASSWD 1
15257_ACEOF 13360EOF
15258 13361
15259fi 13362fi
15260 13363
15261echo "$as_me:$LINENO: checking for pw_expire field in struct passwd" >&5 13364echo "$as_me:13364: checking for pw_expire field in struct passwd" >&5
15262echo $ECHO_N "checking for pw_expire field in struct passwd... $ECHO_C" >&6 13365echo $ECHO_N "checking for pw_expire field in struct passwd... $ECHO_C" >&6
15263if test "${ac_cv_have_pw_expire_in_struct_passwd+set}" = set; then 13366if test "${ac_cv_have_pw_expire_in_struct_passwd+set}" = set; then
15264 echo $ECHO_N "(cached) $ECHO_C" >&6 13367 echo $ECHO_N "(cached) $ECHO_C" >&6
15265else 13368else
15266 13369
15267 cat >conftest.$ac_ext <<_ACEOF 13370 cat >conftest.$ac_ext <<_ACEOF
15268#line $LINENO "configure" 13371#line 13371 "configure"
15269/* confdefs.h. */ 13372#include "confdefs.h"
15270_ACEOF
15271cat confdefs.h >>conftest.$ac_ext
15272cat >>conftest.$ac_ext <<_ACEOF
15273/* end confdefs.h. */
15274 13373
15275#include <pwd.h> 13374#include <pwd.h>
15276 13375
@@ -15283,50 +13382,45 @@ main ()
15283} 13382}
15284_ACEOF 13383_ACEOF
15285rm -f conftest.$ac_objext 13384rm -f conftest.$ac_objext
15286if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13385if { (eval echo "$as_me:13385: \"$ac_compile\"") >&5
15287 (eval $ac_compile) 2>&5 13386 (eval $ac_compile) 2>&5
15288 ac_status=$? 13387 ac_status=$?
15289 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13388 echo "$as_me:13388: \$? = $ac_status" >&5
15290 (exit $ac_status); } && 13389 (exit $ac_status); } &&
15291 { ac_try='test -s conftest.$ac_objext' 13390 { ac_try='test -s conftest.$ac_objext'
15292 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13391 { (eval echo "$as_me:13391: \"$ac_try\"") >&5
15293 (eval $ac_try) 2>&5 13392 (eval $ac_try) 2>&5
15294 ac_status=$? 13393 ac_status=$?
15295 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13394 echo "$as_me:13394: \$? = $ac_status" >&5
15296 (exit $ac_status); }; }; then 13395 (exit $ac_status); }; }; then
15297 ac_cv_have_pw_expire_in_struct_passwd="yes" 13396 ac_cv_have_pw_expire_in_struct_passwd="yes"
15298else 13397else
15299 echo "$as_me: failed program was:" >&5 13398 echo "$as_me: failed program was:" >&5
15300sed 's/^/| /' conftest.$ac_ext >&5 13399cat conftest.$ac_ext >&5
15301
15302 ac_cv_have_pw_expire_in_struct_passwd="no" 13400 ac_cv_have_pw_expire_in_struct_passwd="no"
15303 13401
15304fi 13402fi
15305rm -f conftest.$ac_objext conftest.$ac_ext 13403rm -f conftest.$ac_objext conftest.$ac_ext
15306 13404
15307fi 13405fi
15308echo "$as_me:$LINENO: result: $ac_cv_have_pw_expire_in_struct_passwd" >&5 13406echo "$as_me:13406: result: $ac_cv_have_pw_expire_in_struct_passwd" >&5
15309echo "${ECHO_T}$ac_cv_have_pw_expire_in_struct_passwd" >&6 13407echo "${ECHO_T}$ac_cv_have_pw_expire_in_struct_passwd" >&6
15310if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then 13408if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
15311 cat >>confdefs.h <<\_ACEOF 13409 cat >>confdefs.h <<\EOF
15312#define HAVE_PW_EXPIRE_IN_PASSWD 1 13410#define HAVE_PW_EXPIRE_IN_PASSWD 1
15313_ACEOF 13411EOF
15314 13412
15315fi 13413fi
15316 13414
15317echo "$as_me:$LINENO: checking for pw_change field in struct passwd" >&5 13415echo "$as_me:13415: checking for pw_change field in struct passwd" >&5
15318echo $ECHO_N "checking for pw_change field in struct passwd... $ECHO_C" >&6 13416echo $ECHO_N "checking for pw_change field in struct passwd... $ECHO_C" >&6
15319if test "${ac_cv_have_pw_change_in_struct_passwd+set}" = set; then 13417if test "${ac_cv_have_pw_change_in_struct_passwd+set}" = set; then
15320 echo $ECHO_N "(cached) $ECHO_C" >&6 13418 echo $ECHO_N "(cached) $ECHO_C" >&6
15321else 13419else
15322 13420
15323 cat >conftest.$ac_ext <<_ACEOF 13421 cat >conftest.$ac_ext <<_ACEOF
15324#line $LINENO "configure" 13422#line 13422 "configure"
15325/* confdefs.h. */ 13423#include "confdefs.h"
15326_ACEOF
15327cat confdefs.h >>conftest.$ac_ext
15328cat >>conftest.$ac_ext <<_ACEOF
15329/* end confdefs.h. */
15330 13424
15331#include <pwd.h> 13425#include <pwd.h>
15332 13426
@@ -15339,57 +13433,50 @@ main ()
15339} 13433}
15340_ACEOF 13434_ACEOF
15341rm -f conftest.$ac_objext 13435rm -f conftest.$ac_objext
15342if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 13436if { (eval echo "$as_me:13436: \"$ac_compile\"") >&5
15343 (eval $ac_compile) 2>&5 13437 (eval $ac_compile) 2>&5
15344 ac_status=$? 13438 ac_status=$?
15345 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13439 echo "$as_me:13439: \$? = $ac_status" >&5
15346 (exit $ac_status); } && 13440 (exit $ac_status); } &&
15347 { ac_try='test -s conftest.$ac_objext' 13441 { ac_try='test -s conftest.$ac_objext'
15348 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13442 { (eval echo "$as_me:13442: \"$ac_try\"") >&5
15349 (eval $ac_try) 2>&5 13443 (eval $ac_try) 2>&5
15350 ac_status=$? 13444 ac_status=$?
15351 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13445 echo "$as_me:13445: \$? = $ac_status" >&5
15352 (exit $ac_status); }; }; then 13446 (exit $ac_status); }; }; then
15353 ac_cv_have_pw_change_in_struct_passwd="yes" 13447 ac_cv_have_pw_change_in_struct_passwd="yes"
15354else 13448else
15355 echo "$as_me: failed program was:" >&5 13449 echo "$as_me: failed program was:" >&5
15356sed 's/^/| /' conftest.$ac_ext >&5 13450cat conftest.$ac_ext >&5
15357
15358 ac_cv_have_pw_change_in_struct_passwd="no" 13451 ac_cv_have_pw_change_in_struct_passwd="no"
15359 13452
15360fi 13453fi
15361rm -f conftest.$ac_objext conftest.$ac_ext 13454rm -f conftest.$ac_objext conftest.$ac_ext
15362 13455
15363fi 13456fi
15364echo "$as_me:$LINENO: result: $ac_cv_have_pw_change_in_struct_passwd" >&5 13457echo "$as_me:13457: result: $ac_cv_have_pw_change_in_struct_passwd" >&5
15365echo "${ECHO_T}$ac_cv_have_pw_change_in_struct_passwd" >&6 13458echo "${ECHO_T}$ac_cv_have_pw_change_in_struct_passwd" >&6
15366if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then 13459if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
15367 cat >>confdefs.h <<\_ACEOF 13460 cat >>confdefs.h <<\EOF
15368#define HAVE_PW_CHANGE_IN_PASSWD 1 13461#define HAVE_PW_CHANGE_IN_PASSWD 1
15369_ACEOF 13462EOF
15370 13463
15371fi 13464fi
15372 13465
15373echo "$as_me:$LINENO: checking for msg_accrights field in struct msghdr" >&5 13466echo "$as_me:13466: checking for msg_accrights field in struct msghdr" >&5
15374echo $ECHO_N "checking for msg_accrights field in struct msghdr... $ECHO_C" >&6 13467echo $ECHO_N "checking for msg_accrights field in struct msghdr... $ECHO_C" >&6
15375if test "${ac_cv_have_accrights_in_msghdr+set}" = set; then 13468if test "${ac_cv_have_accrights_in_msghdr+set}" = set; then
15376 echo $ECHO_N "(cached) $ECHO_C" >&6 13469 echo $ECHO_N "(cached) $ECHO_C" >&6
15377else 13470else
15378 13471
15379 if test "$cross_compiling" = yes; then 13472 if test "$cross_compiling" = yes; then
15380 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 13473 { { echo "$as_me:13473: error: cannot run test program while cross compiling" >&5
15381See \`config.log' for more details." >&5 13474echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15382echo "$as_me: error: cannot run test program while cross compiling
15383See \`config.log' for more details." >&2;}
15384 { (exit 1); exit 1; }; } 13475 { (exit 1); exit 1; }; }
15385else 13476else
15386 cat >conftest.$ac_ext <<_ACEOF 13477 cat >conftest.$ac_ext <<_ACEOF
15387#line $LINENO "configure" 13478#line 13478 "configure"
15388/* confdefs.h. */ 13479#include "confdefs.h"
15389_ACEOF
15390cat confdefs.h >>conftest.$ac_ext
15391cat >>conftest.$ac_ext <<_ACEOF
15392/* end confdefs.h. */
15393 13480
15394#include <sys/types.h> 13481#include <sys/types.h>
15395#include <sys/socket.h> 13482#include <sys/socket.h>
@@ -15405,59 +13492,51 @@ exit(0);
15405 13492
15406_ACEOF 13493_ACEOF
15407rm -f conftest$ac_exeext 13494rm -f conftest$ac_exeext
15408if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13495if { (eval echo "$as_me:13495: \"$ac_link\"") >&5
15409 (eval $ac_link) 2>&5 13496 (eval $ac_link) 2>&5
15410 ac_status=$? 13497 ac_status=$?
15411 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13498 echo "$as_me:13498: \$? = $ac_status" >&5
15412 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 13499 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15413 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13500 { (eval echo "$as_me:13500: \"$ac_try\"") >&5
15414 (eval $ac_try) 2>&5 13501 (eval $ac_try) 2>&5
15415 ac_status=$? 13502 ac_status=$?
15416 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13503 echo "$as_me:13503: \$? = $ac_status" >&5
15417 (exit $ac_status); }; }; then 13504 (exit $ac_status); }; }; then
15418 ac_cv_have_accrights_in_msghdr="yes" 13505 ac_cv_have_accrights_in_msghdr="yes"
15419else 13506else
15420 echo "$as_me: program exited with status $ac_status" >&5 13507 echo "$as_me: program exited with status $ac_status" >&5
15421echo "$as_me: failed program was:" >&5 13508echo "$as_me: failed program was:" >&5
15422sed 's/^/| /' conftest.$ac_ext >&5 13509cat conftest.$ac_ext >&5
15423
15424( exit $ac_status )
15425 ac_cv_have_accrights_in_msghdr="no" 13510 ac_cv_have_accrights_in_msghdr="no"
15426 13511
15427fi 13512fi
15428rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 13513rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15429fi 13514fi
15430 13515
15431fi 13516fi
15432echo "$as_me:$LINENO: result: $ac_cv_have_accrights_in_msghdr" >&5 13517echo "$as_me:13517: result: $ac_cv_have_accrights_in_msghdr" >&5
15433echo "${ECHO_T}$ac_cv_have_accrights_in_msghdr" >&6 13518echo "${ECHO_T}$ac_cv_have_accrights_in_msghdr" >&6
15434if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then 13519if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
15435 cat >>confdefs.h <<\_ACEOF 13520 cat >>confdefs.h <<\EOF
15436#define HAVE_ACCRIGHTS_IN_MSGHDR 1 13521#define HAVE_ACCRIGHTS_IN_MSGHDR 1
15437_ACEOF 13522EOF
15438 13523
15439fi 13524fi
15440 13525
15441echo "$as_me:$LINENO: checking for msg_control field in struct msghdr" >&5 13526echo "$as_me:13526: checking for msg_control field in struct msghdr" >&5
15442echo $ECHO_N "checking for msg_control field in struct msghdr... $ECHO_C" >&6 13527echo $ECHO_N "checking for msg_control field in struct msghdr... $ECHO_C" >&6
15443if test "${ac_cv_have_control_in_msghdr+set}" = set; then 13528if test "${ac_cv_have_control_in_msghdr+set}" = set; then
15444 echo $ECHO_N "(cached) $ECHO_C" >&6 13529 echo $ECHO_N "(cached) $ECHO_C" >&6
15445else 13530else
15446 13531
15447 if test "$cross_compiling" = yes; then 13532 if test "$cross_compiling" = yes; then
15448 { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling 13533 { { echo "$as_me:13533: error: cannot run test program while cross compiling" >&5
15449See \`config.log' for more details." >&5 13534echo "$as_me: error: cannot run test program while cross compiling" >&2;}
15450echo "$as_me: error: cannot run test program while cross compiling
15451See \`config.log' for more details." >&2;}
15452 { (exit 1); exit 1; }; } 13535 { (exit 1); exit 1; }; }
15453else 13536else
15454 cat >conftest.$ac_ext <<_ACEOF 13537 cat >conftest.$ac_ext <<_ACEOF
15455#line $LINENO "configure" 13538#line 13538 "configure"
15456/* confdefs.h. */ 13539#include "confdefs.h"
15457_ACEOF
15458cat confdefs.h >>conftest.$ac_ext
15459cat >>conftest.$ac_ext <<_ACEOF
15460/* end confdefs.h. */
15461 13540
15462#include <sys/types.h> 13541#include <sys/types.h>
15463#include <sys/socket.h> 13542#include <sys/socket.h>
@@ -15473,52 +13552,46 @@ exit(0);
15473 13552
15474_ACEOF 13553_ACEOF
15475rm -f conftest$ac_exeext 13554rm -f conftest$ac_exeext
15476if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13555if { (eval echo "$as_me:13555: \"$ac_link\"") >&5
15477 (eval $ac_link) 2>&5 13556 (eval $ac_link) 2>&5
15478 ac_status=$? 13557 ac_status=$?
15479 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13558 echo "$as_me:13558: \$? = $ac_status" >&5
15480 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 13559 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15481 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13560 { (eval echo "$as_me:13560: \"$ac_try\"") >&5
15482 (eval $ac_try) 2>&5 13561 (eval $ac_try) 2>&5
15483 ac_status=$? 13562 ac_status=$?
15484 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13563 echo "$as_me:13563: \$? = $ac_status" >&5
15485 (exit $ac_status); }; }; then 13564 (exit $ac_status); }; }; then
15486 ac_cv_have_control_in_msghdr="yes" 13565 ac_cv_have_control_in_msghdr="yes"
15487else 13566else
15488 echo "$as_me: program exited with status $ac_status" >&5 13567 echo "$as_me: program exited with status $ac_status" >&5
15489echo "$as_me: failed program was:" >&5 13568echo "$as_me: failed program was:" >&5
15490sed 's/^/| /' conftest.$ac_ext >&5 13569cat conftest.$ac_ext >&5
15491
15492( exit $ac_status )
15493 ac_cv_have_control_in_msghdr="no" 13570 ac_cv_have_control_in_msghdr="no"
15494 13571
15495fi 13572fi
15496rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 13573rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15497fi 13574fi
15498 13575
15499fi 13576fi
15500echo "$as_me:$LINENO: result: $ac_cv_have_control_in_msghdr" >&5 13577echo "$as_me:13577: result: $ac_cv_have_control_in_msghdr" >&5
15501echo "${ECHO_T}$ac_cv_have_control_in_msghdr" >&6 13578echo "${ECHO_T}$ac_cv_have_control_in_msghdr" >&6
15502if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then 13579if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
15503 cat >>confdefs.h <<\_ACEOF 13580 cat >>confdefs.h <<\EOF
15504#define HAVE_CONTROL_IN_MSGHDR 1 13581#define HAVE_CONTROL_IN_MSGHDR 1
15505_ACEOF 13582EOF
15506 13583
15507fi 13584fi
15508 13585
15509echo "$as_me:$LINENO: checking if libc defines __progname" >&5 13586echo "$as_me:13586: checking if libc defines __progname" >&5
15510echo $ECHO_N "checking if libc defines __progname... $ECHO_C" >&6 13587echo $ECHO_N "checking if libc defines __progname... $ECHO_C" >&6
15511if test "${ac_cv_libc_defines___progname+set}" = set; then 13588if test "${ac_cv_libc_defines___progname+set}" = set; then
15512 echo $ECHO_N "(cached) $ECHO_C" >&6 13589 echo $ECHO_N "(cached) $ECHO_C" >&6
15513else 13590else
15514 13591
15515 cat >conftest.$ac_ext <<_ACEOF 13592 cat >conftest.$ac_ext <<_ACEOF
15516#line $LINENO "configure" 13593#line 13593 "configure"
15517/* confdefs.h. */ 13594#include "confdefs.h"
15518_ACEOF
15519cat confdefs.h >>conftest.$ac_ext
15520cat >>conftest.$ac_ext <<_ACEOF
15521/* end confdefs.h. */
15522 13595
15523int 13596int
15524main () 13597main ()
@@ -15529,50 +13602,45 @@ main ()
15529} 13602}
15530_ACEOF 13603_ACEOF
15531rm -f conftest.$ac_objext conftest$ac_exeext 13604rm -f conftest.$ac_objext conftest$ac_exeext
15532if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13605if { (eval echo "$as_me:13605: \"$ac_link\"") >&5
15533 (eval $ac_link) 2>&5 13606 (eval $ac_link) 2>&5
15534 ac_status=$? 13607 ac_status=$?
15535 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13608 echo "$as_me:13608: \$? = $ac_status" >&5
15536 (exit $ac_status); } && 13609 (exit $ac_status); } &&
15537 { ac_try='test -s conftest$ac_exeext' 13610 { ac_try='test -s conftest$ac_exeext'
15538 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13611 { (eval echo "$as_me:13611: \"$ac_try\"") >&5
15539 (eval $ac_try) 2>&5 13612 (eval $ac_try) 2>&5
15540 ac_status=$? 13613 ac_status=$?
15541 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13614 echo "$as_me:13614: \$? = $ac_status" >&5
15542 (exit $ac_status); }; }; then 13615 (exit $ac_status); }; }; then
15543 ac_cv_libc_defines___progname="yes" 13616 ac_cv_libc_defines___progname="yes"
15544else 13617else
15545 echo "$as_me: failed program was:" >&5 13618 echo "$as_me: failed program was:" >&5
15546sed 's/^/| /' conftest.$ac_ext >&5 13619cat conftest.$ac_ext >&5
15547
15548 ac_cv_libc_defines___progname="no" 13620 ac_cv_libc_defines___progname="no"
15549 13621
15550fi 13622fi
15551rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13623rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15552 13624
15553fi 13625fi
15554echo "$as_me:$LINENO: result: $ac_cv_libc_defines___progname" >&5 13626echo "$as_me:13626: result: $ac_cv_libc_defines___progname" >&5
15555echo "${ECHO_T}$ac_cv_libc_defines___progname" >&6 13627echo "${ECHO_T}$ac_cv_libc_defines___progname" >&6
15556if test "x$ac_cv_libc_defines___progname" = "xyes" ; then 13628if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
15557 cat >>confdefs.h <<\_ACEOF 13629 cat >>confdefs.h <<\EOF
15558#define HAVE___PROGNAME 1 13630#define HAVE___PROGNAME 1
15559_ACEOF 13631EOF
15560 13632
15561fi 13633fi
15562 13634
15563echo "$as_me:$LINENO: checking whether $CC implements __FUNCTION__" >&5 13635echo "$as_me:13635: checking whether $CC implements __FUNCTION__" >&5
15564echo $ECHO_N "checking whether $CC implements __FUNCTION__... $ECHO_C" >&6 13636echo $ECHO_N "checking whether $CC implements __FUNCTION__... $ECHO_C" >&6
15565if test "${ac_cv_cc_implements___FUNCTION__+set}" = set; then 13637if test "${ac_cv_cc_implements___FUNCTION__+set}" = set; then
15566 echo $ECHO_N "(cached) $ECHO_C" >&6 13638 echo $ECHO_N "(cached) $ECHO_C" >&6
15567else 13639else
15568 13640
15569 cat >conftest.$ac_ext <<_ACEOF 13641 cat >conftest.$ac_ext <<_ACEOF
15570#line $LINENO "configure" 13642#line 13642 "configure"
15571/* confdefs.h. */ 13643#include "confdefs.h"
15572_ACEOF
15573cat confdefs.h >>conftest.$ac_ext
15574cat >>conftest.$ac_ext <<_ACEOF
15575/* end confdefs.h. */
15576 13644
15577#include <stdio.h> 13645#include <stdio.h>
15578 13646
@@ -15585,50 +13653,45 @@ main ()
15585} 13653}
15586_ACEOF 13654_ACEOF
15587rm -f conftest.$ac_objext conftest$ac_exeext 13655rm -f conftest.$ac_objext conftest$ac_exeext
15588if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13656if { (eval echo "$as_me:13656: \"$ac_link\"") >&5
15589 (eval $ac_link) 2>&5 13657 (eval $ac_link) 2>&5
15590 ac_status=$? 13658 ac_status=$?
15591 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13659 echo "$as_me:13659: \$? = $ac_status" >&5
15592 (exit $ac_status); } && 13660 (exit $ac_status); } &&
15593 { ac_try='test -s conftest$ac_exeext' 13661 { ac_try='test -s conftest$ac_exeext'
15594 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13662 { (eval echo "$as_me:13662: \"$ac_try\"") >&5
15595 (eval $ac_try) 2>&5 13663 (eval $ac_try) 2>&5
15596 ac_status=$? 13664 ac_status=$?
15597 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13665 echo "$as_me:13665: \$? = $ac_status" >&5
15598 (exit $ac_status); }; }; then 13666 (exit $ac_status); }; }; then
15599 ac_cv_cc_implements___FUNCTION__="yes" 13667 ac_cv_cc_implements___FUNCTION__="yes"
15600else 13668else
15601 echo "$as_me: failed program was:" >&5 13669 echo "$as_me: failed program was:" >&5
15602sed 's/^/| /' conftest.$ac_ext >&5 13670cat conftest.$ac_ext >&5
15603
15604 ac_cv_cc_implements___FUNCTION__="no" 13671 ac_cv_cc_implements___FUNCTION__="no"
15605 13672
15606fi 13673fi
15607rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13674rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15608 13675
15609fi 13676fi
15610echo "$as_me:$LINENO: result: $ac_cv_cc_implements___FUNCTION__" >&5 13677echo "$as_me:13677: result: $ac_cv_cc_implements___FUNCTION__" >&5
15611echo "${ECHO_T}$ac_cv_cc_implements___FUNCTION__" >&6 13678echo "${ECHO_T}$ac_cv_cc_implements___FUNCTION__" >&6
15612if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then 13679if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
15613 cat >>confdefs.h <<\_ACEOF 13680 cat >>confdefs.h <<\EOF
15614#define HAVE___FUNCTION__ 1 13681#define HAVE___FUNCTION__ 1
15615_ACEOF 13682EOF
15616 13683
15617fi 13684fi
15618 13685
15619echo "$as_me:$LINENO: checking whether $CC implements __func__" >&5 13686echo "$as_me:13686: checking whether $CC implements __func__" >&5
15620echo $ECHO_N "checking whether $CC implements __func__... $ECHO_C" >&6 13687echo $ECHO_N "checking whether $CC implements __func__... $ECHO_C" >&6
15621if test "${ac_cv_cc_implements___func__+set}" = set; then 13688if test "${ac_cv_cc_implements___func__+set}" = set; then
15622 echo $ECHO_N "(cached) $ECHO_C" >&6 13689 echo $ECHO_N "(cached) $ECHO_C" >&6
15623else 13690else
15624 13691
15625 cat >conftest.$ac_ext <<_ACEOF 13692 cat >conftest.$ac_ext <<_ACEOF
15626#line $LINENO "configure" 13693#line 13693 "configure"
15627/* confdefs.h. */ 13694#include "confdefs.h"
15628_ACEOF
15629cat confdefs.h >>conftest.$ac_ext
15630cat >>conftest.$ac_ext <<_ACEOF
15631/* end confdefs.h. */
15632 13695
15633#include <stdio.h> 13696#include <stdio.h>
15634 13697
@@ -15641,50 +13704,45 @@ main ()
15641} 13704}
15642_ACEOF 13705_ACEOF
15643rm -f conftest.$ac_objext conftest$ac_exeext 13706rm -f conftest.$ac_objext conftest$ac_exeext
15644if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13707if { (eval echo "$as_me:13707: \"$ac_link\"") >&5
15645 (eval $ac_link) 2>&5 13708 (eval $ac_link) 2>&5
15646 ac_status=$? 13709 ac_status=$?
15647 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13710 echo "$as_me:13710: \$? = $ac_status" >&5
15648 (exit $ac_status); } && 13711 (exit $ac_status); } &&
15649 { ac_try='test -s conftest$ac_exeext' 13712 { ac_try='test -s conftest$ac_exeext'
15650 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13713 { (eval echo "$as_me:13713: \"$ac_try\"") >&5
15651 (eval $ac_try) 2>&5 13714 (eval $ac_try) 2>&5
15652 ac_status=$? 13715 ac_status=$?
15653 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13716 echo "$as_me:13716: \$? = $ac_status" >&5
15654 (exit $ac_status); }; }; then 13717 (exit $ac_status); }; }; then
15655 ac_cv_cc_implements___func__="yes" 13718 ac_cv_cc_implements___func__="yes"
15656else 13719else
15657 echo "$as_me: failed program was:" >&5 13720 echo "$as_me: failed program was:" >&5
15658sed 's/^/| /' conftest.$ac_ext >&5 13721cat conftest.$ac_ext >&5
15659
15660 ac_cv_cc_implements___func__="no" 13722 ac_cv_cc_implements___func__="no"
15661 13723
15662fi 13724fi
15663rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13725rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15664 13726
15665fi 13727fi
15666echo "$as_me:$LINENO: result: $ac_cv_cc_implements___func__" >&5 13728echo "$as_me:13728: result: $ac_cv_cc_implements___func__" >&5
15667echo "${ECHO_T}$ac_cv_cc_implements___func__" >&6 13729echo "${ECHO_T}$ac_cv_cc_implements___func__" >&6
15668if test "x$ac_cv_cc_implements___func__" = "xyes" ; then 13730if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
15669 cat >>confdefs.h <<\_ACEOF 13731 cat >>confdefs.h <<\EOF
15670#define HAVE___func__ 1 13732#define HAVE___func__ 1
15671_ACEOF 13733EOF
15672 13734
15673fi 13735fi
15674 13736
15675echo "$as_me:$LINENO: checking whether getopt has optreset support" >&5 13737echo "$as_me:13737: checking whether getopt has optreset support" >&5
15676echo $ECHO_N "checking whether getopt has optreset support... $ECHO_C" >&6 13738echo $ECHO_N "checking whether getopt has optreset support... $ECHO_C" >&6
15677if test "${ac_cv_have_getopt_optreset+set}" = set; then 13739if test "${ac_cv_have_getopt_optreset+set}" = set; then
15678 echo $ECHO_N "(cached) $ECHO_C" >&6 13740 echo $ECHO_N "(cached) $ECHO_C" >&6
15679else 13741else
15680 13742
15681 cat >conftest.$ac_ext <<_ACEOF 13743 cat >conftest.$ac_ext <<_ACEOF
15682#line $LINENO "configure" 13744#line 13744 "configure"
15683/* confdefs.h. */ 13745#include "confdefs.h"
15684_ACEOF
15685cat confdefs.h >>conftest.$ac_ext
15686cat >>conftest.$ac_ext <<_ACEOF
15687/* end confdefs.h. */
15688 13746
15689#include <getopt.h> 13747#include <getopt.h>
15690 13748
@@ -15697,50 +13755,45 @@ main ()
15697} 13755}
15698_ACEOF 13756_ACEOF
15699rm -f conftest.$ac_objext conftest$ac_exeext 13757rm -f conftest.$ac_objext conftest$ac_exeext
15700if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13758if { (eval echo "$as_me:13758: \"$ac_link\"") >&5
15701 (eval $ac_link) 2>&5 13759 (eval $ac_link) 2>&5
15702 ac_status=$? 13760 ac_status=$?
15703 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13761 echo "$as_me:13761: \$? = $ac_status" >&5
15704 (exit $ac_status); } && 13762 (exit $ac_status); } &&
15705 { ac_try='test -s conftest$ac_exeext' 13763 { ac_try='test -s conftest$ac_exeext'
15706 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13764 { (eval echo "$as_me:13764: \"$ac_try\"") >&5
15707 (eval $ac_try) 2>&5 13765 (eval $ac_try) 2>&5
15708 ac_status=$? 13766 ac_status=$?
15709 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13767 echo "$as_me:13767: \$? = $ac_status" >&5
15710 (exit $ac_status); }; }; then 13768 (exit $ac_status); }; }; then
15711 ac_cv_have_getopt_optreset="yes" 13769 ac_cv_have_getopt_optreset="yes"
15712else 13770else
15713 echo "$as_me: failed program was:" >&5 13771 echo "$as_me: failed program was:" >&5
15714sed 's/^/| /' conftest.$ac_ext >&5 13772cat conftest.$ac_ext >&5
15715
15716 ac_cv_have_getopt_optreset="no" 13773 ac_cv_have_getopt_optreset="no"
15717 13774
15718fi 13775fi
15719rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13776rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15720 13777
15721fi 13778fi
15722echo "$as_me:$LINENO: result: $ac_cv_have_getopt_optreset" >&5 13779echo "$as_me:13779: result: $ac_cv_have_getopt_optreset" >&5
15723echo "${ECHO_T}$ac_cv_have_getopt_optreset" >&6 13780echo "${ECHO_T}$ac_cv_have_getopt_optreset" >&6
15724if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then 13781if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
15725 cat >>confdefs.h <<\_ACEOF 13782 cat >>confdefs.h <<\EOF
15726#define HAVE_GETOPT_OPTRESET 1 13783#define HAVE_GETOPT_OPTRESET 1
15727_ACEOF 13784EOF
15728 13785
15729fi 13786fi
15730 13787
15731echo "$as_me:$LINENO: checking if libc defines sys_errlist" >&5 13788echo "$as_me:13788: checking if libc defines sys_errlist" >&5
15732echo $ECHO_N "checking if libc defines sys_errlist... $ECHO_C" >&6 13789echo $ECHO_N "checking if libc defines sys_errlist... $ECHO_C" >&6
15733if test "${ac_cv_libc_defines_sys_errlist+set}" = set; then 13790if test "${ac_cv_libc_defines_sys_errlist+set}" = set; then
15734 echo $ECHO_N "(cached) $ECHO_C" >&6 13791 echo $ECHO_N "(cached) $ECHO_C" >&6
15735else 13792else
15736 13793
15737 cat >conftest.$ac_ext <<_ACEOF 13794 cat >conftest.$ac_ext <<_ACEOF
15738#line $LINENO "configure" 13795#line 13795 "configure"
15739/* confdefs.h. */ 13796#include "confdefs.h"
15740_ACEOF
15741cat confdefs.h >>conftest.$ac_ext
15742cat >>conftest.$ac_ext <<_ACEOF
15743/* end confdefs.h. */
15744 13797
15745int 13798int
15746main () 13799main ()
@@ -15751,51 +13804,45 @@ main ()
15751} 13804}
15752_ACEOF 13805_ACEOF
15753rm -f conftest.$ac_objext conftest$ac_exeext 13806rm -f conftest.$ac_objext conftest$ac_exeext
15754if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13807if { (eval echo "$as_me:13807: \"$ac_link\"") >&5
15755 (eval $ac_link) 2>&5 13808 (eval $ac_link) 2>&5
15756 ac_status=$? 13809 ac_status=$?
15757 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13810 echo "$as_me:13810: \$? = $ac_status" >&5
15758 (exit $ac_status); } && 13811 (exit $ac_status); } &&
15759 { ac_try='test -s conftest$ac_exeext' 13812 { ac_try='test -s conftest$ac_exeext'
15760 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13813 { (eval echo "$as_me:13813: \"$ac_try\"") >&5
15761 (eval $ac_try) 2>&5 13814 (eval $ac_try) 2>&5
15762 ac_status=$? 13815 ac_status=$?
15763 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13816 echo "$as_me:13816: \$? = $ac_status" >&5
15764 (exit $ac_status); }; }; then 13817 (exit $ac_status); }; }; then
15765 ac_cv_libc_defines_sys_errlist="yes" 13818 ac_cv_libc_defines_sys_errlist="yes"
15766else 13819else
15767 echo "$as_me: failed program was:" >&5 13820 echo "$as_me: failed program was:" >&5
15768sed 's/^/| /' conftest.$ac_ext >&5 13821cat conftest.$ac_ext >&5
15769
15770 ac_cv_libc_defines_sys_errlist="no" 13822 ac_cv_libc_defines_sys_errlist="no"
15771 13823
15772fi 13824fi
15773rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13825rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15774 13826
15775fi 13827fi
15776echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_errlist" >&5 13828echo "$as_me:13828: result: $ac_cv_libc_defines_sys_errlist" >&5
15777echo "${ECHO_T}$ac_cv_libc_defines_sys_errlist" >&6 13829echo "${ECHO_T}$ac_cv_libc_defines_sys_errlist" >&6
15778if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then 13830if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
15779 cat >>confdefs.h <<\_ACEOF 13831 cat >>confdefs.h <<\EOF
15780#define HAVE_SYS_ERRLIST 1 13832#define HAVE_SYS_ERRLIST 1
15781_ACEOF 13833EOF
15782 13834
15783fi 13835fi
15784 13836
15785 13837echo "$as_me:13837: checking if libc defines sys_nerr" >&5
15786echo "$as_me:$LINENO: checking if libc defines sys_nerr" >&5
15787echo $ECHO_N "checking if libc defines sys_nerr... $ECHO_C" >&6 13838echo $ECHO_N "checking if libc defines sys_nerr... $ECHO_C" >&6
15788if test "${ac_cv_libc_defines_sys_nerr+set}" = set; then 13839if test "${ac_cv_libc_defines_sys_nerr+set}" = set; then
15789 echo $ECHO_N "(cached) $ECHO_C" >&6 13840 echo $ECHO_N "(cached) $ECHO_C" >&6
15790else 13841else
15791 13842
15792 cat >conftest.$ac_ext <<_ACEOF 13843 cat >conftest.$ac_ext <<_ACEOF
15793#line $LINENO "configure" 13844#line 13844 "configure"
15794/* confdefs.h. */ 13845#include "confdefs.h"
15795_ACEOF
15796cat confdefs.h >>conftest.$ac_ext
15797cat >>conftest.$ac_ext <<_ACEOF
15798/* end confdefs.h. */
15799 13846
15800int 13847int
15801main () 13848main ()
@@ -15806,39 +13853,37 @@ main ()
15806} 13853}
15807_ACEOF 13854_ACEOF
15808rm -f conftest.$ac_objext conftest$ac_exeext 13855rm -f conftest.$ac_objext conftest$ac_exeext
15809if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13856if { (eval echo "$as_me:13856: \"$ac_link\"") >&5
15810 (eval $ac_link) 2>&5 13857 (eval $ac_link) 2>&5
15811 ac_status=$? 13858 ac_status=$?
15812 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13859 echo "$as_me:13859: \$? = $ac_status" >&5
15813 (exit $ac_status); } && 13860 (exit $ac_status); } &&
15814 { ac_try='test -s conftest$ac_exeext' 13861 { ac_try='test -s conftest$ac_exeext'
15815 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13862 { (eval echo "$as_me:13862: \"$ac_try\"") >&5
15816 (eval $ac_try) 2>&5 13863 (eval $ac_try) 2>&5
15817 ac_status=$? 13864 ac_status=$?
15818 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13865 echo "$as_me:13865: \$? = $ac_status" >&5
15819 (exit $ac_status); }; }; then 13866 (exit $ac_status); }; }; then
15820 ac_cv_libc_defines_sys_nerr="yes" 13867 ac_cv_libc_defines_sys_nerr="yes"
15821else 13868else
15822 echo "$as_me: failed program was:" >&5 13869 echo "$as_me: failed program was:" >&5
15823sed 's/^/| /' conftest.$ac_ext >&5 13870cat conftest.$ac_ext >&5
15824
15825 ac_cv_libc_defines_sys_nerr="no" 13871 ac_cv_libc_defines_sys_nerr="no"
15826 13872
15827fi 13873fi
15828rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 13874rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15829 13875
15830fi 13876fi
15831echo "$as_me:$LINENO: result: $ac_cv_libc_defines_sys_nerr" >&5 13877echo "$as_me:13877: result: $ac_cv_libc_defines_sys_nerr" >&5
15832echo "${ECHO_T}$ac_cv_libc_defines_sys_nerr" >&6 13878echo "${ECHO_T}$ac_cv_libc_defines_sys_nerr" >&6
15833if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then 13879if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
15834 cat >>confdefs.h <<\_ACEOF 13880 cat >>confdefs.h <<\EOF
15835#define HAVE_SYS_NERR 1 13881#define HAVE_SYS_NERR 1
15836_ACEOF 13882EOF
15837 13883
15838fi 13884fi
15839 13885
15840SCARD_MSG="no" 13886SCARD_MSG="no"
15841
15842# Check whether user wants sectok support 13887# Check whether user wants sectok support
15843 13888
15844# Check whether --with-sectok or --without-sectok was given. 13889# Check whether --with-sectok or --without-sectok was given.
@@ -15860,70 +13905,23 @@ if test "${with_sectok+set}" = set; then
15860for ac_header in sectok.h 13905for ac_header in sectok.h
15861do 13906do
15862as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` 13907as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15863if eval "test \"\${$as_ac_Header+set}\" = set"; then 13908echo "$as_me:13908: checking for $ac_header" >&5
15864 echo "$as_me:$LINENO: checking for $ac_header" >&5
15865echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 13909echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15866if eval "test \"\${$as_ac_Header+set}\" = set"; then 13910if eval "test \"\${$as_ac_Header+set}\" = set"; then
15867 echo $ECHO_N "(cached) $ECHO_C" >&6 13911 echo $ECHO_N "(cached) $ECHO_C" >&6
15868fi
15869echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
15870echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15871else
15872 # Is the header compilable?
15873echo "$as_me:$LINENO: checking $ac_header usability" >&5
15874echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
15875cat >conftest.$ac_ext <<_ACEOF
15876#line $LINENO "configure"
15877/* confdefs.h. */
15878_ACEOF
15879cat confdefs.h >>conftest.$ac_ext
15880cat >>conftest.$ac_ext <<_ACEOF
15881/* end confdefs.h. */
15882$ac_includes_default
15883#include <$ac_header>
15884_ACEOF
15885rm -f conftest.$ac_objext
15886if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
15887 (eval $ac_compile) 2>&5
15888 ac_status=$?
15889 echo "$as_me:$LINENO: \$? = $ac_status" >&5
15890 (exit $ac_status); } &&
15891 { ac_try='test -s conftest.$ac_objext'
15892 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
15893 (eval $ac_try) 2>&5
15894 ac_status=$?
15895 echo "$as_me:$LINENO: \$? = $ac_status" >&5
15896 (exit $ac_status); }; }; then
15897 ac_header_compiler=yes
15898else 13912else
15899 echo "$as_me: failed program was:" >&5 13913 cat >conftest.$ac_ext <<_ACEOF
15900sed 's/^/| /' conftest.$ac_ext >&5 13914#line 13914 "configure"
15901 13915#include "confdefs.h"
15902ac_header_compiler=no
15903fi
15904rm -f conftest.$ac_objext conftest.$ac_ext
15905echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
15906echo "${ECHO_T}$ac_header_compiler" >&6
15907
15908# Is the header present?
15909echo "$as_me:$LINENO: checking $ac_header presence" >&5
15910echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
15911cat >conftest.$ac_ext <<_ACEOF
15912#line $LINENO "configure"
15913/* confdefs.h. */
15914_ACEOF
15915cat confdefs.h >>conftest.$ac_ext
15916cat >>conftest.$ac_ext <<_ACEOF
15917/* end confdefs.h. */
15918#include <$ac_header> 13916#include <$ac_header>
15919_ACEOF 13917_ACEOF
15920if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 13918if { (eval echo "$as_me:13918: \"$ac_cpp conftest.$ac_ext\"") >&5
15921 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 13919 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15922 ac_status=$? 13920 ac_status=$?
15923 grep -v '^ *+' conftest.er1 >conftest.err 13921 egrep -v '^ *\+' conftest.er1 >conftest.err
15924 rm -f conftest.er1 13922 rm -f conftest.er1
15925 cat conftest.err >&5 13923 cat conftest.err >&5
15926 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13924 echo "$as_me:13924: \$? = $ac_status" >&5
15927 (exit $ac_status); } >/dev/null; then 13925 (exit $ac_status); } >/dev/null; then
15928 if test -s conftest.err; then 13926 if test -s conftest.err; then
15929 ac_cpp_err=$ac_c_preproc_warn_flag 13927 ac_cpp_err=$ac_c_preproc_warn_flag
@@ -15934,77 +13932,31 @@ else
15934 ac_cpp_err=yes 13932 ac_cpp_err=yes
15935fi 13933fi
15936if test -z "$ac_cpp_err"; then 13934if test -z "$ac_cpp_err"; then
15937 ac_header_preproc=yes 13935 eval "$as_ac_Header=yes"
15938else 13936else
15939 echo "$as_me: failed program was:" >&5 13937 echo "$as_me: failed program was:" >&5
15940sed 's/^/| /' conftest.$ac_ext >&5 13938 cat conftest.$ac_ext >&5
15941 13939 eval "$as_ac_Header=no"
15942 ac_header_preproc=no
15943fi 13940fi
15944rm -f conftest.err conftest.$ac_ext 13941rm -f conftest.err conftest.$ac_ext
15945echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
15946echo "${ECHO_T}$ac_header_preproc" >&6
15947
15948# So? What about this header?
15949case $ac_header_compiler:$ac_header_preproc in
15950 yes:no )
15951 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
15952echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
15953 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
15954echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
15955 (
15956 cat <<\_ASBOX
15957## ------------------------------------ ##
15958## Report this to bug-autoconf@gnu.org. ##
15959## ------------------------------------ ##
15960_ASBOX
15961 ) |
15962 sed "s/^/$as_me: WARNING: /" >&2
15963 ;;
15964 no:yes )
15965 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
15966echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
15967 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
15968echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
15969 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
15970echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
15971 (
15972 cat <<\_ASBOX
15973## ------------------------------------ ##
15974## Report this to bug-autoconf@gnu.org. ##
15975## ------------------------------------ ##
15976_ASBOX
15977 ) |
15978 sed "s/^/$as_me: WARNING: /" >&2
15979 ;;
15980esac
15981echo "$as_me:$LINENO: checking for $ac_header" >&5
15982echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15983if eval "test \"\${$as_ac_Header+set}\" = set"; then
15984 echo $ECHO_N "(cached) $ECHO_C" >&6
15985else
15986 eval "$as_ac_Header=$ac_header_preproc"
15987fi 13942fi
15988echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 13943echo "$as_me:13943: result: `eval echo '${'$as_ac_Header'}'`" >&5
15989echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 13944echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15990
15991fi
15992if test `eval echo '${'$as_ac_Header'}'` = yes; then 13945if test `eval echo '${'$as_ac_Header'}'` = yes; then
15993 cat >>confdefs.h <<_ACEOF 13946 cat >>confdefs.h <<EOF
15994#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 13947#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15995_ACEOF 13948EOF
15996 13949
15997fi 13950fi
15998
15999done 13951done
16000 13952
16001 if test "$ac_cv_header_sectok_h" != yes; then 13953 if test "$ac_cv_header_sectok_h" != yes; then
16002 { { echo "$as_me:$LINENO: error: Can't find sectok.h" >&5 13954 { { echo "$as_me:13954: error: Can't find sectok.h" >&5
16003echo "$as_me: error: Can't find sectok.h" >&2;} 13955echo "$as_me: error: Can't find sectok.h" >&2;}
16004 { (exit 1); exit 1; }; } 13956 { (exit 1); exit 1; }; }
16005 fi 13957 fi
16006 13958
16007echo "$as_me:$LINENO: checking for sectok_open in -lsectok" >&5 13959echo "$as_me:13959: checking for sectok_open in -lsectok" >&5
16008echo $ECHO_N "checking for sectok_open in -lsectok... $ECHO_C" >&6 13960echo $ECHO_N "checking for sectok_open in -lsectok... $ECHO_C" >&6
16009if test "${ac_cv_lib_sectok_sectok_open+set}" = set; then 13961if test "${ac_cv_lib_sectok_sectok_open+set}" = set; then
16010 echo $ECHO_N "(cached) $ECHO_C" >&6 13962 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16012,12 +13964,8 @@ else
16012 ac_check_lib_save_LIBS=$LIBS 13964 ac_check_lib_save_LIBS=$LIBS
16013LIBS="-lsectok $LIBS" 13965LIBS="-lsectok $LIBS"
16014cat >conftest.$ac_ext <<_ACEOF 13966cat >conftest.$ac_ext <<_ACEOF
16015#line $LINENO "configure" 13967#line 13967 "configure"
16016/* confdefs.h. */ 13968#include "confdefs.h"
16017_ACEOF
16018cat confdefs.h >>conftest.$ac_ext
16019cat >>conftest.$ac_ext <<_ACEOF
16020/* end confdefs.h. */
16021 13969
16022/* Override any gcc2 internal prototype to avoid an error. */ 13970/* Override any gcc2 internal prototype to avoid an error. */
16023#ifdef __cplusplus 13971#ifdef __cplusplus
@@ -16035,55 +13983,53 @@ sectok_open ();
16035} 13983}
16036_ACEOF 13984_ACEOF
16037rm -f conftest.$ac_objext conftest$ac_exeext 13985rm -f conftest.$ac_objext conftest$ac_exeext
16038if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 13986if { (eval echo "$as_me:13986: \"$ac_link\"") >&5
16039 (eval $ac_link) 2>&5 13987 (eval $ac_link) 2>&5
16040 ac_status=$? 13988 ac_status=$?
16041 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13989 echo "$as_me:13989: \$? = $ac_status" >&5
16042 (exit $ac_status); } && 13990 (exit $ac_status); } &&
16043 { ac_try='test -s conftest$ac_exeext' 13991 { ac_try='test -s conftest$ac_exeext'
16044 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 13992 { (eval echo "$as_me:13992: \"$ac_try\"") >&5
16045 (eval $ac_try) 2>&5 13993 (eval $ac_try) 2>&5
16046 ac_status=$? 13994 ac_status=$?
16047 echo "$as_me:$LINENO: \$? = $ac_status" >&5 13995 echo "$as_me:13995: \$? = $ac_status" >&5
16048 (exit $ac_status); }; }; then 13996 (exit $ac_status); }; }; then
16049 ac_cv_lib_sectok_sectok_open=yes 13997 ac_cv_lib_sectok_sectok_open=yes
16050else 13998else
16051 echo "$as_me: failed program was:" >&5 13999 echo "$as_me: failed program was:" >&5
16052sed 's/^/| /' conftest.$ac_ext >&5 14000cat conftest.$ac_ext >&5
16053
16054ac_cv_lib_sectok_sectok_open=no 14001ac_cv_lib_sectok_sectok_open=no
16055fi 14002fi
16056rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14003rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16057LIBS=$ac_check_lib_save_LIBS 14004LIBS=$ac_check_lib_save_LIBS
16058fi 14005fi
16059echo "$as_me:$LINENO: result: $ac_cv_lib_sectok_sectok_open" >&5 14006echo "$as_me:14006: result: $ac_cv_lib_sectok_sectok_open" >&5
16060echo "${ECHO_T}$ac_cv_lib_sectok_sectok_open" >&6 14007echo "${ECHO_T}$ac_cv_lib_sectok_sectok_open" >&6
16061if test $ac_cv_lib_sectok_sectok_open = yes; then 14008if test $ac_cv_lib_sectok_sectok_open = yes; then
16062 cat >>confdefs.h <<_ACEOF 14009 cat >>confdefs.h <<EOF
16063#define HAVE_LIBSECTOK 1 14010#define HAVE_LIBSECTOK 1
16064_ACEOF 14011EOF
16065 14012
16066 LIBS="-lsectok $LIBS" 14013 LIBS="-lsectok $LIBS"
16067 14014
16068fi 14015fi
16069 14016
16070 if test "$ac_cv_lib_sectok_sectok_open" != yes; then 14017 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
16071 { { echo "$as_me:$LINENO: error: Can't find libsectok" >&5 14018 { { echo "$as_me:14018: error: Can't find libsectok" >&5
16072echo "$as_me: error: Can't find libsectok" >&2;} 14019echo "$as_me: error: Can't find libsectok" >&2;}
16073 { (exit 1); exit 1; }; } 14020 { (exit 1); exit 1; }; }
16074 fi 14021 fi
16075 cat >>confdefs.h <<\_ACEOF 14022 cat >>confdefs.h <<\EOF
16076#define SMARTCARD 1 14023#define SMARTCARD 1
16077_ACEOF 14024EOF
16078 14025
16079 cat >>confdefs.h <<\_ACEOF 14026 cat >>confdefs.h <<\EOF
16080#define USE_SECTOK 1 14027#define USE_SECTOK 1
16081_ACEOF 14028EOF
16082 14029
16083 SCARD_MSG="yes, using sectok" 14030 SCARD_MSG="yes, using sectok"
16084 fi 14031 fi
16085 14032
16086
16087fi; 14033fi;
16088 14034
16089# Check whether user wants OpenSC support 14035# Check whether user wants OpenSC support
@@ -16099,7 +14045,7 @@ if test x$opensc_config_prefix != x ; then
16099 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config 14045 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
16100 # Extract the first word of "opensc-config", so it can be a program name with args. 14046 # Extract the first word of "opensc-config", so it can be a program name with args.
16101set dummy opensc-config; ac_word=$2 14047set dummy opensc-config; ac_word=$2
16102echo "$as_me:$LINENO: checking for $ac_word" >&5 14048echo "$as_me:14048: checking for $ac_word" >&5
16103echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 14049echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16104if test "${ac_cv_path_OPENSC_CONFIG+set}" = set; then 14050if test "${ac_cv_path_OPENSC_CONFIG+set}" = set; then
16105 echo $ECHO_N "(cached) $ECHO_C" >&6 14051 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16109,18 +14055,16 @@ else
16109 ac_cv_path_OPENSC_CONFIG="$OPENSC_CONFIG" # Let the user override the test with a path. 14055 ac_cv_path_OPENSC_CONFIG="$OPENSC_CONFIG" # Let the user override the test with a path.
16110 ;; 14056 ;;
16111 *) 14057 *)
16112 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 14058 ac_save_IFS=$IFS; IFS=$ac_path_separator
16113for as_dir in $PATH 14059ac_dummy="$PATH"
16114do 14060for ac_dir in $ac_dummy; do
16115 IFS=$as_save_IFS 14061 IFS=$ac_save_IFS
16116 test -z "$as_dir" && as_dir=. 14062 test -z "$ac_dir" && ac_dir=.
16117 for ac_exec_ext in '' $ac_executable_extensions; do 14063 if $as_executable_p "$ac_dir/$ac_word"; then
16118 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 14064 ac_cv_path_OPENSC_CONFIG="$ac_dir/$ac_word"
16119 ac_cv_path_OPENSC_CONFIG="$as_dir/$ac_word$ac_exec_ext" 14065 echo "$as_me:14065: found $ac_dir/$ac_word" >&5
16120 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 14066 break
16121 break 2 14067fi
16122 fi
16123done
16124done 14068done
16125 14069
16126 test -z "$ac_cv_path_OPENSC_CONFIG" && ac_cv_path_OPENSC_CONFIG="no" 14070 test -z "$ac_cv_path_OPENSC_CONFIG" && ac_cv_path_OPENSC_CONFIG="no"
@@ -16130,10 +14074,10 @@ fi
16130OPENSC_CONFIG=$ac_cv_path_OPENSC_CONFIG 14074OPENSC_CONFIG=$ac_cv_path_OPENSC_CONFIG
16131 14075
16132if test -n "$OPENSC_CONFIG"; then 14076if test -n "$OPENSC_CONFIG"; then
16133 echo "$as_me:$LINENO: result: $OPENSC_CONFIG" >&5 14077 echo "$as_me:14077: result: $OPENSC_CONFIG" >&5
16134echo "${ECHO_T}$OPENSC_CONFIG" >&6 14078echo "${ECHO_T}$OPENSC_CONFIG" >&6
16135else 14079else
16136 echo "$as_me:$LINENO: result: no" >&5 14080 echo "$as_me:14080: result: no" >&5
16137echo "${ECHO_T}no" >&6 14081echo "${ECHO_T}no" >&6
16138fi 14082fi
16139 14083
@@ -16142,108 +14086,81 @@ fi
16142 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs` 14086 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
16143 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS" 14087 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
16144 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS" 14088 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
16145 cat >>confdefs.h <<\_ACEOF 14089 cat >>confdefs.h <<\EOF
16146#define SMARTCARD 1 14090#define SMARTCARD 1
16147_ACEOF 14091EOF
16148 14092
16149 cat >>confdefs.h <<\_ACEOF 14093 cat >>confdefs.h <<\EOF
16150#define USE_OPENSC 1 14094#define USE_OPENSC 1
16151_ACEOF 14095EOF
16152 14096
16153 SCARD_MSG="yes, using OpenSC" 14097 SCARD_MSG="yes, using OpenSC"
16154 fi 14098 fi
16155fi 14099fi
16156 14100
16157# Check whether user wants Kerberos 5 support 14101# Check whether user wants DNS support
16158KRB5_MSG="no" 14102DNS_MSG="no"
16159 14103
16160# Check whether --with-kerberos5 or --without-kerberos5 was given. 14104# Check whether --with-dns or --without-dns was given.
16161if test "${with_kerberos5+set}" = set; then 14105if test "${with_dns+set}" = set; then
16162 withval="$with_kerberos5" 14106 withval="$with_dns"
16163 14107
16164 if test "x$withval" != "xno" ; then 14108 if test "x$withval" != "xno" ; then
16165 if test "x$withval" = "xyes" ; then 14109 DNS_MSG="yes"
16166 KRB5ROOT="/usr/local" 14110 cat >>confdefs.h <<\EOF
16167 else 14111#define DNS 1
16168 KRB5ROOT=${withval} 14112EOF
16169 fi 14113
16170 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include" 14114 echo "$as_me:14114: checking for library containing getrrsetbyname" >&5
16171 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib" 14115echo $ECHO_N "checking for library containing getrrsetbyname... $ECHO_C" >&6
16172 cat >>confdefs.h <<\_ACEOF 14116if test "${ac_cv_search_getrrsetbyname+set}" = set; then
16173#define KRB5 1 14117 echo $ECHO_N "(cached) $ECHO_C" >&6
16174_ACEOF 14118else
14119 ac_func_search_save_LIBS=$LIBS
14120ac_cv_search_getrrsetbyname=no
14121cat >conftest.$ac_ext <<_ACEOF
14122#line 14122 "configure"
14123#include "confdefs.h"
16175 14124
16176 KRB5_MSG="yes" 14125/* Override any gcc2 internal prototype to avoid an error. */
16177 echo "$as_me:$LINENO: checking whether we are using Heimdal" >&5 14126#ifdef __cplusplus
16178echo $ECHO_N "checking whether we are using Heimdal... $ECHO_C" >&6 14127extern "C"
16179 cat >conftest.$ac_ext <<_ACEOF 14128#endif
16180#line $LINENO "configure" 14129/* We use char because int might match the return type of a gcc2
16181/* confdefs.h. */ 14130 builtin and then its argument prototype would still apply. */
16182_ACEOF 14131char getrrsetbyname ();
16183cat confdefs.h >>conftest.$ac_ext
16184cat >>conftest.$ac_ext <<_ACEOF
16185/* end confdefs.h. */
16186 #include <krb5.h>
16187int 14132int
16188main () 14133main ()
16189{ 14134{
16190 char *tmp = heimdal_version; 14135getrrsetbyname ();
16191 ; 14136 ;
16192 return 0; 14137 return 0;
16193} 14138}
16194_ACEOF 14139_ACEOF
16195rm -f conftest.$ac_objext 14140rm -f conftest.$ac_objext conftest$ac_exeext
16196if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 14141if { (eval echo "$as_me:14141: \"$ac_link\"") >&5
16197 (eval $ac_compile) 2>&5 14142 (eval $ac_link) 2>&5
16198 ac_status=$? 14143 ac_status=$?
16199 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14144 echo "$as_me:14144: \$? = $ac_status" >&5
16200 (exit $ac_status); } && 14145 (exit $ac_status); } &&
16201 { ac_try='test -s conftest.$ac_objext' 14146 { ac_try='test -s conftest$ac_exeext'
16202 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14147 { (eval echo "$as_me:14147: \"$ac_try\"") >&5
16203 (eval $ac_try) 2>&5 14148 (eval $ac_try) 2>&5
16204 ac_status=$? 14149 ac_status=$?
16205 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14150 echo "$as_me:14150: \$? = $ac_status" >&5
16206 (exit $ac_status); }; }; then 14151 (exit $ac_status); }; }; then
16207 echo "$as_me:$LINENO: result: yes" >&5 14152 ac_cv_search_getrrsetbyname="none required"
16208echo "${ECHO_T}yes" >&6
16209 cat >>confdefs.h <<\_ACEOF
16210#define HEIMDAL 1
16211_ACEOF
16212
16213 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
16214
16215else 14153else
16216 echo "$as_me: failed program was:" >&5 14154 echo "$as_me: failed program was:" >&5
16217sed 's/^/| /' conftest.$ac_ext >&5 14155cat conftest.$ac_ext >&5
16218
16219 echo "$as_me:$LINENO: result: no" >&5
16220echo "${ECHO_T}no" >&6
16221 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
16222
16223
16224fi 14156fi
16225rm -f conftest.$ac_objext conftest.$ac_ext 14157rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16226 if test ! -z "$need_dash_r" ; then 14158if test "$ac_cv_search_getrrsetbyname" = no; then
16227 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib" 14159 for ac_lib in resolv; do
16228 fi 14160 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16229 if test ! -z "$blibpath" ; then 14161 cat >conftest.$ac_ext <<_ACEOF
16230 blibpath="$blibpath:${KRB5ROOT}/lib" 14162#line 14162 "configure"
16231 fi 14163#include "confdefs.h"
16232
16233echo "$as_me:$LINENO: checking for dn_expand in -lresolv" >&5
16234echo $ECHO_N "checking for dn_expand in -lresolv... $ECHO_C" >&6
16235if test "${ac_cv_lib_resolv_dn_expand+set}" = set; then
16236 echo $ECHO_N "(cached) $ECHO_C" >&6
16237else
16238 ac_check_lib_save_LIBS=$LIBS
16239LIBS="-lresolv $LIBS"
16240cat >conftest.$ac_ext <<_ACEOF
16241#line $LINENO "configure"
16242/* confdefs.h. */
16243_ACEOF
16244cat confdefs.h >>conftest.$ac_ext
16245cat >>conftest.$ac_ext <<_ACEOF
16246/* end confdefs.h. */
16247 14164
16248/* Override any gcc2 internal prototype to avoid an error. */ 14165/* Override any gcc2 internal prototype to avoid an error. */
16249#ifdef __cplusplus 14166#ifdef __cplusplus
@@ -16251,364 +14168,444 @@ extern "C"
16251#endif 14168#endif
16252/* We use char because int might match the return type of a gcc2 14169/* We use char because int might match the return type of a gcc2
16253 builtin and then its argument prototype would still apply. */ 14170 builtin and then its argument prototype would still apply. */
16254char dn_expand (); 14171char getrrsetbyname ();
16255int 14172int
16256main () 14173main ()
16257{ 14174{
16258dn_expand (); 14175getrrsetbyname ();
16259 ; 14176 ;
16260 return 0; 14177 return 0;
16261} 14178}
16262_ACEOF 14179_ACEOF
16263rm -f conftest.$ac_objext conftest$ac_exeext 14180rm -f conftest.$ac_objext conftest$ac_exeext
16264if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14181if { (eval echo "$as_me:14181: \"$ac_link\"") >&5
16265 (eval $ac_link) 2>&5 14182 (eval $ac_link) 2>&5
16266 ac_status=$? 14183 ac_status=$?
16267 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14184 echo "$as_me:14184: \$? = $ac_status" >&5
16268 (exit $ac_status); } && 14185 (exit $ac_status); } &&
16269 { ac_try='test -s conftest$ac_exeext' 14186 { ac_try='test -s conftest$ac_exeext'
16270 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14187 { (eval echo "$as_me:14187: \"$ac_try\"") >&5
16271 (eval $ac_try) 2>&5 14188 (eval $ac_try) 2>&5
16272 ac_status=$? 14189 ac_status=$?
16273 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14190 echo "$as_me:14190: \$? = $ac_status" >&5
16274 (exit $ac_status); }; }; then 14191 (exit $ac_status); }; }; then
16275 ac_cv_lib_resolv_dn_expand=yes 14192 ac_cv_search_getrrsetbyname="-l$ac_lib"
14193break
16276else 14194else
16277 echo "$as_me: failed program was:" >&5 14195 echo "$as_me: failed program was:" >&5
16278sed 's/^/| /' conftest.$ac_ext >&5 14196cat conftest.$ac_ext >&5
16279
16280ac_cv_lib_resolv_dn_expand=no
16281fi 14197fi
16282rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14198rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16283LIBS=$ac_check_lib_save_LIBS 14199 done
16284fi 14200fi
16285echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_dn_expand" >&5 14201LIBS=$ac_func_search_save_LIBS
16286echo "${ECHO_T}$ac_cv_lib_resolv_dn_expand" >&6
16287if test $ac_cv_lib_resolv_dn_expand = yes; then
16288 cat >>confdefs.h <<_ACEOF
16289#define HAVE_LIBRESOLV 1
16290_ACEOF
16291
16292 LIBS="-lresolv $LIBS"
16293
16294fi 14202fi
14203echo "$as_me:14203: result: $ac_cv_search_getrrsetbyname" >&5
14204echo "${ECHO_T}$ac_cv_search_getrrsetbyname" >&6
14205if test "$ac_cv_search_getrrsetbyname" != no; then
14206 test "$ac_cv_search_getrrsetbyname" = "none required" || LIBS="$ac_cv_search_getrrsetbyname $LIBS"
14207 cat >>confdefs.h <<\EOF
14208#define HAVE_GETRRSETBYNAME 1
14209EOF
16295 14210
14211else
16296 14212
16297 KRB5=yes 14213 # Needed by our getrrsetbyname()
16298 fi 14214 echo "$as_me:14214: checking for library containing res_query" >&5
16299 14215echo $ECHO_N "checking for library containing res_query... $ECHO_C" >&6
16300 14216if test "${ac_cv_search_res_query+set}" = set; then
16301fi;
16302# Check whether user wants Kerberos 4 support
16303KRB4_MSG="no"
16304
16305# Check whether --with-kerberos4 or --without-kerberos4 was given.
16306if test "${with_kerberos4+set}" = set; then
16307 withval="$with_kerberos4"
16308
16309 if test "x$withval" != "xno" ; then
16310 if test "x$withval" != "xyes" ; then
16311 CPPFLAGS="$CPPFLAGS -I${withval}/include"
16312 LDFLAGS="$LDFLAGS -L${withval}/lib"
16313 if test ! -z "$need_dash_r" ; then
16314 LDFLAGS="$LDFLAGS -R${withval}/lib"
16315 fi
16316 if test ! -z "$blibpath" ; then
16317 blibpath="$blibpath:${withval}/lib"
16318 fi
16319 else
16320 if test -d /usr/include/kerberosIV ; then
16321 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
16322 fi
16323 fi
16324
16325
16326for ac_header in krb.h
16327do
16328as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16329if eval "test \"\${$as_ac_Header+set}\" = set"; then
16330 echo "$as_me:$LINENO: checking for $ac_header" >&5
16331echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16332if eval "test \"\${$as_ac_Header+set}\" = set"; then
16333 echo $ECHO_N "(cached) $ECHO_C" >&6 14217 echo $ECHO_N "(cached) $ECHO_C" >&6
16334fi
16335echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
16336echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16337else 14218else
16338 # Is the header compilable? 14219 ac_func_search_save_LIBS=$LIBS
16339echo "$as_me:$LINENO: checking $ac_header usability" >&5 14220ac_cv_search_res_query=no
16340echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
16341cat >conftest.$ac_ext <<_ACEOF 14221cat >conftest.$ac_ext <<_ACEOF
16342#line $LINENO "configure" 14222#line 14222 "configure"
16343/* confdefs.h. */ 14223#include "confdefs.h"
16344_ACEOF 14224
16345cat confdefs.h >>conftest.$ac_ext 14225/* Override any gcc2 internal prototype to avoid an error. */
16346cat >>conftest.$ac_ext <<_ACEOF 14226#ifdef __cplusplus
16347/* end confdefs.h. */ 14227extern "C"
16348$ac_includes_default 14228#endif
16349#include <$ac_header> 14229/* We use char because int might match the return type of a gcc2
14230 builtin and then its argument prototype would still apply. */
14231char res_query ();
14232int
14233main ()
14234{
14235res_query ();
14236 ;
14237 return 0;
14238}
16350_ACEOF 14239_ACEOF
16351rm -f conftest.$ac_objext 14240rm -f conftest.$ac_objext conftest$ac_exeext
16352if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 14241if { (eval echo "$as_me:14241: \"$ac_link\"") >&5
16353 (eval $ac_compile) 2>&5 14242 (eval $ac_link) 2>&5
16354 ac_status=$? 14243 ac_status=$?
16355 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14244 echo "$as_me:14244: \$? = $ac_status" >&5
16356 (exit $ac_status); } && 14245 (exit $ac_status); } &&
16357 { ac_try='test -s conftest.$ac_objext' 14246 { ac_try='test -s conftest$ac_exeext'
16358 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14247 { (eval echo "$as_me:14247: \"$ac_try\"") >&5
16359 (eval $ac_try) 2>&5 14248 (eval $ac_try) 2>&5
16360 ac_status=$? 14249 ac_status=$?
16361 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14250 echo "$as_me:14250: \$? = $ac_status" >&5
16362 (exit $ac_status); }; }; then 14251 (exit $ac_status); }; }; then
16363 ac_header_compiler=yes 14252 ac_cv_search_res_query="none required"
16364else 14253else
16365 echo "$as_me: failed program was:" >&5 14254 echo "$as_me: failed program was:" >&5
16366sed 's/^/| /' conftest.$ac_ext >&5 14255cat conftest.$ac_ext >&5
16367
16368ac_header_compiler=no
16369fi 14256fi
16370rm -f conftest.$ac_objext conftest.$ac_ext 14257rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16371echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 14258if test "$ac_cv_search_res_query" = no; then
16372echo "${ECHO_T}$ac_header_compiler" >&6 14259 for ac_lib in resolv; do
14260 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
14261 cat >conftest.$ac_ext <<_ACEOF
14262#line 14262 "configure"
14263#include "confdefs.h"
16373 14264
16374# Is the header present? 14265/* Override any gcc2 internal prototype to avoid an error. */
16375echo "$as_me:$LINENO: checking $ac_header presence" >&5 14266#ifdef __cplusplus
16376echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 14267extern "C"
16377cat >conftest.$ac_ext <<_ACEOF 14268#endif
16378#line $LINENO "configure" 14269/* We use char because int might match the return type of a gcc2
16379/* confdefs.h. */ 14270 builtin and then its argument prototype would still apply. */
16380_ACEOF 14271char res_query ();
16381cat confdefs.h >>conftest.$ac_ext 14272int
16382cat >>conftest.$ac_ext <<_ACEOF 14273main ()
16383/* end confdefs.h. */ 14274{
16384#include <$ac_header> 14275res_query ();
14276 ;
14277 return 0;
14278}
16385_ACEOF 14279_ACEOF
16386if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 14280rm -f conftest.$ac_objext conftest$ac_exeext
16387 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 14281if { (eval echo "$as_me:14281: \"$ac_link\"") >&5
14282 (eval $ac_link) 2>&5
16388 ac_status=$? 14283 ac_status=$?
16389 grep -v '^ *+' conftest.er1 >conftest.err 14284 echo "$as_me:14284: \$? = $ac_status" >&5
16390 rm -f conftest.er1 14285 (exit $ac_status); } &&
16391 cat conftest.err >&5 14286 { ac_try='test -s conftest$ac_exeext'
16392 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14287 { (eval echo "$as_me:14287: \"$ac_try\"") >&5
16393 (exit $ac_status); } >/dev/null; then 14288 (eval $ac_try) 2>&5
16394 if test -s conftest.err; then 14289 ac_status=$?
16395 ac_cpp_err=$ac_c_preproc_warn_flag 14290 echo "$as_me:14290: \$? = $ac_status" >&5
16396 else 14291 (exit $ac_status); }; }; then
16397 ac_cpp_err= 14292 ac_cv_search_res_query="-l$ac_lib"
16398 fi 14293break
16399else
16400 ac_cpp_err=yes
16401fi
16402if test -z "$ac_cpp_err"; then
16403 ac_header_preproc=yes
16404else 14294else
16405 echo "$as_me: failed program was:" >&5 14295 echo "$as_me: failed program was:" >&5
16406sed 's/^/| /' conftest.$ac_ext >&5 14296cat conftest.$ac_ext >&5
16407
16408 ac_header_preproc=no
16409fi 14297fi
16410rm -f conftest.err conftest.$ac_ext 14298rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16411echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 14299 done
16412echo "${ECHO_T}$ac_header_preproc" >&6
16413
16414# So? What about this header?
16415case $ac_header_compiler:$ac_header_preproc in
16416 yes:no )
16417 { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
16418echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
16419 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16420echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16421 (
16422 cat <<\_ASBOX
16423## ------------------------------------ ##
16424## Report this to bug-autoconf@gnu.org. ##
16425## ------------------------------------ ##
16426_ASBOX
16427 ) |
16428 sed "s/^/$as_me: WARNING: /" >&2
16429 ;;
16430 no:yes )
16431 { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
16432echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
16433 { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
16434echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
16435 { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
16436echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
16437 (
16438 cat <<\_ASBOX
16439## ------------------------------------ ##
16440## Report this to bug-autoconf@gnu.org. ##
16441## ------------------------------------ ##
16442_ASBOX
16443 ) |
16444 sed "s/^/$as_me: WARNING: /" >&2
16445 ;;
16446esac
16447echo "$as_me:$LINENO: checking for $ac_header" >&5
16448echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16449if eval "test \"\${$as_ac_Header+set}\" = set"; then
16450 echo $ECHO_N "(cached) $ECHO_C" >&6
16451else
16452 eval "$as_ac_Header=$ac_header_preproc"
16453fi 14300fi
16454echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 14301LIBS=$ac_func_search_save_LIBS
16455echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16456
16457fi 14302fi
16458if test `eval echo '${'$as_ac_Header'}'` = yes; then 14303echo "$as_me:14303: result: $ac_cv_search_res_query" >&5
16459 cat >>confdefs.h <<_ACEOF 14304echo "${ECHO_T}$ac_cv_search_res_query" >&6
16460#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 14305if test "$ac_cv_search_res_query" != no; then
16461_ACEOF 14306 test "$ac_cv_search_res_query" = "none required" || LIBS="$ac_cv_search_res_query $LIBS"
16462 14307
16463fi 14308fi
16464 14309
16465done 14310 echo "$as_me:14310: checking for library containing dn_expand" >&5
16466 14311echo $ECHO_N "checking for library containing dn_expand... $ECHO_C" >&6
16467 if test "$ac_cv_header_krb_h" != yes; then 14312if test "${ac_cv_search_dn_expand+set}" = set; then
16468 { echo "$as_me:$LINENO: WARNING: Cannot find krb.h, build may fail" >&5
16469echo "$as_me: WARNING: Cannot find krb.h, build may fail" >&2;}
16470 fi
16471
16472echo "$as_me:$LINENO: checking for main in -lkrb" >&5
16473echo $ECHO_N "checking for main in -lkrb... $ECHO_C" >&6
16474if test "${ac_cv_lib_krb_main+set}" = set; then
16475 echo $ECHO_N "(cached) $ECHO_C" >&6 14313 echo $ECHO_N "(cached) $ECHO_C" >&6
16476else 14314else
16477 ac_check_lib_save_LIBS=$LIBS 14315 ac_func_search_save_LIBS=$LIBS
16478LIBS="-lkrb $LIBS" 14316ac_cv_search_dn_expand=no
16479cat >conftest.$ac_ext <<_ACEOF 14317cat >conftest.$ac_ext <<_ACEOF
16480#line $LINENO "configure" 14318#line 14318 "configure"
16481/* confdefs.h. */ 14319#include "confdefs.h"
16482_ACEOF
16483cat confdefs.h >>conftest.$ac_ext
16484cat >>conftest.$ac_ext <<_ACEOF
16485/* end confdefs.h. */
16486
16487 14320
14321/* Override any gcc2 internal prototype to avoid an error. */
14322#ifdef __cplusplus
14323extern "C"
14324#endif
14325/* We use char because int might match the return type of a gcc2
14326 builtin and then its argument prototype would still apply. */
14327char dn_expand ();
16488int 14328int
16489main () 14329main ()
16490{ 14330{
16491main (); 14331dn_expand ();
16492 ; 14332 ;
16493 return 0; 14333 return 0;
16494} 14334}
16495_ACEOF 14335_ACEOF
16496rm -f conftest.$ac_objext conftest$ac_exeext 14336rm -f conftest.$ac_objext conftest$ac_exeext
16497if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14337if { (eval echo "$as_me:14337: \"$ac_link\"") >&5
16498 (eval $ac_link) 2>&5 14338 (eval $ac_link) 2>&5
16499 ac_status=$? 14339 ac_status=$?
16500 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14340 echo "$as_me:14340: \$? = $ac_status" >&5
16501 (exit $ac_status); } && 14341 (exit $ac_status); } &&
16502 { ac_try='test -s conftest$ac_exeext' 14342 { ac_try='test -s conftest$ac_exeext'
16503 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14343 { (eval echo "$as_me:14343: \"$ac_try\"") >&5
16504 (eval $ac_try) 2>&5 14344 (eval $ac_try) 2>&5
16505 ac_status=$? 14345 ac_status=$?
16506 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14346 echo "$as_me:14346: \$? = $ac_status" >&5
16507 (exit $ac_status); }; }; then 14347 (exit $ac_status); }; }; then
16508 ac_cv_lib_krb_main=yes 14348 ac_cv_search_dn_expand="none required"
16509else 14349else
16510 echo "$as_me: failed program was:" >&5 14350 echo "$as_me: failed program was:" >&5
16511sed 's/^/| /' conftest.$ac_ext >&5 14351cat conftest.$ac_ext >&5
14352fi
14353rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14354if test "$ac_cv_search_dn_expand" = no; then
14355 for ac_lib in resolv; do
14356 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
14357 cat >conftest.$ac_ext <<_ACEOF
14358#line 14358 "configure"
14359#include "confdefs.h"
16512 14360
16513ac_cv_lib_krb_main=no 14361/* Override any gcc2 internal prototype to avoid an error. */
14362#ifdef __cplusplus
14363extern "C"
14364#endif
14365/* We use char because int might match the return type of a gcc2
14366 builtin and then its argument prototype would still apply. */
14367char dn_expand ();
14368int
14369main ()
14370{
14371dn_expand ();
14372 ;
14373 return 0;
14374}
14375_ACEOF
14376rm -f conftest.$ac_objext conftest$ac_exeext
14377if { (eval echo "$as_me:14377: \"$ac_link\"") >&5
14378 (eval $ac_link) 2>&5
14379 ac_status=$?
14380 echo "$as_me:14380: \$? = $ac_status" >&5
14381 (exit $ac_status); } &&
14382 { ac_try='test -s conftest$ac_exeext'
14383 { (eval echo "$as_me:14383: \"$ac_try\"") >&5
14384 (eval $ac_try) 2>&5
14385 ac_status=$?
14386 echo "$as_me:14386: \$? = $ac_status" >&5
14387 (exit $ac_status); }; }; then
14388 ac_cv_search_dn_expand="-l$ac_lib"
14389break
14390else
14391 echo "$as_me: failed program was:" >&5
14392cat conftest.$ac_ext >&5
16514fi 14393fi
16515rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14394rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16516LIBS=$ac_check_lib_save_LIBS 14395 done
16517fi 14396fi
16518echo "$as_me:$LINENO: result: $ac_cv_lib_krb_main" >&5 14397LIBS=$ac_func_search_save_LIBS
16519echo "${ECHO_T}$ac_cv_lib_krb_main" >&6
16520if test $ac_cv_lib_krb_main = yes; then
16521 cat >>confdefs.h <<_ACEOF
16522#define HAVE_LIBKRB 1
16523_ACEOF
16524
16525 LIBS="-lkrb $LIBS"
16526
16527fi 14398fi
14399echo "$as_me:14399: result: $ac_cv_search_dn_expand" >&5
14400echo "${ECHO_T}$ac_cv_search_dn_expand" >&6
14401if test "$ac_cv_search_dn_expand" != no; then
14402 test "$ac_cv_search_dn_expand" = "none required" || LIBS="$ac_cv_search_dn_expand $LIBS"
16528 14403
16529 if test "$ac_cv_lib_krb_main" != yes; then 14404fi
16530 14405
16531echo "$as_me:$LINENO: checking for main in -lkrb4" >&5 14406for ac_func in _getshort _getlong
16532echo $ECHO_N "checking for main in -lkrb4... $ECHO_C" >&6 14407do
16533if test "${ac_cv_lib_krb4_main+set}" = set; then 14408as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
14409echo "$as_me:14409: checking for $ac_func" >&5
14410echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
14411if eval "test \"\${$as_ac_var+set}\" = set"; then
16534 echo $ECHO_N "(cached) $ECHO_C" >&6 14412 echo $ECHO_N "(cached) $ECHO_C" >&6
16535else 14413else
16536 ac_check_lib_save_LIBS=$LIBS 14414 cat >conftest.$ac_ext <<_ACEOF
16537LIBS="-lkrb4 $LIBS" 14415#line 14415 "configure"
16538cat >conftest.$ac_ext <<_ACEOF 14416#include "confdefs.h"
16539#line $LINENO "configure" 14417/* System header to define __stub macros and hopefully few prototypes,
16540/* confdefs.h. */ 14418 which can conflict with char $ac_func (); below. */
16541_ACEOF 14419#include <assert.h>
16542cat confdefs.h >>conftest.$ac_ext 14420/* Override any gcc2 internal prototype to avoid an error. */
16543cat >>conftest.$ac_ext <<_ACEOF 14421#ifdef __cplusplus
16544/* end confdefs.h. */ 14422extern "C"
16545 14423#endif
14424/* We use char because int might match the return type of a gcc2
14425 builtin and then its argument prototype would still apply. */
14426char $ac_func ();
14427char (*f) ();
16546 14428
16547int 14429int
16548main () 14430main ()
16549{ 14431{
16550main (); 14432/* The GNU C library defines this for functions which it implements
14433 to always fail with ENOSYS. Some functions are actually named
14434 something starting with __ and the normal name is an alias. */
14435#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
14436choke me
14437#else
14438f = $ac_func;
14439#endif
14440
16551 ; 14441 ;
16552 return 0; 14442 return 0;
16553} 14443}
16554_ACEOF 14444_ACEOF
16555rm -f conftest.$ac_objext conftest$ac_exeext 14445rm -f conftest.$ac_objext conftest$ac_exeext
16556if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14446if { (eval echo "$as_me:14446: \"$ac_link\"") >&5
16557 (eval $ac_link) 2>&5 14447 (eval $ac_link) 2>&5
16558 ac_status=$? 14448 ac_status=$?
16559 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14449 echo "$as_me:14449: \$? = $ac_status" >&5
16560 (exit $ac_status); } && 14450 (exit $ac_status); } &&
16561 { ac_try='test -s conftest$ac_exeext' 14451 { ac_try='test -s conftest$ac_exeext'
16562 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14452 { (eval echo "$as_me:14452: \"$ac_try\"") >&5
16563 (eval $ac_try) 2>&5 14453 (eval $ac_try) 2>&5
16564 ac_status=$? 14454 ac_status=$?
16565 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14455 echo "$as_me:14455: \$? = $ac_status" >&5
16566 (exit $ac_status); }; }; then 14456 (exit $ac_status); }; }; then
16567 ac_cv_lib_krb4_main=yes 14457 eval "$as_ac_var=yes"
16568else 14458else
16569 echo "$as_me: failed program was:" >&5 14459 echo "$as_me: failed program was:" >&5
16570sed 's/^/| /' conftest.$ac_ext >&5 14460cat conftest.$ac_ext >&5
16571 14461eval "$as_ac_var=no"
16572ac_cv_lib_krb4_main=no
16573fi 14462fi
16574rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14463rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16575LIBS=$ac_check_lib_save_LIBS
16576fi 14464fi
16577echo "$as_me:$LINENO: result: $ac_cv_lib_krb4_main" >&5 14465echo "$as_me:14465: result: `eval echo '${'$as_ac_var'}'`" >&5
16578echo "${ECHO_T}$ac_cv_lib_krb4_main" >&6 14466echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16579if test $ac_cv_lib_krb4_main = yes; then 14467if test `eval echo '${'$as_ac_var'}'` = yes; then
16580 cat >>confdefs.h <<_ACEOF 14468 cat >>confdefs.h <<EOF
16581#define HAVE_LIBKRB4 1 14469#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
14470EOF
14471
14472fi
14473done
14474
14475 echo "$as_me:14475: checking for HEADER.ad" >&5
14476echo $ECHO_N "checking for HEADER.ad... $ECHO_C" >&6
14477if test "${ac_cv_member_HEADER_ad+set}" = set; then
14478 echo $ECHO_N "(cached) $ECHO_C" >&6
14479else
14480 cat >conftest.$ac_ext <<_ACEOF
14481#line 14481 "configure"
14482#include "confdefs.h"
14483#include <arpa/nameser.h>
14484
14485int
14486main ()
14487{
14488static HEADER ac_aggr;
14489if (ac_aggr.ad)
14490return 0;
14491 ;
14492 return 0;
14493}
16582_ACEOF 14494_ACEOF
14495rm -f conftest.$ac_objext
14496if { (eval echo "$as_me:14496: \"$ac_compile\"") >&5
14497 (eval $ac_compile) 2>&5
14498 ac_status=$?
14499 echo "$as_me:14499: \$? = $ac_status" >&5
14500 (exit $ac_status); } &&
14501 { ac_try='test -s conftest.$ac_objext'
14502 { (eval echo "$as_me:14502: \"$ac_try\"") >&5
14503 (eval $ac_try) 2>&5
14504 ac_status=$?
14505 echo "$as_me:14505: \$? = $ac_status" >&5
14506 (exit $ac_status); }; }; then
14507 ac_cv_member_HEADER_ad=yes
14508else
14509 echo "$as_me: failed program was:" >&5
14510cat conftest.$ac_ext >&5
14511ac_cv_member_HEADER_ad=no
14512fi
14513rm -f conftest.$ac_objext conftest.$ac_ext
14514fi
14515echo "$as_me:14515: result: $ac_cv_member_HEADER_ad" >&5
14516echo "${ECHO_T}$ac_cv_member_HEADER_ad" >&6
14517if test $ac_cv_member_HEADER_ad = yes; then
14518 cat >>confdefs.h <<\EOF
14519#define HAVE_HEADER_AD 1
14520EOF
16583 14521
16584 LIBS="-lkrb4 $LIBS" 14522fi
16585 14523
16586fi 14524fi
16587 14525
16588 if test "$ac_cv_lib_krb4_main" != yes; then 14526 fi
16589 { echo "$as_me:$LINENO: WARNING: Cannot find libkrb nor libkrb4, build may fail" >&5 14527
16590echo "$as_me: WARNING: Cannot find libkrb nor libkrb4, build may fail" >&2;} 14528fi;
16591 else 14529
16592 KLIBS="-lkrb4" 14530# Check whether user wants Kerberos 5 support
16593 fi 14531KRB5_MSG="no"
16594 else 14532
16595 KLIBS="-lkrb" 14533# Check whether --with-kerberos5 or --without-kerberos5 was given.
16596 fi 14534if test "${with_kerberos5+set}" = set; then
14535 withval="$with_kerberos5"
14536
14537 if test "x$withval" != "xno" ; then
14538 if test "x$withval" = "xyes" ; then
14539 KRB5ROOT="/usr/local"
14540 else
14541 KRB5ROOT=${withval}
14542 fi
14543 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
14544 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
14545 cat >>confdefs.h <<\EOF
14546#define KRB5 1
14547EOF
14548
14549 KRB5_MSG="yes"
14550 echo "$as_me:14550: checking whether we are using Heimdal" >&5
14551echo $ECHO_N "checking whether we are using Heimdal... $ECHO_C" >&6
14552 cat >conftest.$ac_ext <<_ACEOF
14553#line 14553 "configure"
14554#include "confdefs.h"
14555 #include <krb5.h>
14556int
14557main ()
14558{
14559 char *tmp = heimdal_version;
14560 ;
14561 return 0;
14562}
14563_ACEOF
14564rm -f conftest.$ac_objext
14565if { (eval echo "$as_me:14565: \"$ac_compile\"") >&5
14566 (eval $ac_compile) 2>&5
14567 ac_status=$?
14568 echo "$as_me:14568: \$? = $ac_status" >&5
14569 (exit $ac_status); } &&
14570 { ac_try='test -s conftest.$ac_objext'
14571 { (eval echo "$as_me:14571: \"$ac_try\"") >&5
14572 (eval $ac_try) 2>&5
14573 ac_status=$?
14574 echo "$as_me:14574: \$? = $ac_status" >&5
14575 (exit $ac_status); }; }; then
14576 echo "$as_me:14576: result: yes" >&5
14577echo "${ECHO_T}yes" >&6
14578 cat >>confdefs.h <<\EOF
14579#define HEIMDAL 1
14580EOF
14581
14582 K5LIBS="-lkrb5 -ldes -lcom_err -lasn1 -lroken"
14583
14584else
14585 echo "$as_me: failed program was:" >&5
14586cat conftest.$ac_ext >&5
14587 echo "$as_me:14587: result: no" >&5
14588echo "${ECHO_T}no" >&6
14589 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
16597 14590
16598echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5 14591fi
16599echo $ECHO_N "checking for des_cbc_encrypt in -ldes... $ECHO_C" >&6 14592rm -f conftest.$ac_objext conftest.$ac_ext
16600if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then 14593 if test ! -z "$need_dash_r" ; then
14594 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
14595 fi
14596 if test ! -z "$blibpath" ; then
14597 blibpath="$blibpath:${KRB5ROOT}/lib"
14598 fi
14599 echo "$as_me:14599: checking for library containing dn_expand" >&5
14600echo $ECHO_N "checking for library containing dn_expand... $ECHO_C" >&6
14601if test "${ac_cv_search_dn_expand+set}" = set; then
16601 echo $ECHO_N "(cached) $ECHO_C" >&6 14602 echo $ECHO_N "(cached) $ECHO_C" >&6
16602else 14603else
16603 ac_check_lib_save_LIBS=$LIBS 14604 ac_func_search_save_LIBS=$LIBS
16604LIBS="-ldes $LIBS" 14605ac_cv_search_dn_expand=no
16605cat >conftest.$ac_ext <<_ACEOF 14606cat >conftest.$ac_ext <<_ACEOF
16606#line $LINENO "configure" 14607#line 14607 "configure"
16607/* confdefs.h. */ 14608#include "confdefs.h"
16608_ACEOF
16609cat confdefs.h >>conftest.$ac_ext
16610cat >>conftest.$ac_ext <<_ACEOF
16611/* end confdefs.h. */
16612 14609
16613/* Override any gcc2 internal prototype to avoid an error. */ 14610/* Override any gcc2 internal prototype to avoid an error. */
16614#ifdef __cplusplus 14611#ifdef __cplusplus
@@ -16616,64 +14613,95 @@ extern "C"
16616#endif 14613#endif
16617/* We use char because int might match the return type of a gcc2 14614/* We use char because int might match the return type of a gcc2
16618 builtin and then its argument prototype would still apply. */ 14615 builtin and then its argument prototype would still apply. */
16619char des_cbc_encrypt (); 14616char dn_expand ();
16620int 14617int
16621main () 14618main ()
16622{ 14619{
16623des_cbc_encrypt (); 14620dn_expand ();
16624 ; 14621 ;
16625 return 0; 14622 return 0;
16626} 14623}
16627_ACEOF 14624_ACEOF
16628rm -f conftest.$ac_objext conftest$ac_exeext 14625rm -f conftest.$ac_objext conftest$ac_exeext
16629if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14626if { (eval echo "$as_me:14626: \"$ac_link\"") >&5
16630 (eval $ac_link) 2>&5 14627 (eval $ac_link) 2>&5
16631 ac_status=$? 14628 ac_status=$?
16632 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14629 echo "$as_me:14629: \$? = $ac_status" >&5
16633 (exit $ac_status); } && 14630 (exit $ac_status); } &&
16634 { ac_try='test -s conftest$ac_exeext' 14631 { ac_try='test -s conftest$ac_exeext'
16635 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14632 { (eval echo "$as_me:14632: \"$ac_try\"") >&5
16636 (eval $ac_try) 2>&5 14633 (eval $ac_try) 2>&5
16637 ac_status=$? 14634 ac_status=$?
16638 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14635 echo "$as_me:14635: \$? = $ac_status" >&5
16639 (exit $ac_status); }; }; then 14636 (exit $ac_status); }; }; then
16640 ac_cv_lib_des_des_cbc_encrypt=yes 14637 ac_cv_search_dn_expand="none required"
16641else 14638else
16642 echo "$as_me: failed program was:" >&5 14639 echo "$as_me: failed program was:" >&5
16643sed 's/^/| /' conftest.$ac_ext >&5 14640cat conftest.$ac_ext >&5
14641fi
14642rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14643if test "$ac_cv_search_dn_expand" = no; then
14644 for ac_lib in resolv; do
14645 LIBS="-l$ac_lib $ac_func_search_save_LIBS"
14646 cat >conftest.$ac_ext <<_ACEOF
14647#line 14647 "configure"
14648#include "confdefs.h"
16644 14649
16645ac_cv_lib_des_des_cbc_encrypt=no 14650/* Override any gcc2 internal prototype to avoid an error. */
14651#ifdef __cplusplus
14652extern "C"
14653#endif
14654/* We use char because int might match the return type of a gcc2
14655 builtin and then its argument prototype would still apply. */
14656char dn_expand ();
14657int
14658main ()
14659{
14660dn_expand ();
14661 ;
14662 return 0;
14663}
14664_ACEOF
14665rm -f conftest.$ac_objext conftest$ac_exeext
14666if { (eval echo "$as_me:14666: \"$ac_link\"") >&5
14667 (eval $ac_link) 2>&5
14668 ac_status=$?
14669 echo "$as_me:14669: \$? = $ac_status" >&5
14670 (exit $ac_status); } &&
14671 { ac_try='test -s conftest$ac_exeext'
14672 { (eval echo "$as_me:14672: \"$ac_try\"") >&5
14673 (eval $ac_try) 2>&5
14674 ac_status=$?
14675 echo "$as_me:14675: \$? = $ac_status" >&5
14676 (exit $ac_status); }; }; then
14677 ac_cv_search_dn_expand="-l$ac_lib"
14678break
14679else
14680 echo "$as_me: failed program was:" >&5
14681cat conftest.$ac_ext >&5
16646fi 14682fi
16647rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14683rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16648LIBS=$ac_check_lib_save_LIBS 14684 done
16649fi 14685fi
16650echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5 14686LIBS=$ac_func_search_save_LIBS
16651echo "${ECHO_T}$ac_cv_lib_des_des_cbc_encrypt" >&6
16652if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
16653 cat >>confdefs.h <<_ACEOF
16654#define HAVE_LIBDES 1
16655_ACEOF
16656
16657 LIBS="-ldes $LIBS"
16658
16659fi 14687fi
14688echo "$as_me:14688: result: $ac_cv_search_dn_expand" >&5
14689echo "${ECHO_T}$ac_cv_search_dn_expand" >&6
14690if test "$ac_cv_search_dn_expand" != no; then
14691 test "$ac_cv_search_dn_expand" = "none required" || LIBS="$ac_cv_search_dn_expand $LIBS"
16660 14692
16661 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then 14693fi
16662 14694
16663echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes425" >&5 14695 echo "$as_me:14695: checking for gss_init_sec_context in -lgssapi" >&5
16664echo $ECHO_N "checking for des_cbc_encrypt in -ldes425... $ECHO_C" >&6 14696echo $ECHO_N "checking for gss_init_sec_context in -lgssapi... $ECHO_C" >&6
16665if test "${ac_cv_lib_des425_des_cbc_encrypt+set}" = set; then 14697if test "${ac_cv_lib_gssapi_gss_init_sec_context+set}" = set; then
16666 echo $ECHO_N "(cached) $ECHO_C" >&6 14698 echo $ECHO_N "(cached) $ECHO_C" >&6
16667else 14699else
16668 ac_check_lib_save_LIBS=$LIBS 14700 ac_check_lib_save_LIBS=$LIBS
16669LIBS="-ldes425 $LIBS" 14701LIBS="-lgssapi $K5LIBS $LIBS"
16670cat >conftest.$ac_ext <<_ACEOF 14702cat >conftest.$ac_ext <<_ACEOF
16671#line $LINENO "configure" 14703#line 14703 "configure"
16672/* confdefs.h. */ 14704#include "confdefs.h"
16673_ACEOF
16674cat confdefs.h >>conftest.$ac_ext
16675cat >>conftest.$ac_ext <<_ACEOF
16676/* end confdefs.h. */
16677 14705
16678/* Override any gcc2 internal prototype to avoid an error. */ 14706/* Override any gcc2 internal prototype to avoid an error. */
16679#ifdef __cplusplus 14707#ifdef __cplusplus
@@ -16681,72 +14709,55 @@ extern "C"
16681#endif 14709#endif
16682/* We use char because int might match the return type of a gcc2 14710/* We use char because int might match the return type of a gcc2
16683 builtin and then its argument prototype would still apply. */ 14711 builtin and then its argument prototype would still apply. */
16684char des_cbc_encrypt (); 14712char gss_init_sec_context ();
16685int 14713int
16686main () 14714main ()
16687{ 14715{
16688des_cbc_encrypt (); 14716gss_init_sec_context ();
16689 ; 14717 ;
16690 return 0; 14718 return 0;
16691} 14719}
16692_ACEOF 14720_ACEOF
16693rm -f conftest.$ac_objext conftest$ac_exeext 14721rm -f conftest.$ac_objext conftest$ac_exeext
16694if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14722if { (eval echo "$as_me:14722: \"$ac_link\"") >&5
16695 (eval $ac_link) 2>&5 14723 (eval $ac_link) 2>&5
16696 ac_status=$? 14724 ac_status=$?
16697 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14725 echo "$as_me:14725: \$? = $ac_status" >&5
16698 (exit $ac_status); } && 14726 (exit $ac_status); } &&
16699 { ac_try='test -s conftest$ac_exeext' 14727 { ac_try='test -s conftest$ac_exeext'
16700 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14728 { (eval echo "$as_me:14728: \"$ac_try\"") >&5
16701 (eval $ac_try) 2>&5 14729 (eval $ac_try) 2>&5
16702 ac_status=$? 14730 ac_status=$?
16703 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14731 echo "$as_me:14731: \$? = $ac_status" >&5
16704 (exit $ac_status); }; }; then 14732 (exit $ac_status); }; }; then
16705 ac_cv_lib_des425_des_cbc_encrypt=yes 14733 ac_cv_lib_gssapi_gss_init_sec_context=yes
16706else 14734else
16707 echo "$as_me: failed program was:" >&5 14735 echo "$as_me: failed program was:" >&5
16708sed 's/^/| /' conftest.$ac_ext >&5 14736cat conftest.$ac_ext >&5
16709 14737ac_cv_lib_gssapi_gss_init_sec_context=no
16710ac_cv_lib_des425_des_cbc_encrypt=no
16711fi 14738fi
16712rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14739rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16713LIBS=$ac_check_lib_save_LIBS 14740LIBS=$ac_check_lib_save_LIBS
16714fi 14741fi
16715echo "$as_me:$LINENO: result: $ac_cv_lib_des425_des_cbc_encrypt" >&5 14742echo "$as_me:14742: result: $ac_cv_lib_gssapi_gss_init_sec_context" >&5
16716echo "${ECHO_T}$ac_cv_lib_des425_des_cbc_encrypt" >&6 14743echo "${ECHO_T}$ac_cv_lib_gssapi_gss_init_sec_context" >&6
16717if test $ac_cv_lib_des425_des_cbc_encrypt = yes; then 14744if test $ac_cv_lib_gssapi_gss_init_sec_context = yes; then
16718 cat >>confdefs.h <<_ACEOF 14745 cat >>confdefs.h <<\EOF
16719#define HAVE_LIBDES425 1 14746#define GSSAPI 1
16720_ACEOF 14747EOF
16721
16722 LIBS="-ldes425 $LIBS"
16723
16724fi
16725
16726 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
16727 { echo "$as_me:$LINENO: WARNING: Cannot find libdes nor libdes425, build may fail" >&5
16728echo "$as_me: WARNING: Cannot find libdes nor libdes425, build may fail" >&2;}
16729 else
16730 KLIBS="-ldes425"
16731 fi
16732 else
16733 KLIBS="-ldes"
16734 fi
16735 14748
16736echo "$as_me:$LINENO: checking for dn_expand in -lresolv" >&5 14749 K5LIBS="-lgssapi $K5LIBS"
16737echo $ECHO_N "checking for dn_expand in -lresolv... $ECHO_C" >&6 14750else
16738if test "${ac_cv_lib_resolv_dn_expand+set}" = set; then 14751 echo "$as_me:14751: checking for gss_init_sec_context in -lgssapi_krb5" >&5
14752echo $ECHO_N "checking for gss_init_sec_context in -lgssapi_krb5... $ECHO_C" >&6
14753if test "${ac_cv_lib_gssapi_krb5_gss_init_sec_context+set}" = set; then
16739 echo $ECHO_N "(cached) $ECHO_C" >&6 14754 echo $ECHO_N "(cached) $ECHO_C" >&6
16740else 14755else
16741 ac_check_lib_save_LIBS=$LIBS 14756 ac_check_lib_save_LIBS=$LIBS
16742LIBS="-lresolv $LIBS" 14757LIBS="-lgssapi_krb5 $K5LIBS $LIBS"
16743cat >conftest.$ac_ext <<_ACEOF 14758cat >conftest.$ac_ext <<_ACEOF
16744#line $LINENO "configure" 14759#line 14759 "configure"
16745/* confdefs.h. */ 14760#include "confdefs.h"
16746_ACEOF
16747cat confdefs.h >>conftest.$ac_ext
16748cat >>conftest.$ac_ext <<_ACEOF
16749/* end confdefs.h. */
16750 14761
16751/* Override any gcc2 internal prototype to avoid an error. */ 14762/* Override any gcc2 internal prototype to avoid an error. */
16752#ifdef __cplusplus 14763#ifdef __cplusplus
@@ -16754,92 +14765,198 @@ extern "C"
16754#endif 14765#endif
16755/* We use char because int might match the return type of a gcc2 14766/* We use char because int might match the return type of a gcc2
16756 builtin and then its argument prototype would still apply. */ 14767 builtin and then its argument prototype would still apply. */
16757char dn_expand (); 14768char gss_init_sec_context ();
16758int 14769int
16759main () 14770main ()
16760{ 14771{
16761dn_expand (); 14772gss_init_sec_context ();
16762 ; 14773 ;
16763 return 0; 14774 return 0;
16764} 14775}
16765_ACEOF 14776_ACEOF
16766rm -f conftest.$ac_objext conftest$ac_exeext 14777rm -f conftest.$ac_objext conftest$ac_exeext
16767if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 14778if { (eval echo "$as_me:14778: \"$ac_link\"") >&5
16768 (eval $ac_link) 2>&5 14779 (eval $ac_link) 2>&5
16769 ac_status=$? 14780 ac_status=$?
16770 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14781 echo "$as_me:14781: \$? = $ac_status" >&5
16771 (exit $ac_status); } && 14782 (exit $ac_status); } &&
16772 { ac_try='test -s conftest$ac_exeext' 14783 { ac_try='test -s conftest$ac_exeext'
16773 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 14784 { (eval echo "$as_me:14784: \"$ac_try\"") >&5
16774 (eval $ac_try) 2>&5 14785 (eval $ac_try) 2>&5
16775 ac_status=$? 14786 ac_status=$?
16776 echo "$as_me:$LINENO: \$? = $ac_status" >&5 14787 echo "$as_me:14787: \$? = $ac_status" >&5
16777 (exit $ac_status); }; }; then 14788 (exit $ac_status); }; }; then
16778 ac_cv_lib_resolv_dn_expand=yes 14789 ac_cv_lib_gssapi_krb5_gss_init_sec_context=yes
16779else 14790else
16780 echo "$as_me: failed program was:" >&5 14791 echo "$as_me: failed program was:" >&5
16781sed 's/^/| /' conftest.$ac_ext >&5 14792cat conftest.$ac_ext >&5
16782 14793ac_cv_lib_gssapi_krb5_gss_init_sec_context=no
16783ac_cv_lib_resolv_dn_expand=no
16784fi 14794fi
16785rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 14795rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16786LIBS=$ac_check_lib_save_LIBS 14796LIBS=$ac_check_lib_save_LIBS
16787fi 14797fi
16788echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_dn_expand" >&5 14798echo "$as_me:14798: result: $ac_cv_lib_gssapi_krb5_gss_init_sec_context" >&5
16789echo "${ECHO_T}$ac_cv_lib_resolv_dn_expand" >&6 14799echo "${ECHO_T}$ac_cv_lib_gssapi_krb5_gss_init_sec_context" >&6
16790if test $ac_cv_lib_resolv_dn_expand = yes; then 14800if test $ac_cv_lib_gssapi_krb5_gss_init_sec_context = yes; then
16791 cat >>confdefs.h <<_ACEOF 14801 cat >>confdefs.h <<\EOF
16792#define HAVE_LIBRESOLV 1 14802#define GSSAPI 1
16793_ACEOF 14803EOF
16794 14804
16795 LIBS="-lresolv $LIBS" 14805 K5LIBS="-lgssapi_krb5 $K5LIBS"
14806else
14807 { echo "$as_me:14807: WARNING: Cannot find any suitable gss-api library - build may fail" >&5
14808echo "$as_me: WARNING: Cannot find any suitable gss-api library - build may fail" >&2;}
14809fi
16796 14810
16797fi 14811fi
16798 14812
16799 KRB4=yes 14813 echo "$as_me:14813: checking for gssapi.h" >&5
16800 KRB4_MSG="yes" 14814echo $ECHO_N "checking for gssapi.h... $ECHO_C" >&6
16801 cat >>confdefs.h <<\_ACEOF 14815if test "${ac_cv_header_gssapi_h+set}" = set; then
16802#define KRB4 1 14816 echo $ECHO_N "(cached) $ECHO_C" >&6
14817else
14818 cat >conftest.$ac_ext <<_ACEOF
14819#line 14819 "configure"
14820#include "confdefs.h"
14821#include <gssapi.h>
16803_ACEOF 14822_ACEOF
14823if { (eval echo "$as_me:14823: \"$ac_cpp conftest.$ac_ext\"") >&5
14824 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14825 ac_status=$?
14826 egrep -v '^ *\+' conftest.er1 >conftest.err
14827 rm -f conftest.er1
14828 cat conftest.err >&5
14829 echo "$as_me:14829: \$? = $ac_status" >&5
14830 (exit $ac_status); } >/dev/null; then
14831 if test -s conftest.err; then
14832 ac_cpp_err=$ac_c_preproc_warn_flag
14833 else
14834 ac_cpp_err=
14835 fi
14836else
14837 ac_cpp_err=yes
14838fi
14839if test -z "$ac_cpp_err"; then
14840 ac_cv_header_gssapi_h=yes
14841else
14842 echo "$as_me: failed program was:" >&5
14843 cat conftest.$ac_ext >&5
14844 ac_cv_header_gssapi_h=no
14845fi
14846rm -f conftest.err conftest.$ac_ext
14847fi
14848echo "$as_me:14848: result: $ac_cv_header_gssapi_h" >&5
14849echo "${ECHO_T}$ac_cv_header_gssapi_h" >&6
14850if test $ac_cv_header_gssapi_h = yes; then
14851 :
14852else
14853 unset ac_cv_header_gssapi_h
14854 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
16804 14855
16805 fi 14856for ac_header in gssapi.h
16806 14857do
16807 14858as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16808fi; 14859echo "$as_me:14859: checking for $ac_header" >&5
16809 14860echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16810# Check whether user wants AFS support 14861if eval "test \"\${$as_ac_Header+set}\" = set"; then
16811AFS_MSG="no" 14862 echo $ECHO_N "(cached) $ECHO_C" >&6
16812 14863else
16813# Check whether --with-afs or --without-afs was given. 14864 cat >conftest.$ac_ext <<_ACEOF
16814if test "${with_afs+set}" = set; then 14865#line 14865 "configure"
16815 withval="$with_afs" 14866#include "confdefs.h"
14867#include <$ac_header>
14868_ACEOF
14869if { (eval echo "$as_me:14869: \"$ac_cpp conftest.$ac_ext\"") >&5
14870 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14871 ac_status=$?
14872 egrep -v '^ *\+' conftest.er1 >conftest.err
14873 rm -f conftest.er1
14874 cat conftest.err >&5
14875 echo "$as_me:14875: \$? = $ac_status" >&5
14876 (exit $ac_status); } >/dev/null; then
14877 if test -s conftest.err; then
14878 ac_cpp_err=$ac_c_preproc_warn_flag
14879 else
14880 ac_cpp_err=
14881 fi
14882else
14883 ac_cpp_err=yes
14884fi
14885if test -z "$ac_cpp_err"; then
14886 eval "$as_ac_Header=yes"
14887else
14888 echo "$as_me: failed program was:" >&5
14889 cat conftest.$ac_ext >&5
14890 eval "$as_ac_Header=no"
14891fi
14892rm -f conftest.err conftest.$ac_ext
14893fi
14894echo "$as_me:14894: result: `eval echo '${'$as_ac_Header'}'`" >&5
14895echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
14896if test `eval echo '${'$as_ac_Header'}'` = yes; then
14897 cat >>confdefs.h <<EOF
14898#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
14899EOF
16816 14900
16817 if test "x$withval" != "xno" ; then 14901else
14902 { echo "$as_me:14902: WARNING: Cannot find any suitable gss-api header - build may fail" >&5
14903echo "$as_me: WARNING: Cannot find any suitable gss-api header - build may fail" >&2;}
16818 14904
16819 if test "x$withval" != "xyes" ; then 14905fi
16820 CPPFLAGS="$CPPFLAGS -I${withval}/include" 14906done
16821 LDFLAGS="$LDFLAGS -L${withval}/lib"
16822 fi
16823 14907
16824 if test -z "$KRB4" ; then 14908fi
16825 { echo "$as_me:$LINENO: WARNING: AFS requires Kerberos IV support, build may fail" >&5
16826echo "$as_me: WARNING: AFS requires Kerberos IV support, build may fail" >&2;}
16827 fi
16828 14909
16829 LIBS="-lkafs $LIBS" 14910 oldCPP="$CPPFLAGS"
16830 if test ! -z "$AFS_LIBS" ; then 14911 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
16831 LIBS="$LIBS $AFS_LIBS" 14912 echo "$as_me:14912: checking for gssapi_krb5.h" >&5
16832 fi 14913echo $ECHO_N "checking for gssapi_krb5.h... $ECHO_C" >&6
16833 cat >>confdefs.h <<\_ACEOF 14914if test "${ac_cv_header_gssapi_krb5_h+set}" = set; then
16834#define AFS 1 14915 echo $ECHO_N "(cached) $ECHO_C" >&6
14916else
14917 cat >conftest.$ac_ext <<_ACEOF
14918#line 14918 "configure"
14919#include "confdefs.h"
14920#include <gssapi_krb5.h>
16835_ACEOF 14921_ACEOF
14922if { (eval echo "$as_me:14922: \"$ac_cpp conftest.$ac_ext\"") >&5
14923 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14924 ac_status=$?
14925 egrep -v '^ *\+' conftest.er1 >conftest.err
14926 rm -f conftest.er1
14927 cat conftest.err >&5
14928 echo "$as_me:14928: \$? = $ac_status" >&5
14929 (exit $ac_status); } >/dev/null; then
14930 if test -s conftest.err; then
14931 ac_cpp_err=$ac_c_preproc_warn_flag
14932 else
14933 ac_cpp_err=
14934 fi
14935else
14936 ac_cpp_err=yes
14937fi
14938if test -z "$ac_cpp_err"; then
14939 ac_cv_header_gssapi_krb5_h=yes
14940else
14941 echo "$as_me: failed program was:" >&5
14942 cat conftest.$ac_ext >&5
14943 ac_cv_header_gssapi_krb5_h=no
14944fi
14945rm -f conftest.err conftest.$ac_ext
14946fi
14947echo "$as_me:14947: result: $ac_cv_header_gssapi_krb5_h" >&5
14948echo "${ECHO_T}$ac_cv_header_gssapi_krb5_h" >&6
14949if test $ac_cv_header_gssapi_krb5_h = yes; then
14950 :
14951else
14952 CPPFLAGS="$oldCPP"
14953fi
16836 14954
16837 AFS_MSG="yes" 14955 KRB5=yes
16838 fi 14956 fi
16839
16840 14957
16841fi; 14958fi;
16842LIBS="$LIBS $KLIBS $K5LIBS" 14959LIBS="$LIBS $K5LIBS"
16843 14960
16844# Looking for programs, paths and files 14961# Looking for programs, paths and files
16845 14962
@@ -16853,11 +14970,8 @@ if test "${with_privsep_path+set}" = set; then
16853 PRIVSEP_PATH=$withval 14970 PRIVSEP_PATH=$withval
16854 fi 14971 fi
16855 14972
16856
16857fi; 14973fi;
16858 14974
16859
16860
16861# Check whether --with-xauth or --without-xauth was given. 14975# Check whether --with-xauth or --without-xauth was given.
16862if test "${with_xauth+set}" = set; then 14976if test "${with_xauth+set}" = set; then
16863 withval="$with_xauth" 14977 withval="$with_xauth"
@@ -16875,7 +14989,7 @@ else
16875 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin" 14989 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
16876 # Extract the first word of "xauth", so it can be a program name with args. 14990 # Extract the first word of "xauth", so it can be a program name with args.
16877set dummy xauth; ac_word=$2 14991set dummy xauth; ac_word=$2
16878echo "$as_me:$LINENO: checking for $ac_word" >&5 14992echo "$as_me:14992: checking for $ac_word" >&5
16879echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 14993echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16880if test "${ac_cv_path_xauth_path+set}" = set; then 14994if test "${ac_cv_path_xauth_path+set}" = set; then
16881 echo $ECHO_N "(cached) $ECHO_C" >&6 14995 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -16885,18 +14999,16 @@ else
16885 ac_cv_path_xauth_path="$xauth_path" # Let the user override the test with a path. 14999 ac_cv_path_xauth_path="$xauth_path" # Let the user override the test with a path.
16886 ;; 15000 ;;
16887 *) 15001 *)
16888 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 15002 ac_save_IFS=$IFS; IFS=$ac_path_separator
16889for as_dir in $TestPath 15003ac_dummy="$TestPath"
16890do 15004for ac_dir in $ac_dummy; do
16891 IFS=$as_save_IFS 15005 IFS=$ac_save_IFS
16892 test -z "$as_dir" && as_dir=. 15006 test -z "$ac_dir" && ac_dir=.
16893 for ac_exec_ext in '' $ac_executable_extensions; do 15007 if $as_executable_p "$ac_dir/$ac_word"; then
16894 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 15008 ac_cv_path_xauth_path="$ac_dir/$ac_word"
16895 ac_cv_path_xauth_path="$as_dir/$ac_word$ac_exec_ext" 15009 echo "$as_me:15009: found $ac_dir/$ac_word" >&5
16896 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 15010 break
16897 break 2 15011fi
16898 fi
16899done
16900done 15012done
16901 15013
16902 ;; 15014 ;;
@@ -16905,10 +15017,10 @@ fi
16905xauth_path=$ac_cv_path_xauth_path 15017xauth_path=$ac_cv_path_xauth_path
16906 15018
16907if test -n "$xauth_path"; then 15019if test -n "$xauth_path"; then
16908 echo "$as_me:$LINENO: result: $xauth_path" >&5 15020 echo "$as_me:15020: result: $xauth_path" >&5
16909echo "${ECHO_T}$xauth_path" >&6 15021echo "${ECHO_T}$xauth_path" >&6
16910else 15022else
16911 echo "$as_me:$LINENO: result: no" >&5 15023 echo "$as_me:15023: result: no" >&5
16912echo "${ECHO_T}no" >&6 15024echo "${ECHO_T}no" >&6
16913fi 15025fi
16914 15026
@@ -16916,7 +15028,6 @@ fi
16916 xauth_path="/usr/openwin/bin/xauth" 15028 xauth_path="/usr/openwin/bin/xauth"
16917 fi 15029 fi
16918 15030
16919
16920fi; 15031fi;
16921 15032
16922STRIP_OPT=-s 15033STRIP_OPT=-s
@@ -16928,17 +15039,15 @@ if test "${enable_strip+set}" = set; then
16928 STRIP_OPT= 15039 STRIP_OPT=
16929 fi 15040 fi
16930 15041
16931
16932fi; 15042fi;
16933 15043
16934
16935if test -z "$xauth_path" ; then 15044if test -z "$xauth_path" ; then
16936 XAUTH_PATH="undefined" 15045 XAUTH_PATH="undefined"
16937 15046
16938else 15047else
16939 cat >>confdefs.h <<_ACEOF 15048 cat >>confdefs.h <<EOF
16940#define XAUTH_PATH "$xauth_path" 15049#define XAUTH_PATH "$xauth_path"
16941_ACEOF 15050EOF
16942 15051
16943 XAUTH_PATH=$xauth_path 15052 XAUTH_PATH=$xauth_path
16944 15053
@@ -16947,21 +15056,21 @@ fi
16947# Check for mail directory (last resort if we cannot get it from headers) 15056# Check for mail directory (last resort if we cannot get it from headers)
16948if test ! -z "$MAIL" ; then 15057if test ! -z "$MAIL" ; then
16949 maildir=`dirname $MAIL` 15058 maildir=`dirname $MAIL`
16950 cat >>confdefs.h <<_ACEOF 15059 cat >>confdefs.h <<EOF
16951#define MAIL_DIRECTORY "$maildir" 15060#define MAIL_DIRECTORY "$maildir"
16952_ACEOF 15061EOF
16953 15062
16954fi 15063fi
16955 15064
16956if test -z "$no_dev_ptmx" ; then 15065if test -z "$no_dev_ptmx" ; then
16957 if test "x$disable_ptmx_check" != "xyes" ; then 15066 if test "x$disable_ptmx_check" != "xyes" ; then
16958 echo "$as_me:$LINENO: checking for \"/dev/ptmx\"" >&5 15067 echo "$as_me:15067: checking for \"/dev/ptmx\"" >&5
16959echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6 15068echo $ECHO_N "checking for \"/dev/ptmx\"... $ECHO_C" >&6
16960if test "${ac_cv_file___dev_ptmx_+set}" = set; then 15069if test "${ac_cv_file___dev_ptmx_+set}" = set; then
16961 echo $ECHO_N "(cached) $ECHO_C" >&6 15070 echo $ECHO_N "(cached) $ECHO_C" >&6
16962else 15071else
16963 test "$cross_compiling" = yes && 15072 test "$cross_compiling" = yes &&
16964 { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 15073 { { echo "$as_me:15073: error: cannot check for file existence when cross compiling" >&5
16965echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} 15074echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
16966 { (exit 1); exit 1; }; } 15075 { (exit 1); exit 1; }; }
16967if test -r ""/dev/ptmx""; then 15076if test -r ""/dev/ptmx""; then
@@ -16970,28 +15079,27 @@ else
16970 ac_cv_file___dev_ptmx_=no 15079 ac_cv_file___dev_ptmx_=no
16971fi 15080fi
16972fi 15081fi
16973echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptmx_" >&5 15082echo "$as_me:15082: result: $ac_cv_file___dev_ptmx_" >&5
16974echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6 15083echo "${ECHO_T}$ac_cv_file___dev_ptmx_" >&6
16975if test $ac_cv_file___dev_ptmx_ = yes; then 15084if test $ac_cv_file___dev_ptmx_ = yes; then
16976 15085
16977 cat >>confdefs.h <<_ACEOF 15086 cat >>confdefs.h <<EOF
16978#define HAVE_DEV_PTMX 1 15087#define HAVE_DEV_PTMX 1
16979_ACEOF 15088EOF
16980 15089
16981 have_dev_ptmx=1 15090 have_dev_ptmx=1
16982 15091
16983
16984fi 15092fi
16985 15093
16986 fi 15094 fi
16987fi 15095fi
16988echo "$as_me:$LINENO: checking for \"/dev/ptc\"" >&5 15096echo "$as_me:15096: checking for \"/dev/ptc\"" >&5
16989echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6 15097echo $ECHO_N "checking for \"/dev/ptc\"... $ECHO_C" >&6
16990if test "${ac_cv_file___dev_ptc_+set}" = set; then 15098if test "${ac_cv_file___dev_ptc_+set}" = set; then
16991 echo $ECHO_N "(cached) $ECHO_C" >&6 15099 echo $ECHO_N "(cached) $ECHO_C" >&6
16992else 15100else
16993 test "$cross_compiling" = yes && 15101 test "$cross_compiling" = yes &&
16994 { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 15102 { { echo "$as_me:15102: error: cannot check for file existence when cross compiling" >&5
16995echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} 15103echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
16996 { (exit 1); exit 1; }; } 15104 { (exit 1); exit 1; }; }
16997if test -r ""/dev/ptc""; then 15105if test -r ""/dev/ptc""; then
@@ -17000,20 +15108,18 @@ else
17000 ac_cv_file___dev_ptc_=no 15108 ac_cv_file___dev_ptc_=no
17001fi 15109fi
17002fi 15110fi
17003echo "$as_me:$LINENO: result: $ac_cv_file___dev_ptc_" >&5 15111echo "$as_me:15111: result: $ac_cv_file___dev_ptc_" >&5
17004echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6 15112echo "${ECHO_T}$ac_cv_file___dev_ptc_" >&6
17005if test $ac_cv_file___dev_ptc_ = yes; then 15113if test $ac_cv_file___dev_ptc_ = yes; then
17006 15114
17007 cat >>confdefs.h <<_ACEOF 15115 cat >>confdefs.h <<EOF
17008#define HAVE_DEV_PTS_AND_PTC 1 15116#define HAVE_DEV_PTS_AND_PTC 1
17009_ACEOF 15117EOF
17010 15118
17011 have_dev_ptc=1 15119 have_dev_ptc=1
17012 15120
17013
17014fi 15121fi
17015 15122
17016
17017# Options from here on. Some of these are preset by platform above 15123# Options from here on. Some of these are preset by platform above
17018 15124
17019# Check whether --with-mantype or --without-mantype was given. 15125# Check whether --with-mantype or --without-mantype was given.
@@ -17025,13 +15131,12 @@ if test "${with_mantype+set}" = set; then
17025 MANTYPE=$withval 15131 MANTYPE=$withval
17026 ;; 15132 ;;
17027 *) 15133 *)
17028 { { echo "$as_me:$LINENO: error: invalid man type: $withval" >&5 15134 { { echo "$as_me:15134: error: invalid man type: $withval" >&5
17029echo "$as_me: error: invalid man type: $withval" >&2;} 15135echo "$as_me: error: invalid man type: $withval" >&2;}
17030 { (exit 1); exit 1; }; } 15136 { (exit 1); exit 1; }; }
17031 ;; 15137 ;;
17032 esac 15138 esac
17033 15139
17034
17035fi; 15140fi;
17036if test -z "$MANTYPE"; then 15141if test -z "$MANTYPE"; then
17037 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb" 15142 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
@@ -17039,7 +15144,7 @@ if test -z "$MANTYPE"; then
17039do 15144do
17040 # Extract the first word of "$ac_prog", so it can be a program name with args. 15145 # Extract the first word of "$ac_prog", so it can be a program name with args.
17041set dummy $ac_prog; ac_word=$2 15146set dummy $ac_prog; ac_word=$2
17042echo "$as_me:$LINENO: checking for $ac_word" >&5 15147echo "$as_me:15147: checking for $ac_word" >&5
17043echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 15148echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
17044if test "${ac_cv_path_NROFF+set}" = set; then 15149if test "${ac_cv_path_NROFF+set}" = set; then
17045 echo $ECHO_N "(cached) $ECHO_C" >&6 15150 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -17049,18 +15154,16 @@ else
17049 ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path. 15154 ac_cv_path_NROFF="$NROFF" # Let the user override the test with a path.
17050 ;; 15155 ;;
17051 *) 15156 *)
17052 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR 15157 ac_save_IFS=$IFS; IFS=$ac_path_separator
17053for as_dir in $TestPath 15158ac_dummy="$TestPath"
17054do 15159for ac_dir in $ac_dummy; do
17055 IFS=$as_save_IFS 15160 IFS=$ac_save_IFS
17056 test -z "$as_dir" && as_dir=. 15161 test -z "$ac_dir" && ac_dir=.
17057 for ac_exec_ext in '' $ac_executable_extensions; do 15162 if $as_executable_p "$ac_dir/$ac_word"; then
17058 if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then 15163 ac_cv_path_NROFF="$ac_dir/$ac_word"
17059 ac_cv_path_NROFF="$as_dir/$ac_word$ac_exec_ext" 15164 echo "$as_me:15164: found $ac_dir/$ac_word" >&5
17060 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 15165 break
17061 break 2 15166fi
17062 fi
17063done
17064done 15167done
17065 15168
17066 ;; 15169 ;;
@@ -17069,10 +15172,10 @@ fi
17069NROFF=$ac_cv_path_NROFF 15172NROFF=$ac_cv_path_NROFF
17070 15173
17071if test -n "$NROFF"; then 15174if test -n "$NROFF"; then
17072 echo "$as_me:$LINENO: result: $NROFF" >&5 15175 echo "$as_me:15175: result: $NROFF" >&5
17073echo "${ECHO_T}$NROFF" >&6 15176echo "${ECHO_T}$NROFF" >&6
17074else 15177else
17075 echo "$as_me:$LINENO: result: no" >&5 15178 echo "$as_me:15178: result: no" >&5
17076echo "${ECHO_T}no" >&6 15179echo "${ECHO_T}no" >&6
17077fi 15180fi
17078 15181
@@ -17095,7 +15198,6 @@ else
17095 mansubdir=$MANTYPE; 15198 mansubdir=$MANTYPE;
17096fi 15199fi
17097 15200
17098
17099# Check whether to enable MD5 passwords 15201# Check whether to enable MD5 passwords
17100MD5_MSG="no" 15202MD5_MSG="no"
17101 15203
@@ -17104,14 +15206,13 @@ if test "${with_md5_passwords+set}" = set; then
17104 withval="$with_md5_passwords" 15206 withval="$with_md5_passwords"
17105 15207
17106 if test "x$withval" != "xno" ; then 15208 if test "x$withval" != "xno" ; then
17107 cat >>confdefs.h <<\_ACEOF 15209 cat >>confdefs.h <<\EOF
17108#define HAVE_MD5_PASSWORDS 1 15210#define HAVE_MD5_PASSWORDS 1
17109_ACEOF 15211EOF
17110 15212
17111 MD5_MSG="yes" 15213 MD5_MSG="yes"
17112 fi 15214 fi
17113 15215
17114
17115fi; 15216fi;
17116 15217
17117# Whether to disable shadow password support 15218# Whether to disable shadow password support
@@ -17121,26 +15222,21 @@ if test "${with_shadow+set}" = set; then
17121 withval="$with_shadow" 15222 withval="$with_shadow"
17122 15223
17123 if test "x$withval" = "xno" ; then 15224 if test "x$withval" = "xno" ; then
17124 cat >>confdefs.h <<\_ACEOF 15225 cat >>confdefs.h <<\EOF
17125#define DISABLE_SHADOW 1 15226#define DISABLE_SHADOW 1
17126_ACEOF 15227EOF
17127 15228
17128 disable_shadow=yes 15229 disable_shadow=yes
17129 fi 15230 fi
17130 15231
17131
17132fi; 15232fi;
17133 15233
17134if test -z "$disable_shadow" ; then 15234if test -z "$disable_shadow" ; then
17135 echo "$as_me:$LINENO: checking if the systems has expire shadow information" >&5 15235 echo "$as_me:15235: checking if the systems has expire shadow information" >&5
17136echo $ECHO_N "checking if the systems has expire shadow information... $ECHO_C" >&6 15236echo $ECHO_N "checking if the systems has expire shadow information... $ECHO_C" >&6
17137 cat >conftest.$ac_ext <<_ACEOF 15237 cat >conftest.$ac_ext <<_ACEOF
17138#line $LINENO "configure" 15238#line 15238 "configure"
17139/* confdefs.h. */ 15239#include "confdefs.h"
17140_ACEOF
17141cat confdefs.h >>conftest.$ac_ext
17142cat >>conftest.$ac_ext <<_ACEOF
17143/* end confdefs.h. */
17144 15240
17145#include <sys/types.h> 15241#include <sys/types.h>
17146#include <shadow.h> 15242#include <shadow.h>
@@ -17155,36 +15251,34 @@ main ()
17155} 15251}
17156_ACEOF 15252_ACEOF
17157rm -f conftest.$ac_objext 15253rm -f conftest.$ac_objext
17158if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15254if { (eval echo "$as_me:15254: \"$ac_compile\"") >&5
17159 (eval $ac_compile) 2>&5 15255 (eval $ac_compile) 2>&5
17160 ac_status=$? 15256 ac_status=$?
17161 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15257 echo "$as_me:15257: \$? = $ac_status" >&5
17162 (exit $ac_status); } && 15258 (exit $ac_status); } &&
17163 { ac_try='test -s conftest.$ac_objext' 15259 { ac_try='test -s conftest.$ac_objext'
17164 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15260 { (eval echo "$as_me:15260: \"$ac_try\"") >&5
17165 (eval $ac_try) 2>&5 15261 (eval $ac_try) 2>&5
17166 ac_status=$? 15262 ac_status=$?
17167 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15263 echo "$as_me:15263: \$? = $ac_status" >&5
17168 (exit $ac_status); }; }; then 15264 (exit $ac_status); }; }; then
17169 sp_expire_available=yes 15265 sp_expire_available=yes
17170else 15266else
17171 echo "$as_me: failed program was:" >&5 15267 echo "$as_me: failed program was:" >&5
17172sed 's/^/| /' conftest.$ac_ext >&5 15268cat conftest.$ac_ext >&5
17173
17174
17175 15269
17176fi 15270fi
17177rm -f conftest.$ac_objext conftest.$ac_ext 15271rm -f conftest.$ac_objext conftest.$ac_ext
17178 15272
17179 if test "x$sp_expire_available" = "xyes" ; then 15273 if test "x$sp_expire_available" = "xyes" ; then
17180 echo "$as_me:$LINENO: result: yes" >&5 15274 echo "$as_me:15274: result: yes" >&5
17181echo "${ECHO_T}yes" >&6 15275echo "${ECHO_T}yes" >&6
17182 cat >>confdefs.h <<\_ACEOF 15276 cat >>confdefs.h <<\EOF
17183#define HAS_SHADOW_EXPIRE 1 15277#define HAS_SHADOW_EXPIRE 1
17184_ACEOF 15278EOF
17185 15279
17186 else 15280 else
17187 echo "$as_me:$LINENO: result: no" >&5 15281 echo "$as_me:15281: result: no" >&5
17188echo "${ECHO_T}no" >&6 15282echo "${ECHO_T}no" >&6
17189 fi 15283 fi
17190fi 15284fi
@@ -17192,9 +15286,9 @@ fi
17192# Use ip address instead of hostname in $DISPLAY 15286# Use ip address instead of hostname in $DISPLAY
17193if test ! -z "$IPADDR_IN_DISPLAY" ; then 15287if test ! -z "$IPADDR_IN_DISPLAY" ; then
17194 DISPLAY_HACK_MSG="yes" 15288 DISPLAY_HACK_MSG="yes"
17195 cat >>confdefs.h <<\_ACEOF 15289 cat >>confdefs.h <<\EOF
17196#define IPADDR_IN_DISPLAY 1 15290#define IPADDR_IN_DISPLAY 1
17197_ACEOF 15291EOF
17198 15292
17199else 15293else
17200 DISPLAY_HACK_MSG="no" 15294 DISPLAY_HACK_MSG="no"
@@ -17204,21 +15298,50 @@ if test "${with_ipaddr_display+set}" = set; then
17204 withval="$with_ipaddr_display" 15298 withval="$with_ipaddr_display"
17205 15299
17206 if test "x$withval" != "xno" ; then 15300 if test "x$withval" != "xno" ; then
17207 cat >>confdefs.h <<\_ACEOF 15301 cat >>confdefs.h <<\EOF
17208#define IPADDR_IN_DISPLAY 1 15302#define IPADDR_IN_DISPLAY 1
17209_ACEOF 15303EOF
17210 15304
17211 DISPLAY_HACK_MSG="yes" 15305 DISPLAY_HACK_MSG="yes"
17212 fi 15306 fi
17213 15307
17214
17215fi; 15308fi;
17216fi 15309fi
17217 15310
15311# check for /etc/default/login and use it if present.
15312echo "$as_me:15312: checking for \"/etc/default/login\"" >&5
15313echo $ECHO_N "checking for \"/etc/default/login\"... $ECHO_C" >&6
15314if test "${ac_cv_file___etc_default_login_+set}" = set; then
15315 echo $ECHO_N "(cached) $ECHO_C" >&6
15316else
15317 test "$cross_compiling" = yes &&
15318 { { echo "$as_me:15318: error: cannot check for file existence when cross compiling" >&5
15319echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
15320 { (exit 1); exit 1; }; }
15321if test -r ""/etc/default/login""; then
15322 ac_cv_file___etc_default_login_=yes
15323else
15324 ac_cv_file___etc_default_login_=no
15325fi
15326fi
15327echo "$as_me:15327: result: $ac_cv_file___etc_default_login_" >&5
15328echo "${ECHO_T}$ac_cv_file___etc_default_login_" >&6
15329if test $ac_cv_file___etc_default_login_ = yes; then
15330 external_path_file=/etc/default/login
15331fi
15332
15333if test "x$external_path_file" = "x/etc/default/login"; then
15334 cat >>confdefs.h <<\EOF
15335#define HAVE_ETC_DEFAULT_LOGIN 1
15336EOF
15337
15338fi
15339
17218if test $ac_cv_func_login_getcapbool = "yes" -a \ 15340if test $ac_cv_func_login_getcapbool = "yes" -a \
17219 $ac_cv_header_login_cap_h = "yes" ; then 15341 $ac_cv_header_login_cap_h = "yes" ; then
17220 USES_LOGIN_CONF=yes 15342 external_path_file=/etc/login.conf
17221fi 15343fi
15344
17222# Whether to mess with the default path 15345# Whether to mess with the default path
17223SERVER_PATH_MSG="(default)" 15346SERVER_PATH_MSG="(default)"
17224 15347
@@ -17226,34 +15349,46 @@ SERVER_PATH_MSG="(default)"
17226if test "${with_default_path+set}" = set; then 15349if test "${with_default_path+set}" = set; then
17227 withval="$with_default_path" 15350 withval="$with_default_path"
17228 15351
17229 if test "$USES_LOGIN_CONF" = "yes" ; then 15352 if test "x$external_path_file" = "x/etc/login.conf" ; then
17230 { echo "$as_me:$LINENO: WARNING: 15353 { echo "$as_me:15353: WARNING:
17231--with-default-path=PATH has no effect on this system. 15354--with-default-path=PATH has no effect on this system.
17232Edit /etc/login.conf instead." >&5 15355Edit /etc/login.conf instead." >&5
17233echo "$as_me: WARNING: 15356echo "$as_me: WARNING:
17234--with-default-path=PATH has no effect on this system. 15357--with-default-path=PATH has no effect on this system.
17235Edit /etc/login.conf instead." >&2;} 15358Edit /etc/login.conf instead." >&2;}
17236 elif test "x$withval" != "xno" ; then 15359 elif test "x$withval" != "xno" ; then
15360 if test ! -z "$external_path_file" ; then
15361 { echo "$as_me:15361: WARNING:
15362--with-default-path=PATH will only be used if PATH is not defined in
15363$external_path_file ." >&5
15364echo "$as_me: WARNING:
15365--with-default-path=PATH will only be used if PATH is not defined in
15366$external_path_file ." >&2;}
15367 fi
17237 user_path="$withval" 15368 user_path="$withval"
17238 SERVER_PATH_MSG="$withval" 15369 SERVER_PATH_MSG="$withval"
17239 fi 15370 fi
17240 15371
17241else 15372else
17242 if test "$USES_LOGIN_CONF" = "yes" ; then 15373 if test "x$external_path_file" = "x/etc/login.conf" ; then
17243 { echo "$as_me:$LINENO: WARNING: Make sure the path to scp is in /etc/login.conf" >&5 15374 { echo "$as_me:15374: WARNING: Make sure the path to scp is in /etc/login.conf" >&5
17244echo "$as_me: WARNING: Make sure the path to scp is in /etc/login.conf" >&2;} 15375echo "$as_me: WARNING: Make sure the path to scp is in /etc/login.conf" >&2;}
17245 else 15376 else
17246 if test "$cross_compiling" = yes; then 15377 if test ! -z "$external_path_file" ; then
15378 { echo "$as_me:15378: WARNING:
15379If PATH is defined in $external_path_file, ensure the path to scp is included,
15380otherwise scp will not work." >&5
15381echo "$as_me: WARNING:
15382If PATH is defined in $external_path_file, ensure the path to scp is included,
15383otherwise scp will not work." >&2;}
15384 fi
15385 if test "$cross_compiling" = yes; then
17247 user_path="/usr/bin:/bin:/usr/sbin:/sbin" 15386 user_path="/usr/bin:/bin:/usr/sbin:/sbin"
17248 15387
17249else 15388else
17250 cat >conftest.$ac_ext <<_ACEOF 15389 cat >conftest.$ac_ext <<_ACEOF
17251#line $LINENO "configure" 15390#line 15390 "configure"
17252/* confdefs.h. */ 15391#include "confdefs.h"
17253_ACEOF
17254cat confdefs.h >>conftest.$ac_ext
17255cat >>conftest.$ac_ext <<_ACEOF
17256/* end confdefs.h. */
17257 15392
17258/* find out what STDPATH is */ 15393/* find out what STDPATH is */
17259#include <stdio.h> 15394#include <stdio.h>
@@ -17289,26 +15424,24 @@ main()
17289 15424
17290_ACEOF 15425_ACEOF
17291rm -f conftest$ac_exeext 15426rm -f conftest$ac_exeext
17292if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 15427if { (eval echo "$as_me:15427: \"$ac_link\"") >&5
17293 (eval $ac_link) 2>&5 15428 (eval $ac_link) 2>&5
17294 ac_status=$? 15429 ac_status=$?
17295 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15430 echo "$as_me:15430: \$? = $ac_status" >&5
17296 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' 15431 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17297 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15432 { (eval echo "$as_me:15432: \"$ac_try\"") >&5
17298 (eval $ac_try) 2>&5 15433 (eval $ac_try) 2>&5
17299 ac_status=$? 15434 ac_status=$?
17300 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15435 echo "$as_me:15435: \$? = $ac_status" >&5
17301 (exit $ac_status); }; }; then 15436 (exit $ac_status); }; }; then
17302 user_path=`cat conftest.stdpath` 15437 user_path=`cat conftest.stdpath`
17303else 15438else
17304 echo "$as_me: program exited with status $ac_status" >&5 15439 echo "$as_me: program exited with status $ac_status" >&5
17305echo "$as_me: failed program was:" >&5 15440echo "$as_me: failed program was:" >&5
17306sed 's/^/| /' conftest.$ac_ext >&5 15441cat conftest.$ac_ext >&5
17307
17308( exit $ac_status )
17309 user_path="/usr/bin:/bin:/usr/sbin:/sbin" 15442 user_path="/usr/bin:/bin:/usr/sbin:/sbin"
17310fi 15443fi
17311rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext 15444rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17312fi 15445fi
17313# make sure $bindir is in USER_PATH so scp will work 15446# make sure $bindir is in USER_PATH so scp will work
17314 t_bindir=`eval echo ${bindir}` 15447 t_bindir=`eval echo ${bindir}`
@@ -17323,18 +15456,17 @@ fi
17323 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1 15456 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
17324 if test $? -ne 0 ; then 15457 if test $? -ne 0 ; then
17325 user_path=$user_path:$t_bindir 15458 user_path=$user_path:$t_bindir
17326 echo "$as_me:$LINENO: result: Adding $t_bindir to USER_PATH so scp will work" >&5 15459 echo "$as_me:15459: result: Adding $t_bindir to USER_PATH so scp will work" >&5
17327echo "${ECHO_T}Adding $t_bindir to USER_PATH so scp will work" >&6 15460echo "${ECHO_T}Adding $t_bindir to USER_PATH so scp will work" >&6
17328 fi 15461 fi
17329 fi 15462 fi
17330 fi 15463 fi
17331 15464
17332fi; 15465fi;
17333if test "$USES_LOGIN_CONF" != "yes" ; then 15466if test "x$external_path_file" != "x/etc/login.conf" ; then
17334 cat >>confdefs.h <<_ACEOF 15467 cat >>confdefs.h <<EOF
17335#define USER_PATH "$user_path" 15468#define USER_PATH "$user_path"
17336_ACEOF 15469EOF
17337
17338 15470
17339fi 15471fi
17340 15472
@@ -17345,36 +15477,16 @@ if test "${with_superuser_path+set}" = set; then
17345 withval="$with_superuser_path" 15477 withval="$with_superuser_path"
17346 15478
17347 if test "x$withval" != "xno" ; then 15479 if test "x$withval" != "xno" ; then
17348 cat >>confdefs.h <<_ACEOF 15480 cat >>confdefs.h <<EOF
17349#define SUPERUSER_PATH "$withval" 15481#define SUPERUSER_PATH "$withval"
17350_ACEOF 15482EOF
17351 15483
17352 superuser_path=$withval 15484 superuser_path=$withval
17353 fi 15485 fi
17354 15486
17355
17356fi;
17357
17358
17359# Whether to force IPv4 by default (needed on broken glibc Linux)
17360IPV4_HACK_MSG="no"
17361
17362# Check whether --with-ipv4-default or --without-ipv4-default was given.
17363if test "${with_ipv4_default+set}" = set; then
17364 withval="$with_ipv4_default"
17365
17366 if test "x$withval" != "xno" ; then
17367 cat >>confdefs.h <<\_ACEOF
17368#define IPV4_DEFAULT 1
17369_ACEOF
17370
17371 IPV4_HACK_MSG="yes"
17372 fi
17373
17374
17375fi; 15487fi;
17376 15488
17377echo "$as_me:$LINENO: checking if we need to convert IPv4 in IPv6-mapped addresses" >&5 15489echo "$as_me:15489: checking if we need to convert IPv4 in IPv6-mapped addresses" >&5
17378echo $ECHO_N "checking if we need to convert IPv4 in IPv6-mapped addresses... $ECHO_C" >&6 15490echo $ECHO_N "checking if we need to convert IPv4 in IPv6-mapped addresses... $ECHO_C" >&6
17379IPV4_IN6_HACK_MSG="no" 15491IPV4_IN6_HACK_MSG="no"
17380 15492
@@ -17383,34 +15495,33 @@ if test "${with_4in6+set}" = set; then
17383 withval="$with_4in6" 15495 withval="$with_4in6"
17384 15496
17385 if test "x$withval" != "xno" ; then 15497 if test "x$withval" != "xno" ; then
17386 echo "$as_me:$LINENO: result: yes" >&5 15498 echo "$as_me:15498: result: yes" >&5
17387echo "${ECHO_T}yes" >&6 15499echo "${ECHO_T}yes" >&6
17388 cat >>confdefs.h <<\_ACEOF 15500 cat >>confdefs.h <<\EOF
17389#define IPV4_IN_IPV6 1 15501#define IPV4_IN_IPV6 1
17390_ACEOF 15502EOF
17391 15503
17392 IPV4_IN6_HACK_MSG="yes" 15504 IPV4_IN6_HACK_MSG="yes"
17393 else 15505 else
17394 echo "$as_me:$LINENO: result: no" >&5 15506 echo "$as_me:15506: result: no" >&5
17395echo "${ECHO_T}no" >&6 15507echo "${ECHO_T}no" >&6
17396 fi 15508 fi
17397 15509
17398else 15510else
17399 15511
17400 if test "x$inet6_default_4in6" = "xyes"; then 15512 if test "x$inet6_default_4in6" = "xyes"; then
17401 echo "$as_me:$LINENO: result: yes (default)" >&5 15513 echo "$as_me:15513: result: yes (default)" >&5
17402echo "${ECHO_T}yes (default)" >&6 15514echo "${ECHO_T}yes (default)" >&6
17403 cat >>confdefs.h <<\_ACEOF 15515 cat >>confdefs.h <<\EOF
17404#define IPV4_IN_IPV6 1 15516#define IPV4_IN_IPV6 1
17405_ACEOF 15517EOF
17406 15518
17407 IPV4_IN6_HACK_MSG="yes" 15519 IPV4_IN6_HACK_MSG="yes"
17408 else 15520 else
17409 echo "$as_me:$LINENO: result: no (default)" >&5 15521 echo "$as_me:15521: result: no (default)" >&5
17410echo "${ECHO_T}no (default)" >&6 15522echo "${ECHO_T}no (default)" >&6
17411 fi 15523 fi
17412 15524
17413
17414fi; 15525fi;
17415 15526
17416# Whether to enable BSD auth support 15527# Whether to enable BSD auth support
@@ -17421,14 +15532,13 @@ if test "${with_bsd_auth+set}" = set; then
17421 withval="$with_bsd_auth" 15532 withval="$with_bsd_auth"
17422 15533
17423 if test "x$withval" != "xno" ; then 15534 if test "x$withval" != "xno" ; then
17424 cat >>confdefs.h <<\_ACEOF 15535 cat >>confdefs.h <<\EOF
17425#define BSD_AUTH 1 15536#define BSD_AUTH 1
17426_ACEOF 15537EOF
17427 15538
17428 BSD_AUTH_MSG=yes 15539 BSD_AUTH_MSG=yes
17429 fi 15540 fi
17430 15541
17431
17432fi; 15542fi;
17433 15543
17434# Where to place sshd.pid 15544# Where to place sshd.pid
@@ -17441,7 +15551,6 @@ if test ! -d $piddir ; then
17441 esac 15551 esac
17442fi 15552fi
17443 15553
17444
17445# Check whether --with-pid-dir or --without-pid-dir was given. 15554# Check whether --with-pid-dir or --without-pid-dir was given.
17446if test "${with_pid_dir+set}" = set; then 15555if test "${with_pid_dir+set}" = set; then
17447 withval="$with_pid_dir" 15556 withval="$with_pid_dir"
@@ -17449,90 +15558,111 @@ if test "${with_pid_dir+set}" = set; then
17449 if test "x$withval" != "xno" ; then 15558 if test "x$withval" != "xno" ; then
17450 piddir=$withval 15559 piddir=$withval
17451 if test ! -d $piddir ; then 15560 if test ! -d $piddir ; then
17452 { echo "$as_me:$LINENO: WARNING: ** no $piddir directory on this system **" >&5 15561 { echo "$as_me:15561: WARNING: ** no $piddir directory on this system **" >&5
17453echo "$as_me: WARNING: ** no $piddir directory on this system **" >&2;} 15562echo "$as_me: WARNING: ** no $piddir directory on this system **" >&2;}
17454 fi 15563 fi
17455 fi 15564 fi
17456 15565
17457
17458fi; 15566fi;
17459 15567
17460cat >>confdefs.h <<_ACEOF 15568cat >>confdefs.h <<EOF
17461#define _PATH_SSH_PIDDIR "$piddir" 15569#define _PATH_SSH_PIDDIR "$piddir"
17462_ACEOF 15570EOF
17463
17464
17465 15571
17466# Check whether --enable-lastlog or --disable-lastlog was given. 15572# Check whether --enable-lastlog or --disable-lastlog was given.
17467if test "${enable_lastlog+set}" = set; then 15573if test "${enable_lastlog+set}" = set; then
17468 enableval="$enable_lastlog" 15574 enableval="$enable_lastlog"
17469 cat >>confdefs.h <<\_ACEOF 15575
15576 if test "x$enableval" = "xno" ; then
15577 cat >>confdefs.h <<\EOF
17470#define DISABLE_LASTLOG 1 15578#define DISABLE_LASTLOG 1
17471_ACEOF 15579EOF
17472 15580
15581 fi
17473 15582
17474fi; 15583fi;
17475# Check whether --enable-utmp or --disable-utmp was given. 15584# Check whether --enable-utmp or --disable-utmp was given.
17476if test "${enable_utmp+set}" = set; then 15585if test "${enable_utmp+set}" = set; then
17477 enableval="$enable_utmp" 15586 enableval="$enable_utmp"
17478 cat >>confdefs.h <<\_ACEOF 15587
15588 if test "x$enableval" = "xno" ; then
15589 cat >>confdefs.h <<\EOF
17479#define DISABLE_UTMP 1 15590#define DISABLE_UTMP 1
17480_ACEOF 15591EOF
17481 15592
15593 fi
17482 15594
17483fi; 15595fi;
17484# Check whether --enable-utmpx or --disable-utmpx was given. 15596# Check whether --enable-utmpx or --disable-utmpx was given.
17485if test "${enable_utmpx+set}" = set; then 15597if test "${enable_utmpx+set}" = set; then
17486 enableval="$enable_utmpx" 15598 enableval="$enable_utmpx"
17487 cat >>confdefs.h <<\_ACEOF 15599
15600 if test "x$enableval" = "xno" ; then
15601 cat >>confdefs.h <<\EOF
17488#define DISABLE_UTMPX 1 15602#define DISABLE_UTMPX 1
17489_ACEOF 15603EOF
17490 15604
15605 fi
17491 15606
17492fi; 15607fi;
17493# Check whether --enable-wtmp or --disable-wtmp was given. 15608# Check whether --enable-wtmp or --disable-wtmp was given.
17494if test "${enable_wtmp+set}" = set; then 15609if test "${enable_wtmp+set}" = set; then
17495 enableval="$enable_wtmp" 15610 enableval="$enable_wtmp"
17496 cat >>confdefs.h <<\_ACEOF 15611
15612 if test "x$enableval" = "xno" ; then
15613 cat >>confdefs.h <<\EOF
17497#define DISABLE_WTMP 1 15614#define DISABLE_WTMP 1
17498_ACEOF 15615EOF
17499 15616
15617 fi
17500 15618
17501fi; 15619fi;
17502# Check whether --enable-wtmpx or --disable-wtmpx was given. 15620# Check whether --enable-wtmpx or --disable-wtmpx was given.
17503if test "${enable_wtmpx+set}" = set; then 15621if test "${enable_wtmpx+set}" = set; then
17504 enableval="$enable_wtmpx" 15622 enableval="$enable_wtmpx"
17505 cat >>confdefs.h <<\_ACEOF 15623
15624 if test "x$enableval" = "xno" ; then
15625 cat >>confdefs.h <<\EOF
17506#define DISABLE_WTMPX 1 15626#define DISABLE_WTMPX 1
17507_ACEOF 15627EOF
17508 15628
15629 fi
17509 15630
17510fi; 15631fi;
17511# Check whether --enable-libutil or --disable-libutil was given. 15632# Check whether --enable-libutil or --disable-libutil was given.
17512if test "${enable_libutil+set}" = set; then 15633if test "${enable_libutil+set}" = set; then
17513 enableval="$enable_libutil" 15634 enableval="$enable_libutil"
17514 cat >>confdefs.h <<\_ACEOF 15635
15636 if test "x$enableval" = "xno" ; then
15637 cat >>confdefs.h <<\EOF
17515#define DISABLE_LOGIN 1 15638#define DISABLE_LOGIN 1
17516_ACEOF 15639EOF
17517 15640
15641 fi
17518 15642
17519fi; 15643fi;
17520# Check whether --enable-pututline or --disable-pututline was given. 15644# Check whether --enable-pututline or --disable-pututline was given.
17521if test "${enable_pututline+set}" = set; then 15645if test "${enable_pututline+set}" = set; then
17522 enableval="$enable_pututline" 15646 enableval="$enable_pututline"
17523 cat >>confdefs.h <<\_ACEOF 15647
15648 if test "x$enableval" = "xno" ; then
15649 cat >>confdefs.h <<\EOF
17524#define DISABLE_PUTUTLINE 1 15650#define DISABLE_PUTUTLINE 1
17525_ACEOF 15651EOF
17526 15652
15653 fi
17527 15654
17528fi; 15655fi;
17529# Check whether --enable-pututxline or --disable-pututxline was given. 15656# Check whether --enable-pututxline or --disable-pututxline was given.
17530if test "${enable_pututxline+set}" = set; then 15657if test "${enable_pututxline+set}" = set; then
17531 enableval="$enable_pututxline" 15658 enableval="$enable_pututxline"
17532 cat >>confdefs.h <<\_ACEOF 15659
15660 if test "x$enableval" = "xno" ; then
15661 cat >>confdefs.h <<\EOF
17533#define DISABLE_PUTUTXLINE 1 15662#define DISABLE_PUTUTXLINE 1
17534_ACEOF 15663EOF
17535 15664
15665 fi
17536 15666
17537fi; 15667fi;
17538 15668
@@ -17541,27 +15671,21 @@ if test "${with_lastlog+set}" = set; then
17541 withval="$with_lastlog" 15671 withval="$with_lastlog"
17542 15672
17543 if test "x$withval" = "xno" ; then 15673 if test "x$withval" = "xno" ; then
17544 cat >>confdefs.h <<\_ACEOF 15674 cat >>confdefs.h <<\EOF
17545#define DISABLE_LASTLOG 1 15675#define DISABLE_LASTLOG 1
17546_ACEOF 15676EOF
17547 15677
17548 else 15678 else
17549 conf_lastlog_location=$withval 15679 conf_lastlog_location=$withval
17550 fi 15680 fi
17551 15681
17552
17553fi; 15682fi;
17554 15683
17555 15684echo "$as_me:15684: checking if your system defines LASTLOG_FILE" >&5
17556echo "$as_me:$LINENO: checking if your system defines LASTLOG_FILE" >&5
17557echo $ECHO_N "checking if your system defines LASTLOG_FILE... $ECHO_C" >&6 15685echo $ECHO_N "checking if your system defines LASTLOG_FILE... $ECHO_C" >&6
17558cat >conftest.$ac_ext <<_ACEOF 15686cat >conftest.$ac_ext <<_ACEOF
17559#line $LINENO "configure" 15687#line 15687 "configure"
17560/* confdefs.h. */ 15688#include "confdefs.h"
17561_ACEOF
17562cat confdefs.h >>conftest.$ac_ext
17563cat >>conftest.$ac_ext <<_ACEOF
17564/* end confdefs.h. */
17565 15689
17566#include <sys/types.h> 15690#include <sys/types.h>
17567#include <utmp.h> 15691#include <utmp.h>
@@ -17584,35 +15708,30 @@ main ()
17584} 15708}
17585_ACEOF 15709_ACEOF
17586rm -f conftest.$ac_objext 15710rm -f conftest.$ac_objext
17587if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15711if { (eval echo "$as_me:15711: \"$ac_compile\"") >&5
17588 (eval $ac_compile) 2>&5 15712 (eval $ac_compile) 2>&5
17589 ac_status=$? 15713 ac_status=$?
17590 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15714 echo "$as_me:15714: \$? = $ac_status" >&5
17591 (exit $ac_status); } && 15715 (exit $ac_status); } &&
17592 { ac_try='test -s conftest.$ac_objext' 15716 { ac_try='test -s conftest.$ac_objext'
17593 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15717 { (eval echo "$as_me:15717: \"$ac_try\"") >&5
17594 (eval $ac_try) 2>&5 15718 (eval $ac_try) 2>&5
17595 ac_status=$? 15719 ac_status=$?
17596 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15720 echo "$as_me:15720: \$? = $ac_status" >&5
17597 (exit $ac_status); }; }; then 15721 (exit $ac_status); }; }; then
17598 echo "$as_me:$LINENO: result: yes" >&5 15722 echo "$as_me:15722: result: yes" >&5
17599echo "${ECHO_T}yes" >&6 15723echo "${ECHO_T}yes" >&6
17600else 15724else
17601 echo "$as_me: failed program was:" >&5 15725 echo "$as_me: failed program was:" >&5
17602sed 's/^/| /' conftest.$ac_ext >&5 15726cat conftest.$ac_ext >&5
17603 15727
17604 15728 echo "$as_me:15728: result: no" >&5
17605 echo "$as_me:$LINENO: result: no" >&5
17606echo "${ECHO_T}no" >&6 15729echo "${ECHO_T}no" >&6
17607 echo "$as_me:$LINENO: checking if your system defines _PATH_LASTLOG" >&5 15730 echo "$as_me:15730: checking if your system defines _PATH_LASTLOG" >&5
17608echo $ECHO_N "checking if your system defines _PATH_LASTLOG... $ECHO_C" >&6 15731echo $ECHO_N "checking if your system defines _PATH_LASTLOG... $ECHO_C" >&6
17609 cat >conftest.$ac_ext <<_ACEOF 15732 cat >conftest.$ac_ext <<_ACEOF
17610#line $LINENO "configure" 15733#line 15733 "configure"
17611/* confdefs.h. */ 15734#include "confdefs.h"
17612_ACEOF
17613cat confdefs.h >>conftest.$ac_ext
17614cat >>conftest.$ac_ext <<_ACEOF
17615/* end confdefs.h. */
17616 15735
17617#include <sys/types.h> 15736#include <sys/types.h>
17618#include <utmp.h> 15737#include <utmp.h>
@@ -17632,32 +15751,30 @@ main ()
17632} 15751}
17633_ACEOF 15752_ACEOF
17634rm -f conftest.$ac_objext 15753rm -f conftest.$ac_objext
17635if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15754if { (eval echo "$as_me:15754: \"$ac_compile\"") >&5
17636 (eval $ac_compile) 2>&5 15755 (eval $ac_compile) 2>&5
17637 ac_status=$? 15756 ac_status=$?
17638 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15757 echo "$as_me:15757: \$? = $ac_status" >&5
17639 (exit $ac_status); } && 15758 (exit $ac_status); } &&
17640 { ac_try='test -s conftest.$ac_objext' 15759 { ac_try='test -s conftest.$ac_objext'
17641 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15760 { (eval echo "$as_me:15760: \"$ac_try\"") >&5
17642 (eval $ac_try) 2>&5 15761 (eval $ac_try) 2>&5
17643 ac_status=$? 15762 ac_status=$?
17644 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15763 echo "$as_me:15763: \$? = $ac_status" >&5
17645 (exit $ac_status); }; }; then 15764 (exit $ac_status); }; }; then
17646 echo "$as_me:$LINENO: result: yes" >&5 15765 echo "$as_me:15765: result: yes" >&5
17647echo "${ECHO_T}yes" >&6 15766echo "${ECHO_T}yes" >&6
17648else 15767else
17649 echo "$as_me: failed program was:" >&5 15768 echo "$as_me: failed program was:" >&5
17650sed 's/^/| /' conftest.$ac_ext >&5 15769cat conftest.$ac_ext >&5
17651 15770
17652 15771 echo "$as_me:15771: result: no" >&5
17653 echo "$as_me:$LINENO: result: no" >&5
17654echo "${ECHO_T}no" >&6 15772echo "${ECHO_T}no" >&6
17655 system_lastlog_path=no 15773 system_lastlog_path=no
17656 15774
17657fi 15775fi
17658rm -f conftest.$ac_objext conftest.$ac_ext 15776rm -f conftest.$ac_objext conftest.$ac_ext
17659 15777
17660
17661fi 15778fi
17662rm -f conftest.$ac_objext conftest.$ac_ext 15779rm -f conftest.$ac_objext conftest.$ac_ext
17663 15780
@@ -17669,28 +15786,24 @@ if test -z "$conf_lastlog_location"; then
17669 fi 15786 fi
17670 done 15787 done
17671 if test -z "$conf_lastlog_location"; then 15788 if test -z "$conf_lastlog_location"; then
17672 { echo "$as_me:$LINENO: WARNING: ** Cannot find lastlog **" >&5 15789 { echo "$as_me:15789: WARNING: ** Cannot find lastlog **" >&5
17673echo "$as_me: WARNING: ** Cannot find lastlog **" >&2;} 15790echo "$as_me: WARNING: ** Cannot find lastlog **" >&2;}
17674 fi 15791 fi
17675 fi 15792 fi
17676fi 15793fi
17677 15794
17678if test -n "$conf_lastlog_location"; then 15795if test -n "$conf_lastlog_location"; then
17679 cat >>confdefs.h <<_ACEOF 15796 cat >>confdefs.h <<EOF
17680#define CONF_LASTLOG_FILE "$conf_lastlog_location" 15797#define CONF_LASTLOG_FILE "$conf_lastlog_location"
17681_ACEOF 15798EOF
17682 15799
17683fi 15800fi
17684 15801
17685echo "$as_me:$LINENO: checking if your system defines UTMP_FILE" >&5 15802echo "$as_me:15802: checking if your system defines UTMP_FILE" >&5
17686echo $ECHO_N "checking if your system defines UTMP_FILE... $ECHO_C" >&6 15803echo $ECHO_N "checking if your system defines UTMP_FILE... $ECHO_C" >&6
17687cat >conftest.$ac_ext <<_ACEOF 15804cat >conftest.$ac_ext <<_ACEOF
17688#line $LINENO "configure" 15805#line 15805 "configure"
17689/* confdefs.h. */ 15806#include "confdefs.h"
17690_ACEOF
17691cat confdefs.h >>conftest.$ac_ext
17692cat >>conftest.$ac_ext <<_ACEOF
17693/* end confdefs.h. */
17694 15807
17695#include <sys/types.h> 15808#include <sys/types.h>
17696#include <utmp.h> 15809#include <utmp.h>
@@ -17707,24 +15820,23 @@ main ()
17707} 15820}
17708_ACEOF 15821_ACEOF
17709rm -f conftest.$ac_objext 15822rm -f conftest.$ac_objext
17710if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15823if { (eval echo "$as_me:15823: \"$ac_compile\"") >&5
17711 (eval $ac_compile) 2>&5 15824 (eval $ac_compile) 2>&5
17712 ac_status=$? 15825 ac_status=$?
17713 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15826 echo "$as_me:15826: \$? = $ac_status" >&5
17714 (exit $ac_status); } && 15827 (exit $ac_status); } &&
17715 { ac_try='test -s conftest.$ac_objext' 15828 { ac_try='test -s conftest.$ac_objext'
17716 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15829 { (eval echo "$as_me:15829: \"$ac_try\"") >&5
17717 (eval $ac_try) 2>&5 15830 (eval $ac_try) 2>&5
17718 ac_status=$? 15831 ac_status=$?
17719 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15832 echo "$as_me:15832: \$? = $ac_status" >&5
17720 (exit $ac_status); }; }; then 15833 (exit $ac_status); }; }; then
17721 echo "$as_me:$LINENO: result: yes" >&5 15834 echo "$as_me:15834: result: yes" >&5
17722echo "${ECHO_T}yes" >&6 15835echo "${ECHO_T}yes" >&6
17723else 15836else
17724 echo "$as_me: failed program was:" >&5 15837 echo "$as_me: failed program was:" >&5
17725sed 's/^/| /' conftest.$ac_ext >&5 15838cat conftest.$ac_ext >&5
17726 15839 echo "$as_me:15839: result: no" >&5
17727 echo "$as_me:$LINENO: result: no" >&5
17728echo "${ECHO_T}no" >&6 15840echo "${ECHO_T}no" >&6
17729 system_utmp_path=no 15841 system_utmp_path=no
17730 15842
@@ -17738,29 +15850,25 @@ if test -z "$conf_utmp_location"; then
17738 fi 15850 fi
17739 done 15851 done
17740 if test -z "$conf_utmp_location"; then 15852 if test -z "$conf_utmp_location"; then
17741 cat >>confdefs.h <<\_ACEOF 15853 cat >>confdefs.h <<\EOF
17742#define DISABLE_UTMP 1 15854#define DISABLE_UTMP 1
17743_ACEOF 15855EOF
17744 15856
17745 fi 15857 fi
17746 fi 15858 fi
17747fi 15859fi
17748if test -n "$conf_utmp_location"; then 15860if test -n "$conf_utmp_location"; then
17749 cat >>confdefs.h <<_ACEOF 15861 cat >>confdefs.h <<EOF
17750#define CONF_UTMP_FILE "$conf_utmp_location" 15862#define CONF_UTMP_FILE "$conf_utmp_location"
17751_ACEOF 15863EOF
17752 15864
17753fi 15865fi
17754 15866
17755echo "$as_me:$LINENO: checking if your system defines WTMP_FILE" >&5 15867echo "$as_me:15867: checking if your system defines WTMP_FILE" >&5
17756echo $ECHO_N "checking if your system defines WTMP_FILE... $ECHO_C" >&6 15868echo $ECHO_N "checking if your system defines WTMP_FILE... $ECHO_C" >&6
17757cat >conftest.$ac_ext <<_ACEOF 15869cat >conftest.$ac_ext <<_ACEOF
17758#line $LINENO "configure" 15870#line 15870 "configure"
17759/* confdefs.h. */ 15871#include "confdefs.h"
17760_ACEOF
17761cat confdefs.h >>conftest.$ac_ext
17762cat >>conftest.$ac_ext <<_ACEOF
17763/* end confdefs.h. */
17764 15872
17765#include <sys/types.h> 15873#include <sys/types.h>
17766#include <utmp.h> 15874#include <utmp.h>
@@ -17777,24 +15885,23 @@ main ()
17777} 15885}
17778_ACEOF 15886_ACEOF
17779rm -f conftest.$ac_objext 15887rm -f conftest.$ac_objext
17780if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15888if { (eval echo "$as_me:15888: \"$ac_compile\"") >&5
17781 (eval $ac_compile) 2>&5 15889 (eval $ac_compile) 2>&5
17782 ac_status=$? 15890 ac_status=$?
17783 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15891 echo "$as_me:15891: \$? = $ac_status" >&5
17784 (exit $ac_status); } && 15892 (exit $ac_status); } &&
17785 { ac_try='test -s conftest.$ac_objext' 15893 { ac_try='test -s conftest.$ac_objext'
17786 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15894 { (eval echo "$as_me:15894: \"$ac_try\"") >&5
17787 (eval $ac_try) 2>&5 15895 (eval $ac_try) 2>&5
17788 ac_status=$? 15896 ac_status=$?
17789 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15897 echo "$as_me:15897: \$? = $ac_status" >&5
17790 (exit $ac_status); }; }; then 15898 (exit $ac_status); }; }; then
17791 echo "$as_me:$LINENO: result: yes" >&5 15899 echo "$as_me:15899: result: yes" >&5
17792echo "${ECHO_T}yes" >&6 15900echo "${ECHO_T}yes" >&6
17793else 15901else
17794 echo "$as_me: failed program was:" >&5 15902 echo "$as_me: failed program was:" >&5
17795sed 's/^/| /' conftest.$ac_ext >&5 15903cat conftest.$ac_ext >&5
17796 15904 echo "$as_me:15904: result: no" >&5
17797 echo "$as_me:$LINENO: result: no" >&5
17798echo "${ECHO_T}no" >&6 15905echo "${ECHO_T}no" >&6
17799 system_wtmp_path=no 15906 system_wtmp_path=no
17800 15907
@@ -17808,30 +15915,25 @@ if test -z "$conf_wtmp_location"; then
17808 fi 15915 fi
17809 done 15916 done
17810 if test -z "$conf_wtmp_location"; then 15917 if test -z "$conf_wtmp_location"; then
17811 cat >>confdefs.h <<\_ACEOF 15918 cat >>confdefs.h <<\EOF
17812#define DISABLE_WTMP 1 15919#define DISABLE_WTMP 1
17813_ACEOF 15920EOF
17814 15921
17815 fi 15922 fi
17816 fi 15923 fi
17817fi 15924fi
17818if test -n "$conf_wtmp_location"; then 15925if test -n "$conf_wtmp_location"; then
17819 cat >>confdefs.h <<_ACEOF 15926 cat >>confdefs.h <<EOF
17820#define CONF_WTMP_FILE "$conf_wtmp_location" 15927#define CONF_WTMP_FILE "$conf_wtmp_location"
17821_ACEOF 15928EOF
17822 15929
17823fi 15930fi
17824 15931
17825 15932echo "$as_me:15932: checking if your system defines UTMPX_FILE" >&5
17826echo "$as_me:$LINENO: checking if your system defines UTMPX_FILE" >&5
17827echo $ECHO_N "checking if your system defines UTMPX_FILE... $ECHO_C" >&6 15933echo $ECHO_N "checking if your system defines UTMPX_FILE... $ECHO_C" >&6
17828cat >conftest.$ac_ext <<_ACEOF 15934cat >conftest.$ac_ext <<_ACEOF
17829#line $LINENO "configure" 15935#line 15935 "configure"
17830/* confdefs.h. */ 15936#include "confdefs.h"
17831_ACEOF
17832cat confdefs.h >>conftest.$ac_ext
17833cat >>conftest.$ac_ext <<_ACEOF
17834/* end confdefs.h. */
17835 15937
17836#include <sys/types.h> 15938#include <sys/types.h>
17837#include <utmp.h> 15939#include <utmp.h>
@@ -17851,24 +15953,23 @@ main ()
17851} 15953}
17852_ACEOF 15954_ACEOF
17853rm -f conftest.$ac_objext 15955rm -f conftest.$ac_objext
17854if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 15956if { (eval echo "$as_me:15956: \"$ac_compile\"") >&5
17855 (eval $ac_compile) 2>&5 15957 (eval $ac_compile) 2>&5
17856 ac_status=$? 15958 ac_status=$?
17857 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15959 echo "$as_me:15959: \$? = $ac_status" >&5
17858 (exit $ac_status); } && 15960 (exit $ac_status); } &&
17859 { ac_try='test -s conftest.$ac_objext' 15961 { ac_try='test -s conftest.$ac_objext'
17860 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 15962 { (eval echo "$as_me:15962: \"$ac_try\"") >&5
17861 (eval $ac_try) 2>&5 15963 (eval $ac_try) 2>&5
17862 ac_status=$? 15964 ac_status=$?
17863 echo "$as_me:$LINENO: \$? = $ac_status" >&5 15965 echo "$as_me:15965: \$? = $ac_status" >&5
17864 (exit $ac_status); }; }; then 15966 (exit $ac_status); }; }; then
17865 echo "$as_me:$LINENO: result: yes" >&5 15967 echo "$as_me:15967: result: yes" >&5
17866echo "${ECHO_T}yes" >&6 15968echo "${ECHO_T}yes" >&6
17867else 15969else
17868 echo "$as_me: failed program was:" >&5 15970 echo "$as_me: failed program was:" >&5
17869sed 's/^/| /' conftest.$ac_ext >&5 15971cat conftest.$ac_ext >&5
17870 15972 echo "$as_me:15972: result: no" >&5
17871 echo "$as_me:$LINENO: result: no" >&5
17872echo "${ECHO_T}no" >&6 15973echo "${ECHO_T}no" >&6
17873 system_utmpx_path=no 15974 system_utmpx_path=no
17874 15975
@@ -17876,27 +15977,23 @@ fi
17876rm -f conftest.$ac_objext conftest.$ac_ext 15977rm -f conftest.$ac_objext conftest.$ac_ext
17877if test -z "$conf_utmpx_location"; then 15978if test -z "$conf_utmpx_location"; then
17878 if test x"$system_utmpx_path" = x"no" ; then 15979 if test x"$system_utmpx_path" = x"no" ; then
17879 cat >>confdefs.h <<\_ACEOF 15980 cat >>confdefs.h <<\EOF
17880#define DISABLE_UTMPX 1 15981#define DISABLE_UTMPX 1
17881_ACEOF 15982EOF
17882 15983
17883 fi 15984 fi
17884else 15985else
17885 cat >>confdefs.h <<_ACEOF 15986 cat >>confdefs.h <<EOF
17886#define CONF_UTMPX_FILE "$conf_utmpx_location" 15987#define CONF_UTMPX_FILE "$conf_utmpx_location"
17887_ACEOF 15988EOF
17888 15989
17889fi 15990fi
17890 15991
17891echo "$as_me:$LINENO: checking if your system defines WTMPX_FILE" >&5 15992echo "$as_me:15992: checking if your system defines WTMPX_FILE" >&5
17892echo $ECHO_N "checking if your system defines WTMPX_FILE... $ECHO_C" >&6 15993echo $ECHO_N "checking if your system defines WTMPX_FILE... $ECHO_C" >&6
17893cat >conftest.$ac_ext <<_ACEOF 15994cat >conftest.$ac_ext <<_ACEOF
17894#line $LINENO "configure" 15995#line 15995 "configure"
17895/* confdefs.h. */ 15996#include "confdefs.h"
17896_ACEOF
17897cat confdefs.h >>conftest.$ac_ext
17898cat >>conftest.$ac_ext <<_ACEOF
17899/* end confdefs.h. */
17900 15997
17901#include <sys/types.h> 15998#include <sys/types.h>
17902#include <utmp.h> 15999#include <utmp.h>
@@ -17916,24 +16013,23 @@ main ()
17916} 16013}
17917_ACEOF 16014_ACEOF
17918rm -f conftest.$ac_objext 16015rm -f conftest.$ac_objext
17919if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 16016if { (eval echo "$as_me:16016: \"$ac_compile\"") >&5
17920 (eval $ac_compile) 2>&5 16017 (eval $ac_compile) 2>&5
17921 ac_status=$? 16018 ac_status=$?
17922 echo "$as_me:$LINENO: \$? = $ac_status" >&5 16019 echo "$as_me:16019: \$? = $ac_status" >&5
17923 (exit $ac_status); } && 16020 (exit $ac_status); } &&
17924 { ac_try='test -s conftest.$ac_objext' 16021 { ac_try='test -s conftest.$ac_objext'
17925 { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 16022 { (eval echo "$as_me:16022: \"$ac_try\"") >&5
17926 (eval $ac_try) 2>&5 16023 (eval $ac_try) 2>&5
17927 ac_status=$? 16024 ac_status=$?
17928 echo "$as_me:$LINENO: \$? = $ac_status" >&5 16025 echo "$as_me:16025: \$? = $ac_status" >&5
17929 (exit $ac_status); }; }; then 16026 (exit $ac_status); }; }; then
17930 echo "$as_me:$LINENO: result: yes" >&5 16027 echo "$as_me:16027: result: yes" >&5
17931echo "${ECHO_T}yes" >&6 16028echo "${ECHO_T}yes" >&6
17932else 16029else
17933 echo "$as_me: failed program was:" >&5 16030 echo "$as_me: failed program was:" >&5
17934sed 's/^/| /' conftest.$ac_ext >&5 16031cat conftest.$ac_ext >&5
17935 16032 echo "$as_me:16032: result: no" >&5
17936 echo "$as_me:$LINENO: result: no" >&5
17937echo "${ECHO_T}no" >&6 16033echo "${ECHO_T}no" >&6
17938 system_wtmpx_path=no 16034 system_wtmpx_path=no
17939 16035
@@ -17941,22 +16037,21 @@ fi
17941rm -f conftest.$ac_objext conftest.$ac_ext 16037rm -f conftest.$ac_objext conftest.$ac_ext
17942if test -z "$conf_wtmpx_location"; then 16038if test -z "$conf_wtmpx_location"; then
17943 if test x"$system_wtmpx_path" = x"no" ; then 16039 if test x"$system_wtmpx_path" = x"no" ; then
17944 cat >>confdefs.h <<\_ACEOF 16040 cat >>confdefs.h <<\EOF
17945#define DISABLE_WTMPX 1 16041#define DISABLE_WTMPX 1
17946_ACEOF 16042EOF
17947 16043
17948 fi 16044 fi
17949else 16045else
17950 cat >>confdefs.h <<_ACEOF 16046 cat >>confdefs.h <<EOF
17951#define CONF_WTMPX_FILE "$conf_wtmpx_location" 16047#define CONF_WTMPX_FILE "$conf_wtmpx_location"
17952_ACEOF 16048EOF
17953 16049
17954fi 16050fi
17955 16051
17956
17957if test ! -z "$blibpath" ; then 16052if test ! -z "$blibpath" ; then
17958 LDFLAGS="$LDFLAGS $blibflags$blibpath" 16053 LDFLAGS="$LDFLAGS $blibflags$blibpath"
17959 { echo "$as_me:$LINENO: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&5 16054 { echo "$as_me:16054: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&5
17960echo "$as_me: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&2;} 16055echo "$as_me: WARNING: Please check and edit blibpath in LDFLAGS in Makefile" >&2;}
17961fi 16056fi
17962 16057
@@ -17967,8 +16062,7 @@ if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
17967 LIBS=`echo $LIBS | sed 's/-ldl //'` 16062 LIBS=`echo $LIBS | sed 's/-ldl //'`
17968fi 16063fi
17969 16064
17970 16065ac_config_files="$ac_config_files Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds"
17971 ac_config_files="$ac_config_files Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds"
17972 16066
17973cat >confcache <<\_ACEOF 16067cat >confcache <<\_ACEOF
17974# This file is a shell script that caches the results of configure 16068# This file is a shell script that caches the results of configure
@@ -17980,7 +16074,7 @@ cat >confcache <<\_ACEOF
17980# config.status only pays attention to the cache file if you give it 16074# config.status only pays attention to the cache file if you give it
17981# the --recheck option to rerun configure. 16075# the --recheck option to rerun configure.
17982# 16076#
17983# `ac_cv_env_foo' variables (set or unset) will be overridden when 16077# `ac_cv_env_foo' variables (set or unset) will be overriden when
17984# loading this file, other *unset* `ac_cv_foo' will be assigned the 16078# loading this file, other *unset* `ac_cv_foo' will be assigned the
17985# following values. 16079# following values.
17986 16080
@@ -18015,7 +16109,7 @@ _ACEOF
18015 t end 16109 t end
18016 /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ 16110 /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18017 : end' >>confcache 16111 : end' >>confcache
18018if diff $cache_file confcache >/dev/null 2>&1; then :; else 16112if cmp -s $cache_file confcache; then :; else
18019 if test -w $cache_file; then 16113 if test -w $cache_file; then
18020 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" 16114 test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
18021 cat confcache >$cache_file 16115 cat confcache >$cache_file
@@ -18046,227 +16140,35 @@ fi
18046 16140
18047DEFS=-DHAVE_CONFIG_H 16141DEFS=-DHAVE_CONFIG_H
18048 16142
18049ac_libobjs=
18050ac_ltlibobjs=
18051for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
18052 # 1. Remove the extension, and $U if already installed.
18053 ac_i=`echo "$ac_i" |
18054 sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
18055 # 2. Add them.
18056 ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
18057 ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
18058done
18059LIBOBJS=$ac_libobjs
18060
18061LTLIBOBJS=$ac_ltlibobjs
18062
18063
18064
18065: ${CONFIG_STATUS=./config.status} 16143: ${CONFIG_STATUS=./config.status}
18066ac_clean_files_save=$ac_clean_files 16144ac_clean_files_save=$ac_clean_files
18067ac_clean_files="$ac_clean_files $CONFIG_STATUS" 16145ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18068{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 16146{ echo "$as_me:16146: creating $CONFIG_STATUS" >&5
18069echo "$as_me: creating $CONFIG_STATUS" >&6;} 16147echo "$as_me: creating $CONFIG_STATUS" >&6;}
18070cat >$CONFIG_STATUS <<_ACEOF 16148cat >$CONFIG_STATUS <<_ACEOF
18071#! $SHELL 16149#! $SHELL
18072# Generated by $as_me. 16150# Generated automatically by configure.
18073# Run this file to recreate the current configuration. 16151# Run this file to recreate the current configuration.
18074# Compiler output produced by configure, useful for debugging 16152# Compiler output produced by configure, useful for debugging
18075# configure, is in config.log if it exists. 16153# configure, is in config.log if it exists.
18076 16154
18077debug=false 16155debug=false
18078ac_cs_recheck=false
18079ac_cs_silent=false
18080SHELL=\${CONFIG_SHELL-$SHELL} 16156SHELL=\${CONFIG_SHELL-$SHELL}
16157ac_cs_invocation="\$0 \$@"
16158
18081_ACEOF 16159_ACEOF
18082 16160
18083cat >>$CONFIG_STATUS <<\_ACEOF 16161cat >>$CONFIG_STATUS <<\_ACEOF
18084## --------------------- ##
18085## M4sh Initialization. ##
18086## --------------------- ##
18087
18088# Be Bourne compatible 16162# Be Bourne compatible
18089if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then 16163if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
18090 emulate sh 16164 emulate sh
18091 NULLCMD=: 16165 NULLCMD=:
18092 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
18093 # is contrary to our usage. Disable this feature.
18094 alias -g '${1+"$@"}'='"$@"'
18095elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then 16166elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
18096 set -o posix 16167 set -o posix
18097fi 16168fi
18098 16169
18099# Support unset when possible.
18100if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18101 as_unset=unset
18102else
18103 as_unset=false
18104fi
18105
18106
18107# Work around bugs in pre-3.0 UWIN ksh.
18108$as_unset ENV MAIL MAILPATH
18109PS1='$ '
18110PS2='> '
18111PS4='+ '
18112
18113# NLS nuisances.
18114for as_var in \
18115 LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
18116 LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
18117 LC_TELEPHONE LC_TIME
18118do
18119 if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
18120 eval $as_var=C; export $as_var
18121 else
18122 $as_unset $as_var
18123 fi
18124done
18125
18126# Required to use basename.
18127if expr a : '\(a\)' >/dev/null 2>&1; then
18128 as_expr=expr
18129else
18130 as_expr=false
18131fi
18132
18133if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
18134 as_basename=basename
18135else
18136 as_basename=false
18137fi
18138
18139
18140# Name of the executable. 16170# Name of the executable.
18141as_me=`$as_basename "$0" || 16171as_me=`echo "$0" |sed 's,.*[\\/],,'`
18142$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
18143 X"$0" : 'X\(//\)$' \| \
18144 X"$0" : 'X\(/\)$' \| \
18145 . : '\(.\)' 2>/dev/null ||
18146echo X/"$0" |
18147 sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
18148 /^X\/\(\/\/\)$/{ s//\1/; q; }
18149 /^X\/\(\/\).*/{ s//\1/; q; }
18150 s/.*/./; q'`
18151
18152
18153# PATH needs CR, and LINENO needs CR and PATH.
18154# Avoid depending upon Character Ranges.
18155as_cr_letters='abcdefghijklmnopqrstuvwxyz'
18156as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
18157as_cr_Letters=$as_cr_letters$as_cr_LETTERS
18158as_cr_digits='0123456789'
18159as_cr_alnum=$as_cr_Letters$as_cr_digits
18160
18161# The user is always right.
18162if test "${PATH_SEPARATOR+set}" != set; then
18163 echo "#! /bin/sh" >conf$$.sh
18164 echo "exit 0" >>conf$$.sh
18165 chmod +x conf$$.sh
18166 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
18167 PATH_SEPARATOR=';'
18168 else
18169 PATH_SEPARATOR=:
18170 fi
18171 rm -f conf$$.sh
18172fi
18173
18174
18175 as_lineno_1=$LINENO
18176 as_lineno_2=$LINENO
18177 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
18178 test "x$as_lineno_1" != "x$as_lineno_2" &&
18179 test "x$as_lineno_3" = "x$as_lineno_2" || {
18180 # Find who we are. Look in the path if we contain no path at all
18181 # relative or not.
18182 case $0 in
18183 *[\\/]* ) as_myself=$0 ;;
18184 *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18185for as_dir in $PATH
18186do
18187 IFS=$as_save_IFS
18188 test -z "$as_dir" && as_dir=.
18189 test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
18190done
18191
18192 ;;
18193 esac
18194 # We did not find ourselves, most probably we were run as `sh COMMAND'
18195 # in which case we are not to be found in the path.
18196 if test "x$as_myself" = x; then
18197 as_myself=$0
18198 fi
18199 if test ! -f "$as_myself"; then
18200 { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
18201echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
18202 { (exit 1); exit 1; }; }
18203 fi
18204 case $CONFIG_SHELL in
18205 '')
18206 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
18207for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
18208do
18209 IFS=$as_save_IFS
18210 test -z "$as_dir" && as_dir=.
18211 for as_base in sh bash ksh sh5; do
18212 case $as_dir in
18213 /*)
18214 if ("$as_dir/$as_base" -c '
18215 as_lineno_1=$LINENO
18216 as_lineno_2=$LINENO
18217 as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
18218 test "x$as_lineno_1" != "x$as_lineno_2" &&
18219 test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
18220 $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
18221 $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
18222 CONFIG_SHELL=$as_dir/$as_base
18223 export CONFIG_SHELL
18224 exec "$CONFIG_SHELL" "$0" ${1+"$@"}
18225 fi;;
18226 esac
18227 done
18228done
18229;;
18230 esac
18231
18232 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
18233 # uniformly replaced by the line number. The first 'sed' inserts a
18234 # line-number line before each line; the second 'sed' does the real
18235 # work. The second script uses 'N' to pair each line-number line
18236 # with the numbered line, and appends trailing '-' during
18237 # substitution so that $LINENO is not a special case at line end.
18238 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
18239 # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
18240 sed '=' <$as_myself |
18241 sed '
18242 N
18243 s,$,-,
18244 : loop
18245 s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
18246 t loop
18247 s,-$,,
18248 s,^['$as_cr_digits']*\n,,
18249 ' >$as_me.lineno &&
18250 chmod +x $as_me.lineno ||
18251 { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
18252echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
18253 { (exit 1); exit 1; }; }
18254
18255 # Don't try to exec as it changes $[0], causing all sort of problems
18256 # (the dirname of $[0] is not the place where we might find the
18257 # original and so on. Autoconf is especially sensible to this).
18258 . ./$as_me.lineno
18259 # Exit status is that of the last command.
18260 exit
18261}
18262
18263
18264case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
18265 *c*,-n*) ECHO_N= ECHO_C='
18266' ECHO_T=' ' ;;
18267 *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
18268 *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
18269esac
18270 16172
18271if expr a : '\(a\)' >/dev/null 2>&1; then 16173if expr a : '\(a\)' >/dev/null 2>&1; then
18272 as_expr=expr 16174 as_expr=expr
@@ -18292,20 +16194,24 @@ else
18292fi 16194fi
18293rm -f conf$$ conf$$.exe conf$$.file 16195rm -f conf$$ conf$$.exe conf$$.file
18294 16196
18295if mkdir -p . 2>/dev/null; then
18296 as_mkdir_p=:
18297else
18298 as_mkdir_p=false
18299fi
18300
18301as_executable_p="test -f" 16197as_executable_p="test -f"
18302 16198
18303# Sed expression to map a string onto a valid CPP name. 16199# Support unset when possible.
18304as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" 16200if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
18305 16201 as_unset=unset
18306# Sed expression to map a string onto a valid variable name. 16202else
18307as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" 16203 as_unset=false
16204fi
18308 16205
16206# NLS nuisances.
16207$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16208$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16209$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16210$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16211$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16212$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16213$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16214$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
18309 16215
18310# IFS 16216# IFS
18311# We need space, tab and new line, in precisely that order. 16217# We need space, tab and new line, in precisely that order.
@@ -18314,34 +16220,10 @@ as_nl='
18314IFS=" $as_nl" 16220IFS=" $as_nl"
18315 16221
18316# CDPATH. 16222# CDPATH.
18317$as_unset CDPATH 16223$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
18318 16224
18319exec 6>&1 16225exec 6>&1
18320 16226
18321# Open the log real soon, to keep \$[0] and so on meaningful, and to
18322# report actual input values of CONFIG_FILES etc. instead of their
18323# values after options handling. Logging --version etc. is OK.
18324exec 5>>config.log
18325{
18326 echo
18327 sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
18328## Running $as_me. ##
18329_ASBOX
18330} >&5
18331cat >&5 <<_CSEOF
18332
18333This file was extended by $as_me, which was
18334generated by GNU Autoconf 2.57. Invocation command line was
18335
18336 CONFIG_FILES = $CONFIG_FILES
18337 CONFIG_HEADERS = $CONFIG_HEADERS
18338 CONFIG_LINKS = $CONFIG_LINKS
18339 CONFIG_COMMANDS = $CONFIG_COMMANDS
18340 $ $0 $@
18341
18342_CSEOF
18343echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
18344echo >&5
18345_ACEOF 16227_ACEOF
18346 16228
18347# Files that config.status was made for. 16229# Files that config.status was made for.
@@ -18361,7 +16243,7 @@ if test -n "$ac_config_commands"; then
18361 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS 16243 echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
18362fi 16244fi
18363 16245
18364cat >>$CONFIG_STATUS <<\_ACEOF 16246cat >>$CONFIG_STATUS <<\EOF
18365 16247
18366ac_cs_usage="\ 16248ac_cs_usage="\
18367\`$as_me' instantiates files from templates according to the 16249\`$as_me' instantiates files from templates according to the
@@ -18371,7 +16253,6 @@ Usage: $0 [OPTIONS] [FILE]...
18371 16253
18372 -h, --help print this help, then exit 16254 -h, --help print this help, then exit
18373 -V, --version print version number, then exit 16255 -V, --version print version number, then exit
18374 -q, --quiet do not print progress messages
18375 -d, --debug don't remove temporary files 16256 -d, --debug don't remove temporary files
18376 --recheck update $as_me by reconfiguring in the same conditions 16257 --recheck update $as_me by reconfiguring in the same conditions
18377 --file=FILE[:TEMPLATE] 16258 --file=FILE[:TEMPLATE]
@@ -18386,12 +16267,12 @@ Configuration headers:
18386$config_headers 16267$config_headers
18387 16268
18388Report bugs to <bug-autoconf@gnu.org>." 16269Report bugs to <bug-autoconf@gnu.org>."
18389_ACEOF 16270EOF
18390 16271
18391cat >>$CONFIG_STATUS <<_ACEOF 16272cat >>$CONFIG_STATUS <<EOF
18392ac_cs_version="\\ 16273ac_cs_version="\\
18393config.status 16274config.status
18394configured by $0, generated by GNU Autoconf 2.57, 16275configured by $0, generated by GNU Autoconf 2.52,
18395 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" 16276 with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
18396 16277
18397Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 16278Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
@@ -18400,9 +16281,9 @@ This config.status script is free software; the Free Software Foundation
18400gives unlimited permission to copy, distribute and modify it." 16281gives unlimited permission to copy, distribute and modify it."
18401srcdir=$srcdir 16282srcdir=$srcdir
18402INSTALL="$INSTALL" 16283INSTALL="$INSTALL"
18403_ACEOF 16284EOF
18404 16285
18405cat >>$CONFIG_STATUS <<\_ACEOF 16286cat >>$CONFIG_STATUS <<\EOF
18406# If no file are specified by the user, then we need to provide default 16287# If no file are specified by the user, then we need to provide default
18407# value. By we need to know if files were specified by the user. 16288# value. By we need to know if files were specified by the user.
18408ac_need_defaults=: 16289ac_need_defaults=:
@@ -18412,30 +16293,30 @@ do
18412 --*=*) 16293 --*=*)
18413 ac_option=`expr "x$1" : 'x\([^=]*\)='` 16294 ac_option=`expr "x$1" : 'x\([^=]*\)='`
18414 ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` 16295 ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
18415 ac_shift=: 16296 shift
18416 ;; 16297 set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
18417 -*) 16298 shift
18418 ac_option=$1
18419 ac_optarg=$2
18420 ac_shift=shift
18421 ;; 16299 ;;
16300 -*);;
18422 *) # This is not an option, so the user has probably given explicit 16301 *) # This is not an option, so the user has probably given explicit
18423 # arguments. 16302 # arguments.
18424 ac_option=$1
18425 ac_need_defaults=false;; 16303 ac_need_defaults=false;;
18426 esac 16304 esac
18427 16305
18428 case $ac_option in 16306 case $1 in
18429 # Handling of the options. 16307 # Handling of the options.
18430_ACEOF 16308EOF
18431cat >>$CONFIG_STATUS <<\_ACEOF 16309cat >>$CONFIG_STATUS <<EOF
18432 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) 16310 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
18433 ac_cs_recheck=: ;; 16311 echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16312 exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16313EOF
16314cat >>$CONFIG_STATUS <<\EOF
18434 --version | --vers* | -V ) 16315 --version | --vers* | -V )
18435 echo "$ac_cs_version"; exit 0 ;; 16316 echo "$ac_cs_version"; exit 0 ;;
18436 --he | --h) 16317 --he | --h)
18437 # Conflict between --help and --header 16318 # Conflict between --help and --header
18438 { { echo "$as_me:$LINENO: error: ambiguous option: $1 16319 { { echo "$as_me:16319: error: ambiguous option: $1
18439Try \`$0 --help' for more information." >&5 16320Try \`$0 --help' for more information." >&5
18440echo "$as_me: error: ambiguous option: $1 16321echo "$as_me: error: ambiguous option: $1
18441Try \`$0 --help' for more information." >&2;} 16322Try \`$0 --help' for more information." >&2;}
@@ -18445,19 +16326,16 @@ Try \`$0 --help' for more information." >&2;}
18445 --debug | --d* | -d ) 16326 --debug | --d* | -d )
18446 debug=: ;; 16327 debug=: ;;
18447 --file | --fil | --fi | --f ) 16328 --file | --fil | --fi | --f )
18448 $ac_shift 16329 shift
18449 CONFIG_FILES="$CONFIG_FILES $ac_optarg" 16330 CONFIG_FILES="$CONFIG_FILES $1"
18450 ac_need_defaults=false;; 16331 ac_need_defaults=false;;
18451 --header | --heade | --head | --hea ) 16332 --header | --heade | --head | --hea )
18452 $ac_shift 16333 shift
18453 CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" 16334 CONFIG_HEADERS="$CONFIG_HEADERS $1"
18454 ac_need_defaults=false;; 16335 ac_need_defaults=false;;
18455 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
18456 | -silent | --silent | --silen | --sile | --sil | --si | --s)
18457 ac_cs_silent=: ;;
18458 16336
18459 # This is an error. 16337 # This is an error.
18460 -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 16338 -*) { { echo "$as_me:16338: error: unrecognized option: $1
18461Try \`$0 --help' for more information." >&5 16339Try \`$0 --help' for more information." >&5
18462echo "$as_me: error: unrecognized option: $1 16340echo "$as_me: error: unrecognized option: $1
18463Try \`$0 --help' for more information." >&2;} 16341Try \`$0 --help' for more information." >&2;}
@@ -18469,27 +16347,25 @@ Try \`$0 --help' for more information." >&2;}
18469 shift 16347 shift
18470done 16348done
18471 16349
18472ac_configure_extra_args= 16350exec 5>>config.log
16351cat >&5 << _ACEOF
18473 16352
18474if $ac_cs_silent; then 16353## ----------------------- ##
18475 exec 6>/dev/null 16354## Running config.status. ##
18476 ac_configure_extra_args="$ac_configure_extra_args --silent" 16355## ----------------------- ##
18477fi
18478 16356
18479_ACEOF 16357This file was extended by $as_me 2.52, executed with
18480cat >>$CONFIG_STATUS <<_ACEOF 16358 CONFIG_FILES = $CONFIG_FILES
18481if \$ac_cs_recheck; then 16359 CONFIG_HEADERS = $CONFIG_HEADERS
18482 echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 16360 CONFIG_LINKS = $CONFIG_LINKS
18483 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion 16361 CONFIG_COMMANDS = $CONFIG_COMMANDS
18484fi 16362 > $ac_cs_invocation
16363on `(hostname || uname -n) 2>/dev/null | sed 1q`
18485 16364
18486_ACEOF 16365_ACEOF
16366EOF
18487 16367
18488 16368cat >>$CONFIG_STATUS <<\EOF
18489
18490
18491
18492cat >>$CONFIG_STATUS <<\_ACEOF
18493for ac_config_target in $ac_config_targets 16369for ac_config_target in $ac_config_targets
18494do 16370do
18495 case "$ac_config_target" in 16371 case "$ac_config_target" in
@@ -18499,7 +16375,7 @@ do
18499 "scard/Makefile" ) CONFIG_FILES="$CONFIG_FILES scard/Makefile" ;; 16375 "scard/Makefile" ) CONFIG_FILES="$CONFIG_FILES scard/Makefile" ;;
18500 "ssh_prng_cmds" ) CONFIG_FILES="$CONFIG_FILES ssh_prng_cmds" ;; 16376 "ssh_prng_cmds" ) CONFIG_FILES="$CONFIG_FILES ssh_prng_cmds" ;;
18501 "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; 16377 "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
18502 *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 16378 *) { { echo "$as_me:16378: error: invalid argument: $ac_config_target" >&5
18503echo "$as_me: error: invalid argument: $ac_config_target" >&2;} 16379echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
18504 { (exit 1); exit 1; }; };; 16380 { (exit 1); exit 1; }; };;
18505 esac 16381 esac
@@ -18514,9 +16390,6 @@ if $ac_need_defaults; then
18514 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers 16390 test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
18515fi 16391fi
18516 16392
18517# Have a temporary directory for convenience. Make it in the build tree
18518# simply because there is no reason to put it here, and in addition,
18519# creating and moving files from /tmp can sometimes cause problems.
18520# Create a temporary directory, and hook for its removal unless debugging. 16393# Create a temporary directory, and hook for its removal unless debugging.
18521$debug || 16394$debug ||
18522{ 16395{
@@ -18525,23 +16398,23 @@ $debug ||
18525} 16398}
18526 16399
18527# Create a (secure) tmp directory for tmp files. 16400# Create a (secure) tmp directory for tmp files.
18528 16401: ${TMPDIR=/tmp}
18529{ 16402{
18530 tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && 16403 tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
18531 test -n "$tmp" && test -d "$tmp" 16404 test -n "$tmp" && test -d "$tmp"
18532} || 16405} ||
18533{ 16406{
18534 tmp=./confstat$$-$RANDOM 16407 tmp=$TMPDIR/cs$$-$RANDOM
18535 (umask 077 && mkdir $tmp) 16408 (umask 077 && mkdir $tmp)
18536} || 16409} ||
18537{ 16410{
18538 echo "$me: cannot create a temporary directory in ." >&2 16411 echo "$me: cannot create a temporary directory in $TMPDIR" >&2
18539 { (exit 1); exit 1; } 16412 { (exit 1); exit 1; }
18540} 16413}
18541 16414
18542_ACEOF 16415EOF
18543 16416
18544cat >>$CONFIG_STATUS <<_ACEOF 16417cat >>$CONFIG_STATUS <<EOF
18545 16418
18546# 16419#
18547# CONFIG_FILES section. 16420# CONFIG_FILES section.
@@ -18554,12 +16427,6 @@ if test -n "\$CONFIG_FILES"; then
18554 sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; 16427 sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
18555 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF 16428 s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
18556s,@SHELL@,$SHELL,;t t 16429s,@SHELL@,$SHELL,;t t
18557s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
18558s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
18559s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
18560s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
18561s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
18562s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18563s,@exec_prefix@,$exec_prefix,;t t 16430s,@exec_prefix@,$exec_prefix,;t t
18564s,@prefix@,$prefix,;t t 16431s,@prefix@,$prefix,;t t
18565s,@program_transform_name@,$program_transform_name,;t t 16432s,@program_transform_name@,$program_transform_name,;t t
@@ -18575,13 +16442,19 @@ s,@includedir@,$includedir,;t t
18575s,@oldincludedir@,$oldincludedir,;t t 16442s,@oldincludedir@,$oldincludedir,;t t
18576s,@infodir@,$infodir,;t t 16443s,@infodir@,$infodir,;t t
18577s,@mandir@,$mandir,;t t 16444s,@mandir@,$mandir,;t t
16445s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16446s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16447s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16448s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16449s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
18578s,@build_alias@,$build_alias,;t t 16450s,@build_alias@,$build_alias,;t t
18579s,@host_alias@,$host_alias,;t t 16451s,@host_alias@,$host_alias,;t t
18580s,@target_alias@,$target_alias,;t t 16452s,@target_alias@,$target_alias,;t t
18581s,@DEFS@,$DEFS,;t t
18582s,@ECHO_C@,$ECHO_C,;t t 16453s,@ECHO_C@,$ECHO_C,;t t
18583s,@ECHO_N@,$ECHO_N,;t t 16454s,@ECHO_N@,$ECHO_N,;t t
18584s,@ECHO_T@,$ECHO_T,;t t 16455s,@ECHO_T@,$ECHO_T,;t t
16456s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16457s,@DEFS@,$DEFS,;t t
18585s,@LIBS@,$LIBS,;t t 16458s,@LIBS@,$LIBS,;t t
18586s,@CC@,$CC,;t t 16459s,@CC@,$CC,;t t
18587s,@CFLAGS@,$CFLAGS,;t t 16460s,@CFLAGS@,$CFLAGS,;t t
@@ -18598,6 +16471,7 @@ s,@host@,$host,;t t
18598s,@host_cpu@,$host_cpu,;t t 16471s,@host_cpu@,$host_cpu,;t t
18599s,@host_vendor@,$host_vendor,;t t 16472s,@host_vendor@,$host_vendor,;t t
18600s,@host_os@,$host_os,;t t 16473s,@host_os@,$host_os,;t t
16474s,@AWK@,$AWK,;t t
18601s,@CPP@,$CPP,;t t 16475s,@CPP@,$CPP,;t t
18602s,@RANLIB@,$RANLIB,;t t 16476s,@RANLIB@,$RANLIB,;t t
18603s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t 16477s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
@@ -18612,7 +16486,6 @@ s,@TEST_MINUS_S_SH@,$TEST_MINUS_S_SH,;t t
18612s,@SH@,$SH,;t t 16486s,@SH@,$SH,;t t
18613s,@LOGIN_PROGRAM_FALLBACK@,$LOGIN_PROGRAM_FALLBACK,;t t 16487s,@LOGIN_PROGRAM_FALLBACK@,$LOGIN_PROGRAM_FALLBACK,;t t
18614s,@LD@,$LD,;t t 16488s,@LD@,$LD,;t t
18615s,@EGREP@,$EGREP,;t t
18616s,@LIBWRAP@,$LIBWRAP,;t t 16489s,@LIBWRAP@,$LIBWRAP,;t t
18617s,@LIBPAM@,$LIBPAM,;t t 16490s,@LIBPAM@,$LIBPAM,;t t
18618s,@INSTALL_SSH_RAND_HELPER@,$INSTALL_SSH_RAND_HELPER,;t t 16491s,@INSTALL_SSH_RAND_HELPER@,$INSTALL_SSH_RAND_HELPER,;t t
@@ -18644,13 +16517,11 @@ s,@MANTYPE@,$MANTYPE,;t t
18644s,@mansubdir@,$mansubdir,;t t 16517s,@mansubdir@,$mansubdir,;t t
18645s,@user_path@,$user_path,;t t 16518s,@user_path@,$user_path,;t t
18646s,@piddir@,$piddir,;t t 16519s,@piddir@,$piddir,;t t
18647s,@LIBOBJS@,$LIBOBJS,;t t
18648s,@LTLIBOBJS@,$LTLIBOBJS,;t t
18649CEOF 16520CEOF
18650 16521
18651_ACEOF 16522EOF
18652 16523
18653 cat >>$CONFIG_STATUS <<\_ACEOF 16524 cat >>$CONFIG_STATUS <<\EOF
18654 # Split the substitutions into bite-sized pieces for seds with 16525 # Split the substitutions into bite-sized pieces for seds with
18655 # small command number limits, like on Digital OSF/1 and HP-UX. 16526 # small command number limits, like on Digital OSF/1 and HP-UX.
18656 ac_max_sed_lines=48 16527 ac_max_sed_lines=48
@@ -18689,8 +16560,8 @@ _ACEOF
18689 fi 16560 fi
18690fi # test -n "$CONFIG_FILES" 16561fi # test -n "$CONFIG_FILES"
18691 16562
18692_ACEOF 16563EOF
18693cat >>$CONFIG_STATUS <<\_ACEOF 16564cat >>$CONFIG_STATUS <<\EOF
18694for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue 16565for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18695 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". 16566 # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
18696 case $ac_file in 16567 case $ac_file in
@@ -18704,8 +16575,7 @@ for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
18704 esac 16575 esac
18705 16576
18706 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. 16577 # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
18707 ac_dir=`(dirname "$ac_file") 2>/dev/null || 16578 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18708$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
18709 X"$ac_file" : 'X\(//\)[^/]' \| \ 16579 X"$ac_file" : 'X\(//\)[^/]' \| \
18710 X"$ac_file" : 'X\(//\)$' \| \ 16580 X"$ac_file" : 'X\(//\)$' \| \
18711 X"$ac_file" : 'X\(/\)' \| \ 16581 X"$ac_file" : 'X\(/\)' \| \
@@ -18716,84 +16586,60 @@ echo X"$ac_file" |
18716 /^X\(\/\/\)$/{ s//\1/; q; } 16586 /^X\(\/\/\)$/{ s//\1/; q; }
18717 /^X\(\/\).*/{ s//\1/; q; } 16587 /^X\(\/\).*/{ s//\1/; q; }
18718 s/.*/./; q'` 16588 s/.*/./; q'`
18719 { if $as_mkdir_p; then 16589 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
18720 mkdir -p "$ac_dir" 16590 { case "$ac_dir" in
18721 else 16591 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
18722 as_dir="$ac_dir" 16592 *) as_incr_dir=.;;
18723 as_dirs= 16593esac
18724 while test ! -d "$as_dir"; do 16594as_dummy="$ac_dir"
18725 as_dirs="$as_dir $as_dirs" 16595for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
18726 as_dir=`(dirname "$as_dir") 2>/dev/null || 16596 case $as_mkdir_dir in
18727$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 16597 # Skip DOS drivespec
18728 X"$as_dir" : 'X\(//\)[^/]' \| \ 16598 ?:) as_incr_dir=$as_mkdir_dir ;;
18729 X"$as_dir" : 'X\(//\)$' \| \ 16599 *)
18730 X"$as_dir" : 'X\(/\)' \| \ 16600 as_incr_dir=$as_incr_dir/$as_mkdir_dir
18731 . : '\(.\)' 2>/dev/null || 16601 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
18732echo X"$as_dir" | 16602 ;;
18733 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } 16603 esac
18734 /^X\(\/\/\)[^/].*/{ s//\1/; q; } 16604done; }
18735 /^X\(\/\/\)$/{ s//\1/; q; }
18736 /^X\(\/\).*/{ s//\1/; q; }
18737 s/.*/./; q'`
18738 done
18739 test ! -n "$as_dirs" || mkdir $as_dirs
18740 fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
18741echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
18742 { (exit 1); exit 1; }; }; }
18743
18744 ac_builddir=.
18745 16605
18746if test "$ac_dir" != .; then 16606 ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
18747 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` 16607 # A "../" for each directory in $ac_dir_suffix.
18748 # A "../" for each directory in $ac_dir_suffix. 16608 ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
18749 ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` 16609 else
18750else 16610 ac_dir_suffix= ac_dots=
18751 ac_dir_suffix= ac_top_builddir= 16611 fi
18752fi
18753 16612
18754case $srcdir in 16613 case $srcdir in
18755 .) # No --srcdir option. We are building in place. 16614 .) ac_srcdir=.
18756 ac_srcdir=. 16615 if test -z "$ac_dots"; then
18757 if test -z "$ac_top_builddir"; then 16616 ac_top_srcdir=.
18758 ac_top_srcdir=. 16617 else
18759 else 16618 ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
18760 ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` 16619 fi ;;
18761 fi ;; 16620 [\\/]* | ?:[\\/]* )
18762 [\\/]* | ?:[\\/]* ) # Absolute path. 16621 ac_srcdir=$srcdir$ac_dir_suffix;
18763 ac_srcdir=$srcdir$ac_dir_suffix; 16622 ac_top_srcdir=$srcdir ;;
18764 ac_top_srcdir=$srcdir ;;
18765 *) # Relative path. 16623 *) # Relative path.
18766 ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix 16624 ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
18767 ac_top_srcdir=$ac_top_builddir$srcdir ;; 16625 ac_top_srcdir=$ac_dots$srcdir ;;
18768esac 16626 esac
18769# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
18770# absolute.
18771ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
18772ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
18773ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
18774ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
18775
18776 16627
18777 case $INSTALL in 16628 case $INSTALL in
18778 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; 16629 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
18779 *) ac_INSTALL=$ac_top_builddir$INSTALL ;; 16630 *) ac_INSTALL=$ac_dots$INSTALL ;;
18780 esac 16631 esac
18781 16632
18782 if test x"$ac_file" != x-; then 16633 if test x"$ac_file" != x-; then
18783 { echo "$as_me:$LINENO: creating $ac_file" >&5 16634 { echo "$as_me:16634: creating $ac_file" >&5
18784echo "$as_me: creating $ac_file" >&6;} 16635echo "$as_me: creating $ac_file" >&6;}
18785 rm -f "$ac_file" 16636 rm -f "$ac_file"
18786 fi 16637 fi
18787 # Let's still pretend it is `configure' which instantiates (i.e., don't 16638 # Let's still pretend it is `configure' which instantiates (i.e., don't
18788 # use $as_me), people would be surprised to read: 16639 # use $as_me), people would be surprised to read:
18789 # /* config.h. Generated by config.status. */ 16640 # /* config.h. Generated automatically by config.status. */
18790 if test x"$ac_file" = x-; then 16641 configure_input="Generated automatically from `echo $ac_file_in |
18791 configure_input= 16642 sed 's,.*/,,'` by configure."
18792 else
18793 configure_input="$ac_file. "
18794 fi
18795 configure_input=$configure_input"Generated from `echo $ac_file_in |
18796 sed 's,.*/,,'` by configure."
18797 16643
18798 # First look for the input files in the build tree, otherwise in the 16644 # First look for the input files in the build tree, otherwise in the
18799 # src tree. 16645 # src tree.
@@ -18803,7 +16649,7 @@ echo "$as_me: creating $ac_file" >&6;}
18803 -) echo $tmp/stdin ;; 16649 -) echo $tmp/stdin ;;
18804 [\\/$]*) 16650 [\\/$]*)
18805 # Absolute (can't be DOS-style, as IFS=:) 16651 # Absolute (can't be DOS-style, as IFS=:)
18806 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 16652 test -f "$f" || { { echo "$as_me:16652: error: cannot find input file: $f" >&5
18807echo "$as_me: error: cannot find input file: $f" >&2;} 16653echo "$as_me: error: cannot find input file: $f" >&2;}
18808 { (exit 1); exit 1; }; } 16654 { (exit 1); exit 1; }; }
18809 echo $f;; 16655 echo $f;;
@@ -18816,29 +16662,23 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
18816 echo $srcdir/$f 16662 echo $srcdir/$f
18817 else 16663 else
18818 # /dev/null tree 16664 # /dev/null tree
18819 { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 16665 { { echo "$as_me:16665: error: cannot find input file: $f" >&5
18820echo "$as_me: error: cannot find input file: $f" >&2;} 16666echo "$as_me: error: cannot find input file: $f" >&2;}
18821 { (exit 1); exit 1; }; } 16667 { (exit 1); exit 1; }; }
18822 fi;; 16668 fi;;
18823 esac 16669 esac
18824 done` || { (exit 1); exit 1; } 16670 done` || { (exit 1); exit 1; }
18825_ACEOF 16671EOF
18826cat >>$CONFIG_STATUS <<_ACEOF 16672cat >>$CONFIG_STATUS <<EOF
18827 sed "$ac_vpsub 16673 sed "$ac_vpsub
18828$extrasub 16674$extrasub
18829_ACEOF 16675EOF
18830cat >>$CONFIG_STATUS <<\_ACEOF 16676cat >>$CONFIG_STATUS <<\EOF
18831:t 16677:t
18832/@[a-zA-Z_][a-zA-Z_0-9]*@/!b 16678/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
18833s,@configure_input@,$configure_input,;t t 16679s,@configure_input@,$configure_input,;t t
18834s,@srcdir@,$ac_srcdir,;t t 16680s,@srcdir@,$ac_srcdir,;t t
18835s,@abs_srcdir@,$ac_abs_srcdir,;t t
18836s,@top_srcdir@,$ac_top_srcdir,;t t 16681s,@top_srcdir@,$ac_top_srcdir,;t t
18837s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
18838s,@builddir@,$ac_builddir,;t t
18839s,@abs_builddir@,$ac_abs_builddir,;t t
18840s,@top_builddir@,$ac_top_builddir,;t t
18841s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
18842s,@INSTALL@,$ac_INSTALL,;t t 16682s,@INSTALL@,$ac_INSTALL,;t t
18843" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out 16683" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
18844 rm -f $tmp/stdin 16684 rm -f $tmp/stdin
@@ -18850,8 +16690,8 @@ s,@INSTALL@,$ac_INSTALL,;t t
18850 fi 16690 fi
18851 16691
18852done 16692done
18853_ACEOF 16693EOF
18854cat >>$CONFIG_STATUS <<\_ACEOF 16694cat >>$CONFIG_STATUS <<\EOF
18855 16695
18856# 16696#
18857# CONFIG_HEADER section. 16697# CONFIG_HEADER section.
@@ -18883,7 +16723,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
18883 * ) ac_file_in=$ac_file.in ;; 16723 * ) ac_file_in=$ac_file.in ;;
18884 esac 16724 esac
18885 16725
18886 test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 16726 test x"$ac_file" != x- && { echo "$as_me:16726: creating $ac_file" >&5
18887echo "$as_me: creating $ac_file" >&6;} 16727echo "$as_me: creating $ac_file" >&6;}
18888 16728
18889 # First look for the input files in the build tree, otherwise in the 16729 # First look for the input files in the build tree, otherwise in the
@@ -18894,7 +16734,7 @@ echo "$as_me: creating $ac_file" >&6;}
18894 -) echo $tmp/stdin ;; 16734 -) echo $tmp/stdin ;;
18895 [\\/$]*) 16735 [\\/$]*)
18896 # Absolute (can't be DOS-style, as IFS=:) 16736 # Absolute (can't be DOS-style, as IFS=:)
18897 test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 16737 test -f "$f" || { { echo "$as_me:16737: error: cannot find input file: $f" >&5
18898echo "$as_me: error: cannot find input file: $f" >&2;} 16738echo "$as_me: error: cannot find input file: $f" >&2;}
18899 { (exit 1); exit 1; }; } 16739 { (exit 1); exit 1; }; }
18900 echo $f;; 16740 echo $f;;
@@ -18907,7 +16747,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
18907 echo $srcdir/$f 16747 echo $srcdir/$f
18908 else 16748 else
18909 # /dev/null tree 16749 # /dev/null tree
18910 { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 16750 { { echo "$as_me:16750: error: cannot find input file: $f" >&5
18911echo "$as_me: error: cannot find input file: $f" >&2;} 16751echo "$as_me: error: cannot find input file: $f" >&2;}
18912 { (exit 1); exit 1; }; } 16752 { (exit 1); exit 1; }; }
18913 fi;; 16753 fi;;
@@ -18916,7 +16756,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;}
18916 # Remove the trailing spaces. 16756 # Remove the trailing spaces.
18917 sed 's/[ ]*$//' $ac_file_inputs >$tmp/in 16757 sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
18918 16758
18919_ACEOF 16759EOF
18920 16760
18921# Transform confdefs.h into two sed scripts, `conftest.defines' and 16761# Transform confdefs.h into two sed scripts, `conftest.defines' and
18922# `conftest.undefs', that substitutes the proper values into 16762# `conftest.undefs', that substitutes the proper values into
@@ -18932,7 +16772,7 @@ rm -f conftest.defines conftest.undefs
18932# `end' is used to avoid that the second main sed command (meant for 16772# `end' is used to avoid that the second main sed command (meant for
18933# 0-ary CPP macros) applies to n-ary macro definitions. 16773# 0-ary CPP macros) applies to n-ary macro definitions.
18934# See the Autoconf documentation for `clear'. 16774# See the Autoconf documentation for `clear'.
18935cat >confdef2sed.sed <<\_ACEOF 16775cat >confdef2sed.sed <<\EOF
18936s/[\\&,]/\\&/g 16776s/[\\&,]/\\&/g
18937s,[\\$`],\\&,g 16777s,[\\$`],\\&,g
18938t clear 16778t clear
@@ -18941,7 +16781,7 @@ s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1
18941t end 16781t end
18942s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp 16782s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
18943: end 16783: end
18944_ACEOF 16784EOF
18945# If some macros were called several times there might be several times 16785# If some macros were called several times there might be several times
18946# the same #defines, which is useless. Nevertheless, we may not want to 16786# the same #defines, which is useless. Nevertheless, we may not want to
18947# sort them, since we want the *last* AC-DEFINE to be honored. 16787# sort them, since we want the *last* AC-DEFINE to be honored.
@@ -18952,14 +16792,14 @@ rm -f confdef2sed.sed
18952# This sed command replaces #undef with comments. This is necessary, for 16792# This sed command replaces #undef with comments. This is necessary, for
18953# example, in the case of _POSIX_SOURCE, which is predefined and required 16793# example, in the case of _POSIX_SOURCE, which is predefined and required
18954# on some systems where configure will not decide to define it. 16794# on some systems where configure will not decide to define it.
18955cat >>conftest.undefs <<\_ACEOF 16795cat >>conftest.undefs <<\EOF
18956s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, 16796s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
18957_ACEOF 16797EOF
18958 16798
18959# Break up conftest.defines because some shells have a limit on the size 16799# Break up conftest.defines because some shells have a limit on the size
18960# of here documents, and old seds have small limits too (100 cmds). 16800# of here documents, and old seds have small limits too (100 cmds).
18961echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS 16801echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
18962echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS 16802echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
18963echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS 16803echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
18964echo ' :' >>$CONFIG_STATUS 16804echo ' :' >>$CONFIG_STATUS
18965rm -f conftest.tail 16805rm -f conftest.tail
@@ -18983,7 +16823,7 @@ do
18983 mv conftest.tail conftest.defines 16823 mv conftest.tail conftest.defines
18984done 16824done
18985rm -f conftest.defines 16825rm -f conftest.defines
18986echo ' fi # grep' >>$CONFIG_STATUS 16826echo ' fi # egrep' >>$CONFIG_STATUS
18987echo >>$CONFIG_STATUS 16827echo >>$CONFIG_STATUS
18988 16828
18989# Break up conftest.undefs because some shells have a limit on the size 16829# Break up conftest.undefs because some shells have a limit on the size
@@ -19011,24 +16851,23 @@ do
19011done 16851done
19012rm -f conftest.undefs 16852rm -f conftest.undefs
19013 16853
19014cat >>$CONFIG_STATUS <<\_ACEOF 16854cat >>$CONFIG_STATUS <<\EOF
19015 # Let's still pretend it is `configure' which instantiates (i.e., don't 16855 # Let's still pretend it is `configure' which instantiates (i.e., don't
19016 # use $as_me), people would be surprised to read: 16856 # use $as_me), people would be surprised to read:
19017 # /* config.h. Generated by config.status. */ 16857 # /* config.h. Generated automatically by config.status. */
19018 if test x"$ac_file" = x-; then 16858 if test x"$ac_file" = x-; then
19019 echo "/* Generated by configure. */" >$tmp/config.h 16859 echo "/* Generated automatically by configure. */" >$tmp/config.h
19020 else 16860 else
19021 echo "/* $ac_file. Generated by configure. */" >$tmp/config.h 16861 echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h
19022 fi 16862 fi
19023 cat $tmp/in >>$tmp/config.h 16863 cat $tmp/in >>$tmp/config.h
19024 rm -f $tmp/in 16864 rm -f $tmp/in
19025 if test x"$ac_file" != x-; then 16865 if test x"$ac_file" != x-; then
19026 if diff $ac_file $tmp/config.h >/dev/null 2>&1; then 16866 if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
19027 { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 16867 { echo "$as_me:16867: $ac_file is unchanged" >&5
19028echo "$as_me: $ac_file is unchanged" >&6;} 16868echo "$as_me: $ac_file is unchanged" >&6;}
19029 else 16869 else
19030 ac_dir=`(dirname "$ac_file") 2>/dev/null || 16870 ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19031$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19032 X"$ac_file" : 'X\(//\)[^/]' \| \ 16871 X"$ac_file" : 'X\(//\)[^/]' \| \
19033 X"$ac_file" : 'X\(//\)$' \| \ 16872 X"$ac_file" : 'X\(//\)$' \| \
19034 X"$ac_file" : 'X\(/\)' \| \ 16873 X"$ac_file" : 'X\(/\)' \| \
@@ -19039,31 +16878,24 @@ echo X"$ac_file" |
19039 /^X\(\/\/\)$/{ s//\1/; q; } 16878 /^X\(\/\/\)$/{ s//\1/; q; }
19040 /^X\(\/\).*/{ s//\1/; q; } 16879 /^X\(\/\).*/{ s//\1/; q; }
19041 s/.*/./; q'` 16880 s/.*/./; q'`
19042 { if $as_mkdir_p; then 16881 if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
19043 mkdir -p "$ac_dir" 16882 { case "$ac_dir" in
19044 else 16883 [\\/]* | ?:[\\/]* ) as_incr_dir=;;
19045 as_dir="$ac_dir" 16884 *) as_incr_dir=.;;
19046 as_dirs= 16885esac
19047 while test ! -d "$as_dir"; do 16886as_dummy="$ac_dir"
19048 as_dirs="$as_dir $as_dirs" 16887for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
19049 as_dir=`(dirname "$as_dir") 2>/dev/null || 16888 case $as_mkdir_dir in
19050$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ 16889 # Skip DOS drivespec
19051 X"$as_dir" : 'X\(//\)[^/]' \| \ 16890 ?:) as_incr_dir=$as_mkdir_dir ;;
19052 X"$as_dir" : 'X\(//\)$' \| \ 16891 *)
19053 X"$as_dir" : 'X\(/\)' \| \ 16892 as_incr_dir=$as_incr_dir/$as_mkdir_dir
19054 . : '\(.\)' 2>/dev/null || 16893 test -d "$as_incr_dir" || mkdir "$as_incr_dir"
19055echo X"$as_dir" | 16894 ;;
19056 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } 16895 esac
19057 /^X\(\/\/\)[^/].*/{ s//\1/; q; } 16896done; }
19058 /^X\(\/\/\)$/{ s//\1/; q; }
19059 /^X\(\/\).*/{ s//\1/; q; }
19060 s/.*/./; q'`
19061 done
19062 test ! -n "$as_dirs" || mkdir $as_dirs
19063 fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
19064echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
19065 { (exit 1); exit 1; }; }; }
19066 16897
16898 fi
19067 rm -f $ac_file 16899 rm -f $ac_file
19068 mv $tmp/config.h $ac_file 16900 mv $tmp/config.h $ac_file
19069 fi 16901 fi
@@ -19072,16 +16904,15 @@ echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
19072 rm -f $tmp/config.h 16904 rm -f $tmp/config.h
19073 fi 16905 fi
19074done 16906done
19075_ACEOF 16907EOF
19076 16908
19077cat >>$CONFIG_STATUS <<\_ACEOF 16909cat >>$CONFIG_STATUS <<\EOF
19078 16910
19079{ (exit 0); exit 0; } 16911{ (exit 0); exit 0; }
19080_ACEOF 16912EOF
19081chmod +x $CONFIG_STATUS 16913chmod +x $CONFIG_STATUS
19082ac_clean_files=$ac_clean_files_save 16914ac_clean_files=$ac_clean_files_save
19083 16915
19084
19085# configure is writing to config.log, and then calls config.status. 16916# configure is writing to config.log, and then calls config.status.
19086# config.status does its own redirection, appending to config.log. 16917# config.status does its own redirection, appending to config.log.
19087# Unfortunately, on DOS this fails, as config.log is still kept open 16918# Unfortunately, on DOS this fails, as config.log is still kept open
@@ -19092,18 +16923,14 @@ ac_clean_files=$ac_clean_files_save
19092# need to make the FD available again. 16923# need to make the FD available again.
19093if test "$no_create" != yes; then 16924if test "$no_create" != yes; then
19094 ac_cs_success=: 16925 ac_cs_success=:
19095 ac_config_status_args=
19096 test "$silent" = yes &&
19097 ac_config_status_args="$ac_config_status_args --quiet"
19098 exec 5>/dev/null 16926 exec 5>/dev/null
19099 $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false 16927 $SHELL $CONFIG_STATUS || ac_cs_success=false
19100 exec 5>>config.log 16928 exec 5>>config.log
19101 # Use ||, not &&, to avoid exiting from the if with $? = 1, which 16929 # Use ||, not &&, to avoid exiting from the if with $? = 1, which
19102 # would make configure fail if this is the last instruction. 16930 # would make configure fail if this is the last instruction.
19103 $ac_cs_success || { (exit 1); exit 1; } 16931 $ac_cs_success || { (exit 1); exit 1; }
19104fi 16932fi
19105 16933
19106
19107# Print summary of options 16934# Print summary of options
19108 16935
19109# Someone please show me a better way :) 16936# Someone please show me a better way :)
@@ -19127,25 +16954,28 @@ echo " Askpass program: $E"
19127echo " Manual pages: $F" 16954echo " Manual pages: $F"
19128echo " PID file: $G" 16955echo " PID file: $G"
19129echo " Privilege separation chroot path: $H" 16956echo " Privilege separation chroot path: $H"
19130if test "$USES_LOGIN_CONF" = "yes" ; then 16957if test "x$external_path_file" = "x/etc/login.conf" ; then
19131echo " At runtime, sshd will use the path defined in /etc/login.conf" 16958echo " At runtime, sshd will use the path defined in $external_path_file"
16959echo " Make sure the path to scp is present, otherwise scp will not work"
19132else 16960else
19133echo " sshd default user PATH: $I" 16961echo " sshd default user PATH: $I"
16962 if test ! -z "$external_path_file"; then
16963echo " (If PATH is set in $external_path_file it will be used instead. If"
16964echo " used, ensure the path to scp is present, otherwise scp will not work.)"
16965 fi
19134fi 16966fi
19135if test ! -z "$superuser_path" ; then 16967if test ! -z "$superuser_path" ; then
19136echo " sshd superuser user PATH: $J" 16968echo " sshd superuser user PATH: $J"
19137fi 16969fi
19138echo " Manpage format: $MANTYPE" 16970echo " Manpage format: $MANTYPE"
19139echo " PAM support: ${PAM_MSG}" 16971echo " DNS support: $DNS_MSG"
19140echo " KerberosIV support: $KRB4_MSG" 16972echo " PAM support: $PAM_MSG"
19141echo " KerberosV support: $KRB5_MSG" 16973echo " KerberosV support: $KRB5_MSG"
19142echo " Smartcard support: $SCARD_MSG" 16974echo " Smartcard support: $SCARD_MSG"
19143echo " AFS support: $AFS_MSG"
19144echo " S/KEY support: $SKEY_MSG" 16975echo " S/KEY support: $SKEY_MSG"
19145echo " TCP Wrappers support: $TCPW_MSG" 16976echo " TCP Wrappers support: $TCPW_MSG"
19146echo " MD5 password support: $MD5_MSG" 16977echo " MD5 password support: $MD5_MSG"
19147echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 16978echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
19148echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
19149echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 16979echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
19150echo " BSD Auth support: $BSD_AUTH_MSG" 16980echo " BSD Auth support: $BSD_AUTH_MSG"
19151echo " Random number source: $RAND_MSG" 16981echo " Random number source: $RAND_MSG"
diff --git a/configure.ac b/configure.ac
index e5a8d6f05..7ddcb777f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.113.2.1 2003/04/29 09:12:08 djm Exp $ 1# $Id: configure.ac,v 1.154.2.1 2003/09/16 05:48:15 tim Exp $
2 2
3AC_INIT 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c]) 4AC_CONFIG_SRCDIR([ssh.c])
@@ -9,6 +9,7 @@ AC_CANONICAL_HOST
9AC_C_BIGENDIAN 9AC_C_BIGENDIAN
10 10
11# Checks for programs. 11# Checks for programs.
12AC_PROG_AWK
12AC_PROG_CPP 13AC_PROG_CPP
13AC_PROG_RANLIB 14AC_PROG_RANLIB
14AC_PROG_INSTALL 15AC_PROG_INSTALL
@@ -54,7 +55,6 @@ fi
54# Check for some target-specific stuff 55# Check for some target-specific stuff
55case "$host" in 56case "$host" in
56*-*-aix*) 57*-*-aix*)
57 AFS_LIBS="-lld"
58 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 58 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
59 LDFLAGS="$LDFLAGS -L/usr/local/lib" 59 LDFLAGS="$LDFLAGS -L/usr/local/lib"
60 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)]) 60 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
@@ -75,19 +75,36 @@ case "$host" in
75 AC_MSG_RESULT($blibflags) 75 AC_MSG_RESULT($blibflags)
76 fi 76 fi
77 LDFLAGS="$saved_LDFLAGS" 77 LDFLAGS="$saved_LDFLAGS"
78 dnl Check for authenticate. Might be in libs.a on older AIXes
78 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)], 79 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
79 [AC_CHECK_LIB(s,authenticate, 80 [AC_CHECK_LIB(s,authenticate,
80 [ AC_DEFINE(WITH_AIXAUTHENTICATE) 81 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
81 LIBS="$LIBS -ls" 82 LIBS="$LIBS -ls"
82 ]) 83 ])
83 ]) 84 ])
85 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
86 AC_CHECK_DECL(loginfailed,
87 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
88 AC_TRY_COMPILE(
89 [#include <usersec.h>],
90 [(void)loginfailed("user","host","tty",0);],
91 [AC_MSG_RESULT(yes)
92 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
93 [AC_MSG_RESULT(no)]
94 )],
95 [],
96 [#include <usersec.h>]
97 )
98 AC_CHECK_FUNCS(setauthdb)
84 AC_DEFINE(BROKEN_GETADDRINFO) 99 AC_DEFINE(BROKEN_GETADDRINFO)
85 AC_DEFINE(BROKEN_REALPATH) 100 AC_DEFINE(BROKEN_REALPATH)
101 AC_DEFINE(SETEUID_BREAKS_SETUID)
102 AC_DEFINE(BROKEN_SETREUID)
103 AC_DEFINE(BROKEN_SETREGID)
86 dnl AIX handles lastlog as part of its login message 104 dnl AIX handles lastlog as part of its login message
87 AC_DEFINE(DISABLE_LASTLOG) 105 AC_DEFINE(DISABLE_LASTLOG)
88 AC_DEFINE(LOGIN_NEEDS_UTMPX) 106 AC_DEFINE(LOGIN_NEEDS_UTMPX)
89 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV) 107 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
90 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0')
91 ;; 108 ;;
92*-*-cygwin*) 109*-*-cygwin*)
93 check_for_libcrypt_later=1 110 check_for_libcrypt_later=1
@@ -95,7 +112,6 @@ case "$host" in
95 AC_DEFINE(HAVE_CYGWIN) 112 AC_DEFINE(HAVE_CYGWIN)
96 AC_DEFINE(USE_PIPES) 113 AC_DEFINE(USE_PIPES)
97 AC_DEFINE(DISABLE_SHADOW) 114 AC_DEFINE(DISABLE_SHADOW)
98 AC_DEFINE(IPV4_DEFAULT)
99 AC_DEFINE(IP_TOS_IS_BROKEN) 115 AC_DEFINE(IP_TOS_IS_BROKEN)
100 AC_DEFINE(NO_X11_UNIX_SOCKETS) 116 AC_DEFINE(NO_X11_UNIX_SOCKETS)
101 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT) 117 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
@@ -129,7 +145,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
129 AC_DEFINE(LOGIN_NEEDS_UTMPX) 145 AC_DEFINE(LOGIN_NEEDS_UTMPX)
130 AC_DEFINE(DISABLE_SHADOW) 146 AC_DEFINE(DISABLE_SHADOW)
131 AC_DEFINE(DISABLE_UTMP) 147 AC_DEFINE(DISABLE_UTMP)
132 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) 148 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
149 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
133 LIBS="$LIBS -lsec -lsecpw" 150 LIBS="$LIBS -lsec -lsecpw"
134 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 151 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
135 disable_ptmx_check=yes 152 disable_ptmx_check=yes
@@ -145,7 +162,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
145 AC_DEFINE(LOGIN_NEEDS_UTMPX) 162 AC_DEFINE(LOGIN_NEEDS_UTMPX)
146 AC_DEFINE(DISABLE_SHADOW) 163 AC_DEFINE(DISABLE_SHADOW)
147 AC_DEFINE(DISABLE_UTMP) 164 AC_DEFINE(DISABLE_UTMP)
148 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) 165 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
166 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
149 LIBS="$LIBS -lsec" 167 LIBS="$LIBS -lsec"
150 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 168 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
151 ;; 169 ;;
@@ -158,7 +176,8 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
158 AC_DEFINE(LOGIN_NEEDS_UTMPX) 176 AC_DEFINE(LOGIN_NEEDS_UTMPX)
159 AC_DEFINE(DISABLE_SHADOW) 177 AC_DEFINE(DISABLE_SHADOW)
160 AC_DEFINE(DISABLE_UTMP) 178 AC_DEFINE(DISABLE_UTMP)
161 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_PSTAT) 179 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
180 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
162 LIBS="$LIBS -lsec" 181 LIBS="$LIBS -lsec"
163 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***])) 182 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
164 ;; 183 ;;
@@ -168,6 +187,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
168 PATH="$PATH:/usr/etc" 187 PATH="$PATH:/usr/etc"
169 AC_DEFINE(BROKEN_INET_NTOA) 188 AC_DEFINE(BROKEN_INET_NTOA)
170 AC_DEFINE(WITH_ABBREV_NO_TTY) 189 AC_DEFINE(WITH_ABBREV_NO_TTY)
190 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
171 ;; 191 ;;
172*-*-irix6*) 192*-*-irix6*)
173 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 193 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -179,15 +199,22 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
179 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)]) 199 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
180 AC_DEFINE(BROKEN_INET_NTOA) 200 AC_DEFINE(BROKEN_INET_NTOA)
181 AC_DEFINE(WITH_ABBREV_NO_TTY) 201 AC_DEFINE(WITH_ABBREV_NO_TTY)
202 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
182 ;; 203 ;;
183*-*-linux*) 204*-*-linux*)
184 no_dev_ptmx=1 205 no_dev_ptmx=1
185 check_for_libcrypt_later=1 206 check_for_libcrypt_later=1
207 check_for_openpty_ctty_bug=1
186 AC_DEFINE(DONT_TRY_OTHER_AF) 208 AC_DEFINE(DONT_TRY_OTHER_AF)
187 AC_DEFINE(PAM_TTY_KLUDGE) 209 AC_DEFINE(PAM_TTY_KLUDGE)
188 AC_DEFINE(SETPROCTITLE_STRATEGY,PS_USE_CLOBBER_ARGV) 210 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!!")
189 AC_DEFINE(SETPROCTITLE_PS_PADDING, '\0') 211 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
190 inet6_default_4in6=yes 212 inet6_default_4in6=yes
213 case `uname -r` in
214 1.*|2.0.*)
215 AC_DEFINE(BROKEN_CMSG_TYPE)
216 ;;
217 esac
191 ;; 218 ;;
192mips-sony-bsd|mips-sony-newsos4) 219mips-sony-bsd|mips-sony-newsos4)
193 AC_DEFINE(HAVE_NEWS4) 220 AC_DEFINE(HAVE_NEWS4)
@@ -220,7 +247,10 @@ mips-sony-bsd|mips-sony-newsos4)
220 AC_DEFINE(LOGIN_NEEDS_UTMPX) 247 AC_DEFINE(LOGIN_NEEDS_UTMPX)
221 AC_DEFINE(LOGIN_NEEDS_TERM) 248 AC_DEFINE(LOGIN_NEEDS_TERM)
222 AC_DEFINE(PAM_TTY_KLUDGE) 249 AC_DEFINE(PAM_TTY_KLUDGE)
223 AC_DEFINE(STREAMS_PUSH_ACQUIRES_CTTY) 250 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
251 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
252 AC_DEFINE(SSHD_ACQUIRES_CTTY)
253 external_path_file=/etc/default/login
224 # hardwire lastlog location (can't detect it on some versions) 254 # hardwire lastlog location (can't detect it on some versions)
225 conf_lastlog_location="/var/adm/lastlog" 255 conf_lastlog_location="/var/adm/lastlog"
226 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x) 256 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
@@ -247,6 +277,7 @@ mips-sony-bsd|mips-sony-newsos4)
247 LDFLAGS="$LDFLAGS -L/usr/local/lib" 277 LDFLAGS="$LDFLAGS -L/usr/local/lib"
248 LIBS="$LIBS -lc89" 278 LIBS="$LIBS -lc89"
249 AC_DEFINE(USE_PIPES) 279 AC_DEFINE(USE_PIPES)
280 AC_DEFINE(SSHD_ACQUIRES_CTTY)
250 ;; 281 ;;
251*-sni-sysv*) 282*-sni-sysv*)
252 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 283 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -255,6 +286,8 @@ mips-sony-bsd|mips-sony-newsos4)
255 IPADDR_IN_DISPLAY=yes 286 IPADDR_IN_DISPLAY=yes
256 AC_DEFINE(USE_PIPES) 287 AC_DEFINE(USE_PIPES)
257 AC_DEFINE(IP_TOS_IS_BROKEN) 288 AC_DEFINE(IP_TOS_IS_BROKEN)
289 AC_DEFINE(SSHD_ACQUIRES_CTTY)
290 external_path_file=/etc/default/login
258 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX 291 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
259 # Attention: always take care to bind libsocket and libnsl before libc, 292 # Attention: always take care to bind libsocket and libnsl before libc,
260 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog 293 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
@@ -263,11 +296,17 @@ mips-sony-bsd|mips-sony-newsos4)
263 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 296 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
264 LDFLAGS="$LDFLAGS -L/usr/local/lib" 297 LDFLAGS="$LDFLAGS -L/usr/local/lib"
265 AC_DEFINE(USE_PIPES) 298 AC_DEFINE(USE_PIPES)
299 AC_DEFINE(SETEUID_BREAKS_SETUID)
300 AC_DEFINE(BROKEN_SETREUID)
301 AC_DEFINE(BROKEN_SETREGID)
266 ;; 302 ;;
267*-*-sysv5*) 303*-*-sysv5*)
268 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 304 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
269 LDFLAGS="$LDFLAGS -L/usr/local/lib" 305 LDFLAGS="$LDFLAGS -L/usr/local/lib"
270 AC_DEFINE(USE_PIPES) 306 AC_DEFINE(USE_PIPES)
307 AC_DEFINE(SETEUID_BREAKS_SETUID)
308 AC_DEFINE(BROKEN_SETREUID)
309 AC_DEFINE(BROKEN_SETREGID)
271 ;; 310 ;;
272*-*-sysv*) 311*-*-sysv*)
273 CPPFLAGS="$CPPFLAGS -I/usr/local/include" 312 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
@@ -284,6 +323,7 @@ mips-sony-bsd|mips-sony-newsos4)
284 AC_DEFINE(HAVE_SECUREWARE) 323 AC_DEFINE(HAVE_SECUREWARE)
285 AC_DEFINE(DISABLE_SHADOW) 324 AC_DEFINE(DISABLE_SHADOW)
286 AC_DEFINE(BROKEN_SAVED_UIDS) 325 AC_DEFINE(BROKEN_SAVED_UIDS)
326 AC_DEFINE(WITH_ABBREV_NO_TTY)
287 AC_CHECK_FUNCS(getluid setluid) 327 AC_CHECK_FUNCS(getluid setluid)
288 MANTYPE=man 328 MANTYPE=man
289 do_sco3_extra_lib_check=yes 329 do_sco3_extra_lib_check=yes
@@ -300,6 +340,10 @@ mips-sony-bsd|mips-sony-newsos4)
300 AC_DEFINE(HAVE_SECUREWARE) 340 AC_DEFINE(HAVE_SECUREWARE)
301 AC_DEFINE(DISABLE_SHADOW) 341 AC_DEFINE(DISABLE_SHADOW)
302 AC_DEFINE(DISABLE_FD_PASSING) 342 AC_DEFINE(DISABLE_FD_PASSING)
343 AC_DEFINE(SETEUID_BREAKS_SETUID)
344 AC_DEFINE(BROKEN_SETREUID)
345 AC_DEFINE(BROKEN_SETREGID)
346 AC_DEFINE(WITH_ABBREV_NO_TTY)
303 AC_CHECK_FUNCS(getluid setluid) 347 AC_CHECK_FUNCS(getluid setluid)
304 MANTYPE=man 348 MANTYPE=man
305 ;; 349 ;;
@@ -310,6 +354,14 @@ mips-sony-bsd|mips-sony-newsos4)
310 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm" 354 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
311 MANTYPE=cat 355 MANTYPE=cat
312 ;; 356 ;;
357*-*-unicosmp*)
358 AC_DEFINE(WITH_ABBREV_NO_TTY)
359 AC_DEFINE(USE_PIPES)
360 AC_DEFINE(DISABLE_FD_PASSING)
361 LDFLAGS="$LDFLAGS"
362 LIBS="$LIBS -lgen -lacid"
363 MANTYPE=cat
364 ;;
313*-*-unicos*) 365*-*-unicos*)
314 AC_DEFINE(USE_PIPES) 366 AC_DEFINE(USE_PIPES)
315 AC_DEFINE(DISABLE_FD_PASSING) 367 AC_DEFINE(DISABLE_FD_PASSING)
@@ -342,6 +394,8 @@ mips-sony-bsd|mips-sony-newsos4)
342 fi 394 fi
343 fi 395 fi
344 AC_DEFINE(DISABLE_FD_PASSING) 396 AC_DEFINE(DISABLE_FD_PASSING)
397 AC_DEFINE(BROKEN_GETADDRINFO)
398 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
345 ;; 399 ;;
346 400
347*-*-nto-qnx) 401*-*-nto-qnx)
@@ -387,14 +441,26 @@ AC_ARG_WITH(libs,
387 ] 441 ]
388) 442)
389 443
444AC_MSG_CHECKING(compiler and flags for sanity)
445AC_TRY_RUN([
446#include <stdio.h>
447int main(){exit(0);}
448 ],
449 [ AC_MSG_RESULT(yes) ],
450 [
451 AC_MSG_RESULT(no)
452 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
453 ]
454)
455
390# Checks for header files. 456# Checks for header files.
391AC_CHECK_HEADERS(bstring.h crypt.h endian.h floatingpoint.h \ 457AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
392 getopt.h glob.h ia.h lastlog.h libgen.h limits.h login.h \ 458 getopt.h glob.h ia.h lastlog.h limits.h login.h \
393 login_cap.h maillock.h netdb.h netgroup.h \ 459 login_cap.h maillock.h netdb.h netgroup.h \
394 netinet/in_systm.h paths.h pty.h readpassphrase.h \ 460 netinet/in_systm.h paths.h pty.h readpassphrase.h \
395 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \ 461 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
396 strings.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h \ 462 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
397 sys/mman.h sys/pstat.h sys/select.h sys/stat.h \ 463 sys/cdefs.h sys/mman.h sys/pstat.h sys/select.h sys/stat.h \
398 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \ 464 sys/stropts.h sys/sysmacros.h sys/time.h sys/timers.h \
399 sys/un.h time.h tmpdir.h ttyent.h usersec.h \ 465 sys/un.h time.h tmpdir.h ttyent.h usersec.h \
400 util.h utime.h utmp.h utmpx.h) 466 util.h utime.h utmp.h utmpx.h)
@@ -410,8 +476,46 @@ if test "x$with_tcp_wrappers" != "xno" ; then
410 fi 476 fi
411fi 477fi
412 478
479dnl IRIX and Solaris 2.5.1 have dirname() in libgen
480AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
481 AC_CHECK_LIB(gen, dirname,[
482 AC_CACHE_CHECK([for broken dirname],
483 ac_cv_have_broken_dirname, [
484 save_LIBS="$LIBS"
485 LIBS="$LIBS -lgen"
486 AC_TRY_RUN(
487 [
488#include <libgen.h>
489#include <string.h>
490
491int main(int argc, char **argv) {
492 char *s, buf[32];
493
494 strncpy(buf,"/etc", 32);
495 s = dirname(buf);
496 if (!s || strncmp(s, "/", 32) != 0) {
497 exit(1);
498 } else {
499 exit(0);
500 }
501}
502 ],
503 [ ac_cv_have_broken_dirname="no" ],
504 [ ac_cv_have_broken_dirname="yes" ]
505 )
506 LIBS="$save_LIBS"
507 ])
508 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
509 LIBS="$LIBS -lgen"
510 AC_DEFINE(HAVE_DIRNAME)
511 AC_CHECK_HEADERS(libgen.h)
512 fi
513 ])
514])
515
413AC_CHECK_FUNC(getspnam, , 516AC_CHECK_FUNC(getspnam, ,
414 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen")) 517 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
518AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
415 519
416AC_ARG_WITH(rpath, 520AC_ARG_WITH(rpath,
417 [ --without-rpath Disable auto-added -R linker paths], 521 [ --without-rpath Disable auto-added -R linker paths],
@@ -608,61 +712,32 @@ AC_ARG_WITH(tcp-wrappers,
608 712
609dnl Checks for library functions. Please keep in alphabetical order 713dnl Checks for library functions. Please keep in alphabetical order
610AC_CHECK_FUNCS(\ 714AC_CHECK_FUNCS(\
611 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename bcopy \ 715 arc4random __b64_ntop b64_ntop __b64_pton b64_pton basename \
612 bindresvport_sa clock fchmod fchown freeaddrinfo futimes \ 716 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
613 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \ 717 gai_strerror getaddrinfo getcwd getgrouplist getnameinfo getopt \
614 getpeereid _getpty getrlimit getrusage getttyent glob inet_aton \ 718 getpeereid _getpty getrlimit getttyent glob inet_aton \
615 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \ 719 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
616 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openpty pstat \ 720 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
617 readpassphrase realpath recvmsg rresvport_af sendmsg setdtablesize \ 721 pstat readpassphrase realpath recvmsg rresvport_af sendmsg \
618 setegid setenv seteuid setgroups setlogin setpcred setproctitle \ 722 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
619 setresgid setreuid setrlimit setsid setvbuf sigaction sigvec \ 723 setproctitle setregid setresgid setresuid setreuid setrlimit \
620 snprintf socketpair strerror strlcat strlcpy strmode strnvis \ 724 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
621 sysconf tcgetpgrp truncate utimes vhangup vsnprintf waitpid \ 725 strlcat strlcpy strmode strnvis sysconf tcgetpgrp \
726 truncate utimes vhangup vsnprintf waitpid \
622) 727)
623 728
624AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP)) 729AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
625AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
626 730
627dnl Make sure strsep prototype is defined before defining HAVE_STRSEP 731dnl Make sure prototypes are defined for these before using them.
628AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)]) 732AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
733AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
629 734
630dnl IRIX and Solaris 2.5.1 have dirname() in libgen 735dnl tcsendbreak might be a macro
631AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[ 736AC_CHECK_DECL(tcsendbreak,
632 AC_CHECK_LIB(gen, dirname,[ 737 [AC_DEFINE(HAVE_TCSENDBREAK)],
633 AC_CACHE_CHECK([for broken dirname], 738 [AC_CHECK_FUNCS(tcsendbreak)],
634 ac_cv_have_broken_dirname, [ 739 [#include <termios.h>]
635 save_LIBS="$LIBS" 740)
636 LIBS="$LIBS -lgen"
637 AC_TRY_RUN(
638 [
639#include <libgen.h>
640#include <string.h>
641
642int main(int argc, char **argv) {
643 char *s, buf[32];
644
645 strncpy(buf,"/etc", 32);
646 s = dirname(buf);
647 if (!s || strncmp(s, "/", 32) != 0) {
648 exit(1);
649 } else {
650 exit(0);
651 }
652}
653 ],
654 [ ac_cv_have_broken_dirname="no" ],
655 [ ac_cv_have_broken_dirname="yes" ]
656 )
657 LIBS="$save_LIBS"
658 ])
659 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
660 LIBS="$LIBS -lgen"
661 AC_DEFINE(HAVE_DIRNAME)
662 AC_CHECK_HEADERS(libgen.h)
663 fi
664 ])
665])
666 741
667dnl Checks for time functions 742dnl Checks for time functions
668AC_CHECK_FUNCS(gettimeofday time) 743AC_CHECK_FUNCS(gettimeofday time)
@@ -726,6 +801,53 @@ unlink(template); exit(0);
726) 801)
727fi 802fi
728 803
804dnl make sure that openpty does not reacquire controlling terminal
805if test ! -z "$check_for_openpty_ctty_bug"; then
806 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
807 AC_TRY_RUN(
808 [
809#include <stdio.h>
810#include <sys/fcntl.h>
811#include <sys/types.h>
812#include <sys/wait.h>
813
814int
815main()
816{
817 pid_t pid;
818 int fd, ptyfd, ttyfd, status;
819
820 pid = fork();
821 if (pid < 0) { /* failed */
822 exit(1);
823 } else if (pid > 0) { /* parent */
824 waitpid(pid, &status, 0);
825 if (WIFEXITED(status))
826 exit(WEXITSTATUS(status));
827 else
828 exit(2);
829 } else { /* child */
830 close(0); close(1); close(2);
831 setsid();
832 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
833 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
834 if (fd >= 0)
835 exit(3); /* Acquired ctty: broken */
836 else
837 exit(0); /* Did not acquire ctty: OK */
838 }
839}
840 ],
841 [
842 AC_MSG_RESULT(yes)
843 ],
844 [
845 AC_MSG_RESULT(no)
846 AC_DEFINE(SSHD_ACQUIRES_CTTY)
847 ]
848 )
849fi
850
729AC_FUNC_GETPGRP 851AC_FUNC_GETPGRP
730 852
731# Check for PAM libs 853# Check for PAM libs
@@ -741,6 +863,7 @@ AC_ARG_WITH(pam,
741 AC_CHECK_LIB(dl, dlopen, , ) 863 AC_CHECK_LIB(dl, dlopen, , )
742 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing])) 864 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
743 AC_CHECK_FUNCS(pam_getenvlist) 865 AC_CHECK_FUNCS(pam_getenvlist)
866 AC_CHECK_FUNCS(pam_putenv)
744 867
745 disable_shadow=yes 868 disable_shadow=yes
746 PAM_MSG="yes" 869 PAM_MSG="yes"
@@ -905,13 +1028,15 @@ int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
905 ], 1028 ],
906 [ 1029 [
907 AC_MSG_RESULT(no) 1030 AC_MSG_RESULT(no)
908 AC_MSG_ERROR(Your OpenSSL headers do not match your library) 1031 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1032Check config.log for details.
1033Also see contrib/findssl.sh for help identifying header/library mismatches.])
909 ] 1034 ]
910) 1035)
911 1036
912# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the 1037# Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
913# version in OpenSSL. Skip this for PAM 1038# version in OpenSSL. Skip this for PAM
914if test "x$PAM_MSG" = "xno" -a "x$check_for_libcrypt_later" = "x1"; then 1039if test "x$check_for_libcrypt_later" = "x1"; then
915 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt") 1040 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
916fi 1041fi
917 1042
@@ -1752,7 +1877,6 @@ if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
1752fi 1877fi
1753 1878
1754SCARD_MSG="no" 1879SCARD_MSG="no"
1755
1756# Check whether user wants sectok support 1880# Check whether user wants sectok support
1757AC_ARG_WITH(sectok, 1881AC_ARG_WITH(sectok,
1758 [ --with-sectok Enable smartcard support using libsectok], 1882 [ --with-sectok Enable smartcard support using libsectok],
@@ -1802,6 +1926,29 @@ if test x$opensc_config_prefix != x ; then
1802 fi 1926 fi
1803fi 1927fi
1804 1928
1929# Check whether user wants DNS support
1930DNS_MSG="no"
1931AC_ARG_WITH(dns,
1932 [ --with-dns Support for fetching keys from DNS (experimental)],
1933 [
1934 if test "x$withval" != "xno" ; then
1935 DNS_MSG="yes"
1936 AC_DEFINE(DNS)
1937 AC_SEARCH_LIBS(getrrsetbyname, resolv,
1938 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
1939 [
1940 # Needed by our getrrsetbyname()
1941 AC_SEARCH_LIBS(res_query, resolv)
1942 AC_SEARCH_LIBS(dn_expand, resolv)
1943 AC_CHECK_FUNCS(_getshort _getlong)
1944 AC_CHECK_MEMBER(HEADER.ad,
1945 [AC_DEFINE(HAVE_HEADER_AD)],,
1946 [#include <arpa/nameser.h>])
1947 ])
1948 fi
1949 ]
1950)
1951
1805# Check whether user wants Kerberos 5 support 1952# Check whether user wants Kerberos 5 support
1806KRB5_MSG="no" 1953KRB5_MSG="no"
1807AC_ARG_WITH(kerberos5, 1954AC_ARG_WITH(kerberos5,
@@ -1834,93 +1981,38 @@ AC_ARG_WITH(kerberos5,
1834 if test ! -z "$blibpath" ; then 1981 if test ! -z "$blibpath" ; then
1835 blibpath="$blibpath:${KRB5ROOT}/lib" 1982 blibpath="$blibpath:${KRB5ROOT}/lib"
1836 fi 1983 fi
1837 AC_CHECK_LIB(resolv, dn_expand, , ) 1984 AC_SEARCH_LIBS(dn_expand, resolv)
1985
1986 AC_CHECK_LIB(gssapi,gss_init_sec_context,
1987 [ AC_DEFINE(GSSAPI)
1988 K5LIBS="-lgssapi $K5LIBS" ],
1989 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
1990 [ AC_DEFINE(GSSAPI)
1991 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
1992 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
1993 $K5LIBS)
1994 ],
1995 $K5LIBS)
1996
1997 AC_CHECK_HEADER(gssapi.h, ,
1998 [ unset ac_cv_header_gssapi_h
1999 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2000 AC_CHECK_HEADERS(gssapi.h, ,
2001 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2002 )
2003 ]
2004 )
2005
2006 oldCPP="$CPPFLAGS"
2007 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2008 AC_CHECK_HEADER(gssapi_krb5.h, ,
2009 [ CPPFLAGS="$oldCPP" ])
1838 2010
1839 KRB5=yes 2011 KRB5=yes
1840 fi 2012 fi
1841 ] 2013 ]
1842) 2014)
1843# Check whether user wants Kerberos 4 support 2015LIBS="$LIBS $K5LIBS"
1844KRB4_MSG="no"
1845AC_ARG_WITH(kerberos4,
1846 [ --with-kerberos4=PATH Enable Kerberos 4 support],
1847 [
1848 if test "x$withval" != "xno" ; then
1849 if test "x$withval" != "xyes" ; then
1850 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1851 LDFLAGS="$LDFLAGS -L${withval}/lib"
1852 if test ! -z "$need_dash_r" ; then
1853 LDFLAGS="$LDFLAGS -R${withval}/lib"
1854 fi
1855 if test ! -z "$blibpath" ; then
1856 blibpath="$blibpath:${withval}/lib"
1857 fi
1858 else
1859 if test -d /usr/include/kerberosIV ; then
1860 CPPFLAGS="$CPPFLAGS -I/usr/include/kerberosIV"
1861 fi
1862 fi
1863
1864 AC_CHECK_HEADERS(krb.h)
1865 if test "$ac_cv_header_krb_h" != yes; then
1866 AC_MSG_WARN([Cannot find krb.h, build may fail])
1867 fi
1868 AC_CHECK_LIB(krb, main)
1869 if test "$ac_cv_lib_krb_main" != yes; then
1870 AC_CHECK_LIB(krb4, main)
1871 if test "$ac_cv_lib_krb4_main" != yes; then
1872 AC_MSG_WARN([Cannot find libkrb nor libkrb4, build may fail])
1873 else
1874 KLIBS="-lkrb4"
1875 fi
1876 else
1877 KLIBS="-lkrb"
1878 fi
1879 AC_CHECK_LIB(des, des_cbc_encrypt)
1880 if test "$ac_cv_lib_des_des_cbc_encrypt" != yes; then
1881 AC_CHECK_LIB(des425, des_cbc_encrypt)
1882 if test "$ac_cv_lib_des425_des_cbc_encrypt" != yes; then
1883 AC_MSG_WARN([Cannot find libdes nor libdes425, build may fail])
1884 else
1885 KLIBS="-ldes425"
1886 fi
1887 else
1888 KLIBS="-ldes"
1889 fi
1890 AC_CHECK_LIB(resolv, dn_expand, , )
1891 KRB4=yes
1892 KRB4_MSG="yes"
1893 AC_DEFINE(KRB4)
1894 fi
1895 ]
1896)
1897
1898# Check whether user wants AFS support
1899AFS_MSG="no"
1900AC_ARG_WITH(afs,
1901 [ --with-afs=PATH Enable AFS support],
1902 [
1903 if test "x$withval" != "xno" ; then
1904
1905 if test "x$withval" != "xyes" ; then
1906 CPPFLAGS="$CPPFLAGS -I${withval}/include"
1907 LDFLAGS="$LDFLAGS -L${withval}/lib"
1908 fi
1909
1910 if test -z "$KRB4" ; then
1911 AC_MSG_WARN([AFS requires Kerberos IV support, build may fail])
1912 fi
1913
1914 LIBS="-lkafs $LIBS"
1915 if test ! -z "$AFS_LIBS" ; then
1916 LIBS="$LIBS $AFS_LIBS"
1917 fi
1918 AC_DEFINE(AFS)
1919 AFS_MSG="yes"
1920 fi
1921 ]
1922)
1923LIBS="$LIBS $KLIBS $K5LIBS"
1924 2016
1925# Looking for programs, paths and files 2017# Looking for programs, paths and files
1926 2018
@@ -2090,30 +2182,48 @@ else
2090 ) 2182 )
2091fi 2183fi
2092 2184
2185# check for /etc/default/login and use it if present.
2186AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2187
2188if test "x$external_path_file" = "x/etc/default/login"; then
2189 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2190fi
2191
2093dnl BSD systems use /etc/login.conf so --with-default-path= has no effect 2192dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2094if test $ac_cv_func_login_getcapbool = "yes" -a \ 2193if test $ac_cv_func_login_getcapbool = "yes" -a \
2095 $ac_cv_header_login_cap_h = "yes" ; then 2194 $ac_cv_header_login_cap_h = "yes" ; then
2096 USES_LOGIN_CONF=yes 2195 external_path_file=/etc/login.conf
2097fi 2196fi
2197
2098# Whether to mess with the default path 2198# Whether to mess with the default path
2099SERVER_PATH_MSG="(default)" 2199SERVER_PATH_MSG="(default)"
2100AC_ARG_WITH(default-path, 2200AC_ARG_WITH(default-path,
2101 [ --with-default-path= Specify default \$PATH environment for server], 2201 [ --with-default-path= Specify default \$PATH environment for server],
2102 [ 2202 [
2103 if test "$USES_LOGIN_CONF" = "yes" ; then 2203 if test "x$external_path_file" = "x/etc/login.conf" ; then
2104 AC_MSG_WARN([ 2204 AC_MSG_WARN([
2105--with-default-path=PATH has no effect on this system. 2205--with-default-path=PATH has no effect on this system.
2106Edit /etc/login.conf instead.]) 2206Edit /etc/login.conf instead.])
2107 elif test "x$withval" != "xno" ; then 2207 elif test "x$withval" != "xno" ; then
2208 if test ! -z "$external_path_file" ; then
2209 AC_MSG_WARN([
2210--with-default-path=PATH will only be used if PATH is not defined in
2211$external_path_file .])
2212 fi
2108 user_path="$withval" 2213 user_path="$withval"
2109 SERVER_PATH_MSG="$withval" 2214 SERVER_PATH_MSG="$withval"
2110 fi 2215 fi
2111 ], 2216 ],
2112 [ if test "$USES_LOGIN_CONF" = "yes" ; then 2217 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2113 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf]) 2218 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2114 else 2219 else
2115 AC_TRY_RUN( 2220 if test ! -z "$external_path_file" ; then
2116 [ 2221 AC_MSG_WARN([
2222If PATH is defined in $external_path_file, ensure the path to scp is included,
2223otherwise scp will not work.])
2224 fi
2225 AC_TRY_RUN(
2226 [
2117/* find out what STDPATH is */ 2227/* find out what STDPATH is */
2118#include <stdio.h> 2228#include <stdio.h>
2119#ifdef HAVE_PATHS_H 2229#ifdef HAVE_PATHS_H
@@ -2167,7 +2277,7 @@ main()
2167 fi 2277 fi
2168 fi ] 2278 fi ]
2169) 2279)
2170if test "$USES_LOGIN_CONF" != "yes" ; then 2280if test "x$external_path_file" != "x/etc/login.conf" ; then
2171 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path") 2281 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2172 AC_SUBST(user_path) 2282 AC_SUBST(user_path)
2173fi 2283fi
@@ -2184,18 +2294,6 @@ AC_ARG_WITH(superuser-path,
2184) 2294)
2185 2295
2186 2296
2187# Whether to force IPv4 by default (needed on broken glibc Linux)
2188IPV4_HACK_MSG="no"
2189AC_ARG_WITH(ipv4-default,
2190 [ --with-ipv4-default Use IPv4 by connections unless '-6' specified],
2191 [
2192 if test "x$withval" != "xno" ; then
2193 AC_DEFINE(IPV4_DEFAULT)
2194 IPV4_HACK_MSG="yes"
2195 fi
2196 ]
2197)
2198
2199AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses]) 2297AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2200IPV4_IN6_HACK_MSG="no" 2298IPV4_IN6_HACK_MSG="no"
2201AC_ARG_WITH(4in6, 2299AC_ARG_WITH(4in6,
@@ -2259,35 +2357,67 @@ AC_SUBST(piddir)
2259dnl allow user to disable some login recording features 2357dnl allow user to disable some login recording features
2260AC_ARG_ENABLE(lastlog, 2358AC_ARG_ENABLE(lastlog,
2261 [ --disable-lastlog disable use of lastlog even if detected [no]], 2359 [ --disable-lastlog disable use of lastlog even if detected [no]],
2262 [ AC_DEFINE(DISABLE_LASTLOG) ] 2360 [
2361 if test "x$enableval" = "xno" ; then
2362 AC_DEFINE(DISABLE_LASTLOG)
2363 fi
2364 ]
2263) 2365)
2264AC_ARG_ENABLE(utmp, 2366AC_ARG_ENABLE(utmp,
2265 [ --disable-utmp disable use of utmp even if detected [no]], 2367 [ --disable-utmp disable use of utmp even if detected [no]],
2266 [ AC_DEFINE(DISABLE_UTMP) ] 2368 [
2369 if test "x$enableval" = "xno" ; then
2370 AC_DEFINE(DISABLE_UTMP)
2371 fi
2372 ]
2267) 2373)
2268AC_ARG_ENABLE(utmpx, 2374AC_ARG_ENABLE(utmpx,
2269 [ --disable-utmpx disable use of utmpx even if detected [no]], 2375 [ --disable-utmpx disable use of utmpx even if detected [no]],
2270 [ AC_DEFINE(DISABLE_UTMPX) ] 2376 [
2377 if test "x$enableval" = "xno" ; then
2378 AC_DEFINE(DISABLE_UTMPX)
2379 fi
2380 ]
2271) 2381)
2272AC_ARG_ENABLE(wtmp, 2382AC_ARG_ENABLE(wtmp,
2273 [ --disable-wtmp disable use of wtmp even if detected [no]], 2383 [ --disable-wtmp disable use of wtmp even if detected [no]],
2274 [ AC_DEFINE(DISABLE_WTMP) ] 2384 [
2385 if test "x$enableval" = "xno" ; then
2386 AC_DEFINE(DISABLE_WTMP)
2387 fi
2388 ]
2275) 2389)
2276AC_ARG_ENABLE(wtmpx, 2390AC_ARG_ENABLE(wtmpx,
2277 [ --disable-wtmpx disable use of wtmpx even if detected [no]], 2391 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2278 [ AC_DEFINE(DISABLE_WTMPX) ] 2392 [
2393 if test "x$enableval" = "xno" ; then
2394 AC_DEFINE(DISABLE_WTMPX)
2395 fi
2396 ]
2279) 2397)
2280AC_ARG_ENABLE(libutil, 2398AC_ARG_ENABLE(libutil,
2281 [ --disable-libutil disable use of libutil (login() etc.) [no]], 2399 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2282 [ AC_DEFINE(DISABLE_LOGIN) ] 2400 [
2401 if test "x$enableval" = "xno" ; then
2402 AC_DEFINE(DISABLE_LOGIN)
2403 fi
2404 ]
2283) 2405)
2284AC_ARG_ENABLE(pututline, 2406AC_ARG_ENABLE(pututline,
2285 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]], 2407 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2286 [ AC_DEFINE(DISABLE_PUTUTLINE) ] 2408 [
2409 if test "x$enableval" = "xno" ; then
2410 AC_DEFINE(DISABLE_PUTUTLINE)
2411 fi
2412 ]
2287) 2413)
2288AC_ARG_ENABLE(pututxline, 2414AC_ARG_ENABLE(pututxline,
2289 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]], 2415 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2290 [ AC_DEFINE(DISABLE_PUTUTXLINE) ] 2416 [
2417 if test "x$enableval" = "xno" ; then
2418 AC_DEFINE(DISABLE_PUTUTXLINE)
2419 fi
2420 ]
2291) 2421)
2292AC_ARG_WITH(lastlog, 2422AC_ARG_WITH(lastlog,
2293 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]], 2423 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
@@ -2517,25 +2647,28 @@ echo " Askpass program: $E"
2517echo " Manual pages: $F" 2647echo " Manual pages: $F"
2518echo " PID file: $G" 2648echo " PID file: $G"
2519echo " Privilege separation chroot path: $H" 2649echo " Privilege separation chroot path: $H"
2520if test "$USES_LOGIN_CONF" = "yes" ; then 2650if test "x$external_path_file" = "x/etc/login.conf" ; then
2521echo " At runtime, sshd will use the path defined in /etc/login.conf" 2651echo " At runtime, sshd will use the path defined in $external_path_file"
2652echo " Make sure the path to scp is present, otherwise scp will not work"
2522else 2653else
2523echo " sshd default user PATH: $I" 2654echo " sshd default user PATH: $I"
2655 if test ! -z "$external_path_file"; then
2656echo " (If PATH is set in $external_path_file it will be used instead. If"
2657echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2658 fi
2524fi 2659fi
2525if test ! -z "$superuser_path" ; then 2660if test ! -z "$superuser_path" ; then
2526echo " sshd superuser user PATH: $J" 2661echo " sshd superuser user PATH: $J"
2527fi 2662fi
2528echo " Manpage format: $MANTYPE" 2663echo " Manpage format: $MANTYPE"
2529echo " PAM support: ${PAM_MSG}" 2664echo " DNS support: $DNS_MSG"
2530echo " KerberosIV support: $KRB4_MSG" 2665echo " PAM support: $PAM_MSG"
2531echo " KerberosV support: $KRB5_MSG" 2666echo " KerberosV support: $KRB5_MSG"
2532echo " Smartcard support: $SCARD_MSG" 2667echo " Smartcard support: $SCARD_MSG"
2533echo " AFS support: $AFS_MSG"
2534echo " S/KEY support: $SKEY_MSG" 2668echo " S/KEY support: $SKEY_MSG"
2535echo " TCP Wrappers support: $TCPW_MSG" 2669echo " TCP Wrappers support: $TCPW_MSG"
2536echo " MD5 password support: $MD5_MSG" 2670echo " MD5 password support: $MD5_MSG"
2537echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" 2671echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2538echo " Use IPv4 by default hack: $IPV4_HACK_MSG"
2539echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" 2672echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2540echo " BSD Auth support: $BSD_AUTH_MSG" 2673echo " BSD Auth support: $BSD_AUTH_MSG"
2541echo " Random number source: $RAND_MSG" 2674echo " Random number source: $RAND_MSG"
diff --git a/contrib/aix/README b/contrib/aix/README
index 82fd8be1b..2a299350a 100644
--- a/contrib/aix/README
+++ b/contrib/aix/README
@@ -26,6 +26,7 @@ and for comparison with the output from this script, however no code
26from lppbuild is included and it is not required for operation. 26from lppbuild is included and it is not required for operation.
27 27
28SRC support based on examples provided by Sandor Sklar and Maarten Kreuger. 28SRC support based on examples provided by Sandor Sklar and Maarten Kreuger.
29PrivSep account handling fixes contributed by W. Earl Allen.
29 30
30 31
31Other notes: 32Other notes:
@@ -45,3 +46,5 @@ you get to keep both pieces.
45 46
46 - Darren Tucker (dtucker at zip dot com dot au) 47 - Darren Tucker (dtucker at zip dot com dot au)
47 2002/03/01 48 2002/03/01
49
50$Id: README,v 1.4 2003/08/25 05:01:04 dtucker Exp $
diff --git a/contrib/aix/buildbff.sh b/contrib/aix/buildbff.sh
index 3b3699660..727ac446d 100755
--- a/contrib/aix/buildbff.sh
+++ b/contrib/aix/buildbff.sh
@@ -1,6 +1,7 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# buildbff.sh: Create AIX SMIT-installable OpenSSH packages 3# buildbff.sh: Create AIX SMIT-installable OpenSSH packages
4# $Id: buildbff.sh,v 1.6 2003/08/25 05:01:04 dtucker Exp $
4# 5#
5# Author: Darren Tucker (dtucker at zip dot com dot au) 6# Author: Darren Tucker (dtucker at zip dot com dot au)
6# This file is placed in the public domain and comes with absolutely 7# This file is placed in the public domain and comes with absolutely
@@ -14,9 +15,9 @@
14# create a "config.local" in your build directory or set 15# create a "config.local" in your build directory or set
15# environment variables to override these. 16# environment variables to override these.
16# 17#
17[ -z "$PERMIT_ROOT_LOGIN" ] || PERMIT_ROOT_LOGIN=no 18[ -z "$PERMIT_ROOT_LOGIN" ] && PERMIT_ROOT_LOGIN=no
18[ -z "$X11_FORWARDING" ] || X11_FORWARDING=no 19[ -z "$X11_FORWARDING" ] && X11_FORWARDING=no
19[ -z "$AIX_SRC" ] || AIX_SRC=no 20[ -z "$AIX_SRC" ] && AIX_SRC=no
20 21
21umask 022 22umask 022
22 23
@@ -31,7 +32,7 @@ else
31fi 32fi
32 33
33# 34#
34# We still support running from contrib/aix, but this is depreciated 35# We still support running from contrib/aix, but this is deprecated
35# 36#
36if pwd | egrep 'contrib/aix$' 37if pwd | egrep 'contrib/aix$'
37then 38then
@@ -121,7 +122,7 @@ cp $srcdir/README* $objdir/$PKGDIR/
121# Extract common info requires for the 'info' part of the package. 122# Extract common info requires for the 'info' part of the package.
122# AIX requires 4-part version numbers 123# AIX requires 4-part version numbers
123# 124#
124VERSION=`./ssh -V 2>&1 | sed -e 's/,.*//' | cut -f 2 -d _` 125VERSION=`./ssh -V 2>&1 | cut -f 1 -d , | cut -f 2 -d _`
125MAJOR=`echo $VERSION | cut -f 1 -d p | cut -f 1 -d .` 126MAJOR=`echo $VERSION | cut -f 1 -d p | cut -f 1 -d .`
126MINOR=`echo $VERSION | cut -f 1 -d p | cut -f 2 -d .` 127MINOR=`echo $VERSION | cut -f 1 -d p | cut -f 2 -d .`
127PATCH=`echo $VERSION | cut -f 1 -d p | cut -f 3 -d .` 128PATCH=`echo $VERSION | cut -f 1 -d p | cut -f 3 -d .`
@@ -218,7 +219,7 @@ else
218 fi 219 fi
219 220
220 # Create user if required 221 # Create user if required
221 if cut -f1 -d: /etc/passwd | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null 222 if lsuser ALL | cut -f1 -d: | egrep '^'$SSH_PRIVSEP_USER'\$' >/dev/null
222 then 223 then
223 echo "PrivSep user $SSH_PRIVSEP_USER already exists." 224 echo "PrivSep user $SSH_PRIVSEP_USER already exists."
224 else 225 else
diff --git a/contrib/aix/inventory.sh b/contrib/aix/inventory.sh
index 619493ae2..4f408e678 100755
--- a/contrib/aix/inventory.sh
+++ b/contrib/aix/inventory.sh
@@ -1,8 +1,10 @@
1#!/bin/sh 1#!/bin/sh
2# 2#
3# inventory.sh 3# inventory.sh
4# $Id: inventory.sh,v 1.5 2003/08/26 03:43:13 dtucker Exp $
4# 5#
5# Originally written by Ben Lindstrom, modified by Darren Tucker to use perl 6# Originally written by Ben Lindstrom, modified by Darren Tucker to use perl
7# This file is placed into the public domain.
6# 8#
7# This will produce an AIX package inventory file, which looks like: 9# This will produce an AIX package inventory file, which looks like:
8# 10#
diff --git a/contrib/caldera/openssh.spec b/contrib/caldera/openssh.spec
index f7fbe15e5..97d6adf51 100644
--- a/contrib/caldera/openssh.spec
+++ b/contrib/caldera/openssh.spec
@@ -17,9 +17,9 @@
17#old cvs stuff. please update before use. may be deprecated. 17#old cvs stuff. please update before use. may be deprecated.
18%define use_stable 1 18%define use_stable 1
19%if %{use_stable} 19%if %{use_stable}
20 %define version 3.6.1p2 20 %define version 3.7p1
21 %define cvs %{nil} 21 %define cvs %{nil}
22 %define release 2 22 %define release 1
23%else 23%else
24 %define version 2.9.9p2 24 %define version 2.9.9p2
25 %define cvs cvs20011009 25 %define cvs cvs20011009
@@ -364,4 +364,4 @@ fi
364* Mon Jan 01 1998 ... 364* Mon Jan 01 1998 ...
365Template Version: 1.31 365Template Version: 1.31
366 366
367$Id: openssh.spec,v 1.42.2.1 2003/04/29 09:12:08 djm Exp $ 367$Id: openssh.spec,v 1.43.2.2 2003/09/16 06:02:40 djm Exp $
diff --git a/contrib/cygwin/ssh-user-config b/contrib/cygwin/ssh-user-config
index 5a76adbaf..4da113181 100644
--- a/contrib/cygwin/ssh-user-config
+++ b/contrib/cygwin/ssh-user-config
@@ -171,8 +171,8 @@ then
171 fi 171 fi
172 if request "Do you want to use this identity to login to this machine?" 172 if request "Do you want to use this identity to login to this machine?"
173 then 173 then
174 echo "Adding to ${pwdhome}/.ssh/authorized_keys2" 174 echo "Adding to ${pwdhome}/.ssh/authorized_keys"
175 cat "${pwdhome}/.ssh/id_rsa.pub" >> "${pwdhome}/.ssh/authorized_keys2" 175 cat "${pwdhome}/.ssh/id_rsa.pub" >> "${pwdhome}/.ssh/authorized_keys"
176 fi 176 fi
177 fi 177 fi
178fi 178fi
@@ -190,8 +190,8 @@ then
190 fi 190 fi
191 if request "Do you want to use this identity to login to this machine?" 191 if request "Do you want to use this identity to login to this machine?"
192 then 192 then
193 echo "Adding to ${pwdhome}/.ssh/authorized_keys2" 193 echo "Adding to ${pwdhome}/.ssh/authorized_keys"
194 cat "${pwdhome}/.ssh/id_dsa.pub" >> "${pwdhome}/.ssh/authorized_keys2" 194 cat "${pwdhome}/.ssh/id_dsa.pub" >> "${pwdhome}/.ssh/authorized_keys"
195 fi 195 fi
196 fi 196 fi
197fi 197fi
diff --git a/contrib/findssl.sh b/contrib/findssl.sh
new file mode 100644
index 000000000..87a4abce2
--- /dev/null
+++ b/contrib/findssl.sh
@@ -0,0 +1,159 @@
1#!/bin/sh
2#
3# findssl.sh
4# Search for all instances of OpenSSL headers and libraries
5# and print their versions.
6# Intended to help diagnose OpenSSH's "OpenSSL headers do not
7# match your library" errors.
8#
9# Written by Darren Tucker (dtucker at zip dot com dot au)
10# This file is placed in the public domain.
11#
12# $Id: findssl.sh,v 1.1 2003/06/24 10:22:10 dtucker Exp $
13# 2002-07-27: Initial release.
14# 2002-08-04: Added public domain notice.
15# 2003-06-24: Incorporated readme, set library paths. First cvs version.
16#
17# "OpenSSL headers do not match your library" are usually caused by
18# OpenSSH's configure picking up an older version of OpenSSL headers
19# or libraries. You can use the following # procedure to help identify
20# the cause.
21#
22# The output of configure will tell you the versions of the OpenSSL
23# headers and libraries that were picked up, for example:
24#
25# checking OpenSSL header version... 90604f (OpenSSL 0.9.6d 9 May 2002)
26# checking OpenSSL library version... 90602f (OpenSSL 0.9.6b [engine] 9 Jul 2001)
27# checking whether OpenSSL's headers match the library... no
28# configure: error: Your OpenSSL headers do not match your library
29#
30# Now run findssl.sh. This should identify the headers and libraries
31# present and their versions. You should be able to identify the
32# libraries and headers used and adjust your CFLAGS or remove incorrect
33# versions. The output will show OpenSSL's internal version identifier
34# and should look something like:
35
36# $ ./findssl.sh
37# Searching for OpenSSL header files.
38# 0x0090604fL /usr/include/openssl/opensslv.h
39# 0x0090604fL /usr/local/ssl/include/openssl/opensslv.h
40#
41# Searching for OpenSSL shared library files.
42# 0x0090602fL /lib/libcrypto.so.0.9.6b
43# 0x0090602fL /lib/libcrypto.so.2
44# 0x0090581fL /usr/lib/libcrypto.so.0
45# 0x0090602fL /usr/lib/libcrypto.so
46# 0x0090581fL /usr/lib/libcrypto.so.0.9.5a
47# 0x0090600fL /usr/lib/libcrypto.so.0.9.6
48# 0x0090600fL /usr/lib/libcrypto.so.1
49#
50# Searching for OpenSSL static library files.
51# 0x0090602fL /usr/lib/libcrypto.a
52# 0x0090604fL /usr/local/ssl/lib/libcrypto.a
53#
54# In this example, I gave configure no extra flags, so it's picking up
55# the OpenSSL header from /usr/include/openssl (90604f) and the library
56# from /usr/lib/ (90602f).
57
58#
59# Adjust these to suit your compiler.
60# You may also need to set the *LIB*PATH environment variables if
61# DEFAULT_LIBPATH is not correct for your system.
62#
63CC=gcc
64STATIC=-static
65
66#
67# Set up conftest C source
68#
69rm -f findssl.log
70cat >conftest.c <<EOD
71#include <stdio.h>
72int main(){printf("0x%08xL\n", SSLeay());}
73EOD
74
75#
76# Set default library paths if not already set
77#
78DEFAULT_LIBPATH=/usr/lib:/usr/local/lib
79LIBPATH=${LIBPATH:=$DEFAULT_LIBPATH}
80LD_LIBRARY_PATH=${LD_LIBRARY_PATH:=$DEFAULT_LIBPATH}
81LIBRARY_PATH=${LIBRARY_PATH:=$DEFAULT_LIBPATH}
82export LIBPATH LD_LIBRARY_PATH LIBRARY_PATH
83
84#
85# Search for OpenSSL headers and print versions
86#
87echo Searching for OpenSSL header files.
88if [ -x "`which locate`" ]
89then
90 headers=`locate opensslv.h`
91else
92 headers=`find / -name opensslv.h -print 2>/dev/null`
93fi
94
95for header in $headers
96do
97 ver=`awk '/OPENSSL_VERSION_NUMBER/{printf \$3}' $header`
98 echo "$ver $header"
99done
100echo
101
102#
103# Search for shared libraries.
104# Relies on shared libraries looking like "libcrypto.s*"
105#
106echo Searching for OpenSSL shared library files.
107if [ -x "`which locate`" ]
108then
109 libraries=`locate libcrypto.s`
110else
111 libraries=`find / -name 'libcrypto.s*' -print 2>/dev/null`
112fi
113
114for lib in $libraries
115do
116 (echo "Trying libcrypto $lib" >>findssl.log
117 dir=`dirname $lib`
118 LIBPATH="$dir:$LIBPATH"
119 LD_LIBRARY_PATH="$dir:$LIBPATH"
120 LIBRARY_PATH="$dir:$LIBPATH"
121 export LIBPATH LD_LIBRARY_PATH LIBRARY_PATH
122 ${CC} -o conftest conftest.c $lib 2>>findssl.log
123 if [ -x ./conftest ]
124 then
125 ver=`./conftest 2>/dev/null`
126 rm -f ./conftest
127 echo "$ver $lib"
128 fi)
129done
130echo
131
132#
133# Search for static OpenSSL libraries and print versions
134#
135echo Searching for OpenSSL static library files.
136if [ -x "`which locate`" ]
137then
138 libraries=`locate libcrypto.a`
139else
140 libraries=`find / -name libcrypto.a -print 2>/dev/null`
141fi
142
143for lib in $libraries
144do
145 libdir=`dirname $lib`
146 echo "Trying libcrypto $lib" >>findssl.log
147 ${CC} ${STATIC} -o conftest conftest.c -L${libdir} -lcrypto 2>>findssl.log
148 if [ -x ./conftest ]
149 then
150 ver=`./conftest 2>/dev/null`
151 rm -f ./conftest
152 echo "$ver $lib"
153 fi
154done
155
156#
157# Clean up
158#
159rm -f conftest.c
diff --git a/contrib/redhat/openssh.spec b/contrib/redhat/openssh.spec
index e7c3bb121..ce7c564c3 100644
--- a/contrib/redhat/openssh.spec
+++ b/contrib/redhat/openssh.spec
@@ -1,4 +1,4 @@
1%define ver 3.6.1p2 1%define ver 3.7p1
2%define rel 1 2%define rel 1
3 3
4# OpenSSH privilege separation requires a user & group ID 4# OpenSSH privilege separation requires a user & group ID
@@ -26,9 +26,6 @@
26# Is this build for RHL 6.x? 26# Is this build for RHL 6.x?
27%define build6x 0 27%define build6x 0
28 28
29# Disable IPv6 (avoids DNS hangs on some glibc versions)
30%define noip6 0
31
32# Do we want kerberos5 support (1=yes 0=no) 29# Do we want kerberos5 support (1=yes 0=no)
33%define kerberos5 1 30%define kerberos5 1
34 31
@@ -43,7 +40,6 @@
43# If this is RHL 6.x, the default configuration has sysconfdir in /usr/etc. 40# If this is RHL 6.x, the default configuration has sysconfdir in /usr/etc.
44%if %{build6x} 41%if %{build6x}
45%define _sysconfdir /etc 42%define _sysconfdir /etc
46%define noip6 1
47%endif 43%endif
48 44
49# Options for static OpenSSL link: 45# Options for static OpenSSL link:
@@ -54,10 +50,6 @@
54# rpm -ba|--rebuild --define "smartcard 1" 50# rpm -ba|--rebuild --define "smartcard 1"
55%{?smartcard:%define scard 1} 51%{?smartcard:%define scard 1}
56 52
57# Option to disable ipv6
58# rpm -ba|--rebuild --define "noipv6 1"
59%{?noipv6:%define noip6 1}
60
61# Is this a build for the rescue CD (without PAM, with MD5)? (1=yes 0=no) 53# Is this a build for the rescue CD (without PAM, with MD5)? (1=yes 0=no)
62%define rescue 0 54%define rescue 0
63%{?build_rescue:%define rescue 1} 55%{?build_rescue:%define rescue 1}
@@ -87,12 +79,12 @@ PreReq: initscripts >= 5.00
87%else 79%else
88PreReq: initscripts >= 5.20 80PreReq: initscripts >= 5.20
89%endif 81%endif
90BuildPreReq: perl, openssl-devel, sharutils, tcp_wrappers 82BuildPreReq: perl, openssl-devel, tcp_wrappers
91BuildPreReq: /bin/login 83BuildPreReq: /bin/login
92%if ! %{build6x} 84%if ! %{build6x}
93BuildPreReq: glibc-devel, pam 85BuildPreReq: glibc-devel, pam
94%else 86%else
95BuildPreReq: db1-devel, /usr/include/security/pam_appl.h 87BuildPreReq: /usr/include/security/pam_appl.h
96%endif 88%endif
97%if ! %{no_x11_askpass} 89%if ! %{no_x11_askpass}
98BuildPreReq: XFree86-devel 90BuildPreReq: XFree86-devel
@@ -196,9 +188,6 @@ CFLAGS="$RPM_OPT_FLAGS -Os"; export CFLAGS
196%if %{scard} 188%if %{scard}
197 --with-smartcard \ 189 --with-smartcard \
198%endif 190%endif
199%if %{noip6}
200 --with-ipv4-default \
201%endif
202%if %{rescue} 191%if %{rescue}
203 --without-pam --with-md5-passwords \ 192 --without-pam --with-md5-passwords \
204%else 193%else
@@ -274,9 +263,11 @@ install -s contrib/gnome-ssh-askpass $RPM_BUILD_ROOT%{_libexecdir}/openssh/gnome
274 rm -f $RPM_BUILD_ROOT/usr/share/openssh/Ssh.bin 263 rm -f $RPM_BUILD_ROOT/usr/share/openssh/Ssh.bin
275%endif 264%endif
276 265
266%if ! %{no_gnome_askpass}
277install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ 267install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
278install -m 755 contrib/redhat/gnome-ssh-askpass.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ 268install -m 755 contrib/redhat/gnome-ssh-askpass.csh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
279install -m 755 contrib/redhat/gnome-ssh-askpass.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/ 269install -m 755 contrib/redhat/gnome-ssh-askpass.sh $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
270%endif
280 271
281perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/* 272perl -pi -e "s|$RPM_BUILD_ROOT||g" $RPM_BUILD_ROOT%{_mandir}/man*/*
282 273
@@ -400,6 +391,14 @@ fi
400%endif 391%endif
401 392
402%changelog 393%changelog
394* Mon Jun 2 2003 Damien Miller <djm@mindrot.org>
395- Remove noip6 option. This may be controlled at run-time in client config
396 file using new AddressFamily directive
397
398* Mon May 12 2003 Damien Miller <djm@mindrot.org>
399- Don't install profile.d scripts when not building with GNOME/GTK askpass
400 (patch from bet@rahul.net)
401
403* Wed Oct 01 2002 Damien Miller <djm@mindrot.org> 402* Wed Oct 01 2002 Damien Miller <djm@mindrot.org>
404- Install ssh-agent setgid nobody to prevent ptrace() key theft attacks 403- Install ssh-agent setgid nobody to prevent ptrace() key theft attacks
405 404
diff --git a/contrib/suse/openssh.spec b/contrib/suse/openssh.spec
index 707c3a221..ca7437bd6 100644
--- a/contrib/suse/openssh.spec
+++ b/contrib/suse/openssh.spec
@@ -1,6 +1,6 @@
1Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation 1Summary: OpenSSH, a free Secure Shell (SSH) protocol implementation
2Name: openssh 2Name: openssh
3Version: 3.6.1p2 3Version: 3.7p1
4URL: http://www.openssh.com/ 4URL: http://www.openssh.com/
5Release: 1 5Release: 1
6Source0: openssh-%{version}.tar.gz 6Source0: openssh-%{version}.tar.gz
diff --git a/defines.h b/defines.h
index 73fbe077b..e662966fb 100644
--- a/defines.h
+++ b/defines.h
@@ -1,7 +1,31 @@
1/*
2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
1#ifndef _DEFINES_H 25#ifndef _DEFINES_H
2#define _DEFINES_H 26#define _DEFINES_H
3 27
4/* $Id: defines.h,v 1.97 2003/01/24 00:50:32 djm Exp $ */ 28/* $Id: defines.h,v 1.103 2003/09/16 01:52:19 dtucker Exp $ */
5 29
6 30
7/* Constants */ 31/* Constants */
@@ -188,28 +212,21 @@ typedef unsigned long u_int32_t;
188#ifndef HAVE_INT64_T 212#ifndef HAVE_INT64_T
189# if (SIZEOF_LONG_INT == 8) 213# if (SIZEOF_LONG_INT == 8)
190typedef long int int64_t; 214typedef long int int64_t;
191# define HAVE_INT64_T 1
192# else 215# else
193# if (SIZEOF_LONG_LONG_INT == 8) 216# if (SIZEOF_LONG_LONG_INT == 8)
194typedef long long int int64_t; 217typedef long long int int64_t;
195# define HAVE_INT64_T 1
196# endif 218# endif
197# endif 219# endif
198#endif 220#endif
199#ifndef HAVE_U_INT64_T 221#ifndef HAVE_U_INT64_T
200# if (SIZEOF_LONG_INT == 8) 222# if (SIZEOF_LONG_INT == 8)
201typedef unsigned long int u_int64_t; 223typedef unsigned long int u_int64_t;
202# define HAVE_U_INT64_T 1
203# else 224# else
204# if (SIZEOF_LONG_LONG_INT == 8) 225# if (SIZEOF_LONG_LONG_INT == 8)
205typedef unsigned long long int u_int64_t; 226typedef unsigned long long int u_int64_t;
206# define HAVE_U_INT64_T 1
207# endif 227# endif
208# endif 228# endif
209#endif 229#endif
210#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
211# define HAVE_LONG_LONG_INT 1
212#endif
213 230
214#ifndef HAVE_U_CHAR 231#ifndef HAVE_U_CHAR
215typedef unsigned char u_char; 232typedef unsigned char u_char;
@@ -304,6 +321,10 @@ struct winsize {
304# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" 321# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
305#endif 322#endif
306 323
324#ifndef SUPERUSER_PATH
325# define SUPERUSER_PATH _PATH_STDPATH
326#endif
327
307#ifndef _PATH_DEVNULL 328#ifndef _PATH_DEVNULL
308# define _PATH_DEVNULL "/dev/null" 329# define _PATH_DEVNULL "/dev/null"
309#endif 330#endif
@@ -420,6 +441,23 @@ struct winsize {
420#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len)) 441#define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
421#endif 442#endif
422 443
444/* given pointer to struct cmsghdr, return pointer to data */
445#ifndef CMSG_DATA
446#define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
447#endif /* CMSG_DATA */
448
449/*
450 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
451 * an empty list for some reasons.
452 */
453#ifndef CMSG_FIRSTHDR
454#define CMSG_FIRSTHDR(mhdr) \
455 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
456 (struct cmsghdr *)(mhdr)->msg_control : \
457 (struct cmsghdr *)NULL)
458#endif /* CMSG_FIRSTHDR */
459
460
423/* Function replacement / compatibility hacks */ 461/* Function replacement / compatibility hacks */
424 462
425#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO)) 463#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
@@ -487,6 +525,10 @@ struct winsize {
487# define __func__ "" 525# define __func__ ""
488#endif 526#endif
489 527
528#if defined(KRB5) && !defined(HEIMDAL)
529# define krb5_get_err_text(context,code) error_message(code)
530#endif
531
490/* 532/*
491 * Define this to use pipes instead of socketpairs for communicating with the 533 * Define this to use pipes instead of socketpairs for communicating with the
492 * client program. Socketpairs do not seem to work on all systems. 534 * client program. Socketpairs do not seem to work on all systems.
diff --git a/dh.c b/dh.c
index 1be51953c..996428b7f 100644
--- a/dh.c
+++ b/dh.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: dh.c,v 1.23 2002/11/21 22:22:50 markus Exp $"); 26RCSID("$OpenBSD: dh.c,v 1.24 2003/04/08 20:21:28 itojun Exp $");
27 27
28#include "xmalloc.h" 28#include "xmalloc.h"
29 29
@@ -112,7 +112,7 @@ choose_dh(int min, int wantbits, int max)
112 112
113 if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL && 113 if ((f = fopen(_PATH_DH_MODULI, "r")) == NULL &&
114 (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) { 114 (f = fopen(_PATH_DH_PRIMES, "r")) == NULL) {
115 log("WARNING: %s does not exist, using old modulus", _PATH_DH_MODULI); 115 logit("WARNING: %s does not exist, using old modulus", _PATH_DH_MODULI);
116 return (dh_new_group1()); 116 return (dh_new_group1());
117 } 117 }
118 118
@@ -140,7 +140,7 @@ choose_dh(int min, int wantbits, int max)
140 140
141 if (bestcount == 0) { 141 if (bestcount == 0) {
142 fclose(f); 142 fclose(f);
143 log("WARNING: no suitable primes in %s", _PATH_DH_PRIMES); 143 logit("WARNING: no suitable primes in %s", _PATH_DH_PRIMES);
144 return (NULL); 144 return (NULL);
145 } 145 }
146 146
@@ -176,7 +176,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
176 int bits_set = 0; 176 int bits_set = 0;
177 177
178 if (dh_pub->neg) { 178 if (dh_pub->neg) {
179 log("invalid public DH value: negativ"); 179 logit("invalid public DH value: negativ");
180 return 0; 180 return 0;
181 } 181 }
182 for (i = 0; i <= n; i++) 182 for (i = 0; i <= n; i++)
@@ -187,7 +187,7 @@ dh_pub_is_valid(DH *dh, BIGNUM *dh_pub)
187 /* if g==2 and bits_set==1 then computing log_g(dh_pub) is trivial */ 187 /* if g==2 and bits_set==1 then computing log_g(dh_pub) is trivial */
188 if (bits_set > 1 && (BN_cmp(dh_pub, dh->p) == -1)) 188 if (bits_set > 1 && (BN_cmp(dh_pub, dh->p) == -1))
189 return 1; 189 return 1;
190 log("invalid public DH value (%d/%d)", bits_set, BN_num_bits(dh->p)); 190 logit("invalid public DH value (%d/%d)", bits_set, BN_num_bits(dh->p));
191 return 0; 191 return 0;
192} 192}
193 193
diff --git a/dispatch.c b/dispatch.c
index ce32bc22f..c5ff65031 100644
--- a/dispatch.c
+++ b/dispatch.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: dispatch.c,v 1.15 2002/01/11 13:39:36 markus Exp $"); 25RCSID("$OpenBSD: dispatch.c,v 1.16 2003/04/08 20:21:28 itojun Exp $");
26 26
27#include "ssh1.h" 27#include "ssh1.h"
28#include "ssh2.h" 28#include "ssh2.h"
@@ -39,7 +39,7 @@ dispatch_fn *dispatch[DISPATCH_MAX];
39void 39void
40dispatch_protocol_error(int type, u_int32_t seq, void *ctxt) 40dispatch_protocol_error(int type, u_int32_t seq, void *ctxt)
41{ 41{
42 log("dispatch_protocol_error: type %d seq %u", type, seq); 42 logit("dispatch_protocol_error: type %d seq %u", type, seq);
43 if (!compat20) 43 if (!compat20)
44 fatal("protocol error"); 44 fatal("protocol error");
45 packet_start(SSH2_MSG_UNIMPLEMENTED); 45 packet_start(SSH2_MSG_UNIMPLEMENTED);
@@ -50,7 +50,7 @@ dispatch_protocol_error(int type, u_int32_t seq, void *ctxt)
50void 50void
51dispatch_protocol_ignore(int type, u_int32_t seq, void *ctxt) 51dispatch_protocol_ignore(int type, u_int32_t seq, void *ctxt)
52{ 52{
53 log("dispatch_protocol_ignore: type %d seq %u", type, seq); 53 logit("dispatch_protocol_ignore: type %d seq %u", type, seq);
54} 54}
55void 55void
56dispatch_init(dispatch_fn *dflt) 56dispatch_init(dispatch_fn *dflt)
diff --git a/dns.c b/dns.c
new file mode 100644
index 000000000..90ab5601a
--- /dev/null
+++ b/dns.c
@@ -0,0 +1,290 @@
1/* $OpenBSD: dns.c,v 1.6 2003/06/11 10:18:47 jakob Exp $ */
2
3/*
4 * Copyright (c) 2003 Wesley Griffin. All rights reserved.
5 * Copyright (c) 2003 Jakob Schlyter. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29#include "includes.h"
30
31#ifdef DNS
32#include <openssl/bn.h>
33#ifdef LWRES
34#include <lwres/netdb.h>
35#include <dns/result.h>
36#else /* LWRES */
37#include <netdb.h>
38#endif /* LWRES */
39
40#include "xmalloc.h"
41#include "key.h"
42#include "dns.h"
43#include "log.h"
44#include "uuencode.h"
45
46extern char *__progname;
47RCSID("$OpenBSD: dns.c,v 1.6 2003/06/11 10:18:47 jakob Exp $");
48
49#ifndef LWRES
50static const char *errset_text[] = {
51 "success", /* 0 ERRSET_SUCCESS */
52 "out of memory", /* 1 ERRSET_NOMEMORY */
53 "general failure", /* 2 ERRSET_FAIL */
54 "invalid parameter", /* 3 ERRSET_INVAL */
55 "name does not exist", /* 4 ERRSET_NONAME */
56 "data does not exist", /* 5 ERRSET_NODATA */
57};
58
59static const char *
60dns_result_totext(unsigned int error)
61{
62 switch (error) {
63 case ERRSET_SUCCESS:
64 return errset_text[ERRSET_SUCCESS];
65 case ERRSET_NOMEMORY:
66 return errset_text[ERRSET_NOMEMORY];
67 case ERRSET_FAIL:
68 return errset_text[ERRSET_FAIL];
69 case ERRSET_INVAL:
70 return errset_text[ERRSET_INVAL];
71 case ERRSET_NONAME:
72 return errset_text[ERRSET_NONAME];
73 case ERRSET_NODATA:
74 return errset_text[ERRSET_NODATA];
75 default:
76 return "unknown error";
77 }
78}
79#endif /* LWRES */
80
81
82/*
83 * Read SSHFP parameters from key buffer.
84 */
85static int
86dns_read_key(u_int8_t *algorithm, u_int8_t *digest_type,
87 u_char **digest, u_int *digest_len, Key *key)
88{
89 int success = 0;
90
91 switch (key->type) {
92 case KEY_RSA:
93 *algorithm = SSHFP_KEY_RSA;
94 break;
95 case KEY_DSA:
96 *algorithm = SSHFP_KEY_DSA;
97 break;
98 default:
99 *algorithm = SSHFP_KEY_RESERVED;
100 }
101
102 if (*algorithm) {
103 *digest_type = SSHFP_HASH_SHA1;
104 *digest = key_fingerprint_raw(key, SSH_FP_SHA1, digest_len);
105 success = 1;
106 } else {
107 *digest_type = SSHFP_HASH_RESERVED;
108 *digest = NULL;
109 *digest_len = 0;
110 success = 0;
111 }
112
113 return success;
114}
115
116/*
117 * Read SSHFP parameters from rdata buffer.
118 */
119static int
120dns_read_rdata(u_int8_t *algorithm, u_int8_t *digest_type,
121 u_char **digest, u_int *digest_len, u_char *rdata, int rdata_len)
122{
123 int success = 0;
124
125 *algorithm = SSHFP_KEY_RESERVED;
126 *digest_type = SSHFP_HASH_RESERVED;
127
128 if (rdata_len >= 2) {
129 *algorithm = rdata[0];
130 *digest_type = rdata[1];
131 *digest_len = rdata_len - 2;
132
133 if (*digest_len > 0) {
134 *digest = (u_char *) xmalloc(*digest_len);
135 memcpy(*digest, rdata + 2, *digest_len);
136 } else {
137 *digest = NULL;
138 }
139
140 success = 1;
141 }
142
143 return success;
144}
145
146
147/*
148 * Verify the given hostname, address and host key using DNS.
149 * Returns 0 if key verifies or -1 if key does NOT verify
150 */
151int
152verify_host_key_dns(const char *hostname, struct sockaddr *address,
153 Key *hostkey)
154{
155 int counter;
156 int result;
157 struct rrsetinfo *fingerprints = NULL;
158 int failures = 0;
159
160 u_int8_t hostkey_algorithm;
161 u_int8_t hostkey_digest_type;
162 u_char *hostkey_digest;
163 u_int hostkey_digest_len;
164
165 u_int8_t dnskey_algorithm;
166 u_int8_t dnskey_digest_type;
167 u_char *dnskey_digest;
168 u_int dnskey_digest_len;
169
170
171 debug3("verify_hostkey_dns");
172 if (hostkey == NULL)
173 fatal("No key to look up!");
174
175 result = getrrsetbyname(hostname, DNS_RDATACLASS_IN,
176 DNS_RDATATYPE_SSHFP, 0, &fingerprints);
177 if (result) {
178 verbose("DNS lookup error: %s", dns_result_totext(result));
179 return DNS_VERIFY_ERROR;
180 }
181
182#ifdef DNSSEC
183 /* Only accept validated answers */
184 if (!fingerprints->rri_flags & RRSET_VALIDATED) {
185 error("Ignored unvalidated fingerprint from DNS.");
186 freerrset(fingerprints);
187 return DNS_VERIFY_ERROR;
188 }
189#endif
190
191 debug("found %d fingerprints in DNS", fingerprints->rri_nrdatas);
192
193 /* Initialize host key parameters */
194 if (!dns_read_key(&hostkey_algorithm, &hostkey_digest_type,
195 &hostkey_digest, &hostkey_digest_len, hostkey)) {
196 error("Error calculating host key fingerprint.");
197 freerrset(fingerprints);
198 return DNS_VERIFY_ERROR;
199 }
200
201 for (counter = 0 ; counter < fingerprints->rri_nrdatas ; counter++) {
202 /*
203 * Extract the key from the answer. Ignore any badly
204 * formatted fingerprints.
205 */
206 if (!dns_read_rdata(&dnskey_algorithm, &dnskey_digest_type,
207 &dnskey_digest, &dnskey_digest_len,
208 fingerprints->rri_rdatas[counter].rdi_data,
209 fingerprints->rri_rdatas[counter].rdi_length)) {
210 verbose("Error parsing fingerprint from DNS.");
211 continue;
212 }
213
214 /* Check if the current key is the same as the given key */
215 if (hostkey_algorithm == dnskey_algorithm &&
216 hostkey_digest_type == dnskey_digest_type) {
217
218 if (hostkey_digest_len == dnskey_digest_len &&
219 memcmp(hostkey_digest, dnskey_digest,
220 hostkey_digest_len) == 0) {
221
222 /* Matching algoritm and digest. */
223 freerrset(fingerprints);
224 debug("matching host key fingerprint found in DNS");
225 return DNS_VERIFY_OK;
226 } else {
227 /* Correct algorithm but bad digest */
228 debug("verify_hostkey_dns: failed");
229 failures++;
230 }
231 }
232 }
233
234 freerrset(fingerprints);
235
236 if (failures) {
237 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
238 error("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @");
239 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
240 error("IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!");
241 error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!");
242 error("It is also possible that the %s host key has just been changed.",
243 key_type(hostkey));
244 error("Please contact your system administrator.");
245 return DNS_VERIFY_FAILED;
246 }
247
248 debug("fingerprints found in DNS, but none of them matched");
249
250 return DNS_VERIFY_ERROR;
251}
252
253
254/*
255 * Export the fingerprint of a key as a DNS resource record
256 */
257int
258export_dns_rr(const char *hostname, Key *key, FILE *f, int generic)
259{
260 u_int8_t rdata_pubkey_algorithm = 0;
261 u_int8_t rdata_digest_type = SSHFP_HASH_SHA1;
262 u_char *rdata_digest;
263 u_int rdata_digest_len;
264
265 int i;
266 int success = 0;
267
268 if (dns_read_key(&rdata_pubkey_algorithm, &rdata_digest_type,
269 &rdata_digest, &rdata_digest_len, key)) {
270
271 if (generic)
272 fprintf(f, "%s IN TYPE%d \\# %d %02x %02x ", hostname,
273 DNS_RDATATYPE_SSHFP, 2 + rdata_digest_len,
274 rdata_pubkey_algorithm, rdata_digest_type);
275 else
276 fprintf(f, "%s IN SSHFP %d %d ", hostname,
277 rdata_pubkey_algorithm, rdata_digest_type);
278
279 for (i = 0; i < rdata_digest_len; i++)
280 fprintf(f, "%02x", rdata_digest[i]);
281 fprintf(f, "\n");
282 success = 1;
283 } else {
284 error("dns_export_rr: unsupported algorithm");
285 }
286
287 return success;
288}
289
290#endif /* DNS */
diff --git a/dns.h b/dns.h
new file mode 100644
index 000000000..ba0ea9fb4
--- /dev/null
+++ b/dns.h
@@ -0,0 +1,57 @@
1/* $OpenBSD: dns.h,v 1.3 2003/05/14 22:56:51 jakob Exp $ */
2
3/*
4 * Copyright (c) 2003 Wesley Griffin. All rights reserved.
5 * Copyright (c) 2003 Jakob Schlyter. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28
29#include "includes.h"
30
31#ifdef DNS
32#ifndef DNS_H
33#define DNS_H
34
35enum sshfp_types {
36 SSHFP_KEY_RESERVED,
37 SSHFP_KEY_RSA,
38 SSHFP_KEY_DSA
39};
40
41enum sshfp_hashes {
42 SSHFP_HASH_RESERVED,
43 SSHFP_HASH_SHA1
44};
45
46#define DNS_RDATACLASS_IN 1
47#define DNS_RDATATYPE_SSHFP 44
48
49#define DNS_VERIFY_FAILED -1
50#define DNS_VERIFY_OK 0
51#define DNS_VERIFY_ERROR 1
52
53int verify_host_key_dns(const char *, struct sockaddr *, Key *);
54int export_dns_rr(const char *, Key *, FILE *, int);
55
56#endif /* DNS_H */
57#endif /* DNS */
diff --git a/entropy.c b/entropy.c
index dcc8689c9..216879786 100644
--- a/entropy.c
+++ b/entropy.c
@@ -45,7 +45,7 @@
45 * XXX: we should tell the child how many bytes we need. 45 * XXX: we should tell the child how many bytes we need.
46 */ 46 */
47 47
48RCSID("$Id: entropy.c,v 1.44 2002/06/09 19:41:48 mouring Exp $"); 48RCSID("$Id: entropy.c,v 1.46 2003/08/25 01:16:21 mouring Exp $");
49 49
50#ifndef OPENSSL_PRNG_ONLY 50#ifndef OPENSSL_PRNG_ONLY
51#define RANDOM_SEED_SIZE 48 51#define RANDOM_SEED_SIZE 48
@@ -75,7 +75,7 @@ seed_rng(void)
75 if (pipe(p) == -1) 75 if (pipe(p) == -1)
76 fatal("pipe: %s", strerror(errno)); 76 fatal("pipe: %s", strerror(errno));
77 77
78 old_sigchld = mysignal(SIGCHLD, SIG_DFL); 78 old_sigchld = signal(SIGCHLD, SIG_DFL);
79 if ((pid = fork()) == -1) 79 if ((pid = fork()) == -1)
80 fatal("Couldn't fork: %s", strerror(errno)); 80 fatal("Couldn't fork: %s", strerror(errno));
81 if (pid == 0) { 81 if (pid == 0) {
@@ -89,8 +89,8 @@ seed_rng(void)
89 if (original_uid != original_euid && 89 if (original_uid != original_euid &&
90 ( seteuid(getuid()) == -1 || 90 ( seteuid(getuid()) == -1 ||
91 setuid(original_uid) == -1) ) { 91 setuid(original_uid) == -1) ) {
92 fprintf(stderr, "(rand child) setuid(%d): %s\n", 92 fprintf(stderr, "(rand child) setuid(%li): %s\n",
93 original_uid, strerror(errno)); 93 (long int)original_uid, strerror(errno));
94 _exit(1); 94 _exit(1);
95 } 95 }
96 96
@@ -116,7 +116,7 @@ seed_rng(void)
116 if (waitpid(pid, &ret, 0) == -1) 116 if (waitpid(pid, &ret, 0) == -1)
117 fatal("Couldn't wait for ssh-rand-helper completion: %s", 117 fatal("Couldn't wait for ssh-rand-helper completion: %s",
118 strerror(errno)); 118 strerror(errno));
119 mysignal(SIGCHLD, old_sigchld); 119 signal(SIGCHLD, old_sigchld);
120 120
121 /* We don't mind if the child exits upon a SIGPIPE */ 121 /* We don't mind if the child exits upon a SIGPIPE */
122 if (!WIFEXITED(ret) && 122 if (!WIFEXITED(ret) &&
diff --git a/groupaccess.c b/groupaccess.c
index 66dfa68fe..fbf794fc8 100644
--- a/groupaccess.c
+++ b/groupaccess.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: groupaccess.c,v 1.5 2002/03/04 17:27:39 stevesk Exp $"); 26RCSID("$OpenBSD: groupaccess.c,v 1.6 2003/04/08 20:21:28 itojun Exp $");
27 27
28#include "groupaccess.h" 28#include "groupaccess.h"
29#include "xmalloc.h" 29#include "xmalloc.h"
@@ -49,7 +49,7 @@ ga_init(const char *user, gid_t base)
49 49
50 ngroups = sizeof(groups_bygid) / sizeof(gid_t); 50 ngroups = sizeof(groups_bygid) / sizeof(gid_t);
51 if (getgrouplist(user, base, groups_bygid, &ngroups) == -1) 51 if (getgrouplist(user, base, groups_bygid, &ngroups) == -1)
52 log("getgrouplist: groups list too small"); 52 logit("getgrouplist: groups list too small");
53 for (i = 0, j = 0; i < ngroups; i++) 53 for (i = 0, j = 0; i < ngroups; i++)
54 if ((gr = getgrgid(groups_bygid[i])) != NULL) 54 if ((gr = getgrgid(groups_bygid[i])) != NULL)
55 groups_byname[j++] = xstrdup(gr->gr_name); 55 groups_byname[j++] = xstrdup(gr->gr_name);
diff --git a/gss-genr.c b/gss-genr.c
new file mode 100644
index 000000000..bda12d6f1
--- /dev/null
+++ b/gss-genr.c
@@ -0,0 +1,256 @@
1/* $OpenBSD: gss-genr.c,v 1.1 2003/08/22 10:56:09 markus Exp $ */
2
3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include "includes.h"
28
29#ifdef GSSAPI
30
31#include "xmalloc.h"
32#include "bufaux.h"
33#include "compat.h"
34#include "log.h"
35#include "monitor_wrap.h"
36
37#include "ssh-gss.h"
38
39
40/* Check that the OID in a data stream matches that in the context */
41int
42ssh_gssapi_check_oid(Gssctxt *ctx, void *data, size_t len)
43{
44 return (ctx != NULL && ctx->oid != GSS_C_NO_OID &&
45 ctx->oid->length == len &&
46 memcmp(ctx->oid->elements, data, len) == 0);
47}
48
49/* Set the contexts OID from a data stream */
50void
51ssh_gssapi_set_oid_data(Gssctxt *ctx, void *data, size_t len)
52{
53 if (ctx->oid != GSS_C_NO_OID) {
54 xfree(ctx->oid->elements);
55 xfree(ctx->oid);
56 }
57 ctx->oid = xmalloc(sizeof(gss_OID_desc));
58 ctx->oid->length = len;
59 ctx->oid->elements = xmalloc(len);
60 memcpy(ctx->oid->elements, data, len);
61}
62
63/* Set the contexts OID */
64void
65ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid)
66{
67 ssh_gssapi_set_oid_data(ctx, oid->elements, oid->length);
68}
69
70/* All this effort to report an error ... */
71void
72ssh_gssapi_error(Gssctxt *ctxt)
73{
74 debug("%s", ssh_gssapi_last_error(ctxt, NULL, NULL));
75}
76
77char *
78ssh_gssapi_last_error(Gssctxt *ctxt,
79 OM_uint32 *major_status, OM_uint32 *minor_status)
80{
81 OM_uint32 lmin;
82 gss_buffer_desc msg = GSS_C_EMPTY_BUFFER;
83 OM_uint32 ctx;
84 Buffer b;
85 char *ret;
86
87 buffer_init(&b);
88
89 if (major_status != NULL)
90 *major_status = ctxt->major;
91 if (minor_status != NULL)
92 *minor_status = ctxt->minor;
93
94 ctx = 0;
95 /* The GSSAPI error */
96 do {
97 gss_display_status(&lmin, ctxt->major,
98 GSS_C_GSS_CODE, GSS_C_NULL_OID, &ctx, &msg);
99
100 buffer_append(&b, msg.value, msg.length);
101 buffer_put_char(&b, '\n');
102
103 gss_release_buffer(&lmin, &msg);
104 } while (ctx != 0);
105
106 /* The mechanism specific error */
107 do {
108 gss_display_status(&lmin, ctxt->minor,
109 GSS_C_MECH_CODE, GSS_C_NULL_OID, &ctx, &msg);
110
111 buffer_append(&b, msg.value, msg.length);
112 buffer_put_char(&b, '\n');
113
114 gss_release_buffer(&lmin, &msg);
115 } while (ctx != 0);
116
117 buffer_put_char(&b, '\0');
118 ret = xmalloc(buffer_len(&b));
119 buffer_get(&b, ret, buffer_len(&b));
120 buffer_free(&b);
121 return (ret);
122}
123
124/*
125 * Initialise our GSSAPI context. We use this opaque structure to contain all
126 * of the data which both the client and server need to persist across
127 * {accept,init}_sec_context calls, so that when we do it from the userauth
128 * stuff life is a little easier
129 */
130void
131ssh_gssapi_build_ctx(Gssctxt **ctx)
132{
133 *ctx = xmalloc(sizeof (Gssctxt));
134 (*ctx)->major = 0;
135 (*ctx)->minor = 0;
136 (*ctx)->context = GSS_C_NO_CONTEXT;
137 (*ctx)->name = GSS_C_NO_NAME;
138 (*ctx)->oid = GSS_C_NO_OID;
139 (*ctx)->creds = GSS_C_NO_CREDENTIAL;
140 (*ctx)->client = GSS_C_NO_NAME;
141 (*ctx)->client_creds = GSS_C_NO_CREDENTIAL;
142}
143
144/* Delete our context, providing it has been built correctly */
145void
146ssh_gssapi_delete_ctx(Gssctxt **ctx)
147{
148 OM_uint32 ms;
149
150 if ((*ctx) == NULL)
151 return;
152 if ((*ctx)->context != GSS_C_NO_CONTEXT)
153 gss_delete_sec_context(&ms, &(*ctx)->context, GSS_C_NO_BUFFER);
154 if ((*ctx)->name != GSS_C_NO_NAME)
155 gss_release_name(&ms, &(*ctx)->name);
156 if ((*ctx)->oid != GSS_C_NO_OID) {
157 xfree((*ctx)->oid->elements);
158 xfree((*ctx)->oid);
159 (*ctx)->oid = GSS_C_NO_OID;
160 }
161 if ((*ctx)->creds != GSS_C_NO_CREDENTIAL)
162 gss_release_cred(&ms, &(*ctx)->creds);
163 if ((*ctx)->client != GSS_C_NO_NAME)
164 gss_release_name(&ms, &(*ctx)->client);
165 if ((*ctx)->client_creds != GSS_C_NO_CREDENTIAL)
166 gss_release_cred(&ms, &(*ctx)->client_creds);
167
168 xfree(*ctx);
169 *ctx = NULL;
170}
171
172/*
173 * Wrapper to init_sec_context
174 * Requires that the context contains:
175 * oid
176 * server name (from ssh_gssapi_import_name)
177 */
178OM_uint32
179ssh_gssapi_init_ctx(Gssctxt *ctx, int deleg_creds, gss_buffer_desc *recv_tok,
180 gss_buffer_desc* send_tok, OM_uint32 *flags)
181{
182 int deleg_flag = 0;
183
184 if (deleg_creds) {
185 deleg_flag = GSS_C_DELEG_FLAG;
186 debug("Delegating credentials");
187 }
188
189 ctx->major = gss_init_sec_context(&ctx->minor,
190 GSS_C_NO_CREDENTIAL, &ctx->context, ctx->name, ctx->oid,
191 GSS_C_MUTUAL_FLAG | GSS_C_INTEG_FLAG | deleg_flag,
192 0, NULL, recv_tok, NULL, send_tok, flags, NULL);
193
194 if (GSS_ERROR(ctx->major))
195 ssh_gssapi_error(ctx);
196
197 return (ctx->major);
198}
199
200/* Create a service name for the given host */
201OM_uint32
202ssh_gssapi_import_name(Gssctxt *ctx, const char *host)
203{
204 gss_buffer_desc gssbuf;
205
206 gssbuf.length = sizeof("host@") + strlen(host);
207 gssbuf.value = xmalloc(gssbuf.length);
208 snprintf(gssbuf.value, gssbuf.length, "host@%s", host);
209
210 if ((ctx->major = gss_import_name(&ctx->minor,
211 &gssbuf, GSS_C_NT_HOSTBASED_SERVICE, &ctx->name)))
212 ssh_gssapi_error(ctx);
213
214 xfree(gssbuf.value);
215 return (ctx->major);
216}
217
218/* Acquire credentials for a server running on the current host.
219 * Requires that the context structure contains a valid OID
220 */
221
222/* Returns a GSSAPI error code */
223OM_uint32
224ssh_gssapi_acquire_cred(Gssctxt *ctx)
225{
226 OM_uint32 status;
227 char lname[MAXHOSTNAMELEN];
228 gss_OID_set oidset;
229
230 gss_create_empty_oid_set(&status, &oidset);
231 gss_add_oid_set_member(&status, ctx->oid, &oidset);
232
233 if (gethostname(lname, MAXHOSTNAMELEN))
234 return (-1);
235
236 if (GSS_ERROR(ssh_gssapi_import_name(ctx, lname)))
237 return (ctx->major);
238
239 if ((ctx->major = gss_acquire_cred(&ctx->minor,
240 ctx->name, 0, oidset, GSS_C_ACCEPT, &ctx->creds, NULL, NULL)))
241 ssh_gssapi_error(ctx);
242
243 gss_release_oid_set(&status, &oidset);
244 return (ctx->major);
245}
246
247OM_uint32
248ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid) {
249 if (*ctx)
250 ssh_gssapi_delete_ctx(ctx);
251 ssh_gssapi_build_ctx(ctx);
252 ssh_gssapi_set_oid(*ctx, oid);
253 return (ssh_gssapi_acquire_cred(*ctx));
254}
255
256#endif /* GSSAPI */
diff --git a/gss-serv-krb5.c b/gss-serv-krb5.c
new file mode 100644
index 000000000..f48e09911
--- /dev/null
+++ b/gss-serv-krb5.c
@@ -0,0 +1,205 @@
1/* $OpenBSD: gss-serv-krb5.c,v 1.1 2003/08/22 10:56:09 markus Exp $ */
2
3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include "includes.h"
28
29#ifdef GSSAPI
30#ifdef KRB5
31
32#include "auth.h"
33#include "xmalloc.h"
34#include "log.h"
35#include "servconf.h"
36
37#include "ssh-gss.h"
38
39extern ServerOptions options;
40
41#ifdef HEIMDAL
42#include <krb5.h>
43#else
44#include <gssapi_krb5.h>
45#endif
46
47static krb5_context krb_context = NULL;
48
49/* Initialise the krb5 library, for the stuff that GSSAPI won't do */
50
51static int
52ssh_gssapi_krb5_init()
53{
54 krb5_error_code problem;
55
56 if (krb_context != NULL)
57 return 1;
58
59 problem = krb5_init_context(&krb_context);
60 if (problem) {
61 logit("Cannot initialize krb5 context");
62 return 0;
63 }
64 krb5_init_ets(krb_context);
65
66 return 1;
67}
68
69/* Check if this user is OK to login. This only works with krb5 - other
70 * GSSAPI mechanisms will need their own.
71 * Returns true if the user is OK to log in, otherwise returns 0
72 */
73
74static int
75ssh_gssapi_krb5_userok(ssh_gssapi_client *client, char *name)
76{
77 krb5_principal princ;
78 int retval;
79
80 if (ssh_gssapi_krb5_init() == 0)
81 return 0;
82
83 if ((retval = krb5_parse_name(krb_context, client->exportedname.value,
84 &princ))) {
85 logit("krb5_parse_name(): %.100s",
86 krb5_get_err_text(krb_context, retval));
87 return 0;
88 }
89 if (krb5_kuserok(krb_context, princ, name)) {
90 retval = 1;
91 logit("Authorized to %s, krb5 principal %s (krb5_kuserok)",
92 name, (char *)client->displayname.value);
93 } else
94 retval = 0;
95
96 krb5_free_principal(krb_context, princ);
97 return retval;
98}
99
100
101/* This writes out any forwarded credentials from the structure populated
102 * during userauth. Called after we have setuid to the user */
103
104static void
105ssh_gssapi_krb5_storecreds(ssh_gssapi_client *client)
106{
107 krb5_ccache ccache;
108 krb5_error_code problem;
109 krb5_principal princ;
110 OM_uint32 maj_status, min_status;
111
112 if (client->creds == NULL) {
113 debug("No credentials stored");
114 return;
115 }
116
117 if (ssh_gssapi_krb5_init() == 0)
118 return;
119
120#ifdef HEIMDAL
121 if ((problem = krb5_cc_gen_new(krb_context, &krb5_fcc_ops, &ccache))) {
122 logit("krb5_cc_gen_new(): %.100s",
123 krb5_get_err_text(krb_context, problem));
124 return;
125 }
126#else
127 {
128 int tmpfd;
129 char ccname[40];
130
131 snprintf(ccname, sizeof(ccname),
132 "FILE:/tmp/krb5cc_%d_XXXXXX", geteuid());
133
134 if ((tmpfd = mkstemp(ccname + strlen("FILE:"))) == -1) {
135 logit("mkstemp(): %.100s", strerror(errno));
136 problem = errno;
137 return;
138 }
139 if (fchmod(tmpfd, S_IRUSR | S_IWUSR) == -1) {
140 logit("fchmod(): %.100s", strerror(errno));
141 close(tmpfd);
142 problem = errno;
143 return;
144 }
145 close(tmpfd);
146 if ((problem = krb5_cc_resolve(krb_context, ccname, &ccache))) {
147 logit("krb5_cc_resolve(): %.100s",
148 krb5_get_err_text(krb_context, problem));
149 return;
150 }
151 }
152#endif /* #ifdef HEIMDAL */
153
154 if ((problem = krb5_parse_name(krb_context,
155 client->exportedname.value, &princ))) {
156 logit("krb5_parse_name(): %.100s",
157 krb5_get_err_text(krb_context, problem));
158 krb5_cc_destroy(krb_context, ccache);
159 return;
160 }
161
162 if ((problem = krb5_cc_initialize(krb_context, ccache, princ))) {
163 logit("krb5_cc_initialize(): %.100s",
164 krb5_get_err_text(krb_context, problem));
165 krb5_free_principal(krb_context, princ);
166 krb5_cc_destroy(krb_context, ccache);
167 return;
168 }
169
170 krb5_free_principal(krb_context, princ);
171
172 if ((maj_status = gss_krb5_copy_ccache(&min_status,
173 client->creds, ccache))) {
174 logit("gss_krb5_copy_ccache() failed");
175 krb5_cc_destroy(krb_context, ccache);
176 return;
177 }
178
179 client->store.filename = xstrdup(krb5_cc_get_name(krb_context, ccache));
180 client->store.envvar = "KRB5CCNAME";
181 client->store.envval = xstrdup(client->store.filename);
182
183#ifdef USE_PAM
184 if (options.use_pam)
185 do_pam_putenv(client->store.envvar,client->store.envval);
186#endif
187
188 krb5_cc_close(krb_context, ccache);
189
190 return;
191}
192
193ssh_gssapi_mech gssapi_kerberos_mech = {
194 "toWM5Slw5Ew8Mqkay+al2g==",
195 "Kerberos",
196 {9, "\x2A\x86\x48\x86\xF7\x12\x01\x02\x02"},
197 NULL,
198 &ssh_gssapi_krb5_userok,
199 NULL,
200 &ssh_gssapi_krb5_storecreds
201};
202
203#endif /* KRB5 */
204
205#endif /* GSSAPI */
diff --git a/gss-serv.c b/gss-serv.c
new file mode 100644
index 000000000..8fd1d63f0
--- /dev/null
+++ b/gss-serv.c
@@ -0,0 +1,292 @@
1/* $OpenBSD: gss-serv.c,v 1.3 2003/08/31 13:31:57 markus Exp $ */
2
3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */
26
27#include "includes.h"
28
29#ifdef GSSAPI
30
31#include "bufaux.h"
32#include "compat.h"
33#include "auth.h"
34#include "log.h"
35#include "channels.h"
36#include "session.h"
37#include "servconf.h"
38#include "monitor_wrap.h"
39#include "xmalloc.h"
40#include "getput.h"
41
42#include "ssh-gss.h"
43
44extern ServerOptions options;
45
46static ssh_gssapi_client gssapi_client =
47 { GSS_C_EMPTY_BUFFER, GSS_C_EMPTY_BUFFER,
48 GSS_C_NO_CREDENTIAL, NULL, {NULL, NULL, NULL}};
49
50ssh_gssapi_mech gssapi_null_mech =
51 { NULL, NULL, {0, NULL}, NULL, NULL, NULL, NULL};
52
53#ifdef KRB5
54extern ssh_gssapi_mech gssapi_kerberos_mech;
55#endif
56
57ssh_gssapi_mech* supported_mechs[]= {
58#ifdef KRB5
59 &gssapi_kerberos_mech,
60#endif
61 &gssapi_null_mech,
62};
63
64/* Unpriviledged */
65void
66ssh_gssapi_supported_oids(gss_OID_set *oidset)
67{
68 int i = 0;
69 OM_uint32 min_status;
70 int present;
71 gss_OID_set supported;
72
73 gss_create_empty_oid_set(&min_status, oidset);
74 gss_indicate_mechs(&min_status, &supported);
75
76 while (supported_mechs[i]->name != NULL) {
77 if (GSS_ERROR(gss_test_oid_set_member(&min_status,
78 &supported_mechs[i]->oid, supported, &present)))
79 present = 0;
80 if (present)
81 gss_add_oid_set_member(&min_status,
82 &supported_mechs[i]->oid, oidset);
83 i++;
84 }
85}
86
87
88/* Wrapper around accept_sec_context
89 * Requires that the context contains:
90 * oid
91 * credentials (from ssh_gssapi_acquire_cred)
92 */
93/* Priviledged */
94OM_uint32
95ssh_gssapi_accept_ctx(Gssctxt *ctx, gss_buffer_desc *recv_tok,
96 gss_buffer_desc *send_tok, OM_uint32 *flags)
97{
98 OM_uint32 status;
99 gss_OID mech;
100
101 ctx->major = gss_accept_sec_context(&ctx->minor,
102 &ctx->context, ctx->creds, recv_tok,
103 GSS_C_NO_CHANNEL_BINDINGS, &ctx->client, &mech,
104 send_tok, flags, NULL, &ctx->client_creds);
105
106 if (GSS_ERROR(ctx->major))
107 ssh_gssapi_error(ctx);
108
109 if (ctx->client_creds)
110 debug("Received some client credentials");
111 else
112 debug("Got no client credentials");
113
114 status = ctx->major;
115
116 /* Now, if we're complete and we have the right flags, then
117 * we flag the user as also having been authenticated
118 */
119
120 if (((flags == NULL) || ((*flags & GSS_C_MUTUAL_FLAG) &&
121 (*flags & GSS_C_INTEG_FLAG))) && (ctx->major == GSS_S_COMPLETE)) {
122 if (ssh_gssapi_getclient(ctx, &gssapi_client))
123 fatal("Couldn't convert client name");
124 }
125
126 return (status);
127}
128
129/*
130 * This parses an exported name, extracting the mechanism specific portion
131 * to use for ACL checking. It verifies that the name belongs the mechanism
132 * originally selected.
133 */
134static OM_uint32
135ssh_gssapi_parse_ename(Gssctxt *ctx, gss_buffer_t ename, gss_buffer_t name)
136{
137 char *tok;
138 OM_uint32 offset;
139 OM_uint32 oidl;
140
141 tok=ename->value;
142
143 /*
144 * Check that ename is long enough for all of the fixed length
145 * header, and that the initial ID bytes are correct
146 */
147
148 if (ename->length<6 || memcmp(tok,"\x04\x01", 2)!=0)
149 return GSS_S_FAILURE;
150
151 /*
152 * Extract the OID, and check it. Here GSSAPI breaks with tradition
153 * and does use the OID type and length bytes. To confuse things
154 * there are two lengths - the first including these, and the
155 * second without.
156 */
157
158 oidl = GET_16BIT(tok+2); /* length including next two bytes */
159 oidl = oidl-2; /* turn it into the _real_ length of the variable OID */
160
161 /*
162 * Check the BER encoding for correct type and length, that the
163 * string is long enough and that the OID matches that in our context
164 */
165 if (tok[4] != 0x06 || tok[5] != oidl ||
166 ename->length < oidl+6 ||
167 !ssh_gssapi_check_oid(ctx,tok+6,oidl))
168 return GSS_S_FAILURE;
169
170 offset = oidl+6;
171
172 if (ename->length < offset+4)
173 return GSS_S_FAILURE;
174
175 name->length = GET_32BIT(tok+offset);
176 offset += 4;
177
178 if (ename->length < offset+name->length)
179 return GSS_S_FAILURE;
180
181 name->value = xmalloc(name->length+1);
182 memcpy(name->value,tok+offset,name->length);
183 ((char *)name->value)[name->length] = 0;
184
185 return GSS_S_COMPLETE;
186}
187
188/* Extract the client details from a given context. This can only reliably
189 * be called once for a context */
190
191/* Priviledged (called from accept_secure_ctx) */
192OM_uint32
193ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *client)
194{
195 int i = 0;
196
197 gss_buffer_desc ename;
198
199 client->mech = NULL;
200
201 while (supported_mechs[i]->name != NULL) {
202 if (supported_mechs[i]->oid.length == ctx->oid->length &&
203 (memcmp(supported_mechs[i]->oid.elements,
204 ctx->oid->elements, ctx->oid->length) == 0))
205 client->mech = supported_mechs[i];
206 i++;
207 }
208
209 if (client->mech == NULL)
210 return GSS_S_FAILURE;
211
212 if ((ctx->major = gss_display_name(&ctx->minor, ctx->client,
213 &client->displayname, NULL))) {
214 ssh_gssapi_error(ctx);
215 return (ctx->major);
216 }
217
218 if ((ctx->major = gss_export_name(&ctx->minor, ctx->client,
219 &ename))) {
220 ssh_gssapi_error(ctx);
221 return (ctx->major);
222 }
223
224 if ((ctx->major = ssh_gssapi_parse_ename(ctx,&ename,
225 &client->exportedname))) {
226 return (ctx->major);
227 }
228
229 /* We can't copy this structure, so we just move the pointer to it */
230 client->creds = ctx->client_creds;
231 ctx->client_creds = GSS_C_NO_CREDENTIAL;
232 return (ctx->major);
233}
234
235/* As user - called through fatal cleanup hook */
236void
237ssh_gssapi_cleanup_creds(void *ignored)
238{
239 if (gssapi_client.store.filename != NULL) {
240 /* Unlink probably isn't sufficient */
241 debug("removing gssapi cred file\"%s\"", gssapi_client.store.filename);
242 unlink(gssapi_client.store.filename);
243 }
244}
245
246/* As user */
247void
248ssh_gssapi_storecreds(void)
249{
250 if (gssapi_client.mech && gssapi_client.mech->storecreds) {
251 (*gssapi_client.mech->storecreds)(&gssapi_client);
252 if (options.gss_cleanup_creds)
253 fatal_add_cleanup(ssh_gssapi_cleanup_creds, NULL);
254 } else
255 debug("ssh_gssapi_storecreds: Not a GSSAPI mechanism");
256}
257
258/* This allows GSSAPI methods to do things to the childs environment based
259 * on the passed authentication process and credentials.
260 */
261/* As user */
262void
263ssh_gssapi_do_child(char ***envp, u_int *envsizep)
264{
265
266 if (gssapi_client.store.envvar != NULL &&
267 gssapi_client.store.envval != NULL) {
268
269 debug("Setting %s to %s", gssapi_client.store.envvar,
270 gssapi_client.store.envval);
271 child_set_env(envp, envsizep, gssapi_client.store.envvar,
272 gssapi_client.store.envval);
273 }
274}
275
276/* Priviledged */
277int
278ssh_gssapi_userok(char *user)
279{
280 if (gssapi_client.exportedname.length == 0 ||
281 gssapi_client.exportedname.value == NULL) {
282 debug("No suitable client data");
283 return 0;
284 }
285 if (gssapi_client.mech && gssapi_client.mech->userok)
286 return ((*gssapi_client.mech->userok)(&gssapi_client, user));
287 else
288 debug("ssh_gssapi_userok: Unknown GSSAPI mechanism");
289 return (0);
290}
291
292#endif
diff --git a/hostfile.c b/hostfile.c
index dcee03448..42a8aa71d 100644
--- a/hostfile.c
+++ b/hostfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: hostfile.c,v 1.30 2002/07/24 16:11:18 markus Exp $"); 39RCSID("$OpenBSD: hostfile.c,v 1.31 2003/04/08 20:21:28 itojun Exp $");
40 40
41#include "packet.h" 41#include "packet.h"
42#include "match.h" 42#include "match.h"
@@ -77,10 +77,10 @@ hostfile_check_key(int bits, Key *key, const char *host, const char *filename, i
77 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL) 77 if (key == NULL || key->type != KEY_RSA1 || key->rsa == NULL)
78 return 1; 78 return 1;
79 if (bits != BN_num_bits(key->rsa->n)) { 79 if (bits != BN_num_bits(key->rsa->n)) {
80 log("Warning: %s, line %d: keysize mismatch for host %s: " 80 logit("Warning: %s, line %d: keysize mismatch for host %s: "
81 "actual %d vs. announced %d.", 81 "actual %d vs. announced %d.",
82 filename, linenum, host, BN_num_bits(key->rsa->n), bits); 82 filename, linenum, host, BN_num_bits(key->rsa->n), bits);
83 log("Warning: replace %d with %d in %s, line %d.", 83 logit("Warning: replace %d with %d in %s, line %d.",
84 bits, BN_num_bits(key->rsa->n), filename, linenum); 84 bits, BN_num_bits(key->rsa->n), filename, linenum);
85 } 85 }
86 return 1; 86 return 1;
diff --git a/includes.h b/includes.h
index 37d402ef4..033cd91fa 100644
--- a/includes.h
+++ b/includes.h
@@ -50,9 +50,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
50#ifdef HAVE_NETGROUP_H 50#ifdef HAVE_NETGROUP_H
51# include <netgroup.h> 51# include <netgroup.h>
52#endif 52#endif
53#if defined(HAVE_NETDB_H)
54# include <netdb.h>
55#endif
56#ifdef HAVE_ENDIAN_H 53#ifdef HAVE_ENDIAN_H
57# include <endian.h> 54# include <endian.h>
58#endif 55#endif
@@ -68,6 +65,7 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
68#ifdef HAVE_NEXT 65#ifdef HAVE_NEXT
69# include <libc.h> 66# include <libc.h>
70#endif 67#endif
68#define __USE_GNU /* before unistd.h, activate extra prototypes for glibc */
71#include <unistd.h> /* For STDIN_FILENO, etc */ 69#include <unistd.h> /* For STDIN_FILENO, etc */
72#include <termios.h> /* Struct winsize */ 70#include <termios.h> /* Struct winsize */
73 71
@@ -133,12 +131,18 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
133#ifdef HAVE_SYS_MMAN_H 131#ifdef HAVE_SYS_MMAN_H
134#include <sys/mman.h> /* for MAP_ANONYMOUS */ 132#include <sys/mman.h> /* for MAP_ANONYMOUS */
135#endif 133#endif
134#ifdef HAVE_SYS_STRTIO_H
135#include <sys/strtio.h> /* for TIOCCBRK on HP-UX */
136#endif
136 137
137#include <netinet/in_systm.h> /* For typedefs */ 138#include <netinet/in_systm.h> /* For typedefs */
138#include <netinet/in.h> /* For IPv6 macros */ 139#include <netinet/in.h> /* For IPv6 macros */
139#include <netinet/ip.h> /* For IPTOS macros */ 140#include <netinet/ip.h> /* For IPTOS macros */
140#include <netinet/tcp.h> 141#include <netinet/tcp.h>
141#include <arpa/inet.h> 142#include <arpa/inet.h>
143#if defined(HAVE_NETDB_H)
144# include <netdb.h>
145#endif
142#ifdef HAVE_RPC_TYPES_H 146#ifdef HAVE_RPC_TYPES_H
143# include <rpc/types.h> /* For INADDR_LOOPBACK */ 147# include <rpc/types.h> /* For INADDR_LOOPBACK */
144#endif 148#endif
@@ -167,7 +171,6 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
167 171
168#include "version.h" 172#include "version.h"
169#include "openbsd-compat/openbsd-compat.h" 173#include "openbsd-compat/openbsd-compat.h"
170#include "openbsd-compat/bsd-cygwin_util.h"
171#include "openbsd-compat/bsd-nextstep.h" 174#include "openbsd-compat/bsd-nextstep.h"
172 175
173#include "entropy.h" 176#include "entropy.h"
diff --git a/key.c b/key.c
index 060b63745..54318cbbf 100644
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34#include "includes.h" 34#include "includes.h"
35RCSID("$OpenBSD: key.c,v 1.51 2003/02/12 09:33:04 markus Exp $"); 35RCSID("$OpenBSD: key.c,v 1.54 2003/07/09 13:58:19 avsm Exp $");
36 36
37#include <openssl/evp.h> 37#include <openssl/evp.h>
38 38
@@ -169,7 +169,7 @@ key_equal(Key *a, Key *b)
169 return 0; 169 return 0;
170} 170}
171 171
172static u_char * 172u_char*
173key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length) 173key_fingerprint_raw(Key *k, enum fp_type dgst_type, u_int *dgst_raw_length)
174{ 174{
175 const EVP_MD *md = NULL; 175 const EVP_MD *md = NULL;
@@ -236,8 +236,10 @@ key_fingerprint_hex(u_char *dgst_raw, u_int dgst_raw_len)
236 for (i = 0; i < dgst_raw_len; i++) { 236 for (i = 0; i < dgst_raw_len; i++) {
237 char hex[4]; 237 char hex[4];
238 snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]); 238 snprintf(hex, sizeof(hex), "%02x:", dgst_raw[i]);
239 strlcat(retval, hex, dgst_raw_len * 3); 239 strlcat(retval, hex, dgst_raw_len * 3 + 1);
240 } 240 }
241
242 /* Remove the trailing ':' character */
241 retval[(dgst_raw_len * 3) - 1] = '\0'; 243 retval[(dgst_raw_len * 3) - 1] = '\0';
242 return retval; 244 return retval;
243} 245}
@@ -438,7 +440,7 @@ key_read(Key *ret, char **cpp)
438 xfree(blob); 440 xfree(blob);
439 return -1; 441 return -1;
440 } 442 }
441 k = key_from_blob(blob, n); 443 k = key_from_blob(blob, (u_int)n);
442 xfree(blob); 444 xfree(blob);
443 if (k == NULL) { 445 if (k == NULL) {
444 error("key_read: key_from_blob %s failed", cp); 446 error("key_read: key_from_blob %s failed", cp);
@@ -674,7 +676,7 @@ key_names_valid2(const char *names)
674} 676}
675 677
676Key * 678Key *
677key_from_blob(u_char *blob, int blen) 679key_from_blob(u_char *blob, u_int blen)
678{ 680{
679 Buffer b; 681 Buffer b;
680 char *ktype; 682 char *ktype;
diff --git a/key.h b/key.h
index 725c7a04a..28753fdfa 100644
--- a/key.h
+++ b/key.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: key.h,v 1.20 2003/02/12 09:33:04 markus Exp $ */ 1/* $OpenBSD: key.h,v 1.22 2003/06/24 08:23:46 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -61,6 +61,7 @@ void key_free(Key *);
61Key *key_demote(Key *); 61Key *key_demote(Key *);
62int key_equal(Key *, Key *); 62int key_equal(Key *, Key *);
63char *key_fingerprint(Key *, enum fp_type, enum fp_rep); 63char *key_fingerprint(Key *, enum fp_type, enum fp_rep);
64u_char *key_fingerprint_raw(Key *, enum fp_type, u_int *);
64char *key_type(Key *); 65char *key_type(Key *);
65int key_write(Key *, FILE *); 66int key_write(Key *, FILE *);
66int key_read(Key *, char **); 67int key_read(Key *, char **);
@@ -70,7 +71,7 @@ Key *key_generate(int, u_int);
70Key *key_from_private(Key *); 71Key *key_from_private(Key *);
71int key_type_from_name(char *); 72int key_type_from_name(char *);
72 73
73Key *key_from_blob(u_char *, int); 74Key *key_from_blob(u_char *, u_int);
74int key_to_blob(Key *, u_char **, u_int *); 75int key_to_blob(Key *, u_char **, u_int *);
75char *key_ssh_name(Key *); 76char *key_ssh_name(Key *);
76int key_names_valid2(const char *); 77int key_names_valid2(const char *);
diff --git a/log.c b/log.c
index 84e4ce0ac..58ce8e5dd 100644
--- a/log.c
+++ b/log.c
@@ -34,7 +34,7 @@
34 */ 34 */
35 35
36#include "includes.h" 36#include "includes.h"
37RCSID("$OpenBSD: log.c,v 1.25 2003/01/11 18:29:43 markus Exp $"); 37RCSID("$OpenBSD: log.c,v 1.28 2003/05/24 09:02:22 djm Exp $");
38 38
39#include "log.h" 39#include "log.h"
40#include "xmalloc.h" 40#include "xmalloc.h"
@@ -127,7 +127,7 @@ error(const char *fmt,...)
127/* Log this message (information that usually should go to the log). */ 127/* Log this message (information that usually should go to the log). */
128 128
129void 129void
130log(const char *fmt,...) 130logit(const char *fmt,...)
131{ 131{
132 va_list args; 132 va_list args;
133 133
@@ -339,6 +339,9 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
339void 339void
340do_log(LogLevel level, const char *fmt, va_list args) 340do_log(LogLevel level, const char *fmt, va_list args)
341{ 341{
342#ifdef OPENLOG_R
343 struct syslog_data sdata = SYSLOG_DATA_INIT;
344#endif
342 char msgbuf[MSGBUFSIZ]; 345 char msgbuf[MSGBUFSIZ];
343 char fmtbuf[MSGBUFSIZ]; 346 char fmtbuf[MSGBUFSIZ];
344 char *txt = NULL; 347 char *txt = NULL;
@@ -387,14 +390,19 @@ do_log(LogLevel level, const char *fmt, va_list args)
387 } else { 390 } else {
388 vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); 391 vsnprintf(msgbuf, sizeof(msgbuf), fmt, args);
389 } 392 }
390 /* Escape magic chars in output. */ 393 strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_SAFE|VIS_OCTAL);
391 strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_OCTAL);
392
393 if (log_on_stderr) { 394 if (log_on_stderr) {
394 fprintf(stderr, "%s\r\n", fmtbuf); 395 snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf);
396 write(STDERR_FILENO, msgbuf, strlen(msgbuf));
395 } else { 397 } else {
398#ifdef OPENLOG_R
399 openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
400 syslog_r(pri, &sdata, "%.500s", fmtbuf);
401 closelog_r(&sdata);
402#else
396 openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); 403 openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
397 syslog(pri, "%.500s", fmtbuf); 404 syslog(pri, "%.500s", fmtbuf);
398 closelog(); 405 closelog();
406#endif
399 } 407 }
400} 408}
diff --git a/log.h b/log.h
index 917fafa69..c3666818f 100644
--- a/log.h
+++ b/log.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: log.h,v 1.8 2002/07/19 15:43:33 markus Exp $ */ 1/* $OpenBSD: log.h,v 1.9 2003/04/08 20:21:28 itojun Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -55,7 +55,7 @@ LogLevel log_level_number(char *);
55 55
56void fatal(const char *, ...) __attribute__((format(printf, 1, 2))); 56void fatal(const char *, ...) __attribute__((format(printf, 1, 2)));
57void error(const char *, ...) __attribute__((format(printf, 1, 2))); 57void error(const char *, ...) __attribute__((format(printf, 1, 2)));
58void log(const char *, ...) __attribute__((format(printf, 1, 2))); 58void logit(const char *, ...) __attribute__((format(printf, 1, 2)));
59void verbose(const char *, ...) __attribute__((format(printf, 1, 2))); 59void verbose(const char *, ...) __attribute__((format(printf, 1, 2)));
60void debug(const char *, ...) __attribute__((format(printf, 1, 2))); 60void debug(const char *, ...) __attribute__((format(printf, 1, 2)));
61void debug2(const char *, ...) __attribute__((format(printf, 1, 2))); 61void debug2(const char *, ...) __attribute__((format(printf, 1, 2)));
diff --git a/loginrec.c b/loginrec.c
index 6697ca7b0..bdac3e959 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -12,11 +12,6 @@
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Markus Friedl.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 * 15 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -163,7 +158,7 @@
163#include "log.h" 158#include "log.h"
164#include "atomicio.h" 159#include "atomicio.h"
165 160
166RCSID("$Id: loginrec.c,v 1.47 2003/03/10 00:23:07 djm Exp $"); 161RCSID("$Id: loginrec.c,v 1.52 2003/07/06 05:20:46 dtucker Exp $");
167 162
168#ifdef HAVE_UTIL_H 163#ifdef HAVE_UTIL_H
169# include <util.h> 164# include <util.h>
@@ -413,7 +408,7 @@ login_write (struct logininfo *li)
413{ 408{
414#ifndef HAVE_CYGWIN 409#ifndef HAVE_CYGWIN
415 if ((int)geteuid() != 0) { 410 if ((int)geteuid() != 0) {
416 log("Attempt to write login records by non-root user (aborting)"); 411 logit("Attempt to write login records by non-root user (aborting)");
417 return 1; 412 return 1;
418 } 413 }
419#endif 414#endif
@@ -818,7 +813,7 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
818 endttyent(); 813 endttyent();
819 814
820 if((struct ttyent *)0 == ty) { 815 if((struct ttyent *)0 == ty) {
821 log("utmp_write_entry: tty not found"); 816 logit("utmp_write_entry: tty not found");
822 return(1); 817 return(1);
823 } 818 }
824#else /* FIXME */ 819#else /* FIXME */
@@ -842,8 +837,8 @@ utmp_write_direct(struct logininfo *li, struct utmp *ut)
842 } 837 }
843 838
844 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); 839 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
845 if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) 840 if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut))
846 log("utmp_write_direct: error writing %s: %s", 841 logit("utmp_write_direct: error writing %s: %s",
847 UTMP_FILE, strerror(errno)); 842 UTMP_FILE, strerror(errno));
848 843
849 (void)close(fd); 844 (void)close(fd);
@@ -862,12 +857,12 @@ utmp_perform_login(struct logininfo *li)
862 construct_utmp(li, &ut); 857 construct_utmp(li, &ut);
863# ifdef UTMP_USE_LIBRARY 858# ifdef UTMP_USE_LIBRARY
864 if (!utmp_write_library(li, &ut)) { 859 if (!utmp_write_library(li, &ut)) {
865 log("utmp_perform_login: utmp_write_library() failed"); 860 logit("utmp_perform_login: utmp_write_library() failed");
866 return 0; 861 return 0;
867 } 862 }
868# else 863# else
869 if (!utmp_write_direct(li, &ut)) { 864 if (!utmp_write_direct(li, &ut)) {
870 log("utmp_perform_login: utmp_write_direct() failed"); 865 logit("utmp_perform_login: utmp_write_direct() failed");
871 return 0; 866 return 0;
872 } 867 }
873# endif 868# endif
@@ -883,12 +878,12 @@ utmp_perform_logout(struct logininfo *li)
883 construct_utmp(li, &ut); 878 construct_utmp(li, &ut);
884# ifdef UTMP_USE_LIBRARY 879# ifdef UTMP_USE_LIBRARY
885 if (!utmp_write_library(li, &ut)) { 880 if (!utmp_write_library(li, &ut)) {
886 log("utmp_perform_logout: utmp_write_library() failed"); 881 logit("utmp_perform_logout: utmp_write_library() failed");
887 return 0; 882 return 0;
888 } 883 }
889# else 884# else
890 if (!utmp_write_direct(li, &ut)) { 885 if (!utmp_write_direct(li, &ut)) {
891 log("utmp_perform_logout: utmp_write_direct() failed"); 886 logit("utmp_perform_logout: utmp_write_direct() failed");
892 return 0; 887 return 0;
893 } 888 }
894# endif 889# endif
@@ -907,7 +902,7 @@ utmp_write_entry(struct logininfo *li)
907 return utmp_perform_logout(li); 902 return utmp_perform_logout(li);
908 903
909 default: 904 default:
910 log("utmp_write_entry: invalid type field"); 905 logit("utmp_write_entry: invalid type field");
911 return 0; 906 return 0;
912 } 907 }
913} 908}
@@ -948,7 +943,7 @@ utmpx_write_library(struct logininfo *li, struct utmpx *utx)
948static int 943static int
949utmpx_write_direct(struct logininfo *li, struct utmpx *utx) 944utmpx_write_direct(struct logininfo *li, struct utmpx *utx)
950{ 945{
951 log("utmpx_write_direct: not implemented!"); 946 logit("utmpx_write_direct: not implemented!");
952 return 0; 947 return 0;
953} 948}
954# endif /* UTMPX_USE_LIBRARY */ 949# endif /* UTMPX_USE_LIBRARY */
@@ -961,12 +956,12 @@ utmpx_perform_login(struct logininfo *li)
961 construct_utmpx(li, &utx); 956 construct_utmpx(li, &utx);
962# ifdef UTMPX_USE_LIBRARY 957# ifdef UTMPX_USE_LIBRARY
963 if (!utmpx_write_library(li, &utx)) { 958 if (!utmpx_write_library(li, &utx)) {
964 log("utmpx_perform_login: utmp_write_library() failed"); 959 logit("utmpx_perform_login: utmp_write_library() failed");
965 return 0; 960 return 0;
966 } 961 }
967# else 962# else
968 if (!utmpx_write_direct(li, &ut)) { 963 if (!utmpx_write_direct(li, &ut)) {
969 log("utmpx_perform_login: utmp_write_direct() failed"); 964 logit("utmpx_perform_login: utmp_write_direct() failed");
970 return 0; 965 return 0;
971 } 966 }
972# endif 967# endif
@@ -1004,7 +999,7 @@ utmpx_write_entry(struct logininfo *li)
1004 case LTYPE_LOGOUT: 999 case LTYPE_LOGOUT:
1005 return utmpx_perform_logout(li); 1000 return utmpx_perform_logout(li);
1006 default: 1001 default:
1007 log("utmpx_write_entry: invalid type field"); 1002 logit("utmpx_write_entry: invalid type field");
1008 return 0; 1003 return 0;
1009 } 1004 }
1010} 1005}
@@ -1026,14 +1021,14 @@ wtmp_write(struct logininfo *li, struct utmp *ut)
1026 int fd, ret = 1; 1021 int fd, ret = 1;
1027 1022
1028 if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) < 0) { 1023 if ((fd = open(WTMP_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
1029 log("wtmp_write: problem writing %s: %s", 1024 logit("wtmp_write: problem writing %s: %s",
1030 WTMP_FILE, strerror(errno)); 1025 WTMP_FILE, strerror(errno));
1031 return 0; 1026 return 0;
1032 } 1027 }
1033 if (fstat(fd, &buf) == 0) 1028 if (fstat(fd, &buf) == 0)
1034 if (atomicio(write, fd, ut, sizeof(*ut)) != sizeof(*ut)) { 1029 if (atomicio(vwrite, fd, ut, sizeof(*ut)) != sizeof(*ut)) {
1035 ftruncate(fd, buf.st_size); 1030 ftruncate(fd, buf.st_size);
1036 log("wtmp_write: problem writing %s: %s", 1031 logit("wtmp_write: problem writing %s: %s",
1037 WTMP_FILE, strerror(errno)); 1032 WTMP_FILE, strerror(errno));
1038 ret = 0; 1033 ret = 0;
1039 } 1034 }
@@ -1070,7 +1065,7 @@ wtmp_write_entry(struct logininfo *li)
1070 case LTYPE_LOGOUT: 1065 case LTYPE_LOGOUT:
1071 return wtmp_perform_logout(li); 1066 return wtmp_perform_logout(li);
1072 default: 1067 default:
1073 log("wtmp_write_entry: invalid type field"); 1068 logit("wtmp_write_entry: invalid type field");
1074 return 0; 1069 return 0;
1075 } 1070 }
1076} 1071}
@@ -1119,12 +1114,12 @@ wtmp_get_entry(struct logininfo *li)
1119 li->tv_sec = li->tv_usec = 0; 1114 li->tv_sec = li->tv_usec = 0;
1120 1115
1121 if ((fd = open(WTMP_FILE, O_RDONLY)) < 0) { 1116 if ((fd = open(WTMP_FILE, O_RDONLY)) < 0) {
1122 log("wtmp_get_entry: problem opening %s: %s", 1117 logit("wtmp_get_entry: problem opening %s: %s",
1123 WTMP_FILE, strerror(errno)); 1118 WTMP_FILE, strerror(errno));
1124 return 0; 1119 return 0;
1125 } 1120 }
1126 if (fstat(fd, &st) != 0) { 1121 if (fstat(fd, &st) != 0) {
1127 log("wtmp_get_entry: couldn't stat %s: %s", 1122 logit("wtmp_get_entry: couldn't stat %s: %s",
1128 WTMP_FILE, strerror(errno)); 1123 WTMP_FILE, strerror(errno));
1129 close(fd); 1124 close(fd);
1130 return 0; 1125 return 0;
@@ -1139,7 +1134,7 @@ wtmp_get_entry(struct logininfo *li)
1139 1134
1140 while (!found) { 1135 while (!found) {
1141 if (atomicio(read, fd, &ut, sizeof(ut)) != sizeof(ut)) { 1136 if (atomicio(read, fd, &ut, sizeof(ut)) != sizeof(ut)) {
1142 log("wtmp_get_entry: read of %s failed: %s", 1137 logit("wtmp_get_entry: read of %s failed: %s",
1143 WTMP_FILE, strerror(errno)); 1138 WTMP_FILE, strerror(errno));
1144 close (fd); 1139 close (fd);
1145 return 0; 1140 return 0;
@@ -1192,15 +1187,15 @@ wtmpx_write(struct logininfo *li, struct utmpx *utx)
1192 int fd, ret = 1; 1187 int fd, ret = 1;
1193 1188
1194 if ((fd = open(WTMPX_FILE, O_WRONLY|O_APPEND, 0)) < 0) { 1189 if ((fd = open(WTMPX_FILE, O_WRONLY|O_APPEND, 0)) < 0) {
1195 log("wtmpx_write: problem opening %s: %s", 1190 logit("wtmpx_write: problem opening %s: %s",
1196 WTMPX_FILE, strerror(errno)); 1191 WTMPX_FILE, strerror(errno));
1197 return 0; 1192 return 0;
1198 } 1193 }
1199 1194
1200 if (fstat(fd, &buf) == 0) 1195 if (fstat(fd, &buf) == 0)
1201 if (atomicio(write, fd, utx, sizeof(*utx)) != sizeof(*utx)) { 1196 if (atomicio(vwrite, fd, utx, sizeof(*utx)) != sizeof(*utx)) {
1202 ftruncate(fd, buf.st_size); 1197 ftruncate(fd, buf.st_size);
1203 log("wtmpx_write: problem writing %s: %s", 1198 logit("wtmpx_write: problem writing %s: %s",
1204 WTMPX_FILE, strerror(errno)); 1199 WTMPX_FILE, strerror(errno));
1205 ret = 0; 1200 ret = 0;
1206 } 1201 }
@@ -1239,7 +1234,7 @@ wtmpx_write_entry(struct logininfo *li)
1239 case LTYPE_LOGOUT: 1234 case LTYPE_LOGOUT:
1240 return wtmpx_perform_logout(li); 1235 return wtmpx_perform_logout(li);
1241 default: 1236 default:
1242 log("wtmpx_write_entry: invalid type field"); 1237 logit("wtmpx_write_entry: invalid type field");
1243 return 0; 1238 return 0;
1244 } 1239 }
1245} 1240}
@@ -1275,12 +1270,12 @@ wtmpx_get_entry(struct logininfo *li)
1275 li->tv_sec = li->tv_usec = 0; 1270 li->tv_sec = li->tv_usec = 0;
1276 1271
1277 if ((fd = open(WTMPX_FILE, O_RDONLY)) < 0) { 1272 if ((fd = open(WTMPX_FILE, O_RDONLY)) < 0) {
1278 log("wtmpx_get_entry: problem opening %s: %s", 1273 logit("wtmpx_get_entry: problem opening %s: %s",
1279 WTMPX_FILE, strerror(errno)); 1274 WTMPX_FILE, strerror(errno));
1280 return 0; 1275 return 0;
1281 } 1276 }
1282 if (fstat(fd, &st) != 0) { 1277 if (fstat(fd, &st) != 0) {
1283 log("wtmpx_get_entry: couldn't stat %s: %s", 1278 logit("wtmpx_get_entry: couldn't stat %s: %s",
1284 WTMPX_FILE, strerror(errno)); 1279 WTMPX_FILE, strerror(errno));
1285 close(fd); 1280 close(fd);
1286 return 0; 1281 return 0;
@@ -1295,7 +1290,7 @@ wtmpx_get_entry(struct logininfo *li)
1295 1290
1296 while (!found) { 1291 while (!found) {
1297 if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) { 1292 if (atomicio(read, fd, &utx, sizeof(utx)) != sizeof(utx)) {
1298 log("wtmpx_get_entry: read of %s failed: %s", 1293 logit("wtmpx_get_entry: read of %s failed: %s",
1299 WTMPX_FILE, strerror(errno)); 1294 WTMPX_FILE, strerror(errno));
1300 close (fd); 1295 close (fd);
1301 return 0; 1296 return 0;
@@ -1340,7 +1335,7 @@ syslogin_perform_login(struct logininfo *li)
1340 struct utmp *ut; 1335 struct utmp *ut;
1341 1336
1342 if (! (ut = (struct utmp *)malloc(sizeof(*ut)))) { 1337 if (! (ut = (struct utmp *)malloc(sizeof(*ut)))) {
1343 log("syslogin_perform_login: couldn't malloc()"); 1338 logit("syslogin_perform_login: couldn't malloc()");
1344 return 0; 1339 return 0;
1345 } 1340 }
1346 construct_utmp(li, ut); 1341 construct_utmp(li, ut);
@@ -1359,7 +1354,7 @@ syslogin_perform_logout(struct logininfo *li)
1359 (void)line_stripname(line, li->line, sizeof(line)); 1354 (void)line_stripname(line, li->line, sizeof(line));
1360 1355
1361 if (!logout(line)) { 1356 if (!logout(line)) {
1362 log("syslogin_perform_logout: logout() returned an error"); 1357 logit("syslogin_perform_logout: logout() returned an error");
1363# ifdef HAVE_LOGWTMP 1358# ifdef HAVE_LOGWTMP
1364 } else { 1359 } else {
1365 logwtmp(line, "", ""); 1360 logwtmp(line, "", "");
@@ -1382,7 +1377,7 @@ syslogin_write_entry(struct logininfo *li)
1382 case LTYPE_LOGOUT: 1377 case LTYPE_LOGOUT:
1383 return syslogin_perform_logout(li); 1378 return syslogin_perform_logout(li);
1384 default: 1379 default:
1385 log("syslogin_write_entry: Invalid type field"); 1380 logit("syslogin_write_entry: Invalid type field");
1386 return 0; 1381 return 0;
1387 } 1382 }
1388} 1383}
@@ -1417,7 +1412,7 @@ lastlog_filetype(char *filename)
1417 struct stat st; 1412 struct stat st;
1418 1413
1419 if (stat(LASTLOG_FILE, &st) != 0) { 1414 if (stat(LASTLOG_FILE, &st) != 0) {
1420 log("lastlog_perform_login: Couldn't stat %s: %s", LASTLOG_FILE, 1415 logit("lastlog_perform_login: Couldn't stat %s: %s", LASTLOG_FILE,
1421 strerror(errno)); 1416 strerror(errno));
1422 return 0; 1417 return 0;
1423 } 1418 }
@@ -1448,12 +1443,12 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
1448 LASTLOG_FILE, li->username); 1443 LASTLOG_FILE, li->username);
1449 break; 1444 break;
1450 default: 1445 default:
1451 log("lastlog_openseek: %.100s is not a file or directory!", 1446 logit("lastlog_openseek: %.100s is not a file or directory!",
1452 LASTLOG_FILE); 1447 LASTLOG_FILE);
1453 return 0; 1448 return 0;
1454 } 1449 }
1455 1450
1456 *fd = open(lastlog_file, filemode); 1451 *fd = open(lastlog_file, filemode, 0600);
1457 if ( *fd < 0) { 1452 if ( *fd < 0) {
1458 debug("lastlog_openseek: Couldn't open %s: %s", 1453 debug("lastlog_openseek: Couldn't open %s: %s",
1459 lastlog_file, strerror(errno)); 1454 lastlog_file, strerror(errno));
@@ -1465,7 +1460,7 @@ lastlog_openseek(struct logininfo *li, int *fd, int filemode)
1465 offset = (off_t) ((long)li->uid * sizeof(struct lastlog)); 1460 offset = (off_t) ((long)li->uid * sizeof(struct lastlog));
1466 1461
1467 if ( lseek(*fd, offset, SEEK_SET) != offset ) { 1462 if ( lseek(*fd, offset, SEEK_SET) != offset ) {
1468 log("lastlog_openseek: %s->lseek(): %s", 1463 logit("lastlog_openseek: %s->lseek(): %s",
1469 lastlog_file, strerror(errno)); 1464 lastlog_file, strerror(errno));
1470 return 0; 1465 return 0;
1471 } 1466 }
@@ -1487,9 +1482,9 @@ lastlog_perform_login(struct logininfo *li)
1487 return(0); 1482 return(0);
1488 1483
1489 /* write the entry */ 1484 /* write the entry */
1490 if (atomicio(write, fd, &last, sizeof(last)) != sizeof(last)) { 1485 if (atomicio(vwrite, fd, &last, sizeof(last)) != sizeof(last)) {
1491 close(fd); 1486 close(fd);
1492 log("lastlog_write_filemode: Error writing to %s: %s", 1487 logit("lastlog_write_filemode: Error writing to %s: %s",
1493 LASTLOG_FILE, strerror(errno)); 1488 LASTLOG_FILE, strerror(errno));
1494 return 0; 1489 return 0;
1495 } 1490 }
@@ -1505,7 +1500,7 @@ lastlog_write_entry(struct logininfo *li)
1505 case LTYPE_LOGIN: 1500 case LTYPE_LOGIN:
1506 return lastlog_perform_login(li); 1501 return lastlog_perform_login(li);
1507 default: 1502 default:
1508 log("lastlog_write_entry: Invalid type field"); 1503 logit("lastlog_write_entry: Invalid type field");
1509 return 0; 1504 return 0;
1510 } 1505 }
1511} 1506}
diff --git a/loginrec.h b/loginrec.h
index 732e21e11..7f932c296 100644
--- a/loginrec.h
+++ b/loginrec.h
@@ -12,11 +12,6 @@
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by Markus Friedl.
18 * 4. The name of the author may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 * 15 *
21 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -40,7 +35,7 @@
40#include <netinet/in.h> 35#include <netinet/in.h>
41#include <sys/socket.h> 36#include <sys/socket.h>
42 37
43/* RCSID("$Id: loginrec.h,v 1.6 2001/05/08 20:33:06 mouring Exp $"); */ 38/* RCSID("$Id: loginrec.h,v 1.7 2003/06/03 02:18:50 djm Exp $"); */
44 39
45/** 40/**
46 ** you should use the login_* calls to work around platform dependencies 41 ** you should use the login_* calls to work around platform dependencies
diff --git a/logintest.c b/logintest.c
index da9ea50ec..3f3997d10 100644
--- a/logintest.c
+++ b/logintest.c
@@ -9,11 +9,6 @@
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 3. All advertising materials mentioning features or use of this software
13 * must display the following acknowledgement:
14 * This product includes software developed by Markus Friedl.
15 * 4. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 12 *
18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
@@ -48,7 +43,7 @@
48 43
49#include "loginrec.h" 44#include "loginrec.h"
50 45
51RCSID("$Id: logintest.c,v 1.8 2001/04/05 23:05:22 stevesk Exp $"); 46RCSID("$Id: logintest.c,v 1.10 2003/08/21 23:34:41 djm Exp $");
52 47
53#ifdef HAVE___PROGNAME 48#ifdef HAVE___PROGNAME
54extern char *__progname; 49extern char *__progname;
@@ -292,7 +287,7 @@ main(int argc, char *argv[])
292{ 287{
293 printf("Platform-independent login recording test driver\n"); 288 printf("Platform-independent login recording test driver\n");
294 289
295 __progname = get_progname(argv[0]); 290 __progname = ssh_get_progname(argv[0]);
296 if (argc == 2) { 291 if (argc == 2) {
297 if (strncmp(argv[1], "-i", 3) == 0) 292 if (strncmp(argv[1], "-i", 3) == 0)
298 compile_opts_only = 1; 293 compile_opts_only = 1;
diff --git a/md5crypt.c b/md5crypt.c
index ba98ccccc..e14d53ac1 100644
--- a/md5crypt.c
+++ b/md5crypt.c
@@ -1,159 +1,165 @@
1/* 1/*
2 * ---------------------------------------------------------------------------- 2 * ----------------------------------------------------------------------------
3 * "THE BEER-WARE LICENSE" (Revision 42): 3 * "THE BEER-WARE LICENSE" (Revision 42):
4 * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you 4 * <phk@login.dknet.dk> wrote this file. As long as you retain this
5 * can do whatever you want with this stuff. If we meet some day, and you think 5 * notice you can do whatever you want with this stuff. If we meet some
6 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp 6 * day, and you think this stuff is worth it, you can buy me a beer in
7 * return. Poul-Henning Kamp
7 * ---------------------------------------------------------------------------- 8 * ----------------------------------------------------------------------------
8 */ 9 */
9 10
10/*
11 * Ported from FreeBSD to Linux, only minimal changes. --marekm
12 */
13
14/*
15 * Adapted from shadow-19990607 by Tudor Bosman, tudorb@jm.nu
16 */
17
18#include "includes.h" 11#include "includes.h"
19 12
20RCSID("$Id: md5crypt.c,v 1.5 2001/02/09 01:55:36 djm Exp $");
21
22#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) 13#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
23
24#include <openssl/md5.h> 14#include <openssl/md5.h>
25 15
26static unsigned char itoa64[] = /* 0 ... 63 => ascii - 64 */ 16RCSID("$Id: md5crypt.c,v 1.7 2003/05/30 06:58:23 dtucker Exp $");
27 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 17
18/* 0 ... 63 => ascii - 64 */
19static unsigned char itoa64[] =
20 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
28 21
29static char *magic = "$1$"; /* 22static char *magic = "$1$";
30 * This string is magic for
31 * this algorithm. Having
32 * it this way, we can get
33 * get better later on
34 */
35 23
36static void 24static char *
37to64(char *s, unsigned long v, int n) 25to64(unsigned long v, int n)
38{ 26{
27 static char buf[5];
28 char *s = buf;
29
30 if (n > 4)
31 return (NULL);
32
33 memset(buf, '\0', sizeof(buf));
39 while (--n >= 0) { 34 while (--n >= 0) {
40 *s++ = itoa64[v&0x3f]; 35 *s++ = itoa64[v&0x3f];
41 v >>= 6; 36 v >>= 6;
42 } 37 }
38
39 return (buf);
43} 40}
44 41
45int 42int
46is_md5_salt(const char *salt) 43is_md5_salt(const char *salt)
47{ 44{
48 return (!strncmp(salt, magic, strlen(magic))); 45 return (strncmp(salt, magic, strlen(magic)) == 0);
49} 46}
50 47
51/*
52 * UNIX password
53 *
54 * Use MD5 for what it is best at...
55 */
56
57char * 48char *
58md5_crypt(const char *pw, const char *salt) 49md5_crypt(const char *pw, const char *salt)
59{ 50{
60 static char passwd[120], *p; 51 static char passwd[120], salt_copy[9], *p;
61 static const char *sp,*ep; 52 static const char *sp, *ep;
62 unsigned char final[16]; 53 unsigned char final[16];
63 int sl,pl,i,j; 54 int sl, pl, i, j;
64 MD5_CTX ctx,ctx1; 55 MD5_CTX ctx, ctx1;
65 unsigned long l; 56 unsigned long l;
66 57
67 /* Refine the Salt first */ 58 /* Refine the Salt first */
68 sp = salt; 59 sp = salt;
69 60
70 /* If it starts with the magic string, then skip that */ 61 /* If it starts with the magic string, then skip that */
71 if(!strncmp(sp,magic,strlen(magic))) 62 if(strncmp(sp, magic, strlen(magic)) == 0)
72 sp += strlen(magic); 63 sp += strlen(magic);
73 64
74 /* It stops at the first '$', max 8 chars */ 65 /* It stops at the first '$', max 8 chars */
75 for(ep=sp;*ep && *ep != '$' && ep < (sp+8);ep++) 66 for (ep = sp; *ep != '$'; ep++) {
76 continue; 67 if (*ep == '\0' || ep >= (sp + 8))
68 return (NULL);
69 }
77 70
78 /* get the length of the true salt */ 71 /* get the length of the true salt */
79 sl = ep - sp; 72 sl = ep - sp;
80 73
74 /* Stash the salt */
75 memcpy(salt_copy, sp, sl);
76 salt_copy[sl] = '\0';
77
81 MD5_Init(&ctx); 78 MD5_Init(&ctx);
82 79
83 /* The password first, since that is what is most unknown */ 80 /* The password first, since that is what is most unknown */
84 MD5_Update(&ctx,pw,strlen(pw)); 81 MD5_Update(&ctx, pw, strlen(pw));
85 82
86 /* Then our magic string */ 83 /* Then our magic string */
87 MD5_Update(&ctx,magic,strlen(magic)); 84 MD5_Update(&ctx, magic, strlen(magic));
88 85
89 /* Then the raw salt */ 86 /* Then the raw salt */
90 MD5_Update(&ctx,sp,sl); 87 MD5_Update(&ctx, sp, sl);
91 88
92 /* Then just as many characters of the MD5(pw,salt,pw) */ 89 /* Then just as many characters of the MD5(pw, salt, pw) */
93 MD5_Init(&ctx1); 90 MD5_Init(&ctx1);
94 MD5_Update(&ctx1,pw,strlen(pw)); 91 MD5_Update(&ctx1, pw, strlen(pw));
95 MD5_Update(&ctx1,sp,sl); 92 MD5_Update(&ctx1, sp, sl);
96 MD5_Update(&ctx1,pw,strlen(pw)); 93 MD5_Update(&ctx1, pw, strlen(pw));
97 MD5_Final(final,&ctx1); 94 MD5_Final(final, &ctx1);
95
98 for(pl = strlen(pw); pl > 0; pl -= 16) 96 for(pl = strlen(pw); pl > 0; pl -= 16)
99 MD5_Update(&ctx,final,pl>16 ? 16 : pl); 97 MD5_Update(&ctx, final, pl > 16 ? 16 : pl);
100 98
101 /* Don't leave anything around in vm they could use. */ 99 /* Don't leave anything around in vm they could use. */
102 memset(final,0,sizeof final); 100 memset(final, '\0', sizeof final);
103 101
104 /* Then something really weird... */ 102 /* Then something really weird... */
105 for (j=0,i = strlen(pw); i ; i >>= 1) 103 for (j = 0, i = strlen(pw); i != 0; i >>= 1)
106 if(i&1) 104 if (i & 1)
107 MD5_Update(&ctx, final+j, 1); 105 MD5_Update(&ctx, final + j, 1);
108 else 106 else
109 MD5_Update(&ctx, pw+j, 1); 107 MD5_Update(&ctx, pw + j, 1);
110 108
111 /* Now make the output string */ 109 /* Now make the output string */
112 strcpy(passwd,magic); 110 snprintf(passwd, sizeof(passwd), "%s%s$", magic, salt_copy);
113 strncat(passwd,sp,sl);
114 strcat(passwd,"$");
115 111
116 MD5_Final(final,&ctx); 112 MD5_Final(final, &ctx);
117 113
118 /* 114 /*
119 * and now, just to make sure things don't run too fast 115 * and now, just to make sure things don't run too fast
120 * On a 60 Mhz Pentium this takes 34 msec, so you would 116 * On a 60 Mhz Pentium this takes 34 msec, so you would
121 * need 30 seconds to build a 1000 entry dictionary... 117 * need 30 seconds to build a 1000 entry dictionary...
122 */ 118 */
123 for(i=0;i<1000;i++) { 119 for(i = 0; i < 1000; i++) {
124 MD5_Init(&ctx1); 120 MD5_Init(&ctx1);
125 if(i & 1) 121 if (i & 1)
126 MD5_Update(&ctx1,pw,strlen(pw)); 122 MD5_Update(&ctx1, pw, strlen(pw));
127 else 123 else
128 MD5_Update(&ctx1,final,16); 124 MD5_Update(&ctx1, final, 16);
129 125
130 if(i % 3) 126 if (i % 3)
131 MD5_Update(&ctx1,sp,sl); 127 MD5_Update(&ctx1, sp, sl);
132 128
133 if(i % 7) 129 if (i % 7)
134 MD5_Update(&ctx1,pw,strlen(pw)); 130 MD5_Update(&ctx1, pw, strlen(pw));
135 131
136 if(i & 1) 132 if (i & 1)
137 MD5_Update(&ctx1,final,16); 133 MD5_Update(&ctx1, final, 16);
138 else 134 else
139 MD5_Update(&ctx1,pw,strlen(pw)); 135 MD5_Update(&ctx1, pw, strlen(pw));
140 MD5_Final(final,&ctx1); 136
137 MD5_Final(final, &ctx1);
141 } 138 }
142 139
143 p = passwd + strlen(passwd); 140 p = passwd + strlen(passwd);
144 141
145 l = (final[ 0]<<16) | (final[ 6]<<8) | final[12]; to64(p,l,4); p += 4; 142 l = (final[ 0]<<16) | (final[ 6]<<8) | final[12];
146 l = (final[ 1]<<16) | (final[ 7]<<8) | final[13]; to64(p,l,4); p += 4; 143 strlcat(passwd, to64(l, 4), sizeof(passwd));
147 l = (final[ 2]<<16) | (final[ 8]<<8) | final[14]; to64(p,l,4); p += 4; 144 l = (final[ 1]<<16) | (final[ 7]<<8) | final[13];
148 l = (final[ 3]<<16) | (final[ 9]<<8) | final[15]; to64(p,l,4); p += 4; 145 strlcat(passwd, to64(l, 4), sizeof(passwd));
149 l = (final[ 4]<<16) | (final[10]<<8) | final[ 5]; to64(p,l,4); p += 4; 146 l = (final[ 2]<<16) | (final[ 8]<<8) | final[14];
150 l = final[11] ; to64(p,l,2); p += 2; 147 strlcat(passwd, to64(l, 4), sizeof(passwd));
151 *p = '\0'; 148 l = (final[ 3]<<16) | (final[ 9]<<8) | final[15];
149 strlcat(passwd, to64(l, 4), sizeof(passwd));
150 l = (final[ 4]<<16) | (final[10]<<8) | final[ 5];
151 strlcat(passwd, to64(l, 4), sizeof(passwd));
152 l = final[11] ;
153 strlcat(passwd, to64(l, 2), sizeof(passwd));
152 154
153 /* Don't leave anything around in vm they could use. */ 155 /* Don't leave anything around in vm they could use. */
154 memset(final,0,sizeof final); 156 memset(final, 0, sizeof(final));
157 memset(salt_copy, 0, sizeof(salt_copy));
158 memset(&ctx, 0, sizeof(ctx));
159 memset(&ctx1, 0, sizeof(ctx1));
160 (void)to64(0, 4);
155 161
156 return passwd; 162 return (passwd);
157} 163}
158 164
159#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ 165#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
diff --git a/md5crypt.h b/md5crypt.h
index 21356fbe7..2341e2c12 100644
--- a/md5crypt.h
+++ b/md5crypt.h
@@ -7,15 +7,7 @@
7 * ---------------------------------------------------------------------------- 7 * ----------------------------------------------------------------------------
8 */ 8 */
9 9
10/* 10/* $Id: md5crypt.h,v 1.4 2003/05/18 14:46:46 djm Exp $ */
11 * Ported from FreeBSD to Linux, only minimal changes. --marekm
12 */
13
14/*
15 * Adapted from shadow-19990607 by Tudor Bosman, tudorb@jm.nu
16 */
17
18/* $Id: md5crypt.h,v 1.3 2001/02/09 01:55:36 djm Exp $ */
19 11
20#ifndef _MD5CRYPT_H 12#ifndef _MD5CRYPT_H
21#define _MD5CRYPT_H 13#define _MD5CRYPT_H
@@ -24,8 +16,8 @@
24 16
25#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) 17#if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
26 18
27int is_md5_salt(const char *salt); 19int is_md5_salt(const char *);
28char *md5_crypt(const char *pw, const char *salt); 20char *md5_crypt(const char *, const char *);
29 21
30#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */ 22#endif /* defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT) */
31 23
diff --git a/mdoc2man.awk b/mdoc2man.awk
new file mode 100644
index 000000000..856e2d7c5
--- /dev/null
+++ b/mdoc2man.awk
@@ -0,0 +1,340 @@
1#!/usr/bin/awk
2#
3# Version history:
4# v3, I put the program under a proper license
5# Dan Nelson <dnelson@allantgroup.com> added .An, .Aq and fixed a typo
6# v2, fixed to work on GNU awk --posix and MacOS X
7# v1, first attempt, didn't work on MacOS X
8#
9# Copyright (c) 2003 Peter Stuge <stuge-mdoc2man@cdy.org>
10#
11# Permission to use, copy, modify, and distribute this software for any
12# purpose with or without fee is hereby granted, provided that the above
13# copyright notice and this permission notice appear in all copies.
14#
15# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
16# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
18# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
21# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
23
24BEGIN {
25 optlist=0
26 oldoptlist=0
27 nospace=0
28 synopsis=0
29 reference=0
30 block=0
31 ext=0
32 extopt=0
33 literal=0
34 prenl=0
35 line=""
36}
37
38function wtail() {
39 retval=""
40 while(w<nwords) {
41 if(length(retval))
42 retval=retval OFS
43 retval=retval words[++w]
44 }
45 return retval
46}
47
48function add(str) {
49 for(;prenl;prenl--)
50 line=line "\n"
51 line=line str
52}
53
54! /^\./ {
55 for(;prenl;prenl--)
56 print ""
57 print
58 if(literal)
59 print ".br"
60 next
61}
62
63/^\.\\"/ { next }
64
65{
66 option=0
67 parens=0
68 angles=0
69 sub("^\\.","")
70 nwords=split($0,words)
71 for(w=1;w<=nwords;w++) {
72 skip=0
73 if(match(words[w],"^Li|Pf$")) {
74 skip=1
75 } else if(match(words[w],"^Xo$")) {
76 skip=1
77 ext=1
78 if(length(line)&&!(match(line," $")||prenl))
79 add(OFS)
80 } else if(match(words[w],"^Xc$")) {
81 skip=1
82 ext=0
83 if(!extopt)
84 prenl++
85 w=nwords
86 } else if(match(words[w],"^Bd$")) {
87 skip=1
88 if(match(words[w+1],"-literal")) {
89 literal=1
90 prenl++
91 w=nwords
92 }
93 } else if(match(words[w],"^Ed$")) {
94 skip=1
95 literal=0
96 } else if(match(words[w],"^Ns$")) {
97 skip=1
98 if(!nospace)
99 nospace=1
100 sub(" $","",line)
101 } else if(match(words[w],"^No$")) {
102 skip=1
103 sub(" $","",line)
104 add(words[++w])
105 } else if(match(words[w],"^Dq$")) {
106 skip=1
107 add("``")
108 add(words[++w])
109 while(w<nwords&&!match(words[w+1],"^[\\.,]"))
110 add(OFS words[++w])
111 add("''")
112 if(!nospace&&match(words[w+1],"^[\\.,]"))
113 nospace=1
114 } else if(match(words[w],"^Sq|Ql$")) {
115 skip=1
116 add("`" words[++w] "'")
117 if(!nospace&&match(words[w+1],"^[\\.,]"))
118 nospace=1
119 } else if(match(words[w],"^Oo$")) {
120 skip=1
121 extopt=1
122 if(!nospace)
123 nospace=1
124 add("[")
125 } else if(match(words[w],"^Oc$")) {
126 skip=1
127 extopt=0
128 add("]")
129 }
130 if(!skip) {
131 if(!nospace&&length(line)&&!(match(line," $")||prenl))
132 add(OFS)
133 if(nospace==1)
134 nospace=0
135 }
136 if(match(words[w],"^Dd$")) {
137 date=wtail()
138 next
139 } else if(match(words[w],"^Dt$")) {
140 id=wtail()
141 next
142 } else if(match(words[w],"^Os$")) {
143 add(".TH " id " \"" date "\" \"" wtail() "\"")
144 } else if(match(words[w],"^Sh$")) {
145 add(".SH")
146 synopsis=match(words[w+1],"SYNOPSIS")
147 } else if(match(words[w],"^Xr$")) {
148 add("\\fB" words[++w] "\\fP(" words[++w] ")" words[++w])
149 } else if(match(words[w],"^Rs$")) {
150 split("",refauthors)
151 nrefauthors=0
152 reftitle=""
153 refissue=""
154 refdate=""
155 refopt=""
156 reference=1
157 next
158 } else if(match(words[w],"^Re$")) {
159 prenl++
160 for(i=nrefauthors-1;i>0;i--) {
161 add(refauthors[i])
162 if(i>1)
163 add(", ")
164 }
165 if(nrefauthors>1)
166 add(" and ")
167 add(refauthors[0] ", \\fI" reftitle "\\fP")
168 if(length(refissue))
169 add(", " refissue)
170 if(length(refdate))
171 add(", " refdate)
172 if(length(refopt))
173 add(", " refopt)
174 add(".")
175 reference=0
176 } else if(reference) {
177 if(match(words[w],"^%A$")) { refauthors[nrefauthors++]=wtail() }
178 if(match(words[w],"^%T$")) {
179 reftitle=wtail()
180 sub("^\"","",reftitle)
181 sub("\"$","",reftitle)
182 }
183 if(match(words[w],"^%N$")) { refissue=wtail() }
184 if(match(words[w],"^%D$")) { refdate=wtail() }
185 if(match(words[w],"^%O$")) { refopt=wtail() }
186 } else if(match(words[w],"^Nm$")) {
187 if(synopsis) {
188 add(".br")
189 prenl++
190 }
191 n=words[++w]
192 if(!length(name))
193 name=n
194 if(!length(n))
195 n=name
196 add("\\fB" n "\\fP")
197 if(!nospace&&match(words[w+1],"^[\\.,]"))
198 nospace=1
199 } else if(match(words[w],"^Nd$")) {
200 add("\\- " wtail())
201 } else if(match(words[w],"^Fl$")) {
202 add("\\fB\\-" words[++w] "\\fP")
203 if(!nospace&&match(words[w+1],"^[\\.,]"))
204 nospace=1
205 } else if(match(words[w],"^Ar$")) {
206 add("\\fI")
207 if(w==nwords)
208 add("file ...\\fP")
209 else {
210 add(words[++w] "\\fP")
211 while(match(words[w+1],"^\\|$"))
212 add(OFS words[++w] " \\fI" words[++w] "\\fP")
213 }
214 if(!nospace&&match(words[w+1],"^[\\.,]"))
215 nospace=1
216 } else if(match(words[w],"^Cm$")) {
217 add("\\fB" words[++w] "\\fP")
218 while(w<nwords&&match(words[w+1],"^[\\.,:;)]"))
219 add(words[++w])
220 } else if(match(words[w],"^Op$")) {
221 option=1
222 if(!nospace)
223 nospace=1
224 add("[")
225 } else if(match(words[w],"^Pp$")) {
226 prenl++
227 } else if(match(words[w],"^An$")) {
228 prenl++
229 } else if(match(words[w],"^Ss$")) {
230 add(".SS")
231 } else if(match(words[w],"^Pa$")&&!option) {
232 add("\\fI")
233 w++
234 if(match(words[w],"^\\."))
235 add("\\&")
236 add(words[w] "\\fP")
237 while(w<nwords&&match(words[w+1],"^[\\.,:;)]"))
238 add(words[++w])
239 } else if(match(words[w],"^Dv$")) {
240 add(".BR")
241 } else if(match(words[w],"^Em|Ev$")) {
242 add(".IR")
243 } else if(match(words[w],"^Pq$")) {
244 add("(")
245 nospace=1
246 parens=1
247 } else if(match(words[w],"^Aq$")) {
248 add("<")
249 nospace=1
250 angles=1
251 } else if(match(words[w],"^S[xy]$")) {
252 add(".B " wtail())
253 } else if(match(words[w],"^Ic$")) {
254 plain=1
255 add("\\fB")
256 while(w<nwords) {
257 w++
258 if(match(words[w],"^Op$")) {
259 w++
260 add("[")
261 words[nwords]=words[nwords] "]"
262 }
263 if(match(words[w],"^Ar$")) {
264 add("\\fI" words[++w] "\\fP")
265 } else if(match(words[w],"^[\\.,]")) {
266 sub(" $","",line)
267 if(plain) {
268 add("\\fP")
269 plain=0
270 }
271 add(words[w])
272 } else {
273 if(!plain) {
274 add("\\fB")
275 plain=1
276 }
277 add(words[w])
278 }
279 if(!nospace)
280 add(OFS)
281 }
282 sub(" $","",line)
283 if(plain)
284 add("\\fP")
285 } else if(match(words[w],"^Bl$")) {
286 oldoptlist=optlist
287 if(match(words[w+1],"-bullet"))
288 optlist=1
289 else if(match(words[w+1],"-enum")) {
290 optlist=2
291 enum=0
292 } else if(match(words[w+1],"-tag"))
293 optlist=3
294 else if(match(words[w+1],"-item"))
295 optlist=4
296 else if(match(words[w+1],"-bullet"))
297 optlist=1
298 w=nwords
299 } else if(match(words[w],"^El$")) {
300 optlist=oldoptlist
301 } else if(match(words[w],"^It$")&&optlist) {
302 if(optlist==1)
303 add(".IP \\(bu")
304 else if(optlist==2)
305 add(".IP " ++enum ".")
306 else if(optlist==3) {
307 add(".TP")
308 prenl++
309 if(match(words[w+1],"^Pa|Ev$")) {
310 add(".B")
311 w++
312 }
313 } else if(optlist==4)
314 add(".IP")
315 } else if(match(words[w],"^Sm$")) {
316 if(match(words[w+1],"off"))
317 nospace=2
318 else if(match(words[w+1],"on"))
319 nospace=0
320 w++
321 } else if(!skip) {
322 add(words[w])
323 }
324 }
325 if(match(line,"^\\.[^a-zA-Z]"))
326 sub("^\\.","",line)
327 if(parens)
328 add(")")
329 if(angles)
330 add(">")
331 if(option)
332 add("]")
333 if(ext&&!extopt&&!match(line," $"))
334 add(OFS)
335 if(!ext&&!extopt&&length(line)) {
336 print line
337 prenl=0
338 line=""
339 }
340}
diff --git a/misc.c b/misc.c
index 512fb22fb..c457a952c 100644
--- a/misc.c
+++ b/misc.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: misc.c,v 1.20 2002/12/13 10:03:15 markus Exp $"); 26RCSID("$OpenBSD: misc.c,v 1.21 2003/04/12 10:15:36 markus Exp $");
27 27
28#include "misc.h" 28#include "misc.h"
29#include "log.h" 29#include "log.h"
@@ -60,7 +60,7 @@ set_nonblock(int fd)
60 debug2("fd %d is O_NONBLOCK", fd); 60 debug2("fd %d is O_NONBLOCK", fd);
61 return; 61 return;
62 } 62 }
63 debug("fd %d setting O_NONBLOCK", fd); 63 debug2("fd %d setting O_NONBLOCK", fd);
64 val |= O_NONBLOCK; 64 val |= O_NONBLOCK;
65 if (fcntl(fd, F_SETFL, val) == -1) 65 if (fcntl(fd, F_SETFL, val) == -1)
66 debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s", 66 debug("fcntl(%d, F_SETFL, O_NONBLOCK): %s",
@@ -323,29 +323,3 @@ addargs(arglist *args, char *fmt, ...)
323 args->list[args->num++] = xstrdup(buf); 323 args->list[args->num++] = xstrdup(buf);
324 args->list[args->num] = NULL; 324 args->list[args->num] = NULL;
325} 325}
326
327mysig_t
328mysignal(int sig, mysig_t act)
329{
330#ifdef HAVE_SIGACTION
331 struct sigaction sa, osa;
332
333 if (sigaction(sig, NULL, &osa) == -1)
334 return (mysig_t) -1;
335 if (osa.sa_handler != act) {
336 memset(&sa, 0, sizeof(sa));
337 sigemptyset(&sa.sa_mask);
338 sa.sa_flags = 0;
339#if defined(SA_INTERRUPT)
340 if (sig == SIGALRM)
341 sa.sa_flags |= SA_INTERRUPT;
342#endif
343 sa.sa_handler = act;
344 if (sigaction(sig, &sa, NULL) == -1)
345 return (mysig_t) -1;
346 }
347 return (osa.sa_handler);
348#else
349 return (signal(sig, act));
350#endif
351}
diff --git a/misc.h b/misc.h
index 3b4b87967..6d2869b36 100644
--- a/misc.h
+++ b/misc.h
@@ -31,7 +31,3 @@ struct arglist {
31 int nalloc; 31 int nalloc;
32}; 32};
33void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3))); 33void addargs(arglist *, char *, ...) __attribute__((format(printf, 2, 3)));
34
35/* wrapper for signal interface */
36typedef void (*mysig_t)(int);
37mysig_t mysignal(int sig, mysig_t act);
diff --git a/moduli.c b/moduli.c
new file mode 100644
index 000000000..eb2c0fd18
--- /dev/null
+++ b/moduli.c
@@ -0,0 +1,617 @@
1/* $OpenBSD: moduli.c,v 1.1 2003/07/28 09:49:56 djm Exp $ */
2/*
3 * Copyright 1994 Phil Karn <karn@qualcomm.com>
4 * Copyright 1996-1998, 2003 William Allen Simpson <wsimpson@greendragon.com>
5 * Copyright 2000 Niels Provos <provos@citi.umich.edu>
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * Two-step process to generate safe primes for DHGEX
31 *
32 * Sieve candidates for "safe" primes,
33 * suitable for use as Diffie-Hellman moduli;
34 * that is, where q = (p-1)/2 is also prime.
35 *
36 * First step: generate candidate primes (memory intensive)
37 * Second step: test primes' safety (processor intensive)
38 */
39
40#include "includes.h"
41#include "moduli.h"
42#include "xmalloc.h"
43#include "log.h"
44
45#include <openssl/bn.h>
46
47
48/*
49 * Debugging defines
50 */
51
52/* define DEBUG_LARGE 1 */
53/* define DEBUG_SMALL 1 */
54/* define DEBUG_TEST 1 */
55
56/*
57 * File output defines
58 */
59
60/* need line long enough for largest moduli plus headers */
61#define QLINESIZE (100+8192)
62
63/* Type: decimal.
64 * Specifies the internal structure of the prime modulus.
65 */
66#define QTYPE_UNKNOWN (0)
67#define QTYPE_UNSTRUCTURED (1)
68#define QTYPE_SAFE (2)
69#define QTYPE_SCHNOOR (3)
70#define QTYPE_SOPHIE_GERMAINE (4)
71#define QTYPE_STRONG (5)
72
73/* Tests: decimal (bit field).
74 * Specifies the methods used in checking for primality.
75 * Usually, more than one test is used.
76 */
77#define QTEST_UNTESTED (0x00)
78#define QTEST_COMPOSITE (0x01)
79#define QTEST_SIEVE (0x02)
80#define QTEST_MILLER_RABIN (0x04)
81#define QTEST_JACOBI (0x08)
82#define QTEST_ELLIPTIC (0x10)
83
84/* Size: decimal.
85 * Specifies the number of the most significant bit (0 to M).
86 ** WARNING: internally, usually 1 to N.
87 */
88#define QSIZE_MINIMUM (511)
89
90/*
91 * Prime sieving defines
92 */
93
94/* Constant: assuming 8 bit bytes and 32 bit words */
95#define SHIFT_BIT (3)
96#define SHIFT_BYTE (2)
97#define SHIFT_WORD (SHIFT_BIT+SHIFT_BYTE)
98#define SHIFT_MEGABYTE (20)
99#define SHIFT_MEGAWORD (SHIFT_MEGABYTE-SHIFT_BYTE)
100
101/*
102 * Constant: when used with 32-bit integers, the largest sieve prime
103 * has to be less than 2**32.
104 */
105#define SMALL_MAXIMUM (0xffffffffUL)
106
107/* Constant: can sieve all primes less than 2**32, as 65537**2 > 2**32-1. */
108#define TINY_NUMBER (1UL<<16)
109
110/* Ensure enough bit space for testing 2*q. */
111#define TEST_MAXIMUM (1UL<<16)
112#define TEST_MINIMUM (QSIZE_MINIMUM + 1)
113/* real TEST_MINIMUM (1UL << (SHIFT_WORD - TEST_POWER)) */
114#define TEST_POWER (3) /* 2**n, n < SHIFT_WORD */
115
116/* bit operations on 32-bit words */
117#define BIT_CLEAR(a,n) ((a)[(n)>>SHIFT_WORD] &= ~(1L << ((n) & 31)))
118#define BIT_SET(a,n) ((a)[(n)>>SHIFT_WORD] |= (1L << ((n) & 31)))
119#define BIT_TEST(a,n) ((a)[(n)>>SHIFT_WORD] & (1L << ((n) & 31)))
120
121/*
122 * Prime testing defines
123 */
124
125/*
126 * Sieving data (XXX - move to struct)
127 */
128
129/* sieve 2**16 */
130static u_int32_t *TinySieve, tinybits;
131
132/* sieve 2**30 in 2**16 parts */
133static u_int32_t *SmallSieve, smallbits, smallbase;
134
135/* sieve relative to the initial value */
136static u_int32_t *LargeSieve, largewords, largetries, largenumbers;
137static u_int32_t largebits, largememory; /* megabytes */
138static BIGNUM *largebase;
139
140
141/*
142 * print moduli out in consistent form,
143 */
144static int
145qfileout(FILE * ofile, u_int32_t otype, u_int32_t otests, u_int32_t otries,
146 u_int32_t osize, u_int32_t ogenerator, BIGNUM * omodulus)
147{
148 struct tm *gtm;
149 time_t time_now;
150 int res;
151
152 time(&time_now);
153 gtm = gmtime(&time_now);
154
155 res = fprintf(ofile, "%04d%02d%02d%02d%02d%02d %u %u %u %u %x ",
156 gtm->tm_year + 1900, gtm->tm_mon + 1, gtm->tm_mday,
157 gtm->tm_hour, gtm->tm_min, gtm->tm_sec,
158 otype, otests, otries, osize, ogenerator);
159
160 if (res < 0)
161 return (-1);
162
163 if (BN_print_fp(ofile, omodulus) < 1)
164 return (-1);
165
166 res = fprintf(ofile, "\n");
167 fflush(ofile);
168
169 return (res > 0 ? 0 : -1);
170}
171
172
173/*
174 ** Sieve p's and q's with small factors
175 */
176static void
177sieve_large(u_int32_t s)
178{
179 u_int32_t r, u;
180
181 debug2("sieve_large %u", s);
182 largetries++;
183 /* r = largebase mod s */
184 r = BN_mod_word(largebase, s);
185 if (r == 0)
186 u = 0; /* s divides into largebase exactly */
187 else
188 u = s - r; /* largebase+u is first entry divisible by s */
189
190 if (u < largebits * 2) {
191 /*
192 * The sieve omits p's and q's divisible by 2, so ensure that
193 * largebase+u is odd. Then, step through the sieve in
194 * increments of 2*s
195 */
196 if (u & 0x1)
197 u += s; /* Make largebase+u odd, and u even */
198
199 /* Mark all multiples of 2*s */
200 for (u /= 2; u < largebits; u += s)
201 BIT_SET(LargeSieve, u);
202 }
203
204 /* r = p mod s */
205 r = (2 * r + 1) % s;
206 if (r == 0)
207 u = 0; /* s divides p exactly */
208 else
209 u = s - r; /* p+u is first entry divisible by s */
210
211 if (u < largebits * 4) {
212 /*
213 * The sieve omits p's divisible by 4, so ensure that
214 * largebase+u is not. Then, step through the sieve in
215 * increments of 4*s
216 */
217 while (u & 0x3) {
218 if (SMALL_MAXIMUM - u < s)
219 return;
220 u += s;
221 }
222
223 /* Mark all multiples of 4*s */
224 for (u /= 4; u < largebits; u += s)
225 BIT_SET(LargeSieve, u);
226 }
227}
228
229/*
230 * list candidates for Sophie-Germaine primes (where q = (p-1)/2)
231 * to standard output.
232 * The list is checked against small known primes (less than 2**30).
233 */
234int
235gen_candidates(FILE *out, int memory, int power, BIGNUM *start)
236{
237 BIGNUM *q;
238 u_int32_t j, r, s, t;
239 u_int32_t smallwords = TINY_NUMBER >> 6;
240 u_int32_t tinywords = TINY_NUMBER >> 6;
241 time_t time_start, time_stop;
242 int i, ret = 0;
243
244 largememory = memory;
245
246 /*
247 * Set power to the length in bits of the prime to be generated.
248 * This is changed to 1 less than the desired safe prime moduli p.
249 */
250 if (power > TEST_MAXIMUM) {
251 error("Too many bits: %u > %lu", power, TEST_MAXIMUM);
252 return (-1);
253 } else if (power < TEST_MINIMUM) {
254 error("Too few bits: %u < %u", power, TEST_MINIMUM);
255 return (-1);
256 }
257 power--; /* decrement before squaring */
258
259 /*
260 * The density of ordinary primes is on the order of 1/bits, so the
261 * density of safe primes should be about (1/bits)**2. Set test range
262 * to something well above bits**2 to be reasonably sure (but not
263 * guaranteed) of catching at least one safe prime.
264 */
265 largewords = ((power * power) >> (SHIFT_WORD - TEST_POWER));
266
267 /*
268 * Need idea of how much memory is available. We don't have to use all
269 * of it.
270 */
271 if (largememory > LARGE_MAXIMUM) {
272 logit("Limited memory: %u MB; limit %lu MB",
273 largememory, LARGE_MAXIMUM);
274 largememory = LARGE_MAXIMUM;
275 }
276
277 if (largewords <= (largememory << SHIFT_MEGAWORD)) {
278 logit("Increased memory: %u MB; need %u bytes",
279 largememory, (largewords << SHIFT_BYTE));
280 largewords = (largememory << SHIFT_MEGAWORD);
281 } else if (largememory > 0) {
282 logit("Decreased memory: %u MB; want %u bytes",
283 largememory, (largewords << SHIFT_BYTE));
284 largewords = (largememory << SHIFT_MEGAWORD);
285 }
286
287 TinySieve = calloc(tinywords, sizeof(u_int32_t));
288 if (TinySieve == NULL) {
289 error("Insufficient memory for tiny sieve: need %u bytes",
290 tinywords << SHIFT_BYTE);
291 exit(1);
292 }
293 tinybits = tinywords << SHIFT_WORD;
294
295 SmallSieve = calloc(smallwords, sizeof(u_int32_t));
296 if (SmallSieve == NULL) {
297 error("Insufficient memory for small sieve: need %u bytes",
298 smallwords << SHIFT_BYTE);
299 xfree(TinySieve);
300 exit(1);
301 }
302 smallbits = smallwords << SHIFT_WORD;
303
304 /*
305 * dynamically determine available memory
306 */
307 while ((LargeSieve = calloc(largewords, sizeof(u_int32_t))) == NULL)
308 largewords -= (1L << (SHIFT_MEGAWORD - 2)); /* 1/4 MB chunks */
309
310 largebits = largewords << SHIFT_WORD;
311 largenumbers = largebits * 2; /* even numbers excluded */
312
313 /* validation check: count the number of primes tried */
314 largetries = 0;
315 q = BN_new();
316
317 /*
318 * Generate random starting point for subprime search, or use
319 * specified parameter.
320 */
321 largebase = BN_new();
322 if (start == NULL)
323 BN_rand(largebase, power, 1, 1);
324 else
325 BN_copy(largebase, start);
326
327 /* ensure odd */
328 BN_set_bit(largebase, 0);
329
330 time(&time_start);
331
332 logit("%.24s Sieve next %u plus %u-bit", ctime(&time_start),
333 largenumbers, power);
334 debug2("start point: 0x%s", BN_bn2hex(largebase));
335
336 /*
337 * TinySieve
338 */
339 for (i = 0; i < tinybits; i++) {
340 if (BIT_TEST(TinySieve, i))
341 continue; /* 2*i+3 is composite */
342
343 /* The next tiny prime */
344 t = 2 * i + 3;
345
346 /* Mark all multiples of t */
347 for (j = i + t; j < tinybits; j += t)
348 BIT_SET(TinySieve, j);
349
350 sieve_large(t);
351 }
352
353 /*
354 * Start the small block search at the next possible prime. To avoid
355 * fencepost errors, the last pass is skipped.
356 */
357 for (smallbase = TINY_NUMBER + 3;
358 smallbase < (SMALL_MAXIMUM - TINY_NUMBER);
359 smallbase += TINY_NUMBER) {
360 for (i = 0; i < tinybits; i++) {
361 if (BIT_TEST(TinySieve, i))
362 continue; /* 2*i+3 is composite */
363
364 /* The next tiny prime */
365 t = 2 * i + 3;
366 r = smallbase % t;
367
368 if (r == 0) {
369 s = 0; /* t divides into smallbase exactly */
370 } else {
371 /* smallbase+s is first entry divisible by t */
372 s = t - r;
373 }
374
375 /*
376 * The sieve omits even numbers, so ensure that
377 * smallbase+s is odd. Then, step through the sieve
378 * in increments of 2*t
379 */
380 if (s & 1)
381 s += t; /* Make smallbase+s odd, and s even */
382
383 /* Mark all multiples of 2*t */
384 for (s /= 2; s < smallbits; s += t)
385 BIT_SET(SmallSieve, s);
386 }
387
388 /*
389 * SmallSieve
390 */
391 for (i = 0; i < smallbits; i++) {
392 if (BIT_TEST(SmallSieve, i))
393 continue; /* 2*i+smallbase is composite */
394
395 /* The next small prime */
396 sieve_large((2 * i) + smallbase);
397 }
398
399 memset(SmallSieve, 0, smallwords << SHIFT_BYTE);
400 }
401
402 time(&time_stop);
403
404 logit("%.24s Sieved with %u small primes in %ld seconds",
405 ctime(&time_stop), largetries, (long) (time_stop - time_start));
406
407 for (j = r = 0; j < largebits; j++) {
408 if (BIT_TEST(LargeSieve, j))
409 continue; /* Definitely composite, skip */
410
411 debug2("test q = largebase+%u", 2 * j);
412 BN_set_word(q, 2 * j);
413 BN_add(q, q, largebase);
414 if (qfileout(out, QTYPE_SOPHIE_GERMAINE, QTEST_SIEVE,
415 largetries, (power - 1) /* MSB */, (0), q) == -1) {
416 ret = -1;
417 break;
418 }
419
420 r++; /* count q */
421 }
422
423 time(&time_stop);
424
425 xfree(LargeSieve);
426 xfree(SmallSieve);
427 xfree(TinySieve);
428
429 logit("%.24s Found %u candidates", ctime(&time_stop), r);
430
431 return (ret);
432}
433
434/*
435 * perform a Miller-Rabin primality test
436 * on the list of candidates
437 * (checking both q and p)
438 * The result is a list of so-call "safe" primes
439 */
440int
441prime_test(FILE *in, FILE *out, u_int32_t trials,
442 u_int32_t generator_wanted)
443{
444 BIGNUM *q, *p, *a;
445 BN_CTX *ctx;
446 char *cp, *lp;
447 u_int32_t count_in = 0, count_out = 0, count_possible = 0;
448 u_int32_t generator_known, in_tests, in_tries, in_type, in_size;
449 time_t time_start, time_stop;
450 int res;
451
452 time(&time_start);
453
454 p = BN_new();
455 q = BN_new();
456 ctx = BN_CTX_new();
457
458 debug2("%.24s Final %u Miller-Rabin trials (%x generator)",
459 ctime(&time_start), trials, generator_wanted);
460
461 res = 0;
462 lp = xmalloc(QLINESIZE + 1);
463 while (fgets(lp, QLINESIZE, in) != NULL) {
464 int ll = strlen(lp);
465
466 count_in++;
467 if (ll < 14 || *lp == '!' || *lp == '#') {
468 debug2("%10u: comment or short line", count_in);
469 continue;
470 }
471
472 /* XXX - fragile parser */
473 /* time */
474 cp = &lp[14]; /* (skip) */
475
476 /* type */
477 in_type = strtoul(cp, &cp, 10);
478
479 /* tests */
480 in_tests = strtoul(cp, &cp, 10);
481
482 if (in_tests & QTEST_COMPOSITE) {
483 debug2("%10u: known composite", count_in);
484 continue;
485 }
486 /* tries */
487 in_tries = strtoul(cp, &cp, 10);
488
489 /* size (most significant bit) */
490 in_size = strtoul(cp, &cp, 10);
491
492 /* generator (hex) */
493 generator_known = strtoul(cp, &cp, 16);
494
495 /* Skip white space */
496 cp += strspn(cp, " ");
497
498 /* modulus (hex) */
499 switch (in_type) {
500 case QTYPE_SOPHIE_GERMAINE:
501 debug2("%10u: (%u) Sophie-Germaine", count_in, in_type);
502 a = q;
503 BN_hex2bn(&a, cp);
504 /* p = 2*q + 1 */
505 BN_lshift(p, q, 1);
506 BN_add_word(p, 1);
507 in_size += 1;
508 generator_known = 0;
509 break;
510 default:
511 debug2("%10u: (%u)", count_in, in_type);
512 a = p;
513 BN_hex2bn(&a, cp);
514 /* q = (p-1) / 2 */
515 BN_rshift(q, p, 1);
516 break;
517 }
518
519 /*
520 * due to earlier inconsistencies in interpretation, check
521 * the proposed bit size.
522 */
523 if (BN_num_bits(p) != (in_size + 1)) {
524 debug2("%10u: bit size %u mismatch", count_in, in_size);
525 continue;
526 }
527 if (in_size < QSIZE_MINIMUM) {
528 debug2("%10u: bit size %u too short", count_in, in_size);
529 continue;
530 }
531
532 if (in_tests & QTEST_MILLER_RABIN)
533 in_tries += trials;
534 else
535 in_tries = trials;
536 /*
537 * guess unknown generator
538 */
539 if (generator_known == 0) {
540 if (BN_mod_word(p, 24) == 11)
541 generator_known = 2;
542 else if (BN_mod_word(p, 12) == 5)
543 generator_known = 3;
544 else {
545 u_int32_t r = BN_mod_word(p, 10);
546
547 if (r == 3 || r == 7) {
548 generator_known = 5;
549 }
550 }
551 }
552 /*
553 * skip tests when desired generator doesn't match
554 */
555 if (generator_wanted > 0 &&
556 generator_wanted != generator_known) {
557 debug2("%10u: generator %d != %d",
558 count_in, generator_known, generator_wanted);
559 continue;
560 }
561
562 count_possible++;
563
564 /*
565 * The (1/4)^N performance bound on Miller-Rabin is
566 * extremely pessimistic, so don't spend a lot of time
567 * really verifying that q is prime until after we know
568 * that p is also prime. A single pass will weed out the
569 * vast majority of composite q's.
570 */
571 if (BN_is_prime(q, 1, NULL, ctx, NULL) <= 0) {
572 debug2("%10u: q failed first possible prime test",
573 count_in);
574 continue;
575 }
576
577 /*
578 * q is possibly prime, so go ahead and really make sure
579 * that p is prime. If it is, then we can go back and do
580 * the same for q. If p is composite, chances are that
581 * will show up on the first Rabin-Miller iteration so it
582 * doesn't hurt to specify a high iteration count.
583 */
584 if (!BN_is_prime(p, trials, NULL, ctx, NULL)) {
585 debug2("%10u: p is not prime", count_in);
586 continue;
587 }
588 debug("%10u: p is almost certainly prime", count_in);
589
590 /* recheck q more rigorously */
591 if (!BN_is_prime(q, trials - 1, NULL, ctx, NULL)) {
592 debug("%10u: q is not prime", count_in);
593 continue;
594 }
595 debug("%10u: q is almost certainly prime", count_in);
596
597 if (qfileout(out, QTYPE_SAFE, (in_tests | QTEST_MILLER_RABIN),
598 in_tries, in_size, generator_known, p)) {
599 res = -1;
600 break;
601 }
602
603 count_out++;
604 }
605
606 time(&time_stop);
607 xfree(lp);
608 BN_free(p);
609 BN_free(q);
610 BN_CTX_free(ctx);
611
612 logit("%.24s Found %u safe primes of %u candidates in %ld seconds",
613 ctime(&time_stop), count_out, count_possible,
614 (long) (time_stop - time_start));
615
616 return (res);
617}
diff --git a/moduli.h b/moduli.h
new file mode 100644
index 000000000..9cd1cd3f8
--- /dev/null
+++ b/moduli.h
@@ -0,0 +1,23 @@
1/* $OpenBSD: moduli.h,v 1.1 2003/07/28 09:49:56 djm Exp $ */
2
3#include <sys/types.h>
4#include <openssl/bn.h>
5
6/*
7 * Using virtual memory can cause thrashing. This should be the largest
8 * number that is supported without a large amount of disk activity --
9 * that would increase the run time from hours to days or weeks!
10 */
11#define LARGE_MINIMUM (8UL) /* megabytes */
12
13/*
14 * Do not increase this number beyond the unsigned integer bit size.
15 * Due to a multiple of 4, it must be LESS than 128 (yielding 2**30 bits).
16 */
17#define LARGE_MAXIMUM (127UL) /* megabytes */
18
19/* Minimum number of primality tests to perform */
20#define TRIAL_MINIMUM (4)
21
22int gen_candidates(FILE *, int, int, BIGNUM *);
23int prime_test(FILE *, FILE *, u_int32_t, u_int32_t);
diff --git a/monitor.c b/monitor.c
index bce9e684c..e5656470d 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.36 2003/04/01 10:22:21 markus Exp $"); 28RCSID("$OpenBSD: monitor.c,v 1.49 2003/08/28 12:54:34 markus Exp $");
29 29
30#include <openssl/dh.h> 30#include <openssl/dh.h>
31 31
@@ -59,6 +59,11 @@ RCSID("$OpenBSD: monitor.c,v 1.36 2003/04/01 10:22:21 markus Exp $");
59#include "ssh2.h" 59#include "ssh2.h"
60#include "mpaux.h" 60#include "mpaux.h"
61 61
62#ifdef GSSAPI
63#include "ssh-gss.h"
64static Gssctxt *gsscontext = NULL;
65#endif
66
62/* Imports */ 67/* Imports */
63extern ServerOptions options; 68extern ServerOptions options;
64extern u_int utmp_len; 69extern u_int utmp_len;
@@ -93,7 +98,7 @@ struct {
93 u_int olen; 98 u_int olen;
94} child_state; 99} child_state;
95 100
96/* Functions on the montior that answer unprivileged requests */ 101/* Functions on the monitor that answer unprivileged requests */
97 102
98int mm_answer_moduli(int, Buffer *); 103int mm_answer_moduli(int, Buffer *);
99int mm_answer_sign(int, Buffer *); 104int mm_answer_sign(int, Buffer *);
@@ -118,13 +123,17 @@ int mm_answer_sessid(int, Buffer *);
118 123
119#ifdef USE_PAM 124#ifdef USE_PAM
120int mm_answer_pam_start(int, Buffer *); 125int mm_answer_pam_start(int, Buffer *);
126int mm_answer_pam_account(int, Buffer *);
127int mm_answer_pam_init_ctx(int, Buffer *);
128int mm_answer_pam_query(int, Buffer *);
129int mm_answer_pam_respond(int, Buffer *);
130int mm_answer_pam_free_ctx(int, Buffer *);
121#endif 131#endif
122 132
123#ifdef KRB4 133#ifdef GSSAPI
124int mm_answer_krb4(int, Buffer *); 134int mm_answer_gss_setup_ctx(int, Buffer *);
125#endif 135int mm_answer_gss_accept_ctx(int, Buffer *);
126#ifdef KRB5 136int mm_answer_gss_userok(int, Buffer *);
127int mm_answer_krb5(int, Buffer *);
128#endif 137#endif
129 138
130static Authctxt *authctxt; 139static Authctxt *authctxt;
@@ -137,8 +146,9 @@ static int key_blobtype = MM_NOKEY;
137static char *hostbased_cuser = NULL; 146static char *hostbased_cuser = NULL;
138static char *hostbased_chost = NULL; 147static char *hostbased_chost = NULL;
139static char *auth_method = "unknown"; 148static char *auth_method = "unknown";
140static int session_id2_len = 0; 149static u_int session_id2_len = 0;
141static u_char *session_id2 = NULL; 150static u_char *session_id2 = NULL;
151static pid_t monitor_child_pid;
142 152
143struct mon_table { 153struct mon_table {
144 enum monitor_reqtype type; 154 enum monitor_reqtype type;
@@ -163,6 +173,11 @@ struct mon_table mon_dispatch_proto20[] = {
163 {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword}, 173 {MONITOR_REQ_AUTHPASSWORD, MON_AUTH, mm_answer_authpassword},
164#ifdef USE_PAM 174#ifdef USE_PAM
165 {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, 175 {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start},
176 {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account},
177 {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx},
178 {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query},
179 {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond},
180 {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx},
166#endif 181#endif
167#ifdef BSD_AUTH 182#ifdef BSD_AUTH
168 {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery}, 183 {MONITOR_REQ_BSDAUTHQUERY, MON_ISAUTH, mm_answer_bsdauthquery},
@@ -174,6 +189,11 @@ struct mon_table mon_dispatch_proto20[] = {
174#endif 189#endif
175 {MONITOR_REQ_KEYALLOWED, MON_ISAUTH, mm_answer_keyallowed}, 190 {MONITOR_REQ_KEYALLOWED, MON_ISAUTH, mm_answer_keyallowed},
176 {MONITOR_REQ_KEYVERIFY, MON_AUTH, mm_answer_keyverify}, 191 {MONITOR_REQ_KEYVERIFY, MON_AUTH, mm_answer_keyverify},
192#ifdef GSSAPI
193 {MONITOR_REQ_GSSSETUP, MON_ISAUTH, mm_answer_gss_setup_ctx},
194 {MONITOR_REQ_GSSSTEP, MON_ISAUTH, mm_answer_gss_accept_ctx},
195 {MONITOR_REQ_GSSUSEROK, MON_AUTH, mm_answer_gss_userok},
196#endif
177 {0, 0, NULL} 197 {0, 0, NULL}
178}; 198};
179 199
@@ -205,12 +225,11 @@ struct mon_table mon_dispatch_proto15[] = {
205#endif 225#endif
206#ifdef USE_PAM 226#ifdef USE_PAM
207 {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start}, 227 {MONITOR_REQ_PAM_START, MON_ONCE, mm_answer_pam_start},
208#endif 228 {MONITOR_REQ_PAM_ACCOUNT, 0, mm_answer_pam_account},
209#ifdef KRB4 229 {MONITOR_REQ_PAM_INIT_CTX, MON_ISAUTH, mm_answer_pam_init_ctx},
210 {MONITOR_REQ_KRB4, MON_ONCE|MON_AUTH, mm_answer_krb4}, 230 {MONITOR_REQ_PAM_QUERY, MON_ISAUTH, mm_answer_pam_query},
211#endif 231 {MONITOR_REQ_PAM_RESPOND, MON_ISAUTH, mm_answer_pam_respond},
212#ifdef KRB5 232 {MONITOR_REQ_PAM_FREE_CTX, MON_ONCE|MON_AUTHDECIDE, mm_answer_pam_free_ctx},
213 {MONITOR_REQ_KRB5, MON_ONCE|MON_AUTH, mm_answer_krb5},
214#endif 233#endif
215 {0, 0, NULL} 234 {0, 0, NULL}
216}; 235};
@@ -286,8 +305,16 @@ monitor_child_preauth(struct monitor *pmonitor)
286 !auth_root_allowed(auth_method)) 305 !auth_root_allowed(auth_method))
287 authenticated = 0; 306 authenticated = 0;
288#ifdef USE_PAM 307#ifdef USE_PAM
289 if (!do_pam_account(authctxt->pw->pw_name, NULL)) 308 /* PAM needs to perform account checks after auth */
290 authenticated = 0; 309 if (options.use_pam) {
310 Buffer m;
311
312 buffer_init(&m);
313 mm_request_receive_expect(pmonitor->m_sendfd,
314 MONITOR_REQ_PAM_ACCOUNT, &m);
315 authenticated = mm_answer_pam_account(pmonitor->m_sendfd, &m);
316 buffer_free(&m);
317 }
291#endif 318#endif
292 } 319 }
293 320
@@ -310,9 +337,25 @@ monitor_child_preauth(struct monitor *pmonitor)
310 return (authctxt); 337 return (authctxt);
311} 338}
312 339
340static void
341monitor_set_child_handler(pid_t pid)
342{
343 monitor_child_pid = pid;
344}
345
346static void
347monitor_child_handler(int signal)
348{
349 kill(monitor_child_pid, signal);
350}
351
313void 352void
314monitor_child_postauth(struct monitor *pmonitor) 353monitor_child_postauth(struct monitor *pmonitor)
315{ 354{
355 monitor_set_child_handler(pmonitor->m_pid);
356 signal(SIGHUP, &monitor_child_handler);
357 signal(SIGTERM, &monitor_child_handler);
358
316 if (compat20) { 359 if (compat20) {
317 mon_dispatch = mon_dispatch_postauth20; 360 mon_dispatch = mon_dispatch_postauth20;
318 361
@@ -320,7 +363,6 @@ monitor_child_postauth(struct monitor *pmonitor)
320 monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1); 363 monitor_permit(mon_dispatch, MONITOR_REQ_MODULI, 1);
321 monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1); 364 monitor_permit(mon_dispatch, MONITOR_REQ_SIGN, 1);
322 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); 365 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1);
323
324 } else { 366 } else {
325 mon_dispatch = mon_dispatch_postauth15; 367 mon_dispatch = mon_dispatch_postauth15;
326 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1); 368 monitor_permit(mon_dispatch, MONITOR_REQ_TERM, 1);
@@ -556,7 +598,8 @@ mm_answer_pwnamallow(int socket, Buffer *m)
556 } 598 }
557 599
558#ifdef USE_PAM 600#ifdef USE_PAM
559 monitor_permit(mon_dispatch, MONITOR_REQ_PAM_START, 1); 601 if (options.use_pam)
602 monitor_permit(mon_dispatch, MONITOR_REQ_PAM_START, 1);
560#endif 603#endif
561 604
562 return (0); 605 return (0);
@@ -606,7 +649,7 @@ mm_answer_authpassword(int socket, Buffer *m)
606 passwd = buffer_get_string(m, &plen); 649 passwd = buffer_get_string(m, &plen);
607 /* Only authenticate if the context is valid */ 650 /* Only authenticate if the context is valid */
608 authenticated = options.password_authentication && 651 authenticated = options.password_authentication &&
609 auth_password(authctxt, passwd) && authctxt->valid; 652 auth_password(authctxt, passwd);
610 memset(passwd, 0, strlen(passwd)); 653 memset(passwd, 0, strlen(passwd));
611 xfree(passwd); 654 xfree(passwd);
612 655
@@ -739,14 +782,133 @@ mm_answer_pam_start(int socket, Buffer *m)
739{ 782{
740 char *user; 783 char *user;
741 784
785 if (!options.use_pam)
786 fatal("UsePAM not set, but ended up in %s anyway", __func__);
787
742 user = buffer_get_string(m, NULL); 788 user = buffer_get_string(m, NULL);
743 789
744 start_pam(user); 790 start_pam(user);
745 791
746 xfree(user); 792 xfree(user);
747 793
794 monitor_permit(mon_dispatch, MONITOR_REQ_PAM_ACCOUNT, 1);
795
748 return (0); 796 return (0);
749} 797}
798
799int
800mm_answer_pam_account(int socket, Buffer *m)
801{
802 u_int ret;
803
804 if (!options.use_pam)
805 fatal("UsePAM not set, but ended up in %s anyway", __func__);
806
807 ret = do_pam_account();
808
809 buffer_put_int(m, ret);
810
811 mm_request_send(socket, MONITOR_ANS_PAM_ACCOUNT, m);
812
813 return (ret);
814}
815
816static void *sshpam_ctxt, *sshpam_authok;
817extern KbdintDevice sshpam_device;
818
819int
820mm_answer_pam_init_ctx(int socket, Buffer *m)
821{
822
823 debug3("%s", __func__);
824 authctxt->user = buffer_get_string(m, NULL);
825 sshpam_ctxt = (sshpam_device.init_ctx)(authctxt);
826 sshpam_authok = NULL;
827 buffer_clear(m);
828 if (sshpam_ctxt != NULL) {
829 monitor_permit(mon_dispatch, MONITOR_REQ_PAM_FREE_CTX, 1);
830 buffer_put_int(m, 1);
831 } else {
832 buffer_put_int(m, 0);
833 }
834 mm_request_send(socket, MONITOR_ANS_PAM_INIT_CTX, m);
835 return (0);
836}
837
838int
839mm_answer_pam_query(int socket, Buffer *m)
840{
841 char *name, *info, **prompts;
842 u_int num, *echo_on;
843 int i, ret;
844
845 debug3("%s", __func__);
846 sshpam_authok = NULL;
847 ret = (sshpam_device.query)(sshpam_ctxt, &name, &info, &num, &prompts, &echo_on);
848 if (ret == 0 && num == 0)
849 sshpam_authok = sshpam_ctxt;
850 if (num > 1 || name == NULL || info == NULL)
851 ret = -1;
852 buffer_clear(m);
853 buffer_put_int(m, ret);
854 buffer_put_cstring(m, name);
855 xfree(name);
856 buffer_put_cstring(m, info);
857 xfree(info);
858 buffer_put_int(m, num);
859 for (i = 0; i < num; ++i) {
860 buffer_put_cstring(m, prompts[i]);
861 xfree(prompts[i]);
862 buffer_put_int(m, echo_on[i]);
863 }
864 if (prompts != NULL)
865 xfree(prompts);
866 if (echo_on != NULL)
867 xfree(echo_on);
868 mm_request_send(socket, MONITOR_ANS_PAM_QUERY, m);
869 return (0);
870}
871
872int
873mm_answer_pam_respond(int socket, Buffer *m)
874{
875 char **resp;
876 u_int num;
877 int i, ret;
878
879 debug3("%s", __func__);
880 sshpam_authok = NULL;
881 num = buffer_get_int(m);
882 if (num > 0) {
883 resp = xmalloc(num * sizeof(char *));
884 for (i = 0; i < num; ++i)
885 resp[i] = buffer_get_string(m, NULL);
886 ret = (sshpam_device.respond)(sshpam_ctxt, num, resp);
887 for (i = 0; i < num; ++i)
888 xfree(resp[i]);
889 xfree(resp);
890 } else {
891 ret = (sshpam_device.respond)(sshpam_ctxt, num, NULL);
892 }
893 buffer_clear(m);
894 buffer_put_int(m, ret);
895 mm_request_send(socket, MONITOR_ANS_PAM_RESPOND, m);
896 auth_method = "keyboard-interactive/pam";
897 if (ret == 0)
898 sshpam_authok = sshpam_ctxt;
899 return (0);
900}
901
902int
903mm_answer_pam_free_ctx(int socket, Buffer *m)
904{
905
906 debug3("%s", __func__);
907 (sshpam_device.free_ctx)(sshpam_ctxt);
908 buffer_clear(m);
909 mm_request_send(socket, MONITOR_ANS_PAM_FREE_CTX, m);
910 return (sshpam_authok == sshpam_ctxt);
911}
750#endif 912#endif
751 913
752static void 914static void
@@ -870,7 +1032,7 @@ monitor_valid_userblob(u_char *data, u_int datalen)
870 fail++; 1032 fail++;
871 p = buffer_get_string(&b, NULL); 1033 p = buffer_get_string(&b, NULL);
872 if (strcmp(authctxt->user, p) != 0) { 1034 if (strcmp(authctxt->user, p) != 0) {
873 log("wrong user name passed to monitor: expected %s != %.100s", 1035 logit("wrong user name passed to monitor: expected %s != %.100s",
874 authctxt->user, p); 1036 authctxt->user, p);
875 fail++; 1037 fail++;
876 } 1038 }
@@ -918,7 +1080,7 @@ monitor_valid_hostbasedblob(u_char *data, u_int datalen, char *cuser,
918 fail++; 1080 fail++;
919 p = buffer_get_string(&b, NULL); 1081 p = buffer_get_string(&b, NULL);
920 if (strcmp(authctxt->user, p) != 0) { 1082 if (strcmp(authctxt->user, p) != 0) {
921 log("wrong user name passed to monitor: expected %s != %.100s", 1083 logit("wrong user name passed to monitor: expected %s != %.100s",
922 authctxt->user, p); 1084 authctxt->user, p);
923 fail++; 1085 fail++;
924 } 1086 }
@@ -1028,14 +1190,14 @@ mm_record_login(Session *s, struct passwd *pw)
1028 } 1190 }
1029 /* Record that there was a login on that tty from the remote host. */ 1191 /* Record that there was a login on that tty from the remote host. */
1030 record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid, 1192 record_login(s->pid, s->tty, pw->pw_name, pw->pw_uid,
1031 get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), 1193 get_remote_name_or_ip(utmp_len, options.use_dns),
1032 (struct sockaddr *)&from, fromlen); 1194 (struct sockaddr *)&from, fromlen);
1033} 1195}
1034 1196
1035static void 1197static void
1036mm_session_close(Session *s) 1198mm_session_close(Session *s)
1037{ 1199{
1038 debug3("%s: session %d pid %d", __func__, s->self, s->pid); 1200 debug3("%s: session %d pid %ld", __func__, s->self, (long)s->pid);
1039 if (s->ttyfd != -1) { 1201 if (s->ttyfd != -1) {
1040 debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd); 1202 debug3("%s: tty %s ptyfd %d", __func__, s->tty, s->ptyfd);
1041 fatal_remove_cleanup(session_pty_cleanup2, (void *)s); 1203 fatal_remove_cleanup(session_pty_cleanup2, (void *)s);
@@ -1299,89 +1461,6 @@ mm_answer_rsa_response(int socket, Buffer *m)
1299 return (success); 1461 return (success);
1300} 1462}
1301 1463
1302#ifdef KRB4
1303int
1304mm_answer_krb4(int socket, Buffer *m)
1305{
1306 KTEXT_ST auth, reply;
1307 char *client, *p;
1308 int success;
1309 u_int alen;
1310
1311 reply.length = auth.length = 0;
1312
1313 p = buffer_get_string(m, &alen);
1314 if (alen >= MAX_KTXT_LEN)
1315 fatal("%s: auth too large", __func__);
1316 memcpy(auth.dat, p, alen);
1317 auth.length = alen;
1318 memset(p, 0, alen);
1319 xfree(p);
1320
1321 success = options.kerberos_authentication &&
1322 authctxt->valid &&
1323 auth_krb4(authctxt, &auth, &client, &reply);
1324
1325 memset(auth.dat, 0, alen);
1326 buffer_clear(m);
1327 buffer_put_int(m, success);
1328
1329 if (success) {
1330 buffer_put_cstring(m, client);
1331 buffer_put_string(m, reply.dat, reply.length);
1332 if (client)
1333 xfree(client);
1334 if (reply.length)
1335 memset(reply.dat, 0, reply.length);
1336 }
1337
1338 debug3("%s: sending result %d", __func__, success);
1339 mm_request_send(socket, MONITOR_ANS_KRB4, m);
1340
1341 auth_method = "kerberos";
1342
1343 /* Causes monitor loop to terminate if authenticated */
1344 return (success);
1345}
1346#endif
1347
1348#ifdef KRB5
1349int
1350mm_answer_krb5(int socket, Buffer *m)
1351{
1352 krb5_data tkt, reply;
1353 char *client_user;
1354 u_int len;
1355 int success;
1356
1357 /* use temporary var to avoid size issues on 64bit arch */
1358 tkt.data = buffer_get_string(m, &len);
1359 tkt.length = len;
1360
1361 success = options.kerberos_authentication &&
1362 authctxt->valid &&
1363 auth_krb5(authctxt, &tkt, &client_user, &reply);
1364
1365 if (tkt.length)
1366 xfree(tkt.data);
1367
1368 buffer_clear(m);
1369 buffer_put_int(m, success);
1370
1371 if (success) {
1372 buffer_put_cstring(m, client_user);
1373 buffer_put_string(m, reply.data, reply.length);
1374 if (client_user)
1375 xfree(client_user);
1376 if (reply.length)
1377 xfree(reply.data);
1378 }
1379 mm_request_send(socket, MONITOR_ANS_KRB5, m);
1380
1381 return success;
1382}
1383#endif
1384
1385int 1464int
1386mm_answer_term(int socket, Buffer *req) 1465mm_answer_term(int socket, Buffer *req)
1387{ 1466{
@@ -1497,6 +1576,8 @@ mm_get_keystate(struct monitor *pmonitor)
1497 Buffer m; 1576 Buffer m;
1498 u_char *blob, *p; 1577 u_char *blob, *p;
1499 u_int bloblen, plen; 1578 u_int bloblen, plen;
1579 u_int32_t seqnr, packets;
1580 u_int64_t blocks;
1500 1581
1501 debug3("%s: Waiting for new keys", __func__); 1582 debug3("%s: Waiting for new keys", __func__);
1502 1583
@@ -1526,8 +1607,14 @@ mm_get_keystate(struct monitor *pmonitor)
1526 xfree(blob); 1607 xfree(blob);
1527 1608
1528 /* Now get sequence numbers for the packets */ 1609 /* Now get sequence numbers for the packets */
1529 packet_set_seqnr(MODE_OUT, buffer_get_int(&m)); 1610 seqnr = buffer_get_int(&m);
1530 packet_set_seqnr(MODE_IN, buffer_get_int(&m)); 1611 blocks = buffer_get_int64(&m);
1612 packets = buffer_get_int(&m);
1613 packet_set_state(MODE_OUT, seqnr, blocks, packets);
1614 seqnr = buffer_get_int(&m);
1615 blocks = buffer_get_int64(&m);
1616 packets = buffer_get_int(&m);
1617 packet_set_state(MODE_IN, seqnr, blocks, packets);
1531 1618
1532 skip: 1619 skip:
1533 /* Get the key context */ 1620 /* Get the key context */
@@ -1648,3 +1735,79 @@ monitor_reinit(struct monitor *mon)
1648 mon->m_recvfd = pair[0]; 1735 mon->m_recvfd = pair[0];
1649 mon->m_sendfd = pair[1]; 1736 mon->m_sendfd = pair[1];
1650} 1737}
1738
1739#ifdef GSSAPI
1740int
1741mm_answer_gss_setup_ctx(int socket, Buffer *m)
1742{
1743 gss_OID_desc oid;
1744 OM_uint32 major;
1745 u_int len;
1746
1747 oid.elements = buffer_get_string(m, &len);
1748 oid.length = len;
1749
1750 major = ssh_gssapi_server_ctx(&gsscontext, &oid);
1751
1752 xfree(oid.elements);
1753
1754 buffer_clear(m);
1755 buffer_put_int(m, major);
1756
1757 mm_request_send(socket,MONITOR_ANS_GSSSETUP, m);
1758
1759 /* Now we have a context, enable the step */
1760 monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 1);
1761
1762 return (0);
1763}
1764
1765int
1766mm_answer_gss_accept_ctx(int socket, Buffer *m)
1767{
1768 gss_buffer_desc in;
1769 gss_buffer_desc out = GSS_C_EMPTY_BUFFER;
1770 OM_uint32 major,minor;
1771 OM_uint32 flags = 0; /* GSI needs this */
1772 u_int len;
1773
1774 in.value = buffer_get_string(m, &len);
1775 in.length = len;
1776 major = ssh_gssapi_accept_ctx(gsscontext, &in, &out, &flags);
1777 xfree(in.value);
1778
1779 buffer_clear(m);
1780 buffer_put_int(m, major);
1781 buffer_put_string(m, out.value, out.length);
1782 buffer_put_int(m, flags);
1783 mm_request_send(socket, MONITOR_ANS_GSSSTEP, m);
1784
1785 gss_release_buffer(&minor, &out);
1786
1787 /* Complete - now we can do signing */
1788 if (major==GSS_S_COMPLETE) {
1789 monitor_permit(mon_dispatch, MONITOR_REQ_GSSSTEP, 0);
1790 monitor_permit(mon_dispatch, MONITOR_REQ_GSSUSEROK, 1);
1791 }
1792 return (0);
1793}
1794
1795int
1796mm_answer_gss_userok(int socket, Buffer *m)
1797{
1798 int authenticated;
1799
1800 authenticated = authctxt->valid && ssh_gssapi_userok(authctxt->user);
1801
1802 buffer_clear(m);
1803 buffer_put_int(m, authenticated);
1804
1805 debug3("%s: sending result %d", __func__, authenticated);
1806 mm_request_send(socket, MONITOR_ANS_GSSUSEROK, m);
1807
1808 auth_method="gssapi";
1809
1810 /* Monitor loop will terminate if authenticated */
1811 return (authenticated);
1812}
1813#endif /* GSSAPI */
diff --git a/monitor.h b/monitor.h
index 668ac9897..2461156c7 100644
--- a/monitor.h
+++ b/monitor.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.h,v 1.8 2002/09/26 11:38:43 markus Exp $ */ 1/* $OpenBSD: monitor.h,v 1.11 2003/08/28 12:54:34 markus Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 4 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -49,9 +49,15 @@ enum monitor_reqtype {
49 MONITOR_REQ_RSAKEYALLOWED, MONITOR_ANS_RSAKEYALLOWED, 49 MONITOR_REQ_RSAKEYALLOWED, MONITOR_ANS_RSAKEYALLOWED,
50 MONITOR_REQ_RSACHALLENGE, MONITOR_ANS_RSACHALLENGE, 50 MONITOR_REQ_RSACHALLENGE, MONITOR_ANS_RSACHALLENGE,
51 MONITOR_REQ_RSARESPONSE, MONITOR_ANS_RSARESPONSE, 51 MONITOR_REQ_RSARESPONSE, MONITOR_ANS_RSARESPONSE,
52 MONITOR_REQ_KRB4, MONITOR_ANS_KRB4, 52 MONITOR_REQ_GSSSETUP, MONITOR_ANS_GSSSETUP,
53 MONITOR_REQ_KRB5, MONITOR_ANS_KRB5, 53 MONITOR_REQ_GSSSTEP, MONITOR_ANS_GSSSTEP,
54 MONITOR_REQ_GSSUSEROK, MONITOR_ANS_GSSUSEROK,
54 MONITOR_REQ_PAM_START, 55 MONITOR_REQ_PAM_START,
56 MONITOR_REQ_PAM_ACCOUNT, MONITOR_ANS_PAM_ACCOUNT,
57 MONITOR_REQ_PAM_INIT_CTX, MONITOR_ANS_PAM_INIT_CTX,
58 MONITOR_REQ_PAM_QUERY, MONITOR_ANS_PAM_QUERY,
59 MONITOR_REQ_PAM_RESPOND, MONITOR_ANS_PAM_RESPOND,
60 MONITOR_REQ_PAM_FREE_CTX, MONITOR_ANS_PAM_FREE_CTX,
55 MONITOR_REQ_TERM 61 MONITOR_REQ_TERM
56}; 62};
57 63
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 641ce721e..22b7882bd 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -113,9 +113,11 @@ mm_receive_fd(int socket)
113 fatal("%s: no fd", __func__); 113 fatal("%s: no fd", __func__);
114#else 114#else
115 cmsg = CMSG_FIRSTHDR(&msg); 115 cmsg = CMSG_FIRSTHDR(&msg);
116#ifndef BROKEN_CMSG_TYPE
116 if (cmsg->cmsg_type != SCM_RIGHTS) 117 if (cmsg->cmsg_type != SCM_RIGHTS)
117 fatal("%s: expected type %d got %d", __func__, 118 fatal("%s: expected type %d got %d", __func__,
118 SCM_RIGHTS, cmsg->cmsg_type); 119 SCM_RIGHTS, cmsg->cmsg_type);
120#endif
119 fd = (*(int *)CMSG_DATA(cmsg)); 121 fd = (*(int *)CMSG_DATA(cmsg));
120#endif 122#endif
121 return fd; 123 return fd;
diff --git a/monitor_mm.c b/monitor_mm.c
index b4a6e40c9..e57c87cc2 100644
--- a/monitor_mm.c
+++ b/monitor_mm.c
@@ -30,7 +30,6 @@ RCSID("$OpenBSD: monitor_mm.c,v 1.8 2002/08/02 14:43:15 millert Exp $");
30#include <sys/mman.h> 30#include <sys/mman.h>
31#endif 31#endif
32 32
33#include "openbsd-compat/xmmap.h"
34#include "ssh.h" 33#include "ssh.h"
35#include "xmalloc.h" 34#include "xmalloc.h"
36#include "log.h" 35#include "log.h"
diff --git a/monitor_wrap.c b/monitor_wrap.c
index c9714138a..4034d569c 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor_wrap.c,v 1.24 2003/04/01 10:22:21 markus Exp $"); 28RCSID("$OpenBSD: monitor_wrap.c,v 1.31 2003/08/28 12:54:34 markus Exp $");
29 29
30#include <openssl/bn.h> 30#include <openssl/bn.h>
31#include <openssl/dh.h> 31#include <openssl/dh.h>
@@ -47,11 +47,16 @@ RCSID("$OpenBSD: monitor_wrap.c,v 1.24 2003/04/01 10:22:21 markus Exp $");
47#include "atomicio.h" 47#include "atomicio.h"
48#include "monitor_fdpass.h" 48#include "monitor_fdpass.h"
49#include "getput.h" 49#include "getput.h"
50#include "servconf.h"
50 51
51#include "auth.h" 52#include "auth.h"
52#include "channels.h" 53#include "channels.h"
53#include "session.h" 54#include "session.h"
54 55
56#ifdef GSSAPI
57#include "ssh-gss.h"
58#endif
59
55/* Imports */ 60/* Imports */
56extern int compat20; 61extern int compat20;
57extern Newkeys *newkeys[]; 62extern Newkeys *newkeys[];
@@ -59,6 +64,7 @@ extern z_stream incoming_stream;
59extern z_stream outgoing_stream; 64extern z_stream outgoing_stream;
60extern struct monitor *pmonitor; 65extern struct monitor *pmonitor;
61extern Buffer input, output; 66extern Buffer input, output;
67extern ServerOptions options;
62 68
63void 69void
64mm_request_send(int socket, enum monitor_reqtype type, Buffer *m) 70mm_request_send(int socket, enum monitor_reqtype type, Buffer *m)
@@ -70,9 +76,9 @@ mm_request_send(int socket, enum monitor_reqtype type, Buffer *m)
70 76
71 PUT_32BIT(buf, mlen + 1); 77 PUT_32BIT(buf, mlen + 1);
72 buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */ 78 buf[4] = (u_char) type; /* 1st byte of payload is mesg-type */
73 if (atomicio(write, socket, buf, sizeof(buf)) != sizeof(buf)) 79 if (atomicio(vwrite, socket, buf, sizeof(buf)) != sizeof(buf))
74 fatal("%s: write", __func__); 80 fatal("%s: write", __func__);
75 if (atomicio(write, socket, buffer_ptr(m), mlen) != mlen) 81 if (atomicio(vwrite, socket, buffer_ptr(m), mlen) != mlen)
76 fatal("%s: write", __func__); 82 fatal("%s: write", __func__);
77} 83}
78 84
@@ -520,6 +526,8 @@ mm_send_keystate(struct monitor *pmonitor)
520 Buffer m; 526 Buffer m;
521 u_char *blob, *p; 527 u_char *blob, *p;
522 u_int bloblen, plen; 528 u_int bloblen, plen;
529 u_int32_t seqnr, packets;
530 u_int64_t blocks;
523 531
524 buffer_init(&m); 532 buffer_init(&m);
525 533
@@ -568,8 +576,14 @@ mm_send_keystate(struct monitor *pmonitor)
568 buffer_put_string(&m, blob, bloblen); 576 buffer_put_string(&m, blob, bloblen);
569 xfree(blob); 577 xfree(blob);
570 578
571 buffer_put_int(&m, packet_get_seqnr(MODE_OUT)); 579 packet_get_state(MODE_OUT, &seqnr, &blocks, &packets);
572 buffer_put_int(&m, packet_get_seqnr(MODE_IN)); 580 buffer_put_int(&m, seqnr);
581 buffer_put_int64(&m, blocks);
582 buffer_put_int(&m, packets);
583 packet_get_state(MODE_IN, &seqnr, &blocks, &packets);
584 buffer_put_int(&m, seqnr);
585 buffer_put_int64(&m, blocks);
586 buffer_put_int(&m, packets);
573 587
574 debug3("%s: New keys have been sent", __func__); 588 debug3("%s: New keys have been sent", __func__);
575 skip: 589 skip:
@@ -661,6 +675,8 @@ mm_start_pam(char *user)
661 Buffer m; 675 Buffer m;
662 676
663 debug3("%s entering", __func__); 677 debug3("%s entering", __func__);
678 if (!options.use_pam)
679 fatal("UsePAM=no, but ended up in %s anyway", __func__);
664 680
665 buffer_init(&m); 681 buffer_init(&m);
666 buffer_put_cstring(&m, user); 682 buffer_put_cstring(&m, user);
@@ -669,6 +685,112 @@ mm_start_pam(char *user)
669 685
670 buffer_free(&m); 686 buffer_free(&m);
671} 687}
688
689u_int
690mm_do_pam_account(void)
691{
692 Buffer m;
693 u_int ret;
694
695 debug3("%s entering", __func__);
696 if (!options.use_pam)
697 fatal("UsePAM=no, but ended up in %s anyway", __func__);
698
699 buffer_init(&m);
700 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_ACCOUNT, &m);
701
702 mm_request_receive_expect(pmonitor->m_recvfd,
703 MONITOR_ANS_PAM_ACCOUNT, &m);
704 ret = buffer_get_int(&m);
705
706 buffer_free(&m);
707
708 debug3("%s returning %d", __func__, ret);
709
710 return (ret);
711}
712
713void *
714mm_sshpam_init_ctx(Authctxt *authctxt)
715{
716 Buffer m;
717 int success;
718
719 debug3("%s", __func__);
720 buffer_init(&m);
721 buffer_put_cstring(&m, authctxt->user);
722 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_INIT_CTX, &m);
723 debug3("%s: waiting for MONITOR_ANS_PAM_INIT_CTX", __func__);
724 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_INIT_CTX, &m);
725 success = buffer_get_int(&m);
726 if (success == 0) {
727 debug3("%s: pam_init_ctx failed", __func__);
728 buffer_free(&m);
729 return (NULL);
730 }
731 buffer_free(&m);
732 return (authctxt);
733}
734
735int
736mm_sshpam_query(void *ctx, char **name, char **info,
737 u_int *num, char ***prompts, u_int **echo_on)
738{
739 Buffer m;
740 int i, ret;
741
742 debug3("%s", __func__);
743 buffer_init(&m);
744 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_QUERY, &m);
745 debug3("%s: waiting for MONITOR_ANS_PAM_QUERY", __func__);
746 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_QUERY, &m);
747 ret = buffer_get_int(&m);
748 debug3("%s: pam_query returned %d", __func__, ret);
749 *name = buffer_get_string(&m, NULL);
750 *info = buffer_get_string(&m, NULL);
751 *num = buffer_get_int(&m);
752 *prompts = xmalloc((*num + 1) * sizeof(char *));
753 *echo_on = xmalloc((*num + 1) * sizeof(u_int));
754 for (i = 0; i < *num; ++i) {
755 (*prompts)[i] = buffer_get_string(&m, NULL);
756 (*echo_on)[i] = buffer_get_int(&m);
757 }
758 buffer_free(&m);
759 return (ret);
760}
761
762int
763mm_sshpam_respond(void *ctx, u_int num, char **resp)
764{
765 Buffer m;
766 int i, ret;
767
768 debug3("%s", __func__);
769 buffer_init(&m);
770 buffer_put_int(&m, num);
771 for (i = 0; i < num; ++i)
772 buffer_put_cstring(&m, resp[i]);
773 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_RESPOND, &m);
774 debug3("%s: waiting for MONITOR_ANS_PAM_RESPOND", __func__);
775 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_RESPOND, &m);
776 ret = buffer_get_int(&m);
777 debug3("%s: pam_respond returned %d", __func__, ret);
778 buffer_free(&m);
779 return (ret);
780}
781
782void
783mm_sshpam_free_ctx(void *ctxtp)
784{
785 Buffer m;
786
787 debug3("%s", __func__);
788 buffer_init(&m);
789 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_PAM_FREE_CTX, &m);
790 debug3("%s: waiting for MONITOR_ANS_PAM_FREE_CTX", __func__);
791 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_PAM_FREE_CTX, &m);
792 buffer_free(&m);
793}
672#endif /* USE_PAM */ 794#endif /* USE_PAM */
673 795
674/* Request process termination */ 796/* Request process termination */
@@ -949,73 +1071,69 @@ mm_auth_rsa_verify_response(Key *key, BIGNUM *p, u_char response[16])
949 return (success); 1071 return (success);
950} 1072}
951 1073
952#ifdef KRB4 1074#ifdef GSSAPI
953int 1075OM_uint32
954mm_auth_krb4(Authctxt *authctxt, void *_auth, char **client, void *_reply) 1076mm_ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid)
955{ 1077{
956 KTEXT auth, reply; 1078 Buffer m;
957 Buffer m; 1079 OM_uint32 major;
958 u_int rlen;
959 int success = 0;
960 char *p;
961 1080
962 debug3("%s entering", __func__); 1081 /* Client doesn't get to see the context */
963 auth = _auth; 1082 *ctx = NULL;
964 reply = _reply;
965 1083
966 buffer_init(&m); 1084 buffer_init(&m);
967 buffer_put_string(&m, auth->dat, auth->length); 1085 buffer_put_string(&m, oid->elements, oid->length);
968 1086
969 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KRB4, &m); 1087 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSETUP, &m);
970 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KRB4, &m); 1088 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSETUP, &m);
1089
1090 major = buffer_get_int(&m);
971 1091
972 success = buffer_get_int(&m);
973 if (success) {
974 *client = buffer_get_string(&m, NULL);
975 p = buffer_get_string(&m, &rlen);
976 if (rlen >= MAX_KTXT_LEN)
977 fatal("%s: reply from monitor too large", __func__);
978 reply->length = rlen;
979 memcpy(reply->dat, p, rlen);
980 memset(p, 0, rlen);
981 xfree(p);
982 }
983 buffer_free(&m); 1092 buffer_free(&m);
984 return (success); 1093 return (major);
985} 1094}
986#endif
987 1095
988#ifdef KRB5 1096OM_uint32
989int 1097mm_ssh_gssapi_accept_ctx(Gssctxt *ctx, gss_buffer_desc *in,
990mm_auth_krb5(void *ctx, void *argp, char **userp, void *resp) 1098 gss_buffer_desc *out, OM_uint32 *flags)
991{ 1099{
992 krb5_data *tkt, *reply;
993 Buffer m; 1100 Buffer m;
994 int success; 1101 OM_uint32 major;
995 1102 u_int len;
996 debug3("%s entering", __func__);
997 tkt = (krb5_data *) argp;
998 reply = (krb5_data *) resp;
999 1103
1000 buffer_init(&m); 1104 buffer_init(&m);
1001 buffer_put_string(&m, tkt->data, tkt->length); 1105 buffer_put_string(&m, in->value, in->length);
1002 1106
1003 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_KRB5, &m); 1107 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSSTEP, &m);
1004 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_KRB5, &m); 1108 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSSTEP, &m);
1005 1109
1006 success = buffer_get_int(&m); 1110 major = buffer_get_int(&m);
1007 if (success) { 1111 out->value = buffer_get_string(&m, &len);
1008 u_int len; 1112 out->length = len;
1113 if (flags)
1114 *flags = buffer_get_int(&m);
1009 1115
1010 *userp = buffer_get_string(&m, NULL); 1116 buffer_free(&m);
1011 reply->data = buffer_get_string(&m, &len); 1117
1012 reply->length = len; 1118 return (major);
1013 } else { 1119}
1014 memset(reply, 0, sizeof(*reply)); 1120
1015 *userp = NULL; 1121int
1016 } 1122mm_ssh_gssapi_userok(char *user)
1123{
1124 Buffer m;
1125 int authenticated = 0;
1126
1127 buffer_init(&m);
1128
1129 mm_request_send(pmonitor->m_recvfd, MONITOR_REQ_GSSUSEROK, &m);
1130 mm_request_receive_expect(pmonitor->m_recvfd, MONITOR_ANS_GSSUSEROK,
1131 &m);
1132
1133 authenticated = buffer_get_int(&m);
1017 1134
1018 buffer_free(&m); 1135 buffer_free(&m);
1019 return (success); 1136 debug3("%s: user %sauthenticated",__func__, authenticated ? "" : "not ");
1137 return (authenticated);
1020} 1138}
1021#endif 1139#endif /* GSSAPI */
diff --git a/monitor_wrap.h b/monitor_wrap.h
index d960a3d0b..5e0334588 100644
--- a/monitor_wrap.h
+++ b/monitor_wrap.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.h,v 1.8 2002/09/26 11:38:43 markus Exp $ */ 1/* $OpenBSD: monitor_wrap.h,v 1.11 2003/08/28 12:54:34 markus Exp $ */
2 2
3/* 3/*
4 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 4 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
@@ -55,8 +55,21 @@ int mm_auth_rsa_key_allowed(struct passwd *, BIGNUM *, Key **);
55int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *); 55int mm_auth_rsa_verify_response(Key *, BIGNUM *, u_char *);
56BIGNUM *mm_auth_rsa_generate_challenge(Key *); 56BIGNUM *mm_auth_rsa_generate_challenge(Key *);
57 57
58#ifdef GSSAPI
59#include "ssh-gss.h"
60OM_uint32 mm_ssh_gssapi_server_ctx(Gssctxt **ctxt, gss_OID oid);
61OM_uint32 mm_ssh_gssapi_accept_ctx(Gssctxt *ctxt,
62 gss_buffer_desc *recv, gss_buffer_desc *send, OM_uint32 *flags);
63int mm_ssh_gssapi_userok(char *user);
64#endif
65
58#ifdef USE_PAM 66#ifdef USE_PAM
59void mm_start_pam(char *); 67void mm_start_pam(char *);
68u_int mm_do_pam_account(void);
69void *mm_sshpam_init_ctx(struct Authctxt *);
70int mm_sshpam_query(void *, char **, char **, u_int *, char ***, u_int **);
71int mm_sshpam_respond(void *, u_int, char **);
72void mm_sshpam_free_ctx(void *);
60#endif 73#endif
61 74
62void mm_terminate(void); 75void mm_terminate(void);
@@ -83,16 +96,6 @@ int mm_bsdauth_respond(void *, u_int, char **);
83int mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **); 96int mm_skey_query(void *, char **, char **, u_int *, char ***, u_int **);
84int mm_skey_respond(void *, u_int, char **); 97int mm_skey_respond(void *, u_int, char **);
85 98
86/* auth_krb */
87#ifdef KRB4
88int mm_auth_krb4(struct Authctxt *, void *, char **, void *);
89#endif
90#ifdef KRB5
91/* auth and reply are really krb5_data objects, but we don't want to
92 * include all of the krb5 headers here */
93int mm_auth_krb5(void *authctxt, void *auth, char **client, void *reply);
94#endif
95
96/* zlib allocation hooks */ 99/* zlib allocation hooks */
97 100
98void *mm_zalloc(struct mm_master *, u_int, u_int); 101void *mm_zalloc(struct mm_master *, u_int, u_int);
diff --git a/msg.c b/msg.c
index 5d266c207..6a806c3f5 100644
--- a/msg.c
+++ b/msg.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: msg.c,v 1.5 2002/12/19 00:07:02 djm Exp $"); 25RCSID("$OpenBSD: msg.c,v 1.6 2003/06/28 16:23:06 deraadt Exp $");
26 26
27#include "buffer.h" 27#include "buffer.h"
28#include "getput.h" 28#include "getput.h"
@@ -40,9 +40,9 @@ ssh_msg_send(int fd, u_char type, Buffer *m)
40 40
41 PUT_32BIT(buf, mlen + 1); 41 PUT_32BIT(buf, mlen + 1);
42 buf[4] = type; /* 1st byte of payload is mesg-type */ 42 buf[4] = type; /* 1st byte of payload is mesg-type */
43 if (atomicio(write, fd, buf, sizeof(buf)) != sizeof(buf)) 43 if (atomicio(vwrite, fd, buf, sizeof(buf)) != sizeof(buf))
44 fatal("ssh_msg_send: write"); 44 fatal("ssh_msg_send: write");
45 if (atomicio(write, fd, buffer_ptr(m), mlen) != mlen) 45 if (atomicio(vwrite, fd, buffer_ptr(m), mlen) != mlen)
46 fatal("ssh_msg_send: write"); 46 fatal("ssh_msg_send: write");
47} 47}
48 48
diff --git a/myproposal.h b/myproposal.h
index 62f5cfb65..8b431d9d2 100644
--- a/myproposal.h
+++ b/myproposal.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: myproposal.h,v 1.14 2002/04/03 09:26:11 markus Exp $ */ 1/* $OpenBSD: myproposal.h,v 1.15 2003/05/17 04:27:52 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -27,7 +27,8 @@
27#define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss" 27#define KEX_DEFAULT_PK_ALG "ssh-rsa,ssh-dss"
28#define KEX_DEFAULT_ENCRYPT \ 28#define KEX_DEFAULT_ENCRYPT \
29 "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \ 29 "aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour," \
30 "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se" 30 "aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se," \
31 "aes128-ctr,aes192-ctr,aes256-ctr"
31#define KEX_DEFAULT_MAC \ 32#define KEX_DEFAULT_MAC \
32 "hmac-md5,hmac-sha1,hmac-ripemd160," \ 33 "hmac-md5,hmac-sha1,hmac-ripemd160," \
33 "hmac-ripemd160@openssh.com," \ 34 "hmac-ripemd160@openssh.com," \
diff --git a/nchan.c b/nchan.c
index bce7325b3..3138cdd19 100644
--- a/nchan.c
+++ b/nchan.c
@@ -23,7 +23,7 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: nchan.c,v 1.47 2002/06/19 00:27:55 deraadt Exp $"); 26RCSID("$OpenBSD: nchan.c,v 1.49 2003/08/29 10:04:36 markus Exp $");
27 27
28#include "ssh1.h" 28#include "ssh1.h"
29#include "ssh2.h" 29#include "ssh2.h"
@@ -83,7 +83,7 @@ chan_set_istate(Channel *c, u_int next)
83{ 83{
84 if (c->istate > CHAN_INPUT_CLOSED || next > CHAN_INPUT_CLOSED) 84 if (c->istate > CHAN_INPUT_CLOSED || next > CHAN_INPUT_CLOSED)
85 fatal("chan_set_istate: bad state %d -> %d", c->istate, next); 85 fatal("chan_set_istate: bad state %d -> %d", c->istate, next);
86 debug("channel %d: input %s -> %s", c->self, istates[c->istate], 86 debug2("channel %d: input %s -> %s", c->self, istates[c->istate],
87 istates[next]); 87 istates[next]);
88 c->istate = next; 88 c->istate = next;
89} 89}
@@ -92,7 +92,7 @@ chan_set_ostate(Channel *c, u_int next)
92{ 92{
93 if (c->ostate > CHAN_OUTPUT_CLOSED || next > CHAN_OUTPUT_CLOSED) 93 if (c->ostate > CHAN_OUTPUT_CLOSED || next > CHAN_OUTPUT_CLOSED)
94 fatal("chan_set_ostate: bad state %d -> %d", c->ostate, next); 94 fatal("chan_set_ostate: bad state %d -> %d", c->ostate, next);
95 debug("channel %d: output %s -> %s", c->self, ostates[c->ostate], 95 debug2("channel %d: output %s -> %s", c->self, ostates[c->ostate],
96 ostates[next]); 96 ostates[next]);
97 c->ostate = next; 97 c->ostate = next;
98} 98}
@@ -104,7 +104,7 @@ chan_set_ostate(Channel *c, u_int next)
104static void 104static void
105chan_rcvd_oclose1(Channel *c) 105chan_rcvd_oclose1(Channel *c)
106{ 106{
107 debug("channel %d: rcvd oclose", c->self); 107 debug2("channel %d: rcvd oclose", c->self);
108 switch (c->istate) { 108 switch (c->istate) {
109 case CHAN_INPUT_WAIT_OCLOSE: 109 case CHAN_INPUT_WAIT_OCLOSE:
110 chan_set_istate(c, CHAN_INPUT_CLOSED); 110 chan_set_istate(c, CHAN_INPUT_CLOSED);
@@ -128,7 +128,7 @@ chan_rcvd_oclose1(Channel *c)
128void 128void
129chan_read_failed(Channel *c) 129chan_read_failed(Channel *c)
130{ 130{
131 debug("channel %d: read failed", c->self); 131 debug2("channel %d: read failed", c->self);
132 switch (c->istate) { 132 switch (c->istate) {
133 case CHAN_INPUT_OPEN: 133 case CHAN_INPUT_OPEN:
134 chan_shutdown_read(c); 134 chan_shutdown_read(c);
@@ -143,7 +143,7 @@ chan_read_failed(Channel *c)
143void 143void
144chan_ibuf_empty(Channel *c) 144chan_ibuf_empty(Channel *c)
145{ 145{
146 debug("channel %d: ibuf empty", c->self); 146 debug2("channel %d: ibuf empty", c->self);
147 if (buffer_len(&c->input)) { 147 if (buffer_len(&c->input)) {
148 error("channel %d: chan_ibuf_empty for non empty buffer", 148 error("channel %d: chan_ibuf_empty for non empty buffer",
149 c->self); 149 c->self);
@@ -169,7 +169,7 @@ chan_ibuf_empty(Channel *c)
169static void 169static void
170chan_rcvd_ieof1(Channel *c) 170chan_rcvd_ieof1(Channel *c)
171{ 171{
172 debug("channel %d: rcvd ieof", c->self); 172 debug2("channel %d: rcvd ieof", c->self);
173 switch (c->ostate) { 173 switch (c->ostate) {
174 case CHAN_OUTPUT_OPEN: 174 case CHAN_OUTPUT_OPEN:
175 chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN); 175 chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN);
@@ -186,7 +186,7 @@ chan_rcvd_ieof1(Channel *c)
186static void 186static void
187chan_write_failed1(Channel *c) 187chan_write_failed1(Channel *c)
188{ 188{
189 debug("channel %d: write failed", c->self); 189 debug2("channel %d: write failed", c->self);
190 switch (c->ostate) { 190 switch (c->ostate) {
191 case CHAN_OUTPUT_OPEN: 191 case CHAN_OUTPUT_OPEN:
192 chan_shutdown_write(c); 192 chan_shutdown_write(c);
@@ -207,7 +207,7 @@ chan_write_failed1(Channel *c)
207void 207void
208chan_obuf_empty(Channel *c) 208chan_obuf_empty(Channel *c)
209{ 209{
210 debug("channel %d: obuf empty", c->self); 210 debug2("channel %d: obuf empty", c->self);
211 if (buffer_len(&c->output)) { 211 if (buffer_len(&c->output)) {
212 error("channel %d: chan_obuf_empty for non empty buffer", 212 error("channel %d: chan_obuf_empty for non empty buffer",
213 c->self); 213 c->self);
@@ -229,7 +229,7 @@ chan_obuf_empty(Channel *c)
229static void 229static void
230chan_send_ieof1(Channel *c) 230chan_send_ieof1(Channel *c)
231{ 231{
232 debug("channel %d: send ieof", c->self); 232 debug2("channel %d: send ieof", c->self);
233 switch (c->istate) { 233 switch (c->istate) {
234 case CHAN_INPUT_OPEN: 234 case CHAN_INPUT_OPEN:
235 case CHAN_INPUT_WAIT_DRAIN: 235 case CHAN_INPUT_WAIT_DRAIN:
@@ -246,7 +246,7 @@ chan_send_ieof1(Channel *c)
246static void 246static void
247chan_send_oclose1(Channel *c) 247chan_send_oclose1(Channel *c)
248{ 248{
249 debug("channel %d: send oclose", c->self); 249 debug2("channel %d: send oclose", c->self);
250 switch (c->ostate) { 250 switch (c->ostate) {
251 case CHAN_OUTPUT_OPEN: 251 case CHAN_OUTPUT_OPEN:
252 case CHAN_OUTPUT_WAIT_DRAIN: 252 case CHAN_OUTPUT_WAIT_DRAIN:
@@ -268,7 +268,7 @@ chan_send_oclose1(Channel *c)
268static void 268static void
269chan_rcvd_close2(Channel *c) 269chan_rcvd_close2(Channel *c)
270{ 270{
271 debug("channel %d: rcvd close", c->self); 271 debug2("channel %d: rcvd close", c->self);
272 if (c->flags & CHAN_CLOSE_RCVD) 272 if (c->flags & CHAN_CLOSE_RCVD)
273 error("channel %d: protocol error: close rcvd twice", c->self); 273 error("channel %d: protocol error: close rcvd twice", c->self);
274 c->flags |= CHAN_CLOSE_RCVD; 274 c->flags |= CHAN_CLOSE_RCVD;
@@ -301,7 +301,7 @@ chan_rcvd_close2(Channel *c)
301static void 301static void
302chan_rcvd_eof2(Channel *c) 302chan_rcvd_eof2(Channel *c)
303{ 303{
304 debug("channel %d: rcvd eof", c->self); 304 debug2("channel %d: rcvd eof", c->self);
305 c->flags |= CHAN_EOF_RCVD; 305 c->flags |= CHAN_EOF_RCVD;
306 if (c->ostate == CHAN_OUTPUT_OPEN) 306 if (c->ostate == CHAN_OUTPUT_OPEN)
307 chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN); 307 chan_set_ostate(c, CHAN_OUTPUT_WAIT_DRAIN);
@@ -309,7 +309,7 @@ chan_rcvd_eof2(Channel *c)
309static void 309static void
310chan_write_failed2(Channel *c) 310chan_write_failed2(Channel *c)
311{ 311{
312 debug("channel %d: write failed", c->self); 312 debug2("channel %d: write failed", c->self);
313 switch (c->ostate) { 313 switch (c->ostate) {
314 case CHAN_OUTPUT_OPEN: 314 case CHAN_OUTPUT_OPEN:
315 case CHAN_OUTPUT_WAIT_DRAIN: 315 case CHAN_OUTPUT_WAIT_DRAIN:
@@ -325,7 +325,7 @@ chan_write_failed2(Channel *c)
325static void 325static void
326chan_send_eof2(Channel *c) 326chan_send_eof2(Channel *c)
327{ 327{
328 debug("channel %d: send eof", c->self); 328 debug2("channel %d: send eof", c->self);
329 switch (c->istate) { 329 switch (c->istate) {
330 case CHAN_INPUT_WAIT_DRAIN: 330 case CHAN_INPUT_WAIT_DRAIN:
331 packet_start(SSH2_MSG_CHANNEL_EOF); 331 packet_start(SSH2_MSG_CHANNEL_EOF);
@@ -342,7 +342,7 @@ chan_send_eof2(Channel *c)
342static void 342static void
343chan_send_close2(Channel *c) 343chan_send_close2(Channel *c)
344{ 344{
345 debug("channel %d: send close", c->self); 345 debug2("channel %d: send close", c->self);
346 if (c->ostate != CHAN_OUTPUT_CLOSED || 346 if (c->ostate != CHAN_OUTPUT_CLOSED ||
347 c->istate != CHAN_INPUT_CLOSED) { 347 c->istate != CHAN_INPUT_CLOSED) {
348 error("channel %d: cannot send close for istate/ostate %d/%d", 348 error("channel %d: cannot send close for istate/ostate %d/%d",
@@ -398,13 +398,13 @@ int
398chan_is_dead(Channel *c, int send) 398chan_is_dead(Channel *c, int send)
399{ 399{
400 if (c->type == SSH_CHANNEL_ZOMBIE) { 400 if (c->type == SSH_CHANNEL_ZOMBIE) {
401 debug("channel %d: zombie", c->self); 401 debug2("channel %d: zombie", c->self);
402 return 1; 402 return 1;
403 } 403 }
404 if (c->istate != CHAN_INPUT_CLOSED || c->ostate != CHAN_OUTPUT_CLOSED) 404 if (c->istate != CHAN_INPUT_CLOSED || c->ostate != CHAN_OUTPUT_CLOSED)
405 return 0; 405 return 0;
406 if (!compat20) { 406 if (!compat20) {
407 debug("channel %d: is dead", c->self); 407 debug2("channel %d: is dead", c->self);
408 return 1; 408 return 1;
409 } 409 }
410 if ((datafellows & SSH_BUG_EXTEOF) && 410 if ((datafellows & SSH_BUG_EXTEOF) &&
@@ -421,7 +421,7 @@ chan_is_dead(Channel *c, int send)
421 } else { 421 } else {
422 /* channel would be dead if we sent a close */ 422 /* channel would be dead if we sent a close */
423 if (c->flags & CHAN_CLOSE_RCVD) { 423 if (c->flags & CHAN_CLOSE_RCVD) {
424 debug("channel %d: almost dead", 424 debug2("channel %d: almost dead",
425 c->self); 425 c->self);
426 return 1; 426 return 1;
427 } 427 }
@@ -429,7 +429,7 @@ chan_is_dead(Channel *c, int send)
429 } 429 }
430 if ((c->flags & CHAN_CLOSE_SENT) && 430 if ((c->flags & CHAN_CLOSE_SENT) &&
431 (c->flags & CHAN_CLOSE_RCVD)) { 431 (c->flags & CHAN_CLOSE_RCVD)) {
432 debug("channel %d: is dead", c->self); 432 debug2("channel %d: is dead", c->self);
433 return 1; 433 return 1;
434 } 434 }
435 return 0; 435 return 0;
@@ -443,15 +443,15 @@ chan_shutdown_write(Channel *c)
443 if (compat20 && c->type == SSH_CHANNEL_LARVAL) 443 if (compat20 && c->type == SSH_CHANNEL_LARVAL)
444 return; 444 return;
445 /* shutdown failure is allowed if write failed already */ 445 /* shutdown failure is allowed if write failed already */
446 debug("channel %d: close_write", c->self); 446 debug2("channel %d: close_write", c->self);
447 if (c->sock != -1) { 447 if (c->sock != -1) {
448 if (shutdown(c->sock, SHUT_WR) < 0) 448 if (shutdown(c->sock, SHUT_WR) < 0)
449 debug("channel %d: chan_shutdown_write: " 449 debug2("channel %d: chan_shutdown_write: "
450 "shutdown() failed for fd%d: %.100s", 450 "shutdown() failed for fd%d: %.100s",
451 c->self, c->sock, strerror(errno)); 451 c->self, c->sock, strerror(errno));
452 } else { 452 } else {
453 if (channel_close_fd(&c->wfd) < 0) 453 if (channel_close_fd(&c->wfd) < 0)
454 log("channel %d: chan_shutdown_write: " 454 logit("channel %d: chan_shutdown_write: "
455 "close() failed for fd%d: %.100s", 455 "close() failed for fd%d: %.100s",
456 c->self, c->wfd, strerror(errno)); 456 c->self, c->wfd, strerror(errno));
457 } 457 }
@@ -461,7 +461,7 @@ chan_shutdown_read(Channel *c)
461{ 461{
462 if (compat20 && c->type == SSH_CHANNEL_LARVAL) 462 if (compat20 && c->type == SSH_CHANNEL_LARVAL)
463 return; 463 return;
464 debug("channel %d: close_read", c->self); 464 debug2("channel %d: close_read", c->self);
465 if (c->sock != -1) { 465 if (c->sock != -1) {
466 /* 466 /*
467 * shutdown(sock, SHUT_READ) may return ENOTCONN if the 467 * shutdown(sock, SHUT_READ) may return ENOTCONN if the
@@ -476,7 +476,7 @@ chan_shutdown_read(Channel *c)
476 strerror(errno)); 476 strerror(errno));
477 } else { 477 } else {
478 if (channel_close_fd(&c->rfd) < 0) 478 if (channel_close_fd(&c->rfd) < 0)
479 log("channel %d: chan_shutdown_read: " 479 logit("channel %d: chan_shutdown_read: "
480 "close() failed for fd%d: %.100s", 480 "close() failed for fd%d: %.100s",
481 c->self, c->rfd, strerror(errno)); 481 c->self, c->rfd, strerror(errno));
482 } 482 }
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
index 8615e3633..c48593f7b 100644
--- a/openbsd-compat/Makefile.in
+++ b/openbsd-compat/Makefile.in
@@ -1,4 +1,4 @@
1# $Id: Makefile.in,v 1.25 2003/02/24 01:55:56 djm Exp $ 1# $Id: Makefile.in,v 1.28 2003/07/24 06:52:14 mouring Exp $
2 2
3sysconfdir=@sysconfdir@ 3sysconfdir=@sysconfdir@
4piddir=@piddir@ 4piddir=@piddir@
@@ -16,9 +16,9 @@ RANLIB=@RANLIB@
16INSTALL=@INSTALL@ 16INSTALL=@INSTALL@
17LDFLAGS=-L. @LDFLAGS@ 17LDFLAGS=-L. @LDFLAGS@
18 18
19OPENBSD=base64.o basename.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 vis.o 19OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o vis.o
20 20
21COMPAT=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 21COMPAT=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-rfc2553.o xmmap.o xcrypt.o
22 22
23PORTS=port-irix.o port-aix.o 23PORTS=port-irix.o port-aix.o
24 24
diff --git a/openbsd-compat/base64.h b/openbsd-compat/base64.h
index 72db3ffc7..732c6b3f8 100644
--- a/openbsd-compat/base64.h
+++ b/openbsd-compat/base64.h
@@ -1,23 +1,65 @@
1/* $Id: base64.h,v 1.4 2003/02/24 04:45:43 djm Exp $ */ 1/* $Id: base64.h,v 1.6 2003/08/29 16:59:52 mouring Exp $ */
2
3/*
4 * Copyright (c) 1996 by Internet Software Consortium.
5 *
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
9 *
10 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
11 * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
12 * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
13 * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
16 * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
17 * SOFTWARE.
18 */
19
20/*
21 * Portions Copyright (c) 1995 by International Business Machines, Inc.
22 *
23 * International Business Machines, Inc. (hereinafter called IBM) grants
24 * permission under its copyrights to use, copy, modify, and distribute this
25 * Software with or without fee, provided that the above copyright notice and
26 * all paragraphs of this notice appear in all copies, and that the name of IBM
27 * not be used in connection with the marketing of any product incorporating
28 * the Software or modifications thereof, without specific, written prior
29 * permission.
30 *
31 * To the extent it has a right to do so, IBM grants an immunity from suit
32 * under its patents, if any, for the use, sale or manufacture of products to
33 * the extent that such products are used for performing Domain Name System
34 * dynamic updates in TCP/IP networks by means of the Software. No immunity is
35 * granted for any product per se or for any other function of any product.
36 *
37 * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES,
38 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
39 * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL,
40 * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING
41 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN
42 * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES.
43 */
2 44
3#ifndef _BSD_BASE64_H 45#ifndef _BSD_BASE64_H
4#define _BSD_BASE64_H 46#define _BSD_BASE64_H
5 47
6#include "config.h" 48#include "includes.h"
7 49
8#ifndef HAVE___B64_NTOP 50#ifndef HAVE___B64_NTOP
9# ifndef HAVE_B64_NTOP 51# ifndef HAVE_B64_NTOP
10int b64_ntop(u_char const *src, size_t srclength, char *target, 52int b64_ntop(u_char const *src, size_t srclength, char *target,
11 size_t targsize); 53 size_t targsize);
12# endif /* !HAVE_B64_NTOP */ 54# endif /* !HAVE_B64_NTOP */
13# define __b64_ntop b64_ntop 55# define __b64_ntop(a,b,c,d) b64_ntop(a,b,c,d)
14#endif /* HAVE___B64_NTOP */ 56#endif /* HAVE___B64_NTOP */
15 57
16#ifndef HAVE___B64_PTON 58#ifndef HAVE___B64_PTON
17# ifndef HAVE_B64_PTON 59# ifndef HAVE_B64_PTON
18int b64_pton(char const *src, u_char *target, size_t targsize); 60int b64_pton(char const *src, u_char *target, size_t targsize);
19# endif /* !HAVE_B64_PTON */ 61# endif /* !HAVE_B64_PTON */
20# define __b64_pton b64_pton 62# define __b64_pton(a,b,c) b64_pton(a,b,c)
21#endif /* HAVE___B64_PTON */ 63#endif /* HAVE___B64_PTON */
22 64
23#endif /* _BSD_BASE64_H */ 65#endif /* _BSD_BASE64_H */
diff --git a/openbsd-compat/basename.c b/openbsd-compat/basename.c
index 5a3823bc5..2054c8068 100644
--- a/openbsd-compat/basename.c
+++ b/openbsd-compat/basename.c
@@ -1,37 +1,26 @@
1/* $OpenBSD: basename.c,v 1.8 2002/06/09 05:03:59 deraadt Exp $ */ 1/* $OpenBSD: basename.c,v 1.11 2003/06/17 21:56:23 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
5 * All rights reserved.
6 * 5 *
7 * Redistribution and use in source and binary forms, with or without 6 * Permission to use, copy, modify, and distribute this software for any
8 * modification, are permitted provided that the following conditions 7 * purpose with or without fee is hereby granted, provided that the above
9 * are met: 8 * copyright notice and this permission notice appear in all copies.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 9 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 17 */
29#include "includes.h"
30 18
31#if !defined(HAVE_BASENAME) 19#include "includes.h"
20#ifndef HAVE_BASENAME
32 21
33#ifndef lint 22#ifndef lint
34static char rcsid[] = "$OpenBSD: basename.c,v 1.8 2002/06/09 05:03:59 deraadt Exp $"; 23static char rcsid[] = "$OpenBSD: basename.c,v 1.11 2003/06/17 21:56:23 millert Exp $";
35#endif /* not lint */ 24#endif /* not lint */
36 25
37char * 26char *
diff --git a/openbsd-compat/bindresvport.c b/openbsd-compat/bindresvport.c
index 620f980ed..8a273f9b5 100644
--- a/openbsd-compat/bindresvport.c
+++ b/openbsd-compat/bindresvport.c
@@ -1,48 +1,37 @@
1/* This file has be modified from the original OpenBSD source */ 1/* This file has be substantially modified from the original OpenBSD source */
2
3/* $OpenBSD: bindresvport.c,v 1.15 2003/05/20 22:42:35 deraadt Exp $ */
2 4
3/* 5/*
4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 6 * Copyright 1996, Jason Downs. All rights reserved.
5 * unrestricted use provided that this legend is included on all tape 7 * Copyright 1998, Theo de Raadt. All rights reserved.
6 * media and as a part of the software program in whole or part. Users 8 * Copyright 2000, Damien Miller. All rights reserved.
7 * may copy or modify Sun RPC without charge, but are not authorized 9 *
8 * to license or distribute it to anyone else except as part of a product or 10 * Redistribution and use in source and binary forms, with or without
9 * program developed by the user. 11 * modification, are permitted provided that the following conditions
10 * 12 * are met:
11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 13 * 1. Redistributions of source code must retain the above copyright
12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 14 * notice, this list of conditions and the following disclaimer.
13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 15 * 2. Redistributions in binary form must reproduce the above copyright
14 * 16 * notice, this list of conditions and the following disclaimer in the
15 * Sun RPC is provided with no support and without any obligation on the 17 * documentation and/or other materials provided with the distribution.
16 * part of Sun Microsystems, Inc. to assist in its use, correction, 18 *
17 * modification or enhancement. 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * 20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 22 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * OR ANY PART THEREOF. 23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * 24 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * or profits or other special, indirect and consequential damages, even if 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * Sun has been advised of the possibility of such damages. 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * 28 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * Sun Microsystems, Inc.
28 * 2550 Garcia Avenue
29 * Mountain View, California 94043
30 */ 29 */
31 30
32#include "includes.h" 31#include "includes.h"
33 32
34#ifndef HAVE_BINDRESVPORT_SA 33#ifndef HAVE_BINDRESVPORT_SA
35 34
36#if defined(LIBC_SCCS) && !defined(lint)
37static char *rcsid = "$OpenBSD: bindresvport.c,v 1.13 2000/01/26 03:43:21 deraadt Exp $";
38#endif /* LIBC_SCCS and not lint */
39
40/*
41 * Copyright (c) 1987 by Sun Microsystems, Inc.
42 *
43 * Portions Copyright(C) 1996, Jason Downs. All rights reserved.
44 */
45
46#include "includes.h" 35#include "includes.h"
47 36
48#define STARTPORT 600 37#define STARTPORT 600
diff --git a/openbsd-compat/bsd-arc4random.c b/openbsd-compat/bsd-arc4random.c
index dd08130d5..5f890968e 100644
--- a/openbsd-compat/bsd-arc4random.c
+++ b/openbsd-compat/bsd-arc4random.c
@@ -25,7 +25,7 @@
25#include "includes.h" 25#include "includes.h"
26#include "log.h" 26#include "log.h"
27 27
28RCSID("$Id: bsd-arc4random.c,v 1.6 2003/03/17 05:13:53 djm Exp $"); 28RCSID("$Id: bsd-arc4random.c,v 1.7 2003/05/18 14:13:38 djm Exp $");
29 29
30#ifndef HAVE_ARC4RANDOM 30#ifndef HAVE_ARC4RANDOM
31 31
@@ -70,6 +70,7 @@ void arc4random_stir(void)
70 fatal("Couldn't obtain random bytes (error %ld)", 70 fatal("Couldn't obtain random bytes (error %ld)",
71 ERR_get_error()); 71 ERR_get_error());
72 RC4_set_key(&rc4, sizeof(rand_buf), rand_buf); 72 RC4_set_key(&rc4, sizeof(rand_buf), rand_buf);
73 RC4(&rc4, sizeof(rand_buf), rand_buf, rand_buf);
73 memset(rand_buf, 0, sizeof(rand_buf)); 74 memset(rand_buf, 0, sizeof(rand_buf));
74 75
75 rc4_ready = REKEY_BYTES; 76 rc4_ready = REKEY_BYTES;
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index edb3112b3..f2ac428cc 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * $Id: bsd-cray.c,v 1.8 2002/09/26 00:38:51 tim Exp $ 2 * $Id: bsd-cray.c,v 1.12 2003/06/03 02:45:27 dtucker Exp $
3 * 3 *
4 * bsd-cray.c 4 * bsd-cray.c
5 * 5 *
@@ -67,10 +67,10 @@
67 67
68extern ServerOptions options; 68extern ServerOptions options;
69 69
70char cray_tmpdir[TPATHSIZ+1]; /* job TMPDIR path */ 70char cray_tmpdir[TPATHSIZ + 1]; /* job TMPDIR path */
71 71
72struct sysv sysv; /* system security structure */ 72struct sysv sysv; /* system security structure */
73struct usrv usrv; /* user security structure */ 73struct usrv usrv; /* user security structure */
74 74
75/* 75/*
76 * Functions. 76 * Functions.
@@ -86,39 +86,40 @@ int cray_access_denied(char *);
86void 86void
87cray_login_failure(char *username, int errcode) 87cray_login_failure(char *username, int errcode)
88{ 88{
89 struct udb *ueptr; /* UDB pointer for username */ 89 struct udb *ueptr; /* UDB pointer for username */
90 ia_failure_t fsent; /* ia_failure structure */ 90 ia_failure_t fsent; /* ia_failure structure */
91 ia_failure_ret_t fret; /* ia_failure return stuff */ 91 ia_failure_ret_t fret; /* ia_failure return stuff */
92 struct jtab jtab; /* job table structure */ 92 struct jtab jtab; /* job table structure */
93 int jid = 0; /* job id */ 93 int jid = 0; /* job id */
94 94
95 if ((jid = getjtab(&jtab)) < 0) { 95 if ((jid = getjtab(&jtab)) < 0)
96 debug("cray_login_failure(): getjtab error"); 96 debug("cray_login_failure(): getjtab error");
97 } 97
98 getsysudb(); 98 getsysudb();
99 if ((ueptr = getudbnam(username)) == UDB_NULL) { 99 if ((ueptr = getudbnam(username)) == UDB_NULL)
100 debug("cray_login_failure(): getudbname() returned NULL"); 100 debug("cray_login_failure(): getudbname() returned NULL");
101 }
102 endudb(); 101 endudb();
103 fsent.revision = 0; 102
104 fsent.uname = username; 103 memset(&fsent, '\0', sizeof(fsent));
105 fsent.host = (char *)get_canonical_hostname(options.verify_reverse_mapping); 104 fsent.revision = 0;
106 fsent.ttyn = "sshd"; 105 fsent.uname = username;
107 fsent.caller = IA_SSHD; 106 fsent.host = (char *)get_canonical_hostname(options.use_dns);
108 fsent.flags = IA_INTERACTIVE; 107 fsent.ttyn = "sshd";
109 fsent.ueptr = ueptr; 108 fsent.caller = IA_SSHD;
110 fsent.jid = jid; 109 fsent.flags = IA_INTERACTIVE;
111 fsent.errcode = errcode; 110 fsent.ueptr = ueptr;
112 fsent.pwdp = NULL; 111 fsent.jid = jid;
113 fsent.exitcode = 0; /* dont exit in ia_failure() */ 112 fsent.errcode = errcode;
114 113 fsent.pwdp = NULL;
115 fret.revision = 0; 114 fsent.exitcode = 0; /* dont exit in ia_failure() */
116 fret.normal = 0; 115
116 fret.revision = 0;
117 fret.normal = 0;
117 118
118 /* 119 /*
119 * Call ia_failure because of an login failure. 120 * Call ia_failure because of an login failure.
120 */ 121 */
121 ia_failure(&fsent,&fret); 122 ia_failure(&fsent, &fret);
122} 123}
123 124
124/* 125/*
@@ -127,338 +128,316 @@ cray_login_failure(char *username, int errcode)
127int 128int
128cray_access_denied(char *username) 129cray_access_denied(char *username)
129{ 130{
130 struct udb *ueptr; /* UDB pointer for username */ 131 struct udb *ueptr; /* UDB pointer for username */
131 int errcode; /* IA errorcode */ 132 int errcode; /* IA errorcode */
132 133
133 errcode = 0; 134 errcode = 0;
134 getsysudb(); 135 getsysudb();
135 if ((ueptr = getudbnam(username)) == UDB_NULL) { 136 if ((ueptr = getudbnam(username)) == UDB_NULL)
136 debug("cray_login_failure(): getudbname() returned NULL"); 137 debug("cray_login_failure(): getudbname() returned NULL");
137 }
138 endudb(); 138 endudb();
139 if (ueptr && ueptr->ue_disabled) 139
140 if (ueptr != NULL && ueptr->ue_disabled)
140 errcode = IA_DISABLED; 141 errcode = IA_DISABLED;
141 if (errcode) 142 if (errcode)
142 cray_login_failure(username, errcode); 143 cray_login_failure(username, errcode);
144
143 return (errcode); 145 return (errcode);
144} 146}
145 147
148/*
149 * record_failed_login: generic "login failed" interface function
150 */
151void
152record_failed_login(const char *user, const char *ttyname)
153{
154 cray_login_failure((char *)user, IA_UDBERR);
155}
156
146int 157int
147cray_setup (uid_t uid, char *username, const char *command) 158cray_setup (uid_t uid, char *username, const char *command)
148{ 159{
149 extern struct udb *getudb(); 160 extern struct udb *getudb();
150 extern char *setlimits(); 161 extern char *setlimits();
151 162
152 int err; /* error return */ 163 int err; /* error return */
153 time_t system_time; /* current system clock */ 164 time_t system_time; /* current system clock */
154 time_t expiration_time; /* password expiration time */ 165 time_t expiration_time; /* password expiration time */
155 int maxattempts; /* maximum no. of failed login attempts */ 166 int maxattempts; /* maximum no. of failed login attempts */
156 int SecureSys; /* unicos security flag */ 167 int SecureSys; /* unicos security flag */
157 int minslevel = 0; /* system minimum security level */ 168 int minslevel = 0; /* system minimum security level */
158 int i, j; 169 int i, j;
159 int valid_acct = -1; /* flag for reading valid acct */ 170 int valid_acct = -1; /* flag for reading valid acct */
160 char acct_name[MAXACID] = { "" }; /* used to read acct name */ 171 char acct_name[MAXACID] = { "" }; /* used to read acct name */
161 struct jtab jtab; /* Job table struct */ 172 struct jtab jtab; /* Job table struct */
162 struct udb ue; /* udb entry for logging-in user */ 173 struct udb ue; /* udb entry for logging-in user */
163 struct udb *up; /* pointer to UDB entry */ 174 struct udb *up; /* pointer to UDB entry */
164 struct secstat secinfo; /* file security attributes */ 175 struct secstat secinfo; /* file security attributes */
165 struct servprov init_info; /* used for sesscntl() call */ 176 struct servprov init_info; /* used for sesscntl() call */
166 int jid; /* job ID */ 177 int jid; /* job ID */
167 int pid; /* process ID */ 178 int pid; /* process ID */
168 char *sr; /* status return from setlimits() */ 179 char *sr; /* status return from setlimits() */
169 char *ttyn = NULL; /* ttyname or command name*/ 180 char *ttyn = NULL; /* ttyname or command name*/
170 char hostname[MAXHOSTNAMELEN]; 181 char hostname[MAXHOSTNAMELEN];
171 passwd_t pwdacm, 182 /* passwd stuff for ia_user */
172 pwddialup, 183 passwd_t pwdacm, pwddialup, pwdudb, pwdwal, pwddce;
173 pwdudb, 184 ia_user_ret_t uret; /* stuff returned from ia_user */
174 pwdwal, 185 ia_user_t usent /* ia_user main structure */
175 pwddce; /* passwd stuff for ia_user */ 186 int ia_rcode; /* ia_user return code */
176 ia_user_ret_t uret; /* stuff returned from ia_user */ 187 ia_failure_t fsent; /* ia_failure structure */
177 ia_user_t usent; /* ia_user main structure */
178 int ia_rcode; /* ia_user return code */
179 ia_failure_t fsent; /* ia_failure structure */
180 ia_failure_ret_t fret; /* ia_failure return stuff */ 188 ia_failure_ret_t fret; /* ia_failure return stuff */
181 ia_success_t ssent; /* ia_success structure */ 189 ia_success_t ssent; /* ia_success structure */
182 ia_success_ret_t sret; /* ia_success return stuff */ 190 ia_success_ret_t sret; /* ia_success return stuff */
183 int ia_mlsrcode; /* ia_mlsuser return code */ 191 int ia_mlsrcode; /* ia_mlsuser return code */
184 int secstatrc; /* [f]secstat return code */ 192 int secstatrc; /* [f]secstat return code */
185 193
186 if (SecureSys = (int)sysconf(_SC_CRAY_SECURE_SYS)) { 194 if (SecureSys = (int)sysconf(_SC_CRAY_SECURE_SYS)) {
187 getsysv(&sysv, sizeof(struct sysv)); 195 getsysv(&sysv, sizeof(struct sysv));
188 minslevel = sysv.sy_minlvl; 196 minslevel = sysv.sy_minlvl;
189 if (getusrv(&usrv) < 0) { 197 if (getusrv(&usrv) < 0)
190 debug("getusrv() failed, errno = %d",errno); 198 fatal("getusrv() failed, errno = %d", errno);
191 exit(1);
192 }
193 } 199 }
194 hostname[0] = '\0'; 200 hostname[0] = '\0';
195 strncpy(hostname, 201 strlcpy(hostname,
196 (char *)get_canonical_hostname(options.verify_reverse_mapping), 202 (char *)get_canonical_hostname(options.use_dns),
197 MAXHOSTNAMELEN); 203 MAXHOSTNAMELEN);
198 /* 204 /*
199 * Fetch user's UDB entry. 205 * Fetch user's UDB entry.
200 */ 206 */
201 getsysudb(); 207 getsysudb();
202 if ((up = getudbnam(username)) == UDB_NULL) { 208 if ((up = getudbnam(username)) == UDB_NULL)
203 debug("cannot fetch user's UDB entry"); 209 fatal("cannot fetch user's UDB entry");
204 exit(1); 210
205 } 211 /*
206 212 * Prevent any possible fudging so perform a data
207 /* 213 * safety check and compare the supplied uid against
208 * Prevent any possible fudging so perform a data 214 * the udb's uid.
209 * safety check and compare the supplied uid against 215 */
210 * the udb's uid. 216 if (up->ue_uid != uid)
211 */ 217 fatal("IA uid missmatch");
212 if (up->ue_uid != uid) {
213 debug("IA uid missmatch");
214 exit(1);
215 }
216 endudb(); 218 endudb();
217 219
218 if ((jid = getjtab (&jtab)) < 0) { 220 if ((jid = getjtab(&jtab)) < 0) {
219 debug("getjtab"); 221 debug("getjtab");
220 return -1; 222 return(-1);
221 } 223 }
222 pid = getpid(); 224 pid = getpid();
223 ttyn = ttyname(0); 225 ttyn = ttyname(0);
224 if (SecureSys) { 226 if (SecureSys) {
225 if (ttyn) { 227 if (ttyn != NULL)
226 secstatrc = secstat(ttyn, &secinfo); 228 secstatrc = secstat(ttyn, &secinfo);
227 } else { 229 else
228 secstatrc = fsecstat(1, &secinfo); 230 secstatrc = fsecstat(1, &secinfo);
229 } 231
230 if (secstatrc == 0) { 232 if (secstatrc == 0)
231 debug("[f]secstat() successful"); 233 debug("[f]secstat() successful");
232 } else { 234 else
233 debug("[f]secstat() error, rc = %d", secstatrc); 235 fatal("[f]secstat() error, rc = %d", secstatrc);
234 exit(1);
235 }
236 } 236 }
237 if ((ttyn == NULL) && ((char *)command != NULL)) 237 if ((ttyn == NULL) && ((char *)command != NULL))
238 ttyn = (char *)command; 238 ttyn = (char *)command;
239 /* 239 /*
240 * Initialize all structures to call ia_user 240 * Initialize all structures to call ia_user
241 */ 241 */
242 usent.revision = 0; 242 usent.revision = 0;
243 usent.uname = username; 243 usent.uname = username;
244 usent.host = hostname; 244 usent.host = hostname;
245 usent.ttyn = ttyn; 245 usent.ttyn = ttyn;
246 usent.caller = IA_SSHD; 246 usent.caller = IA_SSHD;
247 usent.pswdlist = &pwdacm; 247 usent.pswdlist = &pwdacm;
248 usent.ueptr = &ue; 248 usent.ueptr = &ue;
249 usent.flags = IA_INTERACTIVE | IA_FFLAG; 249 usent.flags = IA_INTERACTIVE | IA_FFLAG;
250 pwdacm.atype = IA_SECURID; 250 pwdacm.atype = IA_SECURID;
251 pwdacm.pwdp = NULL; 251 pwdacm.pwdp = NULL;
252 pwdacm.next = &pwdudb; 252 pwdacm.next = &pwdudb;
253 253
254 pwdudb.atype = IA_UDB; 254 pwdudb.atype = IA_UDB;
255 pwdudb.pwdp = NULL; 255 pwdudb.pwdp = NULL;
256 pwdudb.next = &pwddce; 256 pwdudb.next = &pwddce;
257 257
258 pwddce.atype = IA_DCE; 258 pwddce.atype = IA_DCE;
259 pwddce.pwdp = NULL; 259 pwddce.pwdp = NULL;
260 pwddce.next = &pwddialup; 260 pwddce.next = &pwddialup;
261 261
262 pwddialup.atype = IA_DIALUP; 262 pwddialup.atype = IA_DIALUP;
263 pwddialup.pwdp = NULL; 263 pwddialup.pwdp = NULL;
264 /* pwddialup.next = &pwdwal; */ 264 /* pwddialup.next = &pwdwal; */
265 pwddialup.next = NULL; 265 pwddialup.next = NULL;
266 266
267 pwdwal.atype = IA_WAL; 267 pwdwal.atype = IA_WAL;
268 pwdwal.pwdp = NULL; 268 pwdwal.pwdp = NULL;
269 pwdwal.next = NULL; 269 pwdwal.next = NULL;
270 270
271 uret.revision = 0; 271 uret.revision = 0;
272 uret.pswd = NULL; 272 uret.pswd = NULL;
273 uret.normal = 0; 273 uret.normal = 0;
274 274
275 ia_rcode = ia_user(&usent, &uret); 275 ia_rcode = ia_user(&usent, &uret);
276 276 switch (ia_rcode) {
277 switch (ia_rcode) { 277 /*
278 /* 278 * These are acceptable return codes from ia_user()
279 * These are acceptable return codes from ia_user() 279 */
280 */ 280 case IA_UDBWEEK: /* Password Expires in 1 week */
281 case IA_UDBWEEK: /* Password Expires in 1 week */ 281 expiration_time = ue.ue_pwage.time + ue.ue_pwage.maxage;
282 expiration_time = ue.ue_pwage.time + ue.ue_pwage.maxage; 282 printf ("WARNING - your current password will expire %s\n",
283 printf ("WARNING - your current password will expire %s\n", 283 ctime((const time_t *)&expiration_time));
284 ctime((const time_t *)&expiration_time)); 284 break;
285 break; 285 case IA_UDBEXPIRED:
286 case IA_UDBEXPIRED: 286 if (ttyname(0) != NULL) {
287 if (ttyname(0) != NULL) { 287 /* Force a password change */
288 /* Force a password change */ 288 printf("Your password has expired; Choose a new one.\n");
289 printf("Your password has expired; Choose a new one.\n"); 289 execl("/bin/passwd", "passwd", username, 0);
290 execl("/bin/passwd", "passwd", username, 0); 290 exit(9);
291 exit(9); 291 }
292 } 292 break;
293 293 case IA_NORMAL: /* Normal Return Code */
294 break; 294 break;
295 case IA_NORMAL: /* Normal Return Code */ 295 case IA_BACKDOOR:
296 break; 296 /* XXX: can we memset it to zero here so save some of this */
297 case IA_BACKDOOR: 297 strlcpy(ue.ue_name, "root", sizeof(ue.ue_name));
298 strcpy(ue.ue_name, "root"); 298 strlcpy(ue.ue_dir, "/", sizeof(ue.ue_dir));
299 strcpy(ue.ue_passwd, ""); 299 strlcpy(ue.ue_shell, "/bin/sh", sizeof(ue.ue_shell));
300 strcpy(ue.ue_dir, "/"); 300
301 strcpy(ue.ue_shell, "/bin/sh"); 301 ue.ue_passwd[0] = '\0';
302 strcpy(ue.ue_age, ""); 302 ue.ue_age[0] = '\0';
303 strcpy(ue.ue_comment, ""); 303 ue.ue_comment[0] = '\0';
304 strcpy(ue.ue_loghost, ""); 304 ue.ue_loghost[0] = '\0';
305 strcpy(ue.ue_logline, ""); 305 ue.ue_logline[0] = '\0';
306 ue.ue_uid=-1; 306
307 ue.ue_nice[UDBRC_INTER]=0; 307 ue.ue_uid = -1;
308 for (i=0;i<MAXVIDS;i++) 308 ue.ue_nice[UDBRC_INTER] = 0;
309 ue.ue_gids[i]=0; 309
310 ue.ue_logfails=0; 310 for (i = 0; i < MAXVIDS; i++)
311 ue.ue_minlvl=minslevel; 311 ue.ue_gids[i] = 0;
312 ue.ue_maxlvl=minslevel; 312
313 ue.ue_deflvl=minslevel; 313 ue.ue_logfails = 0;
314 ue.ue_defcomps=0; 314 ue.ue_minlvl = ue.ue_maxlvl = ue.ue_deflvl = minslevel;
315 ue.ue_comparts=0; 315 ue.ue_defcomps = 0;
316 ue.ue_permits=0; 316 ue.ue_comparts = 0;
317 ue.ue_trap=0; 317 ue.ue_permits = 0;
318 ue.ue_disabled=0; 318 ue.ue_trap = 0;
319 ue.ue_logtime=0; 319 ue.ue_disabled = 0;
320 break; 320 ue.ue_logtime = 0;
321 case IA_CONSOLE: /* Superuser not from Console */ 321 break;
322 case IA_TRUSTED: /* Trusted user */ 322 case IA_CONSOLE: /* Superuser not from Console */
323 if (options.permit_root_login > PERMIT_NO) 323 case IA_TRUSTED: /* Trusted user */
324 break; /* Accept root login */ 324 if (options.permit_root_login > PERMIT_NO)
325 default: 325 break; /* Accept root login */
326 /* 326 default:
327 * These are failed return codes from ia_user() 327 /*
328 */ 328 * These are failed return codes from ia_user()
329 switch (ia_rcode) 329 */
330 { 330 switch (ia_rcode)
331 case IA_BADAUTH: 331 {
332 printf ("Bad authorization, access denied.\n"); 332 case IA_BADAUTH:
333 break; 333 printf("Bad authorization, access denied.\n");
334 case IA_DIALUPERR: 334 break;
335 break; 335 case IA_DISABLED:
336 case IA_DISABLED: 336 printf("Your login has been disabled. Contact the system ");
337 printf ("Your login has been disabled. Contact the system "); 337 printf("administrator for assistance.\n");
338 printf ("administrator for assistance.\n"); 338 break;
339 break; 339 case IA_GETSYSV:
340 case IA_GETSYSV: 340 printf("getsysv() failed - errno = %d\n", errno);
341 printf ("getsysv() failed - errno = %d\n", errno); 341 break;
342 break; 342 case IA_MAXLOGS:
343 case IA_LOCALHOST: 343 printf("Maximum number of failed login attempts exceeded.\n");
344 break; 344 printf("Access denied.\n");
345 case IA_MAXLOGS: 345 break;
346 printf ("Maximum number of failed login attempts exceeded.\n"); 346 case IA_UDBPWDNULL:
347 printf ("Access denied.\n"); 347 if (SecureSys)
348 break; 348 printf("NULL Password not allowed on MLS systems.\n");
349 case IA_NOPASS: 349 break;
350 break; 350 default:
351 case IA_PUBLIC: 351 break;
352 break; 352 }
353 case IA_SECURIDERR: 353
354 break; 354 /*
355 case IA_CONSOLE: 355 * Authentication failed.
356 break; 356 */
357 case IA_TRUSTED: 357 printf("sshd: Login incorrect, (0%o)\n",
358 break; 358 ia_rcode-IA_ERRORCODE);
359 case IA_UDBERR: 359
360 break; 360 /*
361 case IA_UDBPWDNULL: 361 * Initialize structure for ia_failure
362 /* 362 * which will exit.
363 * NULL password not allowed on MLS systems 363 */
364 */ 364 fsent.revision = 0;
365 if (SecureSys) { 365 fsent.uname = username;
366 printf("NULL Password not allowed on MLS systems.\n"); 366 fsent.host = hostname;
367 } 367 fsent.ttyn = ttyn;
368 break; 368 fsent.caller = IA_SSHD;
369 case IA_UNKNOWN: 369 fsent.flags = IA_INTERACTIVE;
370 break; 370 fsent.ueptr = &ue;
371 case IA_UNKNOWNYP: 371 fsent.jid = jid;
372 break; 372 fsent.errcode = ia_rcode;
373 case IA_WALERR: 373 fsent.pwdp = uret.pswd;
374 break; 374 fsent.exitcode = 1;
375 default: 375
376 /* nothing special */ 376 fret.revision = 0;
377 ; 377 fret.normal = 0;
378 } /* 2. switch (ia_rcode) */ 378
379 /* 379 /*
380 * Authentication failed. 380 * Call ia_failure because of an IA failure.
381 */ 381 * There is no return because ia_failure exits.
382 printf("sshd: Login incorrect, (0%o)\n", 382 */
383 ia_rcode-IA_ERRORCODE); 383 ia_failure(&fsent, &fret);
384 384
385 /* 385 exit(1);
386 * Initialize structure for ia_failure 386 }
387 * which will exit. 387
388 */
389 fsent.revision = 0;
390 fsent.uname = username;
391 fsent.host = hostname;
392 fsent.ttyn = ttyn;
393 fsent.caller = IA_SSHD;
394 fsent.flags = IA_INTERACTIVE;
395 fsent.ueptr = &ue;
396 fsent.jid = jid;
397 fsent.errcode = ia_rcode;
398 fsent.pwdp = uret.pswd;
399 fsent.exitcode = 1;
400
401 fret.revision = 0;
402 fret.normal = 0;
403
404 /*
405 * Call ia_failure because of an IA failure.
406 * There is no return because ia_failure exits.
407 */
408
409 ia_failure(&fsent,&fret);
410
411 exit(1);
412 } /* 1. switch (ia_rcode) */
413 ia_mlsrcode = IA_NORMAL; 388 ia_mlsrcode = IA_NORMAL;
414 if (SecureSys) { 389 if (SecureSys) {
415 debug("calling ia_mlsuser()"); 390 debug("calling ia_mlsuser()");
416 ia_mlsrcode = ia_mlsuser (&ue, &secinfo, &usrv, NULL, 0); 391 ia_mlsrcode = ia_mlsuser(&ue, &secinfo, &usrv, NULL, 0);
417 } 392 }
418 if (ia_mlsrcode != IA_NORMAL) { 393 if (ia_mlsrcode != IA_NORMAL) {
419 printf("sshd: Login incorrect, (0%o)\n", 394 printf("sshd: Login incorrect, (0%o)\n",
420 ia_mlsrcode-IA_ERRORCODE); 395 ia_mlsrcode-IA_ERRORCODE);
421 /* 396 /*
422 * Initialize structure for ia_failure 397 * Initialize structure for ia_failure
423 * which will exit. 398 * which will exit.
424 */ 399 */
425 fsent.revision = 0; 400 fsent.revision = 0;
426 fsent.uname = username; 401 fsent.uname = username;
427 fsent.host = hostname; 402 fsent.host = hostname;
428 fsent.ttyn = ttyn; 403 fsent.ttyn = ttyn;
429 fsent.caller = IA_SSHD; 404 fsent.caller = IA_SSHD;
430 fsent.flags = IA_INTERACTIVE; 405 fsent.flags = IA_INTERACTIVE;
431 fsent.ueptr = &ue; 406 fsent.ueptr = &ue;
432 fsent.jid = jid; 407 fsent.jid = jid;
433 fsent.errcode = ia_mlsrcode; 408 fsent.errcode = ia_mlsrcode;
434 fsent.pwdp = uret.pswd; 409 fsent.pwdp = uret.pswd;
435 fsent.exitcode = 1; 410 fsent.exitcode = 1;
436 fret.revision = 0; 411 fret.revision = 0;
437 fret.normal = 0; 412 fret.normal = 0;
438 413
439 /* 414 /*
440 * Call ia_failure because of an IA failure. 415 * Call ia_failure because of an IA failure.
441 * There is no return because ia_failure exits. 416 * There is no return because ia_failure exits.
442 */ 417 */
443 ia_failure(&fsent,&fret); 418 ia_failure(&fsent,&fret);
444 exit(1); 419 exit(1);
445 } 420 }
446 421
447 /* Provide login status information */ 422 /* Provide login status information */
448 if (options.print_lastlog && ue.ue_logtime != 0) { 423 if (options.print_lastlog && ue.ue_logtime != 0) {
449 printf("Last successful login was : %.*s ", 424 printf("Last successful login was : %.*s ", 19,
450 19, (char *)ctime(&ue.ue_logtime)); 425 (char *)ctime(&ue.ue_logtime));
451 426
452 if (*ue.ue_loghost != '\0') 427 if (*ue.ue_loghost != '\0') {
453 printf("from %.*s\n", sizeof(ue.ue_loghost), ue.ue_loghost); 428 printf("from %.*s\n", sizeof(ue.ue_loghost),
454 429 ue.ue_loghost);
455 else printf("on %.*s\n", sizeof(ue.ue_logline), ue.ue_logline); 430 } else {
456 431 printf("on %.*s\n", sizeof(ue.ue_logline),
457 if ( SecureSys && (ue.ue_logfails != 0)) 432 ue.ue_logline);
458 printf(" followed by %d failed attempts\n", ue.ue_logfails); 433 }
459 } 434
460 435 if (SecureSys && (ue.ue_logfails != 0)) {
461 436 printf(" followed by %d failed attempts\n",
437 ue.ue_logfails);
438 }
439 }
440
462 /* 441 /*
463 * Call ia_success to process successful I/A. 442 * Call ia_success to process successful I/A.
464 */ 443 */
@@ -472,109 +451,116 @@ cray_setup (uid_t uid, char *username, const char *command)
472 ssent.jid = jid; 451 ssent.jid = jid;
473 ssent.errcode = ia_rcode; 452 ssent.errcode = ia_rcode;
474 ssent.us = NULL; 453 ssent.us = NULL;
475 ssent.time = 1; /* Set ue_logtime */ 454 ssent.time = 1; /* Set ue_logtime */
476 455
477 sret.revision = 0; 456 sret.revision = 0;
478 sret.normal = 0; 457 sret.normal = 0;
479 458
480 ia_success(&ssent,&sret); 459 ia_success(&ssent, &sret);
481 460
482 /* 461 /*
483 * Query for account, iff > 1 valid acid & askacid permbit 462 * Query for account, iff > 1 valid acid & askacid permbit
484 */ 463 */
485 if (((ue.ue_permbits & PERMBITS_ACCTID) || 464 if (((ue.ue_permbits & PERMBITS_ACCTID) ||
486 (ue.ue_acids[0] >= 0) && (ue.ue_acids[1] >= 0)) && 465 (ue.ue_acids[0] >= 0) && (ue.ue_acids[1] >= 0)) &&
487 ue.ue_permbits & PERMBITS_ASKACID) { 466 ue.ue_permbits & PERMBITS_ASKACID) {
488 if (ttyname(0) != NULL) { 467 if (ttyname(0) != NULL) {
489 debug("cray_setup: ttyname true case, %.100s", ttyname); 468 debug("cray_setup: ttyname true case, %.100s", ttyname);
490 while (valid_acct == -1) { 469 while (valid_acct == -1) {
491 printf("Account (? for available accounts)" 470 printf("Account (? for available accounts)"
492 " [%s]: ", acid2nam(ue.ue_acids[0])); 471 " [%s]: ", acid2nam(ue.ue_acids[0]));
493 gets(acct_name); 472 fgets(acct_name, MAXACID, stdin);
494 switch (acct_name[0]) { 473 switch (acct_name[0]) {
495 case EOF: 474 case EOF:
496 exit(0); 475 exit(0);
497 break; 476 break;
498 case '\0': 477 case '\0':
499 valid_acct = ue.ue_acids[0]; 478 valid_acct = ue.ue_acids[0];
500 strcpy(acct_name, acid2nam(valid_acct)); 479 strlcpy(acct_name, acid2nam(valid_acct), MAXACID);
501 break; 480 break;
502 case '?': 481 case '?':
503 /* Print the list 3 wide */ 482 /* Print the list 3 wide */
504 for (i = 0, j = 0; i < MAXVIDS; i++) { 483 for (i = 0, j = 0; i < MAXVIDS; i++) {
505 if (ue.ue_acids[i] == -1) { 484 if (ue.ue_acids[i] == -1) {
506 printf("\n"); 485 printf("\n");
507 break; 486 break;
508 } 487 }
509 if (++j == 4) { 488 if (++j == 4) {
510 j = 1; 489 j = 1;
511 printf("\n"); 490 printf("\n");
512 } 491 }
513 printf(" %s", 492 printf(" %s",
514 acid2nam(ue.ue_acids[i])); 493 acid2nam(ue.ue_acids[i]));
515 } 494 }
516 if (ue.ue_permbits & PERMBITS_ACCTID) 495 if (ue.ue_permbits & PERMBITS_ACCTID) {
517 printf("\"acctid\" permbit also allows" 496 printf("\"acctid\" permbit also allows"
518 " you to select any valid " 497 " you to select any valid "
519 "account name.\n"); 498 "account name.\n");
520 printf("\n"); 499 }
521 break; 500 printf("\n");
522 default: 501 break;
523 if ((valid_acct = nam2acid(acct_name)) == -1) printf("Account id not found for" 502 default:
524 " account name \"%s\"\n\n", 503 valid_acct = nam2acid(acct_name);
525 acct_name); 504 if (valid_acct == -1) {
526 break; 505 printf(
527 } 506 "Account id not found for"
528 /* 507 " account name \"%s\"\n\n",
529 * If an account was given, search the user's 508 acct_name);
530 * acids array to verify they can use this account. 509 break;
531 */ 510 }
532 if ((valid_acct != -1) && 511 /*
533 !(ue.ue_permbits & PERMBITS_ACCTID)) { 512 * If an account was given, search the user's
534 for (i = 0; i < MAXVIDS; i++) { 513 * acids array to verify they can use this account.
535 if (ue.ue_acids[i] == -1) 514 */
536 break; 515 if ((valid_acct != -1) &&
537 if (valid_acct == ue.ue_acids[i]) 516 !(ue.ue_permbits & PERMBITS_ACCTID)) {
538 break; 517 for (i = 0; i < MAXVIDS; i++) {
539 } 518 if (ue.ue_acids[i] == -1)
540 if (i == MAXVIDS || 519 break;
541 ue.ue_acids[i] == -1) { 520 if (valid_acct == ue.ue_acids[i])
542 fprintf(stderr, "Cannot set" 521 break;
543 " account name to " 522 }
544 "\"%s\", permission " 523 if (i == MAXVIDS ||
545 "denied\n\n", acct_name); 524 ue.ue_acids[i] == -1) {
546 valid_acct = -1; 525 fprintf(stderr, "Cannot set"
547 } 526 " account name to "
548 } 527 "\"%s\", permission "
549 } 528 "denied\n\n", acct_name);
529 valid_acct = -1;
530 }
531 }
532 }
533 } else {
534 /*
535 * The client isn't connected to a terminal and can't
536 * respond to an acid prompt. Use default acid.
537 */
538 debug("cray_setup: ttyname false case, %.100s",
539 ttyname);
540 valid_acct = ue.ue_acids[0];
541 }
550 } else { 542 } else {
551 /* 543 /*
552 * The client isn't connected to a terminal and can't 544 * The user doesn't have the askacid permbit set or
553 * respond to an acid prompt. Use default acid. 545 * only has one valid account to use.
554 */ 546 */
555 debug("cray_setup: ttyname false case, %.100s", ttyname);
556 valid_acct = ue.ue_acids[0]; 547 valid_acct = ue.ue_acids[0];
557 } 548 }
558 } else { 549 if (acctid(0, valid_acct) < 0) {
559 /* 550 printf ("Bad account id: %d\n", valid_acct);
560 * The user doesn't have the askacid permbit set or 551 exit(1);
561 * only has one valid account to use. 552 }
562 */ 553
563 valid_acct = ue.ue_acids[0]; 554 /*
564 } 555 * Now set shares, quotas, limits, including CPU time for the
565 if (acctid(0, valid_acct) < 0) { 556 * (interactive) job and process, and set up permissions
566 printf ("Bad account id: %d\n", valid_acct); 557 * (for chown etc), etc.
567 exit(1); 558 */
568 }
569
570/* set up shares and quotas */
571/* Now set shares, quotas, limits, including CPU time for the (interactive)
572 * job and process, and set up permissions (for chown etc), etc.
573 */
574 if (setshares(ue.ue_uid, valid_acct, printf, 0, 0)) { 559 if (setshares(ue.ue_uid, valid_acct, printf, 0, 0)) {
575 printf("Unable to give %d shares to <%s>(%d/%d)\n", ue.ue_shares, ue.ue_name, ue.ue_uid, valid_acct); 560 printf("Unable to give %d shares to <%s>(%d/%d)\n",
561 ue.ue_shares, ue.ue_name, ue.ue_uid, valid_acct);
576 exit(1); 562 exit(1);
577 } 563 }
578 564
579 sr = setlimits(username, C_PROC, pid, UDBRC_INTER); 565 sr = setlimits(username, C_PROC, pid, UDBRC_INTER);
580 if (sr != NULL) { 566 if (sr != NULL) {
@@ -587,17 +573,15 @@ cray_setup (uid_t uid, char *username, const char *command)
587 exit(1); 573 exit(1);
588 } 574 }
589 /* 575 /*
590 * Place the service provider information into 576 * Place the service provider information into
591 * the session table (Unicos) or job table (Unicos/mk). 577 * the session table (Unicos) or job table (Unicos/mk).
592 * There exist double defines for the job/session table in 578 * There exist double defines for the job/session table in
593 * unicos/mk (jtab.h) so no need for a compile time switch. 579 * unicos/mk (jtab.h) so no need for a compile time switch.
594 */ 580 */
595 bzero((char *)&init_info, sizeof(struct servprov)); 581 memset(&init_info, '\0', sizeof(init_info));
596 init_info.s_sessinit.si_id = URM_SPT_LOGIN; 582 init_info.s_sessinit.si_id = URM_SPT_LOGIN;
597 init_info.s_sessinit.si_pid = getpid(); 583 init_info.s_sessinit.si_pid = getpid();
598 init_info.s_sessinit.si_sid = jid; 584 init_info.s_sessinit.si_sid = jid;
599 init_info.s_routing.seqno = 0;
600 init_info.s_routing.iadrs = 0;
601 sesscntl(0, S_SETSERVPO, (int)&init_info); 585 sesscntl(0, S_SETSERVPO, (int)&init_info);
602 586
603 /* 587 /*
@@ -610,7 +594,7 @@ cray_setup (uid_t uid, char *username, const char *command)
610 } 594 }
611 } 595 }
612 596
613 return(0); 597 return (0);
614} 598}
615 599
616/* 600/*
@@ -623,10 +607,10 @@ void
623drop_cray_privs() 607drop_cray_privs()
624{ 608{
625#if defined(_SC_CRAY_PRIV_SU) 609#if defined(_SC_CRAY_PRIV_SU)
626 priv_proc_t* privstate; 610 priv_proc_t *privstate;
627 int result; 611 int result;
628 extern int priv_set_proc(); 612 extern int priv_set_proc();
629 extern priv_proc_t* priv_init_proc(); 613 extern priv_proc_t *priv_init_proc();
630 614
631 /* 615 /*
632 * If ether of theses two flags are not set 616 * If ether of theses two flags are not set
@@ -654,15 +638,17 @@ drop_cray_privs()
654 usrv.sv_intcat = TFM_SYSTEM; 638 usrv.sv_intcat = TFM_SYSTEM;
655 usrv.sv_valcat |= (TFM_SYSTEM | TFM_SYSFILE); 639 usrv.sv_valcat |= (TFM_SYSTEM | TFM_SYSFILE);
656 640
657 if (setusrv(&usrv) < 0) 641 if (setusrv(&usrv) < 0) {
658 fatal("%s(%d): setusrv(): %s", __FILE__, __LINE__, 642 fatal("%s(%d): setusrv(): %s", __FILE__, __LINE__,
659 strerror(errno)); 643 strerror(errno));
644 }
660 645
661 if ((privstate = priv_init_proc()) != NULL) { 646 if ((privstate = priv_init_proc()) != NULL) {
662 result = priv_set_proc(privstate); 647 result = priv_set_proc(privstate);
663 if (result != 0 ) 648 if (result != 0 ) {
664 fatal("%s(%d): priv_set_proc(): %s", 649 fatal("%s(%d): priv_set_proc(): %s",
665 __FILE__, __LINE__, strerror(errno)); 650 __FILE__, __LINE__, strerror(errno));
651 }
666 priv_free_proc(privstate); 652 priv_free_proc(privstate);
667 } 653 }
668 debug ("Privileges should be cleared..."); 654 debug ("Privileges should be cleared...");
@@ -683,6 +669,7 @@ cray_retain_utmp(struct utmp *ut, int pid)
683 struct utmp utmp; 669 struct utmp utmp;
684 670
685 if ((fd = open(UTMP_FILE, O_RDONLY)) != -1) { 671 if ((fd = open(UTMP_FILE, O_RDONLY)) != -1) {
672 /* XXX use atomicio */
686 while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) { 673 while (read(fd, (char *)&utmp, sizeof(utmp)) == sizeof(utmp)) {
687 if (pid == utmp.ut_pid) { 674 if (pid == utmp.ut_pid) {
688 ut->ut_jid = utmp.ut_jid; 675 ut->ut_jid = utmp.ut_jid;
@@ -693,9 +680,8 @@ cray_retain_utmp(struct utmp *ut, int pid)
693 } 680 }
694 } 681 }
695 close(fd); 682 close(fd);
696 } 683 } else
697 else 684 fatal("Unable to open utmp file");
698 fatal("Unable to open utmp file");
699} 685}
700 686
701/* 687/*
@@ -708,11 +694,9 @@ cray_retain_utmp(struct utmp *ut, int pid)
708void 694void
709cray_delete_tmpdir(char *login, int jid, uid_t uid) 695cray_delete_tmpdir(char *login, int jid, uid_t uid)
710{ 696{
711 int child;
712 static char jtmp[TPATHSIZ]; 697 static char jtmp[TPATHSIZ];
713 struct stat statbuf; 698 struct stat statbuf;
714 int c; 699 int child, c, wstat;
715 int wstat;
716 700
717 for (c = 'a'; c <= 'z'; c++) { 701 for (c = 'a'; c <= 'z'; c++) {
718 snprintf(jtmp, TPATHSIZ, "%s/jtmp.%06d%c", JTMPDIR, jid, c); 702 snprintf(jtmp, TPATHSIZ, "%s/jtmp.%06d%c", JTMPDIR, jid, c);
diff --git a/openbsd-compat/bsd-cray.h b/openbsd-compat/bsd-cray.h
index a09954f2f..a121ea152 100644
--- a/openbsd-compat/bsd-cray.h
+++ b/openbsd-compat/bsd-cray.h
@@ -1,8 +1,6 @@
1/* 1/* $Id: bsd-cray.h,v 1.10 2003/08/29 16:59:52 mouring Exp $ */
2 * $Id: bsd-cray.h,v 1.7 2003/03/21 01:05:38 mouring Exp $ 2
3 * 3/*
4 * bsd-cray.h
5 *
6 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>) 4 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>)
7 * Significant portions provided by 5 * Significant portions provided by
8 * Wayne Schroeder, SDSC <schroeder@sdsc.edu> 6 * Wayne Schroeder, SDSC <schroeder@sdsc.edu>
@@ -34,25 +32,31 @@
34 * on UNICOS systems. 32 * on UNICOS systems.
35 * 33 *
36 */ 34 */
35
37#ifndef _BSD_CRAY_H 36#ifndef _BSD_CRAY_H
38#define _BSD_CRAY_H 37#define _BSD_CRAY_H
39 38
40#ifdef _UNICOS 39#ifdef _UNICOS
41void cray_init_job(struct passwd *); /* init cray job */ 40
42void cray_job_termination_handler(int); /* process end of job signal */ 41void cray_init_job(struct passwd *);
43void cray_login_failure(char *username, int errcode); 42void cray_job_termination_handler(int);
44int cray_access_denied(char *username); 43void cray_login_failure(char *, int );
45extern char cray_tmpdir[]; /* cray tmpdir */ 44int cray_access_denied(char *);
45#define CUSTOM_FAILED_LOGIN 1
46void record_failed_login(const char *, const char *);
47extern char cray_tmpdir[];
48
46#ifndef IA_SSHD 49#ifndef IA_SSHD
47#define IA_SSHD IA_LOGIN 50# define IA_SSHD IA_LOGIN
48#endif 51#endif
49#ifndef MAXHOSTNAMELEN 52#ifndef MAXHOSTNAMELEN
50#define MAXHOSTNAMELEN 64 53# define MAXHOSTNAMELEN 64
51#endif 54#endif
52#ifndef _CRAYT3E 55#ifndef _CRAYT3E
53#include <sys/ttold.h> 56# include <sys/ttold.h>
54#define TIOCGPGRP (tIOC|20) 57# define TIOCGPGRP (tIOC|20)
55#endif
56#endif 58#endif
57 59
60#endif /* UNICOS */
61
58#endif /* _BSD_CRAY_H */ 62#endif /* _BSD_CRAY_H */
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index 0fa5964bc..a87cf3c97 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -1,6 +1,4 @@
1/* 1/*
2 * cygwin_util.c
3 *
4 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com> 2 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com>
5 * 3 *
6 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
@@ -31,7 +29,7 @@
31 29
32#include "includes.h" 30#include "includes.h"
33 31
34RCSID("$Id: bsd-cygwin_util.c,v 1.9 2002/11/09 15:59:29 mouring Exp $"); 32RCSID("$Id: bsd-cygwin_util.c,v 1.11 2003/08/07 06:23:43 dtucker Exp $");
35 33
36#ifdef HAVE_CYGWIN 34#ifdef HAVE_CYGWIN
37 35
@@ -53,7 +51,8 @@ RCSID("$Id: bsd-cygwin_util.c,v 1.9 2002/11/09 15:59:29 mouring Exp $");
53# undef pipe 51# undef pipe
54#endif 52#endif
55 53
56int binary_open(const char *filename, int flags, ...) 54int
55binary_open(const char *filename, int flags, ...)
57{ 56{
58 va_list ap; 57 va_list ap;
59 mode_t mode; 58 mode_t mode;
@@ -61,55 +60,56 @@ int binary_open(const char *filename, int flags, ...)
61 va_start(ap, flags); 60 va_start(ap, flags);
62 mode = va_arg(ap, mode_t); 61 mode = va_arg(ap, mode_t);
63 va_end(ap); 62 va_end(ap);
64 return open(filename, flags | O_BINARY, mode); 63 return (open(filename, flags | O_BINARY, mode));
65} 64}
66 65
67int binary_pipe(int fd[2]) 66int
67binary_pipe(int fd[2])
68{ 68{
69 int ret = pipe(fd); 69 int ret = pipe(fd);
70 70
71 if (!ret) { 71 if (!ret) {
72 setmode (fd[0], O_BINARY); 72 setmode(fd[0], O_BINARY);
73 setmode (fd[1], O_BINARY); 73 setmode(fd[1], O_BINARY);
74 } 74 }
75 return ret; 75 return (ret);
76} 76}
77 77
78#define HAS_CREATE_TOKEN 1 78#define HAS_CREATE_TOKEN 1
79#define HAS_NTSEC_BY_DEFAULT 2 79#define HAS_NTSEC_BY_DEFAULT 2
80 80
81static int has_capability(int what) 81static int
82has_capability(int what)
82{ 83{
83 /* has_capability() basically calls uname() and checks if
84 specific capabilities of Cygwin can be evaluated from that.
85 This simplifies the calling functions which only have to ask
86 for a capability using has_capability() instead of having
87 to figure that out by themselves. */
88 static int inited; 84 static int inited;
89 static int has_create_token; 85 static int has_create_token;
90 static int has_ntsec_by_default; 86 static int has_ntsec_by_default;
91 87
88 /*
89 * has_capability() basically calls uname() and checks if
90 * specific capabilities of Cygwin can be evaluated from that.
91 * This simplifies the calling functions which only have to ask
92 * for a capability using has_capability() instead of having
93 * to figure that out by themselves.
94 */
92 if (!inited) { 95 if (!inited) {
93 struct utsname uts; 96 struct utsname uts;
94 char *c; 97 char *c;
95 98
96 if (!uname(&uts)) { 99 if (!uname(&uts)) {
97 int major_high = 0; 100 int major_high = 0, major_low = 0, minor = 0;
98 int major_low = 0; 101 int api_major_version = 0, api_minor_version = 0;
99 int minor = 0;
100 int api_major_version = 0;
101 int api_minor_version = 0;
102 char *c; 102 char *c;
103 103
104 sscanf(uts.release, "%d.%d.%d", &major_high, 104 sscanf(uts.release, "%d.%d.%d", &major_high,
105 &major_low, &minor); 105 &major_low, &minor);
106 c = strchr(uts.release, '('); 106 if ((c = strchr(uts.release, '(')) != NULL) {
107 if (c)
108 sscanf(c + 1, "%d.%d", &api_major_version, 107 sscanf(c + 1, "%d.%d", &api_major_version,
109 &api_minor_version); 108 &api_minor_version);
109 }
110 if (major_high > 1 || 110 if (major_high > 1 ||
111 (major_high == 1 && (major_low > 3 || 111 (major_high == 1 && (major_low > 3 ||
112 (major_low == 3 && minor >= 2)))) 112 (major_low == 3 && minor >= 2))))
113 has_create_token = 1; 113 has_create_token = 1;
114 if (api_major_version > 0 || api_minor_version >= 56) 114 if (api_major_version > 0 || api_minor_version >= 56)
115 has_ntsec_by_default = 1; 115 has_ntsec_by_default = 1;
@@ -118,14 +118,15 @@ static int has_capability(int what)
118 } 118 }
119 switch (what) { 119 switch (what) {
120 case HAS_CREATE_TOKEN: 120 case HAS_CREATE_TOKEN:
121 return has_create_token; 121 return (has_create_token);
122 case HAS_NTSEC_BY_DEFAULT: 122 case HAS_NTSEC_BY_DEFAULT:
123 return has_ntsec_by_default; 123 return (has_ntsec_by_default);
124 } 124 }
125 return 0; 125 return (0);
126} 126}
127 127
128int check_nt_auth(int pwd_authenticated, struct passwd *pw) 128int
129check_nt_auth(int pwd_authenticated, struct passwd *pw)
129{ 130{
130 /* 131 /*
131 * The only authentication which is able to change the user 132 * The only authentication which is able to change the user
@@ -149,34 +150,33 @@ int check_nt_auth(int pwd_authenticated, struct passwd *pw)
149 has_create_token = 0; 150 has_create_token = 0;
150 if (has_capability(HAS_CREATE_TOKEN) && 151 if (has_capability(HAS_CREATE_TOKEN) &&
151 (ntsec_on(cygwin) || 152 (ntsec_on(cygwin) ||
152 (has_capability(HAS_NTSEC_BY_DEFAULT) && 153 (has_capability(HAS_NTSEC_BY_DEFAULT) &&
153 !ntsec_off(cygwin)))) 154 !ntsec_off(cygwin))))
154 has_create_token = 1; 155 has_create_token = 1;
155 } 156 }
156 if (has_create_token < 1 && 157 if (has_create_token < 1 &&
157 !pwd_authenticated && geteuid() != pw->pw_uid) 158 !pwd_authenticated && geteuid() != pw->pw_uid)
158 return 0; 159 return (0);
159 } 160 }
160 return 1; 161 return (1);
161} 162}
162 163
163int check_ntsec(const char *filename) 164int
165check_ntsec(const char *filename)
164{ 166{
165 char *cygwin; 167 char *cygwin;
166 int allow_ntea = 0; 168 int allow_ntea = 0, allow_ntsec = 0;
167 int allow_ntsec = 0;
168 struct statfs fsstat; 169 struct statfs fsstat;
169 170
170 /* Windows 95/98/ME don't support file system security at all. */ 171 /* Windows 95/98/ME don't support file system security at all. */
171 if (!is_winnt) 172 if (!is_winnt)
172 return 0; 173 return (0);
173 174
174 /* Evaluate current CYGWIN settings. */ 175 /* Evaluate current CYGWIN settings. */
175 cygwin = getenv("CYGWIN"); 176 cygwin = getenv("CYGWIN");
176 allow_ntea = ntea_on(cygwin); 177 allow_ntea = ntea_on(cygwin);
177 allow_ntsec = ntsec_on(cygwin) || 178 allow_ntsec = ntsec_on(cygwin) ||
178 (has_capability(HAS_NTSEC_BY_DEFAULT) && 179 (has_capability(HAS_NTSEC_BY_DEFAULT) && !ntsec_off(cygwin));
179 !ntsec_off(cygwin));
180 180
181 /* 181 /*
182 * `ntea' is an emulation of POSIX attributes. It doesn't support 182 * `ntea' is an emulation of POSIX attributes. It doesn't support
@@ -185,14 +185,14 @@ int check_ntsec(const char *filename)
185 * for security checks. 185 * for security checks.
186 */ 186 */
187 if (allow_ntea) 187 if (allow_ntea)
188 return 1; 188 return (1);
189 189
190 /* 190 /*
191 * Retrieve file system flags. In Cygwin, file system flags are 191 * Retrieve file system flags. In Cygwin, file system flags are
192 * copied to f_type which has no meaning in Win32 itself. 192 * copied to f_type which has no meaning in Win32 itself.
193 */ 193 */
194 if (statfs(filename, &fsstat)) 194 if (statfs(filename, &fsstat))
195 return 1; 195 return (1);
196 196
197 /* 197 /*
198 * Only file systems supporting ACLs are able to set permissions. 198 * Only file systems supporting ACLs are able to set permissions.
@@ -200,12 +200,13 @@ int check_ntsec(const char *filename)
200 * ACLs to support POSIX permissions on files. 200 * ACLs to support POSIX permissions on files.
201 */ 201 */
202 if (fsstat.f_type & FS_PERSISTENT_ACLS) 202 if (fsstat.f_type & FS_PERSISTENT_ACLS)
203 return allow_ntsec; 203 return (allow_ntsec);
204 204
205 return 0; 205 return (0);
206} 206}
207 207
208void register_9x_service(void) 208void
209register_9x_service(void)
209{ 210{
210 HINSTANCE kerneldll; 211 HINSTANCE kerneldll;
211 DWORD (*RegisterServiceProcess)(DWORD, DWORD); 212 DWORD (*RegisterServiceProcess)(DWORD, DWORD);
@@ -219,10 +220,10 @@ void register_9x_service(void)
219 */ 220 */
220 if (is_winnt) 221 if (is_winnt)
221 return; 222 return;
222 if (! (kerneldll = LoadLibrary("KERNEL32.DLL"))) 223 if (!(kerneldll = LoadLibrary("KERNEL32.DLL")))
223 return; 224 return;
224 if (! (RegisterServiceProcess = (DWORD (*)(DWORD, DWORD)) 225 if (!(RegisterServiceProcess = (DWORD (*)(DWORD, DWORD))
225 GetProcAddress(kerneldll, "RegisterServiceProcess"))) 226 GetProcAddress(kerneldll, "RegisterServiceProcess")))
226 return; 227 return;
227 RegisterServiceProcess(0, 1); 228 RegisterServiceProcess(0, 1);
228} 229}
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h
index af470bdd8..5ccb0fba2 100644
--- a/openbsd-compat/bsd-cygwin_util.h
+++ b/openbsd-compat/bsd-cygwin_util.h
@@ -1,8 +1,6 @@
1/* $Id: bsd-cygwin_util.h,v 1.7 2002/04/15 22:00:52 stevesk Exp $ */ 1/* $Id: bsd-cygwin_util.h,v 1.10 2003/08/07 06:28:16 dtucker Exp $ */
2 2
3/* 3/*
4 * cygwin_util.c
5 *
6 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com> 4 * Copyright (c) 2000, 2001, Corinna Vinschen <vinschen@cygnus.com>
7 * 5 *
8 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
@@ -36,12 +34,17 @@
36 34
37#ifdef HAVE_CYGWIN 35#ifdef HAVE_CYGWIN
38 36
37#undef ERROR
38#define is_winnt (GetVersion() < 0x80000000)
39
40#include <windows.h>
41#include <sys/cygwin.h>
39#include <io.h> 42#include <io.h>
40 43
41int binary_open(const char *filename, int flags, ...); 44int binary_open(const char *, int , ...);
42int binary_pipe(int fd[2]); 45int binary_pipe(int fd[2]);
43int check_nt_auth(int pwd_authenticated, struct passwd *pw); 46int check_nt_auth(int, struct passwd *);
44int check_ntsec(const char *filename); 47int check_ntsec(const char *);
45void register_9x_service(void); 48void register_9x_service(void);
46 49
47#define open binary_open 50#define open binary_open
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index b8e9996d5..08b089bdc 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 1999-2000 Damien Miller. All rights reserved. 2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
@@ -25,13 +25,13 @@
25#include "includes.h" 25#include "includes.h"
26#include "xmalloc.h" 26#include "xmalloc.h"
27 27
28RCSID("$Id: bsd-misc.c,v 1.12 2003/03/18 18:21:41 tim Exp $"); 28RCSID("$Id: bsd-misc.c,v 1.19 2003/08/25 01:16:21 mouring Exp $");
29 29
30/* 30/*
31 * NB. duplicate __progname in case it is an alias for argv[0] 31 * NB. duplicate __progname in case it is an alias for argv[0]
32 * Otherwise it may get clobbered by setproctitle() 32 * Otherwise it may get clobbered by setproctitle()
33 */ 33 */
34char *get_progname(char *argv0) 34char *ssh_get_progname(char *argv0)
35{ 35{
36#ifdef HAVE___PROGNAME 36#ifdef HAVE___PROGNAME
37 extern char *__progname; 37 extern char *__progname;
@@ -41,21 +41,21 @@ char *get_progname(char *argv0)
41 char *p; 41 char *p;
42 42
43 if (argv0 == NULL) 43 if (argv0 == NULL)
44 return "unknown"; /* XXX */ 44 return ("unknown"); /* XXX */
45 p = strrchr(argv0, '/'); 45 p = strrchr(argv0, '/');
46 if (p == NULL) 46 if (p == NULL)
47 p = argv0; 47 p = argv0;
48 else 48 else
49 p++; 49 p++;
50 50
51 return xstrdup(p); 51 return (xstrdup(p));
52#endif 52#endif
53} 53}
54 54
55#ifndef HAVE_SETLOGIN 55#ifndef HAVE_SETLOGIN
56int setlogin(const char *name) 56int setlogin(const char *name)
57{ 57{
58 return(0); 58 return (0);
59} 59}
60#endif /* !HAVE_SETLOGIN */ 60#endif /* !HAVE_SETLOGIN */
61 61
@@ -63,21 +63,21 @@ int setlogin(const char *name)
63int innetgr(const char *netgroup, const char *host, 63int innetgr(const char *netgroup, const char *host,
64 const char *user, const char *domain) 64 const char *user, const char *domain)
65{ 65{
66 return(0); 66 return (0);
67} 67}
68#endif /* HAVE_INNETGR */ 68#endif /* HAVE_INNETGR */
69 69
70#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) 70#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
71int seteuid(uid_t euid) 71int seteuid(uid_t euid)
72{ 72{
73 return(setreuid(-1,euid)); 73 return (setreuid(-1, euid));
74} 74}
75#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ 75#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
76 76
77#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) 77#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
78int setegid(uid_t egid) 78int setegid(uid_t egid)
79{ 79{
80 return(setresgid(-1,egid,-1)); 80 return(setresgid(-1, egid, -1));
81} 81}
82#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */ 82#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
83 83
@@ -88,9 +88,9 @@ const char *strerror(int e)
88 extern char *sys_errlist[]; 88 extern char *sys_errlist[];
89 89
90 if ((e >= 0) && (e < sys_nerr)) 90 if ((e >= 0) && (e < sys_nerr))
91 return(sys_errlist[e]); 91 return (sys_errlist[e]);
92 else 92
93 return("unlisted error"); 93 return ("unlisted error");
94} 94}
95#endif 95#endif
96 96
@@ -102,24 +102,25 @@ int utimes(char *filename, struct timeval *tvp)
102 ub.actime = tvp[0].tv_sec; 102 ub.actime = tvp[0].tv_sec;
103 ub.modtime = tvp[1].tv_sec; 103 ub.modtime = tvp[1].tv_sec;
104 104
105 return(utime(filename, &ub)); 105 return (utime(filename, &ub));
106} 106}
107#endif 107#endif
108 108
109#ifndef HAVE_TRUNCATE 109#ifndef HAVE_TRUNCATE
110int truncate (const char *path, off_t length) 110int truncate(const char *path, off_t length)
111{ 111{
112 int fd, ret, saverrno; 112 int fd, ret, saverrno;
113 113
114 fd = open(path, O_WRONLY); 114 fd = open(path, O_WRONLY);
115 if (fd < 0) 115 if (fd < 0)
116 return -1; 116 return (-1);
117 117
118 ret = ftruncate(fd, length); 118 ret = ftruncate(fd, length);
119 saverrno = errno; 119 saverrno = errno;
120 (void) close (fd); 120 close(fd);
121 if (ret == -1) 121 if (ret == -1)
122 errno = saverrno; 122 errno = saverrno;
123
123 return(ret); 124 return(ret);
124} 125}
125#endif /* HAVE_TRUNCATE */ 126#endif /* HAVE_TRUNCATE */
@@ -131,7 +132,7 @@ int truncate (const char *path, off_t length)
131int 132int
132setgroups(size_t size, const gid_t *list) 133setgroups(size_t size, const gid_t *list)
133{ 134{
134 return 0; 135 return (0);
135} 136}
136#endif 137#endif
137 138
@@ -166,3 +167,62 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
166 167
167#endif 168#endif
168 169
170#ifndef HAVE_TCGETPGRP
171pid_t
172tcgetpgrp(int fd)
173{
174 int ctty_pgrp;
175
176 if (ioctl(fd, TIOCGPGRP, &ctty_pgrp) == -1)
177 return(-1);
178 else
179 return(ctty_pgrp);
180}
181#endif /* HAVE_TCGETPGRP */
182
183#ifndef HAVE_TCSENDBREAK
184int
185tcsendbreak(int fd, int duration)
186{
187# if defined(TIOCSBRK) && defined(TIOCCBRK)
188 struct timeval sleepytime;
189
190 sleepytime.tv_sec = 0;
191 sleepytime.tv_usec = 400000;
192 if (ioctl(fd, TIOCSBRK, 0) == -1)
193 return (-1);
194 (void)select(0, 0, 0, 0, &sleepytime);
195 if (ioctl(fd, TIOCCBRK, 0) == -1)
196 return (-1);
197 return (0);
198# else
199 return -1;
200# endif
201}
202#endif /* HAVE_TCSENDBREAK */
203
204mysig_t
205mysignal(int sig, mysig_t act)
206{
207#ifdef HAVE_SIGACTION
208 struct sigaction sa, osa;
209
210 if (sigaction(sig, NULL, &osa) == -1)
211 return (mysig_t) -1;
212 if (osa.sa_handler != act) {
213 memset(&sa, 0, sizeof(sa));
214 sigemptyset(&sa.sa_mask);
215 sa.sa_flags = 0;
216#ifdef SA_INTERRUPT
217 if (sig == SIGALRM)
218 sa.sa_flags |= SA_INTERRUPT;
219#endif
220 sa.sa_handler = act;
221 if (sigaction(sig, &sa, NULL) == -1)
222 return (mysig_t) -1;
223 }
224 return (osa.sa_handler);
225#else
226 return (signal(sig, act));
227#endif
228}
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 78d9ccdd4..6b70473f3 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -1,5 +1,7 @@
1/* $Id: bsd-misc.h,v 1.13 2003/08/29 16:59:52 mouring Exp $ */
2
1/* 3/*
2 * Copyright (c) 1999-2000 Damien Miller. All rights reserved. 4 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 * 5 *
4 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
@@ -22,42 +24,39 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 25 */
24 26
25/* $Id: bsd-misc.h,v 1.7 2003/03/18 18:21:41 tim Exp $ */
26
27#ifndef _BSD_MISC_H 27#ifndef _BSD_MISC_H
28#define _BSD_MISC_H 28#define _BSD_MISC_H
29 29
30#include "config.h" 30#include "includes.h"
31 31
32char *get_progname(char *argv0); 32char *ssh_get_progname(char *);
33 33
34#ifndef HAVE_SETSID 34#ifndef HAVE_SETSID
35#define setsid() setpgrp(0, getpid()) 35#define setsid() setpgrp(0, getpid())
36#endif /* !HAVE_SETSID */ 36#endif /* !HAVE_SETSID */
37 37
38#ifndef HAVE_SETENV 38#ifndef HAVE_SETENV
39int setenv(const char *name, const char *value, int overwrite); 39int setenv(const char *, const char *, int);
40#endif /* !HAVE_SETENV */ 40#endif /* !HAVE_SETENV */
41 41
42#ifndef HAVE_SETLOGIN 42#ifndef HAVE_SETLOGIN
43int setlogin(const char *name); 43int setlogin(const char *);
44#endif /* !HAVE_SETLOGIN */ 44#endif /* !HAVE_SETLOGIN */
45 45
46#ifndef HAVE_INNETGR 46#ifndef HAVE_INNETGR
47int innetgr(const char *netgroup, const char *host, 47int innetgr(const char *, const char *, const char *, const char *);
48 const char *user, const char *domain);
49#endif /* HAVE_INNETGR */ 48#endif /* HAVE_INNETGR */
50 49
51#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) 50#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
52int seteuid(uid_t euid); 51int seteuid(uid_t);
53#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */ 52#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
54 53
55#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) 54#if !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID)
56int setegid(uid_t egid); 55int setegid(uid_t);
57#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */ 56#endif /* !defined(HAVE_SETEGID) && defined(HAVE_SETRESGID) */
58 57
59#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) 58#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
60const char *strerror(int e); 59const char *strerror(int);
61#endif 60#endif
62 61
63 62
@@ -69,15 +68,15 @@ struct timeval {
69} 68}
70#endif /* HAVE_STRUCT_TIMEVAL */ 69#endif /* HAVE_STRUCT_TIMEVAL */
71 70
72int utimes(char *filename, struct timeval *tvp); 71int utimes(char *, struct timeval *);
73#endif /* HAVE_UTIMES */ 72#endif /* HAVE_UTIMES */
74 73
75#ifndef HAVE_TRUNCATE 74#ifndef HAVE_TRUNCATE
76int truncate (const char *path, off_t length); 75int truncate (const char *, off_t);
77#endif /* HAVE_TRUNCATE */ 76#endif /* HAVE_TRUNCATE */
78 77
79#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP) 78#if !defined(HAVE_SETGROUPS) && defined(SETGROUPS_NOOP)
80int setgroups(size_t size, const gid_t *list); 79int setgroups(size_t, const gid_t *);
81#endif 80#endif
82 81
83#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP) 82#if !defined(HAVE_NANOSLEEP) && !defined(HAVE_NSLEEP)
@@ -87,7 +86,21 @@ struct timespec {
87 long tv_nsec; 86 long tv_nsec;
88}; 87};
89#endif 88#endif
90int nanosleep(const struct timespec *req, struct timespec *rem); 89int nanosleep(const struct timespec *, struct timespec *);
90#endif
91
92#ifndef HAVE_TCGETPGRP
93pid_t tcgetpgrp(int);
94#endif
95
96#ifndef HAVE_TCSENDBREAK
97int tcsendbreak(int, int);
91#endif 98#endif
92 99
100/* wrapper for signal interface */
101typedef void (*mysig_t)(int);
102mysig_t mysignal(int sig, mysig_t act);
103
104#define signal(a,b) mysignal(a,b)
105
93#endif /* _BSD_MISC_H */ 106#endif /* _BSD_MISC_H */
diff --git a/openbsd-compat/bsd-nextstep.c b/openbsd-compat/bsd-nextstep.c
index 85b298a48..bd35a3afc 100644
--- a/openbsd-compat/bsd-nextstep.c
+++ b/openbsd-compat/bsd-nextstep.c
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (c) 2000,2001 Ben Lindstrom. All rights reserved.
3 *
2 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
4 * are met: 6 * are met:
@@ -22,7 +24,7 @@
22 24
23#include "includes.h" 25#include "includes.h"
24 26
25RCSID("$Id: bsd-nextstep.c,v 1.4 2001/03/26 05:35:34 mouring Exp $"); 27RCSID("$Id: bsd-nextstep.c,v 1.6 2003/06/01 03:23:57 mouring Exp $");
26 28
27#ifdef HAVE_NEXT 29#ifdef HAVE_NEXT
28#include <errno.h> 30#include <errno.h>
@@ -40,7 +42,7 @@ posix_wait(int *status)
40 if (status) 42 if (status)
41 *status = (int) statusp.w_status; 43 *status = (int) statusp.w_status;
42 44
43 return wait_pid; 45 return (wait_pid);
44} 46}
45 47
46int 48int
diff --git a/openbsd-compat/bsd-nextstep.h b/openbsd-compat/bsd-nextstep.h
index c6a7019c6..ca5b4b54a 100644
--- a/openbsd-compat/bsd-nextstep.h
+++ b/openbsd-compat/bsd-nextstep.h
@@ -1,4 +1,8 @@
1/* $Id: bsd-nextstep.h,v 1.9 2003/08/29 16:59:52 mouring Exp $ */
2
1/* 3/*
4 * Copyright (c) 2000,2001 Ben Lindstrom. All rights reserved.
5 *
2 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
4 * are met: 8 * are met:
@@ -21,8 +25,6 @@
21 * 25 *
22 */ 26 */
23 27
24/* $Id: bsd-nextstep.h,v 1.6 2001/03/19 13:42:22 mouring Exp $ */
25
26#ifndef _NEXT_POSIX_H 28#ifndef _NEXT_POSIX_H
27#define _NEXT_POSIX_H 29#define _NEXT_POSIX_H
28 30
@@ -37,22 +39,21 @@
37#define dirent direct 39#define dirent direct
38 40
39/* Swap out NeXT's BSD wait() for a more POSIX complient one */ 41/* Swap out NeXT's BSD wait() for a more POSIX complient one */
40pid_t posix_wait(int *status); 42pid_t posix_wait(int *);
41#define wait(a) posix_wait(a) 43#define wait(a) posix_wait(a)
42 44
43/* #ifdef wrapped functions that need defining for clean compiling */ 45/* #ifdef wrapped functions that need defining for clean compiling */
44pid_t getppid(void); 46pid_t getppid(void);
45void vhangup(void); 47void vhangup(void);
46int innetgr(const char *netgroup, const char *host, const char *user, 48int innetgr(const char *, const char *, const char *, const char *);
47 const char *domain);
48 49
49/* TERMCAP */ 50/* TERMCAP */
50int tcgetattr(int fd, struct termios *t); 51int tcgetattr(int, struct termios *);
51int tcsetattr(int fd, int opt, const struct termios *t); 52int tcsetattr(int, int, const struct termios *);
52int tcsetpgrp(int fd, pid_t pgrp); 53int tcsetpgrp(int, pid_t);
53speed_t cfgetospeed(const struct termios *t); 54speed_t cfgetospeed(const struct termios *);
54speed_t cfgetispeed(const struct termios *t); 55speed_t cfgetispeed(const struct termios *);
55int cfsetospeed(struct termios *t, int speed); 56int cfsetospeed(struct termios *, int);
56int cfsetispeed(struct termios *t, int speed); 57int cfsetispeed(struct termios *, int);
57#endif /* HAVE_NEXT */ 58#endif /* HAVE_NEXT */
58#endif /* _NEXT_POSIX_H */ 59#endif /* _NEXT_POSIX_H */
diff --git a/openbsd-compat/bsd-snprintf.c b/openbsd-compat/bsd-snprintf.c
index 2f82180d1..e4d8a439a 100644
--- a/openbsd-compat/bsd-snprintf.c
+++ b/openbsd-compat/bsd-snprintf.c
@@ -58,7 +58,7 @@
58 58
59#include "includes.h" 59#include "includes.h"
60 60
61RCSID("$Id: bsd-snprintf.c,v 1.6 2003/04/01 11:31:56 djm Exp $"); 61RCSID("$Id: bsd-snprintf.c,v 1.7 2003/05/18 14:13:39 djm Exp $");
62 62
63#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */ 63#if defined(BROKEN_SNPRINTF) /* For those with broken snprintf() */
64# undef HAVE_SNPRINTF 64# undef HAVE_SNPRINTF
@@ -72,15 +72,15 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args);
72 72
73static void 73static void
74fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, 74fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags,
75 int min, int max); 75 int min, int max);
76 76
77static void 77static void
78fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, 78fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base,
79 int min, int max, int flags); 79 int min, int max, int flags);
80 80
81static void 81static void
82fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue, 82fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue,
83 int min, int max, int flags); 83 int min, int max, int flags);
84 84
85static void 85static void
86dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); 86dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
@@ -121,15 +121,10 @@ dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c);
121static void 121static void
122dopr(char *buffer, size_t maxlen, const char *format, va_list args) 122dopr(char *buffer, size_t maxlen, const char *format, va_list args)
123{ 123{
124 char *strvalue; 124 char *strvalue, ch;
125 char ch;
126 long value; 125 long value;
127 long double fvalue; 126 long double fvalue;
128 int min = 0; 127 int min = 0, max = -1, state = DP_S_DEFAULT, flags = 0, cflags = 0;
129 int max = -1;
130 int state = DP_S_DEFAULT;
131 int flags = 0;
132 int cflags = 0;
133 size_t currlen = 0; 128 size_t currlen = 0;
134 129
135 ch = *format++; 130 ch = *format++;
@@ -139,224 +134,224 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args)
139 state = DP_S_DONE; 134 state = DP_S_DONE;
140 135
141 switch(state) { 136 switch(state) {
142 case DP_S_DEFAULT: 137 case DP_S_DEFAULT:
143 if (ch == '%') 138 if (ch == '%')
144 state = DP_S_FLAGS; 139 state = DP_S_FLAGS;
145 else 140 else
146 dopr_outch(buffer, &currlen, maxlen, ch); 141 dopr_outch(buffer, &currlen, maxlen, ch);
142 ch = *format++;
143 break;
144 case DP_S_FLAGS:
145 switch (ch) {
146 case '-':
147 flags |= DP_F_MINUS;
147 ch = *format++; 148 ch = *format++;
148 break; 149 break;
149 case DP_S_FLAGS: 150 case '+':
150 switch (ch) { 151 flags |= DP_F_PLUS;
151 case '-': 152 ch = *format++;
152 flags |= DP_F_MINUS;
153 ch = *format++;
154 break;
155 case '+':
156 flags |= DP_F_PLUS;
157 ch = *format++;
158 break;
159 case ' ':
160 flags |= DP_F_SPACE;
161 ch = *format++;
162 break;
163 case '#':
164 flags |= DP_F_NUM;
165 ch = *format++;
166 break;
167 case '0':
168 flags |= DP_F_ZERO;
169 ch = *format++;
170 break;
171 default:
172 state = DP_S_MIN;
173 break;
174 }
175 break; 153 break;
176 case DP_S_MIN: 154 case ' ':
177 if (isdigit((unsigned char)ch)) { 155 flags |= DP_F_SPACE;
178 min = 10*min + char_to_int (ch); 156 ch = *format++;
179 ch = *format++;
180 } else if (ch == '*') {
181 min = va_arg (args, int);
182 ch = *format++;
183 state = DP_S_DOT;
184 } else
185 state = DP_S_DOT;
186 break; 157 break;
187 case DP_S_DOT: 158 case '#':
188 if (ch == '.') { 159 flags |= DP_F_NUM;
189 state = DP_S_MAX; 160 ch = *format++;
190 ch = *format++;
191 } else
192 state = DP_S_MOD;
193 break; 161 break;
194 case DP_S_MAX: 162 case '0':
195 if (isdigit((unsigned char)ch)) { 163 flags |= DP_F_ZERO;
196 if (max < 0) 164 ch = *format++;
197 max = 0;
198 max = 10*max + char_to_int(ch);
199 ch = *format++;
200 } else if (ch == '*') {
201 max = va_arg (args, int);
202 ch = *format++;
203 state = DP_S_MOD;
204 } else
205 state = DP_S_MOD;
206 break; 165 break;
207 case DP_S_MOD: 166 default:
208 switch (ch) { 167 state = DP_S_MIN;
209 case 'h':
210 cflags = DP_C_SHORT;
211 ch = *format++;
212 break;
213 case 'l':
214 cflags = DP_C_LONG;
215 ch = *format++;
216 if (ch == 'l') {
217 cflags = DP_C_LONG_LONG;
218 ch = *format++;
219 }
220 break;
221 case 'q':
222 cflags = DP_C_LONG_LONG;
223 ch = *format++;
224 break;
225 case 'L':
226 cflags = DP_C_LDOUBLE;
227 ch = *format++;
228 break;
229 default:
230 break;
231 }
232 state = DP_S_CONV;
233 break; 168 break;
234 case DP_S_CONV: 169 }
235 switch (ch) { 170 break;
236 case 'd': 171 case DP_S_MIN:
237 case 'i': 172 if (isdigit((unsigned char)ch)) {
238 if (cflags == DP_C_SHORT) 173 min = 10 * min + char_to_int (ch);
239 value = va_arg(args, int); 174 ch = *format++;
240 else if (cflags == DP_C_LONG) 175 } else if (ch == '*') {
241 value = va_arg(args, long int); 176 min = va_arg (args, int);
242 else if (cflags == DP_C_LONG_LONG) 177 ch = *format++;
243 value = va_arg (args, long long); 178 state = DP_S_DOT;
244 else 179 } else
245 value = va_arg (args, int); 180 state = DP_S_DOT;
246 fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags); 181 break;
247 break; 182 case DP_S_DOT:
248 case 'o': 183 if (ch == '.') {
249 flags |= DP_F_UNSIGNED; 184 state = DP_S_MAX;
250 if (cflags == DP_C_SHORT) 185 ch = *format++;
251 value = va_arg(args, unsigned int); 186 } else
252 else if (cflags == DP_C_LONG) 187 state = DP_S_MOD;
253 value = va_arg(args, unsigned long int); 188 break;
254 else if (cflags == DP_C_LONG_LONG) 189 case DP_S_MAX:
255 value = va_arg(args, unsigned long long); 190 if (isdigit((unsigned char)ch)) {
256 else 191 if (max < 0)
257 value = va_arg(args, unsigned int); 192 max = 0;
258 fmtint(buffer, &currlen, maxlen, value, 8, min, max, flags); 193 max = 10 * max + char_to_int(ch);
259 break; 194 ch = *format++;
260 case 'u': 195 } else if (ch == '*') {
261 flags |= DP_F_UNSIGNED; 196 max = va_arg (args, int);
262 if (cflags == DP_C_SHORT) 197 ch = *format++;
263 value = va_arg(args, unsigned int); 198 state = DP_S_MOD;
264 else if (cflags == DP_C_LONG) 199 } else
265 value = va_arg(args, unsigned long int); 200 state = DP_S_MOD;
266 else if (cflags == DP_C_LONG_LONG) 201 break;
267 value = va_arg(args, unsigned long long); 202 case DP_S_MOD:
268 else 203 switch (ch) {
269 value = va_arg(args, unsigned int); 204 case 'h':
270 fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); 205 cflags = DP_C_SHORT;
271 break; 206 ch = *format++;
272 case 'X': 207 break;
273 flags |= DP_F_UP; 208 case 'l':
274 case 'x': 209 cflags = DP_C_LONG;
275 flags |= DP_F_UNSIGNED; 210 ch = *format++;
276 if (cflags == DP_C_SHORT) 211 if (ch == 'l') {
277 value = va_arg(args, unsigned int); 212 cflags = DP_C_LONG_LONG;
278 else if (cflags == DP_C_LONG) 213 ch = *format++;
279 value = va_arg(args, unsigned long int);
280 else if (cflags == DP_C_LONG_LONG)
281 value = va_arg(args, unsigned long long);
282 else
283 value = va_arg(args, unsigned int);
284 fmtint(buffer, &currlen, maxlen, value, 16, min, max, flags);
285 break;
286 case 'f':
287 if (cflags == DP_C_LDOUBLE)
288 fvalue = va_arg(args, long double);
289 else
290 fvalue = va_arg(args, double);
291 /* um, floating point? */
292 fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags);
293 break;
294 case 'E':
295 flags |= DP_F_UP;
296 case 'e':
297 if (cflags == DP_C_LDOUBLE)
298 fvalue = va_arg(args, long double);
299 else
300 fvalue = va_arg(args, double);
301 break;
302 case 'G':
303 flags |= DP_F_UP;
304 case 'g':
305 if (cflags == DP_C_LDOUBLE)
306 fvalue = va_arg(args, long double);
307 else
308 fvalue = va_arg(args, double);
309 break;
310 case 'c':
311 dopr_outch(buffer, &currlen, maxlen, va_arg(args, int));
312 break;
313 case 's':
314 strvalue = va_arg(args, char *);
315 if (max < 0)
316 max = maxlen; /* ie, no max */
317 fmtstr(buffer, &currlen, maxlen, strvalue, flags, min, max);
318 break;
319 case 'p':
320 strvalue = va_arg(args, void *);
321 fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
322 break;
323 case 'n':
324 if (cflags == DP_C_SHORT) {
325 short int *num;
326 num = va_arg(args, short int *);
327 *num = currlen;
328 } else if (cflags == DP_C_LONG) {
329 long int *num;
330 num = va_arg(args, long int *);
331 *num = currlen;
332 } else if (cflags == DP_C_LONG_LONG) {
333 long long *num;
334 num = va_arg(args, long long *);
335 *num = currlen;
336 } else {
337 int *num;
338 num = va_arg(args, int *);
339 *num = currlen;
340 }
341 break;
342 case '%':
343 dopr_outch(buffer, &currlen, maxlen, ch);
344 break;
345 case 'w': /* not supported yet, treat as next char */
346 ch = *format++;
347 break;
348 default: /* Unknown, skip */
349 break;
350 } 214 }
215 break;
216 case 'q':
217 cflags = DP_C_LONG_LONG;
218 ch = *format++;
219 break;
220 case 'L':
221 cflags = DP_C_LDOUBLE;
351 ch = *format++; 222 ch = *format++;
352 state = DP_S_DEFAULT;
353 flags = cflags = min = 0;
354 max = -1;
355 break; 223 break;
356 case DP_S_DONE: 224 default:
225 break;
226 }
227 state = DP_S_CONV;
228 break;
229 case DP_S_CONV:
230 switch (ch) {
231 case 'd':
232 case 'i':
233 if (cflags == DP_C_SHORT)
234 value = va_arg(args, int);
235 else if (cflags == DP_C_LONG)
236 value = va_arg(args, long int);
237 else if (cflags == DP_C_LONG_LONG)
238 value = va_arg (args, long long);
239 else
240 value = va_arg (args, int);
241 fmtint(buffer, &currlen, maxlen, value, 10, min, max, flags);
242 break;
243 case 'o':
244 flags |= DP_F_UNSIGNED;
245 if (cflags == DP_C_SHORT)
246 value = va_arg(args, unsigned int);
247 else if (cflags == DP_C_LONG)
248 value = va_arg(args, unsigned long int);
249 else if (cflags == DP_C_LONG_LONG)
250 value = va_arg(args, unsigned long long);
251 else
252 value = va_arg(args, unsigned int);
253 fmtint(buffer, &currlen, maxlen, value, 8, min, max, flags);
357 break; 254 break;
358 default: /* hmm? */ 255 case 'u':
359 break; /* some picky compilers need this */ 256 flags |= DP_F_UNSIGNED;
257 if (cflags == DP_C_SHORT)
258 value = va_arg(args, unsigned int);
259 else if (cflags == DP_C_LONG)
260 value = va_arg(args, unsigned long int);
261 else if (cflags == DP_C_LONG_LONG)
262 value = va_arg(args, unsigned long long);
263 else
264 value = va_arg(args, unsigned int);
265 fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags);
266 break;
267 case 'X':
268 flags |= DP_F_UP;
269 case 'x':
270 flags |= DP_F_UNSIGNED;
271 if (cflags == DP_C_SHORT)
272 value = va_arg(args, unsigned int);
273 else if (cflags == DP_C_LONG)
274 value = va_arg(args, unsigned long int);
275 else if (cflags == DP_C_LONG_LONG)
276 value = va_arg(args, unsigned long long);
277 else
278 value = va_arg(args, unsigned int);
279 fmtint(buffer, &currlen, maxlen, value, 16, min, max, flags);
280 break;
281 case 'f':
282 if (cflags == DP_C_LDOUBLE)
283 fvalue = va_arg(args, long double);
284 else
285 fvalue = va_arg(args, double);
286 /* um, floating point? */
287 fmtfp(buffer, &currlen, maxlen, fvalue, min, max, flags);
288 break;
289 case 'E':
290 flags |= DP_F_UP;
291 case 'e':
292 if (cflags == DP_C_LDOUBLE)
293 fvalue = va_arg(args, long double);
294 else
295 fvalue = va_arg(args, double);
296 break;
297 case 'G':
298 flags |= DP_F_UP;
299 case 'g':
300 if (cflags == DP_C_LDOUBLE)
301 fvalue = va_arg(args, long double);
302 else
303 fvalue = va_arg(args, double);
304 break;
305 case 'c':
306 dopr_outch(buffer, &currlen, maxlen, va_arg(args, int));
307 break;
308 case 's':
309 strvalue = va_arg(args, char *);
310 if (max < 0)
311 max = maxlen; /* ie, no max */
312 fmtstr(buffer, &currlen, maxlen, strvalue, flags, min, max);
313 break;
314 case 'p':
315 strvalue = va_arg(args, void *);
316 fmtint(buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags);
317 break;
318 case 'n':
319 if (cflags == DP_C_SHORT) {
320 short int *num;
321 num = va_arg(args, short int *);
322 *num = currlen;
323 } else if (cflags == DP_C_LONG) {
324 long int *num;
325 num = va_arg(args, long int *);
326 *num = currlen;
327 } else if (cflags == DP_C_LONG_LONG) {
328 long long *num;
329 num = va_arg(args, long long *);
330 *num = currlen;
331 } else {
332 int *num;
333 num = va_arg(args, int *);
334 *num = currlen;
335 }
336 break;
337 case '%':
338 dopr_outch(buffer, &currlen, maxlen, ch);
339 break;
340 case 'w': /* not supported yet, treat as next char */
341 ch = *format++;
342 break;
343 default: /* Unknown, skip */
344 break;
345 }
346 ch = *format++;
347 state = DP_S_DEFAULT;
348 flags = cflags = min = 0;
349 max = -1;
350 break;
351 case DP_S_DONE:
352 break;
353 default: /* hmm? */
354 break; /* some picky compilers need this */
360 } 355 }
361 } 356 }
362 if (currlen < maxlen - 1) 357 if (currlen < maxlen - 1)
@@ -367,10 +362,9 @@ dopr(char *buffer, size_t maxlen, const char *format, va_list args)
367 362
368static void 363static void
369fmtstr(char *buffer, size_t *currlen, size_t maxlen, 364fmtstr(char *buffer, size_t *currlen, size_t maxlen,
370 char *value, int flags, int min, int max) 365 char *value, int flags, int min, int max)
371{ 366{
372 int padlen, strln; /* amount to pad */ 367 int cnt = 0, padlen, strln; /* amount to pad */
373 int cnt = 0;
374 368
375 if (value == 0) 369 if (value == 0)
376 value = "<NULL>"; 370 value = "<NULL>";
@@ -402,15 +396,13 @@ fmtstr(char *buffer, size_t *currlen, size_t maxlen,
402 396
403static void 397static void
404fmtint(char *buffer, size_t *currlen, size_t maxlen, 398fmtint(char *buffer, size_t *currlen, size_t maxlen,
405 long value, int base, int min, int max, int flags) 399 long value, int base, int min, int max, int flags)
406{ 400{
407 unsigned long uvalue; 401 unsigned long uvalue;
408 char convert[20]; 402 char convert[20];
409 int signvalue = 0; 403 int signvalue = 0, place = 0, caps = 0;
410 int place = 0;
411 int spadlen = 0; /* amount to space pad */ 404 int spadlen = 0; /* amount to space pad */
412 int zpadlen = 0; /* amount to zero pad */ 405 int zpadlen = 0; /* amount to zero pad */
413 int caps = 0;
414 406
415 if (max < 0) 407 if (max < 0)
416 max = 0; 408 max = 0;
@@ -429,11 +421,10 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen,
429 421
430 if (flags & DP_F_UP) 422 if (flags & DP_F_UP)
431 caps = 1; /* Should characters be upper case? */ 423 caps = 1; /* Should characters be upper case? */
432
433 do { 424 do {
434 convert[place++] = 425 convert[place++] =
435 (caps? "0123456789ABCDEF":"0123456789abcdef") 426 (caps ? "0123456789ABCDEF" : "0123456789abcdef")
436 [uvalue % (unsigned)base]; 427 [uvalue % (unsigned)base];
437 uvalue = (uvalue / (unsigned)base ); 428 uvalue = (uvalue / (unsigned)base );
438 } while (uvalue && (place < 20)); 429 } while (uvalue && (place < 20));
439 if (place == 20) 430 if (place == 20)
@@ -453,7 +444,6 @@ fmtint(char *buffer, size_t *currlen, size_t maxlen,
453 if (flags & DP_F_MINUS) 444 if (flags & DP_F_MINUS)
454 spadlen = -spadlen; /* Left Justifty */ 445 spadlen = -spadlen; /* Left Justifty */
455 446
456
457 /* Spaces */ 447 /* Spaces */
458 while (spadlen > 0) { 448 while (spadlen > 0) {
459 dopr_outch(buffer, currlen, maxlen, ' '); 449 dopr_outch(buffer, currlen, maxlen, ' ');
@@ -512,16 +502,11 @@ static void
512fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue, 502fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue,
513 int min, int max, int flags) 503 int min, int max, int flags)
514{ 504{
515 char iconvert[20]; 505 char iconvert[20], fconvert[20];
516 char fconvert[20]; 506 int signvalue = 0, iplace = 0, fplace = 0;
517 int signvalue = 0;
518 int iplace = 0;
519 int fplace = 0;
520 int padlen = 0; /* amount to pad */ 507 int padlen = 0; /* amount to pad */
521 int zpadlen = 0; 508 int zpadlen = 0, caps = 0;
522 int caps = 0; 509 long intpart, fracpart;
523 long intpart;
524 long fracpart;
525 long double ufvalue; 510 long double ufvalue;
526 511
527 /* 512 /*
@@ -562,7 +547,8 @@ fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue,
562 /* Convert integer part */ 547 /* Convert integer part */
563 do { 548 do {
564 iconvert[iplace++] = 549 iconvert[iplace++] =
565 (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10]; 550 (caps ? "0123456789ABCDEF" : "0123456789abcdef")
551 [intpart % 10];
566 intpart = (intpart / 10); 552 intpart = (intpart / 10);
567 } while(intpart && (iplace < 20)); 553 } while(intpart && (iplace < 20));
568 if (iplace == 20) 554 if (iplace == 20)
@@ -572,7 +558,8 @@ fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue,
572 /* Convert fractional part */ 558 /* Convert fractional part */
573 do { 559 do {
574 fconvert[fplace++] = 560 fconvert[fplace++] =
575 (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10]; 561 (caps ? "0123456789ABCDEF" : "0123456789abcdef")
562 [fracpart % 10];
576 fracpart = (fracpart / 10); 563 fracpart = (fracpart / 10);
577 } while(fracpart && (fplace < 20)); 564 } while(fracpart && (fplace < 20));
578 if (fplace == 20) 565 if (fplace == 20)
@@ -611,8 +598,8 @@ fmtfp(char *buffer, size_t *currlen, size_t maxlen, long double fvalue,
611 dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]); 598 dopr_outch(buffer, currlen, maxlen, iconvert[--iplace]);
612 599
613 /* 600 /*
614 * Decimal point. This should probably use locale to find the correct 601 * Decimal point. This should probably use locale to find the
615 * char to print out. 602 * correct char to print out.
616 */ 603 */
617 dopr_outch(buffer, currlen, maxlen, '.'); 604 dopr_outch(buffer, currlen, maxlen, '.');
618 605
@@ -662,90 +649,4 @@ snprintf(char *str,size_t count,const char *fmt,...)
662 return(strlen(str)); 649 return(strlen(str));
663} 650}
664 651
665#ifdef TEST_SNPRINTF
666int
667main(void)
668{
669#define LONG_STRING 1024
670 char buf1[LONG_STRING];
671 char buf2[LONG_STRING];
672 char *fp_fmt[] = {
673 "%-1.5f",
674 "%1.5f",
675 "%123.9f",
676 "%10.5f",
677 "% 10.5f",
678 "%+22.9f",
679 "%+4.9f",
680 "%01.3f",
681 "%4f",
682 "%3.1f",
683 "%3.2f",
684 NULL
685 };
686 double fp_nums[] = {
687 -1.5,
688 134.21,
689 91340.2,
690 341.1234,
691 0203.9,
692 0.96,
693 0.996,
694 0.9996,
695 1.996,
696 4.136,
697 0
698 };
699 char *int_fmt[] = {
700 "%-1.5d",
701 "%1.5d",
702 "%123.9d",
703 "%5.5d",
704 "%10.5d",
705 "% 10.5d",
706 "%+22.33d",
707 "%01.3d",
708 "%4d",
709 "%lld",
710 "%qd",
711 NULL
712 };
713 long long int_nums[] = { -1, 134, 91340, 341, 0203, 0, 9999999 };
714 int x, y;
715 int fail = 0;
716 int num = 0;
717
718 printf("Testing snprintf format codes against system sprintf...\n");
719
720 for (x = 0; fp_fmt[x] != NULL ; x++) {
721 for (y = 0; fp_nums[y] != 0 ; y++) {
722 snprintf(buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]);
723 sprintf (buf2, fp_fmt[x], fp_nums[y]);
724 if (strcmp (buf1, buf2)) {
725 printf("snprintf doesn't match Format: %s\n\t"
726 "snprintf = %s\n\tsprintf = %s\n",
727 fp_fmt[x], buf1, buf2);
728 fail++;
729 }
730 num++;
731 }
732 }
733 for (x = 0; int_fmt[x] != NULL ; x++) {
734 for (y = 0; int_nums[y] != 0 ; y++) {
735 snprintf(buf1, sizeof (buf1), int_fmt[x], int_nums[y]);
736 sprintf(buf2, int_fmt[x], int_nums[y]);
737 if (strcmp (buf1, buf2)) {
738 printf("snprintf doesn't match Format: %s\n\t"
739 "snprintf = %s\n\tsprintf = %s\n",
740 int_fmt[x], buf1, buf2);
741 fail++;
742 }
743 num++;
744 }
745 }
746 printf("%d tests failed out of %d.\n", fail, num);
747 return(0);
748}
749#endif /* SNPRINTF_TEST */
750
751#endif /* !HAVE_SNPRINTF */ 652#endif /* !HAVE_SNPRINTF */
diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c
index 47b4446dc..93c9ec35e 100644
--- a/openbsd-compat/bsd-waitpid.c
+++ b/openbsd-compat/bsd-waitpid.c
@@ -1,4 +1,6 @@
1/* 1/*
2 * Copyright (c) 2000 Ben Lindstrom. All rights reserved.
3 *
2 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
4 * are met: 6 * are met:
@@ -22,7 +24,7 @@
22 24
23#include "includes.h" 25#include "includes.h"
24 26
25RCSID("$Id: bsd-waitpid.c,v 1.3 2001/03/26 05:35:34 mouring Exp $"); 27RCSID("$Id: bsd-waitpid.c,v 1.5 2003/06/01 03:23:57 mouring Exp $");
26 28
27#ifndef HAVE_WAITPID 29#ifndef HAVE_WAITPID
28#include <errno.h> 30#include <errno.h>
@@ -38,15 +40,16 @@ waitpid(int pid, int *stat_loc, int options)
38 if (pid <= 0) { 40 if (pid <= 0) {
39 if (pid != -1) { 41 if (pid != -1) {
40 errno = EINVAL; 42 errno = EINVAL;
41 return -1; 43 return (-1);
42 } 44 }
43 pid = 0; /* wait4() wants pid=0 for indiscriminate wait. */ 45 /* wait4() wants pid=0 for indiscriminate wait. */
46 pid = 0;
44 } 47 }
45 wait_pid = wait4(pid, &statusp, options, NULL); 48 wait_pid = wait4(pid, &statusp, options, NULL);
46 if (stat_loc) 49 if (stat_loc)
47 *stat_loc = (int) statusp.w_status; 50 *stat_loc = (int) statusp.w_status;
48 51
49 return wait_pid; 52 return (wait_pid);
50} 53}
51 54
52#endif /* !HAVE_WAITPID */ 55#endif /* !HAVE_WAITPID */
diff --git a/openbsd-compat/bsd-waitpid.h b/openbsd-compat/bsd-waitpid.h
index e24edd791..2d853db61 100644
--- a/openbsd-compat/bsd-waitpid.h
+++ b/openbsd-compat/bsd-waitpid.h
@@ -1,4 +1,8 @@
1/* $Id: bsd-waitpid.h,v 1.5 2003/08/29 16:59:52 mouring Exp $ */
2
1/* 3/*
4 * Copyright (c) 2000 Ben Lindstrom. All rights reserved.
5 *
2 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
4 * are met: 8 * are met:
@@ -21,8 +25,6 @@
21 * 25 *
22 */ 26 */
23 27
24/* $Id: bsd-waitpid.h,v 1.2 2001/02/09 01:55:36 djm Exp $ */
25
26#ifndef _BSD_WAITPID_H 28#ifndef _BSD_WAITPID_H
27#define _BSD_WAITPID_H 29#define _BSD_WAITPID_H
28 30
@@ -43,7 +45,7 @@
43#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG) 45#define WCOREDUMP(w) ((_W_INT(w)) & WCOREFLAG)
44 46
45/* Prototype */ 47/* Prototype */
46pid_t waitpid(int pid, int *stat_loc, int options); 48pid_t waitpid(int, int *, int);
47 49
48#endif /* !HAVE_WAITPID */ 50#endif /* !HAVE_WAITPID */
49#endif /* _BSD_WAITPID_H */ 51#endif /* _BSD_WAITPID_H */
diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c
index 7d23b2467..6dd45f6a7 100644
--- a/openbsd-compat/daemon.c
+++ b/openbsd-compat/daemon.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -36,12 +32,11 @@
36#ifndef HAVE_DAEMON 32#ifndef HAVE_DAEMON
37 33
38#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
39static char rcsid[] = "$OpenBSD: daemon.c,v 1.2 1996/08/19 08:22:13 tholo Exp $"; 35static char rcsid[] = "$OpenBSD: daemon.c,v 1.5 2003/07/15 17:32:41 deraadt Exp $";
40#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
41 37
42int 38int
43daemon(nochdir, noclose) 39daemon(int nochdir, int noclose)
44 int nochdir, noclose;
45{ 40{
46 int fd; 41 int fd;
47 42
diff --git a/openbsd-compat/dirname.c b/openbsd-compat/dirname.c
index 35c7d8ec7..1ab7516d8 100644
--- a/openbsd-compat/dirname.c
+++ b/openbsd-compat/dirname.c
@@ -1,46 +1,34 @@
1/* $OpenBSD: dirname.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $ */ 1/* $OpenBSD: dirname.c,v 1.10 2003/06/17 21:56:23 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
5 * All rights reserved.
6 * 5 *
7 * Redistribution and use in source and binary forms, with or without 6 * Permission to use, copy, modify, and distribute this software for any
8 * modification, are permitted provided that the following conditions 7 * purpose with or without fee is hereby granted, provided that the above
9 * are met: 8 * copyright notice and this permission notice appear in all copies.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 9 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 17 */
29 18
30#include "includes.h" 19#include "includes.h"
31#ifndef HAVE_DIRNAME 20#ifndef HAVE_DIRNAME
32 21
33#if defined(LIBC_SCCS) && !defined(lint) 22#ifndef lint
34static char rcsid[] = "$OpenBSD: dirname.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $"; 23static char rcsid[] = "$OpenBSD: dirname.c,v 1.10 2003/06/17 21:56:23 millert Exp $";
35#endif /* LIBC_SCCS and not lint */ 24#endif /* not lint */
36 25
37#include <errno.h> 26#include <errno.h>
38#include <string.h> 27#include <string.h>
39#include <sys/param.h> 28#include <sys/param.h>
40 29
41char * 30char *
42dirname(path) 31dirname(const char *path)
43 const char *path;
44{ 32{
45 static char bname[MAXPATHLEN]; 33 static char bname[MAXPATHLEN];
46 register const char *endp; 34 register const char *endp;
diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c
new file mode 100644
index 000000000..f44924836
--- /dev/null
+++ b/openbsd-compat/fake-rfc2553.c
@@ -0,0 +1,220 @@
1/*
2 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
3 * Copyright (C) 1999 WIDE Project. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the project nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 */
29
30/*
31 * Pseudo-implementation of RFC2553 name / address resolution functions
32 *
33 * But these functions are not implemented correctly. The minimum subset
34 * is implemented for ssh use only. For example, this routine assumes
35 * that ai_family is AF_INET. Don't use it for another purpose.
36 */
37
38#include "includes.h"
39
40RCSID("$Id: fake-rfc2553.c,v 1.4 2003/06/13 22:43:23 djm Exp $");
41
42#ifndef HAVE_GETNAMEINFO
43int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
44 size_t hostlen, char *serv, size_t servlen, int flags)
45{
46 struct sockaddr_in *sin = (struct sockaddr_in *)sa;
47 struct hostent *hp;
48 char tmpserv[16];
49
50 if (serv != NULL) {
51 snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port));
52 if (strlcpy(serv, tmpserv, servlen) >= servlen)
53 return (EAI_MEMORY);
54 }
55
56 if (host != NULL) {
57 if (flags & NI_NUMERICHOST) {
58 if (strlcpy(host, inet_ntoa(sin->sin_addr),
59 hostlen) >= hostlen)
60 return (EAI_MEMORY);
61 else
62 return (0);
63 } else {
64 hp = gethostbyaddr((char *)&sin->sin_addr,
65 sizeof(struct in_addr), AF_INET);
66 if (hp == NULL)
67 return (EAI_NODATA);
68
69 if (strlcpy(host, hp->h_name, hostlen) >= hostlen)
70 return (EAI_MEMORY);
71 else
72 return (0);
73 }
74 }
75 return (0);
76}
77#endif /* !HAVE_GETNAMEINFO */
78
79#ifndef HAVE_GAI_STRERROR
80char *
81gai_strerror(int err)
82{
83 switch (err) {
84 case EAI_NODATA:
85 return ("no address associated with name");
86 case EAI_MEMORY:
87 return ("memory allocation failure.");
88 case EAI_NONAME:
89 return ("nodename nor servname provided, or not known");
90 default:
91 return ("unknown/invalid error.");
92 }
93}
94#endif /* !HAVE_GAI_STRERROR */
95
96#ifndef HAVE_FREEADDRINFO
97void
98freeaddrinfo(struct addrinfo *ai)
99{
100 struct addrinfo *next;
101
102 for(; ai != NULL;) {
103 next = ai->ai_next;
104 free(ai);
105 ai = next;
106 }
107}
108#endif /* !HAVE_FREEADDRINFO */
109
110#ifndef HAVE_GETADDRINFO
111static struct
112addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
113{
114 struct addrinfo *ai;
115
116 ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
117 if (ai == NULL)
118 return (NULL);
119
120 memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
121
122 ai->ai_addr = (struct sockaddr *)(ai + 1);
123 /* XXX -- ssh doesn't use sa_len */
124 ai->ai_addrlen = sizeof(struct sockaddr_in);
125 ai->ai_addr->sa_family = ai->ai_family = AF_INET;
126
127 ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port;
128 ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr;
129
130 /* XXX: the following is not generally correct, but does what we want */
131 if (hints->ai_socktype)
132 ai->ai_socktype = hints->ai_socktype;
133 else
134 ai->ai_socktype = SOCK_STREAM;
135
136 if (hints->ai_protocol)
137 ai->ai_protocol = hints->ai_protocol;
138
139 return (ai);
140}
141
142int
143getaddrinfo(const char *hostname, const char *servname,
144 const struct addrinfo *hints, struct addrinfo **res)
145{
146 struct hostent *hp;
147 struct servent *sp;
148 struct in_addr in;
149 int i;
150 long int port;
151 u_long addr;
152
153 port = 0;
154 if (servname != NULL) {
155 char *cp;
156
157 port = strtol(servname, &cp, 10);
158 if (port > 0 && port <= 65535 && *cp == '\0')
159 port = htons(port);
160 else if ((sp = getservbyname(servname, NULL)) != NULL)
161 port = sp->s_port;
162 else
163 port = 0;
164 }
165
166 if (hints && hints->ai_flags & AI_PASSIVE) {
167 addr = htonl(0x00000000);
168 if (hostname && inet_aton(hostname, &in) != 0)
169 addr = in.s_addr;
170 *res = malloc_ai(port, addr, hints);
171 if (*res == NULL)
172 return (EAI_MEMORY);
173 return (0);
174 }
175
176 if (!hostname) {
177 *res = malloc_ai(port, htonl(0x7f000001), hints);
178 if (*res == NULL)
179 return (EAI_MEMORY);
180 return (0);
181 }
182
183 if (inet_aton(hostname, &in)) {
184 *res = malloc_ai(port, in.s_addr, hints);
185 if (*res == NULL)
186 return (EAI_MEMORY);
187 return (0);
188 }
189
190 /* Don't try DNS if AI_NUMERICHOST is set */
191 if (hints && hints->ai_flags & AI_NUMERICHOST)
192 return (EAI_NONAME);
193
194 hp = gethostbyname(hostname);
195 if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
196 struct addrinfo *cur, *prev;
197
198 cur = prev = *res = NULL;
199 for (i = 0; hp->h_addr_list[i]; i++) {
200 struct in_addr *in = (struct in_addr *)hp->h_addr_list[i];
201
202 cur = malloc_ai(port, in->s_addr, hints);
203 if (cur == NULL) {
204 if (*res != NULL)
205 freeaddrinfo(*res);
206 return (EAI_MEMORY);
207 }
208 if (prev)
209 prev->ai_next = cur;
210 else
211 *res = cur;
212
213 prev = cur;
214 }
215 return (0);
216 }
217
218 return (EAI_NODATA);
219}
220#endif /* !HAVE_GETADDRINFO */
diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h
new file mode 100644
index 000000000..b70b928f8
--- /dev/null
+++ b/openbsd-compat/fake-rfc2553.h
@@ -0,0 +1,154 @@
1/* $Id: fake-rfc2553.h,v 1.6 2003/08/29 16:59:52 mouring Exp $ */
2
3/*
4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
5 * Copyright (C) 1999 WIDE Project. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
30 */
31
32/*
33 * Pseudo-implementation of RFC2553 name / address resolution functions
34 *
35 * But these functions are not implemented correctly. The minimum subset
36 * is implemented for ssh use only. For example, this routine assumes
37 * that ai_family is AF_INET. Don't use it for another purpose.
38 */
39
40#ifndef _FAKE_RFC2553_H
41#define _FAKE_RFC2553_H
42
43#include "includes.h"
44#include "sys/types.h"
45
46/*
47 * First, socket and INET6 related definitions
48 */
49#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
50# define _SS_MAXSIZE 128 /* Implementation specific max size */
51# define _SS_PADSIZE (_SS_MAXSIZE - sizeof (struct sockaddr))
52struct sockaddr_storage {
53 struct sockaddr ss_sa;
54 char __ss_pad2[_SS_PADSIZE];
55};
56# define ss_family ss_sa.sa_family
57#endif /* !HAVE_STRUCT_SOCKADDR_STORAGE */
58
59#ifndef IN6_IS_ADDR_LOOPBACK
60# define IN6_IS_ADDR_LOOPBACK(a) \
61 (((u_int32_t *)(a))[0] == 0 && ((u_int32_t *)(a))[1] == 0 && \
62 ((u_int32_t *)(a))[2] == 0 && ((u_int32_t *)(a))[3] == htonl(1))
63#endif /* !IN6_IS_ADDR_LOOPBACK */
64
65#ifndef HAVE_STRUCT_IN6_ADDR
66struct in6_addr {
67 u_int8_t s6_addr[16];
68};
69#endif /* !HAVE_STRUCT_IN6_ADDR */
70
71#ifndef HAVE_STRUCT_SOCKADDR_IN6
72struct sockaddr_in6 {
73 unsigned short sin6_family;
74 u_int16_t sin6_port;
75 u_int32_t sin6_flowinfo;
76 struct in6_addr sin6_addr;
77};
78#endif /* !HAVE_STRUCT_SOCKADDR_IN6 */
79
80#ifndef AF_INET6
81/* Define it to something that should never appear */
82#define AF_INET6 AF_MAX
83#endif
84
85/*
86 * Next, RFC2553 name / address resolution API
87 */
88
89#ifndef NI_NUMERICHOST
90# define NI_NUMERICHOST (1)
91#endif
92#ifndef NI_NAMEREQD
93# define NI_NAMEREQD (1<<1)
94#endif
95#ifndef NI_NUMERICSERV
96# define NI_NUMERICSERV (1<<2)
97#endif
98
99#ifndef AI_PASSIVE
100# define AI_PASSIVE (1)
101#endif
102#ifndef AI_CANONNAME
103# define AI_CANONNAME (1<<1)
104#endif
105#ifndef AI_NUMERICHOST
106# define AI_NUMERICHOST (1<<2)
107#endif
108
109#ifndef NI_MAXSERV
110# define NI_MAXSERV 32
111#endif /* !NI_MAXSERV */
112#ifndef NI_MAXHOST
113# define NI_MAXHOST 1025
114#endif /* !NI_MAXHOST */
115
116#ifndef EAI_NODATA
117# define EAI_NODATA 1
118# define EAI_MEMORY 2
119# define EAI_NONAME 3
120#endif
121
122#ifndef HAVE_STRUCT_ADDRINFO
123struct addrinfo {
124 int ai_flags; /* AI_PASSIVE, AI_CANONNAME */
125 int ai_family; /* PF_xxx */
126 int ai_socktype; /* SOCK_xxx */
127 int ai_protocol; /* 0 or IPPROTO_xxx for IPv4 and IPv6 */
128 size_t ai_addrlen; /* length of ai_addr */
129 char *ai_canonname; /* canonical name for hostname */
130 struct sockaddr *ai_addr; /* binary address */
131 struct addrinfo *ai_next; /* next structure in linked list */
132};
133#endif /* !HAVE_STRUCT_ADDRINFO */
134
135#ifndef HAVE_GETADDRINFO
136int getaddrinfo(const char *, const char *,
137 const struct addrinfo *, struct addrinfo **);
138#endif /* !HAVE_GETADDRINFO */
139
140#ifndef HAVE_GAI_STRERROR
141char *gai_strerror(int);
142#endif /* !HAVE_GAI_STRERROR */
143
144#ifndef HAVE_FREEADDRINFO
145void freeaddrinfo(struct addrinfo *);
146#endif /* !HAVE_FREEADDRINFO */
147
148#ifndef HAVE_GETNAMEINFO
149int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
150 char *, size_t, int);
151#endif /* !HAVE_GETNAMEINFO */
152
153#endif /* !_FAKE_RFC2553_H */
154
diff --git a/openbsd-compat/getcwd.c b/openbsd-compat/getcwd.c
index f4b98e824..31d1cfe93 100644
--- a/openbsd-compat/getcwd.c
+++ b/openbsd-compat/getcwd.c
@@ -10,6 +10,9 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the University nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
13 * 16 *
14 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -29,7 +32,7 @@
29#if !defined(HAVE_GETCWD) 32#if !defined(HAVE_GETCWD)
30 33
31#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
32static char rcsid[] = "$OpenBSD: getcwd.c,v 1.7 2002/11/24 01:52:27 cloder Exp $"; 35static char rcsid[] = "$OpenBSD: getcwd.c,v 1.9 2003/06/11 21:03:10 deraadt Exp $";
33#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
34 37
35#include <sys/param.h> 38#include <sys/param.h>
@@ -47,7 +50,7 @@ static char rcsid[] = "$OpenBSD: getcwd.c,v 1.7 2002/11/24 01:52:27 cloder Exp $
47 (dp->d_name[1] == '.' && dp->d_name[2] == '\0'))) 50 (dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
48 51
49char * 52char *
50getcwd(char *pt,size_t size) 53getcwd(char *pt, size_t size)
51{ 54{
52 register struct dirent *dp; 55 register struct dirent *dp;
53 register DIR *dir = NULL; 56 register DIR *dir = NULL;
diff --git a/openbsd-compat/getgrouplist.c b/openbsd-compat/getgrouplist.c
index f7a27c339..085cda8c3 100644
--- a/openbsd-compat/getgrouplist.c
+++ b/openbsd-compat/getgrouplist.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -36,7 +32,7 @@
36#ifndef HAVE_GETGROUPLIST 32#ifndef HAVE_GETGROUPLIST
37 33
38#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
39static char rcsid[] = "$OpenBSD: getgrouplist.c,v 1.7 1997/08/19 19:13:27 deraadt Exp $"; 35static char rcsid[] = "$OpenBSD: getgrouplist.c,v 1.9 2003/06/25 21:16:47 deraadt Exp $";
40#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
41 37
42/* 38/*
@@ -44,6 +40,7 @@ static char rcsid[] = "$OpenBSD: getgrouplist.c,v 1.7 1997/08/19 19:13:27 deraad
44 */ 40 */
45#include <sys/types.h> 41#include <sys/types.h>
46#include <string.h> 42#include <string.h>
43#include <unistd.h>
47#include <grp.h> 44#include <grp.h>
48 45
49int 46int
diff --git a/openbsd-compat/getopt.c b/openbsd-compat/getopt.c
index a3fe807ee..2136fbfcc 100644
--- a/openbsd-compat/getopt.c
+++ b/openbsd-compat/getopt.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -35,7 +31,7 @@
35#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET) 31#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
36 32
37#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
38static char *rcsid = "$OpenBSD: getopt.c,v 1.4 2002/12/08 22:57:14 millert Exp $"; 34static char *rcsid = "$OpenBSD: getopt.c,v 1.5 2003/06/02 20:18:37 millert Exp $";
39#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
40 36
41#include <stdio.h> 37#include <stdio.h>
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c
new file mode 100644
index 000000000..44fa2755b
--- /dev/null
+++ b/openbsd-compat/getrrsetbyname.c
@@ -0,0 +1,578 @@
1/* $OpenBSD: getrrsetbyname.c,v 1.7 2003/03/07 07:34:14 itojun Exp $ */
2
3/*
4 * Copyright (c) 2001 Jakob Schlyter. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * Portions Copyright (c) 1999-2001 Internet Software Consortium.
31 *
32 * Permission to use, copy, modify, and distribute this software for any
33 * purpose with or without fee is hereby granted, provided that the above
34 * copyright notice and this permission notice appear in all copies.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
37 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
39 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
40 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
41 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
42 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
43 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 */
45
46#include "includes.h"
47
48#if defined(DNS) && !defined(HAVE_GETRRSETBYNAME)
49
50#include "getrrsetbyname.h"
51
52/* #include "thread_private.h" */
53
54#define ANSWER_BUFFER_SIZE 1024*64
55
56struct dns_query {
57 char *name;
58 u_int16_t type;
59 u_int16_t class;
60 struct dns_query *next;
61};
62
63struct dns_rr {
64 char *name;
65 u_int16_t type;
66 u_int16_t class;
67 u_int16_t ttl;
68 u_int16_t size;
69 void *rdata;
70 struct dns_rr *next;
71};
72
73struct dns_response {
74 HEADER header;
75 struct dns_query *query;
76 struct dns_rr *answer;
77 struct dns_rr *authority;
78 struct dns_rr *additional;
79};
80
81static struct dns_response *parse_dns_response(const u_char *, int);
82static struct dns_query *parse_dns_qsection(const u_char *, int,
83 const u_char **, int);
84static struct dns_rr *parse_dns_rrsection(const u_char *, int, const u_char **,
85 int);
86
87static void free_dns_query(struct dns_query *);
88static void free_dns_rr(struct dns_rr *);
89static void free_dns_response(struct dns_response *);
90
91static int count_dns_rr(struct dns_rr *, u_int16_t, u_int16_t);
92
93/*
94 * Inline versions of get/put short/long. Pointer is advanced.
95 *
96 * These macros demonstrate the property of C whereby it can be
97 * portable or it can be elegant but rarely both.
98 */
99
100#ifndef INT32SZ
101# define INT32SZ 4
102#endif
103#ifndef INT16SZ
104# define INT16SZ 2
105#endif
106
107#ifndef GETSHORT
108#define GETSHORT(s, cp) { \
109 register u_char *t_cp = (u_char *)(cp); \
110 (s) = ((u_int16_t)t_cp[0] << 8) \
111 | ((u_int16_t)t_cp[1]) \
112 ; \
113 (cp) += INT16SZ; \
114}
115#endif
116
117#ifndef GETLONG
118#define GETLONG(l, cp) { \
119 register u_char *t_cp = (u_char *)(cp); \
120 (l) = ((u_int32_t)t_cp[0] << 24) \
121 | ((u_int32_t)t_cp[1] << 16) \
122 | ((u_int32_t)t_cp[2] << 8) \
123 | ((u_int32_t)t_cp[3]) \
124 ; \
125 (cp) += INT32SZ; \
126}
127#endif
128
129/*
130 * Routines to insert/extract short/long's.
131 */
132
133#ifndef HAVE__GETSHORT
134static u_int16_t
135_getshort(msgp)
136 register const u_char *msgp;
137{
138 register u_int16_t u;
139
140 GETSHORT(u, msgp);
141 return (u);
142}
143#endif
144
145#ifndef HAVE__GETLONG
146static u_int32_t
147_getlong(msgp)
148 register const u_char *msgp;
149{
150 register u_int32_t u;
151
152 GETLONG(u, msgp);
153 return (u);
154}
155#endif
156
157int
158getrrsetbyname(const char *hostname, unsigned int rdclass,
159 unsigned int rdtype, unsigned int flags,
160 struct rrsetinfo **res)
161{
162 struct __res_state *_resp = &_res;
163 int result;
164 struct rrsetinfo *rrset = NULL;
165 struct dns_response *response;
166 struct dns_rr *rr;
167 struct rdatainfo *rdata;
168 int length;
169 unsigned int index_ans, index_sig;
170 u_char answer[ANSWER_BUFFER_SIZE];
171
172 /* check for invalid class and type */
173 if (rdclass > 0xffff || rdtype > 0xffff) {
174 result = ERRSET_INVAL;
175 goto fail;
176 }
177
178 /* don't allow queries of class or type ANY */
179 if (rdclass == 0xff || rdtype == 0xff) {
180 result = ERRSET_INVAL;
181 goto fail;
182 }
183
184 /* don't allow flags yet, unimplemented */
185 if (flags) {
186 result = ERRSET_INVAL;
187 goto fail;
188 }
189
190 /* initialize resolver */
191 if ((_resp->options & RES_INIT) == 0 && res_init() == -1) {
192 result = ERRSET_FAIL;
193 goto fail;
194 }
195
196#ifdef DEBUG
197 _resp->options |= RES_DEBUG;
198#endif /* DEBUG */
199
200#ifdef RES_USE_DNSSEC
201 /* turn on DNSSEC if EDNS0 is configured */
202 if (_resp->options & RES_USE_EDNS0)
203 _resp->options |= RES_USE_DNSSEC;
204#endif /* RES_USE_DNSEC */
205
206 /* make query */
207 length = res_query(hostname, (signed int) rdclass, (signed int) rdtype,
208 answer, sizeof(answer));
209 if (length < 0) {
210 switch(h_errno) {
211 case HOST_NOT_FOUND:
212 result = ERRSET_NONAME;
213 goto fail;
214 case NO_DATA:
215 result = ERRSET_NODATA;
216 goto fail;
217 default:
218 result = ERRSET_FAIL;
219 goto fail;
220 }
221 }
222
223 /* parse result */
224 response = parse_dns_response(answer, length);
225 if (response == NULL) {
226 result = ERRSET_FAIL;
227 goto fail;
228 }
229
230 if (response->header.qdcount != 1) {
231 result = ERRSET_FAIL;
232 goto fail;
233 }
234
235 /* initialize rrset */
236 rrset = calloc(1, sizeof(struct rrsetinfo));
237 if (rrset == NULL) {
238 result = ERRSET_NOMEMORY;
239 goto fail;
240 }
241 rrset->rri_rdclass = response->query->class;
242 rrset->rri_rdtype = response->query->type;
243 rrset->rri_ttl = response->answer->ttl;
244 rrset->rri_nrdatas = response->header.ancount;
245
246#ifdef HAVE_HEADER_AD
247 /* check for authenticated data */
248 if (response->header.ad == 1)
249 rrset->rri_flags |= RRSET_VALIDATED;
250#endif
251
252 /* copy name from answer section */
253 length = strlen(response->answer->name);
254 rrset->rri_name = malloc(length + 1);
255 if (rrset->rri_name == NULL) {
256 result = ERRSET_NOMEMORY;
257 goto fail;
258 }
259 strlcpy(rrset->rri_name, response->answer->name, length + 1);
260
261 /* count answers */
262 rrset->rri_nrdatas = count_dns_rr(response->answer, rrset->rri_rdclass,
263 rrset->rri_rdtype);
264 rrset->rri_nsigs = count_dns_rr(response->answer, rrset->rri_rdclass,
265 T_SIG);
266
267 /* allocate memory for answers */
268 rrset->rri_rdatas = calloc(rrset->rri_nrdatas,
269 sizeof(struct rdatainfo));
270 if (rrset->rri_rdatas == NULL) {
271 result = ERRSET_NOMEMORY;
272 goto fail;
273 }
274
275 /* allocate memory for signatures */
276 rrset->rri_sigs = calloc(rrset->rri_nsigs, sizeof(struct rdatainfo));
277 if (rrset->rri_sigs == NULL) {
278 result = ERRSET_NOMEMORY;
279 goto fail;
280 }
281
282 /* copy answers & signatures */
283 for (rr = response->answer, index_ans = 0, index_sig = 0;
284 rr; rr = rr->next) {
285
286 rdata = NULL;
287
288 if (rr->class == rrset->rri_rdclass &&
289 rr->type == rrset->rri_rdtype)
290 rdata = &rrset->rri_rdatas[index_ans++];
291
292 if (rr->class == rrset->rri_rdclass &&
293 rr->type == T_SIG)
294 rdata = &rrset->rri_sigs[index_sig++];
295
296 if (rdata) {
297 rdata->rdi_length = rr->size;
298 rdata->rdi_data = malloc(rr->size);
299
300 if (rdata->rdi_data == NULL) {
301 result = ERRSET_NOMEMORY;
302 goto fail;
303 }
304 memcpy(rdata->rdi_data, rr->rdata, rr->size);
305 }
306 }
307
308 *res = rrset;
309 return (ERRSET_SUCCESS);
310
311fail:
312 if (rrset != NULL)
313 freerrset(rrset);
314 return (result);
315}
316
317void
318freerrset(struct rrsetinfo *rrset)
319{
320 u_int16_t i;
321
322 if (rrset == NULL)
323 return;
324
325 if (rrset->rri_rdatas) {
326 for (i = 0; i < rrset->rri_nrdatas; i++) {
327 if (rrset->rri_rdatas[i].rdi_data == NULL)
328 break;
329 free(rrset->rri_rdatas[i].rdi_data);
330 }
331 free(rrset->rri_rdatas);
332 }
333
334 if (rrset->rri_sigs) {
335 for (i = 0; i < rrset->rri_nsigs; i++) {
336 if (rrset->rri_sigs[i].rdi_data == NULL)
337 break;
338 free(rrset->rri_sigs[i].rdi_data);
339 }
340 free(rrset->rri_sigs);
341 }
342
343 if (rrset->rri_name)
344 free(rrset->rri_name);
345 free(rrset);
346}
347
348/*
349 * DNS response parsing routines
350 */
351static struct dns_response *
352parse_dns_response(const u_char *answer, int size)
353{
354 struct dns_response *resp;
355 const u_char *cp;
356
357 /* allocate memory for the response */
358 resp = calloc(1, sizeof(*resp));
359 if (resp == NULL)
360 return (NULL);
361
362 /* initialize current pointer */
363 cp = answer;
364
365 /* copy header */
366 memcpy(&resp->header, cp, HFIXEDSZ);
367 cp += HFIXEDSZ;
368
369 /* fix header byte order */
370 resp->header.qdcount = ntohs(resp->header.qdcount);
371 resp->header.ancount = ntohs(resp->header.ancount);
372 resp->header.nscount = ntohs(resp->header.nscount);
373 resp->header.arcount = ntohs(resp->header.arcount);
374
375 /* there must be at least one query */
376 if (resp->header.qdcount < 1) {
377 free_dns_response(resp);
378 return (NULL);
379 }
380
381 /* parse query section */
382 resp->query = parse_dns_qsection(answer, size, &cp,
383 resp->header.qdcount);
384 if (resp->header.qdcount && resp->query == NULL) {
385 free_dns_response(resp);
386 return (NULL);
387 }
388
389 /* parse answer section */
390 resp->answer = parse_dns_rrsection(answer, size, &cp,
391 resp->header.ancount);
392 if (resp->header.ancount && resp->answer == NULL) {
393 free_dns_response(resp);
394 return (NULL);
395 }
396
397 /* parse authority section */
398 resp->authority = parse_dns_rrsection(answer, size, &cp,
399 resp->header.nscount);
400 if (resp->header.nscount && resp->authority == NULL) {
401 free_dns_response(resp);
402 return (NULL);
403 }
404
405 /* parse additional section */
406 resp->additional = parse_dns_rrsection(answer, size, &cp,
407 resp->header.arcount);
408 if (resp->header.arcount && resp->additional == NULL) {
409 free_dns_response(resp);
410 return (NULL);
411 }
412
413 return (resp);
414}
415
416static struct dns_query *
417parse_dns_qsection(const u_char *answer, int size, const u_char **cp, int count)
418{
419 struct dns_query *head, *curr, *prev;
420 int i, length;
421 char name[MAXDNAME];
422
423 for (i = 1, head = NULL, prev = NULL; i <= count; i++, prev = curr) {
424
425 /* allocate and initialize struct */
426 curr = calloc(1, sizeof(struct dns_query));
427 if (curr == NULL) {
428 free_dns_query(head);
429 return (NULL);
430 }
431 if (head == NULL)
432 head = curr;
433 if (prev != NULL)
434 prev->next = curr;
435
436 /* name */
437 length = dn_expand(answer, answer + size, *cp, name,
438 sizeof(name));
439 if (length < 0) {
440 free_dns_query(head);
441 return (NULL);
442 }
443 curr->name = strdup(name);
444 if (curr->name == NULL) {
445 free_dns_query(head);
446 return (NULL);
447 }
448 *cp += length;
449
450 /* type */
451 curr->type = _getshort(*cp);
452 *cp += INT16SZ;
453
454 /* class */
455 curr->class = _getshort(*cp);
456 *cp += INT16SZ;
457 }
458
459 return (head);
460}
461
462static struct dns_rr *
463parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, int count)
464{
465 struct dns_rr *head, *curr, *prev;
466 int i, length;
467 char name[MAXDNAME];
468
469 for (i = 1, head = NULL, prev = NULL; i <= count; i++, prev = curr) {
470
471 /* allocate and initialize struct */
472 curr = calloc(1, sizeof(struct dns_rr));
473 if (curr == NULL) {
474 free_dns_rr(head);
475 return (NULL);
476 }
477 if (head == NULL)
478 head = curr;
479 if (prev != NULL)
480 prev->next = curr;
481
482 /* name */
483 length = dn_expand(answer, answer + size, *cp, name,
484 sizeof(name));
485 if (length < 0) {
486 free_dns_rr(head);
487 return (NULL);
488 }
489 curr->name = strdup(name);
490 if (curr->name == NULL) {
491 free_dns_rr(head);
492 return (NULL);
493 }
494 *cp += length;
495
496 /* type */
497 curr->type = _getshort(*cp);
498 *cp += INT16SZ;
499
500 /* class */
501 curr->class = _getshort(*cp);
502 *cp += INT16SZ;
503
504 /* ttl */
505 curr->ttl = _getlong(*cp);
506 *cp += INT32SZ;
507
508 /* rdata size */
509 curr->size = _getshort(*cp);
510 *cp += INT16SZ;
511
512 /* rdata itself */
513 curr->rdata = malloc(curr->size);
514 if (curr->rdata == NULL) {
515 free_dns_rr(head);
516 return (NULL);
517 }
518 memcpy(curr->rdata, *cp, curr->size);
519 *cp += curr->size;
520 }
521
522 return (head);
523}
524
525static void
526free_dns_query(struct dns_query *p)
527{
528 if (p == NULL)
529 return;
530
531 if (p->name)
532 free(p->name);
533 free_dns_query(p->next);
534 free(p);
535}
536
537static void
538free_dns_rr(struct dns_rr *p)
539{
540 if (p == NULL)
541 return;
542
543 if (p->name)
544 free(p->name);
545 if (p->rdata)
546 free(p->rdata);
547 free_dns_rr(p->next);
548 free(p);
549}
550
551static void
552free_dns_response(struct dns_response *p)
553{
554 if (p == NULL)
555 return;
556
557 free_dns_query(p->query);
558 free_dns_rr(p->answer);
559 free_dns_rr(p->authority);
560 free_dns_rr(p->additional);
561 free(p);
562}
563
564static int
565count_dns_rr(struct dns_rr *p, u_int16_t class, u_int16_t type)
566{
567 int n = 0;
568
569 while(p) {
570 if (p->class == class && p->type == type)
571 n++;
572 p = p->next;
573 }
574
575 return (n);
576}
577
578#endif /* defined(DNS) && !defined(HAVE_GETRRSETBYNAME) */
diff --git a/openbsd-compat/getrrsetbyname.h b/openbsd-compat/getrrsetbyname.h
new file mode 100644
index 000000000..6466a54d6
--- /dev/null
+++ b/openbsd-compat/getrrsetbyname.h
@@ -0,0 +1,100 @@
1/* $OpenBSD: getrrsetbyname.c,v 1.4 2001/08/16 18:16:43 ho Exp $ */
2
3/*
4 * Copyright (c) 2001 Jakob Schlyter. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/*
30 * Portions Copyright (c) 1999-2001 Internet Software Consortium.
31 *
32 * Permission to use, copy, modify, and distribute this software for any
33 * purpose with or without fee is hereby granted, provided that the above
34 * copyright notice and this permission notice appear in all copies.
35 *
36 * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
37 * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
38 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
39 * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
40 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
41 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
42 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
43 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
44 */
45
46#ifndef _GETRRSETBYNAME_H
47#define _GETRRSETBYNAME_H
48
49#include "includes.h"
50
51#if defined(DNS) && !defined(HAVE_GETRRSETBYNAME)
52
53#include <sys/types.h>
54#include <netinet/in.h>
55#include <arpa/nameser.h>
56#include <netdb.h>
57#include <resolv.h>
58
59/*
60 * Flags for getrrsetbyname()
61 */
62#ifndef RRSET_VALIDATED
63# define RRSET_VALIDATED 1
64#endif
65
66/*
67 * Return codes for getrrsetbyname()
68 */
69#ifndef ERRSET_SUCCESS
70# define ERRSET_SUCCESS 0
71# define ERRSET_NOMEMORY 1
72# define ERRSET_FAIL 2
73# define ERRSET_INVAL 3
74# define ERRSET_NONAME 4
75# define ERRSET_NODATA 5
76#endif
77
78struct rdatainfo {
79 unsigned int rdi_length; /* length of data */
80 unsigned char *rdi_data; /* record data */
81};
82
83struct rrsetinfo {
84 unsigned int rri_flags; /* RRSET_VALIDATED ... */
85 unsigned int rri_rdclass; /* class number */
86 unsigned int rri_rdtype; /* RR type number */
87 unsigned int rri_ttl; /* time to live */
88 unsigned int rri_nrdatas; /* size of rdatas array */
89 unsigned int rri_nsigs; /* size of sigs array */
90 char *rri_name; /* canonical name */
91 struct rdatainfo *rri_rdatas; /* individual records */
92 struct rdatainfo *rri_sigs; /* individual signatures */
93};
94
95int getrrsetbyname(const char *, unsigned int, unsigned int, unsigned int, struct rrsetinfo **);
96void freerrset(struct rrsetinfo *);
97
98#endif /* defined(DNS) && !defined(HAVE_GETRRSETBYNAME) */
99
100#endif /* _GETRRSETBYNAME_H */
diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c
index e928a2272..50f35c304 100644
--- a/openbsd-compat/glob.c
+++ b/openbsd-compat/glob.c
@@ -13,11 +13,7 @@
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software 16 * 3. Neither the name of the University nor the names of its contributors
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 17 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 18 * without specific prior written permission.
23 * 19 *
@@ -56,7 +52,7 @@ get_arg_max(void)
56#if 0 52#if 0
57static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93"; 53static char sccsid[] = "@(#)glob.c 8.3 (Berkeley) 10/13/93";
58#else 54#else
59static char rcsid[] = "$OpenBSD: glob.c,v 1.20 2002/06/14 21:34:58 todd Exp $"; 55static char rcsid[] = "$OpenBSD: glob.c,v 1.22 2003/06/25 21:16:47 deraadt Exp $";
60#endif 56#endif
61#endif /* LIBC_SCCS and not lint */ 57#endif /* LIBC_SCCS and not lint */
62 58
@@ -615,7 +611,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
615 * and dirent.h as taking pointers to differently typed opaque 611 * and dirent.h as taking pointers to differently typed opaque
616 * structures. 612 * structures.
617 */ 613 */
618 struct dirent *(*readdirfunc)(); 614 struct dirent *(*readdirfunc)(void *);
619 615
620 if (pathend > pathend_last) 616 if (pathend > pathend_last)
621 return (1); 617 return (1);
@@ -640,7 +636,7 @@ glob3(pathbuf, pathbuf_last, pathend, pathend_last, pattern, pattern_last,
640 if (pglob->gl_flags & GLOB_ALTDIRFUNC) 636 if (pglob->gl_flags & GLOB_ALTDIRFUNC)
641 readdirfunc = pglob->gl_readdir; 637 readdirfunc = pglob->gl_readdir;
642 else 638 else
643 readdirfunc = readdir; 639 readdirfunc = (struct dirent *(*)(void *))readdir;
644 while ((dp = (*readdirfunc)(dirp))) { 640 while ((dp = (*readdirfunc)(dirp))) {
645 register u_char *sc; 641 register u_char *sc;
646 register Char *dc; 642 register Char *dc;
diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h
index 6421f7049..aceddbc48 100644
--- a/openbsd-compat/glob.h
+++ b/openbsd-compat/glob.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: glob.h,v 1.7 2002/02/17 19:42:21 millert Exp $ */ 1/* $OpenBSD: glob.h,v 1.8 2003/06/02 19:34:12 millert Exp $ */
2/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */ 2/* $NetBSD: glob.h,v 1.5 1994/10/26 00:55:56 cgd Exp $ */
3 3
4/* 4/*
@@ -16,11 +16,7 @@
16 * 2. Redistributions in binary form must reproduce the above copyright 16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the 17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution. 18 * documentation and/or other materials provided with the distribution.
19 * 3. All advertising materials mentioning features or use of this software 19 * 3. Neither the name of the University nor the names of its contributors
20 * must display the following acknowledgement:
21 * This product includes software developed by the University of
22 * California, Berkeley and its contributors.
23 * 4. Neither the name of the University nor the names of its contributors
24 * may be used to endorse or promote products derived from this software 20 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission. 21 * without specific prior written permission.
26 * 22 *
diff --git a/openbsd-compat/inet_aton.c b/openbsd-compat/inet_aton.c
index 1fc001da6..5de49868d 100644
--- a/openbsd-compat/inet_aton.c
+++ b/openbsd-compat/inet_aton.c
@@ -1,8 +1,6 @@
1/* $OpenBSD: inet_addr.c,v 1.6 1999/05/03 22:31:14 yanick Exp $ */ 1/* $OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $ */
2 2
3/* 3/*
4 * ++Copyright++ 1983, 1990, 1993
5 * -
6 * Copyright (c) 1983, 1990, 1993 4 * Copyright (c) 1983, 1990, 1993
7 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
8 * 6 *
@@ -14,11 +12,7 @@
14 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software 15 * 3. Neither the name of the University nor the names of its contributors
18 * must display the following acknowledgement:
19 * This product includes software developed by the University of
20 * California, Berkeley and its contributors.
21 * 4. Neither the name of the University nor the names of its contributors
22 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
23 * without specific prior written permission. 17 * without specific prior written permission.
24 * 18 *
@@ -64,7 +58,7 @@
64static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; 58static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93";
65static char rcsid[] = "$From: inet_addr.c,v 8.5 1996/08/05 08:31:35 vixie Exp $"; 59static char rcsid[] = "$From: inet_addr.c,v 8.5 1996/08/05 08:31:35 vixie Exp $";
66#else 60#else
67static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.6 1999/05/03 22:31:14 yanick Exp $"; 61static char rcsid[] = "$OpenBSD: inet_addr.c,v 1.7 2003/06/02 20:18:35 millert Exp $";
68#endif 62#endif
69#endif /* LIBC_SCCS and not lint */ 63#endif /* LIBC_SCCS and not lint */
70 64
diff --git a/openbsd-compat/inet_ntoa.c b/openbsd-compat/inet_ntoa.c
index ac5f56708..e0384491d 100644
--- a/openbsd-compat/inet_ntoa.c
+++ b/openbsd-compat/inet_ntoa.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -36,7 +32,7 @@
36#if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA) 32#if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA)
37 33
38#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
39static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.3 2002/06/27 10:14:01 itojun Exp $"; 35static char rcsid[] = "$OpenBSD: inet_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Exp $";
40#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
41 37
42/* 38/*
diff --git a/openbsd-compat/inet_ntop.c b/openbsd-compat/inet_ntop.c
index 3bea519af..075eac44f 100644
--- a/openbsd-compat/inet_ntop.c
+++ b/openbsd-compat/inet_ntop.c
@@ -31,7 +31,6 @@ static char rcsid[] = "$OpenBSD: inet_ntop.c,v 1.5 2002/08/23 16:27:31 itojun Ex
31#include <sys/param.h> 31#include <sys/param.h>
32#include <sys/types.h> 32#include <sys/types.h>
33#include <sys/socket.h> 33#include <sys/socket.h>
34#include "openbsd-compat/fake-socket.h"
35#include <netinet/in.h> 34#include <netinet/in.h>
36#include <arpa/inet.h> 35#include <arpa/inet.h>
37#ifndef HAVE_CYGWIN 36#ifndef HAVE_CYGWIN
diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c
index c951050c0..2cd747835 100644
--- a/openbsd-compat/mktemp.c
+++ b/openbsd-compat/mktemp.c
@@ -13,11 +13,7 @@
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software 16 * 3. Neither the name of the University nor the names of its contributors
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 17 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 18 * without specific prior written permission.
23 * 19 *
@@ -39,7 +35,7 @@
39#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP) 35#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP)
40 36
41#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
42static char rcsid[] = "$OpenBSD: mktemp.c,v 1.16 2002/05/27 18:20:45 millert Exp $"; 38static char rcsid[] = "$OpenBSD: mktemp.c,v 1.17 2003/06/02 20:18:37 millert Exp $";
43#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
44 40
45#ifdef HAVE_CYGWIN 41#ifdef HAVE_CYGWIN
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index c3e19b9cb..852948c54 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -1,49 +1,168 @@
1/* $Id: openbsd-compat.h,v 1.19 2003/02/24 01:55:56 djm Exp $ */ 1/* $Id: openbsd-compat.h,v 1.24 2003/08/29 16:59:52 mouring Exp $ */
2 2
3#ifndef _OPENBSD_H 3/*
4#define _OPENBSD_H 4 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
5 * Copyright (c) 2003 Ben Lindstrom. All rights reserved.
6 * Copyright (c) 2002 Tim Rice. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
5 28
6#include "config.h" 29#ifndef _OPENBSD_COMPAT_H
30#define _OPENBSD_COMPAT_H
31
32#include "includes.h"
7 33
8/* OpenBSD function replacements */ 34/* OpenBSD function replacements */
9#include "basename.h"
10#include "bindresvport.h"
11#include "getcwd.h"
12#include "realpath.h"
13#include "rresvport.h"
14#include "strlcpy.h"
15#include "strlcat.h"
16#include "strmode.h"
17#include "mktemp.h"
18#include "daemon.h"
19#include "dirname.h"
20#include "base64.h" 35#include "base64.h"
21#include "sigact.h" 36#include "sigact.h"
22#include "inet_ntoa.h"
23#include "inet_ntop.h"
24#include "strsep.h"
25#include "setproctitle.h"
26#include "getgrouplist.h"
27#include "glob.h" 37#include "glob.h"
28#include "readpassphrase.h" 38#include "readpassphrase.h"
29#include "getopt.h"
30#include "vis.h" 39#include "vis.h"
40#include "getrrsetbyname.h"
41
42
43#ifndef HAVE_BASENAME
44char *basename(const char *path);
45#endif
46
47#ifndef HAVE_BINDRESVPORT_SA
48int bindresvport_sa(int sd, struct sockaddr *sa);
49#endif
50
51#ifndef HAVE_GETCWD
52char *getcwd(char *pt, size_t size);
53#endif
54
55#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
56char *realpath(const char *path, char *resolved);
57#endif
58
59#ifndef HAVE_RRESVPORT_AF
60int rresvport_af(int *alport, sa_family_t af);
61#endif
62
63#ifndef HAVE_STRLCPY
64/* #include <sys/types.h> XXX Still needed? */
65size_t strlcpy(char *dst, const char *src, size_t siz);
66#endif
67
68#ifndef HAVE_STRLCAT
69/* #include <sys/types.h> XXX Still needed? */
70size_t strlcat(char *dst, const char *src, size_t siz);
71#endif
72
73#ifndef HAVE_SETENV
74int setenv(register const char *name, register const char *value, int rewrite);
75#endif
76
77#ifndef HAVE_STRMODE
78void strmode(int mode, char *p);
79#endif
80
81#if !defined(HAVE_MKDTEMP) || defined(HAVE_STRICT_MKSTEMP)
82int mkstemps(char *path, int slen);
83int mkstemp(char *path);
84char *mkdtemp(char *path);
85#endif
86
87#ifndef HAVE_DAEMON
88int daemon(int nochdir, int noclose);
89#endif
90
91#ifndef HAVE_DIRNAME
92char *dirname(const char *path);
93#endif
94
95#if defined(BROKEN_INET_NTOA) || !defined(HAVE_INET_NTOA)
96char *inet_ntoa(struct in_addr in);
97#endif
98
99#ifndef HAVE_INET_NTOP
100const char *inet_ntop(int af, const void *src, char *dst, size_t size);
101#endif
102
103#ifndef HAVE_INET_ATON
104int inet_aton(const char *cp, struct in_addr *addr);
105#endif
106
107#ifndef HAVE_STRSEP
108char *strsep(char **stringp, const char *delim);
109#endif
110
111#ifndef HAVE_SETPROCTITLE
112void setproctitle(const char *fmt, ...);
113void compat_init_setproctitle(int argc, char *argv[]);
114#endif
115
116#ifndef HAVE_GETGROUPLIST
117/* #include <grp.h> XXXX Still needed ? */
118int getgrouplist(const char *, gid_t, gid_t *, int *);
119#endif
120
121#if !defined(HAVE_GETOPT) || !defined(HAVE_GETOPT_OPTRESET)
122int BSDgetopt(int argc, char * const *argv, const char *opts);
123#endif
124
31 125
32/* Home grown routines */ 126/* Home grown routines */
33#include "bsd-arc4random.h"
34#include "bsd-getpeereid.h"
35#include "bsd-misc.h" 127#include "bsd-misc.h"
36#include "bsd-snprintf.h"
37#include "bsd-waitpid.h" 128#include "bsd-waitpid.h"
38 129
130/*#include <sys/types.h> XXX Still needed? * For uid_t, gid_t * */
131
132#ifndef HAVE_GETPEEREID
133int getpeereid(int , uid_t *, gid_t *);
134#endif
135
136#ifndef HAVE_ARC4RANDOM
137unsigned int arc4random(void);
138void arc4random_stir(void);
139#endif /* !HAVE_ARC4RANDOM */
140
141
142
143
144/* #include <sys/types.h> XXX needed? For size_t */
145
146#ifndef HAVE_SNPRINTF
147int snprintf(char *, size_t, const char *, ...);
148#endif
149
150#ifndef HAVE_VSNPRINTF
151int vsnprintf(char *, size_t, const char *, va_list);
152#endif
153
154void *xmmap(size_t size);
155char *xcrypt(const char *password, const char *salt);
156char *shadow_pw(struct passwd *pw);
157
158
39/* rfc2553 socket API replacements */ 159/* rfc2553 socket API replacements */
40#include "fake-getaddrinfo.h" 160#include "fake-rfc2553.h"
41#include "fake-getnameinfo.h"
42#include "fake-socket.h"
43 161
44/* Routines for a single OS platform */ 162/* Routines for a single OS platform */
45#include "bsd-cray.h" 163#include "bsd-cray.h"
164#include "bsd-cygwin_util.h"
46#include "port-irix.h" 165#include "port-irix.h"
47#include "port-aix.h" 166#include "port-aix.h"
48 167
49#endif /* _OPENBSD_H */ 168#endif /* _OPENBSD_COMPAT_H */
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index 4c96a3171..7a981634b 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -24,11 +24,17 @@
24 * 24 *
25 */ 25 */
26#include "includes.h" 26#include "includes.h"
27#include "ssh.h"
28#include "log.h"
29#include "servconf.h"
27 30
28#ifdef _AIX 31#ifdef _AIX
29 32
30#include <uinfo.h> 33#include <uinfo.h>
31#include <../xmalloc.h> 34#include <../xmalloc.h>
35#include "port-aix.h"
36
37extern ServerOptions options;
32 38
33/* 39/*
34 * AIX has a "usrinfo" area where logname and other stuff is stored - 40 * AIX has a "usrinfo" area where logname and other stuff is stored -
@@ -41,16 +47,95 @@ void
41aix_usrinfo(struct passwd *pw) 47aix_usrinfo(struct passwd *pw)
42{ 48{
43 u_int i; 49 u_int i;
50 size_t len;
44 char *cp; 51 char *cp;
45 52
46 cp = xmalloc(16 + 2 * strlen(pw->pw_name)); 53 len = sizeof("LOGNAME= NAME= ") + (2 * strlen(pw->pw_name));
47 i = sprintf(cp, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, 0, 54 cp = xmalloc(len);
48 pw->pw_name, 0); 55
56 i = snprintf(cp, len, "LOGNAME=%s%cNAME=%s%c", pw->pw_name, '\0',
57 pw->pw_name, '\0');
49 if (usrinfo(SETUINFO, cp, i) == -1) 58 if (usrinfo(SETUINFO, cp, i) == -1)
50 fatal("Couldn't set usrinfo: %s", strerror(errno)); 59 fatal("Couldn't set usrinfo: %s", strerror(errno));
51 debug3("AIX/UsrInfo: set len %d", i); 60 debug3("AIX/UsrInfo: set len %d", i);
61
52 xfree(cp); 62 xfree(cp);
53} 63}
54 64
65#ifdef WITH_AIXAUTHENTICATE
66/*
67 * Remove embedded newlines in string (if any).
68 * Used before logging messages returned by AIX authentication functions
69 * so the message is logged on one line.
70 */
71void
72aix_remove_embedded_newlines(char *p)
73{
74 if (p == NULL)
75 return;
76
77 for (; *p; p++) {
78 if (*p == '\n')
79 *p = ' ';
80 }
81 /* Remove trailing whitespace */
82 if (*--p == ' ')
83 *p = '\0';
84}
85#endif /* WITH_AIXAUTHENTICATE */
86
87# ifdef CUSTOM_FAILED_LOGIN
88/*
89 * record_failed_login: generic "login failed" interface function
90 */
91void
92record_failed_login(const char *user, const char *ttyname)
93{
94 char *hostname = get_canonical_hostname(options.use_dns);
95
96 if (geteuid() != 0)
97 return;
98
99 aix_setauthdb(user);
100# ifdef AIX_LOGINFAILED_4ARG
101 loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH);
102# else
103 loginfailed((char *)user, hostname, (char *)ttyname);
104# endif
105}
106
107/*
108 * If we have setauthdb, retrieve the password registry for the user's
109 * account then feed it to setauthdb. This may load registry-specific method
110 * code. If we don't have setauthdb or have already called it this is a no-op.
111 */
112void
113aix_setauthdb(const char *user)
114{
115# ifdef HAVE_SETAUTHDB
116 static char *registry = NULL;
117
118 if (registry != NULL) /* have already done setauthdb */
119 return;
120
121 if (setuserdb(S_READ) == -1) {
122 debug3("%s: Could not open userdb to read", __func__);
123 return;
124 }
125
126 if (getuserattr((char *)user, S_REGISTRY, &registry, SEC_CHAR) == 0) {
127 if (setauthdb(registry, NULL) == 0)
128 debug3("%s: AIX/setauthdb set registry %s", __func__,
129 registry);
130 else
131 debug3("%s: AIX/setauthdb set registry %s failed: %s",
132 __func__, registry, strerror(errno));
133 } else
134 debug3("%s: Could not read S_REGISTRY for user: %s", __func__,
135 strerror(errno));
136 enduserdb();
137# endif
138}
139# endif /* CUSTOM_FAILED_LOGIN */
55#endif /* _AIX */ 140#endif /* _AIX */
56 141
diff --git a/openbsd-compat/port-aix.h b/openbsd-compat/port-aix.h
index 4abe00316..09e7f9e97 100644
--- a/openbsd-compat/port-aix.h
+++ b/openbsd-compat/port-aix.h
@@ -1,3 +1,5 @@
1/* $Id: port-aix.h,v 1.14 2003/08/29 16:59:52 mouring Exp $ */
2
1/* 3/*
2 * 4 *
3 * Copyright (c) 2001 Gert Doering. All rights reserved. 5 * Copyright (c) 2001 Gert Doering. All rights reserved.
@@ -21,11 +23,24 @@
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 */ 26 */
26 27
27#ifdef _AIX 28#ifdef _AIX
28 29
30#ifdef WITH_AIXAUTHENTICATE
31# include <login.h>
32# include <userpw.h>
33# include <usersec.h>
34# ifdef HAVE_SYS_AUDIT_H
35# include <sys/audit.h>
36# endif
37#endif
38
39/* Some versions define r_type in the above headers, which causes a conflict */
40#ifdef r_type
41# undef r_type
42#endif
43
29/* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */ 44/* AIX 4.2.x doesn't have nanosleep but does have nsleep which is equivalent */
30#if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP) 45#if !defined(HAVE_NANOSLEEP) && defined(HAVE_NSLEEP)
31# define nanosleep(a,b) nsleep(a,b) 46# define nanosleep(a,b) nsleep(a,b)
@@ -36,5 +51,12 @@
36# include <sys/timers.h> 51# include <sys/timers.h>
37#endif 52#endif
38 53
39void aix_usrinfo(struct passwd *pw); 54#ifdef WITH_AIXAUTHENTICATE
55# define CUSTOM_FAILED_LOGIN 1
56void record_failed_login(const char *, const char *);
57void aix_setauthdb(const char *);
58#endif
59
60void aix_usrinfo(struct passwd *);
61void aix_remove_embedded_newlines(char *);
40#endif /* _AIX */ 62#endif /* _AIX */
diff --git a/openbsd-compat/port-irix.c b/openbsd-compat/port-irix.c
index a63ec429a..aa6db1cf8 100644
--- a/openbsd-compat/port-irix.c
+++ b/openbsd-compat/port-irix.c
@@ -1,15 +1,42 @@
1/*
2 * Copyright (c) 2000 Denis Parker. All rights reserved.
3 * Copyright (c) 2000 Michael Stone. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
1#include "includes.h" 26#include "includes.h"
2 27
3#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) 28#if defined(WITH_IRIX_PROJECT) || \
29 defined(WITH_IRIX_JOBS) || \
30 defined(WITH_IRIX_ARRAY)
4 31
5#ifdef WITH_IRIX_PROJECT 32#ifdef WITH_IRIX_PROJECT
6#include <proj.h> 33# include <proj.h>
7#endif /* WITH_IRIX_PROJECT */ 34#endif /* WITH_IRIX_PROJECT */
8#ifdef WITH_IRIX_JOBS 35#ifdef WITH_IRIX_JOBS
9#include <sys/resource.h> 36# include <sys/resource.h>
10#endif 37#endif
11#ifdef WITH_IRIX_AUDIT 38#ifdef WITH_IRIX_AUDIT
12#include <sat.h> 39# include <sat.h>
13#endif /* WITH_IRIX_AUDIT */ 40#endif /* WITH_IRIX_AUDIT */
14 41
15void 42void
@@ -17,14 +44,12 @@ irix_setusercontext(struct passwd *pw)
17{ 44{
18#ifdef WITH_IRIX_PROJECT 45#ifdef WITH_IRIX_PROJECT
19 prid_t projid; 46 prid_t projid;
20#endif /* WITH_IRIX_PROJECT */ 47#endif
21#ifdef WITH_IRIX_JOBS 48#ifdef WITH_IRIX_JOBS
22 jid_t jid = 0; 49 jid_t jid = 0;
23#else 50#elif defined(WITH_IRIX_ARRAY)
24# ifdef WITH_IRIX_ARRAY
25 int jid = 0; 51 int jid = 0;
26# endif /* WITH_IRIX_ARRAY */ 52#endif
27#endif /* WITH_IRIX_JOBS */
28 53
29#ifdef WITH_IRIX_JOBS 54#ifdef WITH_IRIX_JOBS
30 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive"); 55 jid = jlimit_startjob(pw->pw_name, pw->pw_uid, "interactive");
diff --git a/openbsd-compat/port-irix.h b/openbsd-compat/port-irix.h
index 2dd3c2e25..67c486307 100644
--- a/openbsd-compat/port-irix.h
+++ b/openbsd-compat/port-irix.h
@@ -1,5 +1,39 @@
1#if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) 1/* $Id: port-irix.h,v 1.4 2003/08/29 16:59:52 mouring Exp $ */
2
3/*
4 * Copyright (c) 2000 Denis Parker. All rights reserved.
5 * Copyright (c) 2000 Michael Stone. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28#ifndef _PORT_IRIX_H
29#define _PORT_IRIX_H
30
31#if defined(WITH_IRIX_PROJECT) || \
32 defined(WITH_IRIX_JOBS) || \
33 defined(WITH_IRIX_ARRAY)
2 34
3void irix_setusercontext(struct passwd *pw); 35void irix_setusercontext(struct passwd *pw);
4 36
5#endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */ 37#endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
38
39#endif /* ! _PORT_IRIX_H */
diff --git a/openbsd-compat/readpassphrase.c b/openbsd-compat/readpassphrase.c
index 4e549b62b..0d0baf569 100644
--- a/openbsd-compat/readpassphrase.c
+++ b/openbsd-compat/readpassphrase.c
@@ -1,34 +1,27 @@
1/* $OpenBSD: readpassphrase.c,v 1.14 2002/06/28 01:43:58 millert Exp $ */ 1/* $OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000-2002 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 2000-2002 Todd C. Miller <Todd.Miller@courtesan.com>
5 * All rights reserved.
6 * 5 *
7 * Redistribution and use in source and binary forms, with or without 6 * Permission to use, copy, modify, and distribute this software for any
8 * modification, are permitted provided that the following conditions 7 * purpose with or without fee is hereby granted, provided that the above
9 * are met: 8 * copyright notice and this permission notice appear in all copies.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 9 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 17 *
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 18 * Sponsored in part by the Defense Advanced Research Projects
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 19 * Agency (DARPA) and Air Force Research Laboratory, Air Force
20 * Materiel Command, USAF, under agreement number F39502-99-1-0512.
28 */ 21 */
29 22
30#if defined(LIBC_SCCS) && !defined(lint) 23#if defined(LIBC_SCCS) && !defined(lint)
31static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.14 2002/06/28 01:43:58 millert Exp $"; 24static const char rcsid[] = "$OpenBSD: readpassphrase.c,v 1.16 2003/06/17 21:56:23 millert Exp $";
32#endif /* LIBC_SCCS and not lint */ 25#endif /* LIBC_SCCS and not lint */
33 26
34#include "includes.h" 27#include "includes.h"
@@ -185,6 +178,7 @@ getpass(const char *prompt)
185 178
186static void handler(int s) 179static void handler(int s)
187{ 180{
181
188 signo = s; 182 signo = s;
189} 183}
190#endif /* HAVE_READPASSPHRASE */ 184#endif /* HAVE_READPASSPHRASE */
diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c
index b9035ca22..77da14e7c 100644
--- a/openbsd-compat/realpath.c
+++ b/openbsd-compat/realpath.c
@@ -13,6 +13,9 @@
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 * may be used to endorse or promote products derived from this software
18 * without specific prior written permission.
16 * 19 *
17 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -32,7 +35,7 @@
32#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) 35#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
33 36
34#if defined(LIBC_SCCS) && !defined(lint) 37#if defined(LIBC_SCCS) && !defined(lint)
35static char *rcsid = "$OpenBSD: realpath.c,v 1.7 2002/05/24 21:22:37 deraadt Exp $"; 38static char *rcsid = "$OpenBSD: realpath.c,v 1.10 2003/08/01 21:04:59 millert Exp $";
36#endif /* LIBC_SCCS and not lint */ 39#endif /* LIBC_SCCS and not lint */
37 40
38#include <sys/param.h> 41#include <sys/param.h>
@@ -62,7 +65,7 @@ char *
62realpath(const char *path, char *resolved) 65realpath(const char *path, char *resolved)
63{ 66{
64 struct stat sb; 67 struct stat sb;
65 int fd, n, rootd, serrno = 0; 68 int fd, n, needslash, serrno = 0;
66 char *p, *q, wbuf[MAXPATHLEN], start[MAXPATHLEN]; 69 char *p, *q, wbuf[MAXPATHLEN], start[MAXPATHLEN];
67 int symlinks = 0; 70 int symlinks = 0;
68 71
@@ -138,18 +141,18 @@ loop:
138 * happens if the last component is empty, or the dirname is root. 141 * happens if the last component is empty, or the dirname is root.
139 */ 142 */
140 if (resolved[0] == '/' && resolved[1] == '\0') 143 if (resolved[0] == '/' && resolved[1] == '\0')
141 rootd = 1; 144 needslash = 0;
142 else 145 else
143 rootd = 0; 146 needslash = 1;
144 147
145 if (*wbuf) { 148 if (*wbuf) {
146 if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { 149 if (strlen(resolved) + strlen(wbuf) + needslash >= MAXPATHLEN) {
147 serrno = ENAMETOOLONG; 150 serrno = ENAMETOOLONG;
148 goto err1; 151 goto err1;
149 } 152 }
150 if (rootd == 0) 153 if (needslash == 0)
151 (void)strcat(resolved, "/"); 154 strlcat(resolved, "/", MAXPATHLEN);
152 (void)strcat(resolved, wbuf); 155 strlcat(resolved, wbuf, MAXPATHLEN);
153 } 156 }
154 157
155 /* Go back to where we came from. */ 158 /* Go back to where we came from. */
diff --git a/openbsd-compat/rresvport.c b/openbsd-compat/rresvport.c
index 9f058961d..608a3b184 100644
--- a/openbsd-compat/rresvport.c
+++ b/openbsd-compat/rresvport.c
@@ -11,12 +11,7 @@
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 3. All advertising materials mentioning features or use of this software 14 * 3. Neither the name of the University nor the names of its contributors
15 * must display the following acknowledgement:
16 * This product includes software developed by the University of
17 * California, Berkeley and its contributors.
18 * This product includes software developed by Theo de Raadt.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software 15 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission. 16 * without specific prior written permission.
22 * 17 *
@@ -38,7 +33,7 @@
38#ifndef HAVE_RRESVPORT_AF 33#ifndef HAVE_RRESVPORT_AF
39 34
40#if defined(LIBC_SCCS) && !defined(lint) 35#if defined(LIBC_SCCS) && !defined(lint)
41static char *rcsid = "$OpenBSD: rresvport.c,v 1.5 2000/01/26 03:43:20 deraadt Exp $"; 36static char *rcsid = "$OpenBSD: rresvport.c,v 1.6 2003/06/03 02:11:35 deraadt Exp $";
42#endif /* LIBC_SCCS and not lint */ 37#endif /* LIBC_SCCS and not lint */
43 38
44#include "includes.h" 39#include "includes.h"
diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c
index e5c5de62e..c9941c195 100644
--- a/openbsd-compat/setenv.c
+++ b/openbsd-compat/setenv.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -35,7 +31,7 @@
35#ifndef HAVE_SETENV 31#ifndef HAVE_SETENV
36 32
37#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
38static char *rcsid = "$OpenBSD: setenv.c,v 1.5 2002/12/10 22:44:13 mickey Exp $"; 34static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $";
39#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
40 36
41#include <stdlib.h> 37#include <stdlib.h>
diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c
index 07af7e9c0..b41100fc6 100644
--- a/openbsd-compat/setproctitle.c
+++ b/openbsd-compat/setproctitle.c
@@ -1,41 +1,34 @@
1/* 1/* Based on conf.c from UCB sendmail 8.8.8 */
2 * Based on src/backend/utils/misc/pg_status.c from
3 * PostgreSQL Database Management System
4 *
5 * Portions Copyright (c) 1996-2001, The PostgreSQL Global Development Group
6 *
7 * Portions Copyright (c) 1994, The Regents of the University of California
8 *
9 * Permission to use, copy, modify, and distribute this software and its
10 * documentation for any purpose, without fee, and without a written agreement
11 * is hereby granted, provided that the above copyright notice and this
12 * paragraph and the following two paragraphs appear in all copies.
13 *
14 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
15 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
16 * LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
17 * DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
18 * POSSIBILITY OF SUCH DAMAGE.
19 *
20 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
21 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22 * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
23 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
24 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 */
26 2
27/*-------------------------------------------------------------------- 3/*
28 * ps_status.c 4 * Copyright 2003 Damien Miller
29 * 5 * Copyright (c) 1983, 1995-1997 Eric P. Allman
30 * Routines to support changing the ps display of PostgreSQL backends 6 * Copyright (c) 1988, 1993
31 * to contain some useful information. Mechanism differs wildly across 7 * The Regents of the University of California. All rights reserved.
32 * platforms.
33 * 8 *
34 * $Header: /var/cvs/openssh/openbsd-compat/setproctitle.c,v 1.5 2003/01/20 02:15:11 djm Exp $ 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
35 * 20 *
36 * Copyright 2000 by PostgreSQL Global Development Group 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
37 * various details abducted from various places 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
38 *-------------------------------------------------------------------- 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
39 */ 32 */
40 33
41#include "includes.h" 34#include "includes.h"
@@ -44,200 +37,121 @@
44 37
45#include <unistd.h> 38#include <unistd.h>
46#ifdef HAVE_SYS_PSTAT_H 39#ifdef HAVE_SYS_PSTAT_H
47#include <sys/pstat.h> /* for HP-UX */ 40#include <sys/pstat.h>
48#endif
49#ifdef HAVE_PS_STRINGS
50#include <machine/vmparam.h> /* for old BSD */
51#include <sys/exec.h>
52#endif 41#endif
53 42
54/*------ 43#define SPT_NONE 0 /* don't use it at all */
55 * Alternative ways of updating ps display: 44#define SPT_PSTAT 1 /* cover argv with title information */
56 * 45#define SPT_REUSEARGV 2 /* use pstat(PSTAT_SETCMD, ...) */
57 * SETPROCTITLE_STRATEGY == PS_USE_PSTAT
58 * use the pstat(PSTAT_SETCMD, )
59 * (HPUX)
60 * SETPROCTITLE_STRATEGY == PS_USE_PS_STRINGS
61 * assign PS_STRINGS->ps_argvstr = "string"
62 * (some BSD systems)
63 * SETPROCTITLE_STRATEGY == PS_USE_CHANGE_ARGV
64 * assign argv[0] = "string"
65 * (some other BSD systems)
66 * SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV
67 * write over the argv and environment area
68 * (most SysV-like systems)
69 * SETPROCTITLE_STRATEGY == PS_USE_NONE
70 * don't update ps display
71 * (This is the default, as it is safest.)
72 */
73 46
74#define PS_USE_NONE 0 47#ifndef SPT_TYPE
75#define PS_USE_PSTAT 1 48# define SPT_TYPE SPT_NONE
76#define PS_USE_PS_STRINGS 2
77#define PS_USE_CHANGE_ARGV 3
78#define PS_USE_CLOBBER_ARGV 4
79
80#ifndef SETPROCTITLE_STRATEGY
81# define SETPROCTITLE_STRATEGY PS_USE_NONE
82#endif 49#endif
83 50
84#ifndef SETPROCTITLE_PS_PADDING 51#ifndef SPT_PADCHAR
85# define SETPROCTITLE_PS_PADDING ' ' 52# define SPT_PADCHAR '\0'
86#endif 53#endif
87#endif /* HAVE_SETPROCTITLE */
88 54
89extern char **environ; 55#if SPT_TYPE == SPT_REUSEARGV
90 56static char *argv_start = NULL;
91/* 57static size_t argv_env_len = 0;
92 * argv clobbering uses existing argv space, all other methods need a buffer
93 */
94#if SETPROCTITLE_STRATEGY != PS_USE_CLOBBER_ARGV
95static char ps_buffer[256];
96static const size_t ps_buffer_size = sizeof(ps_buffer);
97#else
98static char *ps_buffer; /* will point to argv area */
99static size_t ps_buffer_size; /* space determined at run time */
100#endif 58#endif
101 59
102/* save the original argv[] location here */ 60#endif /* HAVE_SETPROCTITLE */
103static int save_argc;
104static char **save_argv;
105
106extern char *__progname;
107 61
108#ifndef HAVE_SETPROCTITLE
109/*
110 * Call this to update the ps status display to a fixed prefix plus an
111 * indication of what you're currently doing passed in the argument.
112 */
113void 62void
114setproctitle(const char *fmt, ...) 63compat_init_setproctitle(int argc, char *argv[])
115{ 64{
116#if SETPROCTITLE_STRATEGY == PS_USE_PSTAT 65#if defined(SPT_TYPE) && SPT_TYPE == SPT_REUSEARGV
117 union pstun pst; 66 extern char **environ;
118#endif 67 char *lastargv = NULL;
119#if SETPROCTITLE_STRATEGY != PS_USE_NONE 68 char **envp = environ;
120 ssize_t used; 69 int i;
121 va_list ap;
122
123 /* no ps display if you didn't call save_ps_display_args() */
124 if (save_argv == NULL)
125 return;
126#if SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV
127 /* If ps_buffer is a pointer, it might still be null */
128 if (ps_buffer == NULL)
129 return;
130#endif /* PS_USE_CLOBBER_ARGV */
131 70
132 /* 71 /*
133 * Overwrite argv[] to point at appropriate space, if needed 72 * NB: This assumes that argv has already been copied out of the
73 * way. This is true for sshd, but may not be true for other
74 * programs. Beware.
134 */ 75 */
135#if SETPROCTITLE_STRATEGY == PS_USE_CHANGE_ARGV
136 save_argv[0] = ps_buffer;
137 save_argv[1] = NULL;
138#endif /* PS_USE_CHANGE_ARGV */
139 76
140#if SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV 77 if (argc == 0 || argv[0] == NULL)
141 save_argv[1] = NULL; 78 return;
142#endif /* PS_USE_CLOBBER_ARGV */ 79
80 /* Fail if we can't allocate room for the new environment */
81 for (i = 0; envp[i] != NULL; i++)
82 ;
83 if ((environ = malloc(sizeof(*environ) * (i + 1))) == NULL) {
84 environ = envp; /* put it back */
85 return;
86 }
143 87
144 /* 88 /*
145 * Make fixed prefix of ps display. 89 * Find the last argv string or environment variable within
90 * our process memory area.
146 */ 91 */
147 92 for (i = 0; i < argc; i++) {
148 va_start(ap, fmt); 93 if (lastargv == NULL || lastargv + 1 == argv[i])
149 if (fmt == NULL) 94 lastargv = argv[i] + strlen(argv[i]);
150 snprintf(ps_buffer, ps_buffer_size, "%s", __progname); 95 }
151 else { 96 for (i = 0; envp[i] != NULL; i++) {
152 used = snprintf(ps_buffer, ps_buffer_size, "%s: ", __progname); 97 if (lastargv + 1 == envp[i])
153 if (used == -1 || used >= ps_buffer_size) 98 lastargv = envp[i] + strlen(envp[i]);
154 used = ps_buffer_size;
155 vsnprintf(ps_buffer + used, ps_buffer_size - used, fmt, ap);
156 } 99 }
157 va_end(ap);
158
159#if SETPROCTITLE_STRATEGY == PS_USE_PSTAT
160 pst.pst_command = ps_buffer;
161 pstat(PSTAT_SETCMD, pst, strlen(ps_buffer), 0, 0);
162#endif /* PS_USE_PSTAT */
163
164#if SETPROCTITLE_STRATEGY == PS_USE_PS_STRINGS
165 PS_STRINGS->ps_nargvstr = 1;
166 PS_STRINGS->ps_argvstr = ps_buffer;
167#endif /* PS_USE_PS_STRINGS */
168 100
169#if SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV 101 argv[1] = NULL;
170 /* pad unused memory */ 102 argv_start = argv[0];
171 used = strlen(ps_buffer); 103 argv_env_len = lastargv - argv[0] - 1;
172 memset(ps_buffer + used, SETPROCTITLE_PS_PADDING,
173 ps_buffer_size - used);
174#endif /* PS_USE_CLOBBER_ARGV */
175 104
176#endif /* PS_USE_NONE */ 105 /*
106 * Copy environment
107 * XXX - will truncate env on strdup fail
108 */
109 for (i = 0; envp[i] != NULL; i++)
110 environ[i] = strdup(envp[i]);
111 environ[i] = NULL;
112#endif /* SPT_REUSEARGV */
177} 113}
178 114
179#endif /* HAVE_SETPROCTITLE */ 115#ifndef HAVE_SETPROCTITLE
180
181/*
182 * Call this early in startup to save the original argc/argv values.
183 *
184 * argv[] will not be overwritten by this routine, but may be overwritten
185 * during setproctitle. Also, the physical location of the environment
186 * strings may be moved, so this should be called before any code that
187 * might try to hang onto a getenv() result.
188 */
189void 116void
190compat_init_setproctitle(int argc, char *argv[]) 117setproctitle(const char *fmt, ...)
191{ 118{
192#if SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV 119#if SPT_TYPE != SPT_NONE
193 char *end_of_area = NULL; 120 va_list ap;
194 char **new_environ; 121 char buf[1024];
195 int i; 122 size_t len;
123 extern char *__progname;
124#if SPT_TYPE == SPT_PSTAT
125 union pstun pst;
196#endif 126#endif
197 127
198 save_argc = argc; 128#if SPT_TYPE == SPT_REUSEARGV
199 save_argv = argv; 129 if (argv_env_len <= 0)
200
201#if SETPROCTITLE_STRATEGY == PS_USE_CLOBBER_ARGV
202 /*
203 * If we're going to overwrite the argv area, count the available
204 * space. Also move the environment to make additional room.
205 */
206
207 /*
208 * check for contiguous argv strings
209 */
210 for (i = 0; i < argc; i++) {
211 if (i == 0 || end_of_area + 1 == argv[i])
212 end_of_area = argv[i] + strlen(argv[i]);
213 }
214
215 /* probably can't happen? */
216 if (end_of_area == NULL) {
217 ps_buffer = NULL;
218 ps_buffer_size = 0;
219 return; 130 return;
220 } 131#endif
221 132
222 /* 133 strlcpy(buf, __progname, sizeof(buf));
223 * check for contiguous environ strings following argv 134
224 */ 135 va_start(ap, fmt);
225 for (i = 0; environ[i] != NULL; i++) { 136 if (fmt != NULL) {
226 if (end_of_area + 1 == environ[i]) 137 len = strlcat(buf, ": ", sizeof(buf));
227 end_of_area = environ[i] + strlen(environ[i]); 138 if (len < sizeof(buf))
139 vsnprintf(buf + len, sizeof(buf) - len , fmt, ap);
228 } 140 }
141 va_end(ap);
229 142
230 ps_buffer = argv[0]; 143#if SPT_TYPE == SPT_PSTAT
231 ps_buffer_size = end_of_area - argv[0] - 1; 144 pst.pst_command = buf;
145 pstat(PSTAT_SETCMD, pst, strlen(buf), 0, 0);
146#elif SPT_TYPE == SPT_REUSEARGV
147/* debug("setproctitle: copy \"%s\" into len %d",
148 buf, argv_env_len); */
149 len = strlcpy(argv_start, buf, argv_env_len);
150 for(; len < argv_env_len; len++)
151 argv_start[len] = SPT_PADCHAR;
152#endif
232 153
233 /* 154#endif /* SPT_NONE */
234 * Duplicate and move the environment out of the way
235 */
236 new_environ = malloc(sizeof(char *) * (i + 1));
237 for (i = 0; environ[i] != NULL; i++)
238 new_environ[i] = strdup(environ[i]);
239 new_environ[i] = NULL;
240 environ = new_environ;
241#endif /* PS_USE_CLOBBER_ARGV */
242} 155}
243 156
157#endif /* HAVE_SETPROCTITLE */
diff --git a/openbsd-compat/strlcat.c b/openbsd-compat/strlcat.c
index 3a9b5d1a7..cae16657c 100644
--- a/openbsd-compat/strlcat.c
+++ b/openbsd-compat/strlcat.c
@@ -1,42 +1,30 @@
1/* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */ 1/* $OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
5 * All rights reserved.
6 * 5 *
7 * Redistribution and use in source and binary forms, with or without 6 * Permission to use, copy, modify, and distribute this software for any
8 * modification, are permitted provided that the following conditions 7 * purpose with or without fee is hereby granted, provided that the above
9 * are met: 8 * copyright notice and this permission notice appear in all copies.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 9 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 17 */
29 18
30#include "includes.h" 19#include "includes.h"
31#ifndef HAVE_STRLCAT 20#ifndef HAVE_STRLCAT
32 21
33#if defined(LIBC_SCCS) && !defined(lint) 22#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $"; 23static char *rcsid = "$OpenBSD: strlcat.c,v 1.11 2003/06/17 21:56:24 millert Exp $";
35#endif /* LIBC_SCCS and not lint */ 24#endif /* LIBC_SCCS and not lint */
36 25
37#include <sys/types.h> 26#include <sys/types.h>
38#include <string.h> 27#include <string.h>
39#include "strlcat.h"
40 28
41/* 29/*
42 * Appends src to string dst of size siz (unlike strncat, siz is the 30 * Appends src to string dst of size siz (unlike strncat, siz is the
@@ -46,10 +34,7 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp
46 * If retval >= siz, truncation occurred. 34 * If retval >= siz, truncation occurred.
47 */ 35 */
48size_t 36size_t
49strlcat(dst, src, siz) 37strlcat(char *dst, const char *src, size_t siz)
50 char *dst;
51 const char *src;
52 size_t siz;
53{ 38{
54 register char *d = dst; 39 register char *d = dst;
55 register const char *s = src; 40 register const char *s = src;
diff --git a/openbsd-compat/strlcpy.c b/openbsd-compat/strlcpy.c
index 2f87eca44..c8fe29987 100644
--- a/openbsd-compat/strlcpy.c
+++ b/openbsd-compat/strlcpy.c
@@ -1,42 +1,30 @@
1/* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */ 1/* $OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
5 * All rights reserved.
6 * 5 *
7 * Redistribution and use in source and binary forms, with or without 6 * Permission to use, copy, modify, and distribute this software for any
8 * modification, are permitted provided that the following conditions 7 * purpose with or without fee is hereby granted, provided that the above
9 * are met: 8 * copyright notice and this permission notice appear in all copies.
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. The name of the author may not be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 * 9 *
18 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, 10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
19 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
20 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
21 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 17 */
29 18
30#include "includes.h" 19#include "includes.h"
31#ifndef HAVE_STRLCPY 20#ifndef HAVE_STRLCPY
32 21
33#if defined(LIBC_SCCS) && !defined(lint) 22#if defined(LIBC_SCCS) && !defined(lint)
34static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $"; 23static char *rcsid = "$OpenBSD: strlcpy.c,v 1.8 2003/06/17 21:56:24 millert Exp $";
35#endif /* LIBC_SCCS and not lint */ 24#endif /* LIBC_SCCS and not lint */
36 25
37#include <sys/types.h> 26#include <sys/types.h>
38#include <string.h> 27#include <string.h>
39#include "strlcpy.h"
40 28
41/* 29/*
42 * Copy src to string dst of size siz. At most siz-1 characters 30 * Copy src to string dst of size siz. At most siz-1 characters
@@ -44,10 +32,7 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp
44 * Returns strlen(src); if retval >= siz, truncation occurred. 32 * Returns strlen(src); if retval >= siz, truncation occurred.
45 */ 33 */
46size_t 34size_t
47strlcpy(dst, src, siz) 35strlcpy(char *dst, const char *src, size_t siz)
48 char *dst;
49 const char *src;
50 size_t siz;
51{ 36{
52 register char *d = dst; 37 register char *d = dst;
53 register const char *s = src; 38 register const char *s = src;
diff --git a/openbsd-compat/strmode.c b/openbsd-compat/strmode.c
index e64d19869..adf5e273e 100644
--- a/openbsd-compat/strmode.c
+++ b/openbsd-compat/strmode.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -35,15 +31,17 @@
35#ifndef HAVE_STRMODE 31#ifndef HAVE_STRMODE
36 32
37#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
38static char *rcsid = "$OpenBSD: strmode.c,v 1.3 1997/06/13 13:57:20 deraadt Exp $"; 34static char *rcsid = "$OpenBSD: strmode.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
39#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
40 36
41#include <sys/types.h> 37#include <sys/types.h>
42#include <sys/stat.h> 38#include <sys/stat.h>
43#include <string.h> 39#include <string.h>
44 40
41/* XXX mode should be mode_t */
42
45void 43void
46strmode(register mode_t mode, register char *p) 44strmode(int mode, char *p)
47{ 45{
48 /* print type */ 46 /* print type */
49 switch (mode & S_IFMT) { 47 switch (mode & S_IFMT) {
diff --git a/openbsd-compat/strsep.c b/openbsd-compat/strsep.c
index d0afc44ae..b13671343 100644
--- a/openbsd-compat/strsep.c
+++ b/openbsd-compat/strsep.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $ */ 1/* $OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1990, 1993 4 * Copyright (c) 1990, 1993
@@ -12,11 +12,7 @@
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software 15 * 3. Neither the name of the University nor the names of its contributors
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission. 17 * without specific prior written permission.
22 * 18 *
@@ -44,7 +40,7 @@
44#if 0 40#if 0
45static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; 41static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
46#else 42#else
47static char *rcsid = "$OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $"; 43static char *rcsid = "$OpenBSD: strsep.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
48#endif 44#endif
49#endif /* LIBC_SCCS and not lint */ 45#endif /* LIBC_SCCS and not lint */
50 46
@@ -62,9 +58,9 @@ static char *rcsid = "$OpenBSD: strsep.c,v 1.3 1997/08/20 04:28:14 millert Exp $
62char * 58char *
63strsep(char **stringp, const char *delim) 59strsep(char **stringp, const char *delim)
64{ 60{
65 register char *s; 61 char *s;
66 register const char *spanp; 62 const char *spanp;
67 register int c, sc; 63 int c, sc;
68 char *tok; 64 char *tok;
69 65
70 if ((s = *stringp) == NULL) 66 if ((s = *stringp) == NULL)
diff --git a/openbsd-compat/sys-queue.h b/openbsd-compat/sys-queue.h
index 176fe3174..dd5c47525 100644
--- a/openbsd-compat/sys-queue.h
+++ b/openbsd-compat/sys-queue.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: queue.h,v 1.22 2001/06/23 04:39:35 angelos Exp $ */ 1/* $OpenBSD: queue.h,v 1.23 2003/06/02 23:28:21 millert Exp $ */
2/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */ 2/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
3 3
4/* 4/*
@@ -13,11 +13,7 @@
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software 16 * 3. Neither the name of the University nor the names of its contributors
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 17 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 18 * without specific prior written permission.
23 * 19 *
diff --git a/openbsd-compat/vis.c b/openbsd-compat/vis.c
index fc5741390..e6a2ce98d 100644
--- a/openbsd-compat/vis.c
+++ b/openbsd-compat/vis.c
@@ -10,11 +10,7 @@
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the 11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution. 12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software 13 * 3. Neither the name of the University nor the names of its contributors
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission. 15 * without specific prior written permission.
20 * 16 *
@@ -30,14 +26,15 @@
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE. 27 * SUCH DAMAGE.
32 */ 28 */
33#include "config.h" 29#include "includes.h"
34#if !defined(HAVE_STRNVIS) 30#if !defined(HAVE_STRNVIS)
35 31
36#if defined(LIBC_SCCS) && !defined(lint) 32#if defined(LIBC_SCCS) && !defined(lint)
37static char rcsid[] = "$OpenBSD: vis.c,v 1.8 2002/02/19 19:39:36 millert Exp $"; 33static char rcsid[] = "$OpenBSD: vis.c,v 1.12 2003/06/02 20:18:35 millert Exp $";
38#endif /* LIBC_SCCS and not lint */ 34#endif /* LIBC_SCCS and not lint */
39 35
40#include <ctype.h> 36#include <ctype.h>
37#include <string.h>
41 38
42#include "vis.h" 39#include "vis.h"
43 40
@@ -47,8 +44,9 @@ static char rcsid[] = "$OpenBSD: vis.c,v 1.8 2002/02/19 19:39:36 millert Exp $";
47 ((flag & VIS_SP) == 0 && (c) == ' ') || \ 44 ((flag & VIS_SP) == 0 && (c) == ' ') || \
48 ((flag & VIS_TAB) == 0 && (c) == '\t') || \ 45 ((flag & VIS_TAB) == 0 && (c) == '\t') || \
49 ((flag & VIS_NL) == 0 && (c) == '\n') || \ 46 ((flag & VIS_NL) == 0 && (c) == '\n') || \
50 ((flag & VIS_SAFE) && \ 47 ((flag & VIS_SAFE) && ((c) == '\b' || \
51 ((c) == '\b' || (c) == '\007' || (c) == '\r'))) 48 (c) == '\007' || (c) == '\r' || \
49 isgraph((u_char)(c)))))
52 50
53/* 51/*
54 * vis - visually encode characters 52 * vis - visually encode characters
@@ -169,16 +167,20 @@ strvis(dst, src, flag)
169 167
170int 168int
171strnvis(dst, src, siz, flag) 169strnvis(dst, src, siz, flag)
172 register char *dst; 170 char *dst;
173 register const char *src; 171 const char *src;
174 size_t siz; 172 size_t siz;
175 int flag; 173 int flag;
176{ 174{
177 register char c; 175 char c;
178 char *start, *end; 176 char *start, *end;
177 char tbuf[5];
178 int i;
179 179
180 i = 0;
180 for (start = dst, end = start + siz - 1; (c = *src) && dst < end; ) { 181 for (start = dst, end = start + siz - 1; (c = *src) && dst < end; ) {
181 if (isvisible(c)) { 182 if (isvisible(c)) {
183 i = 1;
182 *dst++ = c; 184 *dst++ = c;
183 if (c == '\\' && (flag & VIS_NOSLASH) == 0) { 185 if (c == '\\' && (flag & VIS_NOSLASH) == 0) {
184 /* need space for the extra '\\' */ 186 /* need space for the extra '\\' */
@@ -186,22 +188,25 @@ strnvis(dst, src, siz, flag)
186 *dst++ = '\\'; 188 *dst++ = '\\';
187 else { 189 else {
188 dst--; 190 dst--;
191 i = 2;
189 break; 192 break;
190 } 193 }
191 } 194 }
192 src++; 195 src++;
193 } else { 196 } else {
194 /* vis(3) requires up to 4 chars */ 197 i = vis(tbuf, c, flag, *++src) - tbuf;
195 if (dst + 3 < end) 198 if (dst + i <= end) {
196 dst = vis(dst, c, flag, *++src); 199 memcpy(dst, tbuf, i);
197 else 200 dst += i;
201 } else {
202 src--;
198 break; 203 break;
204 }
199 } 205 }
200 } 206 }
201 *dst = '\0'; 207 if (siz > 0)
202 if (dst >= end) { 208 *dst = '\0';
203 char tbuf[5]; 209 if (dst + i > end) {
204
205 /* adjust return value for truncation */ 210 /* adjust return value for truncation */
206 while ((c = *src)) 211 while ((c = *src))
207 dst += vis(tbuf, c, flag, *++src) - tbuf; 212 dst += vis(tbuf, c, flag, *++src) - tbuf;
diff --git a/openbsd-compat/vis.h b/openbsd-compat/vis.h
index 5df6f3694..1c131cc85 100644
--- a/openbsd-compat/vis.h
+++ b/openbsd-compat/vis.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: vis.h,v 1.5 2002/02/16 21:27:17 millert Exp $ */ 1/* $OpenBSD: vis.h,v 1.6 2003/06/02 19:34:12 millert Exp $ */
2/* $NetBSD: vis.h,v 1.4 1994/10/26 00:56:41 cgd Exp $ */ 2/* $NetBSD: vis.h,v 1.4 1994/10/26 00:56:41 cgd Exp $ */
3 3
4/*- 4/*-
@@ -13,11 +13,7 @@
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution. 15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software 16 * 3. Neither the name of the University nor the names of its contributors
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 17 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 18 * without specific prior written permission.
23 * 19 *
@@ -35,7 +31,8 @@
35 * 31 *
36 * @(#)vis.h 5.9 (Berkeley) 4/3/91 32 * @(#)vis.h 5.9 (Berkeley) 4/3/91
37 */ 33 */
38#include "config.h" 34
35#include "includes.h"
39#if !defined(HAVE_STRNVIS) 36#if !defined(HAVE_STRNVIS)
40 37
41#ifndef _VIS_H_ 38#ifndef _VIS_H_
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
new file mode 100644
index 000000000..5b5d69c72
--- /dev/null
+++ b/openbsd-compat/xcrypt.c
@@ -0,0 +1,116 @@
1/*
2 * Copyright (c) 2003 Ben Lindstrom. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#include "includes.h"
26
27#if !defined(HAVE_OSF_SIA)
28
29# ifdef HAVE_CRYPT_H
30# include <crypt.h>
31# endif
32
33# ifdef __hpux
34# include <hpsecurity.h>
35# include <prot.h>
36# endif
37
38# ifdef HAVE_SECUREWARE
39# include <sys/security.h>
40# include <sys/audit.h>
41# include <prot.h>
42# endif
43
44# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
45# include <shadow.h>
46# endif
47
48# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
49# include <sys/label.h>
50# include <sys/audit.h>
51# include <pwdadj.h>
52# endif
53
54# if defined(HAVE_MD5_PASSWORDS) && !defined(HAVE_MD5_CRYPT)
55# include "md5crypt.h"
56# endif
57
58char *
59xcrypt(const char *password, const char *salt)
60{
61 char *crypted;
62
63# ifdef HAVE_MD5_PASSWORDS
64 if (is_md5_salt(salt))
65 crypted = md5_crypt(password, salt);
66 else
67 crypted = crypt(password, salt);
68# elif defined(__hpux) && !defined(HAVE_SECUREWARE)
69 if (iscomsec())
70 crypted = bigcrypt(password, salt);
71 else
72 crypted = crypt(password, salt);
73# elif defined(HAVE_SECUREWARE)
74 crypted = bigcrypt(password, salt);
75# else
76 crypted = crypt(password, salt);
77# endif
78
79 return crypted;
80}
81
82/*
83 * Handle shadowed password systems in a cleaner way for portable
84 * version.
85 */
86
87char *
88shadow_pw(struct passwd *pw)
89{
90 char *pw_password = pw->pw_passwd;
91
92# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
93 struct spwd *spw = getspnam(pw->pw_name);
94
95 if (spw != NULL)
96 pw_password = spw->sp_pwdp;
97# endif
98# if defined(HAVE_GETPWANAM) && !defined(DISABLE_SHADOW)
99 struct passwd_adjunct *spw;
100 if (issecure() && (spw = getpwanam(pw->pw_name)) != NULL)
101 pw_password = spw->pwa_passwd;
102# elif defined(HAVE_SECUREWARE)
103 struct pr_passwd *spw = getprpwnam(pw->pw_name);
104
105 if (spw != NULL)
106 pw_password = spw->ufld.fd_encrypt;
107# elif defined(__hpux) && !defined(HAVE_SECUREWARE)
108 struct pr_passwd *spw;
109 if (iscomsec() && (spw = getprpwnam(pw->pw_name)) != NULL)
110 pw_password = spw->ufld.fd_encrypt;
111# endif
112
113 return pw_password;
114}
115
116#endif /* !defined(HAVE_OSF_SIA) */
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c
index 8f1d2022c..9dc4340a7 100644
--- a/openbsd-compat/xmmap.c
+++ b/openbsd-compat/xmmap.c
@@ -1,4 +1,7 @@
1/* 1/*
2 * Copyright (c) 2002 Tim Rice. All rights reserved.
3 * MAP_FAILED code by Solar Designer.
4 *
2 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
3 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
4 * are met: 7 * are met:
@@ -20,6 +23,8 @@
20 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
21 */ 24 */
22 25
26/* $Id: xmmap.c,v 1.3 2003/06/02 02:25:27 tim Exp $ */
27
23#include "includes.h" 28#include "includes.h"
24 29
25#ifdef HAVE_SYS_MMAN_H 30#ifdef HAVE_SYS_MMAN_H
diff --git a/packet.c b/packet.c
index 3e21df722..4ef639fd6 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,9 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.104 2003/04/01 10:22:21 markus Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.109 2003/07/10 14:42:28 markus Exp $");
41
42#include "openbsd-compat/sys-queue.h"
41 43
42#include "xmalloc.h" 44#include "xmalloc.h"
43#include "buffer.h" 45#include "buffer.h"
@@ -106,7 +108,7 @@ static int compression_buffer_ready = 0;
106static int packet_compression = 0; 108static int packet_compression = 0;
107 109
108/* default maximum packet size */ 110/* default maximum packet size */
109int max_packet_size = 32768; 111u_int max_packet_size = 32768;
110 112
111/* Flag indicating whether this module has been initialized. */ 113/* Flag indicating whether this module has been initialized. */
112static int initialized = 0; 114static int initialized = 0;
@@ -116,8 +118,14 @@ static int interactive_mode = 0;
116 118
117/* Session key information for Encryption and MAC */ 119/* Session key information for Encryption and MAC */
118Newkeys *newkeys[MODE_MAX]; 120Newkeys *newkeys[MODE_MAX];
119static u_int32_t read_seqnr = 0; 121static struct packet_state {
120static u_int32_t send_seqnr = 0; 122 u_int32_t seqnr;
123 u_int32_t packets;
124 u_int64_t blocks;
125} p_read, p_send;
126
127static u_int64_t max_blocks_in, max_blocks_out;
128static u_int32_t rekey_limit;
121 129
122/* Session key for protocol v1 */ 130/* Session key for protocol v1 */
123static u_char ssh1_key[SSH_SESSION_KEY_LENGTH]; 131static u_char ssh1_key[SSH_SESSION_KEY_LENGTH];
@@ -126,6 +134,13 @@ static u_int ssh1_keylen;
126/* roundup current message to extra_pad bytes */ 134/* roundup current message to extra_pad bytes */
127static u_char extra_pad = 0; 135static u_char extra_pad = 0;
128 136
137struct packet {
138 TAILQ_ENTRY(packet) next;
139 u_char type;
140 Buffer payload;
141};
142TAILQ_HEAD(, packet) outgoing;
143
129/* 144/*
130 * Sets the descriptors used for communication. Disables encryption until 145 * Sets the descriptors used for communication. Disables encryption until
131 * packet_set_encryption_key is called. 146 * packet_set_encryption_key is called.
@@ -148,6 +163,7 @@ packet_set_connection(int fd_in, int fd_out)
148 buffer_init(&output); 163 buffer_init(&output);
149 buffer_init(&outgoing_packet); 164 buffer_init(&outgoing_packet);
150 buffer_init(&incoming_packet); 165 buffer_init(&incoming_packet);
166 TAILQ_INIT(&outgoing);
151 } 167 }
152 /* Kludge: arrange the close function to be called from fatal(). */ 168 /* Kludge: arrange the close function to be called from fatal(). */
153 fatal_add_cleanup((void (*) (void *)) packet_close, NULL); 169 fatal_add_cleanup((void (*) (void *)) packet_close, NULL);
@@ -249,27 +265,31 @@ packet_set_iv(int mode, u_char *dat)
249 cipher_set_keyiv(cc, dat); 265 cipher_set_keyiv(cc, dat);
250} 266}
251int 267int
252packet_get_ssh1_cipher() 268packet_get_ssh1_cipher(void)
253{ 269{
254 return (cipher_get_number(receive_context.cipher)); 270 return (cipher_get_number(receive_context.cipher));
255} 271}
256 272
257 273void
258u_int32_t 274packet_get_state(int mode, u_int32_t *seqnr, u_int64_t *blocks, u_int32_t *packets)
259packet_get_seqnr(int mode)
260{ 275{
261 return (mode == MODE_IN ? read_seqnr : send_seqnr); 276 struct packet_state *state;
277
278 state = (mode == MODE_IN) ? &p_read : &p_send;
279 *seqnr = state->seqnr;
280 *blocks = state->blocks;
281 *packets = state->packets;
262} 282}
263 283
264void 284void
265packet_set_seqnr(int mode, u_int32_t seqnr) 285packet_set_state(int mode, u_int32_t seqnr, u_int64_t blocks, u_int32_t packets)
266{ 286{
267 if (mode == MODE_IN) 287 struct packet_state *state;
268 read_seqnr = seqnr; 288
269 else if (mode == MODE_OUT) 289 state = (mode == MODE_IN) ? &p_read : &p_send;
270 send_seqnr = seqnr; 290 state->seqnr = seqnr;
271 else 291 state->blocks = blocks;
272 fatal("packet_set_seqnr: bad mode %d", mode); 292 state->packets = packets;
273} 293}
274 294
275/* returns 1 if connection is via ipv4 */ 295/* returns 1 if connection is via ipv4 */
@@ -562,6 +582,7 @@ set_newkeys(int mode)
562 Mac *mac; 582 Mac *mac;
563 Comp *comp; 583 Comp *comp;
564 CipherContext *cc; 584 CipherContext *cc;
585 u_int64_t *max_blocks;
565 int encrypt; 586 int encrypt;
566 587
567 debug2("set_newkeys: mode %d", mode); 588 debug2("set_newkeys: mode %d", mode);
@@ -569,9 +590,13 @@ set_newkeys(int mode)
569 if (mode == MODE_OUT) { 590 if (mode == MODE_OUT) {
570 cc = &send_context; 591 cc = &send_context;
571 encrypt = CIPHER_ENCRYPT; 592 encrypt = CIPHER_ENCRYPT;
593 p_send.packets = p_send.blocks = 0;
594 max_blocks = &max_blocks_out;
572 } else { 595 } else {
573 cc = &receive_context; 596 cc = &receive_context;
574 encrypt = CIPHER_DECRYPT; 597 encrypt = CIPHER_DECRYPT;
598 p_read.packets = p_read.blocks = 0;
599 max_blocks = &max_blocks_in;
575 } 600 }
576 if (newkeys[mode] != NULL) { 601 if (newkeys[mode] != NULL) {
577 debug("set_newkeys: rekeying"); 602 debug("set_newkeys: rekeying");
@@ -610,13 +635,23 @@ set_newkeys(int mode)
610 buffer_compress_init_recv(); 635 buffer_compress_init_recv();
611 comp->enabled = 1; 636 comp->enabled = 1;
612 } 637 }
638 /*
639 * The 2^(blocksize*2) limit is too expensive for 3DES,
640 * blowfish, etc, so enforce a 1GB limit for small blocksizes.
641 */
642 if (enc->block_size >= 16)
643 *max_blocks = (u_int64_t)1 << (enc->block_size*2);
644 else
645 *max_blocks = ((u_int64_t)1 << 30) / enc->block_size;
646 if (rekey_limit)
647 *max_blocks = MIN(*max_blocks, rekey_limit / enc->block_size);
613} 648}
614 649
615/* 650/*
616 * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue) 651 * Finalize packet in SSH2 format (compress, mac, encrypt, enqueue)
617 */ 652 */
618static void 653static void
619packet_send2(void) 654packet_send2_wrapped(void)
620{ 655{
621 u_char type, *cp, *macbuf = NULL; 656 u_char type, *cp, *macbuf = NULL;
622 u_char padlen, pad; 657 u_char padlen, pad;
@@ -698,10 +733,10 @@ packet_send2(void)
698 733
699 /* compute MAC over seqnr and packet(length fields, payload, padding) */ 734 /* compute MAC over seqnr and packet(length fields, payload, padding) */
700 if (mac && mac->enabled) { 735 if (mac && mac->enabled) {
701 macbuf = mac_compute(mac, send_seqnr, 736 macbuf = mac_compute(mac, p_send.seqnr,
702 buffer_ptr(&outgoing_packet), 737 buffer_ptr(&outgoing_packet),
703 buffer_len(&outgoing_packet)); 738 buffer_len(&outgoing_packet));
704 DBG(debug("done calc MAC out #%d", send_seqnr)); 739 DBG(debug("done calc MAC out #%d", p_send.seqnr));
705 } 740 }
706 /* encrypt packet and append to output buffer. */ 741 /* encrypt packet and append to output buffer. */
707 cp = buffer_append_space(&output, buffer_len(&outgoing_packet)); 742 cp = buffer_append_space(&output, buffer_len(&outgoing_packet));
@@ -715,14 +750,64 @@ packet_send2(void)
715 buffer_dump(&output); 750 buffer_dump(&output);
716#endif 751#endif
717 /* increment sequence number for outgoing packets */ 752 /* increment sequence number for outgoing packets */
718 if (++send_seqnr == 0) 753 if (++p_send.seqnr == 0)
719 log("outgoing seqnr wraps around"); 754 logit("outgoing seqnr wraps around");
755 if (++p_send.packets == 0)
756 if (!(datafellows & SSH_BUG_NOREKEY))
757 fatal("XXX too many packets with same key");
758 p_send.blocks += (packet_length + 4) / block_size;
720 buffer_clear(&outgoing_packet); 759 buffer_clear(&outgoing_packet);
721 760
722 if (type == SSH2_MSG_NEWKEYS) 761 if (type == SSH2_MSG_NEWKEYS)
723 set_newkeys(MODE_OUT); 762 set_newkeys(MODE_OUT);
724} 763}
725 764
765static void
766packet_send2(void)
767{
768 static int rekeying = 0;
769 struct packet *p;
770 u_char type, *cp;
771
772 cp = buffer_ptr(&outgoing_packet);
773 type = cp[5];
774
775 /* during rekeying we can only send key exchange messages */
776 if (rekeying) {
777 if (!((type >= SSH2_MSG_TRANSPORT_MIN) &&
778 (type <= SSH2_MSG_TRANSPORT_MAX))) {
779 debug("enqueue packet: %u", type);
780 p = xmalloc(sizeof(*p));
781 p->type = type;
782 memcpy(&p->payload, &outgoing_packet, sizeof(Buffer));
783 buffer_init(&outgoing_packet);
784 TAILQ_INSERT_TAIL(&outgoing, p, next);
785 return;
786 }
787 }
788
789 /* rekeying starts with sending KEXINIT */
790 if (type == SSH2_MSG_KEXINIT)
791 rekeying = 1;
792
793 packet_send2_wrapped();
794
795 /* after a NEWKEYS message we can send the complete queue */
796 if (type == SSH2_MSG_NEWKEYS) {
797 rekeying = 0;
798 while ((p = TAILQ_FIRST(&outgoing))) {
799 type = p->type;
800 debug("dequeue packet: %u", type);
801 buffer_free(&outgoing_packet);
802 memcpy(&outgoing_packet, &p->payload,
803 sizeof(Buffer));
804 TAILQ_REMOVE(&outgoing, p, next);
805 xfree(p);
806 packet_send2_wrapped();
807 }
808 }
809}
810
726void 811void
727packet_send(void) 812packet_send(void)
728{ 813{
@@ -784,7 +869,7 @@ packet_read_seqnr(u_int32_t *seqnr_p)
784 /* Read data from the socket. */ 869 /* Read data from the socket. */
785 len = read(connection_in, buf, sizeof(buf)); 870 len = read(connection_in, buf, sizeof(buf));
786 if (len == 0) { 871 if (len == 0) {
787 log("Connection closed by %.200s", get_remote_ipaddr()); 872 logit("Connection closed by %.200s", get_remote_ipaddr());
788 fatal_cleanup(); 873 fatal_cleanup();
789 } 874 }
790 if (len < 0) 875 if (len < 0)
@@ -966,18 +1051,22 @@ packet_read_poll2(u_int32_t *seqnr_p)
966 * increment sequence number for incoming packet 1051 * increment sequence number for incoming packet
967 */ 1052 */
968 if (mac && mac->enabled) { 1053 if (mac && mac->enabled) {
969 macbuf = mac_compute(mac, read_seqnr, 1054 macbuf = mac_compute(mac, p_read.seqnr,
970 buffer_ptr(&incoming_packet), 1055 buffer_ptr(&incoming_packet),
971 buffer_len(&incoming_packet)); 1056 buffer_len(&incoming_packet));
972 if (memcmp(macbuf, buffer_ptr(&input), mac->mac_len) != 0) 1057 if (memcmp(macbuf, buffer_ptr(&input), mac->mac_len) != 0)
973 packet_disconnect("Corrupted MAC on input."); 1058 packet_disconnect("Corrupted MAC on input.");
974 DBG(debug("MAC #%d ok", read_seqnr)); 1059 DBG(debug("MAC #%d ok", p_read.seqnr));
975 buffer_consume(&input, mac->mac_len); 1060 buffer_consume(&input, mac->mac_len);
976 } 1061 }
977 if (seqnr_p != NULL) 1062 if (seqnr_p != NULL)
978 *seqnr_p = read_seqnr; 1063 *seqnr_p = p_read.seqnr;
979 if (++read_seqnr == 0) 1064 if (++p_read.seqnr == 0)
980 log("incoming seqnr wraps around"); 1065 logit("incoming seqnr wraps around");
1066 if (++p_read.packets == 0)
1067 if (!(datafellows & SSH_BUG_NOREKEY))
1068 fatal("XXX too many packets with same key");
1069 p_read.blocks += (packet_length + 4) / block_size;
981 1070
982 /* get padlen */ 1071 /* get padlen */
983 cp = buffer_ptr(&incoming_packet); 1072 cp = buffer_ptr(&incoming_packet);
@@ -1042,7 +1131,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1042 case SSH2_MSG_DISCONNECT: 1131 case SSH2_MSG_DISCONNECT:
1043 reason = packet_get_int(); 1132 reason = packet_get_int();
1044 msg = packet_get_string(NULL); 1133 msg = packet_get_string(NULL);
1045 log("Received disconnect from %s: %u: %.400s", 1134 logit("Received disconnect from %s: %u: %.400s",
1046 get_remote_ipaddr(), reason, msg); 1135 get_remote_ipaddr(), reason, msg);
1047 xfree(msg); 1136 xfree(msg);
1048 fatal_cleanup(); 1137 fatal_cleanup();
@@ -1068,7 +1157,7 @@ packet_read_poll_seqnr(u_int32_t *seqnr_p)
1068 break; 1157 break;
1069 case SSH_MSG_DISCONNECT: 1158 case SSH_MSG_DISCONNECT:
1070 msg = packet_get_string(NULL); 1159 msg = packet_get_string(NULL);
1071 log("Received disconnect from %s: %.400s", 1160 logit("Received disconnect from %s: %.400s",
1072 get_remote_ipaddr(), msg); 1161 get_remote_ipaddr(), msg);
1073 fatal_cleanup(); 1162 fatal_cleanup();
1074 xfree(msg); 1163 xfree(msg);
@@ -1227,7 +1316,7 @@ packet_disconnect(const char *fmt,...)
1227 va_end(args); 1316 va_end(args);
1228 1317
1229 /* Display the error locally */ 1318 /* Display the error locally */
1230 log("Disconnecting: %.100s", buf); 1319 logit("Disconnecting: %.100s", buf);
1231 1320
1232 /* Send the disconnect message to the other side, and wait for it to get sent. */ 1321 /* Send the disconnect message to the other side, and wait for it to get sent. */
1233 if (compat20) { 1322 if (compat20) {
@@ -1314,6 +1403,8 @@ packet_not_very_much_data_to_write(void)
1314 return buffer_len(&output) < 128 * 1024; 1403 return buffer_len(&output) < 128 * 1024;
1315} 1404}
1316 1405
1406
1407#if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN)
1317static void 1408static void
1318packet_set_tos(int interactive) 1409packet_set_tos(int interactive)
1319{ 1410{
@@ -1327,6 +1418,7 @@ packet_set_tos(int interactive)
1327 error("setsockopt IP_TOS %d: %.100s:", 1418 error("setsockopt IP_TOS %d: %.100s:",
1328 tos, strerror(errno)); 1419 tos, strerror(errno));
1329} 1420}
1421#endif
1330 1422
1331/* Informs that the current session is interactive. Sets IP flags for that. */ 1423/* Informs that the current session is interactive. Sets IP flags for that. */
1332 1424
@@ -1344,6 +1436,7 @@ packet_set_interactive(int interactive)
1344 1436
1345 /* Only set socket options if using a socket. */ 1437 /* Only set socket options if using a socket. */
1346 if (!packet_connection_is_on_socket()) 1438 if (!packet_connection_is_on_socket())
1439 return;
1347 if (interactive) 1440 if (interactive)
1348 set_nodelay(connection_in); 1441 set_nodelay(connection_in);
1349#if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN) 1442#if defined(IP_TOS) && !defined(IP_TOS_IS_BROKEN)
@@ -1360,18 +1453,18 @@ packet_is_interactive(void)
1360 return interactive_mode; 1453 return interactive_mode;
1361} 1454}
1362 1455
1363int 1456u_int
1364packet_set_maxsize(int s) 1457packet_set_maxsize(u_int s)
1365{ 1458{
1366 static int called = 0; 1459 static int called = 0;
1367 1460
1368 if (called) { 1461 if (called) {
1369 log("packet_set_maxsize: called twice: old %d new %d", 1462 logit("packet_set_maxsize: called twice: old %d new %d",
1370 max_packet_size, s); 1463 max_packet_size, s);
1371 return -1; 1464 return -1;
1372 } 1465 }
1373 if (s < 4 * 1024 || s > 1024 * 1024) { 1466 if (s < 4 * 1024 || s > 1024 * 1024) {
1374 log("packet_set_maxsize: bad size %d", s); 1467 logit("packet_set_maxsize: bad size %d", s);
1375 return -1; 1468 return -1;
1376 } 1469 }
1377 called = 1; 1470 called = 1;
@@ -1413,3 +1506,22 @@ packet_send_ignore(int nbytes)
1413 rand >>= 8; 1506 rand >>= 8;
1414 } 1507 }
1415} 1508}
1509
1510#define MAX_PACKETS (1<<31)
1511int
1512packet_need_rekeying(void)
1513{
1514 if (datafellows & SSH_BUG_NOREKEY)
1515 return 0;
1516 return
1517 (p_send.packets > MAX_PACKETS) ||
1518 (p_read.packets > MAX_PACKETS) ||
1519 (max_blocks_out && (p_send.blocks > max_blocks_out)) ||
1520 (max_blocks_in && (p_read.blocks > max_blocks_in));
1521}
1522
1523void
1524packet_set_rekey_limit(u_int32_t bytes)
1525{
1526 rekey_limit = bytes;
1527}
diff --git a/packet.h b/packet.h
index 46830c3df..7732fafb7 100644
--- a/packet.h
+++ b/packet.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.h,v 1.37 2003/04/01 10:22:21 markus Exp $ */ 1/* $OpenBSD: packet.h,v 1.40 2003/06/24 08:23:46 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -62,8 +62,8 @@ int packet_get_keyiv_len(int);
62void packet_get_keyiv(int, u_char *, u_int); 62void packet_get_keyiv(int, u_char *, u_int);
63int packet_get_keycontext(int, u_char *); 63int packet_get_keycontext(int, u_char *);
64void packet_set_keycontext(int, u_char *); 64void packet_set_keycontext(int, u_char *);
65u_int32_t packet_get_seqnr(int); 65void packet_get_state(int, u_int32_t *, u_int64_t *, u_int32_t *);
66void packet_set_seqnr(int, u_int32_t); 66void packet_set_state(int, u_int32_t, u_int64_t, u_int32_t);
67int packet_get_ssh1_cipher(void); 67int packet_get_ssh1_cipher(void);
68void packet_set_iv(int, u_char *); 68void packet_set_iv(int, u_char *);
69 69
@@ -81,8 +81,8 @@ void packet_add_padding(u_char);
81void tty_make_modes(int, struct termios *); 81void tty_make_modes(int, struct termios *);
82void tty_parse_modes(int, int *); 82void tty_parse_modes(int, int *);
83 83
84extern int max_packet_size; 84extern u_int max_packet_size;
85int packet_set_maxsize(int); 85u_int packet_set_maxsize(u_int);
86#define packet_get_maxsize() max_packet_size 86#define packet_get_maxsize() max_packet_size
87 87
88/* don't allow remaining bytes after the end of the message */ 88/* don't allow remaining bytes after the end of the message */
@@ -90,10 +90,13 @@ int packet_set_maxsize(int);
90do { \ 90do { \
91 int _len = packet_remaining(); \ 91 int _len = packet_remaining(); \
92 if (_len > 0) { \ 92 if (_len > 0) { \
93 log("Packet integrity error (%d bytes remaining) at %s:%d", \ 93 logit("Packet integrity error (%d bytes remaining) at %s:%d", \
94 _len ,__FILE__, __LINE__); \ 94 _len ,__FILE__, __LINE__); \
95 packet_disconnect("Packet integrity error."); \ 95 packet_disconnect("Packet integrity error."); \
96 } \ 96 } \
97} while (0) 97} while (0)
98 98
99int packet_need_rekeying(void);
100void packet_set_rekey_limit(u_int32_t);
101
99#endif /* PACKET_H */ 102#endif /* PACKET_H */
diff --git a/progressmeter.c b/progressmeter.c
index 90eb97f37..c315464ee 100644
--- a/progressmeter.c
+++ b/progressmeter.c
@@ -1,6 +1,5 @@
1/* 1/*
2 * Copyright (c) 1999 Theo de Raadt. All rights reserved. 2 * Copyright (c) 2003 Nils Nordman. All rights reserved.
3 * Copyright (c) 1999 Aaron Campbell. All rights reserved.
4 * 3 *
5 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
@@ -23,260 +22,244 @@
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 23 */
25 24
26/*
27 * Parts from:
28 *
29 * Copyright (c) 1983, 1990, 1992, 1993, 1995
30 * The Regents of the University of California. All rights reserved.
31 *
32 * Redistribution and use in source and binary forms, with or without
33 * modification, are permitted provided that the following conditions
34 * are met:
35 * 1. Redistributions of source code must retain the above copyright
36 * notice, this list of conditions and the following disclaimer.
37 * 2. Redistributions in binary form must reproduce the above copyright
38 * notice, this list of conditions and the following disclaimer in the
39 * documentation and/or other materials provided with the distribution.
40 * 3. All advertising materials mentioning features or use of this software
41 * must display the following acknowledgement:
42 * This product includes software developed by the University of
43 * California, Berkeley and its contributors.
44 * 4. Neither the name of the University nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 *
60 */
61
62#include "includes.h" 25#include "includes.h"
63RCSID("$OpenBSD: progressmeter.c,v 1.3 2003/03/17 10:38:38 markus Exp $"); 26RCSID("$OpenBSD: progressmeter.c,v 1.15 2003/08/31 12:14:22 markus Exp $");
64 27
65#ifdef HAVE_LIBGEN_H
66#include <libgen.h>
67#endif
68
69#include "atomicio.h"
70#include "progressmeter.h" 28#include "progressmeter.h"
29#include "atomicio.h"
30#include "misc.h"
71 31
72/* Number of seconds before xfer considered "stalled". */ 32#define DEFAULT_WINSIZE 80
73#define STALLTIME 5 33#define MAX_WINSIZE 512
74/* alarm() interval for updating progress meter. */ 34#define PADDING 1 /* padding between the progress indicators */
75#define PROGRESSTIME 1 35#define UPDATE_INTERVAL 1 /* update the progress meter every second */
76 36#define STALL_TIME 5 /* we're stalled after this many seconds */
77/* Signal handler used for updating the progress meter. */
78static void update_progress_meter(int);
79 37
80/* Returns non-zero if we are the foreground process. */ 38/* determines whether we can output to the terminal */
81static int foregroundproc(void); 39static int can_output(void);
82 40
83/* Returns width of the terminal (for progress meter calculations). */ 41/* formats and inserts the specified size into the given buffer */
84static int get_tty_width(void); 42static void format_size(char *, int, off_t);
43static void format_rate(char *, int, off_t);
85 44
86/* Visual statistics about files as they are transferred. */ 45/* updates the progressmeter to reflect the current state of the transfer */
87static void draw_progress_meter(void); 46void refresh_progress_meter(void);
88 47
89/* Time a transfer started. */ 48/* signal handler for updating the progress meter */
90static struct timeval start; 49static void update_progress_meter(int);
91 50
92/* Number of bytes of current file transferred so far. */ 51static time_t start; /* start progress */
93static volatile off_t *statbytes; 52static time_t last_update; /* last progress update */
53static char *file; /* name of the file being transferred */
54static off_t end_pos; /* ending position of transfer */
55static off_t cur_pos; /* transfer position as of last refresh */
56static volatile off_t *counter; /* progress counter */
57static long stalled; /* how long we have been stalled */
58static int bytes_per_second; /* current speed in bytes per second */
59static int win_size; /* terminal window size */
94 60
95/* Total size of current file. */ 61/* units for format_size */
96static off_t totalbytes; 62static const char unit[] = " KMGT";
97 63
98/* Name of current file being transferred. */ 64static int
99static char *curfile; 65can_output(void)
66{
67 return (getpgrp() == tcgetpgrp(STDOUT_FILENO));
68}
100 69
101/* Time of last update. */ 70static void
102static struct timeval lastupdate; 71format_rate(char *buf, int size, off_t bytes)
72{
73 int i;
74
75 bytes *= 100;
76 for (i = 0; bytes >= 100*1000 && unit[i] != 'T'; i++)
77 bytes = (bytes + 512) / 1024;
78 if (i == 0) {
79 i++;
80 bytes = (bytes + 512) / 1024;
81 }
82 snprintf(buf, size, "%3lld.%1lld%c%s",
83 (int64_t) bytes / 100,
84 (int64_t) (bytes + 5) / 10 % 10,
85 unit[i],
86 i ? "B" : " ");
87}
103 88
104/* Size at the time of the last update. */ 89static void
105static off_t lastsize; 90format_size(char *buf, int size, off_t bytes)
91{
92 int i;
93
94 for (i = 0; bytes >= 10000 && unit[i] != 'T'; i++)
95 bytes = (bytes + 512) / 1024;
96 snprintf(buf, size, "%4lld%c%s",
97 (int64_t) bytes,
98 unit[i],
99 i ? "B" : " ");
100}
106 101
107void 102void
108start_progress_meter(char *file, off_t filesize, off_t *counter) 103refresh_progress_meter(void)
109{ 104{
110 if ((curfile = basename(file)) == NULL) 105 char buf[MAX_WINSIZE + 1];
111 curfile = file; 106 time_t now;
107 off_t transferred;
108 double elapsed;
109 int percent;
110 int bytes_left;
111 int cur_speed;
112 int hours, minutes, seconds;
113 int i, len;
114 int file_len;
115
116 transferred = *counter - cur_pos;
117 cur_pos = *counter;
118 now = time(NULL);
119 bytes_left = end_pos - cur_pos;
120
121 if (bytes_left > 0)
122 elapsed = now - last_update;
123 else
124 elapsed = now - start;
112 125
113 totalbytes = filesize; 126 /* calculate speed */
114 statbytes = counter; 127 if (elapsed != 0)
115 (void) gettimeofday(&start, (struct timezone *) 0); 128 cur_speed = (transferred / elapsed);
116 lastupdate = start; 129 else
117 lastsize = 0; 130 cur_speed = 0;
118 131
119 draw_progress_meter(); 132#define AGE_FACTOR 0.9
120 signal(SIGALRM, update_progress_meter); 133 if (bytes_per_second != 0) {
121 alarm(PROGRESSTIME); 134 bytes_per_second = (bytes_per_second * AGE_FACTOR) +
122} 135 (cur_speed * (1.0 - AGE_FACTOR));
136 } else
137 bytes_per_second = cur_speed;
138
139 /* filename */
140 buf[0] = '\0';
141 file_len = win_size - 35;
142 if (file_len > 0) {
143 len = snprintf(buf, file_len + 1, "\r%s", file);
144 if (len < 0)
145 len = 0;
146 for (i = len; i < file_len; i++ )
147 buf[i] = ' ';
148 buf[file_len] = '\0';
149 }
123 150
124void 151 /* percent of transfer done */
125stop_progress_meter() 152 if (end_pos != 0)
126{ 153 percent = ((float)cur_pos / end_pos) * 100;
127 alarm(0); 154 else
128 draw_progress_meter(); 155 percent = 100;
129 if (foregroundproc() != 0) 156 snprintf(buf + strlen(buf), win_size - strlen(buf),
130 atomicio(write, fileno(stdout), "\n", 1); 157 " %3d%% ", percent);
158
159 /* amount transferred */
160 format_size(buf + strlen(buf), win_size - strlen(buf),
161 cur_pos);
162 strlcat(buf, " ", win_size);
163
164 /* bandwidth usage */
165 format_rate(buf + strlen(buf), win_size - strlen(buf),
166 bytes_per_second);
167 strlcat(buf, "/s ", win_size);
168
169 /* ETA */
170 if (!transferred)
171 stalled += elapsed;
172 else
173 stalled = 0;
174
175 if (stalled >= STALL_TIME)
176 strlcat(buf, "- stalled -", win_size);
177 else if (bytes_per_second == 0 && bytes_left)
178 strlcat(buf, " --:-- ETA", win_size);
179 else {
180 if (bytes_left > 0)
181 seconds = bytes_left / bytes_per_second;
182 else
183 seconds = elapsed;
184
185 hours = seconds / 3600;
186 seconds -= hours * 3600;
187 minutes = seconds / 60;
188 seconds -= minutes * 60;
189
190 if (hours != 0)
191 snprintf(buf + strlen(buf), win_size - strlen(buf),
192 "%d:%02d:%02d", hours, minutes, seconds);
193 else
194 snprintf(buf + strlen(buf), win_size - strlen(buf),
195 " %02d:%02d", minutes, seconds);
196
197 if (bytes_left > 0)
198 strlcat(buf, " ETA", win_size);
199 else
200 strlcat(buf, " ", win_size);
201 }
202
203 atomicio(vwrite, STDOUT_FILENO, buf, win_size);
204 last_update = now;
131} 205}
132 206
133static void 207static void
134update_progress_meter(int ignore) 208update_progress_meter(int ignore)
135{ 209{
136 int save_errno = errno; 210 int save_errno;
211
212 save_errno = errno;
213
214 if (can_output())
215 refresh_progress_meter();
137 216
138 draw_progress_meter();
139 signal(SIGALRM, update_progress_meter); 217 signal(SIGALRM, update_progress_meter);
140 alarm(PROGRESSTIME); 218 alarm(UPDATE_INTERVAL);
141 errno = save_errno; 219 errno = save_errno;
142} 220}
143 221
144static int 222void
145foregroundproc(void) 223start_progress_meter(char *f, off_t filesize, off_t *stat)
146{
147 static pid_t pgrp = -1;
148 int ctty_pgrp;
149
150 if (pgrp == -1)
151 pgrp = getpgrp();
152
153#ifdef HAVE_TCGETPGRP
154 return ((ctty_pgrp = tcgetpgrp(STDOUT_FILENO)) != -1 &&
155 ctty_pgrp == pgrp);
156#else
157 return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 &&
158 ctty_pgrp == pgrp));
159#endif
160}
161
162static void
163draw_progress_meter()
164{ 224{
165 static const char spaces[] = " " 225 struct winsize winsize;
166 " "
167 " "
168 " "
169 " "
170 " ";
171 static const char prefixes[] = " KMGTP";
172 struct timeval now, td, wait;
173 off_t cursize, abbrevsize, bytespersec;
174 double elapsed;
175 int ratio, remaining, i, ai, bi, nspaces;
176 char buf[512];
177
178 if (foregroundproc() == 0)
179 return;
180 226
181 (void) gettimeofday(&now, (struct timezone *) 0); 227 start = last_update = time(NULL);
182 cursize = *statbytes; 228 file = f;
183 if (totalbytes != 0) { 229 end_pos = filesize;
184 ratio = 100.0 * cursize / totalbytes; 230 cur_pos = 0;
185 ratio = MAX(ratio, 0); 231 counter = stat;
186 ratio = MIN(ratio, 100); 232 stalled = 0;
233 bytes_per_second = 0;
234
235 if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &winsize) != -1 &&
236 winsize.ws_col != 0) {
237 if (winsize.ws_col > MAX_WINSIZE)
238 win_size = MAX_WINSIZE;
239 else
240 win_size = winsize.ws_col;
187 } else 241 } else
188 ratio = 100; 242 win_size = DEFAULT_WINSIZE;
189 243 win_size += 1; /* trailing \0 */
190 abbrevsize = cursize;
191 for (ai = 0; abbrevsize >= 10000 && ai < sizeof(prefixes); ai++)
192 abbrevsize >>= 10;
193 244
194 timersub(&now, &lastupdate, &wait); 245 if (can_output())
195 if (cursize > lastsize) { 246 refresh_progress_meter();
196 lastupdate = now;
197 lastsize = cursize;
198 wait.tv_sec = 0;
199 }
200 timersub(&now, &start, &td);
201 elapsed = td.tv_sec + (td.tv_usec / 1000000.0);
202
203 bytespersec = 0;
204 if (cursize > 0) {
205 bytespersec = cursize;
206 if (elapsed > 0.0)
207 bytespersec /= elapsed;
208 }
209 for (bi = 1; bytespersec >= 1024000 && bi < sizeof(prefixes); bi++)
210 bytespersec >>= 10;
211
212 nspaces = MIN(get_tty_width() - 79, sizeof(spaces) - 1);
213
214#ifdef HAVE_LONG_LONG_INT
215 snprintf(buf, sizeof(buf),
216 "\r%-45.45s%.*s%3d%% %4lld%c%c %3lld.%01d%cB/s",
217 curfile,
218 nspaces,
219 spaces,
220 ratio,
221 (long long)abbrevsize,
222 prefixes[ai],
223 ai == 0 ? ' ' : 'B',
224 (long long)(bytespersec / 1024),
225 (int)((bytespersec % 1024) * 10 / 1024),
226 prefixes[bi]
227 );
228#else
229 /* XXX: Handle integer overflow? */
230 snprintf(buf, sizeof(buf),
231 "\r%-45.45s%.*s%3d%% %4lu%c%c %3lu.%01d%cB/s",
232 curfile,
233 nspaces,
234 spaces,
235 ratio,
236 (u_long)abbrevsize,
237 prefixes[ai],
238 ai == 0 ? ' ' : 'B',
239 (u_long)(bytespersec / 1024),
240 (int)((bytespersec % 1024) * 10 / 1024),
241 prefixes[bi]
242 );
243#endif
244
245 if (cursize <= 0 || elapsed <= 0.0 || cursize > totalbytes) {
246 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
247 " --:-- ETA");
248 } else if (wait.tv_sec >= STALLTIME) {
249 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
250 " - stalled -");
251 } else {
252 if (cursize != totalbytes)
253 remaining = (int)(totalbytes / (cursize / elapsed) -
254 elapsed);
255 else
256 remaining = elapsed;
257 247
258 i = remaining / 3600; 248 signal(SIGALRM, update_progress_meter);
259 if (i) 249 alarm(UPDATE_INTERVAL);
260 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
261 "%2d:", i);
262 else
263 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
264 " ");
265 i = remaining % 3600;
266 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
267 "%02d:%02d%s", i / 60, i % 60,
268 (cursize != totalbytes) ? " ETA" : " ");
269 }
270 atomicio(write, fileno(stdout), buf, strlen(buf));
271} 250}
272 251
273static int 252void
274get_tty_width(void) 253stop_progress_meter(void)
275{ 254{
276 struct winsize winsize; 255 alarm(0);
277 256
278 if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) != -1) 257 if (!can_output())
279 return (winsize.ws_col ? winsize.ws_col : 80); 258 return;
280 else 259
281 return (80); 260 /* Ensure we complete the progress */
261 if (cur_pos != end_pos)
262 refresh_progress_meter();
263
264 atomicio(vwrite, STDOUT_FILENO, "\n", 1);
282} 265}
diff --git a/readconf.c b/readconf.c
index 1df5ce2d9..13987ffa7 100644
--- a/readconf.c
+++ b/readconf.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $"); 15RCSID("$OpenBSD: readconf.c,v 1.121 2003/09/01 18:15:50 markus Exp $");
16 16
17#include "ssh.h" 17#include "ssh.h"
18#include "xmalloc.h" 18#include "xmalloc.h"
@@ -57,7 +57,6 @@ RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $");
57 Host fascist.blob.com 57 Host fascist.blob.com
58 Port 23123 58 Port 23123
59 User tylonen 59 User tylonen
60 RhostsAuthentication no
61 PasswordAuthentication no 60 PasswordAuthentication no
62 61
63 Host puukko.hut.fi 62 Host puukko.hut.fi
@@ -75,7 +74,6 @@ RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $");
75 Host * 74 Host *
76 ForwardAgent no 75 ForwardAgent no
77 ForwardX11 no 76 ForwardX11 no
78 RhostsAuthentication yes
79 PasswordAuthentication yes 77 PasswordAuthentication yes
80 RSAAuthentication yes 78 RSAAuthentication yes
81 RhostsRSAAuthentication yes 79 RhostsRSAAuthentication yes
@@ -91,18 +89,9 @@ RCSID("$OpenBSD: readconf.c,v 1.104 2003/04/01 10:22:21 markus Exp $");
91 89
92typedef enum { 90typedef enum {
93 oBadOption, 91 oBadOption,
94 oForwardAgent, oForwardX11, oGatewayPorts, oRhostsAuthentication, 92 oForwardAgent, oForwardX11, oGatewayPorts,
95 oPasswordAuthentication, oRSAAuthentication, 93 oPasswordAuthentication, oRSAAuthentication,
96 oChallengeResponseAuthentication, oXAuthLocation, 94 oChallengeResponseAuthentication, oXAuthLocation,
97#if defined(KRB4) || defined(KRB5)
98 oKerberosAuthentication,
99#endif
100#if defined(AFS) || defined(KRB5)
101 oKerberosTgtPassing,
102#endif
103#ifdef AFS
104 oAFSTokenPassing,
105#endif
106 oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward, 95 oIdentityFile, oHostName, oPort, oCipher, oRemoteForward, oLocalForward,
107 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand, 96 oUser, oHost, oEscapeChar, oRhostsRSAAuthentication, oProxyCommand,
108 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts, 97 oGlobalKnownHostsFile, oUserKnownHostsFile, oConnectionAttempts,
@@ -114,8 +103,9 @@ typedef enum {
114 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication, 103 oDynamicForward, oPreferredAuthentications, oHostbasedAuthentication,
115 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice, 104 oHostKeyAlgorithms, oBindAddress, oSmartcardDevice,
116 oClearAllForwardings, oNoHostAuthenticationForLocalhost, 105 oClearAllForwardings, oNoHostAuthenticationForLocalhost,
117 oEnableSSHKeysign, 106 oEnableSSHKeysign, oRekeyLimit, oVerifyHostKeyDNS, oConnectTimeout,
118 oDeprecated 107 oAddressFamily, oGssAuthentication, oGssDelegateCreds,
108 oDeprecated, oUnsupported
119} OpCodes; 109} OpCodes;
120 110
121/* Textual representations of the tokens. */ 111/* Textual representations of the tokens. */
@@ -129,7 +119,7 @@ static struct {
129 { "xauthlocation", oXAuthLocation }, 119 { "xauthlocation", oXAuthLocation },
130 { "gatewayports", oGatewayPorts }, 120 { "gatewayports", oGatewayPorts },
131 { "useprivilegedport", oUsePrivilegedPort }, 121 { "useprivilegedport", oUsePrivilegedPort },
132 { "rhostsauthentication", oRhostsAuthentication }, 122 { "rhostsauthentication", oDeprecated },
133 { "passwordauthentication", oPasswordAuthentication }, 123 { "passwordauthentication", oPasswordAuthentication },
134 { "kbdinteractiveauthentication", oKbdInteractiveAuthentication }, 124 { "kbdinteractiveauthentication", oKbdInteractiveAuthentication },
135 { "kbdinteractivedevices", oKbdInteractiveDevices }, 125 { "kbdinteractivedevices", oKbdInteractiveDevices },
@@ -141,14 +131,15 @@ static struct {
141 { "challengeresponseauthentication", oChallengeResponseAuthentication }, 131 { "challengeresponseauthentication", oChallengeResponseAuthentication },
142 { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */ 132 { "skeyauthentication", oChallengeResponseAuthentication }, /* alias */
143 { "tisauthentication", oChallengeResponseAuthentication }, /* alias */ 133 { "tisauthentication", oChallengeResponseAuthentication }, /* alias */
144#if defined(KRB4) || defined(KRB5) 134 { "kerberosauthentication", oUnsupported },
145 { "kerberosauthentication", oKerberosAuthentication }, 135 { "kerberostgtpassing", oUnsupported },
146#endif 136 { "afstokenpassing", oUnsupported },
147#if defined(AFS) || defined(KRB5) 137#if defined(GSSAPI)
148 { "kerberostgtpassing", oKerberosTgtPassing }, 138 { "gssapiauthentication", oGssAuthentication },
149#endif 139 { "gssapidelegatecredentials", oGssDelegateCreds },
150#ifdef AFS 140#else
151 { "afstokenpassing", oAFSTokenPassing }, 141 { "gssapiauthentication", oUnsupported },
142 { "gssapidelegatecredentials", oUnsupported },
152#endif 143#endif
153 { "fallbacktorsh", oDeprecated }, 144 { "fallbacktorsh", oDeprecated },
154 { "usersh", oDeprecated }, 145 { "usersh", oDeprecated },
@@ -184,10 +175,22 @@ static struct {
184 { "preferredauthentications", oPreferredAuthentications }, 175 { "preferredauthentications", oPreferredAuthentications },
185 { "hostkeyalgorithms", oHostKeyAlgorithms }, 176 { "hostkeyalgorithms", oHostKeyAlgorithms },
186 { "bindaddress", oBindAddress }, 177 { "bindaddress", oBindAddress },
178#ifdef SMARTCARD
187 { "smartcarddevice", oSmartcardDevice }, 179 { "smartcarddevice", oSmartcardDevice },
180#else
181 { "smartcarddevice", oUnsupported },
182#endif
188 { "clearallforwardings", oClearAllForwardings }, 183 { "clearallforwardings", oClearAllForwardings },
189 { "enablesshkeysign", oEnableSSHKeysign }, 184 { "enablesshkeysign", oEnableSSHKeysign },
185#ifdef DNS
186 { "verifyhostkeydns", oVerifyHostKeyDNS },
187#else
188 { "verifyhostkeydns", oUnsupported },
189#endif
190 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost }, 190 { "nohostauthenticationforlocalhost", oNoHostAuthenticationForLocalhost },
191 { "rekeylimit", oRekeyLimit },
192 { "connecttimeout", oConnectTimeout },
193 { "addressfamily", oAddressFamily },
191 { NULL, oBadOption } 194 { NULL, oBadOption }
192}; 195};
193 196
@@ -281,6 +284,13 @@ process_config_line(Options *options, const char *host,
281 u_short fwd_port, fwd_host_port; 284 u_short fwd_port, fwd_host_port;
282 char sfwd_host_port[6]; 285 char sfwd_host_port[6];
283 286
287 /* Strip trailing whitespace */
288 for(len = strlen(line) - 1; len > 0; len--) {
289 if (strchr(WHITESPACE, line[len]) == NULL)
290 break;
291 line[len] = '\0';
292 }
293
284 s = line; 294 s = line;
285 /* Get the keyword. (Each line is supposed to begin with a keyword). */ 295 /* Get the keyword. (Each line is supposed to begin with a keyword). */
286 keyword = strdelim(&s); 296 keyword = strdelim(&s);
@@ -297,6 +307,20 @@ process_config_line(Options *options, const char *host,
297 /* don't panic, but count bad options */ 307 /* don't panic, but count bad options */
298 return -1; 308 return -1;
299 /* NOTREACHED */ 309 /* NOTREACHED */
310 case oConnectTimeout:
311 intptr = &options->connection_timeout;
312/* parse_time: */
313 arg = strdelim(&s);
314 if (!arg || *arg == '\0')
315 fatal("%s line %d: missing time value.",
316 filename, linenum);
317 if ((value = convtime(arg)) == -1)
318 fatal("%s line %d: invalid time value.",
319 filename, linenum);
320 if (*intptr == -1)
321 *intptr = value;
322 break;
323
300 case oForwardAgent: 324 case oForwardAgent:
301 intptr = &options->forward_agent; 325 intptr = &options->forward_agent;
302parse_flag: 326parse_flag:
@@ -326,10 +350,6 @@ parse_flag:
326 intptr = &options->use_privileged_port; 350 intptr = &options->use_privileged_port;
327 goto parse_flag; 351 goto parse_flag;
328 352
329 case oRhostsAuthentication:
330 intptr = &options->rhosts_authentication;
331 goto parse_flag;
332
333 case oPasswordAuthentication: 353 case oPasswordAuthentication:
334 intptr = &options->password_authentication; 354 intptr = &options->password_authentication;
335 goto parse_flag; 355 goto parse_flag;
@@ -361,21 +381,15 @@ parse_flag:
361 case oChallengeResponseAuthentication: 381 case oChallengeResponseAuthentication:
362 intptr = &options->challenge_response_authentication; 382 intptr = &options->challenge_response_authentication;
363 goto parse_flag; 383 goto parse_flag;
364#if defined(KRB4) || defined(KRB5) 384
365 case oKerberosAuthentication: 385 case oGssAuthentication:
366 intptr = &options->kerberos_authentication; 386 intptr = &options->gss_authentication;
367 goto parse_flag;
368#endif
369#if defined(AFS) || defined(KRB5)
370 case oKerberosTgtPassing:
371 intptr = &options->kerberos_tgt_passing;
372 goto parse_flag; 387 goto parse_flag;
373#endif 388
374#ifdef AFS 389 case oGssDelegateCreds:
375 case oAFSTokenPassing: 390 intptr = &options->gss_deleg_creds;
376 intptr = &options->afs_token_passing;
377 goto parse_flag; 391 goto parse_flag;
378#endif 392
379 case oBatchMode: 393 case oBatchMode:
380 intptr = &options->batch_mode; 394 intptr = &options->batch_mode;
381 goto parse_flag; 395 goto parse_flag;
@@ -384,6 +398,10 @@ parse_flag:
384 intptr = &options->check_host_ip; 398 intptr = &options->check_host_ip;
385 goto parse_flag; 399 goto parse_flag;
386 400
401 case oVerifyHostKeyDNS:
402 intptr = &options->verify_host_key_dns;
403 goto parse_flag;
404
387 case oStrictHostKeyChecking: 405 case oStrictHostKeyChecking:
388 intptr = &options->strict_host_key_checking; 406 intptr = &options->strict_host_key_checking;
389 arg = strdelim(&s); 407 arg = strdelim(&s);
@@ -423,6 +441,31 @@ parse_flag:
423 intptr = &options->compression_level; 441 intptr = &options->compression_level;
424 goto parse_int; 442 goto parse_int;
425 443
444 case oRekeyLimit:
445 intptr = &options->rekey_limit;
446 arg = strdelim(&s);
447 if (!arg || *arg == '\0')
448 fatal("%.200s line %d: Missing argument.", filename, linenum);
449 if (arg[0] < '0' || arg[0] > '9')
450 fatal("%.200s line %d: Bad number.", filename, linenum);
451 value = strtol(arg, &endofnumber, 10);
452 if (arg == endofnumber)
453 fatal("%.200s line %d: Bad number.", filename, linenum);
454 switch (toupper(*endofnumber)) {
455 case 'K':
456 value *= 1<<10;
457 break;
458 case 'M':
459 value *= 1<<20;
460 break;
461 case 'G':
462 value *= 1<<30;
463 break;
464 }
465 if (*activep && *intptr == -1)
466 *intptr = value;
467 break;
468
426 case oIdentityFile: 469 case oIdentityFile:
427 arg = strdelim(&s); 470 arg = strdelim(&s);
428 if (!arg || *arg == '\0') 471 if (!arg || *arg == '\0')
@@ -489,6 +532,8 @@ parse_string:
489 goto parse_string; 532 goto parse_string;
490 533
491 case oProxyCommand: 534 case oProxyCommand:
535 if (s == NULL)
536 fatal("%.200s line %d: Missing argument.", filename, linenum);
492 charptr = &options->proxy_command; 537 charptr = &options->proxy_command;
493 len = strspn(s, WHITESPACE "="); 538 len = strspn(s, WHITESPACE "=");
494 if (*activep && *charptr == NULL) 539 if (*activep && *charptr == NULL)
@@ -626,7 +671,7 @@ parse_int:
626 fatal("%.200s line %d: Badly formatted port number.", 671 fatal("%.200s line %d: Badly formatted port number.",
627 filename, linenum); 672 filename, linenum);
628 if (*activep) 673 if (*activep)
629 add_local_forward(options, fwd_port, "socks4", 0); 674 add_local_forward(options, fwd_port, "socks", 0);
630 break; 675 break;
631 676
632 case oClearAllForwardings: 677 case oClearAllForwardings:
@@ -666,6 +711,21 @@ parse_int:
666 *intptr = value; 711 *intptr = value;
667 break; 712 break;
668 713
714 case oAddressFamily:
715 arg = strdelim(&s);
716 intptr = &options->address_family;
717 if (strcasecmp(arg, "inet") == 0)
718 value = AF_INET;
719 else if (strcasecmp(arg, "inet6") == 0)
720 value = AF_INET6;
721 else if (strcasecmp(arg, "any") == 0)
722 value = AF_UNSPEC;
723 else
724 fatal("Unsupported AddressFamily \"%s\"", arg);
725 if (*activep && *intptr == -1)
726 *intptr = value;
727 break;
728
669 case oEnableSSHKeysign: 729 case oEnableSSHKeysign:
670 intptr = &options->enable_ssh_keysign; 730 intptr = &options->enable_ssh_keysign;
671 goto parse_flag; 731 goto parse_flag;
@@ -675,6 +735,11 @@ parse_int:
675 filename, linenum, keyword); 735 filename, linenum, keyword);
676 return 0; 736 return 0;
677 737
738 case oUnsupported:
739 error("%s line %d: Unsupported option \"%s\"",
740 filename, linenum, keyword);
741 return 0;
742
678 default: 743 default:
679 fatal("process_config_line: Unimplemented opcode %d", opcode); 744 fatal("process_config_line: Unimplemented opcode %d", opcode);
680 } 745 }
@@ -744,19 +809,11 @@ initialize_options(Options * options)
744 options->xauth_location = NULL; 809 options->xauth_location = NULL;
745 options->gateway_ports = -1; 810 options->gateway_ports = -1;
746 options->use_privileged_port = -1; 811 options->use_privileged_port = -1;
747 options->rhosts_authentication = -1;
748 options->rsa_authentication = -1; 812 options->rsa_authentication = -1;
749 options->pubkey_authentication = -1; 813 options->pubkey_authentication = -1;
750 options->challenge_response_authentication = -1; 814 options->challenge_response_authentication = -1;
751#if defined(KRB4) || defined(KRB5) 815 options->gss_authentication = -1;
752 options->kerberos_authentication = -1; 816 options->gss_deleg_creds = -1;
753#endif
754#if defined(AFS) || defined(KRB5)
755 options->kerberos_tgt_passing = -1;
756#endif
757#ifdef AFS
758 options->afs_token_passing = -1;
759#endif
760 options->password_authentication = -1; 817 options->password_authentication = -1;
761 options->kbd_interactive_authentication = -1; 818 options->kbd_interactive_authentication = -1;
762 options->kbd_interactive_devices = NULL; 819 options->kbd_interactive_devices = NULL;
@@ -769,7 +826,9 @@ initialize_options(Options * options)
769 options->keepalives = -1; 826 options->keepalives = -1;
770 options->compression_level = -1; 827 options->compression_level = -1;
771 options->port = -1; 828 options->port = -1;
829 options->address_family = -1;
772 options->connection_attempts = -1; 830 options->connection_attempts = -1;
831 options->connection_timeout = -1;
773 options->number_of_password_prompts = -1; 832 options->number_of_password_prompts = -1;
774 options->cipher = -1; 833 options->cipher = -1;
775 options->ciphers = NULL; 834 options->ciphers = NULL;
@@ -795,6 +854,8 @@ initialize_options(Options * options)
795 options->smartcard_device = NULL; 854 options->smartcard_device = NULL;
796 options->enable_ssh_keysign = - 1; 855 options->enable_ssh_keysign = - 1;
797 options->no_host_authentication_for_localhost = - 1; 856 options->no_host_authentication_for_localhost = - 1;
857 options->rekey_limit = - 1;
858 options->verify_host_key_dns = -1;
798} 859}
799 860
800/* 861/*
@@ -817,26 +878,16 @@ fill_default_options(Options * options)
817 options->gateway_ports = 0; 878 options->gateway_ports = 0;
818 if (options->use_privileged_port == -1) 879 if (options->use_privileged_port == -1)
819 options->use_privileged_port = 0; 880 options->use_privileged_port = 0;
820 if (options->rhosts_authentication == -1)
821 options->rhosts_authentication = 0;
822 if (options->rsa_authentication == -1) 881 if (options->rsa_authentication == -1)
823 options->rsa_authentication = 1; 882 options->rsa_authentication = 1;
824 if (options->pubkey_authentication == -1) 883 if (options->pubkey_authentication == -1)
825 options->pubkey_authentication = 1; 884 options->pubkey_authentication = 1;
826 if (options->challenge_response_authentication == -1) 885 if (options->challenge_response_authentication == -1)
827 options->challenge_response_authentication = 1; 886 options->challenge_response_authentication = 1;
828#if defined(KRB4) || defined(KRB5) 887 if (options->gss_authentication == -1)
829 if (options->kerberos_authentication == -1) 888 options->gss_authentication = 1;
830 options->kerberos_authentication = 1; 889 if (options->gss_deleg_creds == -1)
831#endif 890 options->gss_deleg_creds = 0;
832#if defined(AFS) || defined(KRB5)
833 if (options->kerberos_tgt_passing == -1)
834 options->kerberos_tgt_passing = 1;
835#endif
836#ifdef AFS
837 if (options->afs_token_passing == -1)
838 options->afs_token_passing = 1;
839#endif
840 if (options->password_authentication == -1) 891 if (options->password_authentication == -1)
841 options->password_authentication = 1; 892 options->password_authentication = 1;
842 if (options->kbd_interactive_authentication == -1) 893 if (options->kbd_interactive_authentication == -1)
@@ -859,6 +910,8 @@ fill_default_options(Options * options)
859 options->compression_level = 6; 910 options->compression_level = 6;
860 if (options->port == -1) 911 if (options->port == -1)
861 options->port = 0; /* Filled in ssh_connect. */ 912 options->port = 0; /* Filled in ssh_connect. */
913 if (options->address_family == -1)
914 options->address_family = AF_UNSPEC;
862 if (options->connection_attempts == -1) 915 if (options->connection_attempts == -1)
863 options->connection_attempts = 1; 916 options->connection_attempts = 1;
864 if (options->number_of_password_prompts == -1) 917 if (options->number_of_password_prompts == -1)
@@ -911,6 +964,10 @@ fill_default_options(Options * options)
911 options->no_host_authentication_for_localhost = 0; 964 options->no_host_authentication_for_localhost = 0;
912 if (options->enable_ssh_keysign == -1) 965 if (options->enable_ssh_keysign == -1)
913 options->enable_ssh_keysign = 0; 966 options->enable_ssh_keysign = 0;
967 if (options->rekey_limit == -1)
968 options->rekey_limit = 0;
969 if (options->verify_host_key_dns == -1)
970 options->verify_host_key_dns = 0;
914 /* options->proxy_command should not be set by default */ 971 /* options->proxy_command should not be set by default */
915 /* options->user will be set in the main program if appropriate */ 972 /* options->user will be set in the main program if appropriate */
916 /* options->hostname will be set in the main program if appropriate */ 973 /* options->hostname will be set in the main program if appropriate */
diff --git a/readconf.h b/readconf.h
index 78e04fedf..60287f710 100644
--- a/readconf.h
+++ b/readconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: readconf.h,v 1.46 2003/04/01 10:22:21 markus Exp $ */ 1/* $OpenBSD: readconf.h,v 1.55 2003/09/01 18:15:50 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -33,7 +33,6 @@ typedef struct {
33 char *xauth_location; /* Location for xauth program */ 33 char *xauth_location; /* Location for xauth program */
34 int gateway_ports; /* Allow remote connects to forwarded ports. */ 34 int gateway_ports; /* Allow remote connects to forwarded ports. */
35 int use_privileged_port; /* Don't use privileged port if false. */ 35 int use_privileged_port; /* Don't use privileged port if false. */
36 int rhosts_authentication; /* Try rhosts authentication. */
37 int rhosts_rsa_authentication; /* Try rhosts with RSA 36 int rhosts_rsa_authentication; /* Try rhosts with RSA
38 * authentication. */ 37 * authentication. */
39 int rsa_authentication; /* Try RSA authentication. */ 38 int rsa_authentication; /* Try RSA authentication. */
@@ -41,15 +40,8 @@ typedef struct {
41 int hostbased_authentication; /* ssh2's rhosts_rsa */ 40 int hostbased_authentication; /* ssh2's rhosts_rsa */
42 int challenge_response_authentication; 41 int challenge_response_authentication;
43 /* Try S/Key or TIS, authentication. */ 42 /* Try S/Key or TIS, authentication. */
44#if defined(KRB4) || defined(KRB5) 43 int gss_authentication; /* Try GSS authentication */
45 int kerberos_authentication; /* Try Kerberos authentication. */ 44 int gss_deleg_creds; /* Delegate GSS credentials */
46#endif
47#if defined(AFS) || defined(KRB5)
48 int kerberos_tgt_passing; /* Try Kerberos TGT passing. */
49#endif
50#ifdef AFS
51 int afs_token_passing; /* Try AFS token passing. */
52#endif
53 int password_authentication; /* Try password 45 int password_authentication; /* Try password
54 * authentication. */ 46 * authentication. */
55 int kbd_interactive_authentication; /* Try keyboard-interactive auth. */ 47 int kbd_interactive_authentication; /* Try keyboard-interactive auth. */
@@ -64,8 +56,11 @@ typedef struct {
64 LogLevel log_level; /* Level for logging. */ 56 LogLevel log_level; /* Level for logging. */
65 57
66 int port; /* Port to connect. */ 58 int port; /* Port to connect. */
59 int address_family;
67 int connection_attempts; /* Max attempts (seconds) before 60 int connection_attempts; /* Max attempts (seconds) before
68 * giving up */ 61 * giving up */
62 int connection_timeout; /* Max time (seconds) before
63 * aborting connection attempt */
69 int number_of_password_prompts; /* Max number of password 64 int number_of_password_prompts; /* Max number of password
70 * prompts. */ 65 * prompts. */
71 int cipher; /* Cipher to use. */ 66 int cipher; /* Cipher to use. */
@@ -86,6 +81,7 @@ typedef struct {
86 char *preferred_authentications; 81 char *preferred_authentications;
87 char *bind_address; /* local socket address for connection to sshd */ 82 char *bind_address; /* local socket address for connection to sshd */
88 char *smartcard_device; /* Smartcard reader device */ 83 char *smartcard_device; /* Smartcard reader device */
84 int verify_host_key_dns; /* Verify host key using DNS */
89 85
90 int num_identity_files; /* Number of files for RSA/DSA identities. */ 86 int num_identity_files; /* Number of files for RSA/DSA identities. */
91 char *identity_files[SSH_MAX_IDENTITY_FILES]; 87 char *identity_files[SSH_MAX_IDENTITY_FILES];
@@ -101,6 +97,7 @@ typedef struct {
101 int clear_forwardings; 97 int clear_forwardings;
102 98
103 int enable_ssh_keysign; 99 int enable_ssh_keysign;
100 int rekey_limit;
104 int no_host_authentication_for_localhost; 101 int no_host_authentication_for_localhost;
105} Options; 102} Options;
106 103
diff --git a/regress/Makefile b/regress/Makefile
index 6e2029348..623be8d82 100644
--- a/regress/Makefile
+++ b/regress/Makefile
@@ -1,8 +1,11 @@
1# $OpenBSD: Makefile,v 1.20 2003/01/08 23:54:22 djm Exp $ 1# $OpenBSD: Makefile,v 1.24 2003/07/03 08:24:13 markus Exp $
2 2
3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 3REGRESS_TARGETS= t1 t2 t3 t4 t5 t6 t7 t-exec
4tests: $(REGRESS_TARGETS)
4 5
5CLEANFILES+= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 6clean:
7 for F in $(CLEANFILES); do rm -f $(OBJ)$$F; done
8distclean: clean
6 9
7LTESTS= connect \ 10LTESTS= connect \
8 proxy-connect \ 11 proxy-connect \
@@ -11,6 +14,7 @@ LTESTS= connect \
11 proto-mismatch \ 14 proto-mismatch \
12 exit-status \ 15 exit-status \
13 transfer \ 16 transfer \
17 rekey \
14 stderr-data \ 18 stderr-data \
15 stderr-after-eof \ 19 stderr-after-eof \
16 broken-pipe \ 20 broken-pipe \
@@ -24,30 +28,34 @@ LTESTS= connect \
24 keygen-change \ 28 keygen-change \
25 sftp \ 29 sftp \
26 sftp-cmds \ 30 sftp-cmds \
31 sftp-badcmds \
27 sftp-batch \ 32 sftp-batch \
33 reconfigure \
34 dynamic-forward \
28 forwarding 35 forwarding
29 36
30USER!= id -un 37USER!= id -un
31CLEANFILES+= authorized_keys_${USER} known_hosts pidfile \ 38CLEANFILES= t2.out t6.out1 t6.out2 t7.out t7.out.pub copy.1 copy.2 \
39 authorized_keys_${USER} known_hosts pidfile \
32 ssh_config ssh_proxy sshd_config sshd_proxy \ 40 ssh_config ssh_proxy sshd_config sshd_proxy \
33 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \ 41 rsa.pub rsa rsa1.pub rsa1 host.rsa host.rsa1 \
34 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \ 42 rsa-agent rsa-agent.pub rsa1-agent rsa1-agent.pub \
35 ls.copy 43 ls.copy remote_pid
36 44
37#LTESTS+= ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp 45#LTESTS += ssh-com ssh-com-client ssh-com-keygen ssh-com-sftp
38 46
39t1: 47t1:
40 ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv 48 ssh-keygen -if ${.CURDIR}/rsa_ssh2.prv | diff - ${.CURDIR}/rsa_openssh.prv
41 49
42t2: 50t2:
43 cat ${.CURDIR}/rsa_openssh.prv > t2.out 51 cat ${.CURDIR}/rsa_openssh.prv > $(OBJ)/t2.out
44 chmod 600 t2.out 52 chmod 600 $(OBJ)/t2.out
45 ssh-keygen -yf t2.out | diff - ${.CURDIR}/rsa_openssh.pub 53 ssh-keygen -yf $(OBJ)/t2.out | diff - ${.CURDIR}/rsa_openssh.pub
46 54
47t3: 55t3:
48 ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub |\ 56 ssh-keygen -ef ${.CURDIR}/rsa_openssh.pub >$(OBJ)/rsa_secsh.pub
49 ssh-keygen -if /dev/stdin |\ 57 ssh-keygen -if $(OBJ)/rsa_secsh.pub | diff - ${.CURDIR}/rsa_openssh.pub
50 diff - ${.CURDIR}/rsa_openssh.pub 58 rm -f ${.CURDIR}/rsa_secsh.pub
51 59
52t4: 60t4:
53 ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\ 61 ssh-keygen -lf ${.CURDIR}/rsa_openssh.pub |\
@@ -58,22 +66,21 @@ t5:
58 awk '{print $$2}' | diff - ${.CURDIR}/t5.ok 66 awk '{print $$2}' | diff - ${.CURDIR}/t5.ok
59 67
60t6: 68t6:
61 ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > t6.out1 69 ssh-keygen -if ${.CURDIR}/dsa_ssh2.prv > $(OBJ)/t6.out1
62 ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > t6.out2 70 ssh-keygen -if ${.CURDIR}/dsa_ssh2.pub > $(OBJ)/t6.out2
63 chmod 600 t6.out1 71 chmod 600 $(OBJ)/t6.out1
64 ssh-keygen -yf t6.out1 | diff - t6.out2 72 ssh-keygen -yf $(OBJ)/t6.out1 | diff - $(OBJ)/t6.out2
65 73
66t7.out: 74$(OBJ)/t7.out:
67 ssh-keygen -q -t rsa -N '' -f $@ 75 ssh-keygen -q -t rsa -N '' -f $@
68 76
69t7: t7.out 77t7: $(OBJ)/t7.out
70 ssh-keygen -lf t7.out > /dev/null 78 ssh-keygen -lf $(OBJ)/t7.out > /dev/null
71 ssh-keygen -Bf t7.out > /dev/null 79 ssh-keygen -Bf $(OBJ)/t7.out > /dev/null
72 80
73.for t in ${LTESTS} 81t-exec: ${LTESTS:=.sh}
74REGRESS_TARGETS+=t-${t} 82 @if [ "x$?" = "x" ]; then exit 0; fi; \
75t-${t}: 83 for TEST in ""$?; do \
76 sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/${t}.sh 84 echo "run test $${TEST}" ... 1>&2; \
77.endfor 85 (sh ${.CURDIR}/test-exec.sh ${.OBJDIR} ${.CURDIR}/$${TEST}) || exit $$?; \
78 86 done
79.include "bsd.regress.mk"
diff --git a/regress/README.regress b/regress/README.regress
new file mode 100644
index 000000000..916894a88
--- /dev/null
+++ b/regress/README.regress
@@ -0,0 +1,86 @@
1Overview.
2
3$ ./configure && make tests
4
5You'll see some progress info. A failure will cause either the make to
6abort or the driver script to report a "FATAL" failure.
7
8The test consists of 2 parts. The first is the file-based tests which is
9driven by the Makefile, and the second is a set of network or proxycommand
10based tests, which are driven by a driver script (test-exec.sh) which is
11called multiple times by the Makefile.
12
13Failures in the first part will cause the Makefile to return an error.
14Failures in the second part will print a "FATAL" message for the failed
15test and continue.
16
17OpenBSD has a system-wide regression test suite. OpenSSH Portable's test
18suite is based on OpenBSD's with modifications.
19
20
21Environment variables.
22
23SUDO: path to sudo command, if desired. Note that some systems (notably
24 systems using PAM) require sudo to execute some tests.
25TEST_SSH_TRACE: set yo "yes" for verbose output from tests
26TEST_SSH_QUIET: set to "yes" to suppress non-fatal output.
27TEST_SSH_x: path to "ssh" command under test, where x=SSH,SSHD,SSHAGENT,SSHADD
28 SSHKEYGEN,SSHKEYSCAN,SFTP,SFTPSERVER
29OBJ: used by test scripts to access build dir.
30
31
32Individual tests.
33
34You can invoke test-exec.sh directly if you set up the path to find the
35binaries under test and the test scripts themselves, for example:
36
37$ cd regress
38$ PATH=`pwd`/..:$PATH:. sh test-exec.sh `pwd` agent-timeout.sh
39ok agent timeout test
40
41
42Files.
43
44test-exec.sh: the main test driver. Sets environment, creates config files
45and keys and runs the specified test.
46
47At the time of writing, the individual tests are:
48agent-timeout.sh: agent timeout test
49agent.sh: simple agent test
50broken-pipe.sh: broken pipe test
51connect-privsep.sh: proxy connect with privsep
52connect.sh: simple connect
53exit-status.sh: remote exit status
54forwarding.sh: local and remote forwarding
55keygen-change.sh: change passphrase for key
56keyscan.sh: keyscan
57proto-mismatch.sh: protocol version mismatch
58proto-version.sh: sshd version with different protocol combinations
59proxy-connect.sh: proxy connect
60sftp.sh: basic sftp put/get
61ssh-com-client.sh: connect with ssh.com client
62ssh-com-keygen.sh: ssh.com key import
63ssh-com-sftp.sh: basic sftp put/get with ssh.com server
64ssh-com.sh: connect to ssh.com server
65stderr-after-eof.sh: stderr data after eof
66stderr-data.sh: stderr data transfer
67transfer.sh: transfer data
68try-ciphers.sh: try ciphers
69yes-head.sh: yes pipe head
70
71
72Problems?
73
74Run the failing test with shell tracing (-x) turned on:
75$ PATH=`pwd`/..:$PATH:. sh -x test-exec.sh `pwd` agent-timeout.sh
76
77Failed tests can be difficult to diagnose. Suggestions:
78- run the individual test via ./test-exec.sh `pwd` [testname]
79- set LogLevel to VERBOSE in test-exec.sh and enable syslogging of
80 auth.debug (eg to /var/log/authlog).
81
82
83Known Issues.
84
85
86$Id: README.regress,v 1.1 2003/09/04 05:39:54 dtucker Exp $
diff --git a/regress/agent-getpeereid.sh b/regress/agent-getpeereid.sh
index 0889fe80e..46d20dc2b 100644
--- a/regress/agent-getpeereid.sh
+++ b/regress/agent-getpeereid.sh
@@ -7,6 +7,12 @@ UNPRIV=nobody
7ASOCK=${OBJ}/agent 7ASOCK=${OBJ}/agent
8SSH_AUTH_SOCK=/nonexistant 8SSH_AUTH_SOCK=/nonexistant
9 9
10if grep "#undef.*HAVE_GETPEEREID" ${BUILDDIR}/config.h >/dev/null 2>&1
11then
12 echo "skipped (not supported on this platform)"
13 exit 0
14fi
15
10trace "start agent" 16trace "start agent"
11eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null 17eval `${SSHAGENT} -s -a ${ASOCK}` > /dev/null
12r=$? 18r=$?
diff --git a/regress/agent-ptrace.sh b/regress/agent-ptrace.sh
index 9f9c99960..cd9c0023d 100644
--- a/regress/agent-ptrace.sh
+++ b/regress/agent-ptrace.sh
@@ -3,6 +3,22 @@
3 3
4tid="disallow agent ptrace attach" 4tid="disallow agent ptrace attach"
5 5
6if have_prog uname ; then
7 case `uname` in
8 Linux|HP-UX|SunOS|NetBSD|AIX|CYGWIN*)
9 echo "skipped (not supported on this platform)"
10 exit 0
11 ;;
12 esac
13fi
14
15if have_prog gdb ; then
16 : ok
17else
18 echo "skipped (gdb not found)"
19 exit 0
20fi
21
6trace "start agent" 22trace "start agent"
7eval `${SSHAGENT} -s` > /dev/null 23eval `${SSHAGENT} -s` > /dev/null
8r=$? 24r=$?
@@ -16,7 +32,7 @@ EOF
16 if [ $? -ne 0 ]; then 32 if [ $? -ne 0 ]; then
17 fail "gdb failed: exit code $?" 33 fail "gdb failed: exit code $?"
18 fi 34 fi
19 grep -q 'ptrace: Operation not permitted.' ${OBJ}/gdb.out 35 grep 'ptrace: Operation not permitted.' >/dev/null ${OBJ}/gdb.out
20 r=$? 36 r=$?
21 rm -f ${OBJ}/gdb.out 37 rm -f ${OBJ}/gdb.out
22 if [ $r -ne 0 ]; then 38 if [ $r -ne 0 ]; then
diff --git a/regress/agent-timeout.sh b/regress/agent-timeout.sh
index 28b1be028..3a40e7af8 100644
--- a/regress/agent-timeout.sh
+++ b/regress/agent-timeout.sh
@@ -3,7 +3,7 @@
3 3
4tid="agent timeout test" 4tid="agent timeout test"
5 5
6TIMEOUT=5 6SSHAGENT_TIMEOUT=10
7 7
8trace "start agent" 8trace "start agent"
9eval `${SSHAGENT} -s` > /dev/null 9eval `${SSHAGENT} -s` > /dev/null
@@ -13,7 +13,7 @@ if [ $r -ne 0 ]; then
13else 13else
14 trace "add keys with timeout" 14 trace "add keys with timeout"
15 for t in rsa rsa1; do 15 for t in rsa rsa1; do
16 ${SSHADD} -t ${TIMEOUT} $OBJ/$t > /dev/null 2>&1 16 ${SSHADD} -t ${SSHAGENT_TIMEOUT} $OBJ/$t > /dev/null 2>&1
17 if [ $? -ne 0 ]; then 17 if [ $? -ne 0 ]; then
18 fail "ssh-add did succeed exit code 0" 18 fail "ssh-add did succeed exit code 0"
19 fi 19 fi
@@ -23,10 +23,10 @@ else
23 if [ $n -ne 2 ]; then 23 if [ $n -ne 2 ]; then
24 fail "ssh-add -l did not return 2 keys: $n" 24 fail "ssh-add -l did not return 2 keys: $n"
25 fi 25 fi
26 trace "sleeping 2*${TIMEOUT} seconds" 26 trace "sleeping 2*${SSHAGENT_TIMEOUT} seconds"
27 sleep ${TIMEOUT} 27 sleep ${SSHAGENT_TIMEOUT}
28 sleep ${TIMEOUT} 28 sleep ${SSHAGENT_TIMEOUT}
29 ${SSHADD} -l 2> /dev/null | grep -q 'The agent has no identities.' 29 ${SSHADD} -l 2> /dev/null | grep 'The agent has no identities.' >/dev/null
30 if [ $? -ne 0 ]; then 30 if [ $? -ne 0 ]; then
31 fail "ssh-add -l still returns keys after timeout" 31 fail "ssh-add -l still returns keys after timeout"
32 fi 32 fi
diff --git a/regress/agent.sh b/regress/agent.sh
index 7e9b4cb18..b34487767 100644
--- a/regress/agent.sh
+++ b/regress/agent.sh
@@ -19,7 +19,7 @@ else
19 fail "ssh-add -l did not fail with exit code 1" 19 fail "ssh-add -l did not fail with exit code 1"
20 fi 20 fi
21 trace "overwrite authorized keys" 21 trace "overwrite authorized keys"
22 echo -n > $OBJ/authorized_keys_$USER 22 echon > $OBJ/authorized_keys_$USER
23 for t in rsa rsa1; do 23 for t in rsa rsa1; do
24 # generate user key for agent 24 # generate user key for agent
25 rm -f $OBJ/$t-agent 25 rm -f $OBJ/$t-agent
diff --git a/regress/dynamic-forward.sh b/regress/dynamic-forward.sh
new file mode 100644
index 000000000..2b0b825d0
--- /dev/null
+++ b/regress/dynamic-forward.sh
@@ -0,0 +1,47 @@
1# $OpenBSD: dynamic-forward.sh,v 1.2 2003/07/03 08:21:46 markus Exp $
2# Placed in the Public Domain.
3
4tid="dynamic forwarding"
5
6PORT=4242
7FWDPORT=4243
8DATA=/bin/ls${EXEEXT}
9
10if have_prog nc && nc -h 2>&1 | grep "x proxy address" >/dev/null; then
11 proxycmd="nc -x 127.0.0.1:$FWDPORT -X"
12elif have_prog connect; then
13 proxycmd="connect -S 127.0.0.1:$FWDPORT -"
14else
15 echo "skipped (no suitable ProxyCommand found)"
16 exit 0
17fi
18trace "will use ProxyCommand $proxycmd"
19
20start_sshd
21
22for p in 1 2; do
23 trace "start dynamic forwarding, fork to background"
24 ${SSH} -$p -F $OBJ/ssh_config -f -D $FWDPORT -q somehost \
25 exec sh -c \'"echo \$\$ > $OBJ/remote_pid; exec sleep 444"\'
26
27 for s in 4 5; do
28 for h in 127.0.0.1 localhost; do
29 trace "testing ssh protocol $p socks version $s host $h"
30 ${SSH} -F $OBJ/ssh_config \
31 -o "ProxyCommand ${proxycmd}${s} $h $PORT" \
32 somehost cat $DATA > $OBJ/ls.copy
33 test -f $OBJ/ls.copy || fail "failed copy $DATA"
34 cmp $DATA $OBJ/ls.copy || fail "corrupted copy of $DATA"
35 done
36 done
37
38 if [ -f $OBJ/remote_pid ]; then
39 remote=`cat $OBJ/remote_pid`
40 trace "terminate remote shell, pid $remote"
41 if [ $remote -gt 1 ]; then
42 kill -HUP $remote
43 fi
44 else
45 fail "no pid file: $OBJ/remote_pid"
46 fi
47done
diff --git a/regress/forwarding.sh b/regress/forwarding.sh
index 7b281c013..dfe065dd6 100644
--- a/regress/forwarding.sh
+++ b/regress/forwarding.sh
@@ -2,6 +2,7 @@
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="local and remote forwarding" 4tid="local and remote forwarding"
5DATA=/bin/ls${EXEEXT}
5 6
6start_sshd 7start_sshd
7 8
@@ -25,9 +26,9 @@ for p in 1 2; do
25 26
26 trace "transfer over forwarded channels and check result" 27 trace "transfer over forwarded channels and check result"
27 ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \ 28 ${SSH} -$q -F $OBJ/ssh_config -p$last -o 'ConnectionAttempts=4' \
28 somehost cat /bin/ls > $OBJ/ls.copy 29 somehost cat $DATA > $OBJ/ls.copy
29 test -f $OBJ/ls.copy || fail "failed copy /bin/ls" 30 test -f $OBJ/ls.copy || fail "failed copy $DATA"
30 cmp /bin/ls $OBJ/ls.copy || fail "corrupted copy of /bin/ls" 31 cmp $DATA $OBJ/ls.copy || fail "corrupted copy of $DATA"
31 32
32 sleep 10 33 sleep 10
33done 34done
diff --git a/regress/proto-version.sh b/regress/proto-version.sh
index 7dc616f5f..1651a69e1 100644
--- a/regress/proto-version.sh
+++ b/regress/proto-version.sh
@@ -8,7 +8,7 @@ check_version ()
8{ 8{
9 version=$1 9 version=$1
10 expect=$2 10 expect=$2
11 banner=`echo -n | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy` 11 banner=`echon | ${SSHD} -o "Protocol=${version}" -i -f ${OBJ}/sshd_proxy`
12 case ${banner} in 12 case ${banner} in
13 SSH-1.99-*) 13 SSH-1.99-*)
14 proto=199 14 proto=199
diff --git a/regress/reconfigure.sh b/regress/reconfigure.sh
new file mode 100644
index 000000000..ba6dbc6f5
--- /dev/null
+++ b/regress/reconfigure.sh
@@ -0,0 +1,35 @@
1# $OpenBSD: reconfigure.sh,v 1.2 2003/06/21 09:14:05 markus Exp $
2# Placed in the Public Domain.
3
4tid="simple connect after reconfigure"
5
6# we need the full path to sshd for -HUP
7case $SSHD in
8/*)
9 # full path is OK
10 ;;
11*)
12 # otherwise make fully qualified
13 SSHD=$OBJ/$SSHD
14esac
15
16start_sshd
17
18$SUDO kill -HUP `cat $PIDFILE`
19sleep 1
20
21trace "wait for sshd to restart"
22i=0;
23while [ ! -f $PIDFILE -a $i -lt 10 ]; do
24 i=`expr $i + 1`
25 sleep $i
26done
27
28test -f $PIDFILE || fatal "sshd did not restart"
29
30for p in 1 2; do
31 ${SSH} -o "Protocol=$p" -F $OBJ/ssh_config somehost true
32 if [ $? -ne 0 ]; then
33 fail "ssh connect with protocol $p failed after reconfigure"
34 fi
35done
diff --git a/regress/rekey.sh b/regress/rekey.sh
new file mode 100644
index 000000000..6b7e845ec
--- /dev/null
+++ b/regress/rekey.sh
@@ -0,0 +1,31 @@
1# $OpenBSD: rekey.sh,v 1.1 2003/03/28 13:58:28 markus Exp $
2# Placed in the Public Domain.
3
4tid="rekey during transfer data"
5
6DATA=${OBJ}/data
7COPY=${OBJ}/copy
8LOG=${OBJ}/log
9
10rm -f ${COPY} ${LOG} ${DATA}
11dd if=/bin/ls${EXEEXT} of=${DATA} bs=1k seek=511 count=1 > /dev/null 2>&1
12
13for s in 16 1k 128k 256k; do
14 trace "rekeylimit ${s}"
15 rm -f ${COPY}
16 cat $DATA | \
17 ${SSH} -oCompression=no -oRekeyLimit=$s \
18 -v -F $OBJ/ssh_proxy somehost "cat > ${COPY}" \
19 2> ${LOG}
20 if [ $? -ne 0 ]; then
21 fail "ssh failed"
22 fi
23 cmp $DATA ${COPY} || fail "corrupted copy"
24 n=`grep 'NEWKEYS sent' ${LOG} | wc -l`
25 n=`expr $n - 1`
26 trace "$n rekeying(s)"
27 if [ $n -lt 1 ]; then
28 fail "no rekeying occured"
29 fi
30done
31rm -f ${COPY} ${LOG} ${DATA}
diff --git a/regress/sftp-badcmds.sh b/regress/sftp-badcmds.sh
new file mode 100644
index 000000000..a6a19409d
--- /dev/null
+++ b/regress/sftp-badcmds.sh
@@ -0,0 +1,78 @@
1# $OpenBSD: sftp-badcmds.sh,v 1.2 2003/05/15 04:07:12 mouring Exp $
2# Placed in the Public Domain.
3
4tid="sftp invalid commands"
5
6DATA=/bin/ls${EXEEXT}
7DATA2=/bin/cat${EXEEXT}
8NONEXIST=/NONEXIST.$$
9COPY=${OBJ}/copy
10GLOBFILES=`(cd /bin;echo l*)`
11
12rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd
13
14rm -f ${COPY}
15verbose "$tid: get nonexistent"
16echo "get $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
17 || fail "get nonexistent failed"
18test -f ${COPY} && fail "existing copy after get nonexistent"
19
20rm -f ${COPY}.dd/*
21verbose "$tid: glob get to nonexistent directory"
22echo "get /bin/l* $NONEXIST" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
23 || fail "get nonexistent failed"
24for x in $GLOBFILES; do
25 test -f ${COPY}.dd/$x && fail "existing copy after get nonexistent"
26done
27
28rm -f ${COPY}
29verbose "$tid: put nonexistent"
30echo "put $NONEXIST $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
31 || fail "put nonexistent failed"
32test -f ${COPY} && fail "existing copy after put nonexistent"
33
34rm -f ${COPY}.dd/*
35verbose "$tid: glob put to nonexistent directory"
36echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
37 || fail "put nonexistent failed"
38for x in $GLOBFILES; do
39 test -f ${COPY}.dd/$x && fail "existing copy after nonexistent"
40done
41
42rm -f ${COPY}
43verbose "$tid: rename nonexistent"
44echo "rename $NONEXIST ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
45 || fail "rename nonexist failed"
46test -f ${COPY}.1 && fail "file exists after rename nonexistent"
47
48rm -f ${COPY} ${COPY}.1
49cp $DATA $COPY
50cp $DATA2 ${COPY}.1
51verbose "$tid: rename target exists"
52echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
53 || fail "rename target exists failed"
54test -f ${COPY} || fail "oldname missing after rename target exists"
55test -f ${COPY}.1 || fail "newname missing after rename target exists"
56cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists"
57cmp $DATA2 ${COPY}.1 >/dev/null 2>&1 || fail "corrupted newname after rename target exists"
58
59rm -rf ${COPY} ${COPY}.dd
60cp $DATA $COPY
61mkdir ${COPY}.dd
62verbose "$tid: rename target exists (directory)"
63echo "rename $COPY ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
64 || fail "rename target exists (directory) failed"
65test -f ${COPY} || fail "oldname missing after rename target exists (directory)"
66test -d ${COPY}.dd || fail "newname missing after rename target exists (directory)"
67cmp $DATA ${COPY} >/dev/null 2>&1 || fail "corrupted oldname after rename target exists (directory)"
68
69rm -f ${COPY}.dd/*
70rm -rf ${COPY}
71cp ${DATA2} ${COPY}
72verbose "$tid: glob put files to local file"
73echo "put /bin/l* $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1
74cmp ${DATA2} ${COPY} || fail "put successed when it should have failed"
75
76rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd
77
78
diff --git a/regress/sftp-batch.sh b/regress/sftp-batch.sh
index cffacb6df..f648eae80 100644
--- a/regress/sftp-batch.sh
+++ b/regress/sftp-batch.sh
@@ -3,9 +3,9 @@
3 3
4tid="sftp batchfile" 4tid="sftp batchfile"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8BATCH=${OBJ}/sftp-batch 8BATCH=${OBJ}/sftp-batch.tmp
9 9
10rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* 10rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.*
11 11
diff --git a/regress/sftp-cmds.sh b/regress/sftp-cmds.sh
index 462c6802f..1256aeb2d 100644
--- a/regress/sftp-cmds.sh
+++ b/regress/sftp-cmds.sh
@@ -1,17 +1,42 @@
1# $OpenBSD: sftp-cmds.sh,v 1.2 2003/01/10 07:52:41 djm Exp $ 1# $OpenBSD: sftp-cmds.sh,v 1.5 2003/07/19 00:46:31 djm Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4# XXX - TODO: 4# XXX - TODO:
5# - globbed operations
6# - chmod / chown / chgrp 5# - chmod / chown / chgrp
7# - -p flag for get & put 6# - -p flag for get & put
8 7
9tid="sftp commands" 8tid="sftp commands"
10 9
11DATA=/bin/ls 10DATA=/bin/ls${EXEEXT}
12COPY=${OBJ}/copy 11COPY=${OBJ}/copy
13 12# test that these files are readable!
14rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* 13for i in `(cd /bin;echo l*)`
14do
15 if [ -r $i ]; then
16 GLOBFILES="$GLOBFILES $i"
17 fi
18done
19
20if have_prog uname
21then
22 case `uname` in
23 CYGWIN*)
24 os=cygwin
25 ;;
26 *)
27 os=`uname`
28 ;;
29 esac
30else
31 os="unknown"
32fi
33
34# Path with embedded quote
35QUOTECOPY=${COPY}".\"blah\""
36QUOTECOPY_ARG=${COPY}'.\"blah\"'
37
38rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2
39mkdir ${COPY}.dd
15 40
16verbose "$tid: lls" 41verbose "$tid: lls"
17echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 42echo "lls ${OBJ}" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
@@ -54,21 +79,91 @@ echo "get $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
54 || fail "get failed" 79 || fail "get failed"
55cmp $DATA ${COPY} || fail "corrupted copy after get" 80cmp $DATA ${COPY} || fail "corrupted copy after get"
56 81
82rm -f ${COPY}.dd/*
83verbose "$tid: get to directory"
84echo "get $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
85 || fail "get failed"
86cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get"
87
88rm -f ${COPY}.dd/*
89verbose "$tid: glob get to directory"
90echo "get /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
91 || fail "get failed"
92for x in $GLOBFILES; do
93 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get"
94done
95
96rm -f ${COPY}.dd/*
97verbose "$tid: get to local dir"
98(echo "lcd ${COPY}.dd"; echo "get $DATA" ) | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
99 || fail "get failed"
100cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after get"
101
102rm -f ${COPY}.dd/*
103verbose "$tid: glob get to local dir"
104(echo "lcd ${COPY}.dd"; echo "get /bin/l*") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
105 || fail "get failed"
106for x in $GLOBFILES; do
107 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after get"
108done
109
57rm -f ${COPY} 110rm -f ${COPY}
58verbose "$tid: put" 111verbose "$tid: put"
59echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 112echo "put $DATA $COPY" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
60 || fail "put failed" 113 || fail "put failed"
61cmp $DATA ${COPY} || fail "corrupted copy after put" 114cmp $DATA ${COPY} || fail "corrupted copy after put"
62 115
116if [ "$os" != "cygwin" ]; then
117rm -f ${QUOTECOPY}
118verbose "$tid: put filename with quotes"
119echo "put $DATA \"$QUOTECOPY_ARG\"" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
120 || fail "put failed"
121cmp $DATA ${QUOTECOPY} || fail "corrupted copy after put with quotes"
122fi
123
124rm -f ${COPY}.dd/*
125verbose "$tid: put to directory"
126echo "put $DATA ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
127 || fail "put failed"
128cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put"
129
130rm -f ${COPY}.dd/*
131verbose "$tid: glob put to directory"
132echo "put /bin/l* ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
133 || fail "put failed"
134for x in $GLOBFILES; do
135 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put"
136done
137
138rm -f ${COPY}.dd/*
139verbose "$tid: put to local dir"
140(echo "cd ${COPY}.dd"; echo "put $DATA") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
141 || fail "put failed"
142cmp $DATA ${COPY}.dd/`basename $DATA` || fail "corrupted copy after put"
143
144rm -f ${COPY}.dd/*
145verbose "$tid: glob put to local dir"
146(echo "cd ${COPY}.dd"; echo "put /bin/l*") | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
147 || fail "put failed"
148for x in $GLOBFILES; do
149 cmp /bin/$x ${COPY}.dd/$x || fail "corrupted copy after put"
150done
151
63verbose "$tid: rename" 152verbose "$tid: rename"
64echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 153echo "rename $COPY ${COPY}.1" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
65 || fail "rename failed" 154 || fail "rename failed"
66test -f ${COPY}.1 || fail "missing file after rename" 155test -f ${COPY}.1 || fail "missing file after rename"
67cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename" 156cmp $DATA ${COPY}.1 >/dev/null 2>&1 || fail "corrupted copy after rename"
68 157
158verbose "$tid: rename directory"
159echo "rename ${COPY}.dd ${COPY}.dd2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
160 || fail "rename directory failed"
161test -d ${COPY}.dd && fail "oldname exists after rename directory"
162test -d ${COPY}.dd2 || fail "missing newname after rename directory"
163
69verbose "$tid: ln" 164verbose "$tid: ln"
70echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed" 165echo "ln ${COPY}.1 ${COPY}.2" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 || fail "ln failed"
71test -L ${COPY}.2 || fail "missing file after ln" 166test -h ${COPY}.2 || fail "missing file after ln"
72 167
73verbose "$tid: mkdir" 168verbose "$tid: mkdir"
74echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 169echo "mkdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
@@ -95,6 +190,6 @@ verbose "$tid: lchdir"
95echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \ 190echo "lchdir ${COPY}.dd" | ${SFTP} -P ${SFTPSERVER} >/dev/null 2>&1 \
96 || fail "lchdir failed" 191 || fail "lchdir failed"
97 192
98rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${BATCH}.* 193rm -rf ${COPY} ${COPY}.1 ${COPY}.2 ${COPY}.dd ${COPY}.dd2
99 194
100 195
diff --git a/regress/sftp.sh b/regress/sftp.sh
index e8d473123..0e22f8f6b 100644
--- a/regress/sftp.sh
+++ b/regress/sftp.sh
@@ -3,27 +3,33 @@
3 3
4tid="basic sftp put/get" 4tid="basic sftp put/get"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8 8
9SFTPCMDFILE=${OBJ}/batch
10cat >$SFTPCMDFILE <<EOF
11version
12get $DATA ${COPY}.1
13put $DATA ${COPY}.2
14EOF
15
9BUFFERSIZE="5 1000 32000 64000" 16BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10" 17REQUESTS="1 2 10"
11 18
12for B in ${BUFFERSIZE}; do 19for B in ${BUFFERSIZE}; do
13 for R in ${REQUESTS}; do 20 for R in ${REQUESTS}; do
14 verbose "test $tid: buffer_size $B num_requests $R" 21 verbose "test $tid: buffer_size $B num_requests $R"
15 rm -f ${COPY}.1 ${COPY}.2 22 rm -f ${COPY}.1 ${COPY}.2
16 ${SFTP} -P ${SFTPSERVER} -B $B -R $R -b /dev/stdin \ 23 ${SFTP} -P ${SFTPSERVER} -B $B -R $R -b $SFTPCMDFILE \
17 > /dev/null 2>&1 << EOF 24 > /dev/null 2>&1
18 version
19 get $DATA ${COPY}.1
20 put $DATA ${COPY}.2
21EOF
22 r=$? 25 r=$?
23 if [ $r -ne 0 ]; then 26 if [ $r -ne 0 ]; then
24 fail "sftp failed with $r" 27 fail "sftp failed with $r"
28 else
29 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
30 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
25 fi 31 fi
26 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
27 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
28 done 32 done
29done 33done
34rm -f ${COPY}.1 ${COPY}.2
35rm -f $SFTPCMDFILE
diff --git a/regress/ssh-com-client.sh b/regress/ssh-com-client.sh
index 015ebbb8c..fc953228e 100644
--- a/regress/ssh-com-client.sh
+++ b/regress/ssh-com-client.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: ssh-com-client.sh,v 1.4 2002/07/16 08:58:16 markus Exp $ 1# $OpenBSD: ssh-com-client.sh,v 1.5 2003/05/14 22:08:27 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="connect with ssh.com client" 4tid="connect with ssh.com client"
@@ -17,6 +17,8 @@ VERSIONS="
17 3.0.0 17 3.0.0
18 3.1.0 18 3.1.0
19 3.2.0 19 3.2.0
20 3.2.2
21 3.2.3
20 3.3.0" 22 3.3.0"
21 23
22# 2.0.10 2.0.12 2.0.13 don't like the test setup 24# 2.0.10 2.0.12 2.0.13 don't like the test setup
@@ -62,7 +64,7 @@ EOF
62# we need a real server (no ProxyConnect option) 64# we need a real server (no ProxyConnect option)
63start_sshd 65start_sshd
64 66
65DATA=/bin/ls 67DATA=/bin/ls${EXEEXT}
66COPY=${OBJ}/copy 68COPY=${OBJ}/copy
67rm -f ${COPY} 69rm -f ${COPY}
68 70
diff --git a/regress/ssh-com-keygen.sh b/regress/ssh-com-keygen.sh
index e93dc78c9..dbe9b0a6b 100644
--- a/regress/ssh-com-keygen.sh
+++ b/regress/ssh-com-keygen.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: ssh-com-keygen.sh,v 1.2 2002/07/16 08:58:16 markus Exp $ 1# $OpenBSD: ssh-com-keygen.sh,v 1.3 2003/05/14 22:08:27 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="ssh.com key import" 4tid="ssh.com key import"
@@ -20,6 +20,8 @@ VERSIONS="
20 3.0.0 20 3.0.0
21 3.1.0 21 3.1.0
22 3.2.0 22 3.2.0
23 3.2.2
24 3.2.3
23 3.3.0" 25 3.3.0"
24 26
25COMPRV=${OBJ}/comkey 27COMPRV=${OBJ}/comkey
diff --git a/regress/ssh-com-sftp.sh b/regress/ssh-com-sftp.sh
index f08018b84..6ca7dad51 100644
--- a/regress/ssh-com-sftp.sh
+++ b/regress/ssh-com-sftp.sh
@@ -1,10 +1,17 @@
1# $OpenBSD: ssh-com-sftp.sh,v 1.3 2002/07/16 08:58:16 markus Exp $ 1# $OpenBSD: ssh-com-sftp.sh,v 1.4 2003/05/14 22:08:27 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="basic sftp put/get with ssh.com server" 4tid="basic sftp put/get with ssh.com server"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8SFTPCMDFILE=${OBJ}/batch
9
10cat >$SFTPCMDFILE <<EOF
11version
12get $DATA ${COPY}.1
13put $DATA ${COPY}.2
14EOF
8 15
9BUFFERSIZE="5 1000 32000 64000" 16BUFFERSIZE="5 1000 32000 64000"
10REQUESTS="1 2 10" 17REQUESTS="1 2 10"
@@ -26,6 +33,8 @@ VERSIONS="
26 3.0.0 33 3.0.0
27 3.1.0 34 3.1.0
28 3.2.0 35 3.2.0
36 3.2.2
37 3.2.3
29 3.3.0" 38 3.3.0"
30 39
31# go for it 40# go for it
@@ -39,18 +48,17 @@ for v in ${VERSIONS}; do
39 for R in ${REQUESTS}; do 48 for R in ${REQUESTS}; do
40 verbose "test $tid: buffer_size $B num_requests $R" 49 verbose "test $tid: buffer_size $B num_requests $R"
41 rm -f ${COPY}.1 ${COPY}.2 50 rm -f ${COPY}.1 ${COPY}.2
42 ${SFTP} -P ${server} -B $B -R $R -b /dev/stdin \ 51 ${SFTP} -P ${server} -B $B -R $R -b $SFTPCMDFILE \
43 > /dev/null 2>&1 << EOF 52 > /dev/null 2>&1
44 version
45 get $DATA ${COPY}.1
46 put $DATA ${COPY}.2
47EOF
48 r=$? 53 r=$?
49 if [ $r -ne 0 ]; then 54 if [ $r -ne 0 ]; then
50 fail "sftp failed with $r" 55 fail "sftp failed with $r"
56 else
57 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
58 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
51 fi 59 fi
52 cmp $DATA ${COPY}.1 || fail "corrupted copy after get"
53 cmp $DATA ${COPY}.2 || fail "corrupted copy after put"
54 done 60 done
55 done 61 done
56done 62done
63rm -f ${COPY}.1 ${COPY}.2
64rm -f $SFTPCMDFILE
diff --git a/regress/ssh-com.sh b/regress/ssh-com.sh
index c2bd15380..78ae6e9e1 100644
--- a/regress/ssh-com.sh
+++ b/regress/ssh-com.sh
@@ -1,4 +1,4 @@
1# $OpenBSD: ssh-com.sh,v 1.4 2002/07/16 08:58:16 markus Exp $ 1# $OpenBSD: ssh-com.sh,v 1.5 2003/05/14 22:08:27 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="connect to ssh.com server" 4tid="connect to ssh.com server"
@@ -18,6 +18,8 @@ VERSIONS="
18 3.0.0 18 3.0.0
19 3.1.0 19 3.1.0
20 3.2.0 20 3.2.0
21 3.2.2
22 3.2.3
21 3.3.0" 23 3.3.0"
22# 2.0.10 does not support UserConfigDirectory 24# 2.0.10 does not support UserConfigDirectory
23# 2.3.1 requires a config in $HOME/.ssh2 25# 2.3.1 requires a config in $HOME/.ssh2
@@ -65,7 +67,7 @@ done
65 67
66# convert and append DSA hostkey 68# convert and append DSA hostkey
67( 69(
68 echo -n 'ssh2-localhost-with-alias,127.0.0.1,::1 ' 70 echon 'ssh2-localhost-with-alias,127.0.0.1,::1 '
69 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub 71 ${SSHKEYGEN} -if ${SRC}/dsa_ssh2.pub
70) >> $OBJ/known_hosts 72) >> $OBJ/known_hosts
71 73
diff --git a/regress/stderr-after-eof.sh b/regress/stderr-after-eof.sh
index bebd700bf..05a5ea56d 100644
--- a/regress/stderr-after-eof.sh
+++ b/regress/stderr-after-eof.sh
@@ -7,13 +7,23 @@ DATA=/etc/motd
7DATA=${OBJ}/data 7DATA=${OBJ}/data
8COPY=${OBJ}/copy 8COPY=${OBJ}/copy
9 9
10MD5=md5sum 10if have_prog md5sum; then
11 CHECKSUM=md5sum
12elif have_prog openssl; then
13 CHECKSUM="openssl md5"
14elif have_prog cksum; then
15 CHECKSUM=cksum
16elif have_prog sum; then
17 CHECKSUM=sum
18else
19 fatal "No checksum program available, aborting $tid test"
20fi
11 21
12# setup data 22# setup data
13rm -f ${DATA} ${COPY} 23rm -f ${DATA} ${COPY}
14cp /dev/null ${DATA} 24cp /dev/null ${DATA}
15for i in 1 2 3 4 5 6; do 25for i in 1 2 3 4 5 6; do
16 (date;echo $i) | $MD5 >> ${DATA} 26 (date;echo $i) | $CHECKSUM >> ${DATA}
17done 27done
18 28
19${SSH} -2 -F $OBJ/ssh_proxy otherhost \ 29${SSH} -2 -F $OBJ/ssh_proxy otherhost \
diff --git a/regress/stderr-data.sh b/regress/stderr-data.sh
index 0157690b0..1daf79bb5 100644
--- a/regress/stderr-data.sh
+++ b/regress/stderr-data.sh
@@ -3,7 +3,7 @@
3 3
4tid="stderr data transfer" 4tid="stderr data transfer"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8rm -f ${COPY} 8rm -f ${COPY}
9 9
diff --git a/regress/test-exec.sh b/regress/test-exec.sh
index a7a8ddbe6..cc7ea67fe 100644
--- a/regress/test-exec.sh
+++ b/regress/test-exec.sh
@@ -2,10 +2,16 @@
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4PORT=4242 4PORT=4242
5USER=`id -un`
6SUDO=
7#SUDO=sudo 5#SUDO=sudo
8 6
7if [ -x /usr/ucb/whoami ]; then
8 USER=`/usr/ucb/whoami`
9elif whoami >/dev/null 2>&1; then
10 USER=`whoami`
11else
12 USER=`id -un`
13fi
14
9OBJ=$1 15OBJ=$1
10if [ "x$OBJ" = "x" ]; then 16if [ "x$OBJ" = "x" ]; then
11 echo '$OBJ not defined' 17 echo '$OBJ not defined'
@@ -72,6 +78,32 @@ export SSH SSHD SSHAGENT SSHADD SSHKEYGEN SSHKEYSCAN SFTP SFTPSERVER
72#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER 78#echo $SSH $SSHD $SSHAGENT $SSHADD $SSHKEYGEN $SSHKEYSCAN $SFTP $SFTPSERVER
73 79
74# helper 80# helper
81echon()
82{
83 if [ "x`echo -n`" = "x" ]; then
84 echo -n "$@"
85 elif [ "x`echo '\c'`" = "x" ]; then
86 echo "$@\c"
87 else
88 fatal "Don't know how to echo without newline."
89 fi
90}
91
92have_prog()
93{
94 saved_IFS="$IFS"
95 IFS=":"
96 for i in $PATH
97 do
98 if [ -x $i/$1 ]; then
99 IFS="$saved_IFS"
100 return 0
101 fi
102 done
103 IFS="$saved_IFS"
104 return 1
105}
106
75cleanup () 107cleanup ()
76{ 108{
77 if [ -f $PIDFILE ]; then 109 if [ -f $PIDFILE ]; then
@@ -111,7 +143,7 @@ fail ()
111 143
112fatal () 144fatal ()
113{ 145{
114 echo -n "FATAL: " 146 echon "FATAL: "
115 fail "$@" 147 fail "$@"
116 cleanup 148 cleanup
117 exit $RESULT 149 exit $RESULT
@@ -130,6 +162,7 @@ cat << EOF > $OBJ/sshd_config
130 PidFile $PIDFILE 162 PidFile $PIDFILE
131 AuthorizedKeysFile $OBJ/authorized_keys_%u 163 AuthorizedKeysFile $OBJ/authorized_keys_%u
132 LogLevel QUIET 164 LogLevel QUIET
165 StrictModes no
133EOF 166EOF
134 167
135# server config for proxy connects 168# server config for proxy connects
@@ -169,7 +202,7 @@ for t in rsa rsa1; do
169 202
170 # known hosts file for client 203 # known hosts file for client
171 ( 204 (
172 echo -n 'localhost-with-alias,127.0.0.1,::1 ' 205 echon 'localhost-with-alias,127.0.0.1,::1 '
173 cat $OBJ/$t.pub 206 cat $OBJ/$t.pub
174 ) >> $OBJ/known_hosts 207 ) >> $OBJ/known_hosts
175 208
@@ -189,7 +222,7 @@ chmod 644 $OBJ/authorized_keys_$USER
189# create a proxy version of the client config 222# create a proxy version of the client config
190( 223(
191 cat $OBJ/ssh_config 224 cat $OBJ/ssh_config
192 echo proxycommand ${SSHD} -i -f $OBJ/sshd_proxy 225 echo proxycommand ${SUDO} ${SSHD} -i -f $OBJ/sshd_proxy
193) > $OBJ/ssh_proxy 226) > $OBJ/ssh_proxy
194 227
195# check proxy config 228# check proxy config
@@ -203,7 +236,7 @@ start_sshd ()
203 236
204 trace "wait for sshd" 237 trace "wait for sshd"
205 i=0; 238 i=0;
206 while [ ! -f $PIDFILE -a $i -lt 5 ]; do 239 while [ ! -f $PIDFILE -a $i -lt 10 ]; do
207 i=`expr $i + 1` 240 i=`expr $i + 1`
208 sleep $i 241 sleep $i
209 done 242 done
diff --git a/regress/transfer.sh b/regress/transfer.sh
index 31cdc0ce3..13ea367d5 100644
--- a/regress/transfer.sh
+++ b/regress/transfer.sh
@@ -3,7 +3,7 @@
3 3
4tid="transfer data" 4tid="transfer data"
5 5
6DATA=/bin/ls 6DATA=/bin/ls${EXEEXT}
7COPY=${OBJ}/copy 7COPY=${OBJ}/copy
8 8
9for p in 1 2; do 9for p in 1 2; do
diff --git a/regress/try-ciphers.sh b/regress/try-ciphers.sh
index 161f039c0..2c727f66c 100644
--- a/regress/try-ciphers.sh
+++ b/regress/try-ciphers.sh
@@ -1,10 +1,11 @@
1# $OpenBSD: try-ciphers.sh,v 1.7 2002/04/03 09:30:01 markus Exp $ 1# $OpenBSD: try-ciphers.sh,v 1.8 2003/06/12 15:40:01 markus Exp $
2# Placed in the Public Domain. 2# Placed in the Public Domain.
3 3
4tid="try ciphers" 4tid="try ciphers"
5 5
6ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour 6ciphers="aes128-cbc 3des-cbc blowfish-cbc cast128-cbc arcfour
7 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se" 7 aes192-cbc aes256-cbc rijndael-cbc@lysator.liu.se
8 aes128-ctr aes192-ctr aes256-ctr"
8macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96" 9macs="hmac-sha1 hmac-md5 hmac-sha1-96 hmac-md5-96"
9 10
10for c in $ciphers; do 11for c in $ciphers; do
diff --git a/regress/yes-head.sh b/regress/yes-head.sh
index f213f6863..17a4d0dd4 100644
--- a/regress/yes-head.sh
+++ b/regress/yes-head.sh
@@ -4,7 +4,7 @@
4tid="yes pipe head" 4tid="yes pipe head"
5 5
6for p in 1 2; do 6for p in 1 2; do
7 lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'yes | head -2000' | (sleep 3 ; wc -l)` 7 lines=`${SSH} -$p -F $OBJ/ssh_proxy thishost 'sh -c "while true;do echo yes;done | head -2000"' | (sleep 3 ; wc -l)`
8 if [ $? -ne 0 ]; then 8 if [ $? -ne 0 ]; then
9 fail "yes|head test failed" 9 fail "yes|head test failed"
10 lines = 0; 10 lines = 0;
diff --git a/scard-opensc.c b/scard-opensc.c
index dd21de39a..2489fec45 100644
--- a/scard-opensc.c
+++ b/scard-opensc.c
@@ -89,6 +89,12 @@ sc_init(void)
89 r = sc_establish_context(&ctx, "openssh"); 89 r = sc_establish_context(&ctx, "openssh");
90 if (r) 90 if (r)
91 goto err; 91 goto err;
92 if (sc_reader_id >= ctx->reader_count) {
93 r = SC_ERROR_NO_READERS_FOUND;
94 error("Illegal reader number %d (max %d)", sc_reader_id,
95 ctx->reader_count -1);
96 goto err;
97 }
92 r = sc_connect_card(ctx->reader[sc_reader_id], 0, &card); 98 r = sc_connect_card(ctx->reader[sc_reader_id], 0, &card);
93 if (r) 99 if (r)
94 goto err; 100 goto err;
@@ -104,7 +110,8 @@ err:
104/* private key operations */ 110/* private key operations */
105 111
106static int 112static int
107sc_prkey_op_init(RSA *rsa, struct sc_pkcs15_object **key_obj_out) 113sc_prkey_op_init(RSA *rsa, struct sc_pkcs15_object **key_obj_out,
114 unsigned int usage)
108{ 115{
109 int r; 116 int r;
110 struct sc_priv_data *priv; 117 struct sc_priv_data *priv;
@@ -124,7 +131,8 @@ sc_prkey_op_init(RSA *rsa, struct sc_pkcs15_object **key_obj_out)
124 goto err; 131 goto err;
125 } 132 }
126 } 133 }
127 r = sc_pkcs15_find_prkey_by_id(p15card, &priv->cert_id, &key_obj); 134 r = sc_pkcs15_find_prkey_by_id_usage(p15card, &priv->cert_id,
135 usage, &key_obj);
128 if (r) { 136 if (r) {
129 error("Unable to find private key from SmartCard: %s", 137 error("Unable to find private key from SmartCard: %s",
130 sc_strerror(r)); 138 sc_strerror(r));
@@ -133,7 +141,16 @@ sc_prkey_op_init(RSA *rsa, struct sc_pkcs15_object **key_obj_out)
133 key = key_obj->data; 141 key = key_obj->data;
134 r = sc_pkcs15_find_pin_by_auth_id(p15card, &key_obj->auth_id, 142 r = sc_pkcs15_find_pin_by_auth_id(p15card, &key_obj->auth_id,
135 &pin_obj); 143 &pin_obj);
136 if (r) { 144 if (r == SC_ERROR_OBJECT_NOT_FOUND) {
145 /* no pin required */
146 r = sc_lock(card);
147 if (r) {
148 error("Unable to lock smartcard: %s", sc_strerror(r));
149 goto err;
150 }
151 *key_obj_out = key_obj;
152 return 0;
153 } else if (r) {
137 error("Unable to find PIN object from SmartCard: %s", 154 error("Unable to find PIN object from SmartCard: %s",
138 sc_strerror(r)); 155 sc_strerror(r));
139 goto err; 156 goto err;
@@ -161,6 +178,9 @@ err:
161 return -1; 178 return -1;
162} 179}
163 180
181#define SC_USAGE_DECRYPT SC_PKCS15_PRKEY_USAGE_DECRYPT | \
182 SC_PKCS15_PRKEY_USAGE_UNWRAP
183
164static int 184static int
165sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa, 185sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa,
166 int padding) 186 int padding)
@@ -170,10 +190,11 @@ sc_private_decrypt(int flen, u_char *from, u_char *to, RSA *rsa,
170 190
171 if (padding != RSA_PKCS1_PADDING) 191 if (padding != RSA_PKCS1_PADDING)
172 return -1; 192 return -1;
173 r = sc_prkey_op_init(rsa, &key_obj); 193 r = sc_prkey_op_init(rsa, &key_obj, SC_USAGE_DECRYPT);
174 if (r) 194 if (r)
175 return -1; 195 return -1;
176 r = sc_pkcs15_decipher(p15card, key_obj, 0, from, flen, to, flen); 196 r = sc_pkcs15_decipher(p15card, key_obj, SC_ALGORITHM_RSA_PAD_PKCS1,
197 from, flen, to, flen);
177 sc_unlock(card); 198 sc_unlock(card);
178 if (r < 0) { 199 if (r < 0) {
179 error("sc_pkcs15_decipher() failed: %s", sc_strerror(r)); 200 error("sc_pkcs15_decipher() failed: %s", sc_strerror(r));
@@ -185,6 +206,9 @@ err:
185 return -1; 206 return -1;
186} 207}
187 208
209#define SC_USAGE_SIGN SC_PKCS15_PRKEY_USAGE_SIGN | \
210 SC_PKCS15_PRKEY_USAGE_SIGNRECOVER
211
188static int 212static int
189sc_sign(int type, u_char *m, unsigned int m_len, 213sc_sign(int type, u_char *m, unsigned int m_len,
190 unsigned char *sigret, unsigned int *siglen, RSA *rsa) 214 unsigned char *sigret, unsigned int *siglen, RSA *rsa)
@@ -193,7 +217,15 @@ sc_sign(int type, u_char *m, unsigned int m_len,
193 int r; 217 int r;
194 unsigned long flags = 0; 218 unsigned long flags = 0;
195 219
196 r = sc_prkey_op_init(rsa, &key_obj); 220 /* XXX: sc_prkey_op_init will search for a pkcs15 private
221 * key object with the sign or signrecover usage flag set.
222 * If the signing key has only the non-repudiation flag set
223 * the key will be rejected as using a non-repudiation key
224 * for authentication is not recommended. Note: This does not
225 * prevent the use of a non-repudiation key for authentication
226 * if the sign or signrecover flag is set as well.
227 */
228 r = sc_prkey_op_init(rsa, &key_obj, SC_USAGE_SIGN);
197 if (r) 229 if (r)
198 return -1; 230 return -1;
199 /* FIXME: length of sigret correct? */ 231 /* FIXME: length of sigret correct? */
@@ -321,7 +353,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
321 debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]); 353 debug("sc_read_pubkey() with cert id %02X", cinfo->id.value[0]);
322 r = sc_pkcs15_read_certificate(p15card, cinfo, &cert); 354 r = sc_pkcs15_read_certificate(p15card, cinfo, &cert);
323 if (r) { 355 if (r) {
324 log("Certificate read failed: %s", sc_strerror(r)); 356 logit("Certificate read failed: %s", sc_strerror(r));
325 goto err; 357 goto err;
326 } 358 }
327 x509 = X509_new(); 359 x509 = X509_new();
@@ -331,7 +363,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
331 } 363 }
332 p = cert->data; 364 p = cert->data;
333 if (!d2i_X509(&x509, &p, cert->data_len)) { 365 if (!d2i_X509(&x509, &p, cert->data_len)) {
334 log("Unable to parse X.509 certificate"); 366 logit("Unable to parse X.509 certificate");
335 r = -1; 367 r = -1;
336 goto err; 368 goto err;
337 } 369 }
@@ -341,7 +373,7 @@ sc_read_pubkey(Key * k, const struct sc_pkcs15_object *cert_obj)
341 X509_free(x509); 373 X509_free(x509);
342 x509 = NULL; 374 x509 = NULL;
343 if (pubkey->type != EVP_PKEY_RSA) { 375 if (pubkey->type != EVP_PKEY_RSA) {
344 log("Public key is of unknown type"); 376 logit("Public key is of unknown type");
345 r = -1; 377 r = -1;
346 goto err; 378 goto err;
347 } 379 }
@@ -413,7 +445,7 @@ sc_get_keys(const char *id, const char *pin)
413 r = sc_pkcs15_get_objects(p15card, SC_PKCS15_TYPE_CERT_X509, 445 r = sc_pkcs15_get_objects(p15card, SC_PKCS15_TYPE_CERT_X509,
414 certs, 32); 446 certs, 32);
415 if (r == 0) { 447 if (r == 0) {
416 log("No certificates found on smartcard"); 448 logit("No certificates found on smartcard");
417 r = -1; 449 r = -1;
418 goto err; 450 goto err;
419 } else if (r < 0) { 451 } else if (r < 0) {
@@ -423,9 +455,14 @@ sc_get_keys(const char *id, const char *pin)
423 } 455 }
424 key_count = r; 456 key_count = r;
425 } 457 }
426 /* FIXME: only keep entries with a corresponding private key */
427 keys = xmalloc(sizeof(Key *) * (key_count*2+1)); 458 keys = xmalloc(sizeof(Key *) * (key_count*2+1));
428 for (i = 0; i < key_count; i++) { 459 for (i = 0; i < key_count; i++) {
460 sc_pkcs15_object_t *tmp_obj = NULL;
461 cert_id = ((sc_pkcs15_cert_info_t *)(certs[i]->data))->id;
462 if (sc_pkcs15_find_prkey_by_id(p15card, &cert_id, &tmp_obj))
463 /* skip the public key (certificate) if no
464 * corresponding private key is present */
465 continue;
429 k = key_new(KEY_RSA); 466 k = key_new(KEY_RSA);
430 if (k == NULL) 467 if (k == NULL)
431 break; 468 break;
@@ -459,4 +496,30 @@ sc_put_key(Key *prv, const char *id)
459 return -1; 496 return -1;
460} 497}
461 498
499char *
500sc_get_key_label(Key *key)
501{
502 int r;
503 const struct sc_priv_data *priv;
504 struct sc_pkcs15_object *key_obj;
505
506 priv = (const struct sc_priv_data *) RSA_get_app_data(key->rsa);
507 if (priv == NULL || p15card == NULL) {
508 logit("SmartCard key not loaded");
509 /* internal error => return default label */
510 return xstrdup("smartcard key");
511 }
512 r = sc_pkcs15_find_prkey_by_id(p15card, &priv->cert_id, &key_obj);
513 if (r) {
514 logit("Unable to find private key from SmartCard: %s",
515 sc_strerror(r));
516 return xstrdup("smartcard key");
517 }
518 if (key_obj == NULL || key_obj->label == NULL)
519 /* the optional PKCS#15 label does not exists
520 * => return the default label */
521 return xstrdup("smartcard key");
522 return xstrdup(key_obj->label);
523}
524
462#endif /* SMARTCARD */ 525#endif /* SMARTCARD */
diff --git a/scard.c b/scard.c
index 9791938c0..906287ba2 100644
--- a/scard.c
+++ b/scard.c
@@ -24,7 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26#if defined(SMARTCARD) && defined(USE_SECTOK) 26#if defined(SMARTCARD) && defined(USE_SECTOK)
27RCSID("$OpenBSD: scard.c,v 1.26 2002/06/23 03:30:17 deraadt Exp $"); 27RCSID("$OpenBSD: scard.c,v 1.28 2003/06/12 19:12:02 markus Exp $");
28 28
29#include <openssl/evp.h> 29#include <openssl/evp.h>
30#include <sectok.h> 30#include <sectok.h>
@@ -526,7 +526,7 @@ sc_put_key(Key *prv, const char *id)
526 } 526 }
527 if (!sectok_swOK(sw)) 527 if (!sectok_swOK(sw))
528 goto done; 528 goto done;
529 log("cyberflex_load_rsa_priv done"); 529 logit("cyberflex_load_rsa_priv done");
530 key_fid[0] = 0x73; 530 key_fid[0] = 0x73;
531 key_fid[1] = 0x68; 531 key_fid[1] = 0x68;
532 if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5], 532 if (cyberflex_load_rsa_pub(fd, cla, key_fid, len, elements[5],
@@ -536,7 +536,7 @@ sc_put_key(Key *prv, const char *id)
536 } 536 }
537 if (!sectok_swOK(sw)) 537 if (!sectok_swOK(sw))
538 goto done; 538 goto done;
539 log("cyberflex_load_rsa_pub done"); 539 logit("cyberflex_load_rsa_pub done");
540 status = 0; 540 status = 0;
541 541
542done: 542done:
@@ -554,4 +554,11 @@ done:
554 sectok_close(fd); 554 sectok_close(fd);
555 return (status); 555 return (status);
556} 556}
557
558char *
559sc_get_key_label(Key *key)
560{
561 return xstrdup("smartcard key");
562}
563
557#endif /* SMARTCARD && USE_SECTOK */ 564#endif /* SMARTCARD && USE_SECTOK */
diff --git a/scard.h b/scard.h
index 00999cb09..9ba20a361 100644
--- a/scard.h
+++ b/scard.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: scard.h,v 1.11 2002/06/30 21:59:45 deraadt Exp $ */ 1/* $OpenBSD: scard.h,v 1.12 2003/06/12 19:12:03 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2001 Markus Friedl. All rights reserved.
@@ -36,5 +36,6 @@
36Key **sc_get_keys(const char *, const char *); 36Key **sc_get_keys(const char *, const char *);
37void sc_close(void); 37void sc_close(void);
38int sc_put_key(Key *, const char *); 38int sc_put_key(Key *, const char *);
39char *sc_get_key_label(Key *);
39 40
40#endif 41#endif
diff --git a/scp.0 b/scp.0
index 7a653c687..2ebff48d0 100644
--- a/scp.0
+++ b/scp.0
@@ -79,15 +79,16 @@ DESCRIPTION
79DIAGNOSTICS 79DIAGNOSTICS
80 scp exits with 0 on success or >0 if an error occurred. 80 scp exits with 0 on success or >0 if an error occurred.
81 81
82AUTHORS 82SEE ALSO
83 Timo Rinne <tri@iki.fi> and Tatu Ylonen <ylo@cs.hut.fi> 83 rcp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1),
84 ssh_config(5), sshd(8)
84 85
85HISTORY 86HISTORY
86 scp is based on the rcp(1) program in BSD source code from the Regents of 87 scp is based on the rcp(1) program in BSD source code from the Regents of
87 the University of California. 88 the University of California.
88 89
89SEE ALSO 90AUTHORS
90 rcp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), 91 Timo Rinne M-bM-^LM-)tri@iki.fiM-bM-^LM-* and
91 ssh_config(5), sshd(8) 92 Tatu Ylonen M-bM-^LM-)ylo@cs.hut.fiM-bM-^LM-*
92 93
93BSD September 25, 1999 BSD 94BSD September 25, 1999 BSD
diff --git a/scp.1 b/scp.1
index a3ec2e0c6..a971500ee 100644
--- a/scp.1
+++ b/scp.1
@@ -9,7 +9,7 @@
9.\" 9.\"
10.\" Created: Sun May 7 00:14:37 1995 ylo 10.\" Created: Sun May 7 00:14:37 1995 ylo
11.\" 11.\"
12.\" $OpenBSD: scp.1,v 1.27 2003/03/28 10:11:43 jmc Exp $ 12.\" $OpenBSD: scp.1,v 1.28 2003/06/10 09:12:11 jmc Exp $
13.\" 13.\"
14.Dd September 25, 1999 14.Dd September 25, 1999
15.Dt SCP 1 15.Dt SCP 1
@@ -148,14 +148,6 @@ to use IPv6 addresses only.
148.Sh DIAGNOSTICS 148.Sh DIAGNOSTICS
149.Nm 149.Nm
150exits with 0 on success or >0 if an error occurred. 150exits with 0 on success or >0 if an error occurred.
151.Sh AUTHORS
152Timo Rinne <tri@iki.fi> and Tatu Ylonen <ylo@cs.hut.fi>
153.Sh HISTORY
154.Nm
155is based on the
156.Xr rcp 1
157program in BSD source code from the Regents of the University of
158California.
159.Sh SEE ALSO 151.Sh SEE ALSO
160.Xr rcp 1 , 152.Xr rcp 1 ,
161.Xr sftp 1 , 153.Xr sftp 1 ,
@@ -165,3 +157,13 @@ California.
165.Xr ssh-keygen 1 , 157.Xr ssh-keygen 1 ,
166.Xr ssh_config 5 , 158.Xr ssh_config 5 ,
167.Xr sshd 8 159.Xr sshd 8
160.Sh HISTORY
161.Nm
162is based on the
163.Xr rcp 1
164program in BSD source code from the Regents of the University of
165California.
166.Sh AUTHORS
167.An Timo Rinne Aq tri@iki.fi
168and
169.An Tatu Ylonen Aq ylo@cs.hut.fi
diff --git a/scp.c b/scp.c
index 35d4c5f71..4f9247c2d 100644
--- a/scp.c
+++ b/scp.c
@@ -52,11 +52,7 @@
52 * 2. Redistributions in binary form must reproduce the above copyright 52 * 2. Redistributions in binary form must reproduce the above copyright
53 * notice, this list of conditions and the following disclaimer in the 53 * notice, this list of conditions and the following disclaimer in the
54 * documentation and/or other materials provided with the distribution. 54 * documentation and/or other materials provided with the distribution.
55 * 3. All advertising materials mentioning features or use of this software 55 * 3. Neither the name of the University nor the names of its contributors
56 * must display the following acknowledgement:
57 * This product includes software developed by the University of
58 * California, Berkeley and its contributors.
59 * 4. Neither the name of the University nor the names of its contributors
60 * may be used to endorse or promote products derived from this software 56 * may be used to endorse or promote products derived from this software
61 * without specific prior written permission. 57 * without specific prior written permission.
62 * 58 *
@@ -75,7 +71,7 @@
75 */ 71 */
76 72
77#include "includes.h" 73#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.102 2003/03/05 22:33:43 markus Exp $"); 74RCSID("$OpenBSD: scp.c,v 1.108 2003/07/18 01:54:25 deraadt Exp $");
79 75
80#include "xmalloc.h" 76#include "xmalloc.h"
81#include "atomicio.h" 77#include "atomicio.h"
@@ -111,7 +107,16 @@ int showprogress = 1;
111char *ssh_program = _PATH_SSH_PROGRAM; 107char *ssh_program = _PATH_SSH_PROGRAM;
112 108
113/* This is used to store the pid of ssh_program */ 109/* This is used to store the pid of ssh_program */
114pid_t do_cmd_pid; 110pid_t do_cmd_pid = -1;
111
112static void
113killchild(int signo)
114{
115 if (do_cmd_pid > 1)
116 kill(do_cmd_pid, signo);
117
118 _exit(1);
119}
115 120
116/* 121/*
117 * This function executes the given command as the specified user on the 122 * This function executes the given command as the specified user on the
@@ -146,7 +151,7 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
146 close(reserved[0]); 151 close(reserved[0]);
147 close(reserved[1]); 152 close(reserved[1]);
148 153
149 /* For a child to execute the command on the remote host using ssh. */ 154 /* Fork a child to execute the command on the remote host using ssh. */
150 do_cmd_pid = fork(); 155 do_cmd_pid = fork();
151 if (do_cmd_pid == 0) { 156 if (do_cmd_pid == 0) {
152 /* Child. */ 157 /* Child. */
@@ -174,6 +179,9 @@ do_cmd(char *host, char *remuser, char *cmd, int *fdin, int *fdout, int argc)
174 *fdout = pin[1]; 179 *fdout = pin[1];
175 close(pout[1]); 180 close(pout[1]);
176 *fdin = pout[0]; 181 *fdin = pout[0];
182 signal(SIGTERM, killchild);
183 signal(SIGINT, killchild);
184 signal(SIGHUP, killchild);
177 return 0; 185 return 0;
178} 186}
179 187
@@ -206,9 +214,7 @@ void toremote(char *, int, char *[]);
206void usage(void); 214void usage(void);
207 215
208int 216int
209main(argc, argv) 217main(int argc, char **argv)
210 int argc;
211 char *argv[];
212{ 218{
213 int ch, fflag, tflag, status; 219 int ch, fflag, tflag, status;
214 double speed; 220 double speed;
@@ -216,7 +222,7 @@ main(argc, argv)
216 extern char *optarg; 222 extern char *optarg;
217 extern int optind; 223 extern int optind;
218 224
219 __progname = get_progname(argv[0]); 225 __progname = ssh_get_progname(argv[0]);
220 226
221 args.list = NULL; 227 args.list = NULL;
222 addargs(&args, "ssh"); /* overwritten with ssh_program */ 228 addargs(&args, "ssh"); /* overwritten with ssh_program */
@@ -292,7 +298,7 @@ main(argc, argv)
292 argv += optind; 298 argv += optind;
293 299
294 if ((pwd = getpwuid(userid = getuid())) == NULL) 300 if ((pwd = getpwuid(userid = getuid())) == NULL)
295 fatal("unknown user %d", (int) userid); 301 fatal("unknown user %u", (u_int) userid);
296 302
297 if (!isatty(STDERR_FILENO)) 303 if (!isatty(STDERR_FILENO))
298 showprogress = 0; 304 showprogress = 0;
@@ -353,9 +359,7 @@ main(argc, argv)
353} 359}
354 360
355void 361void
356toremote(targ, argc, argv) 362toremote(char *targ, int argc, char **argv)
357 char *targ, *argv[];
358 int argc;
359{ 363{
360 int i, len; 364 int i, len;
361 char *bp, *host, *src, *suser, *thost, *tuser; 365 char *bp, *host, *src, *suser, *thost, *tuser;
@@ -443,9 +447,7 @@ toremote(targ, argc, argv)
443} 447}
444 448
445void 449void
446tolocal(argc, argv) 450tolocal(int argc, char **argv)
447 int argc;
448 char *argv[];
449{ 451{
450 int i, len; 452 int i, len;
451 char *bp, *host, *src, *suser; 453 char *bp, *host, *src, *suser;
@@ -494,9 +496,7 @@ tolocal(argc, argv)
494} 496}
495 497
496void 498void
497source(argc, argv) 499source(int argc, char **argv)
498 int argc;
499 char *argv[];
500{ 500{
501 struct stat stb; 501 struct stat stb;
502 static BUF buffer; 502 static BUF buffer;
@@ -549,25 +549,18 @@ syserr: run_err("%s: %s", name, strerror(errno));
549 (void) snprintf(buf, sizeof buf, "T%lu 0 %lu 0\n", 549 (void) snprintf(buf, sizeof buf, "T%lu 0 %lu 0\n",
550 (u_long) stb.st_mtime, 550 (u_long) stb.st_mtime,
551 (u_long) stb.st_atime); 551 (u_long) stb.st_atime);
552 (void) atomicio(write, remout, buf, strlen(buf)); 552 (void) atomicio(vwrite, remout, buf, strlen(buf));
553 if (response() < 0) 553 if (response() < 0)
554 goto next; 554 goto next;
555 } 555 }
556#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) 556#define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
557#ifdef HAVE_LONG_LONG_INT
558 snprintf(buf, sizeof buf, "C%04o %lld %s\n", 557 snprintf(buf, sizeof buf, "C%04o %lld %s\n",
559 (u_int) (stb.st_mode & FILEMODEMASK), 558 (u_int) (stb.st_mode & FILEMODEMASK),
560 (long long)stb.st_size, last); 559 (int64_t)stb.st_size, last);
561#else
562 /* XXX: Handle integer overflow? */
563 snprintf(buf, sizeof buf, "C%04o %lu %s\n",
564 (u_int) (stb.st_mode & FILEMODEMASK),
565 (u_long) stb.st_size, last);
566#endif
567 if (verbose_mode) { 560 if (verbose_mode) {
568 fprintf(stderr, "Sending file modes: %s", buf); 561 fprintf(stderr, "Sending file modes: %s", buf);
569 } 562 }
570 (void) atomicio(write, remout, buf, strlen(buf)); 563 (void) atomicio(vwrite, remout, buf, strlen(buf));
571 if (response() < 0) 564 if (response() < 0)
572 goto next; 565 goto next;
573 if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) { 566 if ((bp = allocbuf(&buffer, fd, 2048)) == NULL) {
@@ -587,9 +580,9 @@ next: (void) close(fd);
587 haderr = result >= 0 ? EIO : errno; 580 haderr = result >= 0 ? EIO : errno;
588 } 581 }
589 if (haderr) 582 if (haderr)
590 (void) atomicio(write, remout, bp->buf, amt); 583 (void) atomicio(vwrite, remout, bp->buf, amt);
591 else { 584 else {
592 result = atomicio(write, remout, bp->buf, amt); 585 result = atomicio(vwrite, remout, bp->buf, amt);
593 if (result != amt) 586 if (result != amt)
594 haderr = result >= 0 ? EIO : errno; 587 haderr = result >= 0 ? EIO : errno;
595 statbytes += result; 588 statbytes += result;
@@ -603,7 +596,7 @@ next: (void) close(fd);
603 if (close(fd) < 0 && !haderr) 596 if (close(fd) < 0 && !haderr)
604 haderr = errno; 597 haderr = errno;
605 if (!haderr) 598 if (!haderr)
606 (void) atomicio(write, remout, "", 1); 599 (void) atomicio(vwrite, remout, "", 1);
607 else 600 else
608 run_err("%s: %s", name, strerror(haderr)); 601 run_err("%s: %s", name, strerror(haderr));
609 (void) response(); 602 (void) response();
@@ -611,9 +604,7 @@ next: (void) close(fd);
611} 604}
612 605
613void 606void
614rsource(name, statp) 607rsource(char *name, struct stat *statp)
615 char *name;
616 struct stat *statp;
617{ 608{
618 DIR *dirp; 609 DIR *dirp;
619 struct dirent *dp; 610 struct dirent *dp;
@@ -632,7 +623,7 @@ rsource(name, statp)
632 (void) snprintf(path, sizeof(path), "T%lu 0 %lu 0\n", 623 (void) snprintf(path, sizeof(path), "T%lu 0 %lu 0\n",
633 (u_long) statp->st_mtime, 624 (u_long) statp->st_mtime,
634 (u_long) statp->st_atime); 625 (u_long) statp->st_atime);
635 (void) atomicio(write, remout, path, strlen(path)); 626 (void) atomicio(vwrite, remout, path, strlen(path));
636 if (response() < 0) { 627 if (response() < 0) {
637 closedir(dirp); 628 closedir(dirp);
638 return; 629 return;
@@ -642,7 +633,7 @@ rsource(name, statp)
642 (u_int) (statp->st_mode & FILEMODEMASK), 0, last); 633 (u_int) (statp->st_mode & FILEMODEMASK), 0, last);
643 if (verbose_mode) 634 if (verbose_mode)
644 fprintf(stderr, "Entering directory: %s", path); 635 fprintf(stderr, "Entering directory: %s", path);
645 (void) atomicio(write, remout, path, strlen(path)); 636 (void) atomicio(vwrite, remout, path, strlen(path));
646 if (response() < 0) { 637 if (response() < 0) {
647 closedir(dirp); 638 closedir(dirp);
648 return; 639 return;
@@ -661,7 +652,7 @@ rsource(name, statp)
661 source(1, vect); 652 source(1, vect);
662 } 653 }
663 (void) closedir(dirp); 654 (void) closedir(dirp);
664 (void) atomicio(write, remout, "E\n", 2); 655 (void) atomicio(vwrite, remout, "E\n", 2);
665 (void) response(); 656 (void) response();
666} 657}
667 658
@@ -720,9 +711,7 @@ bwlimit(int amount)
720} 711}
721 712
722void 713void
723sink(argc, argv) 714sink(int argc, char **argv)
724 int argc;
725 char *argv[];
726{ 715{
727 static BUF buffer; 716 static BUF buffer;
728 struct stat stb; 717 struct stat stb;
@@ -753,7 +742,7 @@ sink(argc, argv)
753 if (targetshouldbedirectory) 742 if (targetshouldbedirectory)
754 verifydir(targ); 743 verifydir(targ);
755 744
756 (void) atomicio(write, remout, "", 1); 745 (void) atomicio(vwrite, remout, "", 1);
757 if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode)) 746 if (stat(targ, &stb) == 0 && S_ISDIR(stb.st_mode))
758 targisdir = 1; 747 targisdir = 1;
759 for (first = 1;; first = 0) { 748 for (first = 1;; first = 0) {
@@ -771,7 +760,7 @@ sink(argc, argv)
771 760
772 if (buf[0] == '\01' || buf[0] == '\02') { 761 if (buf[0] == '\01' || buf[0] == '\02') {
773 if (iamremote == 0) 762 if (iamremote == 0)
774 (void) atomicio(write, STDERR_FILENO, 763 (void) atomicio(vwrite, STDERR_FILENO,
775 buf + 1, strlen(buf + 1)); 764 buf + 1, strlen(buf + 1));
776 if (buf[0] == '\02') 765 if (buf[0] == '\02')
777 exit(1); 766 exit(1);
@@ -779,7 +768,7 @@ sink(argc, argv)
779 continue; 768 continue;
780 } 769 }
781 if (buf[0] == 'E') { 770 if (buf[0] == 'E') {
782 (void) atomicio(write, remout, "", 1); 771 (void) atomicio(vwrite, remout, "", 1);
783 return; 772 return;
784 } 773 }
785 if (ch == '\n') 774 if (ch == '\n')
@@ -801,7 +790,7 @@ sink(argc, argv)
801 atime.tv_usec = strtol(cp, &cp, 10); 790 atime.tv_usec = strtol(cp, &cp, 10);
802 if (!cp || *cp++ != '\0') 791 if (!cp || *cp++ != '\0')
803 SCREWUP("atime.usec not delimited"); 792 SCREWUP("atime.usec not delimited");
804 (void) atomicio(write, remout, "", 1); 793 (void) atomicio(vwrite, remout, "", 1);
805 continue; 794 continue;
806 } 795 }
807 if (*cp != 'C' && *cp != 'D') { 796 if (*cp != 'C' && *cp != 'D') {
@@ -886,7 +875,7 @@ sink(argc, argv)
886bad: run_err("%s: %s", np, strerror(errno)); 875bad: run_err("%s: %s", np, strerror(errno));
887 continue; 876 continue;
888 } 877 }
889 (void) atomicio(write, remout, "", 1); 878 (void) atomicio(vwrite, remout, "", 1);
890 if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) { 879 if ((bp = allocbuf(&buffer, ofd, 4096)) == NULL) {
891 (void) close(ofd); 880 (void) close(ofd);
892 continue; 881 continue;
@@ -923,7 +912,7 @@ bad: run_err("%s: %s", np, strerror(errno));
923 if (count == bp->cnt) { 912 if (count == bp->cnt) {
924 /* Keep reading so we stay sync'd up. */ 913 /* Keep reading so we stay sync'd up. */
925 if (wrerr == NO) { 914 if (wrerr == NO) {
926 j = atomicio(write, ofd, bp->buf, count); 915 j = atomicio(vwrite, ofd, bp->buf, count);
927 if (j != count) { 916 if (j != count) {
928 wrerr = YES; 917 wrerr = YES;
929 wrerrno = j >= 0 ? EIO : errno; 918 wrerrno = j >= 0 ? EIO : errno;
@@ -936,7 +925,7 @@ bad: run_err("%s: %s", np, strerror(errno));
936 if (showprogress) 925 if (showprogress)
937 stop_progress_meter(); 926 stop_progress_meter();
938 if (count != 0 && wrerr == NO && 927 if (count != 0 && wrerr == NO &&
939 (j = atomicio(write, ofd, bp->buf, count)) != count) { 928 (j = atomicio(vwrite, ofd, bp->buf, count)) != count) {
940 wrerr = YES; 929 wrerr = YES;
941 wrerrno = j >= 0 ? EIO : errno; 930 wrerrno = j >= 0 ? EIO : errno;
942 } 931 }
@@ -981,7 +970,7 @@ bad: run_err("%s: %s", np, strerror(errno));
981 run_err("%s: %s", np, strerror(wrerrno)); 970 run_err("%s: %s", np, strerror(wrerrno));
982 break; 971 break;
983 case NO: 972 case NO:
984 (void) atomicio(write, remout, "", 1); 973 (void) atomicio(vwrite, remout, "", 1);
985 break; 974 break;
986 case DISPLAYED: 975 case DISPLAYED:
987 break; 976 break;
@@ -1016,7 +1005,7 @@ response(void)
1016 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n'); 1005 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
1017 1006
1018 if (!iamremote) 1007 if (!iamremote)
1019 (void) atomicio(write, STDERR_FILENO, rbuf, cp - rbuf); 1008 (void) atomicio(vwrite, STDERR_FILENO, rbuf, cp - rbuf);
1020 ++errs; 1009 ++errs;
1021 if (resp == 1) 1010 if (resp == 1)
1022 return (-1); 1011 return (-1);
@@ -1061,8 +1050,7 @@ run_err(const char *fmt,...)
1061} 1050}
1062 1051
1063void 1052void
1064verifydir(cp) 1053verifydir(char *cp)
1065 char *cp;
1066{ 1054{
1067 struct stat stb; 1055 struct stat stb;
1068 1056
@@ -1076,8 +1064,7 @@ verifydir(cp)
1076} 1064}
1077 1065
1078int 1066int
1079okname(cp0) 1067okname(char *cp0)
1080 char *cp0;
1081{ 1068{
1082 int c; 1069 int c;
1083 char *cp; 1070 char *cp;
@@ -1107,9 +1094,7 @@ bad: fprintf(stderr, "%s: invalid user name\n", cp0);
1107} 1094}
1108 1095
1109BUF * 1096BUF *
1110allocbuf(bp, fd, blksize) 1097allocbuf(BUF *bp, int fd, int blksize)
1111 BUF *bp;
1112 int fd, blksize;
1113{ 1098{
1114 size_t size; 1099 size_t size;
1115#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE 1100#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
@@ -1137,8 +1122,7 @@ allocbuf(bp, fd, blksize)
1137} 1122}
1138 1123
1139void 1124void
1140lostconn(signo) 1125lostconn(int signo)
1141 int signo;
1142{ 1126{
1143 if (!iamremote) 1127 if (!iamremote)
1144 write(STDERR_FILENO, "lost connection\n", 16); 1128 write(STDERR_FILENO, "lost connection\n", 16);
diff --git a/servconf.c b/servconf.c
index 2510659ee..71e28b3cb 100644
--- a/servconf.c
+++ b/servconf.c
@@ -10,23 +10,7 @@
10 */ 10 */
11 11
12#include "includes.h" 12#include "includes.h"
13RCSID("$OpenBSD: servconf.c,v 1.116 2003/02/21 09:05:53 markus Exp $"); 13RCSID("$OpenBSD: servconf.c,v 1.127 2003/09/01 18:15:50 markus Exp $");
14
15#if defined(KRB4)
16#include <krb.h>
17#endif
18#if defined(KRB5)
19#ifdef HEIMDAL
20#include <krb.h>
21#else
22/* Bodge - but then, so is using the kerberos IV KEYFILE to get a Kerberos V
23 * keytab */
24#define KEYFILE "/etc/krb5.keytab"
25#endif
26#endif
27#ifdef AFS
28#include <kafs.h>
29#endif
30 14
31#include "ssh.h" 15#include "ssh.h"
32#include "log.h" 16#include "log.h"
@@ -56,7 +40,7 @@ initialize_server_options(ServerOptions *options)
56 memset(options, 0, sizeof(*options)); 40 memset(options, 0, sizeof(*options));
57 41
58 /* Portable-specific options */ 42 /* Portable-specific options */
59 options->pam_authentication_via_kbd_int = -1; 43 options->use_pam = -1;
60 44
61 /* Standard Options */ 45 /* Standard Options */
62 options->num_ports = 0; 46 options->num_ports = 0;
@@ -80,23 +64,16 @@ initialize_server_options(ServerOptions *options)
80 options->keepalives = -1; 64 options->keepalives = -1;
81 options->log_facility = SYSLOG_FACILITY_NOT_SET; 65 options->log_facility = SYSLOG_FACILITY_NOT_SET;
82 options->log_level = SYSLOG_LEVEL_NOT_SET; 66 options->log_level = SYSLOG_LEVEL_NOT_SET;
83 options->rhosts_authentication = -1;
84 options->rhosts_rsa_authentication = -1; 67 options->rhosts_rsa_authentication = -1;
85 options->hostbased_authentication = -1; 68 options->hostbased_authentication = -1;
86 options->hostbased_uses_name_from_packet_only = -1; 69 options->hostbased_uses_name_from_packet_only = -1;
87 options->rsa_authentication = -1; 70 options->rsa_authentication = -1;
88 options->pubkey_authentication = -1; 71 options->pubkey_authentication = -1;
89#if defined(KRB4) || defined(KRB5)
90 options->kerberos_authentication = -1; 72 options->kerberos_authentication = -1;
91 options->kerberos_or_local_passwd = -1; 73 options->kerberos_or_local_passwd = -1;
92 options->kerberos_ticket_cleanup = -1; 74 options->kerberos_ticket_cleanup = -1;
93#endif 75 options->gss_authentication=-1;
94#if defined(AFS) || defined(KRB5) 76 options->gss_cleanup_creds = -1;
95 options->kerberos_tgt_passing = -1;
96#endif
97#ifdef AFS
98 options->afs_token_passing = -1;
99#endif
100 options->password_authentication = -1; 77 options->password_authentication = -1;
101 options->kbd_interactive_authentication = -1; 78 options->kbd_interactive_authentication = -1;
102 options->challenge_response_authentication = -1; 79 options->challenge_response_authentication = -1;
@@ -118,7 +95,7 @@ initialize_server_options(ServerOptions *options)
118 options->max_startups_rate = -1; 95 options->max_startups_rate = -1;
119 options->max_startups = -1; 96 options->max_startups = -1;
120 options->banner = NULL; 97 options->banner = NULL;
121 options->verify_reverse_mapping = -1; 98 options->use_dns = -1;
122 options->client_alive_interval = -1; 99 options->client_alive_interval = -1;
123 options->client_alive_count_max = -1; 100 options->client_alive_count_max = -1;
124 options->authorized_keys_file = NULL; 101 options->authorized_keys_file = NULL;
@@ -132,8 +109,8 @@ void
132fill_default_server_options(ServerOptions *options) 109fill_default_server_options(ServerOptions *options)
133{ 110{
134 /* Portable-specific options */ 111 /* Portable-specific options */
135 if (options->pam_authentication_via_kbd_int == -1) 112 if (options->use_pam == -1)
136 options->pam_authentication_via_kbd_int = 0; 113 options->use_pam = 1;
137 114
138 /* Standard Options */ 115 /* Standard Options */
139 if (options->protocol == SSH_PROTO_UNKNOWN) 116 if (options->protocol == SSH_PROTO_UNKNOWN)
@@ -188,8 +165,6 @@ fill_default_server_options(ServerOptions *options)
188 options->log_facility = SYSLOG_FACILITY_AUTH; 165 options->log_facility = SYSLOG_FACILITY_AUTH;
189 if (options->log_level == SYSLOG_LEVEL_NOT_SET) 166 if (options->log_level == SYSLOG_LEVEL_NOT_SET)
190 options->log_level = SYSLOG_LEVEL_INFO; 167 options->log_level = SYSLOG_LEVEL_INFO;
191 if (options->rhosts_authentication == -1)
192 options->rhosts_authentication = 0;
193 if (options->rhosts_rsa_authentication == -1) 168 if (options->rhosts_rsa_authentication == -1)
194 options->rhosts_rsa_authentication = 0; 169 options->rhosts_rsa_authentication = 0;
195 if (options->hostbased_authentication == -1) 170 if (options->hostbased_authentication == -1)
@@ -200,22 +175,16 @@ fill_default_server_options(ServerOptions *options)
200 options->rsa_authentication = 1; 175 options->rsa_authentication = 1;
201 if (options->pubkey_authentication == -1) 176 if (options->pubkey_authentication == -1)
202 options->pubkey_authentication = 1; 177 options->pubkey_authentication = 1;
203#if defined(KRB4) || defined(KRB5)
204 if (options->kerberos_authentication == -1) 178 if (options->kerberos_authentication == -1)
205 options->kerberos_authentication = 0; 179 options->kerberos_authentication = 0;
206 if (options->kerberos_or_local_passwd == -1) 180 if (options->kerberos_or_local_passwd == -1)
207 options->kerberos_or_local_passwd = 1; 181 options->kerberos_or_local_passwd = 1;
208 if (options->kerberos_ticket_cleanup == -1) 182 if (options->kerberos_ticket_cleanup == -1)
209 options->kerberos_ticket_cleanup = 1; 183 options->kerberos_ticket_cleanup = 1;
210#endif 184 if (options->gss_authentication == -1)
211#if defined(AFS) || defined(KRB5) 185 options->gss_authentication = 0;
212 if (options->kerberos_tgt_passing == -1) 186 if (options->gss_cleanup_creds == -1)
213 options->kerberos_tgt_passing = 0; 187 options->gss_cleanup_creds = 1;
214#endif
215#ifdef AFS
216 if (options->afs_token_passing == -1)
217 options->afs_token_passing = 0;
218#endif
219 if (options->password_authentication == -1) 188 if (options->password_authentication == -1)
220 options->password_authentication = 1; 189 options->password_authentication = 1;
221 if (options->kbd_interactive_authentication == -1) 190 if (options->kbd_interactive_authentication == -1)
@@ -240,8 +209,8 @@ fill_default_server_options(ServerOptions *options)
240 options->max_startups_rate = 100; /* 100% */ 209 options->max_startups_rate = 100; /* 100% */
241 if (options->max_startups_begin == -1) 210 if (options->max_startups_begin == -1)
242 options->max_startups_begin = options->max_startups; 211 options->max_startups_begin = options->max_startups;
243 if (options->verify_reverse_mapping == -1) 212 if (options->use_dns == -1)
244 options->verify_reverse_mapping = 0; 213 options->use_dns = 1;
245 if (options->client_alive_interval == -1) 214 if (options->client_alive_interval == -1)
246 options->client_alive_interval = 0; 215 options->client_alive_interval = 0;
247 if (options->client_alive_count_max == -1) 216 if (options->client_alive_count_max == -1)
@@ -275,21 +244,13 @@ fill_default_server_options(ServerOptions *options)
275typedef enum { 244typedef enum {
276 sBadOption, /* == unknown option */ 245 sBadOption, /* == unknown option */
277 /* Portable-specific options */ 246 /* Portable-specific options */
278 sPAMAuthenticationViaKbdInt, 247 sUsePAM,
279 /* Standard Options */ 248 /* Standard Options */
280 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime, 249 sPort, sHostKeyFile, sServerKeyBits, sLoginGraceTime, sKeyRegenerationTime,
281 sPermitRootLogin, sLogFacility, sLogLevel, 250 sPermitRootLogin, sLogFacility, sLogLevel,
282 sRhostsAuthentication, sRhostsRSAAuthentication, sRSAAuthentication, 251 sRhostsRSAAuthentication, sRSAAuthentication,
283#if defined(KRB4) || defined(KRB5)
284 sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup, 252 sKerberosAuthentication, sKerberosOrLocalPasswd, sKerberosTicketCleanup,
285#endif 253 sKerberosTgtPassing, sChallengeResponseAuthentication,
286#if defined(AFS) || defined(KRB5)
287 sKerberosTgtPassing,
288#endif
289#ifdef AFS
290 sAFSTokenPassing,
291#endif
292 sChallengeResponseAuthentication,
293 sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress, 254 sPasswordAuthentication, sKbdInteractiveAuthentication, sListenAddress,
294 sPrintMotd, sPrintLastLog, sIgnoreRhosts, 255 sPrintMotd, sPrintLastLog, sIgnoreRhosts,
295 sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost, 256 sX11Forwarding, sX11DisplayOffset, sX11UseLocalhost,
@@ -298,11 +259,12 @@ typedef enum {
298 sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups, 259 sAllowUsers, sDenyUsers, sAllowGroups, sDenyGroups,
299 sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile, 260 sIgnoreUserKnownHosts, sCiphers, sMacs, sProtocol, sPidFile,
300 sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups, 261 sGatewayPorts, sPubkeyAuthentication, sXAuthLocation, sSubsystem, sMaxStartups,
301 sBanner, sVerifyReverseMapping, sHostbasedAuthentication, 262 sBanner, sUseDNS, sHostbasedAuthentication,
302 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval, 263 sHostbasedUsesNameFromPacketOnly, sClientAliveInterval,
303 sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2, 264 sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
265 sGssAuthentication, sGssCleanupCreds,
304 sUsePrivilegeSeparation, 266 sUsePrivilegeSeparation,
305 sDeprecated 267 sDeprecated, sUnsupported
306} ServerOpCodes; 268} ServerOpCodes;
307 269
308/* Textual representation of the tokens. */ 270/* Textual representation of the tokens. */
@@ -311,7 +273,12 @@ static struct {
311 ServerOpCodes opcode; 273 ServerOpCodes opcode;
312} keywords[] = { 274} keywords[] = {
313 /* Portable-specific options */ 275 /* Portable-specific options */
314 { "PAMAuthenticationViaKbdInt", sPAMAuthenticationViaKbdInt }, 276#ifdef USE_PAM
277 { "usepam", sUsePAM },
278#else
279 { "usepam", sUnsupported },
280#endif
281 { "pamauthenticationviakbdint", sDeprecated },
315 /* Standard Options */ 282 /* Standard Options */
316 { "port", sPort }, 283 { "port", sPort },
317 { "hostkey", sHostKeyFile }, 284 { "hostkey", sHostKeyFile },
@@ -323,23 +290,30 @@ static struct {
323 { "permitrootlogin", sPermitRootLogin }, 290 { "permitrootlogin", sPermitRootLogin },
324 { "syslogfacility", sLogFacility }, 291 { "syslogfacility", sLogFacility },
325 { "loglevel", sLogLevel }, 292 { "loglevel", sLogLevel },
326 { "rhostsauthentication", sRhostsAuthentication }, 293 { "rhostsauthentication", sDeprecated },
327 { "rhostsrsaauthentication", sRhostsRSAAuthentication }, 294 { "rhostsrsaauthentication", sRhostsRSAAuthentication },
328 { "hostbasedauthentication", sHostbasedAuthentication }, 295 { "hostbasedauthentication", sHostbasedAuthentication },
329 { "hostbasedusesnamefrompacketonly", sHostbasedUsesNameFromPacketOnly }, 296 { "hostbasedusesnamefrompacketonly", sHostbasedUsesNameFromPacketOnly },
330 { "rsaauthentication", sRSAAuthentication }, 297 { "rsaauthentication", sRSAAuthentication },
331 { "pubkeyauthentication", sPubkeyAuthentication }, 298 { "pubkeyauthentication", sPubkeyAuthentication },
332 { "dsaauthentication", sPubkeyAuthentication }, /* alias */ 299 { "dsaauthentication", sPubkeyAuthentication }, /* alias */
333#if defined(KRB4) || defined(KRB5) 300#ifdef KRB5
334 { "kerberosauthentication", sKerberosAuthentication }, 301 { "kerberosauthentication", sKerberosAuthentication },
335 { "kerberosorlocalpasswd", sKerberosOrLocalPasswd }, 302 { "kerberosorlocalpasswd", sKerberosOrLocalPasswd },
336 { "kerberosticketcleanup", sKerberosTicketCleanup }, 303 { "kerberosticketcleanup", sKerberosTicketCleanup },
304#else
305 { "kerberosauthentication", sUnsupported },
306 { "kerberosorlocalpasswd", sUnsupported },
307 { "kerberosticketcleanup", sUnsupported },
337#endif 308#endif
338#if defined(AFS) || defined(KRB5) 309 { "kerberostgtpassing", sUnsupported },
339 { "kerberostgtpassing", sKerberosTgtPassing }, 310 { "afstokenpassing", sUnsupported },
340#endif 311#ifdef GSSAPI
341#ifdef AFS 312 { "gssapiauthentication", sGssAuthentication },
342 { "afstokenpassing", sAFSTokenPassing }, 313 { "gssapicleanupcreds", sGssCleanupCreds },
314#else
315 { "gssapiauthentication", sUnsupported },
316 { "gssapicleanupcreds", sUnsupported },
343#endif 317#endif
344 { "passwordauthentication", sPasswordAuthentication }, 318 { "passwordauthentication", sPasswordAuthentication },
345 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication }, 319 { "kbdinteractiveauthentication", sKbdInteractiveAuthentication },
@@ -373,8 +347,9 @@ static struct {
373 { "subsystem", sSubsystem }, 347 { "subsystem", sSubsystem },
374 { "maxstartups", sMaxStartups }, 348 { "maxstartups", sMaxStartups },
375 { "banner", sBanner }, 349 { "banner", sBanner },
376 { "verifyreversemapping", sVerifyReverseMapping }, 350 { "usedns", sUseDNS },
377 { "reversemappingcheck", sVerifyReverseMapping }, 351 { "verifyreversemapping", sDeprecated },
352 { "reversemappingcheck", sDeprecated },
378 { "clientaliveinterval", sClientAliveInterval }, 353 { "clientaliveinterval", sClientAliveInterval },
379 { "clientalivecountmax", sClientAliveCountMax }, 354 { "clientalivecountmax", sClientAliveCountMax },
380 { "authorizedkeysfile", sAuthorizedKeysFile }, 355 { "authorizedkeysfile", sAuthorizedKeysFile },
@@ -458,8 +433,8 @@ process_server_config_line(ServerOptions *options, char *line,
458 opcode = parse_token(arg, filename, linenum); 433 opcode = parse_token(arg, filename, linenum);
459 switch (opcode) { 434 switch (opcode) {
460 /* Portable-specific options */ 435 /* Portable-specific options */
461 case sPAMAuthenticationViaKbdInt: 436 case sUsePAM:
462 intptr = &options->pam_authentication_via_kbd_int; 437 intptr = &options->use_pam;
463 goto parse_flag; 438 goto parse_flag;
464 439
465 /* Standard Options */ 440 /* Standard Options */
@@ -622,10 +597,6 @@ parse_flag:
622 intptr = &options->ignore_user_known_hosts; 597 intptr = &options->ignore_user_known_hosts;
623 goto parse_flag; 598 goto parse_flag;
624 599
625 case sRhostsAuthentication:
626 intptr = &options->rhosts_authentication;
627 goto parse_flag;
628
629 case sRhostsRSAAuthentication: 600 case sRhostsRSAAuthentication:
630 intptr = &options->rhosts_rsa_authentication; 601 intptr = &options->rhosts_rsa_authentication;
631 goto parse_flag; 602 goto parse_flag;
@@ -645,7 +616,7 @@ parse_flag:
645 case sPubkeyAuthentication: 616 case sPubkeyAuthentication:
646 intptr = &options->pubkey_authentication; 617 intptr = &options->pubkey_authentication;
647 goto parse_flag; 618 goto parse_flag;
648#if defined(KRB4) || defined(KRB5) 619
649 case sKerberosAuthentication: 620 case sKerberosAuthentication:
650 intptr = &options->kerberos_authentication; 621 intptr = &options->kerberos_authentication;
651 goto parse_flag; 622 goto parse_flag;
@@ -657,17 +628,14 @@ parse_flag:
657 case sKerberosTicketCleanup: 628 case sKerberosTicketCleanup:
658 intptr = &options->kerberos_ticket_cleanup; 629 intptr = &options->kerberos_ticket_cleanup;
659 goto parse_flag; 630 goto parse_flag;
660#endif 631
661#if defined(AFS) || defined(KRB5) 632 case sGssAuthentication:
662 case sKerberosTgtPassing: 633 intptr = &options->gss_authentication;
663 intptr = &options->kerberos_tgt_passing;
664 goto parse_flag; 634 goto parse_flag;
665#endif 635
666#ifdef AFS 636 case sGssCleanupCreds:
667 case sAFSTokenPassing: 637 intptr = &options->gss_cleanup_creds;
668 intptr = &options->afs_token_passing;
669 goto parse_flag; 638 goto parse_flag;
670#endif
671 639
672 case sPasswordAuthentication: 640 case sPasswordAuthentication:
673 intptr = &options->password_authentication; 641 intptr = &options->password_authentication;
@@ -733,8 +701,8 @@ parse_flag:
733 intptr = &options->gateway_ports; 701 intptr = &options->gateway_ports;
734 goto parse_flag; 702 goto parse_flag;
735 703
736 case sVerifyReverseMapping: 704 case sUseDNS:
737 intptr = &options->verify_reverse_mapping; 705 intptr = &options->use_dns;
738 goto parse_flag; 706 goto parse_flag;
739 707
740 case sLogFacility: 708 case sLogFacility:
@@ -910,7 +878,14 @@ parse_flag:
910 goto parse_int; 878 goto parse_int;
911 879
912 case sDeprecated: 880 case sDeprecated:
913 log("%s line %d: Deprecated option %s", 881 logit("%s line %d: Deprecated option %s",
882 filename, linenum, arg);
883 while (arg)
884 arg = strdelim(&cp);
885 break;
886
887 case sUnsupported:
888 logit("%s line %d: Unsupported option %s",
914 filename, linenum, arg); 889 filename, linenum, arg);
915 while (arg) 890 while (arg)
916 arg = strdelim(&cp); 891 arg = strdelim(&cp);
diff --git a/servconf.h b/servconf.h
index 024987dd6..828e94c5c 100644
--- a/servconf.h
+++ b/servconf.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: servconf.h,v 1.59 2002/07/30 17:03:55 markus Exp $ */ 1/* $OpenBSD: servconf.h,v 1.65 2003/09/01 18:15:50 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -65,15 +65,12 @@ typedef struct {
65 int gateway_ports; /* If true, allow remote connects to forwarded ports. */ 65 int gateway_ports; /* If true, allow remote connects to forwarded ports. */
66 SyslogFacility log_facility; /* Facility for system logging. */ 66 SyslogFacility log_facility; /* Facility for system logging. */
67 LogLevel log_level; /* Level for system logging. */ 67 LogLevel log_level; /* Level for system logging. */
68 int rhosts_authentication; /* If true, permit rhosts
69 * authentication. */
70 int rhosts_rsa_authentication; /* If true, permit rhosts RSA 68 int rhosts_rsa_authentication; /* If true, permit rhosts RSA
71 * authentication. */ 69 * authentication. */
72 int hostbased_authentication; /* If true, permit ssh2 hostbased auth */ 70 int hostbased_authentication; /* If true, permit ssh2 hostbased auth */
73 int hostbased_uses_name_from_packet_only; /* experimental */ 71 int hostbased_uses_name_from_packet_only; /* experimental */
74 int rsa_authentication; /* If true, permit RSA authentication. */ 72 int rsa_authentication; /* If true, permit RSA authentication. */
75 int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */ 73 int pubkey_authentication; /* If true, permit ssh2 pubkey authentication. */
76#if defined(KRB4) || defined(KRB5)
77 int kerberos_authentication; /* If true, permit Kerberos 74 int kerberos_authentication; /* If true, permit Kerberos
78 * authentication. */ 75 * authentication. */
79 int kerberos_or_local_passwd; /* If true, permit kerberos 76 int kerberos_or_local_passwd; /* If true, permit kerberos
@@ -83,14 +80,8 @@ typedef struct {
83 * /etc/passwd */ 80 * /etc/passwd */
84 int kerberos_ticket_cleanup; /* If true, destroy ticket 81 int kerberos_ticket_cleanup; /* If true, destroy ticket
85 * file on logout. */ 82 * file on logout. */
86#endif 83 int gss_authentication; /* If true, permit GSSAPI authentication */
87#if defined(AFS) || defined(KRB5) 84 int gss_cleanup_creds; /* If true, destroy cred cache on logout */
88 int kerberos_tgt_passing; /* If true, permit Kerberos TGT
89 * passing. */
90#endif
91#ifdef AFS
92 int afs_token_passing; /* If true, permit AFS token passing. */
93#endif
94 int password_authentication; /* If true, permit password 85 int password_authentication; /* If true, permit password
95 * authentication. */ 86 * authentication. */
96 int kbd_interactive_authentication; /* If true, permit */ 87 int kbd_interactive_authentication; /* If true, permit */
@@ -118,7 +109,7 @@ typedef struct {
118 int max_startups_rate; 109 int max_startups_rate;
119 int max_startups; 110 int max_startups;
120 char *banner; /* SSH-2 banner message */ 111 char *banner; /* SSH-2 banner message */
121 int verify_reverse_mapping; /* cross-check ip and dns */ 112 int use_dns;
122 int client_alive_interval; /* 113 int client_alive_interval; /*
123 * poke the client this often to 114 * poke the client this often to
124 * see if it's still there 115 * see if it's still there
@@ -131,7 +122,7 @@ typedef struct {
131 122
132 char *authorized_keys_file; /* File containing public keys */ 123 char *authorized_keys_file; /* File containing public keys */
133 char *authorized_keys_file2; 124 char *authorized_keys_file2;
134 int pam_authentication_via_kbd_int; 125 int use_pam; /* Enable auth via PAM */
135} ServerOptions; 126} ServerOptions;
136 127
137void initialize_server_options(ServerOptions *); 128void initialize_server_options(ServerOptions *);
diff --git a/serverloop.c b/serverloop.c
index f4df9cccb..a95390273 100644
--- a/serverloop.c
+++ b/serverloop.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: serverloop.c,v 1.106 2003/04/01 10:22:21 markus Exp $"); 38RCSID("$OpenBSD: serverloop.c,v 1.110 2003/06/24 08:23:46 markus Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "packet.h" 41#include "packet.h"
@@ -158,7 +158,7 @@ sigchld_handler(int sig)
158static void 158static void
159make_packets_from_stderr_data(void) 159make_packets_from_stderr_data(void)
160{ 160{
161 int len; 161 u_int len;
162 162
163 /* Send buffered stderr data to the client. */ 163 /* Send buffered stderr data to the client. */
164 while (buffer_len(&stderr_buffer) > 0 && 164 while (buffer_len(&stderr_buffer) > 0 &&
@@ -187,7 +187,7 @@ make_packets_from_stderr_data(void)
187static void 187static void
188make_packets_from_stdout_data(void) 188make_packets_from_stdout_data(void)
189{ 189{
190 int len; 190 u_int len;
191 191
192 /* Send buffered stdout data to the client. */ 192 /* Send buffered stdout data to the client. */
193 while (buffer_len(&stdout_buffer) > 0 && 193 while (buffer_len(&stdout_buffer) > 0 &&
@@ -771,8 +771,14 @@ server_loop2(Authctxt *authctxt)
771 &nalloc, 0); 771 &nalloc, 0);
772 772
773 collect_children(); 773 collect_children();
774 if (!rekeying) 774 if (!rekeying) {
775 channel_after_select(readset, writeset); 775 channel_after_select(readset, writeset);
776 if (packet_need_rekeying()) {
777 debug("need rekeying");
778 xxx_kex->done = 0;
779 kex_send_kexinit(xxx_kex);
780 }
781 }
776 process_input(readset); 782 process_input(readset);
777 if (connection_closed) 783 if (connection_closed)
778 break; 784 break;
@@ -874,7 +880,7 @@ server_request_direct_tcpip(char *ctype)
874 return NULL; 880 return NULL;
875 c = channel_new(ctype, SSH_CHANNEL_CONNECTING, 881 c = channel_new(ctype, SSH_CHANNEL_CONNECTING,
876 sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT, 882 sock, sock, -1, CHAN_TCP_WINDOW_DEFAULT,
877 CHAN_TCP_PACKET_DEFAULT, 0, xstrdup("direct-tcpip"), 1); 883 CHAN_TCP_PACKET_DEFAULT, 0, "direct-tcpip", 1);
878 return c; 884 return c;
879} 885}
880 886
@@ -893,7 +899,7 @@ server_request_session(char *ctype)
893 */ 899 */
894 c = channel_new(ctype, SSH_CHANNEL_LARVAL, 900 c = channel_new(ctype, SSH_CHANNEL_LARVAL,
895 -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT, 901 -1, -1, -1, /*window size*/0, CHAN_SES_PACKET_DEFAULT,
896 0, xstrdup("server-session"), 1); 902 0, "server-session", 1);
897 if (session_open(xxx_authctxt, c->self) != 1) { 903 if (session_open(xxx_authctxt, c->self) != 1) {
898 debug("session open failed, free channel %d", c->self); 904 debug("session open failed, free channel %d", c->self);
899 channel_free(c); 905 channel_free(c);
@@ -971,7 +977,7 @@ server_input_global_request(int type, u_int32_t seq, void *ctxt)
971 pw = auth_get_user(); 977 pw = auth_get_user();
972 if (pw == NULL) 978 if (pw == NULL)
973 fatal("server_input_global_request: no user"); 979 fatal("server_input_global_request: no user");
974 listen_address = packet_get_string(NULL); /* XXX currently ignored */ 980 listen_address = packet_get_string(NULL);
975 listen_port = (u_short)packet_get_int(); 981 listen_port = (u_short)packet_get_int();
976 debug("server_input_global_request: tcpip-forward listen %s port %d", 982 debug("server_input_global_request: tcpip-forward listen %s port %d",
977 listen_address, listen_port); 983 listen_address, listen_port);
diff --git a/session.c b/session.c
index c75fea966..4497f5c0b 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.154 2003/03/05 22:33:43 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.163 2003/08/31 13:29:05 markus Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -58,10 +58,8 @@ RCSID("$OpenBSD: session.c,v 1.154 2003/03/05 22:33:43 markus Exp $");
58#include "session.h" 58#include "session.h"
59#include "monitor_wrap.h" 59#include "monitor_wrap.h"
60 60
61#ifdef HAVE_CYGWIN 61#ifdef GSSAPI
62#include <windows.h> 62#include "ssh-gss.h"
63#include <sys/cygwin.h>
64#define is_winnt (GetVersion() < 0x80000000)
65#endif 63#endif
66 64
67/* func */ 65/* func */
@@ -95,6 +93,7 @@ extern int debug_flag;
95extern u_int utmp_len; 93extern u_int utmp_len;
96extern int startup_pipe; 94extern int startup_pipe;
97extern void destroy_sensitive_data(void); 95extern void destroy_sensitive_data(void);
96extern Buffer loginmsg;
98 97
99/* original command from peer. */ 98/* original command from peer. */
100const char *original_command = NULL; 99const char *original_command = NULL;
@@ -103,10 +102,6 @@ const char *original_command = NULL;
103#define MAX_SESSIONS 10 102#define MAX_SESSIONS 10
104Session sessions[MAX_SESSIONS]; 103Session sessions[MAX_SESSIONS];
105 104
106#ifdef WITH_AIXAUTHENTICATE
107char *aixloginmsg;
108#endif /* WITH_AIXAUTHENTICATE */
109
110#ifdef HAVE_LOGIN_CAP 105#ifdef HAVE_LOGIN_CAP
111login_cap_t *lc; 106login_cap_t *lc;
112#endif 107#endif
@@ -192,7 +187,7 @@ auth_input_request_forwarding(struct passwd * pw)
192 nc = channel_new("auth socket", 187 nc = channel_new("auth socket",
193 SSH_CHANNEL_AUTH_SOCKET, sock, sock, -1, 188 SSH_CHANNEL_AUTH_SOCKET, sock, sock, -1,
194 CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT, 189 CHAN_X11_WINDOW_DEFAULT, CHAN_X11_PACKET_DEFAULT,
195 0, xstrdup("auth socket"), 1); 190 0, "auth socket", 1);
196 strlcpy(nc->path, auth_sock_name, sizeof(nc->path)); 191 strlcpy(nc->path, auth_sock_name, sizeof(nc->path));
197 return 1; 192 return 1;
198} 193}
@@ -225,10 +220,6 @@ do_authenticated(Authctxt *authctxt)
225 /* remove agent socket */ 220 /* remove agent socket */
226 if (auth_sock_name != NULL) 221 if (auth_sock_name != NULL)
227 auth_sock_cleanup_proc(authctxt->pw); 222 auth_sock_cleanup_proc(authctxt->pw);
228#ifdef KRB4
229 if (options.kerberos_ticket_cleanup)
230 krb4_cleanup_proc(authctxt);
231#endif
232#ifdef KRB5 223#ifdef KRB5
233 if (options.kerberos_ticket_cleanup) 224 if (options.kerberos_ticket_cleanup)
234 krb5_cleanup_proc(authctxt); 225 krb5_cleanup_proc(authctxt);
@@ -341,58 +332,6 @@ do_authenticated1(Authctxt *authctxt)
341 success = 1; 332 success = 1;
342 break; 333 break;
343 334
344#if defined(AFS) || defined(KRB5)
345 case SSH_CMSG_HAVE_KERBEROS_TGT:
346 if (!options.kerberos_tgt_passing) {
347 verbose("Kerberos TGT passing disabled.");
348 } else {
349 char *kdata = packet_get_string(&dlen);
350 packet_check_eom();
351
352 /* XXX - 0x41, see creds_to_radix version */
353 if (kdata[0] != 0x41) {
354#ifdef KRB5
355 krb5_data tgt;
356 tgt.data = kdata;
357 tgt.length = dlen;
358
359 if (auth_krb5_tgt(s->authctxt, &tgt))
360 success = 1;
361 else
362 verbose("Kerberos v5 TGT refused for %.100s", s->authctxt->user);
363#endif /* KRB5 */
364 } else {
365#ifdef AFS
366 if (auth_krb4_tgt(s->authctxt, kdata))
367 success = 1;
368 else
369 verbose("Kerberos v4 TGT refused for %.100s", s->authctxt->user);
370#endif /* AFS */
371 }
372 xfree(kdata);
373 }
374 break;
375#endif /* AFS || KRB5 */
376
377#ifdef AFS
378 case SSH_CMSG_HAVE_AFS_TOKEN:
379 if (!options.afs_token_passing || !k_hasafs()) {
380 verbose("AFS token passing disabled.");
381 } else {
382 /* Accept AFS token. */
383 char *token = packet_get_string(&dlen);
384 packet_check_eom();
385
386 if (auth_afs_token(s->authctxt, token))
387 success = 1;
388 else
389 verbose("AFS token refused for %.100s",
390 s->authctxt->user);
391 xfree(token);
392 }
393 break;
394#endif /* AFS */
395
396 case SSH_CMSG_EXEC_SHELL: 335 case SSH_CMSG_EXEC_SHELL:
397 case SSH_CMSG_EXEC_CMD: 336 case SSH_CMSG_EXEC_CMD:
398 if (type == SSH_CMSG_EXEC_CMD) { 337 if (type == SSH_CMSG_EXEC_CMD) {
@@ -412,7 +351,7 @@ do_authenticated1(Authctxt *authctxt)
412 * Any unknown messages in this phase are ignored, 351 * Any unknown messages in this phase are ignored,
413 * and a failure message is returned. 352 * and a failure message is returned.
414 */ 353 */
415 log("Unknown packet type received after authentication: %d", type); 354 logit("Unknown packet type received after authentication: %d", type);
416 } 355 }
417 packet_start(success ? SSH_SMSG_SUCCESS : SSH_SMSG_FAILURE); 356 packet_start(success ? SSH_SMSG_SUCCESS : SSH_SMSG_FAILURE);
418 packet_send(); 357 packet_send();
@@ -456,11 +395,12 @@ do_exec_no_pty(Session *s, const char *command)
456 session_proctitle(s); 395 session_proctitle(s);
457 396
458#if defined(USE_PAM) 397#if defined(USE_PAM)
459 do_pam_session(s->pw->pw_name, NULL); 398 if (options.use_pam) {
460 do_pam_setcred(1); 399 do_pam_setcred(1);
461 if (is_pam_password_change_required()) 400 if (is_pam_password_change_required())
462 packet_disconnect("Password change required but no " 401 packet_disconnect("Password change required but no "
463 "TTY available"); 402 "TTY available");
403 }
464#endif /* USE_PAM */ 404#endif /* USE_PAM */
465 405
466 /* Fork the child. */ 406 /* Fork the child. */
@@ -583,8 +523,10 @@ do_exec_pty(Session *s, const char *command)
583 ttyfd = s->ttyfd; 523 ttyfd = s->ttyfd;
584 524
585#if defined(USE_PAM) 525#if defined(USE_PAM)
586 do_pam_session(s->pw->pw_name, s->tty); 526 if (options.use_pam) {
587 do_pam_setcred(1); 527 do_pam_set_tty(s->tty);
528 do_pam_setcred(1);
529 }
588#endif 530#endif
589 531
590 /* Fork the child. */ 532 /* Fork the child. */
@@ -690,7 +632,7 @@ do_pre_login(Session *s)
690 } 632 }
691 633
692 record_utmp_only(pid, s->tty, s->pw->pw_name, 634 record_utmp_only(pid, s->tty, s->pw->pw_name,
693 get_remote_name_or_ip(utmp_len, options.verify_reverse_mapping), 635 get_remote_name_or_ip(utmp_len, options.use_dns),
694 (struct sockaddr *)&from, fromlen); 636 (struct sockaddr *)&from, fromlen);
695} 637}
696#endif 638#endif
@@ -708,6 +650,14 @@ do_exec(Session *s, const char *command)
708 debug("Forced command '%.900s'", command); 650 debug("Forced command '%.900s'", command);
709 } 651 }
710 652
653#ifdef GSSAPI
654 if (options.gss_authentication) {
655 temporarily_use_uid(s->pw);
656 ssh_gssapi_storecreds();
657 restore_uid();
658 }
659#endif
660
711 if (s->ttyfd != -1) 661 if (s->ttyfd != -1)
712 do_exec_pty(s, command); 662 do_exec_pty(s, command);
713 else 663 else
@@ -745,7 +695,7 @@ do_login(Session *s, const char *command)
745 if (!use_privsep) 695 if (!use_privsep)
746 record_login(pid, s->tty, pw->pw_name, pw->pw_uid, 696 record_login(pid, s->tty, pw->pw_name, pw->pw_uid,
747 get_remote_name_or_ip(utmp_len, 697 get_remote_name_or_ip(utmp_len,
748 options.verify_reverse_mapping), 698 options.use_dns),
749 (struct sockaddr *)&from, fromlen); 699 (struct sockaddr *)&from, fromlen);
750 700
751#ifdef USE_PAM 701#ifdef USE_PAM
@@ -753,9 +703,10 @@ do_login(Session *s, const char *command)
753 * If password change is needed, do it now. 703 * If password change is needed, do it now.
754 * This needs to occur before the ~/.hushlogin check. 704 * This needs to occur before the ~/.hushlogin check.
755 */ 705 */
756 if (is_pam_password_change_required()) { 706 if (options.use_pam && is_pam_password_change_required()) {
757 print_pam_messages(); 707 print_pam_messages();
758 do_pam_chauthtok(); 708 do_pam_chauthtok();
709 /* XXX - signal [net] parent to enable forwardings */
759 } 710 }
760#endif 711#endif
761 712
@@ -763,13 +714,16 @@ do_login(Session *s, const char *command)
763 return; 714 return;
764 715
765#ifdef USE_PAM 716#ifdef USE_PAM
766 if (!is_pam_password_change_required()) 717 if (options.use_pam && !is_pam_password_change_required())
767 print_pam_messages(); 718 print_pam_messages();
768#endif /* USE_PAM */ 719#endif /* USE_PAM */
769#ifdef WITH_AIXAUTHENTICATE 720
770 if (aixloginmsg && *aixloginmsg) 721 /* display post-login message */
771 printf("%s\n", aixloginmsg); 722 if (buffer_len(&loginmsg) > 0) {
772#endif /* WITH_AIXAUTHENTICATE */ 723 buffer_append(&loginmsg, "\0", 1);
724 printf("%s\n", (char *)buffer_ptr(&loginmsg));
725 }
726 buffer_free(&loginmsg);
773 727
774#ifndef NO_SSH_LASTLOG 728#ifndef NO_SSH_LASTLOG
775 if (options.print_lastlog && s->last_login_time != 0) { 729 if (options.print_lastlog && s->last_login_time != 0) {
@@ -840,7 +794,7 @@ check_quietlogin(Session *s, const char *command)
840 * Sets the value of the given variable in the environment. If the variable 794 * Sets the value of the given variable in the environment. If the variable
841 * already exists, its value is overriden. 795 * already exists, its value is overriden.
842 */ 796 */
843static void 797void
844child_set_env(char ***envp, u_int *envsizep, const char *name, 798child_set_env(char ***envp, u_int *envsizep, const char *name,
845 const char *value) 799 const char *value)
846{ 800{
@@ -848,6 +802,16 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
848 char **env; 802 char **env;
849 803
850 /* 804 /*
805 * If we're passed an uninitialized list, allocate a single null
806 * entry before continuing.
807 */
808 if (*envp == NULL && *envsizep == 0) {
809 *envp = xmalloc(sizeof(char *));
810 *envp[0] = NULL;
811 *envsizep = 1;
812 }
813
814 /*
851 * Find the slot where the value should be stored. If the variable 815 * Find the slot where the value should be stored. If the variable
852 * already exists, we reuse the slot; otherwise we append a new slot 816 * already exists, we reuse the slot; otherwise we append a new slot
853 * at the end of the array, expanding if necessary. 817 * at the end of the array, expanding if necessary.
@@ -923,6 +887,59 @@ read_environment_file(char ***env, u_int *envsize,
923 fclose(f); 887 fclose(f);
924} 888}
925 889
890#ifdef HAVE_ETC_DEFAULT_LOGIN
891/*
892 * Return named variable from specified environment, or NULL if not present.
893 */
894static char *
895child_get_env(char **env, const char *name)
896{
897 int i;
898 size_t len;
899
900 len = strlen(name);
901 for (i=0; env[i] != NULL; i++)
902 if (strncmp(name, env[i], len) == 0 && env[i][len] == '=')
903 return(env[i] + len + 1);
904 return NULL;
905}
906
907/*
908 * Read /etc/default/login.
909 * We pick up the PATH (or SUPATH for root) and UMASK.
910 */
911static void
912read_etc_default_login(char ***env, u_int *envsize, uid_t uid)
913{
914 char **tmpenv = NULL, *var;
915 u_int i;
916 size_t tmpenvsize = 0;
917 mode_t mask;
918
919 /*
920 * We don't want to copy the whole file to the child's environment,
921 * so we use a temporary environment and copy the variables we're
922 * interested in.
923 */
924 read_environment_file(&tmpenv, &tmpenvsize, "/etc/default/login");
925
926 if (uid == 0)
927 var = child_get_env(tmpenv, "SUPATH");
928 else
929 var = child_get_env(tmpenv, "PATH");
930 if (var != NULL)
931 child_set_env(env, envsize, "PATH", var);
932
933 if ((var = child_get_env(tmpenv, "UMASK")) != NULL)
934 if (sscanf(var, "%5lo", &mask) == 1)
935 umask(mask);
936
937 for (i = 0; tmpenv[i] != NULL; i++)
938 xfree(tmpenv[i]);
939 xfree(tmpenv);
940}
941#endif /* HAVE_ETC_DEFAULT_LOGIN */
942
926void copy_environment(char **source, char ***env, u_int *envsize) 943void copy_environment(char **source, char ***env, u_int *envsize)
927{ 944{
928 char *var_name, *var_val; 945 char *var_name, *var_val;
@@ -951,7 +968,7 @@ do_setup_env(Session *s, const char *shell)
951{ 968{
952 char buf[256]; 969 char buf[256];
953 u_int i, envsize; 970 u_int i, envsize;
954 char **env, *laddr; 971 char **env, *laddr, *path = NULL;
955 struct passwd *pw = s->pw; 972 struct passwd *pw = s->pw;
956 973
957 /* Initialize the environment. */ 974 /* Initialize the environment. */
@@ -967,6 +984,13 @@ do_setup_env(Session *s, const char *shell)
967 copy_environment(environ, &env, &envsize); 984 copy_environment(environ, &env, &envsize);
968#endif 985#endif
969 986
987#ifdef GSSAPI
988 /* Allow any GSSAPI methods that we've used to alter
989 * the childs environment as they see fit
990 */
991 ssh_gssapi_do_child(&env, &envsize);
992#endif
993
970 if (!options.use_login) { 994 if (!options.use_login) {
971 /* Set basic environment. */ 995 /* Set basic environment. */
972 child_set_env(&env, &envsize, "USER", pw->pw_name); 996 child_set_env(&env, &envsize, "USER", pw->pw_name);
@@ -988,12 +1012,15 @@ do_setup_env(Session *s, const char *shell)
988 * needed for loading shared libraries. So the path better 1012 * needed for loading shared libraries. So the path better
989 * remains intact here. 1013 * remains intact here.
990 */ 1014 */
991# ifdef SUPERUSER_PATH 1015# ifdef HAVE_ETC_DEFAULT_LOGIN
992 child_set_env(&env, &envsize, "PATH", 1016 read_etc_default_login(&env, &envsize, pw->pw_uid);
993 s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH); 1017 path = child_get_env(env, "PATH");
994# else 1018# endif /* HAVE_ETC_DEFAULT_LOGIN */
995 child_set_env(&env, &envsize, "PATH", _PATH_STDPATH); 1019 if (path == NULL || *path == '\0') {
996# endif /* SUPERUSER_PATH */ 1020 child_set_env(&env, &envsize, "PATH",
1021 s->pw->pw_uid == 0 ?
1022 SUPERUSER_PATH : _PATH_STDPATH);
1023 }
997# endif /* HAVE_CYGWIN */ 1024# endif /* HAVE_CYGWIN */
998#endif /* HAVE_LOGIN_CAP */ 1025#endif /* HAVE_LOGIN_CAP */
999 1026
@@ -1062,11 +1089,6 @@ do_setup_env(Session *s, const char *shell)
1062 read_environment_file(&env, &envsize, "/etc/environment"); 1089 read_environment_file(&env, &envsize, "/etc/environment");
1063 } 1090 }
1064#endif 1091#endif
1065#ifdef KRB4
1066 if (s->authctxt->krb4_ticket_file)
1067 child_set_env(&env, &envsize, "KRBTKFILE",
1068 s->authctxt->krb4_ticket_file);
1069#endif
1070#ifdef KRB5 1092#ifdef KRB5
1071 if (s->authctxt->krb5_ticket_file) 1093 if (s->authctxt->krb5_ticket_file)
1072 child_set_env(&env, &envsize, "KRB5CCNAME", 1094 child_set_env(&env, &envsize, "KRB5CCNAME",
@@ -1077,10 +1099,9 @@ do_setup_env(Session *s, const char *shell)
1077 * Pull in any environment variables that may have 1099 * Pull in any environment variables that may have
1078 * been set by PAM. 1100 * been set by PAM.
1079 */ 1101 */
1080 { 1102 if (options.use_pam) {
1081 char **p; 1103 char **p = fetch_pam_environment();
1082 1104
1083 p = fetch_pam_environment();
1084 copy_environment(p, &env, &envsize); 1105 copy_environment(p, &env, &envsize);
1085 free_pam_environment(p); 1106 free_pam_environment(p);
1086 } 1107 }
@@ -1192,7 +1213,7 @@ do_nologin(struct passwd *pw)
1192#endif 1213#endif
1193 if (f) { 1214 if (f) {
1194 /* /etc/nologin exists. Print its contents and exit. */ 1215 /* /etc/nologin exists. Print its contents and exit. */
1195 log("User %.100s not allowed because %s exists", 1216 logit("User %.100s not allowed because %s exists",
1196 pw->pw_name, _PATH_NOLOGIN); 1217 pw->pw_name, _PATH_NOLOGIN);
1197 while (fgets(buf, sizeof(buf), f)) 1218 while (fgets(buf, sizeof(buf), f))
1198 fputs(buf, stderr); 1219 fputs(buf, stderr);
@@ -1212,7 +1233,8 @@ do_setusercontext(struct passwd *pw)
1212 { 1233 {
1213 1234
1214#ifdef HAVE_SETPCRED 1235#ifdef HAVE_SETPCRED
1215 setpcred(pw->pw_name); 1236 if (setpcred(pw->pw_name, (char **)NULL) == -1)
1237 fatal("Failed to set process credentials");
1216#endif /* HAVE_SETPCRED */ 1238#endif /* HAVE_SETPCRED */
1217#ifdef HAVE_LOGIN_CAP 1239#ifdef HAVE_LOGIN_CAP
1218# ifdef __bsdi__ 1240# ifdef __bsdi__
@@ -1248,7 +1270,10 @@ do_setusercontext(struct passwd *pw)
1248 * These will have been wiped by the above initgroups() call. 1270 * These will have been wiped by the above initgroups() call.
1249 * Reestablish them here. 1271 * Reestablish them here.
1250 */ 1272 */
1251 do_pam_setcred(0); 1273 if (options.use_pam) {
1274 do_pam_session();
1275 do_pam_setcred(0);
1276 }
1252# endif /* USE_PAM */ 1277# endif /* USE_PAM */
1253# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) 1278# if defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY)
1254 irix_setusercontext(pw); 1279 irix_setusercontext(pw);
@@ -1349,7 +1374,7 @@ do_child(Session *s, const char *command)
1349 /* we have to stash the hostname before we close our socket. */ 1374 /* we have to stash the hostname before we close our socket. */
1350 if (options.use_login) 1375 if (options.use_login)
1351 hostname = get_remote_name_or_ip(utmp_len, 1376 hostname = get_remote_name_or_ip(utmp_len,
1352 options.verify_reverse_mapping); 1377 options.use_dns);
1353 /* 1378 /*
1354 * Close the connection descriptors; note that this is the child, and 1379 * Close the connection descriptors; note that this is the child, and
1355 * the server will still have the socket open, and it is important 1380 * the server will still have the socket open, and it is important
@@ -1391,18 +1416,6 @@ do_child(Session *s, const char *command)
1391 */ 1416 */
1392 environ = env; 1417 environ = env;
1393 1418
1394#ifdef AFS
1395 /* Try to get AFS tokens for the local cell. */
1396 if (k_hasafs()) {
1397 char cell[64];
1398
1399 if (k_afs_cell_of_file(pw->pw_dir, cell, sizeof(cell)) == 0)
1400 krb_afslog(cell, 0);
1401
1402 krb_afslog(0, 0);
1403 }
1404#endif /* AFS */
1405
1406 /* Change current directory to the user\'s home directory. */ 1419 /* Change current directory to the user\'s home directory. */
1407 if (chdir(pw->pw_dir) < 0) { 1420 if (chdir(pw->pw_dir) < 0) {
1408 fprintf(stderr, "Could not chdir to home directory %s: %s\n", 1421 fprintf(stderr, "Could not chdir to home directory %s: %s\n",
@@ -1672,7 +1685,7 @@ session_subsystem_req(Session *s)
1672 int i; 1685 int i;
1673 1686
1674 packet_check_eom(); 1687 packet_check_eom();
1675 log("subsystem request for %.100s", subsys); 1688 logit("subsystem request for %.100s", subsys);
1676 1689
1677 for (i = 0; i < options.num_subsystems; i++) { 1690 for (i = 0; i < options.num_subsystems; i++) {
1678 if (strcmp(subsys, options.subsystem_name[i]) == 0) { 1691 if (strcmp(subsys, options.subsystem_name[i]) == 0) {
@@ -1691,7 +1704,7 @@ session_subsystem_req(Session *s)
1691 } 1704 }
1692 1705
1693 if (!success) 1706 if (!success)
1694 log("subsystem request for %.100s failed, subsystem not found", 1707 logit("subsystem request for %.100s failed, subsystem not found",
1695 subsys); 1708 subsys);
1696 1709
1697 xfree(subsys); 1710 xfree(subsys);
@@ -1739,6 +1752,20 @@ session_exec_req(Session *s)
1739} 1752}
1740 1753
1741static int 1754static int
1755session_break_req(Session *s)
1756{
1757 u_int break_length;
1758
1759 break_length = packet_get_int(); /* ignored */
1760 packet_check_eom();
1761
1762 if (s->ttyfd == -1 ||
1763 tcsendbreak(s->ttyfd, 0) < 0)
1764 return 0;
1765 return 1;
1766}
1767
1768static int
1742session_auth_agent_req(Session *s) 1769session_auth_agent_req(Session *s)
1743{ 1770{
1744 static int called = 0; 1771 static int called = 0;
@@ -1762,7 +1789,7 @@ session_input_channel_req(Channel *c, const char *rtype)
1762 Session *s; 1789 Session *s;
1763 1790
1764 if ((s = session_by_channel(c->self)) == NULL) { 1791 if ((s = session_by_channel(c->self)) == NULL) {
1765 log("session_input_channel_req: no session %d req %.100s", 1792 logit("session_input_channel_req: no session %d req %.100s",
1766 c->self, rtype); 1793 c->self, rtype);
1767 return 0; 1794 return 0;
1768 } 1795 }
@@ -1785,6 +1812,8 @@ session_input_channel_req(Channel *c, const char *rtype)
1785 success = session_auth_agent_req(s); 1812 success = session_auth_agent_req(s);
1786 } else if (strcmp(rtype, "subsystem") == 0) { 1813 } else if (strcmp(rtype, "subsystem") == 0) {
1787 success = session_subsystem_req(s); 1814 success = session_subsystem_req(s);
1815 } else if (strcmp(rtype, "break") == 0) {
1816 success = session_break_req(s);
1788 } 1817 }
1789 } 1818 }
1790 if (strcmp(rtype, "window-change") == 0) { 1819 if (strcmp(rtype, "window-change") == 0) {
@@ -2121,4 +2150,8 @@ static void
2121do_authenticated2(Authctxt *authctxt) 2150do_authenticated2(Authctxt *authctxt)
2122{ 2151{
2123 server_loop2(authctxt); 2152 server_loop2(authctxt);
2153#if defined(GSSAPI)
2154 if (options.gss_cleanup_creds)
2155 ssh_gssapi_cleanup_creds(NULL);
2156#endif
2124} 2157}
diff --git a/session.h b/session.h
index d3ddfab75..525e47f64 100644
--- a/session.h
+++ b/session.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.h,v 1.19 2002/06/30 21:59:45 deraadt Exp $ */ 1/* $OpenBSD: session.h,v 1.20 2003/08/22 10:56:09 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -68,4 +68,7 @@ Session *session_new(void);
68Session *session_by_tty(char *); 68Session *session_by_tty(char *);
69void session_close(Session *); 69void session_close(Session *);
70void do_setusercontext(struct passwd *); 70void do_setusercontext(struct passwd *);
71void child_set_env(char ***envp, u_int *envsizep, const char *name,
72 const char *value);
73
71#endif 74#endif
diff --git a/sftp-client.c b/sftp-client.c
index 3b3279e65..ffff0fe5a 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -28,7 +28,7 @@
28/* XXX: copy between two remote sites */ 28/* XXX: copy between two remote sites */
29 29
30#include "includes.h" 30#include "includes.h"
31RCSID("$OpenBSD: sftp-client.c,v 1.42 2003/03/05 22:33:43 markus Exp $"); 31RCSID("$OpenBSD: sftp-client.c,v 1.44 2003/06/28 16:23:06 deraadt Exp $");
32 32
33#include "openbsd-compat/sys-queue.h" 33#include "openbsd-compat/sys-queue.h"
34 34
@@ -71,10 +71,10 @@ send_msg(int fd, Buffer *m)
71 71
72 /* Send length first */ 72 /* Send length first */
73 PUT_32BIT(mlen, buffer_len(m)); 73 PUT_32BIT(mlen, buffer_len(m));
74 if (atomicio(write, fd, mlen, sizeof(mlen)) <= 0) 74 if (atomicio(vwrite, fd, mlen, sizeof(mlen)) <= 0)
75 fatal("Couldn't send packet: %s", strerror(errno)); 75 fatal("Couldn't send packet: %s", strerror(errno));
76 76
77 if (atomicio(write, fd, buffer_ptr(m), buffer_len(m)) <= 0) 77 if (atomicio(vwrite, fd, buffer_ptr(m), buffer_len(m)) <= 0)
78 fatal("Couldn't send packet: %s", strerror(errno)); 78 fatal("Couldn't send packet: %s", strerror(errno));
79 79
80 buffer_clear(m); 80 buffer_clear(m);
@@ -507,7 +507,7 @@ do_lstat(struct sftp_conn *conn, char *path, int quiet)
507 if (quiet) 507 if (quiet)
508 debug("Server version does not support lstat operation"); 508 debug("Server version does not support lstat operation");
509 else 509 else
510 log("Server version does not support lstat operation"); 510 logit("Server version does not support lstat operation");
511 return(do_stat(conn, path, quiet)); 511 return(do_stat(conn, path, quiet));
512 } 512 }
513 513
@@ -875,7 +875,7 @@ do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
875 fatal("Received more data than asked for " 875 fatal("Received more data than asked for "
876 "%u > %u", len, req->len); 876 "%u > %u", len, req->len);
877 if ((lseek(local_fd, req->offset, SEEK_SET) == -1 || 877 if ((lseek(local_fd, req->offset, SEEK_SET) == -1 ||
878 atomicio(write, local_fd, data, len) != len) && 878 atomicio(vwrite, local_fd, data, len) != len) &&
879 !write_error) { 879 !write_error) {
880 write_errno = errno; 880 write_errno = errno;
881 write_error = 1; 881 write_error = 1;
diff --git a/sftp-common.c b/sftp-common.c
index 31d41385b..5313b134d 100644
--- a/sftp-common.c
+++ b/sftp-common.c
@@ -24,7 +24,7 @@
24 */ 24 */
25 25
26#include "includes.h" 26#include "includes.h"
27RCSID("$OpenBSD: sftp-common.c,v 1.8 2002/10/16 14:31:48 itojun Exp $"); 27RCSID("$OpenBSD: sftp-common.c,v 1.9 2003/05/24 09:30:40 djm Exp $");
28 28
29#include "buffer.h" 29#include "buffer.h"
30#include "bufaux.h" 30#include "bufaux.h"
@@ -206,8 +206,8 @@ ls_file(char *name, struct stat *st, int remote)
206 tbuf[0] = '\0'; 206 tbuf[0] = '\0';
207 ulen = MAX(strlen(user), 8); 207 ulen = MAX(strlen(user), 8);
208 glen = MAX(strlen(group), 8); 208 glen = MAX(strlen(group), 8);
209 snprintf(buf, sizeof buf, "%s %3d %-*s %-*s %8llu %s %s", mode, 209 snprintf(buf, sizeof buf, "%s %3u %-*s %-*s %8llu %s %s", mode,
210 st->st_nlink, ulen, user, glen, group, 210 (u_int)st->st_nlink, ulen, user, glen, group,
211 (unsigned long long)st->st_size, tbuf, name); 211 (unsigned long long)st->st_size, tbuf, name);
212 return xstrdup(buf); 212 return xstrdup(buf);
213} 213}
diff --git a/sftp-int.c b/sftp-int.c
index 6987de9a3..94299aa43 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -25,7 +25,7 @@
25/* XXX: recursive operations */ 25/* XXX: recursive operations */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: sftp-int.c,v 1.57 2003/03/05 22:33:43 markus Exp $"); 28RCSID("$OpenBSD: sftp-int.c,v 1.62 2003/08/25 08:13:09 fgsch Exp $");
29 29
30#include "buffer.h" 30#include "buffer.h"
31#include "xmalloc.h" 31#include "xmalloc.h"
@@ -53,6 +53,10 @@ int showprogress = 1;
53/* Seperators for interactive commands */ 53/* Seperators for interactive commands */
54#define WHITESPACE " \t\r\n" 54#define WHITESPACE " \t\r\n"
55 55
56/* Define what type of ls view (0 - multi-column) */
57#define LONG_VIEW 1 /* Full view ala ls -l */
58#define SHORT_VIEW 2 /* Single row view ala ls -1 */
59
56/* Commands for interactive mode */ 60/* Commands for interactive mode */
57#define I_CHDIR 1 61#define I_CHDIR 1
58#define I_CHGRP 2 62#define I_CHGRP 2
@@ -307,7 +311,10 @@ parse_ls_flags(const char **cpp, int *lflag)
307 for(; strchr(WHITESPACE, *cp) == NULL; cp++) { 311 for(; strchr(WHITESPACE, *cp) == NULL; cp++) {
308 switch (*cp) { 312 switch (*cp) {
309 case 'l': 313 case 'l':
310 *lflag = 1; 314 *lflag = LONG_VIEW;
315 break;
316 case '1':
317 *lflag = SHORT_VIEW;
311 break; 318 break;
312 default: 319 default:
313 error("Invalid flag -%c", *cp); 320 error("Invalid flag -%c", *cp);
@@ -325,7 +332,7 @@ get_pathname(const char **cpp, char **path)
325{ 332{
326 const char *cp = *cpp, *end; 333 const char *cp = *cpp, *end;
327 char quot; 334 char quot;
328 int i; 335 int i, j;
329 336
330 cp += strspn(cp, WHITESPACE); 337 cp += strspn(cp, WHITESPACE);
331 if (!*cp) { 338 if (!*cp) {
@@ -334,37 +341,54 @@ get_pathname(const char **cpp, char **path)
334 return (0); 341 return (0);
335 } 342 }
336 343
344 *path = xmalloc(strlen(cp) + 1);
345
337 /* Check for quoted filenames */ 346 /* Check for quoted filenames */
338 if (*cp == '\"' || *cp == '\'') { 347 if (*cp == '\"' || *cp == '\'') {
339 quot = *cp++; 348 quot = *cp++;
340 349
341 end = strchr(cp, quot); 350 /* Search for terminating quote, unescape some chars */
342 if (end == NULL) { 351 for (i = j = 0; i <= strlen(cp); i++) {
343 error("Unterminated quote"); 352 if (cp[i] == quot) { /* Found quote */
344 goto fail; 353 (*path)[j] = '\0';
354 break;
355 }
356 if (cp[i] == '\0') { /* End of string */
357 error("Unterminated quote");
358 goto fail;
359 }
360 if (cp[i] == '\\') { /* Escaped characters */
361 i++;
362 if (cp[i] != '\'' && cp[i] != '\"' &&
363 cp[i] != '\\') {
364 error("Bad escaped character '\%c'",
365 cp[i]);
366 goto fail;
367 }
368 }
369 (*path)[j++] = cp[i];
345 } 370 }
346 if (cp == end) { 371
372 if (j == 0) {
347 error("Empty quotes"); 373 error("Empty quotes");
348 goto fail; 374 goto fail;
349 } 375 }
350 *cpp = end + 1 + strspn(end + 1, WHITESPACE); 376 *cpp = cp + i + strspn(cp + i, WHITESPACE);
351 } else { 377 } else {
352 /* Read to end of filename */ 378 /* Read to end of filename */
353 end = strpbrk(cp, WHITESPACE); 379 end = strpbrk(cp, WHITESPACE);
354 if (end == NULL) 380 if (end == NULL)
355 end = strchr(cp, '\0'); 381 end = strchr(cp, '\0');
356 *cpp = end + strspn(end, WHITESPACE); 382 *cpp = end + strspn(end, WHITESPACE);
357 }
358 383
359 i = end - cp; 384 memcpy(*path, cp, end - cp);
360 385 (*path)[end - cp] = '\0';
361 *path = xmalloc(i + 1); 386 }
362 memcpy(*path, cp, i); 387 return (0);
363 (*path)[i] = '\0';
364 return(0);
365 388
366 fail: 389 fail:
367 *path = NULL; 390 xfree(*path);
391 *path = NULL;
368 return (-1); 392 return (-1);
369} 393}
370 394
@@ -425,29 +449,8 @@ process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd, int pflag)
425 goto out; 449 goto out;
426 } 450 }
427 451
428 /* Only one match, dst may be file, directory or unspecified */ 452 /* If multiple matches, dst must be a directory or unspecified */
429 if (g.gl_pathv[0] && g.gl_matchc == 1) { 453 if (g.gl_matchc > 1 && dst && !is_dir(dst)) {
430 if (dst) {
431 /* If directory specified, append filename */
432 if (is_dir(dst)) {
433 if (infer_path(g.gl_pathv[0], &tmp)) {
434 err = 1;
435 goto out;
436 }
437 abs_dst = path_append(dst, tmp);
438 xfree(tmp);
439 } else
440 abs_dst = xstrdup(dst);
441 } else if (infer_path(g.gl_pathv[0], &abs_dst)) {
442 err = -1;
443 goto out;
444 }
445 err = do_download(conn, g.gl_pathv[0], abs_dst, pflag);
446 goto out;
447 }
448
449 /* Multiple matches, dst may be directory or unspecified */
450 if (dst && !is_dir(dst)) {
451 error("Multiple files match, but \"%s\" is not a directory", 454 error("Multiple files match, but \"%s\" is not a directory",
452 dst); 455 dst);
453 err = -1; 456 err = -1;
@@ -459,7 +462,19 @@ process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd, int pflag)
459 err = -1; 462 err = -1;
460 goto out; 463 goto out;
461 } 464 }
462 if (dst) { 465
466 if (g.gl_matchc == 1 && dst) {
467 /* If directory specified, append filename */
468 if (is_dir(dst)) {
469 if (infer_path(g.gl_pathv[0], &tmp)) {
470 err = 1;
471 goto out;
472 }
473 abs_dst = path_append(dst, tmp);
474 xfree(tmp);
475 } else
476 abs_dst = xstrdup(dst);
477 } else if (dst) {
463 abs_dst = path_append(dst, tmp); 478 abs_dst = path_append(dst, tmp);
464 xfree(tmp); 479 xfree(tmp);
465 } else 480 } else
@@ -503,38 +518,8 @@ process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd, int pflag)
503 goto out; 518 goto out;
504 } 519 }
505 520
506 /* Only one match, dst may be file, directory or unspecified */ 521 /* If multiple matches, dst may be directory or unspecified */
507 if (g.gl_pathv[0] && g.gl_matchc == 1) { 522 if (g.gl_matchc > 1 && tmp_dst && !remote_is_dir(conn, tmp_dst)) {
508 if (!is_reg(g.gl_pathv[0])) {
509 error("Can't upload %s: not a regular file",
510 g.gl_pathv[0]);
511 err = 1;
512 goto out;
513 }
514 if (tmp_dst) {
515 /* If directory specified, append filename */
516 if (remote_is_dir(conn, tmp_dst)) {
517 if (infer_path(g.gl_pathv[0], &tmp)) {
518 err = 1;
519 goto out;
520 }
521 abs_dst = path_append(tmp_dst, tmp);
522 xfree(tmp);
523 } else
524 abs_dst = xstrdup(tmp_dst);
525 } else {
526 if (infer_path(g.gl_pathv[0], &abs_dst)) {
527 err = -1;
528 goto out;
529 }
530 abs_dst = make_absolute(abs_dst, pwd);
531 }
532 err = do_upload(conn, g.gl_pathv[0], abs_dst, pflag);
533 goto out;
534 }
535
536 /* Multiple matches, dst may be directory or unspecified */
537 if (tmp_dst && !remote_is_dir(conn, tmp_dst)) {
538 error("Multiple files match, but \"%s\" is not a directory", 523 error("Multiple files match, but \"%s\" is not a directory",
539 tmp_dst); 524 tmp_dst);
540 err = -1; 525 err = -1;
@@ -551,7 +536,20 @@ process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd, int pflag)
551 err = -1; 536 err = -1;
552 goto out; 537 goto out;
553 } 538 }
554 if (tmp_dst) { 539
540 if (g.gl_matchc == 1 && tmp_dst) {
541 /* If directory specified, append filename */
542 if (remote_is_dir(conn, tmp_dst)) {
543 if (infer_path(g.gl_pathv[0], &tmp)) {
544 err = 1;
545 goto out;
546 }
547 abs_dst = path_append(tmp_dst, tmp);
548 xfree(tmp);
549 } else
550 abs_dst = xstrdup(tmp_dst);
551
552 } else if (tmp_dst) {
555 abs_dst = path_append(tmp_dst, tmp); 553 abs_dst = path_append(tmp_dst, tmp);
556 xfree(tmp); 554 xfree(tmp);
557 } else 555 } else
@@ -567,6 +565,7 @@ out:
567 xfree(abs_dst); 565 xfree(abs_dst);
568 if (tmp_dst) 566 if (tmp_dst)
569 xfree(tmp_dst); 567 xfree(tmp_dst);
568 globfree(&g);
570 return(err); 569 return(err);
571} 570}
572 571
@@ -583,15 +582,27 @@ sdirent_comp(const void *aa, const void *bb)
583static int 582static int
584do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag) 583do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
585{ 584{
586 int n; 585 int n, c = 1, colspace = 0, columns = 1;
587 SFTP_DIRENT **d; 586 SFTP_DIRENT **d;
588 587
589 if ((n = do_readdir(conn, path, &d)) != 0) 588 if ((n = do_readdir(conn, path, &d)) != 0)
590 return (n); 589 return (n);
591 590
592 /* Count entries for sort */ 591 if (!(lflag & SHORT_VIEW)) {
593 for (n = 0; d[n] != NULL; n++) 592 int m = 0, width = 80;
594 ; 593 struct winsize ws;
594
595 /* Count entries for sort and find longest filename */
596 for (n = 0; d[n] != NULL; n++)
597 m = MAX(m, strlen(d[n]->filename));
598
599 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1)
600 width = ws.ws_col;
601
602 columns = width / (m + 2);
603 columns = MAX(columns, 1);
604 colspace = width / columns;
605 }
595 606
596 qsort(d, n, sizeof(*d), sdirent_comp); 607 qsort(d, n, sizeof(*d), sdirent_comp);
597 608
@@ -602,7 +613,7 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
602 fname = path_strip(tmp, strip_path); 613 fname = path_strip(tmp, strip_path);
603 xfree(tmp); 614 xfree(tmp);
604 615
605 if (lflag) { 616 if (lflag & LONG_VIEW) {
606 char *lname; 617 char *lname;
607 struct stat sb; 618 struct stat sb;
608 619
@@ -612,13 +623,20 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
612 printf("%s\n", lname); 623 printf("%s\n", lname);
613 xfree(lname); 624 xfree(lname);
614 } else { 625 } else {
615 /* XXX - multicolumn display would be nice here */ 626 printf("%-*s", colspace, fname);
616 printf("%s\n", fname); 627 if (c >= columns) {
628 printf("\n");
629 c = 1;
630 } else
631 c++;
617 } 632 }
618 633
619 xfree(fname); 634 xfree(fname);
620 } 635 }
621 636
637 if (!(lflag & LONG_VIEW) && (c != 1))
638 printf("\n");
639
622 free_sftp_dirents(d); 640 free_sftp_dirents(d);
623 return (0); 641 return (0);
624} 642}
@@ -629,9 +647,8 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
629 int lflag) 647 int lflag)
630{ 648{
631 glob_t g; 649 glob_t g;
632 int i; 650 int i, c = 1, colspace = 0, columns = 1;
633 Attrib *a; 651 Attrib *a;
634 struct stat sb;
635 652
636 memset(&g, 0, sizeof(g)); 653 memset(&g, 0, sizeof(g));
637 654
@@ -658,12 +675,31 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
658 } 675 }
659 } 676 }
660 677
678 if (!(lflag & SHORT_VIEW)) {
679 int m = 0, width = 80;
680 struct winsize ws;
681
682 /* Count entries for sort and find longest filename */
683 for (i = 0; g.gl_pathv[i]; i++)
684 m = MAX(m, strlen(g.gl_pathv[i]));
685
686 if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) != -1)
687 width = ws.ws_col;
688
689 columns = width / (m + 2);
690 columns = MAX(columns, 1);
691 colspace = width / columns;
692 }
693
661 for (i = 0; g.gl_pathv[i]; i++) { 694 for (i = 0; g.gl_pathv[i]; i++) {
662 char *fname, *lname; 695 char *fname;
663 696
664 fname = path_strip(g.gl_pathv[i], strip_path); 697 fname = path_strip(g.gl_pathv[i], strip_path);
665 698
666 if (lflag) { 699 if (lflag & LONG_VIEW) {
700 char *lname;
701 struct stat sb;
702
667 /* 703 /*
668 * XXX: this is slow - 1 roundtrip per path 704 * XXX: this is slow - 1 roundtrip per path
669 * A solution to this is to fork glob() and 705 * A solution to this is to fork glob() and
@@ -679,12 +715,19 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
679 printf("%s\n", lname); 715 printf("%s\n", lname);
680 xfree(lname); 716 xfree(lname);
681 } else { 717 } else {
682 /* XXX - multicolumn display would be nice here */ 718 printf("%-*s", colspace, fname);
683 printf("%s\n", fname); 719 if (c >= columns) {
720 printf("\n");
721 c = 1;
722 } else
723 c++;
684 } 724 }
685 xfree(fname); 725 xfree(fname);
686 } 726 }
687 727
728 if (!(lflag & LONG_VIEW) && (c != 1))
729 printf("\n");
730
688 if (g.gl_pathc) 731 if (g.gl_pathc)
689 globfree(&g); 732 globfree(&g);
690 733
diff --git a/sftp-server.0 b/sftp-server.0
index 37dcb5beb..fc57814f5 100644
--- a/sftp-server.0
+++ b/sftp-server.0
@@ -19,7 +19,7 @@ SEE ALSO
19 filexfer-00.txt, January 2001, work in progress material. 19 filexfer-00.txt, January 2001, work in progress material.
20 20
21AUTHORS 21AUTHORS
22 Markus Friedl <markus@openbsd.org> 22 Markus Friedl M-bM-^LM-)markus@openbsd.orgM-bM-^LM-*
23 23
24HISTORY 24HISTORY
25 sftp-server first appeared in OpenBSD 2.8 . 25 sftp-server first appeared in OpenBSD 2.8 .
diff --git a/sftp-server.8 b/sftp-server.8
index 0a0210a34..871f83796 100644
--- a/sftp-server.8
+++ b/sftp-server.8
@@ -1,4 +1,4 @@
1.\" $OpenBSD: sftp-server.8,v 1.8 2001/06/23 05:57:08 deraadt Exp $ 1.\" $OpenBSD: sftp-server.8,v 1.9 2003/06/10 09:12:11 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2000 Markus Friedl. All rights reserved. 3.\" Copyright (c) 2000 Markus Friedl. All rights reserved.
4.\" 4.\"
@@ -56,7 +56,7 @@ for more information.
56.%O work in progress material 56.%O work in progress material
57.Re 57.Re
58.Sh AUTHORS 58.Sh AUTHORS
59Markus Friedl <markus@openbsd.org> 59.An Markus Friedl Aq markus@openbsd.org
60.Sh HISTORY 60.Sh HISTORY
61.Nm 61.Nm
62first appeared in OpenBSD 2.8 . 62first appeared in OpenBSD 2.8 .
diff --git a/sftp-server.c b/sftp-server.c
index 9a66b4de7..9166853ed 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: sftp-server.c,v 1.41 2003/03/26 04:02:51 deraadt Exp $"); 25RCSID("$OpenBSD: sftp-server.c,v 1.43 2003/06/25 22:39:36 miod Exp $");
26 26
27#include "buffer.h" 27#include "buffer.h"
28#include "bufaux.h" 28#include "bufaux.h"
@@ -52,7 +52,7 @@ Buffer oqueue;
52/* Version of client */ 52/* Version of client */
53int version; 53int version;
54 54
55/* portable attibutes, etc. */ 55/* portable attributes, etc. */
56 56
57typedef struct Stat Stat; 57typedef struct Stat Stat;
58 58
@@ -442,7 +442,7 @@ process_read(void)
442 (u_int64_t)off, len); 442 (u_int64_t)off, len);
443 if (len > sizeof buf) { 443 if (len > sizeof buf) {
444 len = sizeof buf; 444 len = sizeof buf;
445 log("read change len %d", len); 445 logit("read change len %d", len);
446 } 446 }
447 fd = handle_to_fd(handle); 447 fd = handle_to_fd(handle);
448 if (fd >= 0) { 448 if (fd >= 0) {
@@ -495,7 +495,7 @@ process_write(void)
495 } else if (ret == len) { 495 } else if (ret == len) {
496 status = SSH2_FX_OK; 496 status = SSH2_FX_OK;
497 } else { 497 } else {
498 log("nothing at all written"); 498 logit("nothing at all written");
499 } 499 }
500 } 500 }
501 } 501 }
@@ -1030,7 +1030,7 @@ main(int ac, char **av)
1030 1030
1031 /* XXX should use getopt */ 1031 /* XXX should use getopt */
1032 1032
1033 __progname = get_progname(av[0]); 1033 __progname = ssh_get_progname(av[0]);
1034 handle_init(); 1034 handle_init();
1035 1035
1036#ifdef DEBUG_SFTP_SERVER 1036#ifdef DEBUG_SFTP_SERVER
diff --git a/sftp.0 b/sftp.0
index 479751215..b72ea4700 100644
--- a/sftp.0
+++ b/sftp.0
@@ -1,7 +1,7 @@
1SFTP(1) BSD General Commands Manual SFTP(1) 1SFTP(1) BSD General Commands Manual SFTP(1)
2 2
3NAME 3NAME
4 sftp - Secure file transfer program 4 sftp - secure file transfer program
5 5
6SYNOPSIS 6SYNOPSIS
7 sftp [-vC1] [-b batchfile] [-o ssh_option] [-s subsystem | sftp_server] 7 sftp [-vC1] [-b batchfile] [-o ssh_option] [-s subsystem | sftp_server]
@@ -9,6 +9,7 @@ SYNOPSIS
9 [-R num_requests] [-S program] host 9 [-R num_requests] [-S program] host
10 sftp [[user@]host[:file [file]]] 10 sftp [[user@]host[:file [file]]]
11 sftp [[user@]host[:dir[/]]] 11 sftp [[user@]host[:dir[/]]]
12 sftp -b batchfile [user@]host
12 13
13DESCRIPTION 14DESCRIPTION
14 sftp is an interactive file transfer program, similar to ftp(1), which 15 sftp is an interactive file transfer program, similar to ftp(1), which
@@ -21,10 +22,13 @@ DESCRIPTION
21 active authentication method is used; otherwise it will do so after suc- 22 active authentication method is used; otherwise it will do so after suc-
22 cessful interactive authentication. 23 cessful interactive authentication.
23 24
24 The last usage format allows the sftp client to start in a remote direc- 25 The third usage format allows the sftp client to start in a remote direc-
25 tory. 26 tory.
26 27
27 The options are as follows: 28 The final usage format allows for automated sessions using the -b option.
29 In such cases, it is usually necessary to configure public key authenti-
30 cation to obviate the need to enter a password at connection time (see
31 sshd(8) and ssh-keygen(1) for details). The options are as follows:
28 32
29 -b batchfile 33 -b batchfile
30 Batch mode reads a series of commands from an input batchfile 34 Batch mode reads a series of commands from an input batchfile
@@ -33,42 +37,42 @@ DESCRIPTION
33 will abort if any of the following commands fail: get, put, 37 will abort if any of the following commands fail: get, put,
34 rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp, 38 rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, chown, chgrp,
35 lpwd and lmkdir. Termination on error can be suppressed on a 39 lpwd and lmkdir. Termination on error can be suppressed on a
36 command by command basis by prefixing the command with a M-bM-^@M-^M-bM-^@M-^Y-M-bM-^@M-^M-bM-^@M-^Y 40 command by command basis by prefixing the command with a M-bM-^@M-^X-M-bM-^@M-^Y
37 character (For example, -rm /tmp/blah* ). 41 character (for example, -rm /tmp/blah*).
38 42
39 -o ssh_option 43 -o ssh_option
40 Can be used to pass options to ssh in the format used in 44 Can be used to pass options to ssh in the format used in
41 ssh_config(5). This is useful for specifying options for which 45 ssh_config(5). This is useful for specifying options for which
42 there is no separate sftp command-line flag. For example, to 46 there is no separate sftp command-line flag. For example, to
43 specify an alternate port use: sftp -oPort=24. 47 specify an alternate port use: sftp -oPort=24.
44 48
45 -s subsystem | sftp_server 49 -s subsystem | sftp_server
46 Specifies the SSH2 subsystem or the path for an sftp server on 50 Specifies the SSH2 subsystem or the path for an sftp server on
47 the remote host. A path is useful for using sftp over protocol 51 the remote host. A path is useful for using sftp over protocol
48 version 1, or when the remote sshd does not have an sftp subsys- 52 version 1, or when the remote sshd(8) does not have an sftp sub-
49 tem configured. 53 system configured.
50 54
51 -v Raise logging level. This option is also passed to ssh. 55 -v Raise logging level. This option is also passed to ssh.
52 56
53 -B buffer_size 57 -B buffer_size
54 Specify the size of the buffer that sftp uses when transferring 58 Specify the size of the buffer that sftp uses when transferring
55 files. Larger buffers require fewer round trips at the cost of 59 files. Larger buffers require fewer round trips at the cost of
56 higher memory consumption. The default is 32768 bytes. 60 higher memory consumption. The default is 32768 bytes.
57 61
58 -C Enables compression (via sshM-bM-^@M-^Ys -C flag). 62 -C Enables compression (via sshM-bM-^@M-^Ys -C flag).
59 63
60 -F ssh_config 64 -F ssh_config
61 Specifies an alternative per-user configuration file for ssh. 65 Specifies an alternative per-user configuration file for ssh(1).
62 This option is directly passed to ssh(1). 66 This option is directly passed to ssh(1).
63 67
64 -P sftp_server path 68 -P sftp_server path
65 Connect directly to a local sftp-server (rather than via ssh) 69 Connect directly to a local sftp server (rather than via ssh(1))
66 This option may be useful in debugging the client and server. 70 This option may be useful in debugging the client and server.
67 71
68 -R num_requests 72 -R num_requests
69 Specify how many requests may be outstanding at any one time. 73 Specify how many requests may be outstanding at any one time.
70 Increasing this may slightly improve file transfer speed but will 74 Increasing this may slightly improve file transfer speed but will
71 increase memory usage. The default is 16 outstanding requests. 75 increase memory usage. The default is 16 outstanding requests.
72 76
73 -S program 77 -S program
74 Name of the program to use for the encrypted connection. The 78 Name of the program to use for the encrypted connection. The
@@ -103,7 +107,7 @@ INTERACTIVE COMMANDS
103 get [flags] remote-path [local-path] 107 get [flags] remote-path [local-path]
104 Retrieve the remote-path and store it on the local machine. If 108 Retrieve the remote-path and store it on the local machine. If
105 the local path name is not specified, it is given the same name 109 the local path name is not specified, it is given the same name
106 it has on the remote machine. If the -P flag is specified, then 110 it has on the remote machine. If the -P flag is specified, then
107 the fileM-bM-^@M-^Ys full permission and access time are copied too. 111 the fileM-bM-^@M-^Ys full permission and access time are copied too.
108 112
109 help Display help text. 113 help Display help text.
@@ -122,7 +126,7 @@ INTERACTIVE COMMANDS
122 126
123 ls [flags] [path] 127 ls [flags] [path]
124 Display remote directory listing of either path or current direc- 128 Display remote directory listing of either path or current direc-
125 tory if path is not specified. If the -l flag is specified, then 129 tory if path is not specified. If the -l flag is specified, then
126 display additional details including permissions and ownership 130 display additional details including permissions and ownership
127 information. 131 information.
128 132
@@ -136,9 +140,9 @@ INTERACTIVE COMMANDS
136 Toggle display of progress meter. 140 Toggle display of progress meter.
137 141
138 put [flags] local-path [remote-path] 142 put [flags] local-path [remote-path]
139 Upload local-path and store it on the remote machine. If the 143 Upload local-path and store it on the remote machine. If the
140 remote path name is not specified, it is given the same name it 144 remote path name is not specified, it is given the same name it
141 has on the local machine. If the -P flag is specified, then the 145 has on the local machine. If the -P flag is specified, then the
142 fileM-bM-^@M-^Ys full permission and access time are copied too. 146 fileM-bM-^@M-^Ys full permission and access time are copied too.
143 147
144 pwd Display remote working directory. 148 pwd Display remote working directory.
@@ -167,9 +171,6 @@ INTERACTIVE COMMANDS
167 171
168 ? Synonym for help. 172 ? Synonym for help.
169 173
170AUTHORS
171 Damien Miller <djm@mindrot.org>
172
173SEE ALSO 174SEE ALSO
174 scp(1), ssh(1), ssh-add(1), ssh-keygen(1), ssh_config(5), sftp-server(8), 175 scp(1), ssh(1), ssh-add(1), ssh-keygen(1), ssh_config(5), sftp-server(8),
175 sshd(8) 176 sshd(8)
diff --git a/sftp.1 b/sftp.1
index 02d2c274b..753a4f2b9 100644
--- a/sftp.1
+++ b/sftp.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: sftp.1,v 1.41 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: sftp.1,v 1.45 2003/09/02 18:50:06 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2001 Damien Miller. All rights reserved. 3.\" Copyright (c) 2001 Damien Miller. All rights reserved.
4.\" 4.\"
@@ -27,7 +27,7 @@
27.Os 27.Os
28.Sh NAME 28.Sh NAME
29.Nm sftp 29.Nm sftp
30.Nd Secure file transfer program 30.Nd secure file transfer program
31.Sh SYNOPSIS 31.Sh SYNOPSIS
32.Nm sftp 32.Nm sftp
33.Bk -words 33.Bk -words
@@ -43,13 +43,16 @@
43.Ar host 43.Ar host
44.Ek 44.Ek
45.Nm sftp 45.Nm sftp
46.Oo Oo Ar user Ns No @ Oc Ns 46.Oo Oo Ar user Ns @ Oc Ns
47.Ar host Ns Oo : Ns Ar file Oo 47.Ar host Ns Oo : Ns Ar file Oo
48.Ar file Oc Oc Oc 48.Ar file Oc Oc Oc
49.Nm sftp 49.Nm sftp
50.Oo Oo Ar user Ns No @ Oc Ns 50.Oo Oo Ar user Ns @ Oc Ns
51.Ar host Ns Oo : Ns Ar dir Ns 51.Ar host Ns Oo : Ns Ar dir Ns
52.Oo Ar / Oc Oc Oc 52.Oo Ar / Oc Oc Oc
53.Nm sftp
54.Fl b Ar batchfile
55.Oo Ar user Ns @ Oc Ns Ar host
53.Sh DESCRIPTION 56.Sh DESCRIPTION
54.Nm 57.Nm
55is an interactive file transfer program, similar to 58is an interactive file transfer program, similar to
@@ -68,8 +71,17 @@ The second usage format will retrieve files automatically if a non-interactive
68authentication method is used; otherwise it will do so after 71authentication method is used; otherwise it will do so after
69successful interactive authentication. 72successful interactive authentication.
70.Pp 73.Pp
71The last usage format allows the sftp client to start in a remote directory. 74The third usage format allows the sftp client to start in a remote directory.
72.Pp 75.Pp
76The final usage format allows for automated sessions using the
77.Fl b
78option.
79In such cases, it is usually necessary to configure public key authentication
80to obviate the need to enter a password at connection time (see
81.Xr sshd 8
82and
83.Xr ssh-keygen 1
84for details).
73The options are as follows: 85The options are as follows:
74.Bl -tag -width Ds 86.Bl -tag -width Ds
75.It Fl b Ar batchfile 87.It Fl b Ar batchfile
@@ -89,10 +101,9 @@ and
89.Ic lmkdir . 101.Ic lmkdir .
90Termination on error can be suppressed on a command by command basis by 102Termination on error can be suppressed on a command by command basis by
91prefixing the command with a 103prefixing the command with a
92.Ic '-' 104.Sq Ic \-
93character (For example, 105character (for example,
94.Ic -rm /tmp/blah* 106.Ic -rm /tmp/blah* ) .
95).
96.It Fl o Ar ssh_option 107.It Fl o Ar ssh_option
97Can be used to pass options to 108Can be used to pass options to
98.Nm ssh 109.Nm ssh
@@ -101,22 +112,27 @@ in the format used in
101This is useful for specifying options 112This is useful for specifying options
102for which there is no separate 113for which there is no separate
103.Nm sftp 114.Nm sftp
104command-line flag. For example, to specify an alternate 115command-line flag.
105port use: 116For example, to specify an alternate port use:
106.Ic sftp -oPort=24 . 117.Ic sftp -oPort=24 .
107.It Fl s Ar subsystem | sftp_server 118.It Fl s Ar subsystem | sftp_server
108Specifies the SSH2 subsystem or the path for an sftp server 119Specifies the SSH2 subsystem or the path for an sftp server
109on the remote host. A path is useful for using sftp over 120on the remote host.
110protocol version 1, or when the remote 121A path is useful for using
111.Nm sshd 122.Nm
123over protocol version 1, or when the remote
124.Xr sshd 8
112does not have an sftp subsystem configured. 125does not have an sftp subsystem configured.
113.It Fl v 126.It Fl v
114Raise logging level. This option is also passed to ssh. 127Raise logging level.
128This option is also passed to ssh.
115.It Fl B Ar buffer_size 129.It Fl B Ar buffer_size
116Specify the size of the buffer that 130Specify the size of the buffer that
117.Nm 131.Nm
118uses when transferring files. Larger buffers require fewer round trips at 132uses when transferring files.
119the cost of higher memory consumption. The default is 32768 bytes. 133Larger buffers require fewer round trips at the cost of higher
134memory consumption.
135The default is 32768 bytes.
120.It Fl C 136.It Fl C
121Enables compression (via ssh's 137Enables compression (via ssh's
122.Fl C 138.Fl C
@@ -124,19 +140,19 @@ flag).
124.It Fl F Ar ssh_config 140.It Fl F Ar ssh_config
125Specifies an alternative 141Specifies an alternative
126per-user configuration file for 142per-user configuration file for
127.Nm ssh . 143.Xr ssh 1 .
128This option is directly passed to 144This option is directly passed to
129.Xr ssh 1 . 145.Xr ssh 1 .
130.It Fl P Ar sftp_server path 146.It Fl P Ar sftp_server path
131Connect directly to a local 147Connect directly to a local sftp server
132.Nm sftp-server
133(rather than via 148(rather than via
134.Nm ssh ) 149.Xr ssh 1 )
135This option may be useful in debugging the client and server. 150This option may be useful in debugging the client and server.
136.It Fl R Ar num_requests 151.It Fl R Ar num_requests
137Specify how many requests may be outstanding at any one time. Increasing 152Specify how many requests may be outstanding at any one time.
138this may slightly improve file transfer speed but will increase memory 153Increasing this may slightly improve file transfer speed
139usage. The default is 16 outstanding requests. 154but will increase memory usage.
155The default is 16 outstanding requests.
140.It Fl S Ar program 156.It Fl S Ar program
141Name of the 157Name of the
142.Ar program 158.Ar program
@@ -156,7 +172,8 @@ Commands are case insensitive and pathnames may be enclosed in quotes if they
156contain spaces. 172contain spaces.
157.Bl -tag -width Ds 173.Bl -tag -width Ds
158.It Ic bye 174.It Ic bye
159Quit sftp. 175Quit
176.Nm sftp .
160.It Ic cd Ar path 177.It Ic cd Ar path
161Change remote directory to 178Change remote directory to
162.Ar path . 179.Ar path .
@@ -183,7 +200,8 @@ to
183.Ar own 200.Ar own
184must be a numeric UID. 201must be a numeric UID.
185.It Ic exit 202.It Ic exit
186Quit sftp. 203Quit
204.Nm sftp .
187.It Xo Ic get 205.It Xo Ic get
188.Op Ar flags 206.Op Ar flags
189.Ar remote-path 207.Ar remote-path
@@ -194,7 +212,8 @@ Retrieve the
194and store it on the local machine. 212and store it on the local machine.
195If the local 213If the local
196path name is not specified, it is given the same name it has on the 214path name is not specified, it is given the same name it has on the
197remote machine. If the 215remote machine.
216If the
198.Fl P 217.Fl P
199flag is specified, then the file's full permission and access time are 218flag is specified, then the file's full permission and access time are
200copied too. 219copied too.
@@ -224,7 +243,8 @@ Display remote directory listing of either
224.Ar path 243.Ar path
225or current directory if 244or current directory if
226.Ar path 245.Ar path
227is not specified. If the 246is not specified.
247If the
228.Fl l 248.Fl l
229flag is specified, then display additional details including permissions 249flag is specified, then display additional details including permissions
230and ownership information. 250and ownership information.
@@ -243,15 +263,18 @@ Toggle display of progress meter.
243.Xc 263.Xc
244Upload 264Upload
245.Ar local-path 265.Ar local-path
246and store it on the remote machine. If the remote path name is not 266and store it on the remote machine.
247specified, it is given the same name it has on the local machine. If the 267If the remote path name is not specified, it is given the same name it has
268on the local machine.
269If the
248.Fl P 270.Fl P
249flag is specified, then the file's full permission and access time are 271flag is specified, then the file's full permission and access time are
250copied too. 272copied too.
251.It Ic pwd 273.It Ic pwd
252Display remote working directory. 274Display remote working directory.
253.It Ic quit 275.It Ic quit
254Quit sftp. 276Quit
277.Nm sftp .
255.It Ic rename Ar oldpath Ar newpath 278.It Ic rename Ar oldpath Ar newpath
256Rename remote file from 279Rename remote file from
257.Ar oldpath 280.Ar oldpath
@@ -272,17 +295,15 @@ to
272Display the 295Display the
273.Nm 296.Nm
274protocol version. 297protocol version.
275.It Ic ! Ar command 298.It Ic \&! Ar command
276Execute 299Execute
277.Ar command 300.Ar command
278in local shell. 301in local shell.
279.It Ic ! 302.It Ic \&!
280Escape to local shell. 303Escape to local shell.
281.It Ic ? 304.It Ic \&?
282Synonym for help. 305Synonym for help.
283.El 306.El
284.Sh AUTHORS
285Damien Miller <djm@mindrot.org>
286.Sh SEE ALSO 307.Sh SEE ALSO
287.Xr scp 1 , 308.Xr scp 1 ,
288.Xr ssh 1 , 309.Xr ssh 1 ,
diff --git a/sftp.c b/sftp.c
index e8adcba18..c2a6593b8 100644
--- a/sftp.c
+++ b/sftp.c
@@ -24,9 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26 26
27RCSID("$OpenBSD: sftp.c,v 1.34 2003/01/10 08:19:07 fgsch Exp $"); 27RCSID("$OpenBSD: sftp.c,v 1.37 2003/07/10 20:05:55 markus Exp $");
28
29/* XXX: short-form remote directory listings (like 'ls -C') */
30 28
31#include "buffer.h" 29#include "buffer.h"
32#include "xmalloc.h" 30#include "xmalloc.h"
@@ -48,11 +46,21 @@ char *__progname;
48FILE* infile; 46FILE* infile;
49size_t copy_buffer_len = 32768; 47size_t copy_buffer_len = 32768;
50size_t num_requests = 16; 48size_t num_requests = 16;
49static pid_t sshpid = -1;
51 50
52extern int showprogress; 51extern int showprogress;
53 52
54static void 53static void
55connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid) 54killchild(int signo)
55{
56 if (sshpid > 1)
57 kill(sshpid, signo);
58
59 _exit(1);
60}
61
62static void
63connect_to_server(char *path, char **args, int *in, int *out)
56{ 64{
57 int c_in, c_out; 65 int c_in, c_out;
58 66
@@ -74,9 +82,9 @@ connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid)
74 c_in = c_out = inout[1]; 82 c_in = c_out = inout[1];
75#endif /* USE_PIPES */ 83#endif /* USE_PIPES */
76 84
77 if ((*sshpid = fork()) == -1) 85 if ((sshpid = fork()) == -1)
78 fatal("fork: %s", strerror(errno)); 86 fatal("fork: %s", strerror(errno));
79 else if (*sshpid == 0) { 87 else if (sshpid == 0) {
80 if ((dup2(c_in, STDIN_FILENO) == -1) || 88 if ((dup2(c_in, STDIN_FILENO) == -1) ||
81 (dup2(c_out, STDOUT_FILENO) == -1)) { 89 (dup2(c_out, STDOUT_FILENO) == -1)) {
82 fprintf(stderr, "dup2: %s\n", strerror(errno)); 90 fprintf(stderr, "dup2: %s\n", strerror(errno));
@@ -91,6 +99,9 @@ connect_to_server(char *path, char **args, int *in, int *out, pid_t *sshpid)
91 exit(1); 99 exit(1);
92 } 100 }
93 101
102 signal(SIGTERM, killchild);
103 signal(SIGINT, killchild);
104 signal(SIGHUP, killchild);
94 close(c_in); 105 close(c_in);
95 close(c_out); 106 close(c_out);
96} 107}
@@ -101,8 +112,9 @@ usage(void)
101 extern char *__progname; 112 extern char *__progname;
102 113
103 fprintf(stderr, 114 fprintf(stderr,
104 "usage: %s [-vC1] [-b batchfile] [-o option] [-s subsystem|path] [-B buffer_size]\n" 115 "usage: %s [-vC1] [-b batchfile] [-o ssh_option] [-s subsystem | sftp_server]\n"
105 " [-F config] [-P direct server path] [-S program]\n" 116 " [-B buffer_size] [-F ssh_config] [-P sftp_server path]\n"
117 " [-R num_requests] [-S program]\n"
106 " [user@]host[:file [file]]\n", __progname); 118 " [user@]host[:file [file]]\n", __progname);
107 exit(1); 119 exit(1);
108} 120}
@@ -111,7 +123,6 @@ int
111main(int argc, char **argv) 123main(int argc, char **argv)
112{ 124{
113 int in, out, ch, err; 125 int in, out, ch, err;
114 pid_t sshpid;
115 char *host, *userhost, *cp, *file2; 126 char *host, *userhost, *cp, *file2;
116 int debug_level = 0, sshver = 2; 127 int debug_level = 0, sshver = 2;
117 char *file1 = NULL, *sftp_server = NULL; 128 char *file1 = NULL, *sftp_server = NULL;
@@ -121,7 +132,7 @@ main(int argc, char **argv)
121 extern int optind; 132 extern int optind;
122 extern char *optarg; 133 extern char *optarg;
123 134
124 __progname = get_progname(argv[0]); 135 __progname = ssh_get_progname(argv[0]);
125 args.list = NULL; 136 args.list = NULL;
126 addargs(&args, "ssh"); /* overwritten with ssh_program */ 137 addargs(&args, "ssh"); /* overwritten with ssh_program */
127 addargs(&args, "-oForwardX11 no"); 138 addargs(&args, "-oForwardX11 no");
@@ -229,15 +240,13 @@ main(int argc, char **argv)
229 args.list[0] = ssh_program; 240 args.list[0] = ssh_program;
230 241
231 fprintf(stderr, "Connecting to %s...\n", host); 242 fprintf(stderr, "Connecting to %s...\n", host);
232 connect_to_server(ssh_program, args.list, &in, &out, 243 connect_to_server(ssh_program, args.list, &in, &out);
233 &sshpid);
234 } else { 244 } else {
235 args.list = NULL; 245 args.list = NULL;
236 addargs(&args, "sftp-server"); 246 addargs(&args, "sftp-server");
237 247
238 fprintf(stderr, "Attaching to %s...\n", sftp_direct); 248 fprintf(stderr, "Attaching to %s...\n", sftp_direct);
239 connect_to_server(sftp_direct, args.list, &in, &out, 249 connect_to_server(sftp_direct, args.list, &in, &out);
240 &sshpid);
241 } 250 }
242 251
243 err = interactive_loop(in, out, file1, file2); 252 err = interactive_loop(in, out, file1, file2);
diff --git a/ssh-add.0 b/ssh-add.0
index b0096423d..95929d4d3 100644
--- a/ssh-add.0
+++ b/ssh-add.0
@@ -54,6 +54,21 @@ DESCRIPTION
54 -e reader 54 -e reader
55 Remove key in smartcard reader. 55 Remove key in smartcard reader.
56 56
57ENVIRONMENT
58 DISPLAY and SSH_ASKPASS
59 If ssh-add needs a passphrase, it will read the passphrase from
60 the current terminal if it was run from a terminal. If ssh-add
61 does not have a terminal associated with it but DISPLAY and
62 SSH_ASKPASS are set, it will execute the program specified by
63 SSH_ASKPASS and open an X11 window to read the passphrase. This
64 is particularly useful when calling ssh-add from a .Xsession or
65 related script. (Note that on some machines it may be necessary
66 to redirect the input from /dev/null to make this work.)
67
68 SSH_AUTH_SOCK
69 Identifies the path of a unix-domain socket used to communicate
70 with the agent.
71
57FILES 72FILES
58 $HOME/.ssh/identity 73 $HOME/.ssh/identity
59 Contains the protocol version 1 RSA authentication identity of 74 Contains the protocol version 1 RSA authentication identity of
@@ -70,25 +85,13 @@ FILES
70 Identity files should not be readable by anyone but the user. Note that 85 Identity files should not be readable by anyone but the user. Note that
71 ssh-add ignores identity files if they are accessible by others. 86 ssh-add ignores identity files if they are accessible by others.
72 87
73ENVIRONMENT
74 DISPLAY and SSH_ASKPASS
75 If ssh-add needs a passphrase, it will read the passphrase from
76 the current terminal if it was run from a terminal. If ssh-add
77 does not have a terminal associated with it but DISPLAY and
78 SSH_ASKPASS are set, it will execute the program specified by
79 SSH_ASKPASS and open an X11 window to read the passphrase. This
80 is particularly useful when calling ssh-add from a .Xsession or
81 related script. (Note that on some machines it may be necessary
82 to redirect the input from /dev/null to make this work.)
83
84 SSH_AUTH_SOCK
85 Identifies the path of a unix-domain socket used to communicate
86 with the agent.
87
88DIAGNOSTICS 88DIAGNOSTICS
89 Exit status is 0 on success, 1 if the specified command fails, and 2 if 89 Exit status is 0 on success, 1 if the specified command fails, and 2 if
90 ssh-add is unable to contact the authentication agent. 90 ssh-add is unable to contact the authentication agent.
91 91
92SEE ALSO
93 ssh(1), ssh-agent(1), ssh-keygen(1), sshd(8)
94
92AUTHORS 95AUTHORS
93 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 96 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
94 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 97 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
@@ -96,7 +99,4 @@ AUTHORS
96 ated OpenSSH. Markus Friedl contributed the support for SSH protocol 99 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
97 versions 1.5 and 2.0. 100 versions 1.5 and 2.0.
98 101
99SEE ALSO
100 ssh(1), ssh-agent(1), ssh-keygen(1), sshd(8)
101
102BSD September 25, 1999 BSD 102BSD September 25, 1999 BSD
diff --git a/ssh-add.1 b/ssh-add.1
index bcdb8e7f6..fe0190859 100644
--- a/ssh-add.1
+++ b/ssh-add.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-add.1,v 1.38 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: ssh-add.1,v 1.39 2003/06/10 09:12:11 jmc Exp $
2.\" 2.\"
3.\" -*- nroff -*- 3.\" -*- nroff -*-
4.\" 4.\"
@@ -109,20 +109,6 @@ Add key in smartcard
109Remove key in smartcard 109Remove key in smartcard
110.Ar reader . 110.Ar reader .
111.El 111.El
112.Sh FILES
113.Bl -tag -width Ds
114.It Pa $HOME/.ssh/identity
115Contains the protocol version 1 RSA authentication identity of the user.
116.It Pa $HOME/.ssh/id_dsa
117Contains the protocol version 2 DSA authentication identity of the user.
118.It Pa $HOME/.ssh/id_rsa
119Contains the protocol version 2 RSA authentication identity of the user.
120.El
121.Pp
122Identity files should not be readable by anyone but the user.
123Note that
124.Nm
125ignores identity files if they are accessible by others.
126.Sh ENVIRONMENT 112.Sh ENVIRONMENT
127.Bl -tag -width Ds 113.Bl -tag -width Ds
128.It Ev "DISPLAY" and "SSH_ASKPASS" 114.It Ev "DISPLAY" and "SSH_ASKPASS"
@@ -152,11 +138,30 @@ to make this work.)
152Identifies the path of a unix-domain socket used to communicate with the 138Identifies the path of a unix-domain socket used to communicate with the
153agent. 139agent.
154.El 140.El
141.Sh FILES
142.Bl -tag -width Ds
143.It Pa $HOME/.ssh/identity
144Contains the protocol version 1 RSA authentication identity of the user.
145.It Pa $HOME/.ssh/id_dsa
146Contains the protocol version 2 DSA authentication identity of the user.
147.It Pa $HOME/.ssh/id_rsa
148Contains the protocol version 2 RSA authentication identity of the user.
149.El
150.Pp
151Identity files should not be readable by anyone but the user.
152Note that
153.Nm
154ignores identity files if they are accessible by others.
155.Sh DIAGNOSTICS 155.Sh DIAGNOSTICS
156Exit status is 0 on success, 1 if the specified command fails, 156Exit status is 0 on success, 1 if the specified command fails,
157and 2 if 157and 2 if
158.Nm 158.Nm
159is unable to contact the authentication agent. 159is unable to contact the authentication agent.
160.Sh SEE ALSO
161.Xr ssh 1 ,
162.Xr ssh-agent 1 ,
163.Xr ssh-keygen 1 ,
164.Xr sshd 8
160.Sh AUTHORS 165.Sh AUTHORS
161OpenSSH is a derivative of the original and free 166OpenSSH is a derivative of the original and free
162ssh 1.2.12 release by Tatu Ylonen. 167ssh 1.2.12 release by Tatu Ylonen.
@@ -166,8 +171,3 @@ removed many bugs, re-added newer features and
166created OpenSSH. 171created OpenSSH.
167Markus Friedl contributed the support for SSH 172Markus Friedl contributed the support for SSH
168protocol versions 1.5 and 2.0. 173protocol versions 1.5 and 2.0.
169.Sh SEE ALSO
170.Xr ssh 1 ,
171.Xr ssh-agent 1 ,
172.Xr ssh-keygen 1 ,
173.Xr sshd 8
diff --git a/ssh-add.c b/ssh-add.c
index 9adec3094..2e394e5c1 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: ssh-add.c,v 1.66 2003/03/05 22:33:43 markus Exp $"); 38RCSID("$OpenBSD: ssh-add.c,v 1.68 2003/06/16 10:22:45 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41 41
@@ -164,7 +164,8 @@ add_file(AuthenticationConnection *ac, const char *filename)
164 if (private != NULL) 164 if (private != NULL)
165 break; 165 break;
166 clear_pass(); 166 clear_pass();
167 strlcpy(msg, "Bad passphrase, try again: ", sizeof msg); 167 snprintf(msg, sizeof msg,
168 "Bad passphrase, try again for %.200s: ", comment);
168 } 169 }
169 } 170 }
170 171
@@ -201,7 +202,7 @@ update_card(AuthenticationConnection *ac, int add, const char *id)
201 if (pin == NULL) 202 if (pin == NULL)
202 return -1; 203 return -1;
203 204
204 if (ssh_update_card(ac, add, id, pin)) { 205 if (ssh_update_card(ac, add, id, pin, lifetime, confirm)) {
205 fprintf(stderr, "Card %s: %s\n", 206 fprintf(stderr, "Card %s: %s\n",
206 add ? "added" : "removed", id); 207 add ? "added" : "removed", id);
207 ret = 0; 208 ret = 0;
@@ -318,7 +319,7 @@ main(int argc, char **argv)
318 char *sc_reader_id = NULL; 319 char *sc_reader_id = NULL;
319 int i, ch, deleting = 0, ret = 0; 320 int i, ch, deleting = 0, ret = 0;
320 321
321 __progname = get_progname(argv[0]); 322 __progname = ssh_get_progname(argv[0]);
322 init_rng(); 323 init_rng();
323 seed_rng(); 324 seed_rng();
324 325
diff --git a/ssh-agent.0 b/ssh-agent.0
index 48cc9b36e..990cbc29b 100644
--- a/ssh-agent.0
+++ b/ssh-agent.0
@@ -60,7 +60,7 @@ DESCRIPTION
60 can thus use the privileges given by the identities anywhere in the net- 60 can thus use the privileges given by the identities anywhere in the net-
61 work in a secure way. 61 work in a secure way.
62 62
63 There are two main ways to get an agent setup: Either the agent starts a 63 There are two main ways to get an agent set up: Either the agent starts a
64 new subcommand into which some environment variables are exported, or the 64 new subcommand into which some environment variables are exported, or the
65 agent prints the needed shell commands (either sh(1) or csh(1) syntax can 65 agent prints the needed shell commands (either sh(1) or csh(1) syntax can
66 be generated) which can be evalled in the calling shell. Later ssh(1) 66 be generated) which can be evalled in the calling shell. Later ssh(1)
@@ -101,6 +101,9 @@ FILES
101 owner. The sockets should get automatically removed when the 101 owner. The sockets should get automatically removed when the
102 agent exits. 102 agent exits.
103 103
104SEE ALSO
105 ssh(1), ssh-add(1), ssh-keygen(1), sshd(8)
106
104AUTHORS 107AUTHORS
105 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 108 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
106 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 109 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
@@ -108,7 +111,4 @@ AUTHORS
108 ated OpenSSH. Markus Friedl contributed the support for SSH protocol 111 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
109 versions 1.5 and 2.0. 112 versions 1.5 and 2.0.
110 113
111SEE ALSO
112 ssh(1), ssh-add(1), ssh-keygen(1), sshd(8)
113
114BSD September 25, 1999 BSD 114BSD September 25, 1999 BSD
diff --git a/ssh-agent.1 b/ssh-agent.1
index fde4608bb..aab15cc7f 100644
--- a/ssh-agent.1
+++ b/ssh-agent.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-agent.1,v 1.37 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: ssh-agent.1,v 1.39 2003/06/10 09:12:11 jmc Exp $
2.\" 2.\"
3.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 3.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -133,7 +133,7 @@ However, the connection to the agent is forwarded over SSH
133remote logins, and the user can thus use the privileges given by the 133remote logins, and the user can thus use the privileges given by the
134identities anywhere in the network in a secure way. 134identities anywhere in the network in a secure way.
135.Pp 135.Pp
136There are two main ways to get an agent setup: 136There are two main ways to get an agent set up:
137Either the agent starts a new subcommand into which some environment 137Either the agent starts a new subcommand into which some environment
138variables are exported, or the agent prints the needed shell commands 138variables are exported, or the agent prints the needed shell commands
139(either 139(either
@@ -179,6 +179,11 @@ authentication agent.
179These sockets should only be readable by the owner. 179These sockets should only be readable by the owner.
180The sockets should get automatically removed when the agent exits. 180The sockets should get automatically removed when the agent exits.
181.El 181.El
182.Sh SEE ALSO
183.Xr ssh 1 ,
184.Xr ssh-add 1 ,
185.Xr ssh-keygen 1 ,
186.Xr sshd 8
182.Sh AUTHORS 187.Sh AUTHORS
183OpenSSH is a derivative of the original and free 188OpenSSH is a derivative of the original and free
184ssh 1.2.12 release by Tatu Ylonen. 189ssh 1.2.12 release by Tatu Ylonen.
@@ -188,8 +193,3 @@ removed many bugs, re-added newer features and
188created OpenSSH. 193created OpenSSH.
189Markus Friedl contributed the support for SSH 194Markus Friedl contributed the support for SSH
190protocol versions 1.5 and 2.0. 195protocol versions 1.5 and 2.0.
191.Sh SEE ALSO
192.Xr ssh 1 ,
193.Xr ssh-add 1 ,
194.Xr ssh-keygen 1 ,
195.Xr sshd 8
diff --git a/ssh-agent.c b/ssh-agent.c
index eb593de73..c05c61468 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -35,7 +35,7 @@
35 35
36#include "includes.h" 36#include "includes.h"
37#include "openbsd-compat/sys-queue.h" 37#include "openbsd-compat/sys-queue.h"
38RCSID("$OpenBSD: ssh-agent.c,v 1.108 2003/03/13 11:44:50 markus Exp $"); 38RCSID("$OpenBSD: ssh-agent.c,v 1.111 2003/06/12 19:12:03 markus Exp $");
39 39
40#include <openssl/evp.h> 40#include <openssl/evp.h>
41#include <openssl/md5.h> 41#include <openssl/md5.h>
@@ -261,7 +261,7 @@ process_authentication_challenge1(SocketEntry *e)
261 /* The response is MD5 of decrypted challenge plus session id. */ 261 /* The response is MD5 of decrypted challenge plus session id. */
262 len = BN_num_bytes(challenge); 262 len = BN_num_bytes(challenge);
263 if (len <= 0 || len > 32) { 263 if (len <= 0 || len > 32) {
264 log("process_authentication_challenge: bad challenge length %d", len); 264 logit("process_authentication_challenge: bad challenge length %d", len);
265 goto failure; 265 goto failure;
266 } 266 }
267 memset(buf, 0, 32); 267 memset(buf, 0, 32);
@@ -350,7 +350,7 @@ process_remove_identity(SocketEntry *e, int version)
350 buffer_get_bignum(&e->request, key->rsa->n); 350 buffer_get_bignum(&e->request, key->rsa->n);
351 351
352 if (bits != key_size(key)) 352 if (bits != key_size(key))
353 log("Warning: identity keysize mismatch: actual %u, announced %u", 353 logit("Warning: identity keysize mismatch: actual %u, announced %u",
354 key_size(key), bits); 354 key_size(key), bits);
355 break; 355 break;
356 case 2: 356 case 2:
@@ -580,13 +580,29 @@ static void
580process_add_smartcard_key (SocketEntry *e) 580process_add_smartcard_key (SocketEntry *e)
581{ 581{
582 char *sc_reader_id = NULL, *pin; 582 char *sc_reader_id = NULL, *pin;
583 int i, version, success = 0; 583 int i, version, success = 0, death = 0, confirm = 0;
584 Key **keys, *k; 584 Key **keys, *k;
585 Identity *id; 585 Identity *id;
586 Idtab *tab; 586 Idtab *tab;
587 587
588 sc_reader_id = buffer_get_string(&e->request, NULL); 588 sc_reader_id = buffer_get_string(&e->request, NULL);
589 pin = buffer_get_string(&e->request, NULL); 589 pin = buffer_get_string(&e->request, NULL);
590
591 while (buffer_len(&e->request)) {
592 switch (buffer_get_char(&e->request)) {
593 case SSH_AGENT_CONSTRAIN_LIFETIME:
594 death = time(NULL) + buffer_get_int(&e->request);
595 break;
596 case SSH_AGENT_CONSTRAIN_CONFIRM:
597 confirm = 1;
598 break;
599 default:
600 break;
601 }
602 }
603 if (lifetime && !death)
604 death = time(NULL) + lifetime;
605
590 keys = sc_get_keys(sc_reader_id, pin); 606 keys = sc_get_keys(sc_reader_id, pin);
591 xfree(sc_reader_id); 607 xfree(sc_reader_id);
592 xfree(pin); 608 xfree(pin);
@@ -602,9 +618,9 @@ process_add_smartcard_key (SocketEntry *e)
602 if (lookup_identity(k, version) == NULL) { 618 if (lookup_identity(k, version) == NULL) {
603 id = xmalloc(sizeof(Identity)); 619 id = xmalloc(sizeof(Identity));
604 id->key = k; 620 id->key = k;
605 id->comment = xstrdup("smartcard key"); 621 id->comment = sc_get_key_label(k);
606 id->death = 0; 622 id->death = death;
607 id->confirm = 0; 623 id->confirm = confirm;
608 TAILQ_INSERT_TAIL(&tab->idlist, id, next); 624 TAILQ_INSERT_TAIL(&tab->idlist, id, next);
609 tab->nentries++; 625 tab->nentries++;
610 success = 1; 626 success = 1;
@@ -748,6 +764,7 @@ process_message(SocketEntry *e)
748 break; 764 break;
749#ifdef SMARTCARD 765#ifdef SMARTCARD
750 case SSH_AGENTC_ADD_SMARTCARD_KEY: 766 case SSH_AGENTC_ADD_SMARTCARD_KEY:
767 case SSH_AGENTC_ADD_SMARTCARD_KEY_CONSTRAINED:
751 process_add_smartcard_key(e); 768 process_add_smartcard_key(e);
752 break; 769 break;
753 case SSH_AGENTC_REMOVE_SMARTCARD_KEY: 770 case SSH_AGENTC_REMOVE_SMARTCARD_KEY:
@@ -962,7 +979,7 @@ check_parent_exists(int sig)
962 /* printf("Parent has died - Authentication agent exiting.\n"); */ 979 /* printf("Parent has died - Authentication agent exiting.\n"); */
963 cleanup_handler(sig); /* safe */ 980 cleanup_handler(sig); /* safe */
964 } 981 }
965 signal(SIGALRM, check_parent_exists); 982 mysignal(SIGALRM, check_parent_exists);
966 alarm(10); 983 alarm(10);
967 errno = save_errno; 984 errno = save_errno;
968} 985}
@@ -1007,7 +1024,7 @@ main(int ac, char **av)
1007 1024
1008 SSLeay_add_all_algorithms(); 1025 SSLeay_add_all_algorithms();
1009 1026
1010 __progname = get_progname(av[0]); 1027 __progname = ssh_get_progname(av[0]);
1011 init_rng(); 1028 init_rng();
1012 seed_rng(); 1029 seed_rng();
1013 1030
@@ -1194,7 +1211,7 @@ skip:
1194 fatal_add_cleanup(cleanup_socket, NULL); 1211 fatal_add_cleanup(cleanup_socket, NULL);
1195 new_socket(AUTH_SOCKET, sock); 1212 new_socket(AUTH_SOCKET, sock);
1196 if (ac > 0) { 1213 if (ac > 0) {
1197 signal(SIGALRM, check_parent_exists); 1214 mysignal(SIGALRM, check_parent_exists);
1198 alarm(10); 1215 alarm(10);
1199 } 1216 }
1200 idtab_init(); 1217 idtab_init();
diff --git a/ssh-gss.h b/ssh-gss.h
new file mode 100644
index 000000000..6b58adb3a
--- /dev/null
+++ b/ssh-gss.h
@@ -0,0 +1,121 @@
1/*
2 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */
24
25#ifndef _SSH_GSS_H
26#define _SSH_GSS_H
27
28#ifdef GSSAPI
29
30#include "buffer.h"
31
32#include <gssapi.h>
33
34#ifdef KRB5
35#ifndef HEIMDAL
36#include <gssapi_generic.h>
37
38/* MIT Kerberos doesn't seem to define GSS_NT_HOSTBASED_SERVICE */
39
40#ifndef GSS_C_NT_HOSTBASED_SERVICE
41#define GSS_C_NT_HOSTBASED_SERVICE gss_nt_service_name
42#endif /* GSS_C_NT_... */
43#endif /* !HEIMDAL */
44#endif /* KRB5 */
45
46/* draft-ietf-secsh-gsskeyex-06 */
47#define SSH2_MSG_USERAUTH_GSSAPI_RESPONSE 60
48#define SSH2_MSG_USERAUTH_GSSAPI_TOKEN 61
49#define SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE 63
50#define SSH2_MSG_USERAUTH_GSSAPI_ERROR 64
51#define SSH2_MSG_USERAUTH_GSSAPI_ERRTOK 65
52
53#define SSH_GSS_OIDTYPE 0x06
54
55typedef struct {
56 char *filename;
57 char *envvar;
58 char *envval;
59 void *data;
60} ssh_gssapi_ccache;
61
62typedef struct {
63 gss_buffer_desc displayname;
64 gss_buffer_desc exportedname;
65 gss_cred_id_t creds;
66 struct ssh_gssapi_mech_struct *mech;
67 ssh_gssapi_ccache store;
68} ssh_gssapi_client;
69
70typedef struct ssh_gssapi_mech_struct {
71 char *enc_name;
72 char *name;
73 gss_OID_desc oid;
74 int (*dochild) (ssh_gssapi_client *);
75 int (*userok) (ssh_gssapi_client *, char *);
76 int (*localname) (ssh_gssapi_client *, char **);
77 void (*storecreds) (ssh_gssapi_client *);
78} ssh_gssapi_mech;
79
80typedef struct {
81 OM_uint32 major; /* both */
82 OM_uint32 minor; /* both */
83 gss_ctx_id_t context; /* both */
84 gss_name_t name; /* both */
85 gss_OID oid; /* client */
86 gss_cred_id_t creds; /* server */
87 gss_name_t client; /* server */
88 gss_cred_id_t client_creds; /* server */
89} Gssctxt;
90
91extern ssh_gssapi_mech *supported_mechs[];
92
93int ssh_gssapi_check_oid(Gssctxt *ctx, void *data, size_t len);
94void ssh_gssapi_set_oid_data(Gssctxt *ctx, void *data, size_t len);
95void ssh_gssapi_set_oid(Gssctxt *ctx, gss_OID oid);
96void ssh_gssapi_supported_oids(gss_OID_set *oidset);
97ssh_gssapi_mech *ssh_gssapi_get_ctype(Gssctxt *ctxt);
98
99OM_uint32 ssh_gssapi_import_name(Gssctxt *ctx, const char *host);
100OM_uint32 ssh_gssapi_acquire_cred(Gssctxt *ctx);
101OM_uint32 ssh_gssapi_init_ctx(Gssctxt *ctx, int deleg_creds,
102 gss_buffer_desc *recv_tok, gss_buffer_desc *send_tok, OM_uint32 *flags);
103OM_uint32 ssh_gssapi_accept_ctx(Gssctxt *ctx,
104 gss_buffer_desc *recv_tok, gss_buffer_desc *send_tok, OM_uint32 *flags);
105OM_uint32 ssh_gssapi_getclient(Gssctxt *ctx, ssh_gssapi_client *);
106void ssh_gssapi_error(Gssctxt *ctx);
107char *ssh_gssapi_last_error(Gssctxt *ctxt, OM_uint32 *maj, OM_uint32 *min);
108void ssh_gssapi_build_ctx(Gssctxt **ctx);
109void ssh_gssapi_delete_ctx(Gssctxt **ctx);
110OM_uint32 ssh_gssapi_server_ctx(Gssctxt **ctx, gss_OID oid);
111
112/* In the server */
113int ssh_gssapi_userok(char *name);
114
115void ssh_gssapi_do_child(char ***envp, u_int *envsizep);
116void ssh_gssapi_cleanup_creds(void *ignored);
117void ssh_gssapi_storecreds(void);
118
119#endif /* GSSAPI */
120
121#endif /* _SSH_GSS_H */
diff --git a/ssh-keygen.0 b/ssh-keygen.0
index 515d9f94c..2db957554 100644
--- a/ssh-keygen.0
+++ b/ssh-keygen.0
@@ -15,12 +15,18 @@ SYNOPSIS
15 ssh-keygen -B [-f input_keyfile] 15 ssh-keygen -B [-f input_keyfile]
16 ssh-keygen -D reader 16 ssh-keygen -D reader
17 ssh-keygen -U reader [-f input_keyfile] 17 ssh-keygen -U reader [-f input_keyfile]
18 ssh-keygen -r hostname [-f input_keyfile] [-g]
19 ssh-keygen -G output_file [-b bits] [-M memory] [-S start_point]
20 ssh-keygen -T output_file -f input_file [-a num_trials] [-W generator]
18 21
19DESCRIPTION 22DESCRIPTION
20 ssh-keygen generates, manages and converts authentication keys for 23 ssh-keygen generates, manages and converts authentication keys for
21 ssh(1). ssh-keygen can create RSA keys for use by SSH protocol version 1 24 ssh(1). ssh-keygen can create RSA keys for use by SSH protocol version 1
22 and RSA or DSA keys for use by SSH protocol version 2. The type of key to 25 and RSA or DSA keys for use by SSH protocol version 2. The type of key
23 be generated is specified with the -t option. 26 to be generated is specified with the -t option.
27
28 ssh-keygen is also used to generate groups for use in Diffie-Hellman
29 group exchange (DH-GEX). See the MODULI GENERATION section for details.
24 30
25 Normally each user wishing to use SSH with RSA or DSA authentication runs 31 Normally each user wishing to use SSH with RSA or DSA authentication runs
26 this once to create the authentication key in $HOME/.ssh/identity, 32 this once to create the authentication key in $HOME/.ssh/identity,
@@ -56,6 +62,10 @@ DESCRIPTION
56 62
57 The options are as follows: 63 The options are as follows:
58 64
65 -a trials
66 Specifies the number of primality tests to perform when screening
67 DH-GEX candidates using the -T command.
68
59 -b bits 69 -b bits
60 Specifies the number of bits in the key to create. Minimum is 70 Specifies the number of bits in the key to create. Minimum is
61 512 bits. Generally, 1024 bits is considered sufficient. The 71 512 bits. Generally, 1024 bits is considered sufficient. The
@@ -71,6 +81,8 @@ DESCRIPTION
71 This option allows exporting keys for use by several commercial 81 This option allows exporting keys for use by several commercial
72 SSH implementations. 82 SSH implementations.
73 83
84 -g Use generic DNS resource record format.
85
74 -f filename 86 -f filename
75 Specifies the filename of the key file. 87 Specifies the filename of the key file.
76 88
@@ -108,15 +120,71 @@ DESCRIPTION
108 -D reader 120 -D reader
109 Download the RSA public key stored in the smartcard in reader. 121 Download the RSA public key stored in the smartcard in reader.
110 122
123 -G output_file
124 Generate candidate primes for DH-GEX. These primes must be
125 screened for safety (using the -T option) before use.
126
127 -M memory
128 Specify the amount of memory to use (in megabytes) when generat-
129 ing candidate moduli for DH-GEX.
130
111 -N new_passphrase 131 -N new_passphrase
112 Provides the new passphrase. 132 Provides the new passphrase.
113 133
114 -P passphrase 134 -P passphrase
115 Provides the (old) passphrase. 135 Provides the (old) passphrase.
116 136
137 -S start
138 Specify start point (in hex) when generating candidate moduli for
139 DH-GEX.
140
141 -T output_file
142 Test DH group exchange candidate primes (generated using the -G
143 option) for safety.
144
145 -W generator
146 Specify desired generator when testing candidate moduli for DH-
147 GEX.
148
117 -U reader 149 -U reader
118 Upload an existing RSA private key into the smartcard in reader. 150 Upload an existing RSA private key into the smartcard in reader.
119 151
152 -r hostname
153 Print DNS resource record with the specified hostname.
154
155MODULI GENERATION
156 ssh-keygen may be used to generate groups for the Diffie-Hellman Group
157 Exchange (DH-GEX) protocol. Generating these groups is a two-step pro-
158 cess: first, candidate primes are generated using a fast, but memory
159 intensive process. These candidate primes are then tested for suitabil-
160 ity (a CPU-intensive process).
161
162 Generation of primes is performed using the -G option. The desired
163 length of the primes may be specified by the -b option. For example:
164
165 ssh-keygen -G moduli-2048.candidates -b 2048
166
167 By default, the search for primes begins at a random point in the desired
168 length range. This may be overridden using the -S option, which speci-
169 fies a different start point (in hex).
170
171 Once a set of candidates have been generated, they must be tested for
172 suitability. This may be performed using the -T option. In this mode
173 ssh-keygen will read candidates from standard input (or a file specified
174 using the -f option). For example:
175
176 ssh-keygen -T moduli-2048 -f moduli-2048.candidates
177
178 By default, each candidate will be subjected to 100 primality tests.
179 This may be overridden using the -a option. The DH generator value will
180 be chosen automatically for the prime under consideration. If a specific
181 generator is desired, it may be requested using the -W option. Valid
182 generator values are 2, 3 and 5.
183
184 Screened DH groups may be installed in /etc/moduli. It is important that
185 this file contains moduli of a range of bit lengths and that both ends of
186 a connection share common moduli.
187
120FILES 188FILES
121 $HOME/.ssh/identity 189 $HOME/.ssh/identity
122 Contains the protocol version 1 RSA authentication identity of 190 Contains the protocol version 1 RSA authentication identity of
@@ -166,6 +234,16 @@ FILES
166 to log in using public key authentication. There is no need to 234 to log in using public key authentication. There is no need to
167 keep the contents of this file secret. 235 keep the contents of this file secret.
168 236
237 /etc/moduli
238 Contains Diffie-Hellman groups used for DH-GEX. The file format
239 is described in moduli(5).
240
241SEE ALSO
242 ssh(1), ssh-add(1), ssh-agent(1), moduli(5), sshd(8)
243
244 J. Galbraith and R. Thayer, SECSH Public Key File Format, draft-ietf-
245 secsh-publickeyfile-01.txt, March 2001, work in progress material.
246
169AUTHORS 247AUTHORS
170 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 248 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
171 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 249 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
@@ -173,10 +251,4 @@ AUTHORS
173 ated OpenSSH. Markus Friedl contributed the support for SSH protocol 251 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
174 versions 1.5 and 2.0. 252 versions 1.5 and 2.0.
175 253
176SEE ALSO
177 ssh(1), ssh-add(1), ssh-agent(1), sshd(8)
178
179 J. Galbraith and R. Thayer, SECSH Public Key File Format, draft-ietf-
180 secsh-publickeyfile-01.txt, March 2001, work in progress material.
181
182BSD September 25, 1999 BSD 254BSD September 25, 1999 BSD
diff --git a/ssh-keygen.1 b/ssh-keygen.1
index 000e8ff2a..dc4bcacd0 100644
--- a/ssh-keygen.1
+++ b/ssh-keygen.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keygen.1,v 1.56 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: ssh-keygen.1,v 1.60 2003/07/28 09:49:56 djm Exp $
2.\" 2.\"
3.\" -*- nroff -*- 3.\" -*- nroff -*-
4.\" 4.\"
@@ -83,17 +83,38 @@
83.Nm ssh-keygen 83.Nm ssh-keygen
84.Fl U Ar reader 84.Fl U Ar reader
85.Op Fl f Ar input_keyfile 85.Op Fl f Ar input_keyfile
86.Nm ssh-keygen
87.Fl r Ar hostname
88.Op Fl f Ar input_keyfile
89.Op Fl g
90.Nm ssh-keygen
91.Fl G Ar output_file
92.Op Fl b Ar bits
93.Op Fl M Ar memory
94.Op Fl S Ar start_point
95.Nm ssh-keygen
96.Fl T Ar output_file
97.Fl f Ar input_file
98.Op Fl a Ar num_trials
99.Op Fl W Ar generator
86.Sh DESCRIPTION 100.Sh DESCRIPTION
87.Nm 101.Nm
88generates, manages and converts authentication keys for 102generates, manages and converts authentication keys for
89.Xr ssh 1 . 103.Xr ssh 1 .
90.Nm 104.Nm
91can create RSA keys for use by SSH protocol version 1 and RSA or DSA 105can create RSA keys for use by SSH protocol version 1 and RSA or DSA
92keys for use by SSH protocol version 2. The type of key to be generated 106keys for use by SSH protocol version 2.
93is specified with the 107The type of key to be generated is specified with the
94.Fl t 108.Fl t
95option. 109option.
96.Pp 110.Pp
111.Nm
112is also used to generate groups for use in Diffie-Hellman group
113exchange (DH-GEX).
114See the
115.Sx MODULI GENERATION
116section for details.
117.Pp
97Normally each user wishing to use SSH 118Normally each user wishing to use SSH
98with RSA or DSA authentication runs this once to create the authentication 119with RSA or DSA authentication runs this once to create the authentication
99key in 120key in
@@ -146,6 +167,11 @@ should be placed to be activated.
146.Pp 167.Pp
147The options are as follows: 168The options are as follows:
148.Bl -tag -width Ds 169.Bl -tag -width Ds
170.It Fl a Ar trials
171Specifies the number of primality tests to perform when screening DH-GEX
172candidates using the
173.Fl T
174command.
149.It Fl b Ar bits 175.It Fl b Ar bits
150Specifies the number of bits in the key to create. 176Specifies the number of bits in the key to create.
151Minimum is 512 bits. 177Minimum is 512 bits.
@@ -163,6 +189,8 @@ print the key in a
163to stdout. 189to stdout.
164This option allows exporting keys for use by several commercial 190This option allows exporting keys for use by several commercial
165SSH implementations. 191SSH implementations.
192.It Fl g
193Use generic DNS resource record format.
166.It Fl f Ar filename 194.It Fl f Ar filename
167Specifies the filename of the key file. 195Specifies the filename of the key file.
168.It Fl i 196.It Fl i
@@ -211,14 +239,88 @@ Provides the new comment.
211.It Fl D Ar reader 239.It Fl D Ar reader
212Download the RSA public key stored in the smartcard in 240Download the RSA public key stored in the smartcard in
213.Ar reader . 241.Ar reader .
242.It Fl G Ar output_file
243Generate candidate primes for DH-GEX.
244These primes must be screened for
245safety (using the
246.Fl T
247option) before use.
248.It Fl M Ar memory
249Specify the amount of memory to use (in megabytes) when generating
250candidate moduli for DH-GEX.
214.It Fl N Ar new_passphrase 251.It Fl N Ar new_passphrase
215Provides the new passphrase. 252Provides the new passphrase.
216.It Fl P Ar passphrase 253.It Fl P Ar passphrase
217Provides the (old) passphrase. 254Provides the (old) passphrase.
255.It Fl S Ar start
256Specify start point (in hex) when generating candidate moduli for DH-GEX.
257.It Fl T Ar output_file
258Test DH group exchange candidate primes (generated using the
259.Fl G
260option) for safety.
261.It Fl W Ar generator
262Specify desired generator when testing candidate moduli for DH-GEX.
218.It Fl U Ar reader 263.It Fl U Ar reader
219Upload an existing RSA private key into the smartcard in 264Upload an existing RSA private key into the smartcard in
220.Ar reader . 265.Ar reader .
266.It Fl r Ar hostname
267Print DNS resource record with the specified
268.Ar hostname .
221.El 269.El
270.Sh MODULI GENERATION
271.Nm
272may be used to generate groups for the Diffie-Hellman Group Exchange
273(DH-GEX) protocol.
274Generating these groups is a two-step process: first, candidate
275primes are generated using a fast, but memory intensive process.
276These candidate primes are then tested for suitability (a CPU-intensive
277process).
278.Pp
279Generation of primes is performed using the
280.Fl G
281option.
282The desired length of the primes may be specified by the
283.Fl b
284option.
285For example:
286.Pp
287.Dl ssh-keygen -G moduli-2048.candidates -b 2048
288.Pp
289By default, the search for primes begins at a random point in the
290desired length range.
291This may be overridden using the
292.Fl S
293option, which specifies a different start point (in hex).
294.Pp
295Once a set of candidates have been generated, they must be tested for
296suitability.
297This may be performed using the
298.Fl T
299option.
300In this mode
301.Nm
302will read candidates from standard input (or a file specified using the
303.Fl f
304option).
305For example:
306.Pp
307.Dl ssh-keygen -T moduli-2048 -f moduli-2048.candidates
308.Pp
309By default, each candidate will be subjected to 100 primality tests.
310This may be overridden using the
311.Fl a
312option.
313The DH generator value will be chosen automatically for the
314prime under consideration.
315If a specific generator is desired, it may be requested using the
316.Fl W
317option.
318Valid generator values are 2, 3 and 5.
319.Pp
320Screened DH groups may be installed in
321.Pa /etc/moduli .
322It is important that this file contains moduli of a range of bit lengths and
323that both ends of a connection share common moduli.
222.Sh FILES 324.Sh FILES
223.Bl -tag -width Ds 325.Bl -tag -width Ds
224.It Pa $HOME/.ssh/identity 326.It Pa $HOME/.ssh/identity
@@ -275,20 +377,16 @@ The contents of this file should be added to
275on all machines 377on all machines
276where the user wishes to log in using public key authentication. 378where the user wishes to log in using public key authentication.
277There is no need to keep the contents of this file secret. 379There is no need to keep the contents of this file secret.
380.It Pa /etc/moduli
381Contains Diffie-Hellman groups used for DH-GEX.
382The file format is described in
383.Xr moduli 5 .
278.El 384.El
279.Sh AUTHORS
280OpenSSH is a derivative of the original and free
281ssh 1.2.12 release by Tatu Ylonen.
282Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
283Theo de Raadt and Dug Song
284removed many bugs, re-added newer features and
285created OpenSSH.
286Markus Friedl contributed the support for SSH
287protocol versions 1.5 and 2.0.
288.Sh SEE ALSO 385.Sh SEE ALSO
289.Xr ssh 1 , 386.Xr ssh 1 ,
290.Xr ssh-add 1 , 387.Xr ssh-add 1 ,
291.Xr ssh-agent 1 , 388.Xr ssh-agent 1 ,
389.Xr moduli 5 ,
292.Xr sshd 8 390.Xr sshd 8
293.Rs 391.Rs
294.%A J. Galbraith 392.%A J. Galbraith
@@ -298,3 +396,12 @@ protocol versions 1.5 and 2.0.
298.%D March 2001 396.%D March 2001
299.%O work in progress material 397.%O work in progress material
300.Re 398.Re
399.Sh AUTHORS
400OpenSSH is a derivative of the original and free
401ssh 1.2.12 release by Tatu Ylonen.
402Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
403Theo de Raadt and Dug Song
404removed many bugs, re-added newer features and
405created OpenSSH.
406Markus Friedl contributed the support for SSH
407protocol versions 1.5 and 2.0.
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 6a872bcfd..e74d3cd37 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: ssh-keygen.c,v 1.102 2002/11/26 00:45:03 wcobb Exp $"); 15RCSID("$OpenBSD: ssh-keygen.c,v 1.108 2003/08/14 16:08:58 markus Exp $");
16 16
17#include <openssl/evp.h> 17#include <openssl/evp.h>
18#include <openssl/pem.h> 18#include <openssl/pem.h>
@@ -27,10 +27,14 @@ RCSID("$OpenBSD: ssh-keygen.c,v 1.102 2002/11/26 00:45:03 wcobb Exp $");
27#include "pathnames.h" 27#include "pathnames.h"
28#include "log.h" 28#include "log.h"
29#include "readpass.h" 29#include "readpass.h"
30#include "moduli.h"
30 31
31#ifdef SMARTCARD 32#ifdef SMARTCARD
32#include "scard.h" 33#include "scard.h"
33#endif 34#endif
35#ifdef DNS
36#include "dns.h"
37#endif
34 38
35/* Number of bits in the RSA/DSA key. This value can be changed on the command line. */ 39/* Number of bits in the RSA/DSA key. This value can be changed on the command line. */
36int bits = 1024; 40int bits = 1024;
@@ -70,6 +74,7 @@ char *identity_comment = NULL;
70int convert_to_ssh2 = 0; 74int convert_to_ssh2 = 0;
71int convert_from_ssh2 = 0; 75int convert_from_ssh2 = 0;
72int print_public = 0; 76int print_public = 0;
77int print_generic = 0;
73 78
74char *key_type_name = NULL; 79char *key_type_name = NULL;
75 80
@@ -163,6 +168,10 @@ do_convert_to_ssh2(struct passwd *pw)
163 exit(1); 168 exit(1);
164 } 169 }
165 } 170 }
171 if (k->type == KEY_RSA1) {
172 fprintf(stderr, "version 1 keys are not supported\n");
173 exit(1);
174 }
166 if (key_to_blob(k, &blob, &len) <= 0) { 175 if (key_to_blob(k, &blob, &len) <= 0) {
167 fprintf(stderr, "key_to_blob failed\n"); 176 fprintf(stderr, "key_to_blob failed\n");
168 exit(1); 177 exit(1);
@@ -415,7 +424,7 @@ do_upload(struct passwd *pw, const char *sc_reader_id)
415 key_free(prv); 424 key_free(prv);
416 if (ret < 0) 425 if (ret < 0)
417 exit(1); 426 exit(1);
418 log("loading key done"); 427 logit("loading key done");
419 exit(0); 428 exit(0);
420} 429}
421 430
@@ -616,6 +625,38 @@ do_change_passphrase(struct passwd *pw)
616 exit(0); 625 exit(0);
617} 626}
618 627
628#ifdef DNS
629/*
630 * Print the SSHFP RR.
631 */
632static void
633do_print_resource_record(struct passwd *pw, char *hostname)
634{
635 Key *public;
636 char *comment = NULL;
637 struct stat st;
638
639 if (!have_identity)
640 ask_filename(pw, "Enter file in which the key is");
641 if (stat(identity_file, &st) < 0) {
642 perror(identity_file);
643 exit(1);
644 }
645 public = key_load_public(identity_file, &comment);
646 if (public != NULL) {
647 export_dns_rr(hostname, public, stdout, print_generic);
648 key_free(public);
649 xfree(comment);
650 exit(0);
651 }
652 if (comment)
653 xfree(comment);
654
655 printf("failed to read v2 public key from %s.\n", identity_file);
656 exit(1);
657}
658#endif /* DNS */
659
619/* 660/*
620 * Change the comment of a private key file. 661 * Change the comment of a private key file.
621 */ 662 */
@@ -722,6 +763,7 @@ usage(void)
722 fprintf(stderr, " -c Change comment in private and public key files.\n"); 763 fprintf(stderr, " -c Change comment in private and public key files.\n");
723 fprintf(stderr, " -e Convert OpenSSH to IETF SECSH key file.\n"); 764 fprintf(stderr, " -e Convert OpenSSH to IETF SECSH key file.\n");
724 fprintf(stderr, " -f filename Filename of the key file.\n"); 765 fprintf(stderr, " -f filename Filename of the key file.\n");
766 fprintf(stderr, " -g Use generic DNS resource record format.\n");
725 fprintf(stderr, " -i Convert IETF SECSH to OpenSSH key file.\n"); 767 fprintf(stderr, " -i Convert IETF SECSH to OpenSSH key file.\n");
726 fprintf(stderr, " -l Show fingerprint of key file.\n"); 768 fprintf(stderr, " -l Show fingerprint of key file.\n");
727 fprintf(stderr, " -p Change passphrase of private key file.\n"); 769 fprintf(stderr, " -p Change passphrase of private key file.\n");
@@ -732,11 +774,17 @@ usage(void)
732 fprintf(stderr, " -C comment Provide new comment.\n"); 774 fprintf(stderr, " -C comment Provide new comment.\n");
733 fprintf(stderr, " -N phrase Provide new passphrase.\n"); 775 fprintf(stderr, " -N phrase Provide new passphrase.\n");
734 fprintf(stderr, " -P phrase Provide old passphrase.\n"); 776 fprintf(stderr, " -P phrase Provide old passphrase.\n");
777#ifdef DNS
778 fprintf(stderr, " -r hostname Print DNS resource record.\n");
779#endif /* DNS */
735#ifdef SMARTCARD 780#ifdef SMARTCARD
736 fprintf(stderr, " -D reader Download public key from smartcard.\n"); 781 fprintf(stderr, " -D reader Download public key from smartcard.\n");
737 fprintf(stderr, " -U reader Upload private key to smartcard.\n"); 782 fprintf(stderr, " -U reader Upload private key to smartcard.\n");
738#endif /* SMARTCARD */ 783#endif /* SMARTCARD */
739 784
785 fprintf(stderr, " -G file Generate candidates for DH-GEX moduli\n");
786 fprintf(stderr, " -T file Screen candidates for DH-GEX moduli\n");
787
740 exit(1); 788 exit(1);
741} 789}
742 790
@@ -747,19 +795,25 @@ int
747main(int ac, char **av) 795main(int ac, char **av)
748{ 796{
749 char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2; 797 char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2;
750 char *reader_id = NULL; 798 char out_file[MAXPATHLEN], *reader_id = NULL;
799 char *resource_record_hostname = NULL;
751 Key *private, *public; 800 Key *private, *public;
752 struct passwd *pw; 801 struct passwd *pw;
753 struct stat st; 802 struct stat st;
754 int opt, type, fd, download = 0; 803 int opt, type, fd, download = 0, memory = 0;
804 int generator_wanted = 0, trials = 100;
805 int do_gen_candidates = 0, do_screen_candidates = 0;
806 BIGNUM *start = NULL;
755 FILE *f; 807 FILE *f;
756 808
757 extern int optind; 809 extern int optind;
758 extern char *optarg; 810 extern char *optarg;
759 811
760 __progname = get_progname(av[0]); 812 __progname = ssh_get_progname(av[0]);
761 813
762 SSLeay_add_all_algorithms(); 814 SSLeay_add_all_algorithms();
815 log_init(av[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
816
763 init_rng(); 817 init_rng();
764 seed_rng(); 818 seed_rng();
765 819
@@ -774,7 +828,8 @@ main(int ac, char **av)
774 exit(1); 828 exit(1);
775 } 829 }
776 830
777 while ((opt = getopt(ac, av, "deiqpclBRxXyb:f:t:U:D:P:N:C:")) != -1) { 831 while ((opt = getopt(ac, av,
832 "degiqpclBRxXyb:f:t:U:D:P:N:C:r:g:T:G:M:S:a:W:")) != -1) {
778 switch (opt) { 833 switch (opt) {
779 case 'b': 834 case 'b':
780 bits = atoi(optarg); 835 bits = atoi(optarg);
@@ -799,6 +854,9 @@ main(int ac, char **av)
799 strlcpy(identity_file, optarg, sizeof(identity_file)); 854 strlcpy(identity_file, optarg, sizeof(identity_file));
800 have_identity = 1; 855 have_identity = 1;
801 break; 856 break;
857 case 'g':
858 print_generic = 1;
859 break;
802 case 'P': 860 case 'P':
803 identity_passphrase = optarg; 861 identity_passphrase = optarg;
804 break; 862 break;
@@ -839,6 +897,42 @@ main(int ac, char **av)
839 case 'U': 897 case 'U':
840 reader_id = optarg; 898 reader_id = optarg;
841 break; 899 break;
900 case 'r':
901 resource_record_hostname = optarg;
902 break;
903 case 'W':
904 generator_wanted = atoi(optarg);
905 if (generator_wanted < 1)
906 fatal("Desired generator has bad value.");
907 break;
908 case 'a':
909 trials = atoi(optarg);
910 if (trials < TRIAL_MINIMUM) {
911 fatal("Minimum primality trials is %d",
912 TRIAL_MINIMUM);
913 }
914 break;
915 case 'M':
916 memory = atoi(optarg);
917 if (memory != 0 &&
918 (memory < LARGE_MINIMUM || memory > LARGE_MAXIMUM)) {
919 fatal("Invalid memory amount (min %ld, max %ld)",
920 LARGE_MINIMUM, LARGE_MAXIMUM);
921 }
922 break;
923 case 'G':
924 do_gen_candidates = 1;
925 strlcpy(out_file, optarg, sizeof(out_file));
926 break;
927 case 'T':
928 do_screen_candidates = 1;
929 strlcpy(out_file, optarg, sizeof(out_file));
930 break;
931 case 'S':
932 /* XXX - also compare length against bits */
933 if (BN_hex2bn(&start, optarg) == 0)
934 fatal("Invalid start point.");
935 break;
842 case '?': 936 case '?':
843 default: 937 default:
844 usage(); 938 usage();
@@ -864,6 +958,13 @@ main(int ac, char **av)
864 do_convert_from_ssh2(pw); 958 do_convert_from_ssh2(pw);
865 if (print_public) 959 if (print_public)
866 do_print_public(pw); 960 do_print_public(pw);
961 if (resource_record_hostname != NULL) {
962#ifdef DNS
963 do_print_resource_record(pw, resource_record_hostname);
964#else /* DNS */
965 fatal("no DNS support.");
966#endif /* DNS */
967 }
867 if (reader_id != NULL) { 968 if (reader_id != NULL) {
868#ifdef SMARTCARD 969#ifdef SMARTCARD
869 if (download) 970 if (download)
@@ -875,6 +976,42 @@ main(int ac, char **av)
875#endif /* SMARTCARD */ 976#endif /* SMARTCARD */
876 } 977 }
877 978
979 if (do_gen_candidates) {
980 FILE *out = fopen(out_file, "w");
981
982 if (out == NULL) {
983 error("Couldn't open modulus candidate file \"%s\": %s",
984 out_file, strerror(errno));
985 return (1);
986 }
987 if (gen_candidates(out, memory, bits, start) != 0)
988 fatal("modulus candidate generation failed\n");
989
990 return (0);
991 }
992
993 if (do_screen_candidates) {
994 FILE *in;
995 FILE *out = fopen(out_file, "w");
996
997 if (have_identity && strcmp(identity_file, "-") != 0) {
998 if ((in = fopen(identity_file, "r")) == NULL) {
999 fatal("Couldn't open modulus candidate "
1000 "file \"%s\": %s", identity_file,
1001 strerror(errno));
1002 }
1003 } else
1004 in = stdin;
1005
1006 if (out == NULL) {
1007 fatal("Couldn't open moduli file \"%s\": %s",
1008 out_file, strerror(errno));
1009 }
1010 if (prime_test(in, out, trials, generator_wanted) != 0)
1011 fatal("modulus screening failed\n");
1012 return (0);
1013 }
1014
878 arc4random_stir(); 1015 arc4random_stir();
879 1016
880 if (key_type_name == NULL) { 1017 if (key_type_name == NULL) {
diff --git a/ssh-keyscan.0 b/ssh-keyscan.0
index 19031a27f..23d9f943c 100644
--- a/ssh-keyscan.0
+++ b/ssh-keyscan.0
@@ -57,17 +57,6 @@ SECURITY
57 detection of tampered keyfiles or man in the middle attacks which have 57 detection of tampered keyfiles or man in the middle attacks which have
58 begun after the ssh_known_hosts file was created. 58 begun after the ssh_known_hosts file was created.
59 59
60EXAMPLES
61 Print the rsa1 host key for machine hostname:
62
63 $ ssh-keyscan hostname
64
65 Find all hosts from the file ssh_hosts which have new or different keys
66 from those in the sorted file ssh_known_hosts:
67
68 $ ssh-keyscan -t rsa,dsa -f ssh_hosts | \
69 sort -u - ssh_known_hosts | diff ssh_known_hosts -
70
71FILES 60FILES
72 Input format: 61 Input format:
73 62
@@ -81,22 +70,33 @@ FILES
81 70
82 host-or-namelist keytype base64-encoded-key 71 host-or-namelist keytype base64-encoded-key
83 72
84 Where keytype is either M-bM-^@M-^\ssh-rsaM-bM-^@M-^] or M-bM-^@M-^\ssh-dsaM-bM-^@M-^]. 73 Where keytype is either M-bM-^@M-^\ssh-rsaM-bM-^@M-^] or M-bM-^@M-^\ssh-dssM-bM-^@M-^].
85 74
86 /etc/ssh/ssh_known_hosts 75 /etc/ssh/ssh_known_hosts
87 76
88BUGS 77EXAMPLES
89 It generates "Connection closed by remote host" messages on the consoles 78 Print the rsa1 host key for machine hostname:
90 of all the machines it scans if the server is older than version 2.9. 79
91 This is because it opens a connection to the ssh port, reads the public 80 $ ssh-keyscan hostname
92 key, and drops the connection as soon as it gets the key. 81
82 Find all hosts from the file ssh_hosts which have new or different keys
83 from those in the sorted file ssh_known_hosts:
84
85 $ ssh-keyscan -t rsa,dsa -f ssh_hosts | \
86 sort -u - ssh_known_hosts | diff ssh_known_hosts -
93 87
94SEE ALSO 88SEE ALSO
95 ssh(1), sshd(8) 89 ssh(1), sshd(8)
96 90
97AUTHORS 91AUTHORS
98 David Mazieres <dm@lcs.mit.edu> wrote the initial version, and Wayne 92 David Mazieres M-bM-^LM-)dm@lcs.mit.eduM-bM-^LM-* wrote the initial version, and
99 Davison <wayned@users.sourceforge.net> added support for protocol version 93 Wayne Davison M-bM-^LM-)wayned@users.sourceforge.netM-bM-^LM-* added support for protocol
100 2. 94 version 2.
95
96BUGS
97 It generates "Connection closed by remote host" messages on the consoles
98 of all the machines it scans if the server is older than version 2.9.
99 This is because it opens a connection to the ssh port, reads the public
100 key, and drops the connection as soon as it gets the key.
101 101
102BSD January 1, 1996 BSD 102BSD January 1, 1996 BSD
diff --git a/ssh-keyscan.1 b/ssh-keyscan.1
index f6596c481..572751f66 100644
--- a/ssh-keyscan.1
+++ b/ssh-keyscan.1
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keyscan.1,v 1.15 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: ssh-keyscan.1,v 1.17 2003/06/10 09:12:11 jmc Exp $
2.\" 2.\"
3.\" Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>. 3.\" Copyright 1995, 1996 by David Mazieres <dm@lcs.mit.edu>.
4.\" 4.\"
@@ -103,24 +103,6 @@ On the other hand, if the security model allows such a risk,
103.Nm 103.Nm
104can help in the detection of tampered keyfiles or man in the middle 104can help in the detection of tampered keyfiles or man in the middle
105attacks which have begun after the ssh_known_hosts file was created. 105attacks which have begun after the ssh_known_hosts file was created.
106.Sh EXAMPLES
107.Pp
108Print the
109.Pa rsa1
110host key for machine
111.Pa hostname :
112.Bd -literal
113$ ssh-keyscan hostname
114.Ed
115.Pp
116Find all hosts from the file
117.Pa ssh_hosts
118which have new or different keys from those in the sorted file
119.Pa ssh_known_hosts :
120.Bd -literal
121$ ssh-keyscan -t rsa,dsa -f ssh_hosts | \e\
122 sort -u - ssh_known_hosts | diff ssh_known_hosts -
123.Ed
124.Sh FILES 106.Sh FILES
125.Pa Input format: 107.Pa Input format:
126.Bd -literal 108.Bd -literal
@@ -142,19 +124,36 @@ Where
142is either 124is either
143.Dq ssh-rsa 125.Dq ssh-rsa
144or 126or
145.Dq ssh-dsa . 127.Dq ssh-dss .
146.Pp 128.Pp
147.Pa /etc/ssh/ssh_known_hosts 129.Pa /etc/ssh/ssh_known_hosts
148.Sh BUGS 130.Sh EXAMPLES
149It generates "Connection closed by remote host" messages on the consoles 131Print the
150of all the machines it scans if the server is older than version 2.9. 132.Pa rsa1
151This is because it opens a connection to the ssh port, reads the public 133host key for machine
152key, and drops the connection as soon as it gets the key. 134.Pa hostname :
135.Bd -literal
136$ ssh-keyscan hostname
137.Ed
138.Pp
139Find all hosts from the file
140.Pa ssh_hosts
141which have new or different keys from those in the sorted file
142.Pa ssh_known_hosts :
143.Bd -literal
144$ ssh-keyscan -t rsa,dsa -f ssh_hosts | \e
145 sort -u - ssh_known_hosts | diff ssh_known_hosts -
146.Ed
153.Sh SEE ALSO 147.Sh SEE ALSO
154.Xr ssh 1 , 148.Xr ssh 1 ,
155.Xr sshd 8 149.Xr sshd 8
156.Sh AUTHORS 150.Sh AUTHORS
157David Mazieres <dm@lcs.mit.edu> 151.An David Mazieres Aq dm@lcs.mit.edu
158wrote the initial version, and 152wrote the initial version, and
159Wayne Davison <wayned@users.sourceforge.net> 153.An Wayne Davison Aq wayned@users.sourceforge.net
160added support for protocol version 2. 154added support for protocol version 2.
155.Sh BUGS
156It generates "Connection closed by remote host" messages on the consoles
157of all the machines it scans if the server is older than version 2.9.
158This is because it opens a connection to the ssh port, reads the public
159key, and drops the connection as soon as it gets the key.
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 5b4eb82d1..9fa8aaebc 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -7,7 +7,7 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: ssh-keyscan.c,v 1.41 2003/02/16 17:09:57 markus Exp $"); 10RCSID("$OpenBSD: ssh-keyscan.c,v 1.44 2003/06/28 16:23:06 deraadt Exp $");
11 11
12#include "openbsd-compat/sys-queue.h" 12#include "openbsd-compat/sys-queue.h"
13 13
@@ -31,11 +31,7 @@ RCSID("$OpenBSD: ssh-keyscan.c,v 1.41 2003/02/16 17:09:57 markus Exp $");
31 31
32/* Flag indicating whether IPv4 or IPv6. This can be set on the command line. 32/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
33 Default value is AF_UNSPEC means both IPv4 and IPv6. */ 33 Default value is AF_UNSPEC means both IPv4 and IPv6. */
34#ifdef IPV4_DEFAULT
35int IPv4or6 = AF_INET;
36#else
37int IPv4or6 = AF_UNSPEC; 34int IPv4or6 = AF_UNSPEC;
38#endif
39 35
40int ssh_port = SSH_DEFAULT_PORT; 36int ssh_port = SSH_DEFAULT_PORT;
41 37
@@ -397,7 +393,7 @@ tcpconnect(char *host)
397 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0) 393 if ((gaierr = getaddrinfo(host, strport, &hints, &aitop)) != 0)
398 fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr)); 394 fatal("getaddrinfo %s: %s", host, gai_strerror(gaierr));
399 for (ai = aitop; ai; ai = ai->ai_next) { 395 for (ai = aitop; ai; ai = ai->ai_next) {
400 s = socket(ai->ai_family, SOCK_STREAM, 0); 396 s = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
401 if (s < 0) { 397 if (s < 0) {
402 error("socket: %s", strerror(errno)); 398 error("socket: %s", strerror(errno));
403 continue; 399 continue;
@@ -545,7 +541,7 @@ congreet(int s)
545 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", 541 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n",
546 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, 542 c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2,
547 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); 543 c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2);
548 if (atomicio(write, s, buf, n) != n) { 544 if (atomicio(vwrite, s, buf, n) != n) {
549 error("write (%s): %s", c->c_name, strerror(errno)); 545 error("write (%s): %s", c->c_name, strerror(errno));
550 confree(s); 546 confree(s);
551 return; 547 return;
@@ -685,7 +681,7 @@ fatal(const char *fmt,...)
685static void 681static void
686usage(void) 682usage(void)
687{ 683{
688 fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-f file]\n" 684 fprintf(stderr, "usage: %s [-v46] [-p port] [-T timeout] [-t type] [-f file]\n"
689 "\t\t [host | addrlist namelist] [...]\n", 685 "\t\t [host | addrlist namelist] [...]\n",
690 __progname); 686 __progname);
691 exit(1); 687 exit(1);
@@ -701,7 +697,7 @@ main(int argc, char **argv)
701 extern int optind; 697 extern int optind;
702 extern char *optarg; 698 extern char *optarg;
703 699
704 __progname = get_progname(argv[0]); 700 __progname = ssh_get_progname(argv[0]);
705 init_rng(); 701 init_rng();
706 seed_rng(); 702 seed_rng();
707 TAILQ_INIT(&tq); 703 TAILQ_INIT(&tq);
diff --git a/ssh-keysign.0 b/ssh-keysign.0
index 6fb9ca59b..5e9c6f9c7 100644
--- a/ssh-keysign.0
+++ b/ssh-keysign.0
@@ -33,10 +33,10 @@ FILES
33SEE ALSO 33SEE ALSO
34 ssh(1), ssh-keygen(1), ssh_config(5), sshd(8) 34 ssh(1), ssh-keygen(1), ssh_config(5), sshd(8)
35 35
36AUTHORS
37 Markus Friedl <markus@openbsd.org>
38
39HISTORY 36HISTORY
40 ssh-keysign first appeared in OpenBSD 3.2. 37 ssh-keysign first appeared in OpenBSD 3.2.
41 38
39AUTHORS
40 Markus Friedl M-bM-^LM-)markus@openbsd.orgM-bM-^LM-*
41
42BSD May 24, 2002 BSD 42BSD May 24, 2002 BSD
diff --git a/ssh-keysign.8 b/ssh-keysign.8
index 2e3f8ff3e..a17e8d5cf 100644
--- a/ssh-keysign.8
+++ b/ssh-keysign.8
@@ -1,4 +1,4 @@
1.\" $OpenBSD: ssh-keysign.8,v 1.6 2003/03/28 10:11:43 jmc Exp $ 1.\" $OpenBSD: ssh-keysign.8,v 1.7 2003/06/10 09:12:11 jmc Exp $
2.\" 2.\"
3.\" Copyright (c) 2002 Markus Friedl. All rights reserved. 3.\" Copyright (c) 2002 Markus Friedl. All rights reserved.
4.\" 4.\"
@@ -74,9 +74,9 @@ must be set-uid root if hostbased authentication is used.
74.Xr ssh-keygen 1 , 74.Xr ssh-keygen 1 ,
75.Xr ssh_config 5 , 75.Xr ssh_config 5 ,
76.Xr sshd 8 76.Xr sshd 8
77.Sh AUTHORS
78Markus Friedl <markus@openbsd.org>
79.Sh HISTORY 77.Sh HISTORY
80.Nm 78.Nm
81first appeared in 79first appeared in
82.Ox 3.2 . 80.Ox 3.2 .
81.Sh AUTHORS
82.An Markus Friedl Aq markus@openbsd.org
diff --git a/ssh-keysign.c b/ssh-keysign.c
index 26c8faad2..c7ca5c4e4 100644
--- a/ssh-keysign.c
+++ b/ssh-keysign.c
@@ -22,7 +22,7 @@
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 23 */
24#include "includes.h" 24#include "includes.h"
25RCSID("$OpenBSD: ssh-keysign.c,v 1.10 2003/03/13 11:42:19 markus Exp $"); 25RCSID("$OpenBSD: ssh-keysign.c,v 1.13 2003/07/03 08:09:06 djm Exp $");
26 26
27#include <openssl/evp.h> 27#include <openssl/evp.h>
28#include <openssl/rand.h> 28#include <openssl/rand.h>
@@ -42,7 +42,8 @@ RCSID("$OpenBSD: ssh-keysign.c,v 1.10 2003/03/13 11:42:19 markus Exp $");
42#include "pathnames.h" 42#include "pathnames.h"
43#include "readconf.h" 43#include "readconf.h"
44 44
45uid_t original_real_uid; /* XXX readconf.c needs this */ 45/* XXX readconf.c needs these */
46uid_t original_real_uid;
46 47
47#ifdef HAVE___PROGNAME 48#ifdef HAVE___PROGNAME
48extern char *__progname; 49extern char *__progname;
@@ -55,7 +56,7 @@ valid_request(struct passwd *pw, char *host, Key **ret, u_char *data,
55 u_int datalen) 56 u_int datalen)
56{ 57{
57 Buffer b; 58 Buffer b;
58 Key *key; 59 Key *key = NULL;
59 u_char *pkblob; 60 u_char *pkblob;
60 u_int blen, len; 61 u_int blen, len;
61 char *pkalg, *p; 62 char *pkalg, *p;
diff --git a/ssh-rand-helper.c b/ssh-rand-helper.c
index 68b77b208..7e65e4569 100644
--- a/ssh-rand-helper.c
+++ b/ssh-rand-helper.c
@@ -39,7 +39,7 @@
39#include "pathnames.h" 39#include "pathnames.h"
40#include "log.h" 40#include "log.h"
41 41
42RCSID("$Id: ssh-rand-helper.c,v 1.10 2003/03/17 05:13:53 djm Exp $"); 42RCSID("$Id: ssh-rand-helper.c,v 1.13 2003/08/21 23:34:41 djm Exp $");
43 43
44/* Number of bytes we write out */ 44/* Number of bytes we write out */
45#define OUTPUT_SEED_SIZE 48 45#define OUTPUT_SEED_SIZE 48
@@ -187,7 +187,7 @@ reopen:
187 msg[0] = 0x02; 187 msg[0] = 0x02;
188 msg[1] = len; 188 msg[1] = len;
189 189
190 if (atomicio(write, fd, msg, sizeof(msg)) != sizeof(msg)) { 190 if (atomicio(vwrite, fd, msg, sizeof(msg)) != sizeof(msg)) {
191 if (errno == EPIPE && errors < 10) { 191 if (errno == EPIPE && errors < 10) {
192 close(fd); 192 close(fd);
193 errors++; 193 errors++;
@@ -532,7 +532,7 @@ prng_check_seedfile(char *filename)
532 /* mode 0600, owned by root or the current user? */ 532 /* mode 0600, owned by root or the current user? */
533 if (((st.st_mode & 0177) != 0) || !(st.st_uid == getuid())) { 533 if (((st.st_mode & 0177) != 0) || !(st.st_uid == getuid())) {
534 debug("WARNING: PRNG seedfile %.100s must be mode 0600, " 534 debug("WARNING: PRNG seedfile %.100s must be mode 0600, "
535 "owned by uid %d", filename, getuid()); 535 "owned by uid %li", filename, (long int)getuid());
536 return 0; 536 return 0;
537 } 537 }
538 538
@@ -550,7 +550,7 @@ prng_write_seedfile(void)
550 pw = getpwuid(getuid()); 550 pw = getpwuid(getuid());
551 if (pw == NULL) 551 if (pw == NULL)
552 fatal("Couldn't get password entry for current user " 552 fatal("Couldn't get password entry for current user "
553 "(%i): %s", getuid(), strerror(errno)); 553 "(%li): %s", (long int)getuid(), strerror(errno));
554 554
555 /* Try to ensure that the parent directory is there */ 555 /* Try to ensure that the parent directory is there */
556 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 556 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
@@ -572,7 +572,7 @@ prng_write_seedfile(void)
572 debug("WARNING: couldn't access PRNG seedfile %.100s " 572 debug("WARNING: couldn't access PRNG seedfile %.100s "
573 "(%.100s)", filename, strerror(errno)); 573 "(%.100s)", filename, strerror(errno));
574 } else { 574 } else {
575 if (atomicio(write, fd, &seed, sizeof(seed)) < sizeof(seed)) 575 if (atomicio(vwrite, fd, &seed, sizeof(seed)) < sizeof(seed))
576 fatal("problem writing PRNG seedfile %.100s " 576 fatal("problem writing PRNG seedfile %.100s "
577 "(%.100s)", filename, strerror(errno)); 577 "(%.100s)", filename, strerror(errno));
578 close(fd); 578 close(fd);
@@ -589,7 +589,7 @@ prng_read_seedfile(void)
589 pw = getpwuid(getuid()); 589 pw = getpwuid(getuid());
590 if (pw == NULL) 590 if (pw == NULL)
591 fatal("Couldn't get password entry for current user " 591 fatal("Couldn't get password entry for current user "
592 "(%i): %s", getuid(), strerror(errno)); 592 "(%li): %s", (long int)getuid(), strerror(errno));
593 593
594 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir, 594 snprintf(filename, sizeof(filename), "%.512s/%s", pw->pw_dir,
595 SSH_PRNG_SEED_FILE); 595 SSH_PRNG_SEED_FILE);
@@ -769,7 +769,7 @@ main(int argc, char **argv)
769 extern char *optarg; 769 extern char *optarg;
770 LogLevel ll; 770 LogLevel ll;
771 771
772 __progname = get_progname(argv[0]); 772 __progname = ssh_get_progname(argv[0]);
773 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1); 773 log_init(argv[0], SYSLOG_LEVEL_INFO, SYSLOG_FACILITY_USER, 1);
774 774
775 ll = SYSLOG_LEVEL_INFO; 775 ll = SYSLOG_LEVEL_INFO;
@@ -858,7 +858,7 @@ main(int argc, char **argv)
858 printf("%02x", (unsigned char)(buf[ret])); 858 printf("%02x", (unsigned char)(buf[ret]));
859 printf("\n"); 859 printf("\n");
860 } else 860 } else
861 ret = atomicio(write, STDOUT_FILENO, buf, bytes); 861 ret = atomicio(vwrite, STDOUT_FILENO, buf, bytes);
862 862
863 memset(buf, '\0', bytes); 863 memset(buf, '\0', bytes);
864 xfree(buf); 864 xfree(buf);
diff --git a/ssh-rsa.c b/ssh-rsa.c
index efbc9e664..53e5023f7 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -1,29 +1,20 @@
1/* 1/*
2 * Copyright (c) 2000 Markus Friedl. All rights reserved. 2 * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org>
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Permission to use, copy, modify, and distribute this software for any
5 * modification, are permitted provided that the following conditions 5 * purpose with or without fee is hereby granted, provided that the above
6 * are met: 6 * copyright notice and this permission notice appear in all copies.
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * 7 *
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 */ 15 */
24
25#include "includes.h" 16#include "includes.h"
26RCSID("$OpenBSD: ssh-rsa.c,v 1.28 2003/02/12 09:33:04 markus Exp $"); 17RCSID("$OpenBSD: ssh-rsa.c,v 1.30 2003/06/18 11:28:11 markus Exp $");
27 18
28#include <openssl/evp.h> 19#include <openssl/evp.h>
29#include <openssl/err.h> 20#include <openssl/err.h>
diff --git a/ssh.0 b/ssh.0
index 0baca2288..972ac45c7 100644
--- a/ssh.0
+++ b/ssh.0
@@ -6,7 +6,7 @@ NAME
6SYNOPSIS 6SYNOPSIS
7 ssh [-l login_name] hostname | user@hostname [command] 7 ssh [-l login_name] hostname | user@hostname [command]
8 8
9 ssh [-afgknqstvxACNTX1246] [-b bind_address] [-c cipher_spec] 9 ssh [-afgknqstvxACNTVX1246] [-b bind_address] [-c cipher_spec]
10 [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec] 10 [-e escape_char] [-i identity_file] [-l login_name] [-m mac_spec]
11 [-o option] [-p port] [-F configfile] [-L port:host:hostport] 11 [-o option] [-p port] [-F configfile] [-L port:host:hostport]
12 [-R port:host:hostport] [-D port] hostname | user@hostname [command] 12 [-R port:host:hostport] [-D port] hostname | user@hostname [command]
@@ -149,6 +149,9 @@ DESCRIPTION
149 149
150 ~? Display a list of escape characters 150 ~? Display a list of escape characters
151 151
152 ~B Send a BREAK to the remote system (only useful for SSH protocol
153 version 2 and if the peer supports it)
154
152 ~C Open command line (only useful for adding port forwardings using 155 ~C Open command line (only useful for adding port forwardings using
153 the -L and -R options) 156 the -L and -R options)
154 157
@@ -263,12 +266,12 @@ DESCRIPTION
263 ties specified in configuration files). 266 ties specified in configuration files).
264 267
265 -I smartcard_device 268 -I smartcard_device
266 Specifies which smartcard device to use. The argument is the 269 Specifies which smartcard device to use. The argument is the
267 device ssh should use to communicate with a smartcard used for 270 device ssh should use to communicate with a smartcard used for
268 storing the userM-bM-^@M-^Ys private RSA key. 271 storing the userM-bM-^@M-^Ys private RSA key.
269 272
270 -k Disables forwarding of Kerberos tickets and AFS tokens. This may 273 -k Disables forwarding of Kerberos tickets. This may also be speci-
271 also be specified on a per-host basis in the configuration file. 274 fied on a per-host basis in the configuration file.
272 275
273 -l login_name 276 -l login_name
274 Specifies the user to log in as on the remote machine. This also 277 Specifies the user to log in as on the remote machine. This also
@@ -305,10 +308,10 @@ DESCRIPTION
305 suppressed. 308 suppressed.
306 309
307 -s May be used to request invocation of a subsystem on the remote 310 -s May be used to request invocation of a subsystem on the remote
308 system. Subsystems are a feature of the SSH2 protocol which 311 system. Subsystems are a feature of the SSH2 protocol which
309 facilitate the use of SSH as a secure transport for other appli- 312 facilitate the use of SSH as a secure transport for other appli-
310 cations (eg. sftp). The subsystem is specified as the remote com- 313 cations (eg. sftp). The subsystem is specified as the remote
311 mand. 314 command.
312 315
313 -t Force pseudo-tty allocation. This can be used to execute arbi- 316 -t Force pseudo-tty allocation. This can be used to execute arbi-
314 trary screen-based programs on a remote machine, which can be 317 trary screen-based programs on a remote machine, which can be
@@ -319,8 +322,10 @@ DESCRIPTION
319 322
320 -v Verbose mode. Causes ssh to print debugging messages about its 323 -v Verbose mode. Causes ssh to print debugging messages about its
321 progress. This is helpful in debugging connection, authentica- 324 progress. This is helpful in debugging connection, authentica-
322 tion, and configuration problems. Multiple -v options increases 325 tion, and configuration problems. Multiple -v options increase
323 the verbosity. Maximum is 3. 326 the verbosity. The maximum is 3.
327
328 -V Display the version number and exit.
324 329
325 -x Disables X11 forwarding. 330 -x Disables X11 forwarding.
326 331
@@ -377,10 +382,10 @@ DESCRIPTION
377 side, and whenever a connection is made to this port, the connec- 382 side, and whenever a connection is made to this port, the connec-
378 tion is forwarded over the secure channel, and the application 383 tion is forwarded over the secure channel, and the application
379 protocol is then used to determine where to connect to from the 384 protocol is then used to determine where to connect to from the
380 remote machine. Currently the SOCKS4 protocol is supported, and 385 remote machine. Currently the SOCKS4 and SOCKS5 protocols are
381 ssh will act as a SOCKS4 server. Only root can forward privi- 386 supported, and ssh will act as a SOCKS server. Only root can
382 leged ports. Dynamic port forwardings can also be specified in 387 forward privileged ports. Dynamic port forwardings can also be
383 the configuration file. 388 specified in the configuration file.
384 389
385 -1 Forces ssh to try protocol version 1 only. 390 -1 Forces ssh to try protocol version 1 only.
386 391
@@ -559,7 +564,7 @@ FILES
559 with ssh without permitting login with rlogin or rsh(1). 564 with ssh without permitting login with rlogin or rsh(1).
560 565
561 /etc/hosts.equiv 566 /etc/hosts.equiv
562 This file is used during .rhosts authentication. It contains 567 This file is used during .rhosts authentication. It contains
563 canonical hosts names, one per line (the full format is described 568 canonical hosts names, one per line (the full format is described
564 on the sshd(8) manual page). If the client host is found in this 569 on the sshd(8) manual page). If the client host is found in this
565 file, login is automatically permitted provided client and server 570 file, login is automatically permitted provided client and server
@@ -590,13 +595,6 @@ DIAGNOSTICS
590 ssh exits with the exit status of the remote command or with 255 if an 595 ssh exits with the exit status of the remote command or with 255 if an
591 error occurred. 596 error occurred.
592 597
593AUTHORS
594 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
595 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
596 de Raadt and Dug Song removed many bugs, re-added newer features and cre-
597 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
598 versions 1.5 and 2.0.
599
600SEE ALSO 598SEE ALSO
601 rsh(1), scp(1), sftp(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), 599 rsh(1), scp(1), sftp(1), ssh-add(1), ssh-agent(1), ssh-keygen(1),
602 telnet(1), ssh_config(5), ssh-keysign(8), sshd(8) 600 telnet(1), ssh_config(5), ssh-keysign(8), sshd(8)
@@ -605,4 +603,11 @@ SEE ALSO
605 Protocol Architecture, draft-ietf-secsh-architecture-12.txt, January 603 Protocol Architecture, draft-ietf-secsh-architecture-12.txt, January
606 2002, work in progress material. 604 2002, work in progress material.
607 605
606AUTHORS
607 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
608 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
609 de Raadt and Dug Song removed many bugs, re-added newer features and cre-
610 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
611 versions 1.5 and 2.0.
612
608BSD September 25, 1999 BSD 613BSD September 25, 1999 BSD
diff --git a/ssh.1 b/ssh.1
index fd822bb3d..c81cb42c6 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.168 2003/03/28 10:11:43 jmc Exp $ 37.\" $OpenBSD: ssh.1,v 1.175 2003/07/22 13:35:22 markus Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
@@ -49,7 +49,7 @@
49.Pp 49.Pp
50.Nm ssh 50.Nm ssh
51.Bk -words 51.Bk -words
52.Op Fl afgknqstvxACNTX1246 52.Op Fl afgknqstvxACNTVX1246
53.Op Fl b Ar bind_address 53.Op Fl b Ar bind_address
54.Op Fl c Ar cipher_spec 54.Op Fl c Ar cipher_spec
55.Op Fl e Ar escape_char 55.Op Fl e Ar escape_char
@@ -301,6 +301,9 @@ Background ssh at logout when waiting for forwarded connection / X11 sessions
301to terminate 301to terminate
302.It Cm ~? 302.It Cm ~?
303Display a list of escape characters 303Display a list of escape characters
304.It Cm ~B
305Send a BREAK to the remote system (only useful for SSH protocol version 2
306and if the peer supports it)
304.It Cm ~C 307.It Cm ~C
305Open command line (only useful for adding port forwardings using the 308Open command line (only useful for adding port forwardings using the
306.Fl L 309.Fl L
@@ -485,13 +488,13 @@ It is possible to have multiple
485options (and multiple identities specified in 488options (and multiple identities specified in
486configuration files). 489configuration files).
487.It Fl I Ar smartcard_device 490.It Fl I Ar smartcard_device
488Specifies which smartcard device to use. The argument is 491Specifies which smartcard device to use.
489the device 492The argument is the device
490.Nm 493.Nm
491should use to communicate with a smartcard used for storing the user's 494should use to communicate with a smartcard used for storing the user's
492private RSA key. 495private RSA key.
493.It Fl k 496.It Fl k
494Disables forwarding of Kerberos tickets and AFS tokens. 497Disables forwarding of Kerberos tickets.
495This may also be specified on a per-host basis in the configuration file. 498This may also be specified on a per-host basis in the configuration file.
496.It Fl l Ar login_name 499.It Fl l Ar login_name
497Specifies the user to log in as on the remote machine. 500Specifies the user to log in as on the remote machine.
@@ -539,9 +542,10 @@ per-host basis in the configuration file.
539Quiet mode. 542Quiet mode.
540Causes all warning and diagnostic messages to be suppressed. 543Causes all warning and diagnostic messages to be suppressed.
541.It Fl s 544.It Fl s
542May be used to request invocation of a subsystem on the remote system. Subsystems are a feature of the SSH2 protocol which facilitate the use 545May be used to request invocation of a subsystem on the remote system.
543of SSH as a secure transport for other applications (eg. sftp). The 546Subsystems are a feature of the SSH2 protocol which facilitate the use
544subsystem is specified as the remote command. 547of SSH as a secure transport for other applications (eg. sftp).
548The subsystem is specified as the remote command.
545.It Fl t 549.It Fl t
546Force pseudo-tty allocation. 550Force pseudo-tty allocation.
547This can be used to execute arbitrary 551This can be used to execute arbitrary
@@ -563,8 +567,10 @@ This is helpful in
563debugging connection, authentication, and configuration problems. 567debugging connection, authentication, and configuration problems.
564Multiple 568Multiple
565.Fl v 569.Fl v
566options increases the verbosity. 570options increase the verbosity.
567Maximum is 3. 571The maximum is 3.
572.It Fl V
573Display the version number and exit.
568.It Fl x 574.It Fl x
569Disables X11 forwarding. 575Disables X11 forwarding.
570.It Fl X 576.It Fl X
@@ -643,9 +649,9 @@ on the local side, and whenever a connection is made to this port, the
643connection is forwarded over the secure channel, and the application 649connection is forwarded over the secure channel, and the application
644protocol is then used to determine where to connect to from the 650protocol is then used to determine where to connect to from the
645remote machine. 651remote machine.
646Currently the SOCKS4 protocol is supported, and 652Currently the SOCKS4 and SOCKS5 protocols are supported, and
647.Nm 653.Nm
648will act as a SOCKS4 server. 654will act as a SOCKS server.
649Only root can forward privileged ports. 655Only root can forward privileged ports.
650Dynamic port forwardings can also be specified in the configuration file. 656Dynamic port forwardings can also be specified in the configuration file.
651.It Fl 1 657.It Fl 1
@@ -916,7 +922,8 @@ or
916.Xr rsh 1 . 922.Xr rsh 1 .
917.It Pa /etc/hosts.equiv 923.It Pa /etc/hosts.equiv
918This file is used during 924This file is used during
919.Pa \&.rhosts authentication. 925.Pa \&.rhosts
926authentication.
920It contains 927It contains
921canonical hosts names, one per line (the full format is described on 928canonical hosts names, one per line (the full format is described on
922the 929the
@@ -958,15 +965,6 @@ above.
958.Nm 965.Nm
959exits with the exit status of the remote command or with 255 966exits with the exit status of the remote command or with 255
960if an error occurred. 967if an error occurred.
961.Sh AUTHORS
962OpenSSH is a derivative of the original and free
963ssh 1.2.12 release by Tatu Ylonen.
964Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
965Theo de Raadt and Dug Song
966removed many bugs, re-added newer features and
967created OpenSSH.
968Markus Friedl contributed the support for SSH
969protocol versions 1.5 and 2.0.
970.Sh SEE ALSO 968.Sh SEE ALSO
971.Xr rsh 1 , 969.Xr rsh 1 ,
972.Xr scp 1 , 970.Xr scp 1 ,
@@ -989,3 +987,12 @@ protocol versions 1.5 and 2.0.
989.%D January 2002 987.%D January 2002
990.%O work in progress material 988.%O work in progress material
991.Re 989.Re
990.Sh AUTHORS
991OpenSSH is a derivative of the original and free
992ssh 1.2.12 release by Tatu Ylonen.
993Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
994Theo de Raadt and Dug Song
995removed many bugs, re-added newer features and
996created OpenSSH.
997Markus Friedl contributed the support for SSH
998protocol versions 1.5 and 2.0.
diff --git a/ssh.c b/ssh.c
index 720604394..35418f693 100644
--- a/ssh.c
+++ b/ssh.c
@@ -40,7 +40,7 @@
40 */ 40 */
41 41
42#include "includes.h" 42#include "includes.h"
43RCSID("$OpenBSD: ssh.c,v 1.190 2003/02/06 09:27:29 markus Exp $"); 43RCSID("$OpenBSD: ssh.c,v 1.201 2003/09/01 18:15:50 markus Exp $");
44 44
45#include <openssl/evp.h> 45#include <openssl/evp.h>
46#include <openssl/err.h> 46#include <openssl/err.h>
@@ -79,14 +79,6 @@ extern char *__progname;
79char *__progname; 79char *__progname;
80#endif 80#endif
81 81
82/* Flag indicating whether IPv4 or IPv6. This can be set on the command line.
83 Default value is AF_UNSPEC means both IPv4 and IPv6. */
84#ifdef IPV4_DEFAULT
85int IPv4or6 = AF_INET;
86#else
87int IPv4or6 = AF_UNSPEC;
88#endif
89
90/* Flag indicating whether debug mode is on. This can be set on the command line. */ 82/* Flag indicating whether debug mode is on. This can be set on the command line. */
91int debug_flag = 0; 83int debug_flag = 0;
92 84
@@ -162,9 +154,6 @@ usage(void)
162 _PATH_SSH_USER_CONFFILE); 154 _PATH_SSH_USER_CONFFILE);
163 fprintf(stderr, " -A Enable authentication agent forwarding.\n"); 155 fprintf(stderr, " -A Enable authentication agent forwarding.\n");
164 fprintf(stderr, " -a Disable authentication agent forwarding (default).\n"); 156 fprintf(stderr, " -a Disable authentication agent forwarding (default).\n");
165#ifdef AFS
166 fprintf(stderr, " -k Disable Kerberos ticket and AFS token forwarding.\n");
167#endif /* AFS */
168 fprintf(stderr, " -X Enable X11 connection forwarding.\n"); 157 fprintf(stderr, " -X Enable X11 connection forwarding.\n");
169 fprintf(stderr, " -x Disable X11 connection forwarding (default).\n"); 158 fprintf(stderr, " -x Disable X11 connection forwarding (default).\n");
170 fprintf(stderr, " -i file Identity for public key authentication " 159 fprintf(stderr, " -i file Identity for public key authentication "
@@ -222,7 +211,7 @@ main(int ac, char **av)
222 extern int optind, optreset; 211 extern int optind, optreset;
223 extern char *optarg; 212 extern char *optarg;
224 213
225 __progname = get_progname(av[0]); 214 __progname = ssh_get_progname(av[0]);
226 init_rng(); 215 init_rng();
227 216
228 /* 217 /*
@@ -253,7 +242,7 @@ main(int ac, char **av)
253 /* Get user data. */ 242 /* Get user data. */
254 pw = getpwuid(original_real_uid); 243 pw = getpwuid(original_real_uid);
255 if (!pw) { 244 if (!pw) {
256 log("You don't exist, go away!"); 245 logit("You don't exist, go away!");
257 exit(1); 246 exit(1);
258 } 247 }
259 /* Take a copy of the returned structure. */ 248 /* Take a copy of the returned structure. */
@@ -284,10 +273,10 @@ again:
284 options.protocol = SSH_PROTO_2; 273 options.protocol = SSH_PROTO_2;
285 break; 274 break;
286 case '4': 275 case '4':
287 IPv4or6 = AF_INET; 276 options.address_family = AF_INET;
288 break; 277 break;
289 case '6': 278 case '6':
290 IPv4or6 = AF_INET6; 279 options.address_family = AF_INET6;
291 break; 280 break;
292 case 'n': 281 case 'n':
293 stdin_null_flag = 1; 282 stdin_null_flag = 1;
@@ -314,12 +303,9 @@ again:
314 case 'A': 303 case 'A':
315 options.forward_agent = 1; 304 options.forward_agent = 1;
316 break; 305 break;
317#ifdef AFS
318 case 'k': 306 case 'k':
319 options.kerberos_tgt_passing = 0; 307 /* ignored for backward compatibility */
320 options.afs_token_passing = 0;
321 break; 308 break;
322#endif
323 case 'i': 309 case 'i':
324 if (stat(optarg, &st) < 0) { 310 if (stat(optarg, &st) < 0) {
325 fprintf(stderr, "Warning: Identity file %s " 311 fprintf(stderr, "Warning: Identity file %s "
@@ -346,22 +332,22 @@ again:
346 tty_flag = 1; 332 tty_flag = 1;
347 break; 333 break;
348 case 'v': 334 case 'v':
349 if (0 == debug_flag) { 335 if (debug_flag == 0) {
350 debug_flag = 1; 336 debug_flag = 1;
351 options.log_level = SYSLOG_LEVEL_DEBUG1; 337 options.log_level = SYSLOG_LEVEL_DEBUG1;
352 } else if (options.log_level < SYSLOG_LEVEL_DEBUG3) { 338 } else {
353 options.log_level++; 339 if (options.log_level < SYSLOG_LEVEL_DEBUG3)
340 options.log_level++;
354 break; 341 break;
355 } else 342 }
356 fatal("Too high debugging level.");
357 /* fallthrough */ 343 /* fallthrough */
358 case 'V': 344 case 'V':
359 fprintf(stderr, 345 fprintf(stderr,
360 "%s, SSH protocols %d.%d/%d.%d, OpenSSL 0x%8.8lx\n", 346 "%s, SSH protocols %d.%d/%d.%d, %s\n",
361 SSH_VERSION, 347 SSH_VERSION,
362 PROTOCOL_MAJOR_1, PROTOCOL_MINOR_1, 348 PROTOCOL_MAJOR_1, PROTOCOL_MINOR_1,
363 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, 349 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2,
364 SSLeay()); 350 SSLeay_version(SSLEAY_VERSION));
365 if (opt == 'V') 351 if (opt == 'V')
366 exit(0); 352 exit(0);
367 break; 353 break;
@@ -427,9 +413,9 @@ again:
427 413
428 case 'L': 414 case 'L':
429 case 'R': 415 case 'R':
430 if (sscanf(optarg, "%5[0-9]:%255[^:]:%5[0-9]", 416 if (sscanf(optarg, "%5[0123456789]:%255[^:]:%5[0123456789]",
431 sfwd_port, buf, sfwd_host_port) != 3 && 417 sfwd_port, buf, sfwd_host_port) != 3 &&
432 sscanf(optarg, "%5[0-9]/%255[^/]/%5[0-9]", 418 sscanf(optarg, "%5[0123456789]/%255[^/]/%5[0123456789]",
433 sfwd_port, buf, sfwd_host_port) != 3) { 419 sfwd_port, buf, sfwd_host_port) != 3) {
434 fprintf(stderr, 420 fprintf(stderr,
435 "Bad forwarding specification '%s'\n", 421 "Bad forwarding specification '%s'\n",
@@ -458,7 +444,7 @@ again:
458 optarg); 444 optarg);
459 exit(1); 445 exit(1);
460 } 446 }
461 add_local_forward(&options, fwd_port, "socks4", 0); 447 add_local_forward(&options, fwd_port, "socks", 0);
462 break; 448 break;
463 449
464 case 'C': 450 case 'C':
@@ -518,7 +504,6 @@ again:
518 504
519 SSLeay_add_all_algorithms(); 505 SSLeay_add_all_algorithms();
520 ERR_load_crypto_strings(); 506 ERR_load_crypto_strings();
521 channel_set_af(IPv4or6);
522 507
523 /* Initialize the command to execute on remote host. */ 508 /* Initialize the command to execute on remote host. */
524 buffer_init(&command); 509 buffer_init(&command);
@@ -559,7 +544,7 @@ again:
559 /* Do not allocate a tty if stdin is not a tty. */ 544 /* Do not allocate a tty if stdin is not a tty. */
560 if (!isatty(fileno(stdin)) && !force_tty_flag) { 545 if (!isatty(fileno(stdin)) && !force_tty_flag) {
561 if (tty_flag) 546 if (tty_flag)
562 log("Pseudo-terminal will not be allocated because stdin is not a terminal."); 547 logit("Pseudo-terminal will not be allocated because stdin is not a terminal.");
563 tty_flag = 0; 548 tty_flag = 0;
564 } 549 }
565 550
@@ -590,6 +575,8 @@ again:
590 /* Fill configuration defaults. */ 575 /* Fill configuration defaults. */
591 fill_default_options(&options); 576 fill_default_options(&options);
592 577
578 channel_set_af(options.address_family);
579
593 /* reinit */ 580 /* reinit */
594 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1); 581 log_init(av[0], options.log_level, SYSLOG_FACILITY_USER, 1);
595 582
@@ -601,25 +588,20 @@ again:
601 if (options.hostname != NULL) 588 if (options.hostname != NULL)
602 host = options.hostname; 589 host = options.hostname;
603 590
591 /* force lowercase for hostkey matching */
592 if (options.host_key_alias != NULL) {
593 for (p = options.host_key_alias; *p; p++)
594 if (isupper(*p))
595 *p = tolower(*p);
596 }
597
604 if (options.proxy_command != NULL && 598 if (options.proxy_command != NULL &&
605 strcmp(options.proxy_command, "none") == 0) 599 strcmp(options.proxy_command, "none") == 0)
606 options.proxy_command = NULL; 600 options.proxy_command = NULL;
607 601
608 /* Disable rhosts authentication if not running as root. */
609#ifdef HAVE_CYGWIN
610 /* Ignore uid if running under Windows */
611 if (!options.use_privileged_port) {
612#else
613 if (original_effective_uid != 0 || !options.use_privileged_port) {
614#endif
615 debug("Rhosts Authentication disabled, "
616 "originating port will not be trusted.");
617 options.rhosts_authentication = 0;
618 }
619 /* Open a connection to the remote host. */ 602 /* Open a connection to the remote host. */
620 603 if (ssh_connect(host, &hostaddr, options.port,
621 if (ssh_connect(host, &hostaddr, options.port, IPv4or6, 604 options.address_family, options.connection_attempts,
622 options.connection_attempts,
623#ifdef HAVE_CYGWIN 605#ifdef HAVE_CYGWIN
624 options.use_privileged_port, 606 options.use_privileged_port,
625#else 607#else
@@ -793,7 +775,7 @@ x11_get_proto(char **_proto, char **_data)
793 if (!got_data) { 775 if (!got_data) {
794 u_int32_t rand = 0; 776 u_int32_t rand = 0;
795 777
796 log("Warning: No xauth data; using fake authentication data for X11 forwarding."); 778 logit("Warning: No xauth data; using fake authentication data for X11 forwarding.");
797 strlcpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto); 779 strlcpy(proto, "MIT-MAGIC-COOKIE-1", sizeof proto);
798 for (i = 0; i < 16; i++) { 780 for (i = 0; i < 16; i++) {
799 if (i % 4 == 0) 781 if (i % 4 == 0)
@@ -873,7 +855,7 @@ ssh_session(void)
873 if (type == SSH_SMSG_SUCCESS) 855 if (type == SSH_SMSG_SUCCESS)
874 packet_start_compression(options.compression_level); 856 packet_start_compression(options.compression_level);
875 else if (type == SSH_SMSG_FAILURE) 857 else if (type == SSH_SMSG_FAILURE)
876 log("Warning: Remote host refused compression."); 858 logit("Warning: Remote host refused compression.");
877 else 859 else
878 packet_disconnect("Protocol error waiting for compression response."); 860 packet_disconnect("Protocol error waiting for compression response.");
879 } 861 }
@@ -912,7 +894,7 @@ ssh_session(void)
912 interactive = 1; 894 interactive = 1;
913 have_tty = 1; 895 have_tty = 1;
914 } else if (type == SSH_SMSG_FAILURE) 896 } else if (type == SSH_SMSG_FAILURE)
915 log("Warning: Remote host failed or refused to allocate a pseudo tty."); 897 logit("Warning: Remote host failed or refused to allocate a pseudo tty.");
916 else 898 else
917 packet_disconnect("Protocol error waiting for pty request response."); 899 packet_disconnect("Protocol error waiting for pty request response.");
918 } 900 }
@@ -930,7 +912,7 @@ ssh_session(void)
930 if (type == SSH_SMSG_SUCCESS) { 912 if (type == SSH_SMSG_SUCCESS) {
931 interactive = 1; 913 interactive = 1;
932 } else if (type == SSH_SMSG_FAILURE) { 914 } else if (type == SSH_SMSG_FAILURE) {
933 log("Warning: Remote host denied X11 forwarding."); 915 logit("Warning: Remote host denied X11 forwarding.");
934 } else { 916 } else {
935 packet_disconnect("Protocol error waiting for X11 forwarding"); 917 packet_disconnect("Protocol error waiting for X11 forwarding");
936 } 918 }
@@ -949,7 +931,7 @@ ssh_session(void)
949 type = packet_read(); 931 type = packet_read();
950 packet_check_eom(); 932 packet_check_eom();
951 if (type != SSH_SMSG_SUCCESS) 933 if (type != SSH_SMSG_SUCCESS)
952 log("Warning: Remote host denied authentication agent forwarding."); 934 logit("Warning: Remote host denied authentication agent forwarding.");
953 } 935 }
954 936
955 /* Initiate port forwardings. */ 937 /* Initiate port forwardings. */
@@ -1017,7 +999,7 @@ client_global_request_reply(int type, u_int32_t seq, void *ctxt)
1017 options.remote_forwards[i].host, 999 options.remote_forwards[i].host,
1018 options.remote_forwards[i].host_port); 1000 options.remote_forwards[i].host_port);
1019 if (type == SSH2_MSG_REQUEST_FAILURE) 1001 if (type == SSH2_MSG_REQUEST_FAILURE)
1020 log("Warning: remote port forwarding failed for listen port %d", 1002 logit("Warning: remote port forwarding failed for listen port %d",
1021 options.remote_forwards[i].port); 1003 options.remote_forwards[i].port);
1022} 1004}
1023 1005
@@ -1132,7 +1114,7 @@ ssh_session2_open(void)
1132 c = channel_new( 1114 c = channel_new(
1133 "session", SSH_CHANNEL_OPENING, in, out, err, 1115 "session", SSH_CHANNEL_OPENING, in, out, err,
1134 window, packetmax, CHAN_EXTENDED_WRITE, 1116 window, packetmax, CHAN_EXTENDED_WRITE,
1135 xstrdup("client-session"), /*nonblock*/0); 1117 "client-session", /*nonblock*/0);
1136 1118
1137 debug3("ssh_session2_open: channel_new: %d", c->self); 1119 debug3("ssh_session2_open: channel_new: %d", c->self);
1138 1120
@@ -1184,7 +1166,7 @@ load_public_identity_files(void)
1184 sizeof(Key *) * (SSH_MAX_IDENTITY_FILES - 1)); 1166 sizeof(Key *) * (SSH_MAX_IDENTITY_FILES - 1));
1185 options.num_identity_files++; 1167 options.num_identity_files++;
1186 options.identity_keys[0] = keys[i]; 1168 options.identity_keys[0] = keys[i];
1187 options.identity_files[0] = xstrdup("smartcard key");; 1169 options.identity_files[0] = sc_get_key_label(keys[i]);
1188 } 1170 }
1189 if (options.num_identity_files > SSH_MAX_IDENTITY_FILES) 1171 if (options.num_identity_files > SSH_MAX_IDENTITY_FILES)
1190 options.num_identity_files = SSH_MAX_IDENTITY_FILES; 1172 options.num_identity_files = SSH_MAX_IDENTITY_FILES;
diff --git a/ssh.h b/ssh.h
index 0a6ad1317..e88b9b83e 100644
--- a/ssh.h
+++ b/ssh.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.h,v 1.71 2002/06/22 02:00:29 stevesk Exp $ */ 1/* $OpenBSD: ssh.h,v 1.74 2003/09/01 13:52:18 markus Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -20,7 +20,6 @@
20#include <stdarg.h> /* For va_list */ 20#include <stdarg.h> /* For va_list */
21#include <syslog.h> /* For LOG_AUTH and friends */ 21#include <syslog.h> /* For LOG_AUTH and friends */
22#include <sys/socket.h> /* For struct sockaddr_storage */ 22#include <sys/socket.h> /* For struct sockaddr_storage */
23#include "openbsd-compat/fake-socket.h" /* For struct sockaddr_storage */
24#ifdef HAVE_SYS_SELECT_H 23#ifdef HAVE_SYS_SELECT_H
25# include <sys/select.h> 24# include <sys/select.h>
26#endif 25#endif
@@ -89,9 +88,6 @@
89 */ 88 */
90#define SSH_SESSION_KEY_LENGTH 32 89#define SSH_SESSION_KEY_LENGTH 32
91 90
92/* Name of Kerberos service for SSH to use. */
93#define KRB4_SERVICE_NAME "rcmd"
94
95/* Used to identify ``EscapeChar none'' */ 91/* Used to identify ``EscapeChar none'' */
96#define SSH_ESCAPECHAR_NONE -2 92#define SSH_ESCAPECHAR_NONE -2
97 93
diff --git a/ssh2.h b/ssh2.h
index 091e52b13..fb491c918 100644
--- a/ssh2.h
+++ b/ssh2.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh2.h,v 1.8 2002/03/04 17:27:39 stevesk Exp $ */ 1/* $OpenBSD: ssh2.h,v 1.9 2003/05/14 00:52:59 markus Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2000 Markus Friedl. All rights reserved. 4 * Copyright (c) 2000 Markus Friedl. All rights reserved.
@@ -61,6 +61,8 @@
61#define SSH2_MSG_TRANSPORT_MAX 49 61#define SSH2_MSG_TRANSPORT_MAX 49
62#define SSH2_MSG_USERAUTH_MIN 50 62#define SSH2_MSG_USERAUTH_MIN 50
63#define SSH2_MSG_USERAUTH_MAX 79 63#define SSH2_MSG_USERAUTH_MAX 79
64#define SSH2_MSG_USERAUTH_PER_METHOD_MIN 60
65#define SSH2_MSG_USERAUTH_PER_METHOD_MAX SSH2_MSG_USERAUTH_MAX
64#define SSH2_MSG_CONNECTION_MIN 80 66#define SSH2_MSG_CONNECTION_MIN 80
65#define SSH2_MSG_CONNECTION_MAX 127 67#define SSH2_MSG_CONNECTION_MAX 127
66#define SSH2_MSG_RESERVED_MIN 128 68#define SSH2_MSG_RESERVED_MIN 128
diff --git a/ssh_config b/ssh_config
index 94cffbf39..2692e8913 100644
--- a/ssh_config
+++ b/ssh_config
@@ -1,4 +1,4 @@
1# $OpenBSD: ssh_config,v 1.16 2002/07/03 14:21:05 markus Exp $ 1# $OpenBSD: ssh_config,v 1.19 2003/08/13 08:46:31 markus Exp $
2 2
3# This is the ssh client system-wide configuration file. See 3# This is the ssh client system-wide configuration file. See
4# ssh_config(5) for more information. This file provides defaults for 4# ssh_config(5) for more information. This file provides defaults for
@@ -18,13 +18,14 @@
18# Host * 18# Host *
19# ForwardAgent no 19# ForwardAgent no
20# ForwardX11 no 20# ForwardX11 no
21# RhostsAuthentication no
22# RhostsRSAAuthentication no 21# RhostsRSAAuthentication no
23# RSAAuthentication yes 22# RSAAuthentication yes
24# PasswordAuthentication yes 23# PasswordAuthentication yes
25# HostbasedAuthentication no 24# HostbasedAuthentication no
26# BatchMode no 25# BatchMode no
27# CheckHostIP yes 26# CheckHostIP yes
27# AddressFamily any
28# ConnectTimeout 0
28# StrictHostKeyChecking ask 29# StrictHostKeyChecking ask
29# IdentityFile ~/.ssh/identity 30# IdentityFile ~/.ssh/identity
30# IdentityFile ~/.ssh/id_rsa 31# IdentityFile ~/.ssh/id_rsa
diff --git a/ssh_config.0 b/ssh_config.0
index 74e516594..a8687ffc2 100644
--- a/ssh_config.0
+++ b/ssh_config.0
@@ -39,16 +39,16 @@ DESCRIPTION
39 39
40 Host Restricts the following declarations (up to the next Host key- 40 Host Restricts the following declarations (up to the next Host key-
41 word) to be only for those hosts that match one of the patterns 41 word) to be only for those hosts that match one of the patterns
42 given after the keyword. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? can be used as wildcards 42 given after the keyword. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y can be used as wildcards in
43 in the patterns. A single M-bM-^@M-^X*M-bM-^@M-^Y as a pattern can be used to pro- 43 the patterns. A single M-bM-^@M-^X*M-bM-^@M-^Y as a pattern can be used to provide
44 vide global defaults for all hosts. The host is the hostname 44 global defaults for all hosts. The host is the hostname argument
45 argument given on the command line (i.e., the name is not con- 45 given on the command line (i.e., the name is not converted to a
46 verted to a canonicalized host name before matching). 46 canonicalized host name before matching).
47 47
48 AFSTokenPassing 48 AddressFamily
49 Specifies whether to pass AFS tokens to remote host. The argu- 49 Specifies which address family to use when connecting. Valid
50 ment to this keyword must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. This option applies 50 arguments are M-bM-^@M-^\anyM-bM-^@M-^], M-bM-^@M-^\inetM-bM-^@M-^] (Use IPv4 only) or M-bM-^@M-^\inet6M-bM-^@M-^] (Use IPv6
51 to protocol version 1 only. 51 only.)
52 52
53 BatchMode 53 BatchMode
54 If set to M-bM-^@M-^\yesM-bM-^@M-^], passphrase/password querying will be disabled. 54 If set to M-bM-^@M-^\yesM-bM-^@M-^], passphrase/password querying will be disabled.
@@ -112,15 +112,28 @@ DESCRIPTION
112 exiting. The argument must be an integer. This may be useful in 112 exiting. The argument must be an integer. This may be useful in
113 scripts if the connection sometimes fails. The default is 1. 113 scripts if the connection sometimes fails. The default is 1.
114 114
115 ConnectTimeout
116 Specifies the timeout (in seconds) used when connecting to the
117 ssh server, instead of using the default system TCP timeout.
118 This value is used only when the target is down or really
119 unreachable, not when it refuses the connection.
120
115 DynamicForward 121 DynamicForward
116 Specifies that a TCP/IP port on the local machine be forwarded 122 Specifies that a TCP/IP port on the local machine be forwarded
117 over the secure channel, and the application protocol is then 123 over the secure channel, and the application protocol is then
118 used to determine where to connect to from the remote machine. 124 used to determine where to connect to from the remote machine.
119 The argument must be a port number. Currently the SOCKS4 proto- 125 The argument must be a port number. Currently the SOCKS4 and
120 col is supported, and ssh will act as a SOCKS4 server. Multiple 126 SOCKS5 protocols are supported, and ssh will act as a SOCKS
121 forwardings may be specified, and additional forwardings can be 127 server. Multiple forwardings may be specified, and additional
122 given on the command line. Only the superuser can forward privi- 128 forwardings can be given on the command line. Only the superuser
123 leged ports. 129 can forward privileged ports.
130
131 EnableSSHKeysign
132 Setting this option to M-bM-^@M-^\yesM-bM-^@M-^] in the global client configuration
133 file /etc/ssh/ssh_config enables the use of the helper program
134 ssh-keysign(8) during HostbasedAuthentication. The argument must
135 be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The default is M-bM-^@M-^\noM-bM-^@M-^]. See ssh-keysign(8) for
136 more information.
124 137
125 EscapeChar 138 EscapeChar
126 Sets the escape character (default: M-bM-^@M-^X~M-bM-^@M-^Y). The escape character 139 Sets the escape character (default: M-bM-^@M-^X~M-bM-^@M-^Y). The escape character
@@ -166,6 +179,16 @@ DESCRIPTION
166 Specifies a file to use for the global host key database instead 179 Specifies a file to use for the global host key database instead
167 of /etc/ssh/ssh_known_hosts. 180 of /etc/ssh/ssh_known_hosts.
168 181
182 GSSAPIAuthentication
183 Specifies whether authentication based on GSSAPI may be used,
184 either using the result of a successful key exchange, or using
185 GSSAPI user authentication. The default is M-bM-^@M-^\yesM-bM-^@M-^]. Note that
186 this option applies to protocol version 2 only.
187
188 GSSAPIDelegateCredentials
189 Forward (delegate) credentials to the server. The default is
190 M-bM-^@M-^\noM-bM-^@M-^]. Note that this option applies to protocol version 2 only.
191
169 HostbasedAuthentication 192 HostbasedAuthentication
170 Specifies whether to try rhosts based authentication with public 193 Specifies whether to try rhosts based authentication with public
171 key authentication. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The 194 key authentication. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The
@@ -192,14 +215,14 @@ DESCRIPTION
192 215
193 IdentityFile 216 IdentityFile
194 Specifies a file from which the userM-bM-^@M-^Ys RSA or DSA authentication 217 Specifies a file from which the userM-bM-^@M-^Ys RSA or DSA authentication
195 identity is read. The default is $HOME/.ssh/identity for protocol 218 identity is read. The default is $HOME/.ssh/identity for proto-
196 version 1, and $HOME/.ssh/id_rsa and $HOME/.ssh/id_dsa for proto- 219 col version 1, and $HOME/.ssh/id_rsa and $HOME/.ssh/id_dsa for
197 col version 2. Additionally, any identities represented by the 220 protocol version 2. Additionally, any identities represented by
198 authentication agent will be used for authentication. The file 221 the authentication agent will be used for authentication. The
199 name may use the tilde syntax to refer to a userM-bM-^@M-^Ys home direc- 222 file name may use the tilde syntax to refer to a userM-bM-^@M-^Ys home
200 tory. It is possible to have multiple identity files specified 223 directory. It is possible to have multiple identity files speci-
201 in configuration files; all these identities will be tried in 224 fied in configuration files; all these identities will be tried
202 sequence. 225 in sequence.
203 226
204 KeepAlive 227 KeepAlive
205 Specifies whether the system should send TCP keepalive messages 228 Specifies whether the system should send TCP keepalive messages
@@ -214,15 +237,6 @@ DESCRIPTION
214 237
215 To disable keepalives, the value should be set to M-bM-^@M-^\noM-bM-^@M-^]. 238 To disable keepalives, the value should be set to M-bM-^@M-^\noM-bM-^@M-^].
216 239
217 KerberosAuthentication
218 Specifies whether Kerberos authentication will be used. The
219 argument to this keyword must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^].
220
221 KerberosTgtPassing
222 Specifies whether a Kerberos TGT will be forwarded to the server.
223 This will only work if the Kerberos server is actually an AFS
224 kaserver. The argument to this keyword must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^].
225
226 LocalForward 240 LocalForward
227 Specifies that a TCP/IP port on the local machine be forwarded 241 Specifies that a TCP/IP port on the local machine be forwarded
228 over the secure channel to the specified host and port from the 242 over the secure channel to the specified host and port from the
@@ -267,9 +281,9 @@ DESCRIPTION
267 281
268 PreferredAuthentications 282 PreferredAuthentications
269 Specifies the order in which the client should try protocol 2 283 Specifies the order in which the client should try protocol 2
270 authentication methods. This allows a client to prefer one method 284 authentication methods. This allows a client to prefer one
271 (e.g. keyboard-interactive) over another method (e.g. password) 285 method (e.g. keyboard-interactive) over another method (e.g.
272 The default for this option is: 286 password) The default for this option is:
273 M-bM-^@M-^\hostbased,publickey,keyboard-interactive,passwordM-bM-^@M-^]. 287 M-bM-^@M-^\hostbased,publickey,keyboard-interactive,passwordM-bM-^@M-^].
274 288
275 Protocol 289 Protocol
@@ -307,16 +321,6 @@ DESCRIPTION
307 specified, and additional forwardings can be given on the command 321 specified, and additional forwardings can be given on the command
308 line. Only the superuser can forward privileged ports. 322 line. Only the superuser can forward privileged ports.
309 323
310 RhostsAuthentication
311 Specifies whether to try rhosts based authentication. Note that
312 this declaration only affects the client side and has no effect
313 whatsoever on security. Most servers do not permit RhostsAuthen-
314 tication because it is not secure (see RhostsRSAAuthentication).
315 The argument to this keyword must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The default
316 is M-bM-^@M-^\noM-bM-^@M-^]. This option applies to protocol version 1 only and
317 requires ssh to be setuid root and UsePrivilegedPort to be set to
318 M-bM-^@M-^\yesM-bM-^@M-^].
319
320 RhostsRSAAuthentication 324 RhostsRSAAuthentication
321 Specifies whether to try rhosts based authentication with RSA 325 Specifies whether to try rhosts based authentication with RSA
322 host authentication. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The 326 host authentication. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The
@@ -331,9 +335,9 @@ DESCRIPTION
331 applies to protocol version 1 only. 335 applies to protocol version 1 only.
332 336
333 SmartcardDevice 337 SmartcardDevice
334 Specifies which smartcard device to use. The argument to this 338 Specifies which smartcard device to use. The argument to this
335 keyword is the device ssh should use to communicate with a smart- 339 keyword is the device ssh should use to communicate with a smart-
336 card used for storing the userM-bM-^@M-^Ys private RSA key. By default, no 340 card used for storing the userM-bM-^@M-^Ys private RSA key. By default, no
337 device is specified and smartcard support is not activated. 341 device is specified and smartcard support is not activated.
338 342
339 StrictHostKeyChecking 343 StrictHostKeyChecking
@@ -356,8 +360,7 @@ DESCRIPTION
356 Specifies whether to use a privileged port for outgoing connec- 360 Specifies whether to use a privileged port for outgoing connec-
357 tions. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The default is M-bM-^@M-^\noM-bM-^@M-^]. 361 tions. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The default is M-bM-^@M-^\noM-bM-^@M-^].
358 If set to M-bM-^@M-^\yesM-bM-^@M-^] ssh must be setuid root. Note that this option 362 If set to M-bM-^@M-^\yesM-bM-^@M-^] ssh must be setuid root. Note that this option
359 must be set to M-bM-^@M-^\yesM-bM-^@M-^] if RhostsAuthentication and 363 must be set to M-bM-^@M-^\yesM-bM-^@M-^] for RhostsRSAAuthentication with older
360 RhostsRSAAuthentication authentications are needed with older
361 servers. 364 servers.
362 365
363 User Specifies the user to log in as. This can be useful when a dif- 366 User Specifies the user to log in as. This can be useful when a dif-
@@ -369,6 +372,11 @@ DESCRIPTION
369 Specifies a file to use for the user host key database instead of 372 Specifies a file to use for the user host key database instead of
370 $HOME/.ssh/known_hosts. 373 $HOME/.ssh/known_hosts.
371 374
375 VerifyHostKeyDNS
376 Specifies whether to verify the remote key using DNS and SSHFP
377 resource records. The default is M-bM-^@M-^\noM-bM-^@M-^]. Note that this option
378 applies to protocol version 2 only.
379
372 XAuthLocation 380 XAuthLocation
373 Specifies the full pathname of the xauth(1) program. The default 381 Specifies the full pathname of the xauth(1) program. The default
374 is /usr/X11R6/bin/xauth. 382 is /usr/X11R6/bin/xauth.
@@ -387,6 +395,9 @@ FILES
387 file, and for those users who do not have a configuration file. 395 file, and for those users who do not have a configuration file.
388 This file must be world-readable. 396 This file must be world-readable.
389 397
398SEE ALSO
399 ssh(1)
400
390AUTHORS 401AUTHORS
391 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 402 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
392 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 403 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
@@ -394,7 +405,4 @@ AUTHORS
394 ated OpenSSH. Markus Friedl contributed the support for SSH protocol 405 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
395 versions 1.5 and 2.0. 406 versions 1.5 and 2.0.
396 407
397SEE ALSO
398 ssh(1)
399
400BSD September 25, 1999 BSD 408BSD September 25, 1999 BSD
diff --git a/ssh_config.5 b/ssh_config.5
index 44208b431..7a435a90e 100644
--- a/ssh_config.5
+++ b/ssh_config.5
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh_config.5,v 1.7 2003/03/28 10:11:43 jmc Exp $ 37.\" $OpenBSD: ssh_config.5,v 1.20 2003/09/02 18:50:06 jmc Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH_CONFIG 5 39.Dt SSH_CONFIG 5
40.Os 40.Os
@@ -104,7 +104,7 @@ keyword) to be only for those hosts that match one of the patterns
104given after the keyword. 104given after the keyword.
105.Ql \&* 105.Ql \&*
106and 106and
107.Ql ? 107.Ql \&?
108can be used as wildcards in the 108can be used as wildcards in the
109patterns. 109patterns.
110A single 110A single
@@ -115,13 +115,14 @@ The host is the
115.Ar hostname 115.Ar hostname
116argument given on the command line (i.e., the name is not converted to 116argument given on the command line (i.e., the name is not converted to
117a canonicalized host name before matching). 117a canonicalized host name before matching).
118.It Cm AFSTokenPassing 118.It Cm AddressFamily
119Specifies whether to pass AFS tokens to remote host. 119Specifies which address family to use when connecting.
120The argument to this keyword must be 120Valid arguments are
121.Dq yes 121.Dq any ,
122or 122.Dq inet
123.Dq no . 123(Use IPv4 only) or
124This option applies to protocol version 1 only. 124.Dq inet6
125(Use IPv6 only.)
125.It Cm BatchMode 126.It Cm BatchMode
126If set to 127If set to
127.Dq yes , 128.Dq yes ,
@@ -227,18 +228,41 @@ Specifies the number of tries (one per second) to make before exiting.
227The argument must be an integer. 228The argument must be an integer.
228This may be useful in scripts if the connection sometimes fails. 229This may be useful in scripts if the connection sometimes fails.
229The default is 1. 230The default is 1.
231.It Cm ConnectTimeout
232Specifies the timeout (in seconds) used when connecting to the ssh
233server, instead of using the default system TCP timeout.
234This value is used only when the target is down or really unreachable,
235not when it refuses the connection.
230.It Cm DynamicForward 236.It Cm DynamicForward
231Specifies that a TCP/IP port on the local machine be forwarded 237Specifies that a TCP/IP port on the local machine be forwarded
232over the secure channel, and the application 238over the secure channel, and the application
233protocol is then used to determine where to connect to from the 239protocol is then used to determine where to connect to from the
234remote machine. 240remote machine.
235The argument must be a port number. 241The argument must be a port number.
236Currently the SOCKS4 protocol is supported, and 242Currently the SOCKS4 and SOCKS5 protocols are supported, and
237.Nm ssh 243.Nm ssh
238will act as a SOCKS4 server. 244will act as a SOCKS server.
239Multiple forwardings may be specified, and 245Multiple forwardings may be specified, and
240additional forwardings can be given on the command line. 246additional forwardings can be given on the command line.
241Only the superuser can forward privileged ports. 247Only the superuser can forward privileged ports.
248.It Cm EnableSSHKeysign
249Setting this option to
250.Dq yes
251in the global client configuration file
252.Pa /etc/ssh/ssh_config
253enables the use of the helper program
254.Xr ssh-keysign 8
255during
256.Cm HostbasedAuthentication .
257The argument must be
258.Dq yes
259or
260.Dq no .
261The default is
262.Dq no .
263See
264.Xr ssh-keysign 8
265for more information.
242.It Cm EscapeChar 266.It Cm EscapeChar
243Sets the escape character (default: 267Sets the escape character (default:
244.Ql ~ ) . 268.Ql ~ ) .
@@ -307,6 +331,18 @@ The default is
307Specifies a file to use for the global 331Specifies a file to use for the global
308host key database instead of 332host key database instead of
309.Pa /etc/ssh/ssh_known_hosts . 333.Pa /etc/ssh/ssh_known_hosts .
334.It Cm GSSAPIAuthentication
335Specifies whether authentication based on GSSAPI may be used, either using
336the result of a successful key exchange, or using GSSAPI user
337authentication.
338The default is
339.Dq yes .
340Note that this option applies to protocol version 2 only.
341.It Cm GSSAPIDelegateCredentials
342Forward (delegate) credentials to the server.
343The default is
344.Dq no .
345Note that this option applies to protocol version 2 only.
310.It Cm HostbasedAuthentication 346.It Cm HostbasedAuthentication
311Specifies whether to try rhosts based authentication with public key 347Specifies whether to try rhosts based authentication with public key
312authentication. 348authentication.
@@ -339,7 +375,8 @@ Numeric IP addresses are also permitted (both on the command line and in
339specifications). 375specifications).
340.It Cm IdentityFile 376.It Cm IdentityFile
341Specifies a file from which the user's RSA or DSA authentication identity 377Specifies a file from which the user's RSA or DSA authentication identity
342is read. The default is 378is read.
379The default is
343.Pa $HOME/.ssh/identity 380.Pa $HOME/.ssh/identity
344for protocol version 1, and 381for protocol version 1, and
345.Pa $HOME/.ssh/id_rsa 382.Pa $HOME/.ssh/id_rsa
@@ -370,19 +407,6 @@ This is important in scripts, and many users want it too.
370.Pp 407.Pp
371To disable keepalives, the value should be set to 408To disable keepalives, the value should be set to
372.Dq no . 409.Dq no .
373.It Cm KerberosAuthentication
374Specifies whether Kerberos authentication will be used.
375The argument to this keyword must be
376.Dq yes
377or
378.Dq no .
379.It Cm KerberosTgtPassing
380Specifies whether a Kerberos TGT will be forwarded to the server.
381This will only work if the Kerberos server is actually an AFS kaserver.
382The argument to this keyword must be
383.Dq yes
384or
385.Dq no .
386.It Cm LocalForward 410.It Cm LocalForward
387Specifies that a TCP/IP port on the local machine be forwarded over 411Specifies that a TCP/IP port on the local machine be forwarded over
388the secure channel to the specified host and port from the remote machine. 412the secure channel to the specified host and port from the remote machine.
@@ -436,7 +460,8 @@ Specifies the port number to connect on the remote host.
436Default is 22. 460Default is 22.
437.It Cm PreferredAuthentications 461.It Cm PreferredAuthentications
438Specifies the order in which the client should try protocol 2 462Specifies the order in which the client should try protocol 2
439authentication methods. This allows a client to prefer one method (e.g. 463authentication methods.
464This allows a client to prefer one method (e.g.
440.Cm keyboard-interactive ) 465.Cm keyboard-interactive )
441over another method (e.g. 466over another method (e.g.
442.Cm password ) 467.Cm password )
@@ -504,26 +529,6 @@ IPv6 addresses can be specified with an alternative syntax:
504Multiple forwardings may be specified, and additional 529Multiple forwardings may be specified, and additional
505forwardings can be given on the command line. 530forwardings can be given on the command line.
506Only the superuser can forward privileged ports. 531Only the superuser can forward privileged ports.
507.It Cm RhostsAuthentication
508Specifies whether to try rhosts based authentication.
509Note that this
510declaration only affects the client side and has no effect whatsoever
511on security.
512Most servers do not permit RhostsAuthentication because it
513is not secure (see
514.Cm RhostsRSAAuthentication ) .
515The argument to this keyword must be
516.Dq yes
517or
518.Dq no .
519The default is
520.Dq no .
521This option applies to protocol version 1 only and requires
522.Nm ssh
523to be setuid root and
524.Cm UsePrivilegedPort
525to be set to
526.Dq yes .
527.It Cm RhostsRSAAuthentication 532.It Cm RhostsRSAAuthentication
528Specifies whether to try rhosts based authentication with RSA host 533Specifies whether to try rhosts based authentication with RSA host
529authentication. 534authentication.
@@ -549,12 +554,12 @@ The default is
549.Dq yes . 554.Dq yes .
550Note that this option applies to protocol version 1 only. 555Note that this option applies to protocol version 1 only.
551.It Cm SmartcardDevice 556.It Cm SmartcardDevice
552Specifies which smartcard device to use. The argument to this keyword is 557Specifies which smartcard device to use.
553the device 558The argument to this keyword is the device
554.Nm ssh 559.Nm ssh
555should use to communicate with a smartcard used for storing the user's 560should use to communicate with a smartcard used for storing the user's
556private RSA key. By default, no device is specified and smartcard support 561private RSA key.
557is not activated. 562By default, no device is specified and smartcard support is not activated.
558.It Cm StrictHostKeyChecking 563.It Cm StrictHostKeyChecking
559If this flag is set to 564If this flag is set to
560.Dq yes , 565.Dq yes ,
@@ -604,11 +609,9 @@ If set to
604must be setuid root. 609must be setuid root.
605Note that this option must be set to 610Note that this option must be set to
606.Dq yes 611.Dq yes
607if 612for
608.Cm RhostsAuthentication
609and
610.Cm RhostsRSAAuthentication 613.Cm RhostsRSAAuthentication
611authentications are needed with older servers. 614with older servers.
612.It Cm User 615.It Cm User
613Specifies the user to log in as. 616Specifies the user to log in as.
614This can be useful when a different user name is used on different machines. 617This can be useful when a different user name is used on different machines.
@@ -618,6 +621,12 @@ having to remember to give the user name on the command line.
618Specifies a file to use for the user 621Specifies a file to use for the user
619host key database instead of 622host key database instead of
620.Pa $HOME/.ssh/known_hosts . 623.Pa $HOME/.ssh/known_hosts .
624.It Cm VerifyHostKeyDNS
625Specifies whether to verify the remote key using DNS and SSHFP resource
626records.
627The default is
628.Dq no .
629Note that this option applies to protocol version 2 only.
621.It Cm XAuthLocation 630.It Cm XAuthLocation
622Specifies the full pathname of the 631Specifies the full pathname of the
623.Xr xauth 1 632.Xr xauth 1
@@ -643,6 +652,8 @@ values that are not specified in the user's configuration file, and
643for those users who do not have a configuration file. 652for those users who do not have a configuration file.
644This file must be world-readable. 653This file must be world-readable.
645.El 654.El
655.Sh SEE ALSO
656.Xr ssh 1
646.Sh AUTHORS 657.Sh AUTHORS
647OpenSSH is a derivative of the original and free 658OpenSSH is a derivative of the original and free
648ssh 1.2.12 release by Tatu Ylonen. 659ssh 1.2.12 release by Tatu Ylonen.
@@ -652,5 +663,3 @@ removed many bugs, re-added newer features and
652created OpenSSH. 663created OpenSSH.
653Markus Friedl contributed the support for SSH 664Markus Friedl contributed the support for SSH
654protocol versions 1.5 and 2.0. 665protocol versions 1.5 and 2.0.
655.Sh SEE ALSO
656.Xr ssh 1
diff --git a/sshconnect.c b/sshconnect.c
index dae25969a..40d22800f 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.137 2002/11/21 23:03:51 deraadt Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.147 2003/06/29 12:44:38 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -33,9 +33,17 @@ RCSID("$OpenBSD: sshconnect.c,v 1.137 2002/11/21 23:03:51 deraadt Exp $");
33#include "misc.h" 33#include "misc.h"
34#include "readpass.h" 34#include "readpass.h"
35 35
36#ifdef DNS
37#include "dns.h"
38#endif
39
36char *client_version_string = NULL; 40char *client_version_string = NULL;
37char *server_version_string = NULL; 41char *server_version_string = NULL;
38 42
43#ifdef DNS
44int verified_host_key_dns = 0;
45#endif
46
39/* import */ 47/* import */
40extern Options options; 48extern Options options;
41extern char *__progname; 49extern char *__progname;
@@ -163,7 +171,7 @@ ssh_proxy_connect(const char *host, u_short port, const char *proxy_command)
163 * Creates a (possibly privileged) socket for use as the ssh connection. 171 * Creates a (possibly privileged) socket for use as the ssh connection.
164 */ 172 */
165static int 173static int
166ssh_create_socket(int privileged, int family) 174ssh_create_socket(int privileged, struct addrinfo *ai)
167{ 175{
168 int sock, gaierr; 176 int sock, gaierr;
169 struct addrinfo hints, *res; 177 struct addrinfo hints, *res;
@@ -175,15 +183,16 @@ ssh_create_socket(int privileged, int family)
175 if (privileged) { 183 if (privileged) {
176 int p = IPPORT_RESERVED - 1; 184 int p = IPPORT_RESERVED - 1;
177 PRIV_START; 185 PRIV_START;
178 sock = rresvport_af(&p, family); 186 sock = rresvport_af(&p, ai->ai_family);
179 PRIV_END; 187 PRIV_END;
180 if (sock < 0) 188 if (sock < 0)
181 error("rresvport: af=%d %.100s", family, strerror(errno)); 189 error("rresvport: af=%d %.100s", ai->ai_family,
190 strerror(errno));
182 else 191 else
183 debug("Allocated local port %d.", p); 192 debug("Allocated local port %d.", p);
184 return sock; 193 return sock;
185 } 194 }
186 sock = socket(family, SOCK_STREAM, 0); 195 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
187 if (sock < 0) 196 if (sock < 0)
188 error("socket: %.100s", strerror(errno)); 197 error("socket: %.100s", strerror(errno));
189 198
@@ -192,8 +201,9 @@ ssh_create_socket(int privileged, int family)
192 return sock; 201 return sock;
193 202
194 memset(&hints, 0, sizeof(hints)); 203 memset(&hints, 0, sizeof(hints));
195 hints.ai_family = family; 204 hints.ai_family = ai->ai_family;
196 hints.ai_socktype = SOCK_STREAM; 205 hints.ai_socktype = ai->ai_socktype;
206 hints.ai_protocol = ai->ai_protocol;
197 hints.ai_flags = AI_PASSIVE; 207 hints.ai_flags = AI_PASSIVE;
198 gaierr = getaddrinfo(options.bind_address, "0", &hints, &res); 208 gaierr = getaddrinfo(options.bind_address, "0", &hints, &res);
199 if (gaierr) { 209 if (gaierr) {
@@ -212,6 +222,73 @@ ssh_create_socket(int privileged, int family)
212 return sock; 222 return sock;
213} 223}
214 224
225static int
226timeout_connect(int sockfd, const struct sockaddr *serv_addr,
227 socklen_t addrlen, int timeout)
228{
229 fd_set *fdset;
230 struct timeval tv;
231 socklen_t optlen;
232 int fdsetsz, optval, rc, result = -1;
233
234 if (timeout <= 0)
235 return (connect(sockfd, serv_addr, addrlen));
236
237 if (fcntl(sockfd, F_SETFL, O_NONBLOCK) < 0)
238 return (-1);
239
240 rc = connect(sockfd, serv_addr, addrlen);
241 if (rc == 0)
242 return (0);
243 if (errno != EINPROGRESS)
244 return (-1);
245
246 fdsetsz = howmany(sockfd + 1, NFDBITS) * sizeof(fd_mask);
247 fdset = (fd_set *)xmalloc(fdsetsz);
248
249 memset(fdset, 0, fdsetsz);
250 FD_SET(sockfd, fdset);
251 tv.tv_sec = timeout;
252 tv.tv_usec = 0;
253
254 for(;;) {
255 rc = select(sockfd + 1, NULL, fdset, NULL, &tv);
256 if (rc != -1 || errno != EINTR)
257 break;
258 }
259
260 switch(rc) {
261 case 0:
262 /* Timed out */
263 errno = ETIMEDOUT;
264 break;
265 case -1:
266 /* Select error */
267 debug("select: %s", strerror(errno));
268 break;
269 case 1:
270 /* Completed or failed */
271 optval = 0;
272 optlen = sizeof(optval);
273 if (getsockopt(sockfd, SOL_SOCKET, SO_ERROR, &optval,
274 &optlen) == -1)
275 debug("getsockopt: %s", strerror(errno));
276 break;
277 if (optval != 0) {
278 errno = optval;
279 break;
280 }
281 result = 0;
282 break;
283 default:
284 /* Should not occur */
285 fatal("Bogus return (%d) from select()", rc);
286 }
287
288 xfree(fdset);
289 return (result);
290}
291
215/* 292/*
216 * Opens a TCP/IP connection to the remote server on the given host. 293 * Opens a TCP/IP connection to the remote server on the given host.
217 * The address of the remote host will be returned in hostaddr. 294 * The address of the remote host will be returned in hostaddr.
@@ -295,12 +372,13 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
295 host, ntop, strport); 372 host, ntop, strport);
296 373
297 /* Create a socket for connecting. */ 374 /* Create a socket for connecting. */
298 sock = ssh_create_socket(needpriv, ai->ai_family); 375 sock = ssh_create_socket(needpriv, ai);
299 if (sock < 0) 376 if (sock < 0)
300 /* Any error is already output */ 377 /* Any error is already output */
301 continue; 378 continue;
302 379
303 if (connect(sock, ai->ai_addr, ai->ai_addrlen) >= 0) { 380 if (timeout_connect(sock, ai->ai_addr, ai->ai_addrlen,
381 options.connection_timeout) >= 0) {
304 /* Successful connection. */ 382 /* Successful connection. */
305 memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen); 383 memcpy(hostaddr, ai->ai_addr, ai->ai_addrlen);
306 break; 384 break;
@@ -332,7 +410,7 @@ ssh_connect(const char *host, struct sockaddr_storage * hostaddr,
332 410
333 /* Return failure if we didn't get a successful connection. */ 411 /* Return failure if we didn't get a successful connection. */
334 if (attempt >= connection_attempts) { 412 if (attempt >= connection_attempts) {
335 log("ssh: connect to host %s port %s: %s", 413 logit("ssh: connect to host %s port %s: %s",
336 host, strport, strerror(errno)); 414 host, strport, strerror(errno));
337 return full_failure ? ECONNABORTED : ECONNREFUSED; 415 return full_failure ? ECONNABORTED : ECONNREFUSED;
338 } 416 }
@@ -421,7 +499,7 @@ ssh_exchange_identification(void)
421 enable_compat13(); 499 enable_compat13();
422 minor1 = 3; 500 minor1 = 3;
423 if (options.forward_agent) { 501 if (options.forward_agent) {
424 log("Agent forwarding disabled for protocol 1.3"); 502 logit("Agent forwarding disabled for protocol 1.3");
425 options.forward_agent = 0; 503 options.forward_agent = 0;
426 } 504 }
427 } 505 }
@@ -445,7 +523,7 @@ ssh_exchange_identification(void)
445 compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1, 523 compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
446 compat20 ? PROTOCOL_MINOR_2 : minor1, 524 compat20 ? PROTOCOL_MINOR_2 : minor1,
447 SSH_VERSION); 525 SSH_VERSION);
448 if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf)) 526 if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf))
449 fatal("write: %.100s", strerror(errno)); 527 fatal("write: %.100s", strerror(errno));
450 client_version_string = xstrdup(buf); 528 client_version_string = xstrdup(buf);
451 chop(client_version_string); 529 chop(client_version_string);
@@ -496,7 +574,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
496 int salen; 574 int salen;
497 char ntop[NI_MAXHOST]; 575 char ntop[NI_MAXHOST];
498 char msg[1024]; 576 char msg[1024];
499 int len, host_line, ip_line, has_keys; 577 int len, host_line, ip_line;
500 const char *host_file = NULL, *ip_file = NULL; 578 const char *host_file = NULL, *ip_file = NULL;
501 579
502 /* 580 /*
@@ -612,16 +690,16 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
612 debug("Found key in %s:%d", host_file, host_line); 690 debug("Found key in %s:%d", host_file, host_line);
613 if (options.check_host_ip && ip_status == HOST_NEW) { 691 if (options.check_host_ip && ip_status == HOST_NEW) {
614 if (readonly) 692 if (readonly)
615 log("%s host key for IP address " 693 logit("%s host key for IP address "
616 "'%.128s' not in list of known hosts.", 694 "'%.128s' not in list of known hosts.",
617 type, ip); 695 type, ip);
618 else if (!add_host_to_hostfile(user_hostfile, ip, 696 else if (!add_host_to_hostfile(user_hostfile, ip,
619 host_key)) 697 host_key))
620 log("Failed to add the %s host key for IP " 698 logit("Failed to add the %s host key for IP "
621 "address '%.128s' to the list of known " 699 "address '%.128s' to the list of known "
622 "hosts (%.30s).", type, ip, user_hostfile); 700 "hosts (%.30s).", type, ip, user_hostfile);
623 else 701 else
624 log("Warning: Permanently added the %s host " 702 logit("Warning: Permanently added the %s host "
625 "key for IP address '%.128s' to the list " 703 "key for IP address '%.128s' to the list "
626 "of known hosts.", type, ip); 704 "of known hosts.", type, ip);
627 } 705 }
@@ -640,19 +718,36 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
640 "have requested strict checking.", type, host); 718 "have requested strict checking.", type, host);
641 goto fail; 719 goto fail;
642 } else if (options.strict_host_key_checking == 2) { 720 } else if (options.strict_host_key_checking == 2) {
643 has_keys = show_other_keys(host, host_key); 721 char msg1[1024], msg2[1024];
722
723 if (show_other_keys(host, host_key))
724 snprintf(msg1, sizeof(msg1),
725 "\nbut keys of different type are already"
726 " known for this host.");
727 else
728 snprintf(msg1, sizeof(msg1), ".");
644 /* The default */ 729 /* The default */
645 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX); 730 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
731 msg2[0] = '\0';
732#ifdef DNS
733 if (options.verify_host_key_dns) {
734 if (verified_host_key_dns)
735 snprintf(msg2, sizeof(msg2),
736 "Matching host key fingerprint"
737 " found in DNS.\n");
738 else
739 snprintf(msg2, sizeof(msg2),
740 "No matching host key fingerprint"
741 " found in DNS.\n");
742 }
743#endif
646 snprintf(msg, sizeof(msg), 744 snprintf(msg, sizeof(msg),
647 "The authenticity of host '%.200s (%s)' can't be " 745 "The authenticity of host '%.200s (%s)' can't be "
648 "established%s\n" 746 "established%s\n"
649 "%s key fingerprint is %s.\n" 747 "%s key fingerprint is %s.\n%s"
650 "Are you sure you want to continue connecting " 748 "Are you sure you want to continue connecting "
651 "(yes/no)? ", 749 "(yes/no)? ",
652 host, ip, 750 host, ip, msg1, type, fp, msg2);
653 has_keys ? ",\nbut keys of different type are already "
654 "known for this host." : ".",
655 type, fp);
656 xfree(fp); 751 xfree(fp);
657 if (!confirm(msg)) 752 if (!confirm(msg))
658 goto fail; 753 goto fail;
@@ -668,10 +763,10 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
668 * local known_hosts file. 763 * local known_hosts file.
669 */ 764 */
670 if (!add_host_to_hostfile(user_hostfile, hostp, host_key)) 765 if (!add_host_to_hostfile(user_hostfile, hostp, host_key))
671 log("Failed to add the host to the list of known " 766 logit("Failed to add the host to the list of known "
672 "hosts (%.500s).", user_hostfile); 767 "hosts (%.500s).", user_hostfile);
673 else 768 else
674 log("Warning: Permanently added '%.200s' (%s) to the " 769 logit("Warning: Permanently added '%.200s' (%s) to the "
675 "list of known hosts.", hostp, type); 770 "list of known hosts.", hostp, type);
676 break; 771 break;
677 case HOST_CHANGED: 772 case HOST_CHANGED:
@@ -722,7 +817,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
722 817
723 /* 818 /*
724 * If strict host key checking has not been requested, allow 819 * If strict host key checking has not been requested, allow
725 * the connection but without password authentication or 820 * the connection but without MITM-able authentication or
726 * agent forwarding. 821 * agent forwarding.
727 */ 822 */
728 if (options.password_authentication) { 823 if (options.password_authentication) {
@@ -730,6 +825,17 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
730 "man-in-the-middle attacks."); 825 "man-in-the-middle attacks.");
731 options.password_authentication = 0; 826 options.password_authentication = 0;
732 } 827 }
828 if (options.kbd_interactive_authentication) {
829 error("Keyboard-interactive authentication is disabled"
830 " to avoid man-in-the-middle attacks.");
831 options.kbd_interactive_authentication = 0;
832 options.challenge_response_authentication = 0;
833 }
834 if (options.challenge_response_authentication) {
835 error("Challenge/response authentication is disabled"
836 " to avoid man-in-the-middle attacks.");
837 options.challenge_response_authentication = 0;
838 }
733 if (options.forward_agent) { 839 if (options.forward_agent) {
734 error("Agent forwarding is disabled to avoid " 840 error("Agent forwarding is disabled to avoid "
735 "man-in-the-middle attacks."); 841 "man-in-the-middle attacks.");
@@ -774,7 +880,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
774 host_file, host_line); 880 host_file, host_line);
775 } 881 }
776 if (options.strict_host_key_checking == 1) { 882 if (options.strict_host_key_checking == 1) {
777 log(msg); 883 logit("%s", msg);
778 error("Exiting, you have requested strict checking."); 884 error("Exiting, you have requested strict checking.");
779 goto fail; 885 goto fail;
780 } else if (options.strict_host_key_checking == 2) { 886 } else if (options.strict_host_key_checking == 2) {
@@ -783,7 +889,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
783 if (!confirm(msg)) 889 if (!confirm(msg))
784 goto fail; 890 goto fail;
785 } else { 891 } else {
786 log(msg); 892 logit("%s", msg);
787 } 893 }
788 } 894 }
789 895
@@ -795,11 +901,33 @@ fail:
795 return -1; 901 return -1;
796} 902}
797 903
904/* returns 0 if key verifies or -1 if key does NOT verify */
798int 905int
799verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key) 906verify_host_key(char *host, struct sockaddr *hostaddr, Key *host_key)
800{ 907{
801 struct stat st; 908 struct stat st;
802 909
910#ifdef DNS
911 if (options.verify_host_key_dns) {
912 switch(verify_host_key_dns(host, hostaddr, host_key)) {
913 case DNS_VERIFY_OK:
914#ifdef DNSSEC
915 return 0;
916#else
917 verified_host_key_dns = 1;
918 break;
919#endif
920 case DNS_VERIFY_FAILED:
921 return -1;
922 case DNS_VERIFY_ERROR:
923 break;
924 default:
925 debug3("bad return value from verify_host_key_dns");
926 break;
927 }
928 }
929#endif /* DNS */
930
803 /* return ok if the key can be found in an old keyfile */ 931 /* return ok if the key can be found in an old keyfile */
804 if (stat(options.system_hostfile2, &st) == 0 || 932 if (stat(options.system_hostfile2, &st) == 0 ||
805 stat(options.user_hostfile2, &st) == 0) { 933 stat(options.user_hostfile2, &st) == 0) {
@@ -881,7 +1009,7 @@ show_key_from_file(const char *file, const char *host, int keytype)
881 if ((ret = lookup_key_in_hostfile_by_type(file, host, 1009 if ((ret = lookup_key_in_hostfile_by_type(file, host,
882 keytype, found, &line))) { 1010 keytype, found, &line))) {
883 fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX); 1011 fp = key_fingerprint(found, SSH_FP_MD5, SSH_FP_HEX);
884 log("WARNING: %s key found for host %s\n" 1012 logit("WARNING: %s key found for host %s\n"
885 "in %s:%d\n" 1013 "in %s:%d\n"
886 "%s key fingerprint %s.", 1014 "%s key fingerprint %s.",
887 key_type(found), host, file, line, 1015 key_type(found), host, file, line,
diff --git a/sshconnect1.c b/sshconnect1.c
index 2fc9a981a..2f89964ec 100644
--- a/sshconnect1.c
+++ b/sshconnect1.c
@@ -13,25 +13,11 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect1.c,v 1.52 2002/08/08 13:50:23 aaron Exp $"); 16RCSID("$OpenBSD: sshconnect1.c,v 1.56 2003/08/28 12:54:34 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19#include <openssl/md5.h> 19#include <openssl/md5.h>
20 20
21#ifdef KRB4
22#include <krb.h>
23#endif
24#ifdef KRB5
25#include <krb5.h>
26#ifndef HEIMDAL
27#define krb5_get_err_text(context,code) error_message(code)
28#endif /* !HEIMDAL */
29#endif
30#ifdef AFS
31#include <kafs.h>
32#include "radix.h"
33#endif
34
35#include "ssh.h" 21#include "ssh.h"
36#include "ssh1.h" 22#include "ssh1.h"
37#include "xmalloc.h" 23#include "xmalloc.h"
@@ -122,7 +108,7 @@ try_agent_authentication(void)
122 * although it advertised it supports this. Just 108 * although it advertised it supports this. Just
123 * return a wrong value. 109 * return a wrong value.
124 */ 110 */
125 log("Authentication agent failed to decrypt challenge."); 111 logit("Authentication agent failed to decrypt challenge.");
126 memset(response, 0, sizeof(response)); 112 memset(response, 0, sizeof(response));
127 } 113 }
128 key_free(key); 114 key_free(key);
@@ -380,478 +366,6 @@ try_rhosts_rsa_authentication(const char *local_user, Key * host_key)
380 return 0; 366 return 0;
381} 367}
382 368
383#ifdef KRB4
384static int
385try_krb4_authentication(void)
386{
387 KTEXT_ST auth; /* Kerberos data */
388 char *reply;
389 char inst[INST_SZ];
390 char *realm;
391 CREDENTIALS cred;
392 int r, type;
393 socklen_t slen;
394 Key_schedule schedule;
395 u_long checksum, cksum;
396 MSG_DAT msg_data;
397 struct sockaddr_in local, foreign;
398 struct stat st;
399
400 /* Don't do anything if we don't have any tickets. */
401 if (stat(tkt_string(), &st) < 0)
402 return 0;
403
404 strlcpy(inst, (char *)krb_get_phost(get_canonical_hostname(1)),
405 INST_SZ);
406
407 realm = (char *)krb_realmofhost(get_canonical_hostname(1));
408 if (!realm) {
409 debug("Kerberos v4: no realm for %s", get_canonical_hostname(1));
410 return 0;
411 }
412 /* This can really be anything. */
413 checksum = (u_long)getpid();
414
415 r = krb_mk_req(&auth, KRB4_SERVICE_NAME, inst, realm, checksum);
416 if (r != KSUCCESS) {
417 debug("Kerberos v4 krb_mk_req failed: %s", krb_err_txt[r]);
418 return 0;
419 }
420 /* Get session key to decrypt the server's reply with. */
421 r = krb_get_cred(KRB4_SERVICE_NAME, inst, realm, &cred);
422 if (r != KSUCCESS) {
423 debug("get_cred failed: %s", krb_err_txt[r]);
424 return 0;
425 }
426 des_key_sched((des_cblock *) cred.session, schedule);
427
428 /* Send authentication info to server. */
429 packet_start(SSH_CMSG_AUTH_KERBEROS);
430 packet_put_string((char *) auth.dat, auth.length);
431 packet_send();
432 packet_write_wait();
433
434 /* Zero the buffer. */
435 (void) memset(auth.dat, 0, MAX_KTXT_LEN);
436
437 slen = sizeof(local);
438 memset(&local, 0, sizeof(local));
439 if (getsockname(packet_get_connection_in(),
440 (struct sockaddr *)&local, &slen) < 0)
441 debug("getsockname failed: %s", strerror(errno));
442
443 slen = sizeof(foreign);
444 memset(&foreign, 0, sizeof(foreign));
445 if (getpeername(packet_get_connection_in(),
446 (struct sockaddr *)&foreign, &slen) < 0) {
447 debug("getpeername failed: %s", strerror(errno));
448 fatal_cleanup();
449 }
450 /* Get server reply. */
451 type = packet_read();
452 switch (type) {
453 case SSH_SMSG_FAILURE:
454 /* Should really be SSH_SMSG_AUTH_KERBEROS_FAILURE */
455 debug("Kerberos v4 authentication failed.");
456 return 0;
457 break;
458
459 case SSH_SMSG_AUTH_KERBEROS_RESPONSE:
460 /* SSH_SMSG_AUTH_KERBEROS_SUCCESS */
461 debug("Kerberos v4 authentication accepted.");
462
463 /* Get server's response. */
464 reply = packet_get_string((u_int *) &auth.length);
465 if (auth.length >= MAX_KTXT_LEN)
466 fatal("Kerberos v4: Malformed response from server");
467 memcpy(auth.dat, reply, auth.length);
468 xfree(reply);
469
470 packet_check_eom();
471
472 /*
473 * If his response isn't properly encrypted with the session
474 * key, and the decrypted checksum fails to match, he's
475 * bogus. Bail out.
476 */
477 r = krb_rd_priv(auth.dat, auth.length, schedule, &cred.session,
478 &foreign, &local, &msg_data);
479 if (r != KSUCCESS) {
480 debug("Kerberos v4 krb_rd_priv failed: %s",
481 krb_err_txt[r]);
482 packet_disconnect("Kerberos v4 challenge failed!");
483 }
484 /* Fetch the (incremented) checksum that we supplied in the request. */
485 memcpy((char *)&cksum, (char *)msg_data.app_data,
486 sizeof(cksum));
487 cksum = ntohl(cksum);
488
489 /* If it matches, we're golden. */
490 if (cksum == checksum + 1) {
491 debug("Kerberos v4 challenge successful.");
492 return 1;
493 } else
494 packet_disconnect("Kerberos v4 challenge failed!");
495 break;
496
497 default:
498 packet_disconnect("Protocol error on Kerberos v4 response: %d", type);
499 }
500 return 0;
501}
502
503#endif /* KRB4 */
504
505#ifdef KRB5
506static int
507try_krb5_authentication(krb5_context *context, krb5_auth_context *auth_context)
508{
509 krb5_error_code problem;
510 const char *tkfile;
511 struct stat buf;
512 krb5_ccache ccache = NULL;
513 const char *remotehost;
514 krb5_data ap;
515 int type;
516 krb5_ap_rep_enc_part *reply = NULL;
517 int ret;
518
519 memset(&ap, 0, sizeof(ap));
520
521 problem = krb5_init_context(context);
522 if (problem) {
523 debug("Kerberos v5: krb5_init_context failed");
524 ret = 0;
525 goto out;
526 }
527
528 problem = krb5_auth_con_init(*context, auth_context);
529 if (problem) {
530 debug("Kerberos v5: krb5_auth_con_init failed");
531 ret = 0;
532 goto out;
533 }
534
535#ifndef HEIMDAL
536 problem = krb5_auth_con_setflags(*context, *auth_context,
537 KRB5_AUTH_CONTEXT_RET_TIME);
538 if (problem) {
539 debug("Keberos v5: krb5_auth_con_setflags failed");
540 ret = 0;
541 goto out;
542 }
543#endif
544
545 tkfile = krb5_cc_default_name(*context);
546 if (strncmp(tkfile, "FILE:", 5) == 0)
547 tkfile += 5;
548
549 if (stat(tkfile, &buf) == 0 && getuid() != buf.st_uid) {
550 debug("Kerberos v5: could not get default ccache (permission denied).");
551 ret = 0;
552 goto out;
553 }
554
555 problem = krb5_cc_default(*context, &ccache);
556 if (problem) {
557 debug("Kerberos v5: krb5_cc_default failed: %s",
558 krb5_get_err_text(*context, problem));
559 ret = 0;
560 goto out;
561 }
562
563 remotehost = get_canonical_hostname(1);
564
565 problem = krb5_mk_req(*context, auth_context, AP_OPTS_MUTUAL_REQUIRED,
566 "host", remotehost, NULL, ccache, &ap);
567 if (problem) {
568 debug("Kerberos v5: krb5_mk_req failed: %s",
569 krb5_get_err_text(*context, problem));
570 ret = 0;
571 goto out;
572 }
573
574 packet_start(SSH_CMSG_AUTH_KERBEROS);
575 packet_put_string((char *) ap.data, ap.length);
576 packet_send();
577 packet_write_wait();
578
579 xfree(ap.data);
580 ap.length = 0;
581
582 type = packet_read();
583 switch (type) {
584 case SSH_SMSG_FAILURE:
585 /* Should really be SSH_SMSG_AUTH_KERBEROS_FAILURE */
586 debug("Kerberos v5 authentication failed.");
587 ret = 0;
588 break;
589
590 case SSH_SMSG_AUTH_KERBEROS_RESPONSE:
591 /* SSH_SMSG_AUTH_KERBEROS_SUCCESS */
592 debug("Kerberos v5 authentication accepted.");
593
594 /* Get server's response. */
595 ap.data = packet_get_string((unsigned int *) &ap.length);
596 packet_check_eom();
597 /* XXX je to dobre? */
598
599 problem = krb5_rd_rep(*context, *auth_context, &ap, &reply);
600 if (problem) {
601 ret = 0;
602 }
603 ret = 1;
604 break;
605
606 default:
607 packet_disconnect("Protocol error on Kerberos v5 response: %d",
608 type);
609 ret = 0;
610 break;
611
612 }
613
614 out:
615 if (ccache != NULL)
616 krb5_cc_close(*context, ccache);
617 if (reply != NULL)
618 krb5_free_ap_rep_enc_part(*context, reply);
619 if (ap.length > 0)
620#ifdef HEIMDAL
621 krb5_data_free(&ap);
622#else
623 krb5_free_data_contents(*context, &ap);
624#endif
625
626 return (ret);
627}
628
629static void
630send_krb5_tgt(krb5_context context, krb5_auth_context auth_context)
631{
632 int fd, type;
633 krb5_error_code problem;
634 krb5_data outbuf;
635 krb5_ccache ccache = NULL;
636 krb5_creds creds;
637#ifdef HEIMDAL
638 krb5_kdc_flags flags;
639#else
640 int forwardable;
641#endif
642 const char *remotehost;
643
644 memset(&creds, 0, sizeof(creds));
645 memset(&outbuf, 0, sizeof(outbuf));
646
647 fd = packet_get_connection_in();
648
649#ifdef HEIMDAL
650 problem = krb5_auth_con_setaddrs_from_fd(context, auth_context, &fd);
651#else
652 problem = krb5_auth_con_genaddrs(context, auth_context, fd,
653 KRB5_AUTH_CONTEXT_GENERATE_REMOTE_FULL_ADDR |
654 KRB5_AUTH_CONTEXT_GENERATE_LOCAL_FULL_ADDR);
655#endif
656 if (problem)
657 goto out;
658
659 problem = krb5_cc_default(context, &ccache);
660 if (problem)
661 goto out;
662
663 problem = krb5_cc_get_principal(context, ccache, &creds.client);
664 if (problem)
665 goto out;
666
667 remotehost = get_canonical_hostname(1);
668
669#ifdef HEIMDAL
670 problem = krb5_build_principal(context, &creds.server,
671 strlen(creds.client->realm), creds.client->realm,
672 "krbtgt", creds.client->realm, NULL);
673#else
674 problem = krb5_build_principal(context, &creds.server,
675 creds.client->realm.length, creds.client->realm.data,
676 "host", remotehost, NULL);
677#endif
678 if (problem)
679 goto out;
680
681 creds.times.endtime = 0;
682
683#ifdef HEIMDAL
684 flags.i = 0;
685 flags.b.forwarded = 1;
686 flags.b.forwardable = krb5_config_get_bool(context, NULL,
687 "libdefaults", "forwardable", NULL);
688 problem = krb5_get_forwarded_creds(context, auth_context,
689 ccache, flags.i, remotehost, &creds, &outbuf);
690#else
691 forwardable = 1;
692 problem = krb5_fwd_tgt_creds(context, auth_context, remotehost,
693 creds.client, creds.server, ccache, forwardable, &outbuf);
694#endif
695
696 if (problem)
697 goto out;
698
699 packet_start(SSH_CMSG_HAVE_KERBEROS_TGT);
700 packet_put_string((char *)outbuf.data, outbuf.length);
701 packet_send();
702 packet_write_wait();
703
704 type = packet_read();
705
706 if (type == SSH_SMSG_SUCCESS) {
707 char *pname;
708
709 krb5_unparse_name(context, creds.client, &pname);
710 debug("Kerberos v5 TGT forwarded (%s).", pname);
711 xfree(pname);
712 } else
713 debug("Kerberos v5 TGT forwarding failed.");
714
715 return;
716
717 out:
718 if (problem)
719 debug("Kerberos v5 TGT forwarding failed: %s",
720 krb5_get_err_text(context, problem));
721 if (creds.client)
722 krb5_free_principal(context, creds.client);
723 if (creds.server)
724 krb5_free_principal(context, creds.server);
725 if (ccache)
726 krb5_cc_close(context, ccache);
727 if (outbuf.data)
728 xfree(outbuf.data);
729}
730#endif /* KRB5 */
731
732#ifdef AFS
733static void
734send_krb4_tgt(void)
735{
736 CREDENTIALS *creds;
737 struct stat st;
738 char buffer[4096], pname[ANAME_SZ], pinst[INST_SZ], prealm[REALM_SZ];
739 int problem, type;
740
741 /* Don't do anything if we don't have any tickets. */
742 if (stat(tkt_string(), &st) < 0)
743 return;
744
745 creds = xmalloc(sizeof(*creds));
746
747 problem = krb_get_tf_fullname(TKT_FILE, pname, pinst, prealm);
748 if (problem)
749 goto out;
750
751 problem = krb_get_cred("krbtgt", prealm, prealm, creds);
752 if (problem)
753 goto out;
754
755 if (time(0) > krb_life_to_time(creds->issue_date, creds->lifetime)) {
756 problem = RD_AP_EXP;
757 goto out;
758 }
759 creds_to_radix(creds, (u_char *)buffer, sizeof(buffer));
760
761 packet_start(SSH_CMSG_HAVE_KERBEROS_TGT);
762 packet_put_cstring(buffer);
763 packet_send();
764 packet_write_wait();
765
766 type = packet_read();
767
768 if (type == SSH_SMSG_SUCCESS)
769 debug("Kerberos v4 TGT forwarded (%s%s%s@%s).",
770 creds->pname, creds->pinst[0] ? "." : "",
771 creds->pinst, creds->realm);
772 else
773 debug("Kerberos v4 TGT rejected.");
774
775 xfree(creds);
776 return;
777
778 out:
779 debug("Kerberos v4 TGT passing failed: %s", krb_err_txt[problem]);
780 xfree(creds);
781}
782
783static void
784send_afs_tokens(void)
785{
786 CREDENTIALS creds;
787 struct ViceIoctl parms;
788 struct ClearToken ct;
789 int i, type, len;
790 char buf[2048], *p, *server_cell;
791 char buffer[8192];
792
793 /* Move over ktc_GetToken, here's something leaner. */
794 for (i = 0; i < 100; i++) { /* just in case */
795 parms.in = (char *) &i;
796 parms.in_size = sizeof(i);
797 parms.out = buf;
798 parms.out_size = sizeof(buf);
799 if (k_pioctl(0, VIOCGETTOK, &parms, 0) != 0)
800 break;
801 p = buf;
802
803 /* Get secret token. */
804 memcpy(&creds.ticket_st.length, p, sizeof(u_int));
805 if (creds.ticket_st.length > MAX_KTXT_LEN)
806 break;
807 p += sizeof(u_int);
808 memcpy(creds.ticket_st.dat, p, creds.ticket_st.length);
809 p += creds.ticket_st.length;
810
811 /* Get clear token. */
812 memcpy(&len, p, sizeof(len));
813 if (len != sizeof(struct ClearToken))
814 break;
815 p += sizeof(len);
816 memcpy(&ct, p, len);
817 p += len;
818 p += sizeof(len); /* primary flag */
819 server_cell = p;
820
821 /* Flesh out our credentials. */
822 strlcpy(creds.service, "afs", sizeof(creds.service));
823 creds.instance[0] = '\0';
824 strlcpy(creds.realm, server_cell, REALM_SZ);
825 memcpy(creds.session, ct.HandShakeKey, DES_KEY_SZ);
826 creds.issue_date = ct.BeginTimestamp;
827 creds.lifetime = krb_time_to_life(creds.issue_date,
828 ct.EndTimestamp);
829 creds.kvno = ct.AuthHandle;
830 snprintf(creds.pname, sizeof(creds.pname), "AFS ID %d", ct.ViceId);
831 creds.pinst[0] = '\0';
832
833 /* Encode token, ship it off. */
834 if (creds_to_radix(&creds, (u_char *)buffer,
835 sizeof(buffer)) <= 0)
836 break;
837 packet_start(SSH_CMSG_HAVE_AFS_TOKEN);
838 packet_put_cstring(buffer);
839 packet_send();
840 packet_write_wait();
841
842 /* Roger, Roger. Clearance, Clarence. What's your vector,
843 Victor? */
844 type = packet_read();
845
846 if (type == SSH_SMSG_FAILURE)
847 debug("AFS token for cell %s rejected.", server_cell);
848 else if (type != SSH_SMSG_SUCCESS)
849 packet_disconnect("Protocol error on AFS token response: %d", type);
850 }
851}
852
853#endif /* AFS */
854
855/* 369/*
856 * Tries to authenticate with any string-based challenge/response system. 370 * Tries to authenticate with any string-based challenge/response system.
857 * Note that the client code is not tied to s/key or TIS. 371 * Note that the client code is not tied to s/key or TIS.
@@ -890,7 +404,7 @@ try_challenge_response_authentication(void)
890 if (i != 0) 404 if (i != 0)
891 error("Permission denied, please try again."); 405 error("Permission denied, please try again.");
892 if (options.cipher == SSH_CIPHER_NONE) 406 if (options.cipher == SSH_CIPHER_NONE)
893 log("WARNING: Encryption is disabled! " 407 logit("WARNING: Encryption is disabled! "
894 "Response will be transmitted in clear text."); 408 "Response will be transmitted in clear text.");
895 response = read_passphrase(prompt, 0); 409 response = read_passphrase(prompt, 0);
896 if (strcmp(response, "") == 0) { 410 if (strcmp(response, "") == 0) {
@@ -925,7 +439,7 @@ try_password_authentication(char *prompt)
925 439
926 debug("Doing password authentication."); 440 debug("Doing password authentication.");
927 if (options.cipher == SSH_CIPHER_NONE) 441 if (options.cipher == SSH_CIPHER_NONE)
928 log("WARNING: Encryption is disabled! Password will be transmitted in clear text."); 442 logit("WARNING: Encryption is disabled! Password will be transmitted in clear text.");
929 for (i = 0; i < options.number_of_password_prompts; i++) { 443 for (i = 0; i < options.number_of_password_prompts; i++) {
930 if (i != 0) 444 if (i != 0)
931 error("Permission denied, please try again."); 445 error("Permission denied, please try again.");
@@ -981,9 +495,9 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
981 495
982 rbits = BN_num_bits(server_key->rsa->n); 496 rbits = BN_num_bits(server_key->rsa->n);
983 if (bits != rbits) { 497 if (bits != rbits) {
984 log("Warning: Server lies about size of server public key: " 498 logit("Warning: Server lies about size of server public key: "
985 "actual size is %d bits vs. announced %d.", rbits, bits); 499 "actual size is %d bits vs. announced %d.", rbits, bits);
986 log("Warning: This may be due to an old implementation of ssh."); 500 logit("Warning: This may be due to an old implementation of ssh.");
987 } 501 }
988 /* Get the host key. */ 502 /* Get the host key. */
989 host_key = key_new(KEY_RSA1); 503 host_key = key_new(KEY_RSA1);
@@ -993,9 +507,9 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
993 507
994 rbits = BN_num_bits(host_key->rsa->n); 508 rbits = BN_num_bits(host_key->rsa->n);
995 if (bits != rbits) { 509 if (bits != rbits) {
996 log("Warning: Server lies about size of server host key: " 510 logit("Warning: Server lies about size of server host key: "
997 "actual size is %d bits vs. announced %d.", rbits, bits); 511 "actual size is %d bits vs. announced %d.", rbits, bits);
998 log("Warning: This may be due to an old implementation of ssh."); 512 logit("Warning: This may be due to an old implementation of ssh.");
999 } 513 }
1000 514
1001 /* Get protocol flags. */ 515 /* Get protocol flags. */
@@ -1086,7 +600,7 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
1086 options.cipher = ssh_cipher_default; 600 options.cipher = ssh_cipher_default;
1087 } else if (options.cipher == SSH_CIPHER_ILLEGAL || 601 } else if (options.cipher == SSH_CIPHER_ILLEGAL ||
1088 !(cipher_mask_ssh1(1) & (1 << options.cipher))) { 602 !(cipher_mask_ssh1(1) & (1 << options.cipher))) {
1089 log("No valid SSH1 cipher, using %.100s instead.", 603 logit("No valid SSH1 cipher, using %.100s instead.",
1090 cipher_name(ssh_cipher_default)); 604 cipher_name(ssh_cipher_default));
1091 options.cipher = ssh_cipher_default; 605 options.cipher = ssh_cipher_default;
1092 } 606 }
@@ -1140,10 +654,6 @@ void
1140ssh_userauth1(const char *local_user, const char *server_user, char *host, 654ssh_userauth1(const char *local_user, const char *server_user, char *host,
1141 Sensitive *sensitive) 655 Sensitive *sensitive)
1142{ 656{
1143#ifdef KRB5
1144 krb5_context context = NULL;
1145 krb5_auth_context auth_context = NULL;
1146#endif
1147 int i, type; 657 int i, type;
1148 658
1149 if (supported_authentications == 0) 659 if (supported_authentications == 0)
@@ -1168,56 +678,6 @@ ssh_userauth1(const char *local_user, const char *server_user, char *host,
1168 if (type != SSH_SMSG_FAILURE) 678 if (type != SSH_SMSG_FAILURE)
1169 packet_disconnect("Protocol error: got %d in response to SSH_CMSG_USER", type); 679 packet_disconnect("Protocol error: got %d in response to SSH_CMSG_USER", type);
1170 680
1171#ifdef KRB5
1172 if ((supported_authentications & (1 << SSH_AUTH_KERBEROS)) &&
1173 options.kerberos_authentication) {
1174 debug("Trying Kerberos v5 authentication.");
1175
1176 if (try_krb5_authentication(&context, &auth_context)) {
1177 type = packet_read();
1178 if (type == SSH_SMSG_SUCCESS)
1179 goto success;
1180 if (type != SSH_SMSG_FAILURE)
1181 packet_disconnect("Protocol error: got %d in response to Kerberos v5 auth", type);
1182 }
1183 }
1184#endif /* KRB5 */
1185
1186#ifdef KRB4
1187 if ((supported_authentications & (1 << SSH_AUTH_KERBEROS)) &&
1188 options.kerberos_authentication) {
1189 debug("Trying Kerberos v4 authentication.");
1190
1191 if (try_krb4_authentication()) {
1192 type = packet_read();
1193 if (type == SSH_SMSG_SUCCESS)
1194 goto success;
1195 if (type != SSH_SMSG_FAILURE)
1196 packet_disconnect("Protocol error: got %d in response to Kerberos v4 auth", type);
1197 }
1198 }
1199#endif /* KRB4 */
1200
1201 /*
1202 * Use rhosts authentication if running in privileged socket and we
1203 * do not wish to remain anonymous.
1204 */
1205 if ((supported_authentications & (1 << SSH_AUTH_RHOSTS)) &&
1206 options.rhosts_authentication) {
1207 debug("Trying rhosts authentication.");
1208 packet_start(SSH_CMSG_AUTH_RHOSTS);
1209 packet_put_cstring(local_user);
1210 packet_send();
1211 packet_write_wait();
1212
1213 /* The server should respond with success or failure. */
1214 type = packet_read();
1215 if (type == SSH_SMSG_SUCCESS)
1216 goto success;
1217 if (type != SSH_SMSG_FAILURE)
1218 packet_disconnect("Protocol error: got %d in response to rhosts auth",
1219 type);
1220 }
1221 /* 681 /*
1222 * Try .rhosts or /etc/hosts.equiv authentication with RSA host 682 * Try .rhosts or /etc/hosts.equiv authentication with RSA host
1223 * authentication. 683 * authentication.
@@ -1271,36 +731,5 @@ ssh_userauth1(const char *local_user, const char *server_user, char *host,
1271 /* NOTREACHED */ 731 /* NOTREACHED */
1272 732
1273 success: 733 success:
1274#ifdef KRB5
1275 /* Try Kerberos v5 TGT passing. */
1276 if ((supported_authentications & (1 << SSH_PASS_KERBEROS_TGT)) &&
1277 options.kerberos_tgt_passing && context && auth_context) {
1278 if (options.cipher == SSH_CIPHER_NONE)
1279 log("WARNING: Encryption is disabled! Ticket will be transmitted in the clear!");
1280 send_krb5_tgt(context, auth_context);
1281 }
1282 if (auth_context)
1283 krb5_auth_con_free(context, auth_context);
1284 if (context)
1285 krb5_free_context(context);
1286#endif
1287
1288#ifdef AFS
1289 /* Try Kerberos v4 TGT passing if the server supports it. */
1290 if ((supported_authentications & (1 << SSH_PASS_KERBEROS_TGT)) &&
1291 options.kerberos_tgt_passing) {
1292 if (options.cipher == SSH_CIPHER_NONE)
1293 log("WARNING: Encryption is disabled! Ticket will be transmitted in the clear!");
1294 send_krb4_tgt();
1295 }
1296 /* Try AFS token passing if the server supports it. */
1297 if ((supported_authentications & (1 << SSH_PASS_AFS_TOKEN)) &&
1298 options.afs_token_passing && k_hasafs()) {
1299 if (options.cipher == SSH_CIPHER_NONE)
1300 log("WARNING: Encryption is disabled! Token will be transmitted in the clear!");
1301 send_afs_tokens();
1302 }
1303#endif /* AFS */
1304
1305 return; /* need statement after label */ 734 return; /* need statement after label */
1306} 735}
diff --git a/sshconnect2.c b/sshconnect2.c
index 642b34b9e..933c223ec 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -23,7 +23,9 @@
23 */ 23 */
24 24
25#include "includes.h" 25#include "includes.h"
26RCSID("$OpenBSD: sshconnect2.c,v 1.114 2003/04/01 10:22:21 markus Exp $"); 26RCSID("$OpenBSD: sshconnect2.c,v 1.124 2003/08/25 10:33:33 djm Exp $");
27
28#include "openbsd-compat/sys-queue.h"
27 29
28#include "ssh.h" 30#include "ssh.h"
29#include "ssh2.h" 31#include "ssh2.h"
@@ -48,6 +50,10 @@ RCSID("$OpenBSD: sshconnect2.c,v 1.114 2003/04/01 10:22:21 markus Exp $");
48#include "msg.h" 50#include "msg.h"
49#include "pathnames.h" 51#include "pathnames.h"
50 52
53#ifdef GSSAPI
54#include "ssh-gss.h"
55#endif
56
51/* import */ 57/* import */
52extern char *client_version_string; 58extern char *client_version_string;
53extern char *server_version_string; 59extern char *server_version_string;
@@ -58,7 +64,7 @@ extern Options options;
58 */ 64 */
59 65
60u_char *session_id2 = NULL; 66u_char *session_id2 = NULL;
61int session_id2_len = 0; 67u_int session_id2_len = 0;
62 68
63char *xxx_host; 69char *xxx_host;
64struct sockaddr *xxx_hostaddr; 70struct sockaddr *xxx_hostaddr;
@@ -82,7 +88,7 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
82 xxx_hostaddr = hostaddr; 88 xxx_hostaddr = hostaddr;
83 89
84 if (options.ciphers == (char *)-1) { 90 if (options.ciphers == (char *)-1) {
85 log("No valid ciphers for protocol version 2 given, using defaults."); 91 logit("No valid ciphers for protocol version 2 given, using defaults.");
86 options.ciphers = NULL; 92 options.ciphers = NULL;
87 } 93 }
88 if (options.ciphers != NULL) { 94 if (options.ciphers != NULL) {
@@ -108,6 +114,9 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
108 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] = 114 myproposal[PROPOSAL_SERVER_HOST_KEY_ALGS] =
109 options.hostkeyalgorithms; 115 options.hostkeyalgorithms;
110 116
117 if (options.rekey_limit)
118 packet_set_rekey_limit(options.rekey_limit);
119
111 /* start key exchange */ 120 /* start key exchange */
112 kex = kex_setup(myproposal); 121 kex = kex_setup(myproposal);
113 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client; 122 kex->kex[KEX_DH_GRP1_SHA1] = kexdh_client;
@@ -138,10 +147,18 @@ ssh_kex2(char *host, struct sockaddr *hostaddr)
138 147
139typedef struct Authctxt Authctxt; 148typedef struct Authctxt Authctxt;
140typedef struct Authmethod Authmethod; 149typedef struct Authmethod Authmethod;
141 150typedef struct identity Identity;
142typedef int sign_cb_fn( 151typedef struct idlist Idlist;
143 Authctxt *authctxt, Key *key, 152
144 u_char **sigp, u_int *lenp, u_char *data, u_int datalen); 153struct identity {
154 TAILQ_ENTRY(identity) next;
155 AuthenticationConnection *ac; /* set if agent supports key */
156 Key *key; /* public/private key */
157 char *filename; /* comment for agent-only keys */
158 int tried;
159 int isprivate; /* key points to the private key */
160};
161TAILQ_HEAD(idlist, identity);
145 162
146struct Authctxt { 163struct Authctxt {
147 const char *server_user; 164 const char *server_user;
@@ -152,14 +169,14 @@ struct Authctxt {
152 int success; 169 int success;
153 char *authlist; 170 char *authlist;
154 /* pubkey */ 171 /* pubkey */
155 Key *last_key; 172 Idlist keys;
156 sign_cb_fn *last_key_sign;
157 int last_key_hint;
158 AuthenticationConnection *agent; 173 AuthenticationConnection *agent;
159 /* hostbased */ 174 /* hostbased */
160 Sensitive *sensitive; 175 Sensitive *sensitive;
161 /* kbd-interactive */ 176 /* kbd-interactive */
162 int info_req_seen; 177 int info_req_seen;
178 /* generic */
179 void *methoddata;
163}; 180};
164struct Authmethod { 181struct Authmethod {
165 char *name; /* string to compare against server's list */ 182 char *name; /* string to compare against server's list */
@@ -181,17 +198,35 @@ int userauth_pubkey(Authctxt *);
181int userauth_passwd(Authctxt *); 198int userauth_passwd(Authctxt *);
182int userauth_kbdint(Authctxt *); 199int userauth_kbdint(Authctxt *);
183int userauth_hostbased(Authctxt *); 200int userauth_hostbased(Authctxt *);
201int userauth_kerberos(Authctxt *);
202
203#ifdef GSSAPI
204int userauth_gssapi(Authctxt *authctxt);
205void input_gssapi_response(int type, u_int32_t, void *);
206void input_gssapi_token(int type, u_int32_t, void *);
207void input_gssapi_hash(int type, u_int32_t, void *);
208void input_gssapi_error(int, u_int32_t, void *);
209void input_gssapi_errtok(int, u_int32_t, void *);
210#endif
184 211
185void userauth(Authctxt *, char *); 212void userauth(Authctxt *, char *);
186 213
187static int sign_and_send_pubkey(Authctxt *, Key *, sign_cb_fn *); 214static int sign_and_send_pubkey(Authctxt *, Identity *);
188static void clear_auth_state(Authctxt *); 215static void pubkey_prepare(Authctxt *);
216static void pubkey_cleanup(Authctxt *);
217static Key *load_identity_file(char *);
189 218
190static Authmethod *authmethod_get(char *authlist); 219static Authmethod *authmethod_get(char *authlist);
191static Authmethod *authmethod_lookup(const char *name); 220static Authmethod *authmethod_lookup(const char *name);
192static char *authmethods_get(void); 221static char *authmethods_get(void);
193 222
194Authmethod authmethods[] = { 223Authmethod authmethods[] = {
224#ifdef GSSAPI
225 {"gssapi",
226 userauth_gssapi,
227 &options.gss_authentication,
228 NULL},
229#endif
195 {"hostbased", 230 {"hostbased",
196 userauth_hostbased, 231 userauth_hostbased,
197 &options.hostbased_authentication, 232 &options.hostbased_authentication,
@@ -248,7 +283,7 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
248 283
249 /* setup authentication context */ 284 /* setup authentication context */
250 memset(&authctxt, 0, sizeof(authctxt)); 285 memset(&authctxt, 0, sizeof(authctxt));
251 authctxt.agent = ssh_get_authentication_connection(); 286 pubkey_prepare(&authctxt);
252 authctxt.server_user = server_user; 287 authctxt.server_user = server_user;
253 authctxt.local_user = local_user; 288 authctxt.local_user = local_user;
254 authctxt.host = host; 289 authctxt.host = host;
@@ -256,6 +291,7 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
256 authctxt.success = 0; 291 authctxt.success = 0;
257 authctxt.method = authmethod_lookup("none"); 292 authctxt.method = authmethod_lookup("none");
258 authctxt.authlist = NULL; 293 authctxt.authlist = NULL;
294 authctxt.methoddata = NULL;
259 authctxt.sensitive = sensitive; 295 authctxt.sensitive = sensitive;
260 authctxt.info_req_seen = 0; 296 authctxt.info_req_seen = 0;
261 if (authctxt.method == NULL) 297 if (authctxt.method == NULL)
@@ -270,14 +306,19 @@ ssh_userauth2(const char *local_user, const char *server_user, char *host,
270 dispatch_set(SSH2_MSG_USERAUTH_BANNER, &input_userauth_banner); 306 dispatch_set(SSH2_MSG_USERAUTH_BANNER, &input_userauth_banner);
271 dispatch_run(DISPATCH_BLOCK, &authctxt.success, &authctxt); /* loop until success */ 307 dispatch_run(DISPATCH_BLOCK, &authctxt.success, &authctxt); /* loop until success */
272 308
273 if (authctxt.agent != NULL) 309 pubkey_cleanup(&authctxt);
274 ssh_close_authentication_connection(authctxt.agent); 310 dispatch_range(SSH2_MSG_USERAUTH_MIN, SSH2_MSG_USERAUTH_MAX, NULL);
275 311
276 debug("Authentication succeeded (%s).", authctxt.method->name); 312 debug("Authentication succeeded (%s).", authctxt.method->name);
277} 313}
314
278void 315void
279userauth(Authctxt *authctxt, char *authlist) 316userauth(Authctxt *authctxt, char *authlist)
280{ 317{
318 if (authctxt->methoddata) {
319 xfree(authctxt->methoddata);
320 authctxt->methoddata = NULL;
321 }
281 if (authlist == NULL) { 322 if (authlist == NULL) {
282 authlist = authctxt->authlist; 323 authlist = authctxt->authlist;
283 } else { 324 } else {
@@ -290,6 +331,12 @@ userauth(Authctxt *authctxt, char *authlist)
290 if (method == NULL) 331 if (method == NULL)
291 fatal("Permission denied (%s).", authlist); 332 fatal("Permission denied (%s).", authlist);
292 authctxt->method = method; 333 authctxt->method = method;
334
335 /* reset the per method handler */
336 dispatch_range(SSH2_MSG_USERAUTH_PER_METHOD_MIN,
337 SSH2_MSG_USERAUTH_PER_METHOD_MAX, NULL);
338
339 /* and try new method */
293 if (method->userauth(authctxt) != 0) { 340 if (method->userauth(authctxt) != 0) {
294 debug2("we sent a %s packet, wait for reply", method->name); 341 debug2("we sent a %s packet, wait for reply", method->name);
295 break; 342 break;
@@ -314,7 +361,7 @@ input_userauth_banner(int type, u_int32_t seq, void *ctxt)
314 debug3("input_userauth_banner"); 361 debug3("input_userauth_banner");
315 msg = packet_get_string(NULL); 362 msg = packet_get_string(NULL);
316 lang = packet_get_string(NULL); 363 lang = packet_get_string(NULL);
317 fprintf(stderr, "%s", msg); 364 logit("%s", msg);
318 xfree(msg); 365 xfree(msg);
319 xfree(lang); 366 xfree(lang);
320} 367}
@@ -327,7 +374,8 @@ input_userauth_success(int type, u_int32_t seq, void *ctxt)
327 fatal("input_userauth_success: no authentication context"); 374 fatal("input_userauth_success: no authentication context");
328 if (authctxt->authlist) 375 if (authctxt->authlist)
329 xfree(authctxt->authlist); 376 xfree(authctxt->authlist);
330 clear_auth_state(authctxt); 377 if (authctxt->methoddata)
378 xfree(authctxt->methoddata);
331 authctxt->success = 1; /* break out */ 379 authctxt->success = 1; /* break out */
332} 380}
333 381
@@ -346,10 +394,9 @@ input_userauth_failure(int type, u_int32_t seq, void *ctxt)
346 packet_check_eom(); 394 packet_check_eom();
347 395
348 if (partial != 0) 396 if (partial != 0)
349 log("Authenticated with partial success."); 397 logit("Authenticated with partial success.");
350 debug("Authentications that can continue: %s", authlist); 398 debug("Authentications that can continue: %s", authlist);
351 399
352 clear_auth_state(authctxt);
353 userauth(authctxt, authlist); 400 userauth(authctxt, authlist);
354} 401}
355void 402void
@@ -357,6 +404,7 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
357{ 404{
358 Authctxt *authctxt = ctxt; 405 Authctxt *authctxt = ctxt;
359 Key *key = NULL; 406 Key *key = NULL;
407 Identity *id = NULL;
360 Buffer b; 408 Buffer b;
361 int pktype, sent = 0; 409 int pktype, sent = 0;
362 u_int alen, blen; 410 u_int alen, blen;
@@ -379,55 +427,267 @@ input_userauth_pk_ok(int type, u_int32_t seq, void *ctxt)
379 } 427 }
380 packet_check_eom(); 428 packet_check_eom();
381 429
382 debug("Server accepts key: pkalg %s blen %u lastkey %p hint %d", 430 debug("Server accepts key: pkalg %s blen %u", pkalg, blen);
383 pkalg, blen, authctxt->last_key, authctxt->last_key_hint);
384 431
385 do { 432 if ((pktype = key_type_from_name(pkalg)) == KEY_UNSPEC) {
386 if (authctxt->last_key == NULL || 433 debug("unknown pkalg %s", pkalg);
387 authctxt->last_key_sign == NULL) { 434 goto done;
388 debug("no last key or no sign cb"); 435 }
389 break; 436 if ((key = key_from_blob(pkblob, blen)) == NULL) {
390 } 437 debug("no key from blob. pkalg %s", pkalg);
391 if ((pktype = key_type_from_name(pkalg)) == KEY_UNSPEC) { 438 goto done;
392 debug("unknown pkalg %s", pkalg); 439 }
393 break; 440 if (key->type != pktype) {
394 } 441 error("input_userauth_pk_ok: type mismatch "
395 if ((key = key_from_blob(pkblob, blen)) == NULL) { 442 "for decoded key (received %d, expected %d)",
396 debug("no key from blob. pkalg %s", pkalg); 443 key->type, pktype);
397 break; 444 goto done;
398 } 445 }
399 if (key->type != pktype) { 446 fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX);
400 error("input_userauth_pk_ok: type mismatch " 447 debug2("input_userauth_pk_ok: fp %s", fp);
401 "for decoded key (received %d, expected %d)", 448 xfree(fp);
402 key->type, pktype); 449
403 break; 450 TAILQ_FOREACH(id, &authctxt->keys, next) {
404 } 451 if (key_equal(key, id->key)) {
405 fp = key_fingerprint(key, SSH_FP_MD5, SSH_FP_HEX); 452 sent = sign_and_send_pubkey(authctxt, id);
406 debug2("input_userauth_pk_ok: fp %s", fp);
407 xfree(fp);
408 if (!key_equal(key, authctxt->last_key)) {
409 debug("key != last_key");
410 break; 453 break;
411 } 454 }
412 sent = sign_and_send_pubkey(authctxt, key, 455 }
413 authctxt->last_key_sign); 456done:
414 } while (0);
415
416 if (key != NULL) 457 if (key != NULL)
417 key_free(key); 458 key_free(key);
418 xfree(pkalg); 459 xfree(pkalg);
419 xfree(pkblob); 460 xfree(pkblob);
420 461
421 /* unregister */
422 clear_auth_state(authctxt);
423 dispatch_set(SSH2_MSG_USERAUTH_PK_OK, NULL);
424
425 /* try another method if we did not send a packet */ 462 /* try another method if we did not send a packet */
426 if (sent == 0) 463 if (sent == 0)
427 userauth(authctxt, NULL); 464 userauth(authctxt, NULL);
465}
466
467#ifdef GSSAPI
468int
469userauth_gssapi(Authctxt *authctxt)
470{
471 Gssctxt *gssctxt = NULL;
472 static gss_OID_set supported = NULL;
473 static int mech = 0;
474 OM_uint32 min;
475 int ok = 0;
476
477 /* Try one GSSAPI method at a time, rather than sending them all at
478 * once. */
479
480 if (supported == NULL)
481 gss_indicate_mechs(&min, &supported);
482
483 /* Check to see if the mechanism is usable before we offer it */
484 while (mech<supported->count && !ok) {
485 if (gssctxt)
486 ssh_gssapi_delete_ctx(&gssctxt);
487 ssh_gssapi_build_ctx(&gssctxt);
488 ssh_gssapi_set_oid(gssctxt, &supported->elements[mech]);
489
490 /* My DER encoding requires length<128 */
491 if (supported->elements[mech].length < 128 &&
492 !GSS_ERROR(ssh_gssapi_import_name(gssctxt,
493 authctxt->host))) {
494 ok = 1; /* Mechanism works */
495 } else {
496 mech++;
497 }
498 }
499
500 if (!ok) return 0;
501
502 authctxt->methoddata=(void *)gssctxt;
503
504 packet_start(SSH2_MSG_USERAUTH_REQUEST);
505 packet_put_cstring(authctxt->server_user);
506 packet_put_cstring(authctxt->service);
507 packet_put_cstring(authctxt->method->name);
428 508
509 packet_put_int(1);
510
511 /* Some servers encode the OID incorrectly (as we used to) */
512 if (datafellows & SSH_BUG_GSSAPI_BER) {
513 packet_put_string(supported->elements[mech].elements,
514 supported->elements[mech].length);
515 } else {
516 packet_put_int((supported->elements[mech].length)+2);
517 packet_put_char(SSH_GSS_OIDTYPE);
518 packet_put_char(supported->elements[mech].length);
519 packet_put_raw(supported->elements[mech].elements,
520 supported->elements[mech].length);
521 }
522
523 packet_send();
524
525 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_RESPONSE, &input_gssapi_response);
526 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_TOKEN, &input_gssapi_token);
527 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERROR, &input_gssapi_error);
528 dispatch_set(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK, &input_gssapi_errtok);
529
530 mech++; /* Move along to next candidate */
531
532 return 1;
533}
534
535void
536input_gssapi_response(int type, u_int32_t plen, void *ctxt)
537{
538 Authctxt *authctxt = ctxt;
539 Gssctxt *gssctxt;
540 OM_uint32 status, ms;
541 int oidlen;
542 char *oidv;
543 gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
544
545 if (authctxt == NULL)
546 fatal("input_gssapi_response: no authentication context");
547 gssctxt = authctxt->methoddata;
548
549 /* Setup our OID */
550 oidv = packet_get_string(&oidlen);
551
552 if (datafellows & SSH_BUG_GSSAPI_BER) {
553 if (!ssh_gssapi_check_oid(gssctxt, oidv, oidlen))
554 fatal("Server returned different OID than expected");
555 } else {
556 if(oidv[0] != SSH_GSS_OIDTYPE || oidv[1] != oidlen-2) {
557 debug("Badly encoded mechanism OID received");
558 userauth(authctxt, NULL);
559 xfree(oidv);
560 return;
561 }
562 if (!ssh_gssapi_check_oid(gssctxt, oidv+2, oidlen-2))
563 fatal("Server returned different OID than expected");
564 }
565
566 packet_check_eom();
567
568 xfree(oidv);
569
570 status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
571 GSS_C_NO_BUFFER, &send_tok, NULL);
572 if (GSS_ERROR(status)) {
573 if (send_tok.length > 0) {
574 packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK);
575 packet_put_string(send_tok.value, send_tok.length);
576 packet_send();
577 gss_release_buffer(&ms, &send_tok);
578 }
579 /* Start again with next method on list */
580 debug("Trying to start again");
581 userauth(authctxt, NULL);
582 return;
583 }
584
585 /* We must have data to send */
586 packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
587 packet_put_string(send_tok.value, send_tok.length);
588 packet_send();
589 gss_release_buffer(&ms, &send_tok);
429} 590}
430 591
592void
593input_gssapi_token(int type, u_int32_t plen, void *ctxt)
594{
595 Authctxt *authctxt = ctxt;
596 Gssctxt *gssctxt;
597 gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
598 gss_buffer_desc recv_tok;
599 OM_uint32 status, ms;
600 u_int slen;
601
602 if (authctxt == NULL)
603 fatal("input_gssapi_response: no authentication context");
604 gssctxt = authctxt->methoddata;
605
606 recv_tok.value = packet_get_string(&slen);
607 recv_tok.length = slen; /* safe typecast */
608
609 packet_check_eom();
610
611 status=ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
612 &recv_tok, &send_tok, NULL);
613
614 xfree(recv_tok.value);
615
616 if (GSS_ERROR(status)) {
617 if (send_tok.length > 0) {
618 packet_start(SSH2_MSG_USERAUTH_GSSAPI_ERRTOK);
619 packet_put_string(send_tok.value, send_tok.length);
620 packet_send();
621 gss_release_buffer(&ms, &send_tok);
622 }
623 /* Start again with the next method in the list */
624 userauth(authctxt, NULL);
625 return;
626 }
627
628 if (send_tok.length > 0) {
629 packet_start(SSH2_MSG_USERAUTH_GSSAPI_TOKEN);
630 packet_put_string(send_tok.value, send_tok.length);
631 packet_send();
632 gss_release_buffer(&ms, &send_tok);
633 }
634
635 if (status == GSS_S_COMPLETE) {
636 /* If that succeeded, send a exchange complete message */
637 packet_start(SSH2_MSG_USERAUTH_GSSAPI_EXCHANGE_COMPLETE);
638 packet_send();
639 }
640}
641
642void
643input_gssapi_errtok(int type, u_int32_t plen, void *ctxt)
644{
645 Authctxt *authctxt = ctxt;
646 Gssctxt *gssctxt;
647 gss_buffer_desc send_tok = GSS_C_EMPTY_BUFFER;
648 gss_buffer_desc recv_tok;
649 OM_uint32 status, ms;
650 u_int len;
651
652 if (authctxt == NULL)
653 fatal("input_gssapi_response: no authentication context");
654 gssctxt = authctxt->methoddata;
655
656 recv_tok.value = packet_get_string(&len);
657 recv_tok.length = len;
658
659 packet_check_eom();
660
661 /* Stick it into GSSAPI and see what it says */
662 status = ssh_gssapi_init_ctx(gssctxt, options.gss_deleg_creds,
663 &recv_tok, &send_tok, NULL);
664
665 xfree(recv_tok.value);
666 gss_release_buffer(&ms, &send_tok);
667
668 /* Server will be returning a failed packet after this one */
669}
670
671void
672input_gssapi_error(int type, u_int32_t plen, void *ctxt)
673{
674 OM_uint32 maj, min;
675 char *msg;
676 char *lang;
677
678 maj=packet_get_int();
679 min=packet_get_int();
680 msg=packet_get_string(NULL);
681 lang=packet_get_string(NULL);
682
683 packet_check_eom();
684
685 debug("Server GSSAPI Error:\n%s\n", msg);
686 xfree(msg);
687 xfree(lang);
688}
689#endif /* GSSAPI */
690
431int 691int
432userauth_none(Authctxt *authctxt) 692userauth_none(Authctxt *authctxt)
433{ 693{
@@ -491,7 +751,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
491 info = packet_get_string(NULL); 751 info = packet_get_string(NULL);
492 lang = packet_get_string(NULL); 752 lang = packet_get_string(NULL);
493 if (strlen(info) > 0) 753 if (strlen(info) > 0)
494 log("%s", info); 754 logit("%s", info);
495 xfree(info); 755 xfree(info);
496 xfree(lang); 756 xfree(lang);
497 packet_start(SSH2_MSG_USERAUTH_REQUEST); 757 packet_start(SSH2_MSG_USERAUTH_REQUEST);
@@ -523,7 +783,7 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
523 if (strcmp(password, retype) != 0) { 783 if (strcmp(password, retype) != 0) {
524 memset(password, 0, strlen(password)); 784 memset(password, 0, strlen(password));
525 xfree(password); 785 xfree(password);
526 log("Mismatch; try again, EOF to quit."); 786 logit("Mismatch; try again, EOF to quit.");
527 password = NULL; 787 password = NULL;
528 } 788 }
529 memset(retype, 0, strlen(retype)); 789 memset(retype, 0, strlen(retype));
@@ -539,34 +799,44 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, void *ctxt)
539 &input_userauth_passwd_changereq); 799 &input_userauth_passwd_changereq);
540} 800}
541 801
542static void 802static int
543clear_auth_state(Authctxt *authctxt) 803identity_sign(Identity *id, u_char **sigp, u_int *lenp,
804 u_char *data, u_int datalen)
544{ 805{
545 /* XXX clear authentication state */ 806 Key *prv;
546 dispatch_set(SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ, NULL); 807 int ret;
547 808
548 if (authctxt->last_key != NULL && authctxt->last_key_hint == -1) { 809 /* the agent supports this key */
549 debug3("clear_auth_state: key_free %p", authctxt->last_key); 810 if (id->ac)
550 key_free(authctxt->last_key); 811 return (ssh_agent_sign(id->ac, id->key, sigp, lenp,
551 } 812 data, datalen));
552 authctxt->last_key = NULL; 813 /*
553 authctxt->last_key_hint = -2; 814 * we have already loaded the private key or
554 authctxt->last_key_sign = NULL; 815 * the private key is stored in external hardware
816 */
817 if (id->isprivate || (id->key->flags & KEY_FLAG_EXT))
818 return (key_sign(id->key, sigp, lenp, data, datalen));
819 /* load the private key from the file */
820 if ((prv = load_identity_file(id->filename)) == NULL)
821 return (-1);
822 ret = key_sign(prv, sigp, lenp, data, datalen);
823 key_free(prv);
824 return (ret);
555} 825}
556 826
557static int 827static int
558sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback) 828sign_and_send_pubkey(Authctxt *authctxt, Identity *id)
559{ 829{
560 Buffer b; 830 Buffer b;
561 u_char *blob, *signature; 831 u_char *blob, *signature;
562 u_int bloblen, slen; 832 u_int bloblen, slen;
563 int skip = 0; 833 u_int skip = 0;
564 int ret = -1; 834 int ret = -1;
565 int have_sig = 1; 835 int have_sig = 1;
566 836
567 debug3("sign_and_send_pubkey"); 837 debug3("sign_and_send_pubkey");
568 838
569 if (key_to_blob(k, &blob, &bloblen) == 0) { 839 if (key_to_blob(id->key, &blob, &bloblen) == 0) {
570 /* we cannot handle this key */ 840 /* we cannot handle this key */
571 debug3("sign_and_send_pubkey: cannot handle key"); 841 debug3("sign_and_send_pubkey: cannot handle key");
572 return 0; 842 return 0;
@@ -591,12 +861,12 @@ sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback)
591 } else { 861 } else {
592 buffer_put_cstring(&b, authctxt->method->name); 862 buffer_put_cstring(&b, authctxt->method->name);
593 buffer_put_char(&b, have_sig); 863 buffer_put_char(&b, have_sig);
594 buffer_put_cstring(&b, key_ssh_name(k)); 864 buffer_put_cstring(&b, key_ssh_name(id->key));
595 } 865 }
596 buffer_put_string(&b, blob, bloblen); 866 buffer_put_string(&b, blob, bloblen);
597 867
598 /* generate signature */ 868 /* generate signature */
599 ret = (*sign_callback)(authctxt, k, &signature, &slen, 869 ret = identity_sign(id, &signature, &slen,
600 buffer_ptr(&b), buffer_len(&b)); 870 buffer_ptr(&b), buffer_len(&b));
601 if (ret == -1) { 871 if (ret == -1) {
602 xfree(blob); 872 xfree(blob);
@@ -616,7 +886,7 @@ sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback)
616 buffer_put_cstring(&b, authctxt->method->name); 886 buffer_put_cstring(&b, authctxt->method->name);
617 buffer_put_char(&b, have_sig); 887 buffer_put_char(&b, have_sig);
618 if (!(datafellows & SSH_BUG_PKAUTH)) 888 if (!(datafellows & SSH_BUG_PKAUTH))
619 buffer_put_cstring(&b, key_ssh_name(k)); 889 buffer_put_cstring(&b, key_ssh_name(id->key));
620 buffer_put_string(&b, blob, bloblen); 890 buffer_put_string(&b, blob, bloblen);
621 } 891 }
622 xfree(blob); 892 xfree(blob);
@@ -640,23 +910,19 @@ sign_and_send_pubkey(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback)
640} 910}
641 911
642static int 912static int
643send_pubkey_test(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback, 913send_pubkey_test(Authctxt *authctxt, Identity *id)
644 int hint)
645{ 914{
646 u_char *blob; 915 u_char *blob;
647 u_int bloblen, have_sig = 0; 916 u_int bloblen, have_sig = 0;
648 917
649 debug3("send_pubkey_test"); 918 debug3("send_pubkey_test");
650 919
651 if (key_to_blob(k, &blob, &bloblen) == 0) { 920 if (key_to_blob(id->key, &blob, &bloblen) == 0) {
652 /* we cannot handle this key */ 921 /* we cannot handle this key */
653 debug3("send_pubkey_test: cannot handle key"); 922 debug3("send_pubkey_test: cannot handle key");
654 return 0; 923 return 0;
655 } 924 }
656 /* register callback for USERAUTH_PK_OK message */ 925 /* register callback for USERAUTH_PK_OK message */
657 authctxt->last_key_sign = sign_callback;
658 authctxt->last_key_hint = hint;
659 authctxt->last_key = k;
660 dispatch_set(SSH2_MSG_USERAUTH_PK_OK, &input_userauth_pk_ok); 926 dispatch_set(SSH2_MSG_USERAUTH_PK_OK, &input_userauth_pk_ok);
661 927
662 packet_start(SSH2_MSG_USERAUTH_REQUEST); 928 packet_start(SSH2_MSG_USERAUTH_REQUEST);
@@ -665,7 +931,7 @@ send_pubkey_test(Authctxt *authctxt, Key *k, sign_cb_fn *sign_callback,
665 packet_put_cstring(authctxt->method->name); 931 packet_put_cstring(authctxt->method->name);
666 packet_put_char(have_sig); 932 packet_put_char(have_sig);
667 if (!(datafellows & SSH_BUG_PKAUTH)) 933 if (!(datafellows & SSH_BUG_PKAUTH))
668 packet_put_cstring(key_ssh_name(k)); 934 packet_put_cstring(key_ssh_name(id->key));
669 packet_put_string(blob, bloblen); 935 packet_put_string(blob, bloblen);
670 xfree(blob); 936 xfree(blob);
671 packet_send(); 937 packet_send();
@@ -710,103 +976,134 @@ load_identity_file(char *filename)
710 return private; 976 return private;
711} 977}
712 978
713static int 979/*
714identity_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, u_int *lenp, 980 * try keys in the following order:
715 u_char *data, u_int datalen) 981 * 1. agent keys that are found in the config file
716{ 982 * 2. other agent keys
717 Key *private; 983 * 3. keys that are only listed in the config file
718 int idx, ret; 984 */
719 985static void
720 idx = authctxt->last_key_hint; 986pubkey_prepare(Authctxt *authctxt)
721 if (idx < 0)
722 return -1;
723
724 /* private key is stored in external hardware */
725 if (options.identity_keys[idx]->flags & KEY_FLAG_EXT)
726 return key_sign(options.identity_keys[idx], sigp, lenp, data, datalen);
727
728 private = load_identity_file(options.identity_files[idx]);
729 if (private == NULL)
730 return -1;
731 ret = key_sign(private, sigp, lenp, data, datalen);
732 key_free(private);
733 return ret;
734}
735
736static int
737agent_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, u_int *lenp,
738 u_char *data, u_int datalen)
739{
740 return ssh_agent_sign(authctxt->agent, key, sigp, lenp, data, datalen);
741}
742
743static int
744key_sign_cb(Authctxt *authctxt, Key *key, u_char **sigp, u_int *lenp,
745 u_char *data, u_int datalen)
746{ 987{
747 return key_sign(key, sigp, lenp, data, datalen); 988 Identity *id;
989 Idlist agent, files, *preferred;
990 Key *key;
991 AuthenticationConnection *ac;
992 char *comment;
993 int i, found;
994
995 TAILQ_INIT(&agent); /* keys from the agent */
996 TAILQ_INIT(&files); /* keys from the config file */
997 preferred = &authctxt->keys;
998 TAILQ_INIT(preferred); /* preferred order of keys */
999
1000 /* list of keys stored in the filesystem */
1001 for (i = 0; i < options.num_identity_files; i++) {
1002 key = options.identity_keys[i];
1003 if (key && key->type == KEY_RSA1)
1004 continue;
1005 options.identity_keys[i] = NULL;
1006 id = xmalloc(sizeof(*id));
1007 memset(id, 0, sizeof(*id));
1008 id->key = key;
1009 id->filename = xstrdup(options.identity_files[i]);
1010 TAILQ_INSERT_TAIL(&files, id, next);
1011 }
1012 /* list of keys supported by the agent */
1013 if ((ac = ssh_get_authentication_connection())) {
1014 for (key = ssh_get_first_identity(ac, &comment, 2);
1015 key != NULL;
1016 key = ssh_get_next_identity(ac, &comment, 2)) {
1017 found = 0;
1018 TAILQ_FOREACH(id, &files, next) {
1019 /* agent keys from the config file are preferred */
1020 if (key_equal(key, id->key)) {
1021 key_free(key);
1022 xfree(comment);
1023 TAILQ_REMOVE(&files, id, next);
1024 TAILQ_INSERT_TAIL(preferred, id, next);
1025 id->ac = ac;
1026 found = 1;
1027 break;
1028 }
1029 }
1030 if (!found) {
1031 id = xmalloc(sizeof(*id));
1032 memset(id, 0, sizeof(*id));
1033 id->key = key;
1034 id->filename = comment;
1035 id->ac = ac;
1036 TAILQ_INSERT_TAIL(&agent, id, next);
1037 }
1038 }
1039 /* append remaining agent keys */
1040 for (id = TAILQ_FIRST(&agent); id; id = TAILQ_FIRST(&agent)) {
1041 TAILQ_REMOVE(&agent, id, next);
1042 TAILQ_INSERT_TAIL(preferred, id, next);
1043 }
1044 authctxt->agent = ac;
1045 }
1046 /* append remaining keys from the config file */
1047 for (id = TAILQ_FIRST(&files); id; id = TAILQ_FIRST(&files)) {
1048 TAILQ_REMOVE(&files, id, next);
1049 TAILQ_INSERT_TAIL(preferred, id, next);
1050 }
1051 TAILQ_FOREACH(id, preferred, next) {
1052 debug2("key: %s (%p)", id->filename, id->key);
1053 }
748} 1054}
749 1055
750static int 1056static void
751userauth_pubkey_agent(Authctxt *authctxt) 1057pubkey_cleanup(Authctxt *authctxt)
752{ 1058{
753 static int called = 0; 1059 Identity *id;
754 int ret = 0; 1060
755 char *comment; 1061 if (authctxt->agent != NULL)
756 Key *k; 1062 ssh_close_authentication_connection(authctxt->agent);
757 1063 for (id = TAILQ_FIRST(&authctxt->keys); id;
758 if (called == 0) { 1064 id = TAILQ_FIRST(&authctxt->keys)) {
759 if (ssh_get_num_identities(authctxt->agent, 2) == 0) 1065 TAILQ_REMOVE(&authctxt->keys, id, next);
760 debug2("userauth_pubkey_agent: no keys at all"); 1066 if (id->key)
761 called = 1; 1067 key_free(id->key);
762 } 1068 if (id->filename)
763 k = ssh_get_next_identity(authctxt->agent, &comment, 2); 1069 xfree(id->filename);
764 if (k == NULL) { 1070 xfree(id);
765 debug2("userauth_pubkey_agent: no more keys");
766 } else {
767 debug("Offering agent key: %s", comment);
768 xfree(comment);
769 ret = send_pubkey_test(authctxt, k, agent_sign_cb, -1);
770 if (ret == 0)
771 key_free(k);
772 } 1071 }
773 if (ret == 0)
774 debug2("userauth_pubkey_agent: no message sent");
775 return ret;
776} 1072}
777 1073
778int 1074int
779userauth_pubkey(Authctxt *authctxt) 1075userauth_pubkey(Authctxt *authctxt)
780{ 1076{
781 static int idx = 0; 1077 Identity *id;
782 int sent = 0; 1078 int sent = 0;
783 Key *key;
784 char *filename;
785 1079
786 if (authctxt->agent != NULL) { 1080 while ((id = TAILQ_FIRST(&authctxt->keys))) {
787 do { 1081 if (id->tried++)
788 sent = userauth_pubkey_agent(authctxt); 1082 return (0);
789 } while (!sent && authctxt->agent->howmany > 0); 1083 TAILQ_REMOVE(&authctxt->keys, id, next);
790 } 1084 TAILQ_INSERT_TAIL(&authctxt->keys, id, next);
791 while (!sent && idx < options.num_identity_files) { 1085 /*
792 key = options.identity_keys[idx]; 1086 * send a test message if we have the public key. for
793 filename = options.identity_files[idx]; 1087 * encrypted keys we cannot do this and have to load the
794 if (key == NULL) { 1088 * private key instead
795 debug("Trying private key: %s", filename); 1089 */
796 key = load_identity_file(filename); 1090 if (id->key && id->key->type != KEY_RSA1) {
797 if (key != NULL) { 1091 debug("Offering public key: %s", id->filename);
798 sent = sign_and_send_pubkey(authctxt, key, 1092 sent = send_pubkey_test(authctxt, id);
799 key_sign_cb); 1093 } else if (id->key == NULL) {
800 key_free(key); 1094 debug("Trying private key: %s", id->filename);
1095 id->key = load_identity_file(id->filename);
1096 if (id->key != NULL) {
1097 id->isprivate = 1;
1098 sent = sign_and_send_pubkey(authctxt, id);
1099 key_free(id->key);
1100 id->key = NULL;
801 } 1101 }
802 } else if (key->type != KEY_RSA1) {
803 debug("Offering public key: %s", filename);
804 sent = send_pubkey_test(authctxt, key,
805 identity_sign_cb, idx);
806 } 1102 }
807 idx++; 1103 if (sent)
1104 return (sent);
808 } 1105 }
809 return sent; 1106 return (0);
810} 1107}
811 1108
812/* 1109/*
@@ -862,9 +1159,9 @@ input_userauth_info_req(int type, u_int32_t seq, void *ctxt)
862 inst = packet_get_string(NULL); 1159 inst = packet_get_string(NULL);
863 lang = packet_get_string(NULL); 1160 lang = packet_get_string(NULL);
864 if (strlen(name) > 0) 1161 if (strlen(name) > 0)
865 log("%s", name); 1162 logit("%s", name);
866 if (strlen(inst) > 0) 1163 if (strlen(inst) > 0)
867 log("%s", inst); 1164 logit("%s", inst);
868 xfree(name); 1165 xfree(name);
869 xfree(inst); 1166 xfree(inst);
870 xfree(lang); 1167 xfree(lang);
diff --git a/sshd.0 b/sshd.0
index 7bed03416..937e35906 100644
--- a/sshd.0
+++ b/sshd.0
@@ -42,6 +42,17 @@ DESCRIPTION
42 authentication combined with RSA host authentication, RSA challenge- 42 authentication combined with RSA host authentication, RSA challenge-
43 response authentication, or password based authentication. 43 response authentication, or password based authentication.
44 44
45 Regardless of the authentication type, the account is checked to ensure
46 that it is accessible. An account is not accessible if it is locked,
47 listed in DenyUsers or its group is listed in DenyGroups . The defini-
48 tion of a locked account is system dependant. Some platforms have their
49 own account database (eg AIX) and some modify the passwd field ( M-bM-^@M-^X*LK*M-bM-^@M-^Y
50 on Solaris, M-bM-^@M-^X*M-bM-^@M-^Y on HP-UX, containing M-bM-^@M-^XNologinM-bM-^@M-^Y on Tru64 and a leading
51 M-bM-^@M-^X!!M-bM-^@M-^Y on Linux). If there is a requirement to disable password authenti-
52 cation for the account while allowing still public-key, then the passwd
53 field should be set to something other than these values (eg M-bM-^@M-^XNPM-bM-^@M-^Y or
54 M-bM-^@M-^X*NP*M-bM-^@M-^Y ).
55
45 Rhosts authentication is normally disabled because it is fundamentally 56 Rhosts authentication is normally disabled because it is fundamentally
46 insecure, but can be enabled in the server configuration file if desired. 57 insecure, but can be enabled in the server configuration file if desired.
47 System security is not improved unless rshd, rlogind, and rexecd are dis- 58 System security is not improved unless rshd, rlogind, and rexecd are dis-
@@ -169,10 +180,10 @@ DESCRIPTION
169 the utmp file. -u0 may also be used to prevent sshd from making 180 the utmp file. -u0 may also be used to prevent sshd from making
170 DNS requests unless the authentication mechanism or configuration 181 DNS requests unless the authentication mechanism or configuration
171 requires it. Authentication mechanisms that may require DNS 182 requires it. Authentication mechanisms that may require DNS
172 include RhostsAuthentication, RhostsRSAAuthentication, 183 include RhostsRSAAuthentication, HostbasedAuthentication and
173 HostbasedAuthentication and using a from="pattern-list" option in 184 using a from="pattern-list" option in a key file. Configuration
174 a key file. Configuration options that require DNS include using 185 options that require DNS include using a USER@HOST pattern in
175 a USER@HOST pattern in AllowUsers or DenyUsers. 186 AllowUsers or DenyUsers.
176 187
177 -D When this option is specified sshd will not detach and does not 188 -D When this option is specified sshd will not detach and does not
178 become a daemon. This allows easy monitoring of sshd. 189 become a daemon. This allows easy monitoring of sshd.
@@ -250,9 +261,9 @@ AUTHORIZED_KEYS FILE FORMAT
250 from="pattern-list" 261 from="pattern-list"
251 Specifies that in addition to public key authentication, the 262 Specifies that in addition to public key authentication, the
252 canonical name of the remote host must be present in the comma- 263 canonical name of the remote host must be present in the comma-
253 separated list of patterns (M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? serve as wildcards). 264 separated list of patterns (M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y serve as wildcards). The
254 The list may also contain patterns negated by prefixing them with 265 list may also contain patterns negated by prefixing them with
255 M-bM-^@M-^XM-bM-^@M-^Y!; if the canonical host name matches a negated pattern, the 266 M-bM-^@M-^X!M-bM-^@M-^Y; if the canonical host name matches a negated pattern, the
256 key is not accepted. The purpose of this option is to optionally 267 key is not accepted. The purpose of this option is to optionally
257 increase security: public key authentication by itself does not 268 increase security: public key authentication by itself does not
258 trust the network or name servers or anything (but the key); how- 269 trust the network or name servers or anything (but the key); how-
@@ -304,7 +315,7 @@ AUTHORIZED_KEYS FILE FORMAT
304 Limit local M-bM-^@M-^XM-bM-^@M-^Xssh -LM-bM-^@M-^YM-bM-^@M-^Y port forwarding such that it may only con- 315 Limit local M-bM-^@M-^XM-bM-^@M-^Xssh -LM-bM-^@M-^YM-bM-^@M-^Y port forwarding such that it may only con-
305 nect to the specified host and port. IPv6 addresses can be spec- 316 nect to the specified host and port. IPv6 addresses can be spec-
306 ified with an alternative syntax: host/port. Multiple permitopen 317 ified with an alternative syntax: host/port. Multiple permitopen
307 options may be applied separated by commas. No pattern matching 318 options may be applied separated by commas. No pattern matching
308 is performed on the specified hostnames, they must be literal 319 is performed on the specified hostnames, they must be literal
309 domains or addresses. 320 domains or addresses.
310 321
@@ -328,11 +339,11 @@ SSH_KNOWN_HOSTS FILE FORMAT
328 Each line in these files contains the following fields: hostnames, bits, 339 Each line in these files contains the following fields: hostnames, bits,
329 exponent, modulus, comment. The fields are separated by spaces. 340 exponent, modulus, comment. The fields are separated by spaces.
330 341
331 Hostnames is a comma-separated list of patterns (M-bM-^@M-^Y*M-bM-^@M-^Y and M-bM-^@M-^Y?M-bM-^@M-^Y act as wild- 342 Hostnames is a comma-separated list of patterns (M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y act as wild-
332 cards); each pattern in turn is matched against the canonical host name 343 cards); each pattern in turn is matched against the canonical host name
333 (when authenticating a client) or against the user-supplied name (when 344 (when authenticating a client) or against the user-supplied name (when
334 authenticating a server). A pattern may also be preceded by M-bM-^@M-^XM-bM-^@M-^Y! to 345 authenticating a server). A pattern may also be preceded by M-bM-^@M-^X!M-bM-^@M-^Y to indi-
335 indicate negation: if the host name matches a negated pattern, it is not 346 cate negation: if the host name matches a negated pattern, it is not
336 accepted (by that line) even if it matched another pattern on the line. 347 accepted (by that line) even if it matched another pattern on the line.
337 348
338 Bits, exponent, and modulus are taken directly from the RSA host key; 349 Bits, exponent, and modulus are taken directly from the RSA host key;
@@ -520,14 +531,6 @@ FILES
520 login-time initializations globally. This file should be 531 login-time initializations globally. This file should be
521 writable only by root, and should be world-readable. 532 writable only by root, and should be world-readable.
522 533
523AUTHORS
524 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
525 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
526 de Raadt and Dug Song removed many bugs, re-added newer features and cre-
527 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
528 versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support
529 for privilege separation.
530
531SEE ALSO 534SEE ALSO
532 scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1), 535 scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1),
533 login.conf(5), moduli(5), sshd_config(5), sftp-server(8) 536 login.conf(5), moduli(5), sshd_config(5), sftp-server(8)
@@ -540,4 +543,12 @@ SEE ALSO
540 for the SSH Transport Layer Protocol, draft-ietf-secsh-dh-group- 543 for the SSH Transport Layer Protocol, draft-ietf-secsh-dh-group-
541 exchange-02.txt, January 2002, work in progress material. 544 exchange-02.txt, January 2002, work in progress material.
542 545
546AUTHORS
547 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
548 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
549 de Raadt and Dug Song removed many bugs, re-added newer features and cre-
550 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
551 versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support
552 for privilege separation.
553
543BSD September 25, 1999 BSD 554BSD September 25, 1999 BSD
diff --git a/sshd.8 b/sshd.8
index a99c4f162..0eeea6666 100644
--- a/sshd.8
+++ b/sshd.8
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: sshd.8,v 1.194 2003/01/31 21:54:40 jmc Exp $ 37.\" $OpenBSD: sshd.8,v 1.199 2003/08/13 08:46:31 markus Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSHD 8 39.Dt SSHD 8
40.Os 40.Os
@@ -114,6 +114,29 @@ authentication combined with RSA host
114authentication, RSA challenge-response authentication, or password 114authentication, RSA challenge-response authentication, or password
115based authentication. 115based authentication.
116.Pp 116.Pp
117Regardless of the authentication type, the account is checked to
118ensure that it is accessible. An account is not accessible if it is
119locked, listed in
120.Cm DenyUsers
121or its group is listed in
122.Cm DenyGroups
123\&. The definition of a locked account is system dependant. Some platforms
124have their own account database (eg AIX) and some modify the passwd field (
125.Ql \&*LK\&*
126on Solaris,
127.Ql \&*
128on HP-UX, containing
129.Ql Nologin
130on Tru64 and a leading
131.Ql \&!!
132on Linux). If there is a requirement to disable password authentication
133for the account while allowing still public-key, then the passwd field
134should be set to something other than these values (eg
135.Ql NP
136or
137.Ql \&*NP\&*
138).
139.Pp
117Rhosts authentication is normally disabled 140Rhosts authentication is normally disabled
118because it is fundamentally insecure, but can be enabled in the server 141because it is fundamentally insecure, but can be enabled in the server
119configuration file if desired. 142configuration file if desired.
@@ -292,7 +315,6 @@ may also be used to prevent
292from making DNS requests unless the authentication 315from making DNS requests unless the authentication
293mechanism or configuration requires it. 316mechanism or configuration requires it.
294Authentication mechanisms that may require DNS include 317Authentication mechanisms that may require DNS include
295.Cm RhostsAuthentication ,
296.Cm RhostsRSAAuthentication , 318.Cm RhostsRSAAuthentication ,
297.Cm HostbasedAuthentication 319.Cm HostbasedAuthentication
298and using a 320and using a
@@ -429,13 +451,13 @@ that option keywords are case-insensitive):
429Specifies that in addition to public key authentication, the canonical name 451Specifies that in addition to public key authentication, the canonical name
430of the remote host must be present in the comma-separated list of 452of the remote host must be present in the comma-separated list of
431patterns 453patterns
432.Pf ( Ql * 454.Pf ( Ql \&*
433and 455and
434.Ql ? 456.Ql \&?
435serve as wildcards). 457serve as wildcards).
436The list may also contain 458The list may also contain
437patterns negated by prefixing them with 459patterns negated by prefixing them with
438.Ql ! ; 460.Ql \&! ;
439if the canonical host name matches a negated pattern, the key is not accepted. 461if the canonical host name matches a negated pattern, the key is not accepted.
440The purpose 462The purpose
441of this option is to optionally increase security: public key authentication 463of this option is to optionally increase security: public key authentication
@@ -497,9 +519,9 @@ IPv6 addresses can be specified with an alternative syntax:
497.Ar host/port . 519.Ar host/port .
498Multiple 520Multiple
499.Cm permitopen 521.Cm permitopen
500options may be applied separated by commas. No pattern matching is 522options may be applied separated by commas.
501performed on the specified hostnames, they must be literal domains or 523No pattern matching is performed on the specified hostnames,
502addresses. 524they must be literal domains or addresses.
503.El 525.El
504.Ss Examples 526.Ss Examples
5051024 33 12121.\|.\|.\|312314325 ylo@foo.bar 5271024 33 12121.\|.\|.\|312314325 ylo@foo.bar
@@ -524,12 +546,16 @@ Each line in these files contains the following fields: hostnames,
524bits, exponent, modulus, comment. 546bits, exponent, modulus, comment.
525The fields are separated by spaces. 547The fields are separated by spaces.
526.Pp 548.Pp
527Hostnames is a comma-separated list of patterns ('*' and '?' act as 549Hostnames is a comma-separated list of patterns
550.Pf ( Ql \&*
551and
552.Ql \&?
553act as
528wildcards); each pattern in turn is matched against the canonical host 554wildcards); each pattern in turn is matched against the canonical host
529name (when authenticating a client) or against the user-supplied 555name (when authenticating a client) or against the user-supplied
530name (when authenticating a server). 556name (when authenticating a server).
531A pattern may also be preceded by 557A pattern may also be preceded by
532.Ql ! 558.Ql \&!
533to indicate negation: if the host name matches a negated 559to indicate negation: if the host name matches a negated
534pattern, it is not accepted (by that line) even if it matched another 560pattern, it is not accepted (by that line) even if it matched another
535pattern on the line. 561pattern on the line.
@@ -767,17 +793,6 @@ This can be used to specify
767machine-specific login-time initializations globally. 793machine-specific login-time initializations globally.
768This file should be writable only by root, and should be world-readable. 794This file should be writable only by root, and should be world-readable.
769.El 795.El
770.Sh AUTHORS
771OpenSSH is a derivative of the original and free
772ssh 1.2.12 release by Tatu Ylonen.
773Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
774Theo de Raadt and Dug Song
775removed many bugs, re-added newer features and
776created OpenSSH.
777Markus Friedl contributed the support for SSH
778protocol versions 1.5 and 2.0.
779Niels Provos and Markus Friedl contributed support
780for privilege separation.
781.Sh SEE ALSO 796.Sh SEE ALSO
782.Xr scp 1 , 797.Xr scp 1 ,
783.Xr sftp 1 , 798.Xr sftp 1 ,
@@ -809,3 +824,14 @@ for privilege separation.
809.%D January 2002 824.%D January 2002
810.%O work in progress material 825.%O work in progress material
811.Re 826.Re
827.Sh AUTHORS
828OpenSSH is a derivative of the original and free
829ssh 1.2.12 release by Tatu Ylonen.
830Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
831Theo de Raadt and Dug Song
832removed many bugs, re-added newer features and
833created OpenSSH.
834Markus Friedl contributed the support for SSH
835protocol versions 1.5 and 2.0.
836Niels Provos and Markus Friedl contributed support
837for privilege separation.
diff --git a/sshd.c b/sshd.c
index 0f2b2a3ce..47df9caf1 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.263 2003/02/16 17:09:57 markus Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.276 2003/08/28 12:54:34 markus Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -112,11 +112,7 @@ char *config_file_name = _PATH_SERVER_CONFIG_FILE;
112 * Flag indicating whether IPv4 or IPv6. This can be set on the command line. 112 * Flag indicating whether IPv4 or IPv6. This can be set on the command line.
113 * Default value is AF_UNSPEC means both IPv4 and IPv6. 113 * Default value is AF_UNSPEC means both IPv4 and IPv6.
114 */ 114 */
115#ifdef IPV4_DEFAULT
116int IPv4or6 = AF_INET;
117#else
118int IPv4or6 = AF_UNSPEC; 115int IPv4or6 = AF_UNSPEC;
119#endif
120 116
121/* 117/*
122 * Debug mode flag. This can be set on the command line. If debug 118 * Debug mode flag. This can be set on the command line. If debug
@@ -192,7 +188,7 @@ u_char session_id[16];
192 188
193/* same for ssh2 */ 189/* same for ssh2 */
194u_char *session_id2 = NULL; 190u_char *session_id2 = NULL;
195int session_id2_len = 0; 191u_int session_id2_len = 0;
196 192
197/* record remote hostname or ip */ 193/* record remote hostname or ip */
198u_int utmp_len = MAXHOSTNAMELEN; 194u_int utmp_len = MAXHOSTNAMELEN;
@@ -205,6 +201,9 @@ int startup_pipe; /* in child */
205int use_privsep; 201int use_privsep;
206struct monitor *pmonitor; 202struct monitor *pmonitor;
207 203
204/* message to be displayed after login */
205Buffer loginmsg;
206
208/* Prototypes for various functions defined later in this file. */ 207/* Prototypes for various functions defined later in this file. */
209void destroy_sensitive_data(void); 208void destroy_sensitive_data(void);
210void demote_sensitive_data(void); 209void demote_sensitive_data(void);
@@ -258,11 +257,11 @@ sighup_handler(int sig)
258static void 257static void
259sighup_restart(void) 258sighup_restart(void)
260{ 259{
261 log("Received SIGHUP; restarting."); 260 logit("Received SIGHUP; restarting.");
262 close_listen_socks(); 261 close_listen_socks();
263 close_startup_pipes(); 262 close_startup_pipes();
264 execv(saved_argv[0], saved_argv); 263 execv(saved_argv[0], saved_argv);
265 log("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0], 264 logit("RESTART FAILED: av[0]='%.100s', error: %.100s.", saved_argv[0],
266 strerror(errno)); 265 strerror(errno));
267 exit(1); 266 exit(1);
268} 267}
@@ -371,39 +370,37 @@ sshd_exchange_identification(int sock_in, int sock_out)
371 snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION); 370 snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
372 server_version_string = xstrdup(buf); 371 server_version_string = xstrdup(buf);
373 372
374 if (client_version_string == NULL) { 373 /* Send our protocol version identification. */
375 /* Send our protocol version identification. */ 374 if (atomicio(vwrite, sock_out, server_version_string,
376 if (atomicio(write, sock_out, server_version_string, 375 strlen(server_version_string))
377 strlen(server_version_string)) 376 != strlen(server_version_string)) {
378 != strlen(server_version_string)) { 377 logit("Could not write ident string to %s", get_remote_ipaddr());
379 log("Could not write ident string to %s", get_remote_ipaddr()); 378 fatal_cleanup();
379 }
380
381 /* Read other sides version identification. */
382 memset(buf, 0, sizeof(buf));
383 for (i = 0; i < sizeof(buf) - 1; i++) {
384 if (atomicio(read, sock_in, &buf[i], 1) != 1) {
385 logit("Did not receive identification string from %s",
386 get_remote_ipaddr());
380 fatal_cleanup(); 387 fatal_cleanup();
381 } 388 }
382 389 if (buf[i] == '\r') {
383 /* Read other sides version identification. */ 390 buf[i] = 0;
384 memset(buf, 0, sizeof(buf)); 391 /* Kludge for F-Secure Macintosh < 1.0.2 */
385 for (i = 0; i < sizeof(buf) - 1; i++) { 392 if (i == 12 &&
386 if (atomicio(read, sock_in, &buf[i], 1) != 1) { 393 strncmp(buf, "SSH-1.5-W1.0", 12) == 0)
387 log("Did not receive identification string from %s",
388 get_remote_ipaddr());
389 fatal_cleanup();
390 }
391 if (buf[i] == '\r') {
392 buf[i] = 0;
393 /* Kludge for F-Secure Macintosh < 1.0.2 */
394 if (i == 12 &&
395 strncmp(buf, "SSH-1.5-W1.0", 12) == 0)
396 break;
397 continue;
398 }
399 if (buf[i] == '\n') {
400 buf[i] = 0;
401 break; 394 break;
402 } 395 continue;
396 }
397 if (buf[i] == '\n') {
398 buf[i] = 0;
399 break;
403 } 400 }
404 buf[sizeof(buf) - 1] = 0;
405 client_version_string = xstrdup(buf);
406 } 401 }
402 buf[sizeof(buf) - 1] = 0;
403 client_version_string = xstrdup(buf);
407 404
408 /* 405 /*
409 * Check that the versions match. In future this might accept 406 * Check that the versions match. In future this might accept
@@ -412,10 +409,10 @@ sshd_exchange_identification(int sock_in, int sock_out)
412 if (sscanf(client_version_string, "SSH-%d.%d-%[^\n]\n", 409 if (sscanf(client_version_string, "SSH-%d.%d-%[^\n]\n",
413 &remote_major, &remote_minor, remote_version) != 3) { 410 &remote_major, &remote_minor, remote_version) != 3) {
414 s = "Protocol mismatch.\n"; 411 s = "Protocol mismatch.\n";
415 (void) atomicio(write, sock_out, s, strlen(s)); 412 (void) atomicio(vwrite, sock_out, s, strlen(s));
416 close(sock_in); 413 close(sock_in);
417 close(sock_out); 414 close(sock_out);
418 log("Bad protocol version identification '%.100s' from %s", 415 logit("Bad protocol version identification '%.100s' from %s",
419 client_version_string, get_remote_ipaddr()); 416 client_version_string, get_remote_ipaddr());
420 fatal_cleanup(); 417 fatal_cleanup();
421 } 418 }
@@ -425,13 +422,13 @@ sshd_exchange_identification(int sock_in, int sock_out)
425 compat_datafellows(remote_version); 422 compat_datafellows(remote_version);
426 423
427 if (datafellows & SSH_BUG_PROBE) { 424 if (datafellows & SSH_BUG_PROBE) {
428 log("probed from %s with %s. Don't panic.", 425 logit("probed from %s with %s. Don't panic.",
429 get_remote_ipaddr(), client_version_string); 426 get_remote_ipaddr(), client_version_string);
430 fatal_cleanup(); 427 fatal_cleanup();
431 } 428 }
432 429
433 if (datafellows & SSH_BUG_SCANNER) { 430 if (datafellows & SSH_BUG_SCANNER) {
434 log("scanned from %s with %s. Don't panic.", 431 logit("scanned from %s with %s. Don't panic.",
435 get_remote_ipaddr(), client_version_string); 432 get_remote_ipaddr(), client_version_string);
436 fatal_cleanup(); 433 fatal_cleanup();
437 } 434 }
@@ -473,10 +470,10 @@ sshd_exchange_identification(int sock_in, int sock_out)
473 470
474 if (mismatch) { 471 if (mismatch) {
475 s = "Protocol major versions differ.\n"; 472 s = "Protocol major versions differ.\n";
476 (void) atomicio(write, sock_out, s, strlen(s)); 473 (void) atomicio(vwrite, sock_out, s, strlen(s));
477 close(sock_in); 474 close(sock_in);
478 close(sock_out); 475 close(sock_out);
479 log("Protocol major versions differ for %s: %.200s vs. %.200s", 476 logit("Protocol major versions differ for %s: %.200s vs. %.200s",
480 get_remote_ipaddr(), 477 get_remote_ipaddr(),
481 server_version_string, client_version_string); 478 server_version_string, client_version_string);
482 fatal_cleanup(); 479 fatal_cleanup();
@@ -568,8 +565,6 @@ privsep_preauth_child(void)
568 do_setusercontext(pw); 565 do_setusercontext(pw);
569#else 566#else
570 gidset[0] = pw->pw_gid; 567 gidset[0] = pw->pw_gid;
571 if (setgid(pw->pw_gid) < 0)
572 fatal("setgid failed for %u", pw->pw_gid );
573 if (setgroups(1, gidset) < 0) 568 if (setgroups(1, gidset) < 0)
574 fatal("setgroups: %.100s", strerror(errno)); 569 fatal("setgroups: %.100s", strerror(errno));
575 permanently_set_uid(pw); 570 permanently_set_uid(pw);
@@ -824,26 +819,27 @@ main(int ac, char **av)
824#ifdef HAVE_SECUREWARE 819#ifdef HAVE_SECUREWARE
825 (void)set_auth_parameters(ac, av); 820 (void)set_auth_parameters(ac, av);
826#endif 821#endif
827 __progname = get_progname(av[0]); 822 __progname = ssh_get_progname(av[0]);
828 init_rng(); 823 init_rng();
829 824
830 /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ 825 /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */
831 saved_argc = ac; 826 saved_argc = ac;
832 saved_argv = av; 827 saved_argv = xmalloc(sizeof(*saved_argv) * (ac + 1));
833 saved_argv = xmalloc(sizeof(*saved_argv) * ac);
834 for (i = 0; i < ac; i++) 828 for (i = 0; i < ac; i++)
835 saved_argv[i] = xstrdup(av[i]); 829 saved_argv[i] = xstrdup(av[i]);
830 saved_argv[i] = NULL;
836 831
837#ifndef HAVE_SETPROCTITLE 832#ifndef HAVE_SETPROCTITLE
838 /* Prepare for later setproctitle emulation */ 833 /* Prepare for later setproctitle emulation */
839 compat_init_setproctitle(ac, av); 834 compat_init_setproctitle(ac, av);
835 av = saved_argv;
840#endif 836#endif
841 837
842 /* Initialize configuration options to their default values. */ 838 /* Initialize configuration options to their default values. */
843 initialize_server_options(&options); 839 initialize_server_options(&options);
844 840
845 /* Parse command-line arguments. */ 841 /* Parse command-line arguments. */
846 while ((opt = getopt(ac, av, "f:p:b:k:h:g:V:u:o:dDeiqtQ46")) != -1) { 842 while ((opt = getopt(ac, av, "f:p:b:k:h:g:u:o:dDeiqtQ46")) != -1) {
847 switch (opt) { 843 switch (opt) {
848 case '4': 844 case '4':
849 IPv4or6 = AF_INET; 845 IPv4or6 = AF_INET;
@@ -855,15 +851,11 @@ main(int ac, char **av)
855 config_file_name = optarg; 851 config_file_name = optarg;
856 break; 852 break;
857 case 'd': 853 case 'd':
858 if (0 == debug_flag) { 854 if (debug_flag == 0) {
859 debug_flag = 1; 855 debug_flag = 1;
860 options.log_level = SYSLOG_LEVEL_DEBUG1; 856 options.log_level = SYSLOG_LEVEL_DEBUG1;
861 } else if (options.log_level < SYSLOG_LEVEL_DEBUG3) { 857 } else if (options.log_level < SYSLOG_LEVEL_DEBUG3)
862 options.log_level++; 858 options.log_level++;
863 } else {
864 fprintf(stderr, "Too high debugging level.\n");
865 exit(1);
866 }
867 break; 859 break;
868 case 'D': 860 case 'D':
869 no_daemon_flag = 1; 861 no_daemon_flag = 1;
@@ -914,11 +906,6 @@ main(int ac, char **av)
914 } 906 }
915 options.host_key_files[options.num_host_key_files++] = optarg; 907 options.host_key_files[options.num_host_key_files++] = optarg;
916 break; 908 break;
917 case 'V':
918 client_version_string = optarg;
919 /* only makes sense with inetd_flag, i.e. no listen() */
920 inetd_flag = 1;
921 break;
922 case 't': 909 case 't':
923 test_flag = 1; 910 test_flag = 1;
924 break; 911 break;
@@ -1010,15 +997,15 @@ main(int ac, char **av)
1010 key_type(key)); 997 key_type(key));
1011 } 998 }
1012 if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) { 999 if ((options.protocol & SSH_PROTO_1) && !sensitive_data.have_ssh1_key) {
1013 log("Disabling protocol version 1. Could not load host key"); 1000 logit("Disabling protocol version 1. Could not load host key");
1014 options.protocol &= ~SSH_PROTO_1; 1001 options.protocol &= ~SSH_PROTO_1;
1015 } 1002 }
1016 if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) { 1003 if ((options.protocol & SSH_PROTO_2) && !sensitive_data.have_ssh2_key) {
1017 log("Disabling protocol version 2. Could not load host key"); 1004 logit("Disabling protocol version 2. Could not load host key");
1018 options.protocol &= ~SSH_PROTO_2; 1005 options.protocol &= ~SSH_PROTO_2;
1019 } 1006 }
1020 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) { 1007 if (!(options.protocol & (SSH_PROTO_1|SSH_PROTO_2))) {
1021 log("sshd: no hostkeys available -- exiting."); 1008 logit("sshd: no hostkeys available -- exiting.");
1022 exit(1); 1009 exit(1);
1023 } 1010 }
1024 1011
@@ -1153,7 +1140,8 @@ main(int ac, char **av)
1153 continue; 1140 continue;
1154 } 1141 }
1155 /* Create socket for listening. */ 1142 /* Create socket for listening. */
1156 listen_sock = socket(ai->ai_family, SOCK_STREAM, 0); 1143 listen_sock = socket(ai->ai_family, ai->ai_socktype,
1144 ai->ai_protocol);
1157 if (listen_sock < 0) { 1145 if (listen_sock < 0) {
1158 /* kernel may not support ipv6 */ 1146 /* kernel may not support ipv6 */
1159 verbose("socket: %.100s", strerror(errno)); 1147 verbose("socket: %.100s", strerror(errno));
@@ -1186,7 +1174,7 @@ main(int ac, char **av)
1186 num_listen_socks++; 1174 num_listen_socks++;
1187 1175
1188 /* Start listening on the port. */ 1176 /* Start listening on the port. */
1189 log("Server listening on %s port %s.", ntop, strport); 1177 logit("Server listening on %s port %s.", ntop, strport);
1190 if (listen(listen_sock, 5) < 0) 1178 if (listen(listen_sock, 5) < 0)
1191 fatal("listen: %.100s", strerror(errno)); 1179 fatal("listen: %.100s", strerror(errno));
1192 1180
@@ -1221,7 +1209,10 @@ main(int ac, char **av)
1221 * overwrite any old pid in the file. 1209 * overwrite any old pid in the file.
1222 */ 1210 */
1223 f = fopen(options.pid_file, "wb"); 1211 f = fopen(options.pid_file, "wb");
1224 if (f) { 1212 if (f == NULL) {
1213 error("Couldn't create pid file \"%s\": %s",
1214 options.pid_file, strerror(errno));
1215 } else {
1225 fprintf(f, "%ld\n", (long) getpid()); 1216 fprintf(f, "%ld\n", (long) getpid());
1226 fclose(f); 1217 fclose(f);
1227 } 1218 }
@@ -1262,7 +1253,7 @@ main(int ac, char **av)
1262 if (ret < 0 && errno != EINTR) 1253 if (ret < 0 && errno != EINTR)
1263 error("select: %.100s", strerror(errno)); 1254 error("select: %.100s", strerror(errno));
1264 if (received_sigterm) { 1255 if (received_sigterm) {
1265 log("Received signal %d; terminating.", 1256 logit("Received signal %d; terminating.",
1266 (int) received_sigterm); 1257 (int) received_sigterm);
1267 close_listen_socks(); 1258 close_listen_socks();
1268 unlink(options.pid_file); 1259 unlink(options.pid_file);
@@ -1400,11 +1391,11 @@ main(int ac, char **av)
1400 * setlogin() affects the entire process group. We don't 1391 * setlogin() affects the entire process group. We don't
1401 * want the child to be able to affect the parent. 1392 * want the child to be able to affect the parent.
1402 */ 1393 */
1403#if !defined(STREAMS_PUSH_ACQUIRES_CTTY) 1394#if !defined(SSHD_ACQUIRES_CTTY)
1404 /* 1395 /*
1405 * If setsid is called on Solaris, sshd will acquire the controlling 1396 * If setsid is called, on some platforms sshd will later acquire a
1406 * terminal while pushing STREAMS modules. This will prevent the 1397 * controlling terminal which will result in "could not set
1407 * shell from acquiring it later. 1398 * controlling tty" errors.
1408 */ 1399 */
1409 if (!debug_flag && !inetd_flag && setsid() < 0) 1400 if (!debug_flag && !inetd_flag && setsid() < 0)
1410 error("setsid: %.100s", strerror(errno)); 1401 error("setsid: %.100s", strerror(errno));
@@ -1471,37 +1462,12 @@ main(int ac, char **av)
1471 alarm(options.login_grace_time); 1462 alarm(options.login_grace_time);
1472 1463
1473 sshd_exchange_identification(sock_in, sock_out); 1464 sshd_exchange_identification(sock_in, sock_out);
1474 /*
1475 * Check that the connection comes from a privileged port.
1476 * Rhosts-Authentication only makes sense from privileged
1477 * programs. Of course, if the intruder has root access on his local
1478 * machine, he can connect from any port. So do not use these
1479 * authentication methods from machines that you do not trust.
1480 */
1481 if (options.rhosts_authentication &&
1482 (remote_port >= IPPORT_RESERVED ||
1483 remote_port < IPPORT_RESERVED / 2)) {
1484 debug("Rhosts Authentication disabled, "
1485 "originating port %d not trusted.", remote_port);
1486 options.rhosts_authentication = 0;
1487 }
1488#if defined(KRB4) && !defined(KRB5)
1489 if (!packet_connection_is_ipv4() &&
1490 options.kerberos_authentication) {
1491 debug("Kerberos Authentication disabled, only available for IPv4.");
1492 options.kerberos_authentication = 0;
1493 }
1494#endif /* KRB4 && !KRB5 */
1495#ifdef AFS
1496 /* If machine has AFS, set process authentication group. */
1497 if (k_hasafs()) {
1498 k_setpag();
1499 k_unlog();
1500 }
1501#endif /* AFS */
1502 1465
1503 packet_set_nonblocking(); 1466 packet_set_nonblocking();
1504 1467
1468 /* prepare buffers to collect authentication messages */
1469 buffer_init(&loginmsg);
1470
1505 if (use_privsep) 1471 if (use_privsep)
1506 if ((authctxt = privsep_preauth()) != NULL) 1472 if ((authctxt = privsep_preauth()) != NULL)
1507 goto authenticated; 1473 goto authenticated;
@@ -1543,7 +1509,8 @@ main(int ac, char **av)
1543 verbose("Closing connection to %.100s", remote_ip); 1509 verbose("Closing connection to %.100s", remote_ip);
1544 1510
1545#ifdef USE_PAM 1511#ifdef USE_PAM
1546 finish_pam(); 1512 if (options.use_pam)
1513 finish_pam();
1547#endif /* USE_PAM */ 1514#endif /* USE_PAM */
1548 1515
1549 packet_close(); 1516 packet_close();
@@ -1655,24 +1622,10 @@ do_ssh1_kex(void)
1655 1622
1656 /* Declare supported authentication types. */ 1623 /* Declare supported authentication types. */
1657 auth_mask = 0; 1624 auth_mask = 0;
1658 if (options.rhosts_authentication)
1659 auth_mask |= 1 << SSH_AUTH_RHOSTS;
1660 if (options.rhosts_rsa_authentication) 1625 if (options.rhosts_rsa_authentication)
1661 auth_mask |= 1 << SSH_AUTH_RHOSTS_RSA; 1626 auth_mask |= 1 << SSH_AUTH_RHOSTS_RSA;
1662 if (options.rsa_authentication) 1627 if (options.rsa_authentication)
1663 auth_mask |= 1 << SSH_AUTH_RSA; 1628 auth_mask |= 1 << SSH_AUTH_RSA;
1664#if defined(KRB4) || defined(KRB5)
1665 if (options.kerberos_authentication)
1666 auth_mask |= 1 << SSH_AUTH_KERBEROS;
1667#endif
1668#if defined(AFS) || defined(KRB5)
1669 if (options.kerberos_tgt_passing)
1670 auth_mask |= 1 << SSH_PASS_KERBEROS_TGT;
1671#endif
1672#ifdef AFS
1673 if (options.afs_token_passing)
1674 auth_mask |= 1 << SSH_PASS_AFS_TOKEN;
1675#endif
1676 if (options.challenge_response_authentication == 1) 1629 if (options.challenge_response_authentication == 1)
1677 auth_mask |= 1 << SSH_AUTH_TIS; 1630 auth_mask |= 1 << SSH_AUTH_TIS;
1678 if (options.password_authentication) 1631 if (options.password_authentication)
@@ -1750,7 +1703,7 @@ do_ssh1_kex(void)
1750 u_char *buf = xmalloc(bytes); 1703 u_char *buf = xmalloc(bytes);
1751 MD5_CTX md; 1704 MD5_CTX md;
1752 1705
1753 log("do_connection: generating a fake encryption key"); 1706 logit("do_connection: generating a fake encryption key");
1754 BN_bn2bin(session_key_int, buf); 1707 BN_bn2bin(session_key_int, buf);
1755 MD5_Init(&md); 1708 MD5_Init(&md);
1756 MD5_Update(&md, buf, bytes); 1709 MD5_Update(&md, buf, bytes);
diff --git a/sshd_config b/sshd_config
index 36429c9d0..dd53f1057 100644
--- a/sshd_config
+++ b/sshd_config
@@ -1,4 +1,4 @@
1# $OpenBSD: sshd_config,v 1.59 2002/09/25 11:17:16 markus Exp $ 1# $OpenBSD: sshd_config,v 1.65 2003/08/28 12:54:34 markus Exp $
2 2
3# This is the sshd server system-wide configuration file. See 3# This is the sshd server system-wide configuration file. See
4# sshd_config(5) for more information. 4# sshd_config(5) for more information.
@@ -22,7 +22,7 @@
22#HostKey /etc/ssh/ssh_host_dsa_key 22#HostKey /etc/ssh/ssh_host_dsa_key
23 23
24# Lifetime and size of ephemeral version 1 server key 24# Lifetime and size of ephemeral version 1 server key
25#KeyRegenerationInterval 3600 25#KeyRegenerationInterval 1h
26#ServerKeyBits 768 26#ServerKeyBits 768
27 27
28# Logging 28# Logging
@@ -32,7 +32,7 @@
32 32
33# Authentication: 33# Authentication:
34 34
35#LoginGraceTime 120 35#LoginGraceTime 2m
36#PermitRootLogin yes 36#PermitRootLogin yes
37#StrictModes yes 37#StrictModes yes
38 38
@@ -40,10 +40,6 @@
40#PubkeyAuthentication yes 40#PubkeyAuthentication yes
41#AuthorizedKeysFile .ssh/authorized_keys 41#AuthorizedKeysFile .ssh/authorized_keys
42 42
43# rhosts authentication should not be used
44#RhostsAuthentication no
45# Don't read the user's ~/.rhosts and ~/.shosts files
46#IgnoreRhosts yes
47# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts 43# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
48#RhostsRSAAuthentication no 44#RhostsRSAAuthentication no
49# similar for protocol version 2 45# similar for protocol version 2
@@ -51,6 +47,8 @@
51# Change to yes if you don't trust ~/.ssh/known_hosts for 47# Change to yes if you don't trust ~/.ssh/known_hosts for
52# RhostsRSAAuthentication and HostbasedAuthentication 48# RhostsRSAAuthentication and HostbasedAuthentication
53#IgnoreUserKnownHosts no 49#IgnoreUserKnownHosts no
50# Don't read the user's ~/.rhosts and ~/.shosts files
51#IgnoreRhosts yes
54 52
55# To disable tunneled clear text passwords, change to no here! 53# To disable tunneled clear text passwords, change to no here!
56#PasswordAuthentication yes 54#PasswordAuthentication yes
@@ -64,15 +62,17 @@
64#KerberosOrLocalPasswd yes 62#KerberosOrLocalPasswd yes
65#KerberosTicketCleanup yes 63#KerberosTicketCleanup yes
66 64
67#AFSTokenPassing no 65# GSSAPI options
66#GSSAPIAuthentication no
67#GSSAPICleanupCreds yes
68 68
69# Kerberos TGT Passing only works with the AFS kaserver 69# Set this to 'yes' to enable PAM authentication (via challenge-response)
70#KerberosTgtPassing no 70# and session processing. Depending on your PAM configuration, this may
71 71# bypass the setting of 'PasswordAuthentication'
72# Set this to 'yes' to enable PAM keyboard-interactive authentication 72#UsePAM yes
73# Warning: enabling this may bypass the setting of 'PasswordAuthentication'
74#PAMAuthenticationViaKbdInt no
75 73
74#AllowTcpForwarding yes
75#GatewayPorts no
76#X11Forwarding no 76#X11Forwarding no
77#X11DisplayOffset 10 77#X11DisplayOffset 10
78#X11UseLocalhost yes 78#X11UseLocalhost yes
@@ -83,11 +83,14 @@
83#UsePrivilegeSeparation yes 83#UsePrivilegeSeparation yes
84#PermitUserEnvironment no 84#PermitUserEnvironment no
85#Compression yes 85#Compression yes
86 86#ClientAliveInterval 0
87#ClientAliveCountMax 3
88#UseDNS yes
89#PidFile /var/run/sshd.pid
87#MaxStartups 10 90#MaxStartups 10
91
88# no default banner path 92# no default banner path
89#Banner /some/path 93#Banner /some/path
90#VerifyReverseMapping no
91 94
92# override default of no subsystems 95# override default of no subsystems
93Subsystem sftp /usr/libexec/sftp-server 96Subsystem sftp /usr/libexec/sftp-server
diff --git a/sshd_config.0 b/sshd_config.0
index 7800de312..bc266317f 100644
--- a/sshd_config.0
+++ b/sshd_config.0
@@ -15,15 +15,11 @@ DESCRIPTION
15 The possible keywords and their meanings are as follows (note that key- 15 The possible keywords and their meanings are as follows (note that key-
16 words are case-insensitive and arguments are case-sensitive): 16 words are case-insensitive and arguments are case-sensitive):
17 17
18 AFSTokenPassing
19 Specifies whether an AFS token may be forwarded to the server.
20 Default is M-bM-^@M-^\noM-bM-^@M-^].
21
22 AllowGroups 18 AllowGroups
23 This keyword can be followed by a list of group name patterns, 19 This keyword can be followed by a list of group name patterns,
24 separated by spaces. If specified, login is allowed only for 20 separated by spaces. If specified, login is allowed only for
25 users whose primary group or supplementary group list matches one 21 users whose primary group or supplementary group list matches one
26 of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? can be used as wildcards in the 22 of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y can be used as wildcards in the
27 patterns. Only group names are valid; a numerical group ID is 23 patterns. Only group names are valid; a numerical group ID is
28 not recognized. By default, login is allowed for all groups. 24 not recognized. By default, login is allowed for all groups.
29 25
@@ -36,7 +32,7 @@ DESCRIPTION
36 AllowUsers 32 AllowUsers
37 This keyword can be followed by a list of user name patterns, 33 This keyword can be followed by a list of user name patterns,
38 separated by spaces. If specified, login is allowed only for 34 separated by spaces. If specified, login is allowed only for
39 user names that match one of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? can be 35 user names that match one of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y can be
40 used as wildcards in the patterns. Only user names are valid; a 36 used as wildcards in the patterns. Only user names are valid; a
41 numerical user ID is not recognized. By default, login is 37 numerical user ID is not recognized. By default, login is
42 allowed for all users. If the pattern takes the form USER@HOST 38 allowed for all users. If the pattern takes the form USER@HOST
@@ -70,7 +66,7 @@ DESCRIPTION
70 ciphers must be comma-separated. The default is 66 ciphers must be comma-separated. The default is
71 67
72 M-bM-^@M-^XM-bM-^@M-^Xaes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, 68 M-bM-^@M-^XM-bM-^@M-^Xaes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
73 aes192-cbc,aes256-cbcM-bM-^@M-^YM-bM-^@M-^Y 69 aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctrM-bM-^@M-^YM-bM-^@M-^Y
74 70
75 ClientAliveInterval 71 ClientAliveInterval
76 Sets a timeout interval in seconds after which if no data has 72 Sets a timeout interval in seconds after which if no data has
@@ -81,18 +77,18 @@ DESCRIPTION
81 77
82 ClientAliveCountMax 78 ClientAliveCountMax
83 Sets the number of client alive messages (see above) which may be 79 Sets the number of client alive messages (see above) which may be
84 sent without sshd receiving any messages back from the client. If 80 sent without sshd receiving any messages back from the client.
85 this threshold is reached while client alive messages are being 81 If this threshold is reached while client alive messages are
86 sent, sshd will disconnect the client, terminating the session. 82 being sent, sshd will disconnect the client, terminating the ses-
87 It is important to note that the use of client alive messages is 83 sion. It is important to note that the use of client alive mes-
88 very different from KeepAlive (below). The client alive messages 84 sages is very different from KeepAlive (below). The client alive
89 are sent through the encrypted channel and therefore will not be 85 messages are sent through the encrypted channel and therefore
90 spoofable. The TCP keepalive option enabled by KeepAlive is 86 will not be spoofable. The TCP keepalive option enabled by
91 spoofable. The client alive mechanism is valuable when the client 87 KeepAlive is spoofable. The client alive mechanism is valuable
92 or server depend on knowing when a connection has become inac- 88 when the client or server depend on knowing when a connection has
93 tive. 89 become inactive.
94 90
95 The default value is 3. If ClientAliveInterval (above) is set to 91 The default value is 3. If ClientAliveInterval (above) is set to
96 15, and ClientAliveCountMax is left at the default, unresponsive 92 15, and ClientAliveCountMax is left at the default, unresponsive
97 ssh clients will be disconnected after approximately 45 seconds. 93 ssh clients will be disconnected after approximately 45 seconds.
98 94
@@ -104,14 +100,14 @@ DESCRIPTION
104 This keyword can be followed by a list of group name patterns, 100 This keyword can be followed by a list of group name patterns,
105 separated by spaces. Login is disallowed for users whose primary 101 separated by spaces. Login is disallowed for users whose primary
106 group or supplementary group list matches one of the patterns. 102 group or supplementary group list matches one of the patterns.
107 M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? can be used as wildcards in the patterns. Only 103 M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y can be used as wildcards in the patterns. Only group
108 group names are valid; a numerical group ID is not recognized. 104 names are valid; a numerical group ID is not recognized. By
109 By default, login is allowed for all groups. 105 default, login is allowed for all groups.
110 106
111 DenyUsers 107 DenyUsers
112 This keyword can be followed by a list of user name patterns, 108 This keyword can be followed by a list of user name patterns,
113 separated by spaces. Login is disallowed for user names that 109 separated by spaces. Login is disallowed for user names that
114 match one of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^XM-bM-^@M-^Y? can be used as wildcards 110 match one of the patterns. M-bM-^@M-^X*M-bM-^@M-^Y and M-bM-^@M-^X?M-bM-^@M-^Y can be used as wildcards
115 in the patterns. Only user names are valid; a numerical user ID 111 in the patterns. Only user names are valid; a numerical user ID
116 is not recognized. By default, login is allowed for all users. 112 is not recognized. By default, login is allowed for all users.
117 If the pattern takes the form USER@HOST then USER and HOST are 113 If the pattern takes the form USER@HOST then USER and HOST are
@@ -128,6 +124,16 @@ DESCRIPTION
128 forwarded ports. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The 124 forwarded ports. The argument must be M-bM-^@M-^\yesM-bM-^@M-^] or M-bM-^@M-^\noM-bM-^@M-^]. The
129 default is M-bM-^@M-^\noM-bM-^@M-^]. 125 default is M-bM-^@M-^\noM-bM-^@M-^].
130 126
127 GSSAPIAuthentication
128 Specifies whether user authentication based on GSSAPI is allowed.
129 The default is M-bM-^@M-^\noM-bM-^@M-^]. Note that this option applies to protocol
130 version 2 only.
131
132 GSSAPICleanupCredentials
133 Specifies whether to automatically destroy the userM-bM-^@M-^Ys credentials
134 cache on logout. The default is M-bM-^@M-^\yesM-bM-^@M-^]. Note that this option
135 applies to protocol version 2 only.
136
131 HostbasedAuthentication 137 HostbasedAuthentication
132 Specifies whether rhosts or /etc/hosts.equiv authentication 138 Specifies whether rhosts or /etc/hosts.equiv authentication
133 together with successful public key client host authentication is 139 together with successful public key client host authentication is
@@ -146,8 +152,7 @@ DESCRIPTION
146 152
147 IgnoreRhosts 153 IgnoreRhosts
148 Specifies that .rhosts and .shosts files will not be used in 154 Specifies that .rhosts and .shosts files will not be used in
149 RhostsAuthentication, RhostsRSAAuthentication or 155 RhostsRSAAuthentication or HostbasedAuthentication.
150 HostbasedAuthentication.
151 156
152 /etc/hosts.equiv and /etc/shosts.equiv are still used. The 157 /etc/hosts.equiv and /etc/shosts.equiv are still used. The
153 default is M-bM-^@M-^\yesM-bM-^@M-^]. 158 default is M-bM-^@M-^\yesM-bM-^@M-^].
@@ -173,23 +178,17 @@ DESCRIPTION
173 To disable keepalives, the value should be set to M-bM-^@M-^\noM-bM-^@M-^]. 178 To disable keepalives, the value should be set to M-bM-^@M-^\noM-bM-^@M-^].
174 179
175 KerberosAuthentication 180 KerberosAuthentication
176 Specifies whether Kerberos authentication is allowed. This can 181 Specifies whether the password provided by the user for
177 be in the form of a Kerberos ticket, or if PasswordAuthentication 182 PasswordAuthentication will be validated through the Kerberos
178 is yes, the password provided by the user will be validated 183 KDC. To use this option, the server needs a Kerberos servtab
179 through the Kerberos KDC. To use this option, the server needs a 184 which allows the verification of the KDCM-bM-^@M-^Ys identity. Default is
180 Kerberos servtab which allows the verification of the KDCM-bM-^@M-^Ys iden- 185 M-bM-^@M-^\noM-bM-^@M-^].
181 tity. Default is M-bM-^@M-^\noM-bM-^@M-^].
182 186
183 KerberosOrLocalPasswd 187 KerberosOrLocalPasswd
184 If set then if password authentication through Kerberos fails 188 If set then if password authentication through Kerberos fails
185 then the password will be validated via any additional local 189 then the password will be validated via any additional local
186 mechanism such as /etc/passwd. Default is M-bM-^@M-^\yesM-bM-^@M-^]. 190 mechanism such as /etc/passwd. Default is M-bM-^@M-^\yesM-bM-^@M-^].
187 191
188 KerberosTgtPassing
189 Specifies whether a Kerberos TGT may be forwarded to the server.
190 Default is M-bM-^@M-^\noM-bM-^@M-^], as this only works when the Kerberos KDC is
191 actually an AFS kaserver.
192
193 KerberosTicketCleanup 192 KerberosTicketCleanup
194 Specifies whether to automatically destroy the userM-bM-^@M-^Ys ticket 193 Specifies whether to automatically destroy the userM-bM-^@M-^Ys ticket
195 cache file on logout. Default is M-bM-^@M-^\yesM-bM-^@M-^]. 194 cache file on logout. Default is M-bM-^@M-^\yesM-bM-^@M-^].
@@ -211,7 +210,7 @@ DESCRIPTION
211 ListenAddress [host|IPv6_addr]:port 210 ListenAddress [host|IPv6_addr]:port
212 211
213 If port is not specified, sshd will listen on the address and all 212 If port is not specified, sshd will listen on the address and all
214 prior Port options specified. The default is to listen on all 213 prior Port options specified. The default is to listen on all
215 local addresses. Multiple ListenAddress options are permitted. 214 local addresses. Multiple ListenAddress options are permitted.
216 Additionally, any Port options must precede this option for non 215 Additionally, any Port options must precede this option for non
217 port qualified addresses. 216 port qualified addresses.
@@ -249,12 +248,6 @@ DESCRIPTION
249 and all connection attempts are refused if the number of unau- 248 and all connection attempts are refused if the number of unau-
250 thenticated connections reaches M-bM-^@M-^\fullM-bM-^@M-^] (60). 249 thenticated connections reaches M-bM-^@M-^\fullM-bM-^@M-^] (60).
251 250
252 PAMAuthenticationViaKbdInt
253 Specifies whether PAM challenge response authentication is
254 allowed. This allows the use of most PAM challenge response
255 authentication modules, but it will allow password authentication
256 regardless of whether PasswordAuthentication is enabled.
257
258 PasswordAuthentication 251 PasswordAuthentication
259 Specifies whether password authentication is allowed. The 252 Specifies whether password authentication is allowed. The
260 default is M-bM-^@M-^\yesM-bM-^@M-^]. 253 default is M-bM-^@M-^\yesM-bM-^@M-^].
@@ -275,7 +268,7 @@ DESCRIPTION
275 If this option is set to M-bM-^@M-^\forced-commands-onlyM-bM-^@M-^] root login with 268 If this option is set to M-bM-^@M-^\forced-commands-onlyM-bM-^@M-^] root login with
276 public key authentication will be allowed, but only if the 269 public key authentication will be allowed, but only if the
277 command option has been specified (which may be useful for taking 270 command option has been specified (which may be useful for taking
278 remote backups even if root login is normally not allowed). All 271 remote backups even if root login is normally not allowed). All
279 other authentication methods are disabled for root. 272 other authentication methods are disabled for root.
280 273
281 If this option is set to M-bM-^@M-^\noM-bM-^@M-^] root is not allowed to login. 274 If this option is set to M-bM-^@M-^\noM-bM-^@M-^] root is not allowed to login.
@@ -315,16 +308,10 @@ DESCRIPTION
315 PubkeyAuthentication 308 PubkeyAuthentication
316 Specifies whether public key authentication is allowed. The 309 Specifies whether public key authentication is allowed. The
317 default is M-bM-^@M-^\yesM-bM-^@M-^]. Note that this option applies to protocol ver- 310 default is M-bM-^@M-^\yesM-bM-^@M-^]. Note that this option applies to protocol ver-
318 sion 2 only. 311 sion 2 only. RhostsRSAAuthentication should be used instead,
319 312 because it performs RSA-based host authentication in addition to
320 RhostsAuthentication 313 normal rhosts or /etc/hosts.equiv authentication. The default is
321 Specifies whether authentication using rhosts or /etc/hosts.equiv 314 M-bM-^@M-^\noM-bM-^@M-^]. This option applies to protocol version 1 only.
322 files is sufficient. Normally, this method should not be permit-
323 ted because it is insecure. RhostsRSAAuthentication should be
324 used instead, because it performs RSA-based host authentication
325 in addition to normal rhosts or /etc/hosts.equiv authentication.
326 The default is M-bM-^@M-^\noM-bM-^@M-^]. This option applies to protocol version 1
327 only.
328 315
329 RhostsRSAAuthentication 316 RhostsRSAAuthentication
330 Specifies whether rhosts or /etc/hosts.equiv authentication 317 Specifies whether rhosts or /etc/hosts.equiv authentication
@@ -361,6 +348,10 @@ DESCRIPTION
361 LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The 348 LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The
362 default is AUTH. 349 default is AUTH.
363 350
351 UseDNS Specifies whether sshd should lookup the remote host name and
352 check that the resolved host name for the remote IP address maps
353 back to the very same IP address. The default is M-bM-^@M-^\yesM-bM-^@M-^].
354
364 UseLogin 355 UseLogin
365 Specifies whether login(1) is used for interactive login ses- 356 Specifies whether login(1) is used for interactive login ses-
366 sions. The default is M-bM-^@M-^\noM-bM-^@M-^]. Note that login(1) is never used 357 sions. The default is M-bM-^@M-^\noM-bM-^@M-^]. Note that login(1) is never used
@@ -369,6 +360,11 @@ DESCRIPTION
369 know how to handle xauth(1) cookies. If UsePrivilegeSeparation 360 know how to handle xauth(1) cookies. If UsePrivilegeSeparation
370 is specified, it will be disabled after authentication. 361 is specified, it will be disabled after authentication.
371 362
363 UsePAM Enables PAM authentication (via challenge-response) and session
364 set up. If you enable this, you should probably disable
365 PasswordAuthentication. If you enable then you will not be able
366 to run sshd as a non-root user.
367
372 UsePrivilegeSeparation 368 UsePrivilegeSeparation
373 Specifies whether sshd separates privileges by creating an 369 Specifies whether sshd separates privileges by creating an
374 unprivileged child process to deal with incoming network traffic. 370 unprivileged child process to deal with incoming network traffic.
@@ -378,11 +374,6 @@ DESCRIPTION
378 taining any corruption within the unprivileged processes. The 374 taining any corruption within the unprivileged processes. The
379 default is M-bM-^@M-^\yesM-bM-^@M-^]. 375 default is M-bM-^@M-^\yesM-bM-^@M-^].
380 376
381 VerifyReverseMapping
382 Specifies whether sshd should try to verify the remote host name
383 and check that the resolved host name for the remote IP address
384 maps back to the very same IP address. The default is M-bM-^@M-^\noM-bM-^@M-^].
385
386 X11DisplayOffset 377 X11DisplayOffset
387 Specifies the first display number available for sshdM-bM-^@M-^Ys X11 for- 378 Specifies the first display number available for sshdM-bM-^@M-^Ys X11 for-
388 warding. This prevents sshd from interfering with real X11 379 warding. This prevents sshd from interfering with real X11
@@ -400,7 +391,7 @@ DESCRIPTION
400 substitution occur on the client side. The security risk of 391 substitution occur on the client side. The security risk of
401 using X11 forwarding is that the clientM-bM-^@M-^Ys X11 display server may 392 using X11 forwarding is that the clientM-bM-^@M-^Ys X11 display server may
402 be exposed to attack when the ssh client requests forwarding (see 393 be exposed to attack when the ssh client requests forwarding (see
403 the warnings for ForwardX11 in ssh_config(5) ). A system adminis- 394 the warnings for ForwardX11 in ssh_config(5)). A system adminis-
404 trator may have a stance in which they want to protect clients 395 trator may have a stance in which they want to protect clients
405 that may expose themselves to attack by unwittingly requesting 396 that may expose themselves to attack by unwittingly requesting
406 X11 forwarding, which can warrant a M-bM-^@M-^\noM-bM-^@M-^] setting. 397 X11 forwarding, which can warrant a M-bM-^@M-^\noM-bM-^@M-^] setting.
@@ -454,6 +445,9 @@ FILES
454 writable by root only, but it is recommended (though not neces- 445 writable by root only, but it is recommended (though not neces-
455 sary) that it be world-readable. 446 sary) that it be world-readable.
456 447
448SEE ALSO
449 sshd(8)
450
457AUTHORS 451AUTHORS
458 OpenSSH is a derivative of the original and free ssh 1.2.12 release by 452 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
459 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo 453 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
@@ -462,7 +456,4 @@ AUTHORS
462 versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support 456 versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support
463 for privilege separation. 457 for privilege separation.
464 458
465SEE ALSO
466 sshd(8)
467
468BSD September 25, 1999 BSD 459BSD September 25, 1999 BSD
diff --git a/sshd_config.5 b/sshd_config.5
index 6f38a260a..727fdb12a 100644
--- a/sshd_config.5
+++ b/sshd_config.5
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: sshd_config.5,v 1.15 2003/03/28 10:11:43 jmc Exp $ 37.\" $OpenBSD: sshd_config.5,v 1.25 2003/09/01 09:50:04 markus Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSHD_CONFIG 5 39.Dt SSHD_CONFIG 5
40.Os 40.Os
@@ -61,10 +61,6 @@ The possible
61keywords and their meanings are as follows (note that 61keywords and their meanings are as follows (note that
62keywords are case-insensitive and arguments are case-sensitive): 62keywords are case-insensitive and arguments are case-sensitive):
63.Bl -tag -width Ds 63.Bl -tag -width Ds
64.It Cm AFSTokenPassing
65Specifies whether an AFS token may be forwarded to the server.
66Default is
67.Dq no .
68.It Cm AllowGroups 64.It Cm AllowGroups
69This keyword can be followed by a list of group name patterns, separated 65This keyword can be followed by a list of group name patterns, separated
70by spaces. 66by spaces.
@@ -72,7 +68,7 @@ If specified, login is allowed only for users whose primary
72group or supplementary group list matches one of the patterns. 68group or supplementary group list matches one of the patterns.
73.Ql \&* 69.Ql \&*
74and 70and
75.Ql ? 71.Ql \&?
76can be used as 72can be used as
77wildcards in the patterns. 73wildcards in the patterns.
78Only group names are valid; a numerical group ID is not recognized. 74Only group names are valid; a numerical group ID is not recognized.
@@ -93,7 +89,7 @@ If specified, login is allowed only for user names that
93match one of the patterns. 89match one of the patterns.
94.Ql \&* 90.Ql \&*
95and 91and
96.Ql ? 92.Ql \&?
97can be used as 93can be used as
98wildcards in the patterns. 94wildcards in the patterns.
99Only user names are valid; a numerical user ID is not recognized. 95Only user names are valid; a numerical user ID is not recognized.
@@ -107,7 +103,8 @@ Specifies the file that contains the public keys that can be used
107for user authentication. 103for user authentication.
108.Cm AuthorizedKeysFile 104.Cm AuthorizedKeysFile
109may contain tokens of the form %T which are substituted during connection 105may contain tokens of the form %T which are substituted during connection
110set-up. The following tokens are defined: %% is replaced by a literal '%', 106set-up.
107The following tokens are defined: %% is replaced by a literal '%',
111%h is replaced by the home directory of the user being authenticated and 108%h is replaced by the home directory of the user being authenticated and
112%u is replaced by the username of that user. 109%u is replaced by the username of that user.
113After expansion, 110After expansion,
@@ -138,7 +135,7 @@ The default is
138.Pp 135.Pp
139.Bd -literal 136.Bd -literal
140 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, 137 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
141 aes192-cbc,aes256-cbc'' 138 aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr''
142.Ed 139.Ed
143.It Cm ClientAliveInterval 140.It Cm ClientAliveInterval
144Sets a timeout interval in seconds after which if no data has been received 141Sets a timeout interval in seconds after which if no data has been received
@@ -153,20 +150,24 @@ This option applies to protocol version 2 only.
153Sets the number of client alive messages (see above) which may be 150Sets the number of client alive messages (see above) which may be
154sent without 151sent without
155.Nm sshd 152.Nm sshd
156receiving any messages back from the client. If this threshold is 153receiving any messages back from the client.
157reached while client alive messages are being sent, 154If this threshold is reached while client alive messages are being sent,
158.Nm sshd 155.Nm sshd
159will disconnect the client, terminating the session. It is important 156will disconnect the client, terminating the session.
160to note that the use of client alive messages is very different from 157It is important to note that the use of client alive messages is very
158different from
161.Cm KeepAlive 159.Cm KeepAlive
162(below). The client alive messages are sent through the 160(below).
163encrypted channel and therefore will not be spoofable. The TCP keepalive 161The client alive messages are sent through the encrypted channel
164option enabled by 162and therefore will not be spoofable.
163The TCP keepalive option enabled by
165.Cm KeepAlive 164.Cm KeepAlive
166is spoofable. The client alive mechanism is valuable when the client or 165is spoofable.
166The client alive mechanism is valuable when the client or
167server depend on knowing when a connection has become inactive. 167server depend on knowing when a connection has become inactive.
168.Pp 168.Pp
169The default value is 3. If 169The default value is 3.
170If
170.Cm ClientAliveInterval 171.Cm ClientAliveInterval
171(above) is set to 15, and 172(above) is set to 15, and
172.Cm ClientAliveCountMax 173.Cm ClientAliveCountMax
@@ -187,7 +188,7 @@ Login is disallowed for users whose primary group or supplementary
187group list matches one of the patterns. 188group list matches one of the patterns.
188.Ql \&* 189.Ql \&*
189and 190and
190.Ql ? 191.Ql \&?
191can be used as 192can be used as
192wildcards in the patterns. 193wildcards in the patterns.
193Only group names are valid; a numerical group ID is not recognized. 194Only group names are valid; a numerical group ID is not recognized.
@@ -199,7 +200,7 @@ by spaces.
199Login is disallowed for user names that match one of the patterns. 200Login is disallowed for user names that match one of the patterns.
200.Ql \&* 201.Ql \&*
201and 202and
202.Ql ? 203.Ql \&?
203can be used as wildcards in the patterns. 204can be used as wildcards in the patterns.
204Only user names are valid; a numerical user ID is not recognized. 205Only user names are valid; a numerical user ID is not recognized.
205By default, login is allowed for all users. 206By default, login is allowed for all users.
@@ -224,6 +225,17 @@ or
224.Dq no . 225.Dq no .
225The default is 226The default is
226.Dq no . 227.Dq no .
228.It Cm GSSAPIAuthentication
229Specifies whether user authentication based on GSSAPI is allowed.
230The default is
231.Dq no .
232Note that this option applies to protocol version 2 only.
233.It Cm GSSAPICleanupCredentials
234Specifies whether to automatically destroy the user's credentials cache
235on logout.
236The default is
237.Dq yes .
238Note that this option applies to protocol version 2 only.
227.It Cm HostbasedAuthentication 239.It Cm HostbasedAuthentication
228Specifies whether rhosts or /etc/hosts.equiv authentication together 240Specifies whether rhosts or /etc/hosts.equiv authentication together
229with successful public key client host authentication is allowed 241with successful public key client host authentication is allowed
@@ -259,7 +271,6 @@ Specifies that
259and 271and
260.Pa .shosts 272.Pa .shosts
261files will not be used in 273files will not be used in
262.Cm RhostsAuthentication ,
263.Cm RhostsRSAAuthentication 274.Cm RhostsRSAAuthentication
264or 275or
265.Cm HostbasedAuthentication . 276.Cm HostbasedAuthentication .
@@ -303,11 +314,9 @@ This avoids infinitely hanging sessions.
303To disable keepalives, the value should be set to 314To disable keepalives, the value should be set to
304.Dq no . 315.Dq no .
305.It Cm KerberosAuthentication 316.It Cm KerberosAuthentication
306Specifies whether Kerberos authentication is allowed. 317Specifies whether the password provided by the user for
307This can be in the form of a Kerberos ticket, or if
308.Cm PasswordAuthentication 318.Cm PasswordAuthentication
309is yes, the password provided by the user will be validated through 319will be validated through the Kerberos KDC.
310the Kerberos KDC.
311To use this option, the server needs a 320To use this option, the server needs a
312Kerberos servtab which allows the verification of the KDC's identity. 321Kerberos servtab which allows the verification of the KDC's identity.
313Default is 322Default is
@@ -319,11 +328,6 @@ such as
319.Pa /etc/passwd . 328.Pa /etc/passwd .
320Default is 329Default is
321.Dq yes . 330.Dq yes .
322.It Cm KerberosTgtPassing
323Specifies whether a Kerberos TGT may be forwarded to the server.
324Default is
325.Dq no ,
326as this only works when the Kerberos KDC is actually an AFS kaserver.
327.It Cm KerberosTicketCleanup 331.It Cm KerberosTicketCleanup
328Specifies whether to automatically destroy the user's ticket cache 332Specifies whether to automatically destroy the user's ticket cache
329file on logout. 333file on logout.
@@ -369,11 +373,12 @@ is not specified,
369.Nm sshd 373.Nm sshd
370will listen on the address and all prior 374will listen on the address and all prior
371.Cm Port 375.Cm Port
372options specified. The default is to listen on all local 376options specified.
373addresses. 377The default is to listen on all local addresses.
374Multiple 378Multiple
375.Cm ListenAddress 379.Cm ListenAddress
376options are permitted. Additionally, any 380options are permitted.
381Additionally, any
377.Cm Port 382.Cm Port
378options must precede this option for non port qualified addresses. 383options must precede this option for non port qualified addresses.
379.It Cm LoginGraceTime 384.It Cm LoginGraceTime
@@ -422,12 +427,6 @@ The probability increases linearly and all connection attempts
422are refused if the number of unauthenticated connections reaches 427are refused if the number of unauthenticated connections reaches
423.Dq full 428.Dq full
424(60). 429(60).
425.It Cm PAMAuthenticationViaKbdInt
426Specifies whether PAM challenge response authentication is allowed. This
427allows the use of most PAM challenge response authentication modules, but
428it will allow password authentication regardless of whether
429.Cm PasswordAuthentication
430is enabled.
431.It Cm PasswordAuthentication 430.It Cm PasswordAuthentication
432Specifies whether password authentication is allowed. 431Specifies whether password authentication is allowed.
433The default is 432The default is
@@ -460,8 +459,8 @@ but only if the
460.Ar command 459.Ar command
461option has been specified 460option has been specified
462(which may be useful for taking remote backups even if root login is 461(which may be useful for taking remote backups even if root login is
463normally not allowed). All other authentication methods are disabled 462normally not allowed).
464for root. 463All other authentication methods are disabled for root.
465.Pp 464.Pp
466If this option is set to 465If this option is set to
467.Dq no 466.Dq no
@@ -534,10 +533,6 @@ Specifies whether public key authentication is allowed.
534The default is 533The default is
535.Dq yes . 534.Dq yes .
536Note that this option applies to protocol version 2 only. 535Note that this option applies to protocol version 2 only.
537.It Cm RhostsAuthentication
538Specifies whether authentication using rhosts or /etc/hosts.equiv
539files is sufficient.
540Normally, this method should not be permitted because it is insecure.
541.Cm RhostsRSAAuthentication 536.Cm RhostsRSAAuthentication
542should be used 537should be used
543instead, because it performs RSA-based host authentication in addition 538instead, because it performs RSA-based host authentication in addition
@@ -585,6 +580,14 @@ Gives the facility code that is used when logging messages from
585The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 580The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
586LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 581LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
587The default is AUTH. 582The default is AUTH.
583.It Cm UseDNS
584Specifies whether
585.Nm sshd
586should lookup the remote host name and check that
587the resolved host name for the remote IP address maps back to the
588very same IP address.
589The default is
590.Dq yes .
588.It Cm UseLogin 591.It Cm UseLogin
589Specifies whether 592Specifies whether
590.Xr login 1 593.Xr login 1
@@ -604,6 +607,13 @@ cookies.
604If 607If
605.Cm UsePrivilegeSeparation 608.Cm UsePrivilegeSeparation
606is specified, it will be disabled after authentication. 609is specified, it will be disabled after authentication.
610.It Cm UsePAM
611Enables PAM authentication (via challenge-response) and session set up.
612If you enable this, you should probably disable
613.Cm PasswordAuthentication .
614If you enable
615.CM UsePAM
616then you will not be able to run sshd as a non-root user.
607.It Cm UsePrivilegeSeparation 617.It Cm UsePrivilegeSeparation
608Specifies whether 618Specifies whether
609.Nm sshd 619.Nm sshd
@@ -615,14 +625,6 @@ The goal of privilege separation is to prevent privilege
615escalation by containing any corruption within the unprivileged processes. 625escalation by containing any corruption within the unprivileged processes.
616The default is 626The default is
617.Dq yes . 627.Dq yes .
618.It Cm VerifyReverseMapping
619Specifies whether
620.Nm sshd
621should try to verify the remote host name and check that
622the resolved host name for the remote IP address maps back to the
623very same IP address.
624The default is
625.Dq no .
626.It Cm X11DisplayOffset 628.It Cm X11DisplayOffset
627Specifies the first display number available for 629Specifies the first display number available for
628.Nm sshd Ns 's 630.Nm sshd Ns 's
@@ -653,7 +655,7 @@ display server may be exposed to attack when the ssh client requests
653forwarding (see the warnings for 655forwarding (see the warnings for
654.Cm ForwardX11 656.Cm ForwardX11
655in 657in
656.Xr ssh_config 5 ). 658.Xr ssh_config 5 ) .
657A system administrator may have a stance in which they want to 659A system administrator may have a stance in which they want to
658protect clients that may expose themselves to attack by unwittingly 660protect clients that may expose themselves to attack by unwittingly
659requesting X11 forwarding, which can warrant a 661requesting X11 forwarding, which can warrant a
@@ -699,7 +701,6 @@ The default is
699.Pa /usr/X11R6/bin/xauth . 701.Pa /usr/X11R6/bin/xauth .
700.El 702.El
701.Ss Time Formats 703.Ss Time Formats
702.Pp
703.Nm sshd 704.Nm sshd
704command-line arguments and configuration file options that specify time 705command-line arguments and configuration file options that specify time
705may be expressed using a sequence of the form: 706may be expressed using a sequence of the form:
@@ -748,6 +749,8 @@ Contains configuration data for
748This file should be writable by root only, but it is recommended 749This file should be writable by root only, but it is recommended
749(though not necessary) that it be world-readable. 750(though not necessary) that it be world-readable.
750.El 751.El
752.Sh SEE ALSO
753.Xr sshd 8
751.Sh AUTHORS 754.Sh AUTHORS
752OpenSSH is a derivative of the original and free 755OpenSSH is a derivative of the original and free
753ssh 1.2.12 release by Tatu Ylonen. 756ssh 1.2.12 release by Tatu Ylonen.
@@ -759,5 +762,3 @@ Markus Friedl contributed the support for SSH
759protocol versions 1.5 and 2.0. 762protocol versions 1.5 and 2.0.
760Niels Provos and Markus Friedl contributed support 763Niels Provos and Markus Friedl contributed support
761for privilege separation. 764for privilege separation.
762.Sh SEE ALSO
763.Xr sshd 8
diff --git a/sshlogin.c b/sshlogin.c
index 12555d635..36b648934 100644
--- a/sshlogin.c
+++ b/sshlogin.c
@@ -39,7 +39,7 @@
39 */ 39 */
40 40
41#include "includes.h" 41#include "includes.h"
42RCSID("$OpenBSD: sshlogin.c,v 1.5 2002/08/29 15:57:25 stevesk Exp $"); 42RCSID("$OpenBSD: sshlogin.c,v 1.7 2003/06/12 07:57:38 markus Exp $");
43 43
44#include "loginrec.h" 44#include "loginrec.h"
45 45
@@ -60,8 +60,8 @@ get_last_login_time(uid_t uid, const char *logname,
60} 60}
61 61
62/* 62/*
63 * Records that the user has logged in. I these parts of operating systems 63 * Records that the user has logged in. I wish these parts of operating
64 * were more standardized. 64 * systems were more standardized.
65 */ 65 */
66void 66void
67record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid, 67record_login(pid_t pid, const char *ttyname, const char *user, uid_t uid,
diff --git a/sshpty.c b/sshpty.c
index d28947f62..4747ceaf4 100644
--- a/sshpty.c
+++ b/sshpty.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: sshpty.c,v 1.8 2003/02/03 08:56:16 markus Exp $"); 15RCSID("$OpenBSD: sshpty.c,v 1.10 2003/06/12 07:57:38 markus Exp $");
16 16
17#ifdef HAVE_UTIL_H 17#ifdef HAVE_UTIL_H
18# include <util.h> 18# include <util.h>
@@ -101,12 +101,12 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
101 error("/dev/ptmx: %.100s", strerror(errno)); 101 error("/dev/ptmx: %.100s", strerror(errno));
102 return 0; 102 return 0;
103 } 103 }
104 old_signal = mysignal(SIGCHLD, SIG_DFL); 104 old_signal = signal(SIGCHLD, SIG_DFL);
105 if (grantpt(ptm) < 0) { 105 if (grantpt(ptm) < 0) {
106 error("grantpt: %.100s", strerror(errno)); 106 error("grantpt: %.100s", strerror(errno));
107 return 0; 107 return 0;
108 } 108 }
109 mysignal(SIGCHLD, old_signal); 109 signal(SIGCHLD, old_signal);
110 if (unlockpt(ptm) < 0) { 110 if (unlockpt(ptm) < 0) {
111 error("unlockpt: %.100s", strerror(errno)); 111 error("unlockpt: %.100s", strerror(errno));
112 return 0; 112 return 0;
@@ -226,7 +226,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
226 } 226 }
227 /* set tty modes to a sane state for broken clients */ 227 /* set tty modes to a sane state for broken clients */
228 if (tcgetattr(*ptyfd, &tio) < 0) 228 if (tcgetattr(*ptyfd, &tio) < 0)
229 log("Getting tty modes for pty failed: %.100s", strerror(errno)); 229 logit("Getting tty modes for pty failed: %.100s", strerror(errno));
230 else { 230 else {
231 tio.c_lflag |= (ECHO | ISIG | ICANON); 231 tio.c_lflag |= (ECHO | ISIG | ICANON);
232 tio.c_oflag |= (OPOST | ONLCR); 232 tio.c_oflag |= (OPOST | ONLCR);
@@ -234,7 +234,7 @@ pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen)
234 234
235 /* Set the new modes for the terminal. */ 235 /* Set the new modes for the terminal. */
236 if (tcsetattr(*ptyfd, TCSANOW, &tio) < 0) 236 if (tcsetattr(*ptyfd, TCSANOW, &tio) < 0)
237 log("Setting tty modes for pty failed: %.100s", strerror(errno)); 237 logit("Setting tty modes for pty failed: %.100s", strerror(errno));
238 } 238 }
239 239
240 return 1; 240 return 1;
@@ -258,7 +258,7 @@ pty_release(const char *ttyname)
258 error("chmod %.100s 0666 failed: %.100s", ttyname, strerror(errno)); 258 error("chmod %.100s 0666 failed: %.100s", ttyname, strerror(errno));
259} 259}
260 260
261/* Makes the tty the processes controlling tty and sets it to sane modes. */ 261/* Makes the tty the process's controlling tty and sets it to sane modes. */
262 262
263void 263void
264pty_make_controlling_tty(int *ttyfd, const char *ttyname) 264pty_make_controlling_tty(int *ttyfd, const char *ttyname)
@@ -274,9 +274,9 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
274 274
275 fd = open(ttyname, O_RDWR|O_NOCTTY); 275 fd = open(ttyname, O_RDWR|O_NOCTTY);
276 if (fd != -1) { 276 if (fd != -1) {
277 mysignal(SIGHUP, SIG_IGN); 277 signal(SIGHUP, SIG_IGN);
278 ioctl(fd, TCVHUP, (char *)NULL); 278 ioctl(fd, TCVHUP, (char *)NULL);
279 mysignal(SIGHUP, SIG_DFL); 279 signal(SIGHUP, SIG_DFL);
280 setpgid(0, 0); 280 setpgid(0, 0);
281 close(fd); 281 close(fd);
282 } else { 282 } else {
@@ -323,9 +323,9 @@ pty_make_controlling_tty(int *ttyfd, const char *ttyname)
323 error("SETPGRP %s",strerror(errno)); 323 error("SETPGRP %s",strerror(errno));
324#endif /* HAVE_NEWS4 */ 324#endif /* HAVE_NEWS4 */
325#ifdef USE_VHANGUP 325#ifdef USE_VHANGUP
326 old = mysignal(SIGHUP, SIG_IGN); 326 old = signal(SIGHUP, SIG_IGN);
327 vhangup(); 327 vhangup();
328 mysignal(SIGHUP, old); 328 signal(SIGHUP, old);
329#endif /* USE_VHANGUP */ 329#endif /* USE_VHANGUP */
330 fd = open(ttyname, O_RDWR); 330 fd = open(ttyname, O_RDWR);
331 if (fd < 0) { 331 if (fd < 0) {
@@ -409,10 +409,10 @@ pty_setowner(struct passwd *pw, const char *ttyname)
409 if (errno == EROFS && 409 if (errno == EROFS &&
410 (st.st_mode & (S_IRGRP | S_IROTH)) == 0) 410 (st.st_mode & (S_IRGRP | S_IROTH)) == 0)
411 debug("chmod(%.100s, 0%o) failed: %.100s", 411 debug("chmod(%.100s, 0%o) failed: %.100s",
412 ttyname, mode, strerror(errno)); 412 ttyname, (u_int)mode, strerror(errno));
413 else 413 else
414 fatal("chmod(%.100s, 0%o) failed: %.100s", 414 fatal("chmod(%.100s, 0%o) failed: %.100s",
415 ttyname, mode, strerror(errno)); 415 ttyname, (u_int)mode, strerror(errno));
416 } 416 }
417 } 417 }
418} 418}
diff --git a/sshtty.c b/sshtty.c
index 5c016f80a..2f47b06d1 100644
--- a/sshtty.c
+++ b/sshtty.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: sshtty.c,v 1.3 2002/03/04 17:27:39 stevesk Exp $"); 38RCSID("$OpenBSD: sshtty.c,v 1.4 2003/07/16 10:36:28 markus Exp $");
39 39
40#include "sshtty.h" 40#include "sshtty.h"
41#include "log.h" 41#include "log.h"
@@ -80,6 +80,9 @@ enter_raw_mode(void)
80 _saved_tio = tio; 80 _saved_tio = tio;
81 tio.c_iflag |= IGNPAR; 81 tio.c_iflag |= IGNPAR;
82 tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF); 82 tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
83#ifdef IUCLC
84 tio.c_iflag &= ~IUCLC;
85#endif
83 tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); 86 tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
84#ifdef IEXTEN 87#ifdef IEXTEN
85 tio.c_lflag &= ~IEXTEN; 88 tio.c_lflag &= ~IEXTEN;
diff --git a/ttymodes.c b/ttymodes.c
index 5cc13dcd5..c32e213a4 100644
--- a/ttymodes.c
+++ b/ttymodes.c
@@ -43,7 +43,7 @@
43 */ 43 */
44 44
45#include "includes.h" 45#include "includes.h"
46RCSID("$OpenBSD: ttymodes.c,v 1.18 2002/06/19 00:27:55 deraadt Exp $"); 46RCSID("$OpenBSD: ttymodes.c,v 1.19 2003/04/08 20:21:29 itojun Exp $");
47 47
48#include "packet.h" 48#include "packet.h"
49#include "log.h" 49#include "log.h"
@@ -267,7 +267,7 @@ tty_make_modes(int fd, struct termios *tiop)
267 267
268 if (tiop == NULL) { 268 if (tiop == NULL) {
269 if (tcgetattr(fd, &tio) == -1) { 269 if (tcgetattr(fd, &tio) == -1) {
270 log("tcgetattr: %.100s", strerror(errno)); 270 logit("tcgetattr: %.100s", strerror(errno));
271 goto end; 271 goto end;
272 } 272 }
273 } else 273 } else
@@ -341,7 +341,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
341 * modes, they will initially have reasonable values. 341 * modes, they will initially have reasonable values.
342 */ 342 */
343 if (tcgetattr(fd, &tio) == -1) { 343 if (tcgetattr(fd, &tio) == -1) {
344 log("tcgetattr: %.100s", strerror(errno)); 344 logit("tcgetattr: %.100s", strerror(errno));
345 failure = -1; 345 failure = -1;
346 } 346 }
347 347
@@ -420,7 +420,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
420 * left in the packet; hopefully there is nothing 420 * left in the packet; hopefully there is nothing
421 * more coming after the mode data. 421 * more coming after the mode data.
422 */ 422 */
423 log("parse_tty_modes: unknown opcode %d", opcode); 423 logit("parse_tty_modes: unknown opcode %d", opcode);
424 goto set; 424 goto set;
425 } 425 }
426 } else { 426 } else {
@@ -436,7 +436,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
436 (void) packet_get_int(); 436 (void) packet_get_int();
437 break; 437 break;
438 } else { 438 } else {
439 log("parse_tty_modes: unknown opcode %d", opcode); 439 logit("parse_tty_modes: unknown opcode %d", opcode);
440 goto set; 440 goto set;
441 } 441 }
442 } 442 }
@@ -446,7 +446,7 @@ tty_parse_modes(int fd, int *n_bytes_ptr)
446set: 446set:
447 if (*n_bytes_ptr != n_bytes) { 447 if (*n_bytes_ptr != n_bytes) {
448 *n_bytes_ptr = n_bytes; 448 *n_bytes_ptr = n_bytes;
449 log("parse_tty_modes: n_bytes_ptr != n_bytes: %d %d", 449 logit("parse_tty_modes: n_bytes_ptr != n_bytes: %d %d",
450 *n_bytes_ptr, n_bytes); 450 *n_bytes_ptr, n_bytes);
451 return; /* Don't process bytes passed */ 451 return; /* Don't process bytes passed */
452 } 452 }
@@ -455,5 +455,5 @@ set:
455 455
456 /* Set the new modes for the terminal. */ 456 /* Set the new modes for the terminal. */
457 if (tcsetattr(fd, TCSANOW, &tio) == -1) 457 if (tcsetattr(fd, TCSANOW, &tio) == -1)
458 log("Setting tty modes failed: %.100s", strerror(errno)); 458 logit("Setting tty modes failed: %.100s", strerror(errno));
459} 459}
diff --git a/uidswap.c b/uidswap.c
index 86c61a4b0..3f13f9bf4 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -12,7 +12,7 @@
12 */ 12 */
13 13
14#include "includes.h" 14#include "includes.h"
15RCSID("$OpenBSD: uidswap.c,v 1.23 2002/07/15 17:15:31 stevesk Exp $"); 15RCSID("$OpenBSD: uidswap.c,v 1.24 2003/05/29 16:58:45 deraadt Exp $");
16 16
17#include "log.h" 17#include "log.h"
18#include "uidswap.h" 18#include "uidswap.h"
@@ -143,12 +143,63 @@ restore_uid(void)
143void 143void
144permanently_set_uid(struct passwd *pw) 144permanently_set_uid(struct passwd *pw)
145{ 145{
146 uid_t old_uid = getuid();
147 gid_t old_gid = getgid();
148
146 if (temporarily_use_uid_effective) 149 if (temporarily_use_uid_effective)
147 fatal("permanently_set_uid: temporarily_use_uid effective"); 150 fatal("permanently_set_uid: temporarily_use_uid effective");
148 debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, 151 debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,
149 (u_int)pw->pw_gid); 152 (u_int)pw->pw_gid);
153
154#if defined(HAVE_SETRESGID)
155 if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) < 0)
156 fatal("setresgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
157#elif defined(HAVE_SETREGID) && !defined(BROKEN_SETREGID)
158 if (setregid(pw->pw_gid, pw->pw_gid) < 0)
159 fatal("setregid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
160#else
161 if (setegid(pw->pw_gid) < 0)
162 fatal("setegid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
150 if (setgid(pw->pw_gid) < 0) 163 if (setgid(pw->pw_gid) < 0)
151 fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); 164 fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
165#endif
166
167#if defined(HAVE_SETRESUID)
168 if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
169 fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
170#elif defined(HAVE_SETREUID) && !defined(BROKEN_SETREUID)
171 if (setreuid(pw->pw_uid, pw->pw_uid) < 0)
172 fatal("setreuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
173#else
174# ifndef SETEUID_BREAKS_SETUID
175 if (seteuid(pw->pw_uid) < 0)
176 fatal("seteuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
177# endif
152 if (setuid(pw->pw_uid) < 0) 178 if (setuid(pw->pw_uid) < 0)
153 fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); 179 fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
180#endif
181
182 /* Try restoration of GID if changed (test clearing of saved gid) */
183 if (old_gid != pw->pw_gid &&
184 (setgid(old_gid) != -1 || setegid(old_gid) != -1))
185 fatal("%s: was able to restore old [e]gid", __func__);
186
187 /* Verify GID drop was successful */
188 if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {
189 fatal("%s: egid incorrect gid:%u egid:%u (should be %u)",
190 __func__, (u_int)getgid(), (u_int)getegid(),
191 (u_int)pw->pw_gid);
192 }
193
194 /* Try restoration of UID if changed (test clearing of saved uid) */
195 if (old_uid != pw->pw_uid &&
196 (setuid(old_uid) != -1 || seteuid(old_uid) != -1))
197 fatal("%s: was able to restore old [e]uid", __func__);
198
199 /* Verify UID drop was successful */
200 if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {
201 fatal("%s: euid incorrect uid:%u euid:%u (should be %u)",
202 __func__, (u_int)getuid(), (u_int)geteuid(),
203 (u_int)pw->pw_uid);
204 }
154} 205}
diff --git a/version.h b/version.h
index 3b2a35d91..37e0c22ab 100644
--- a/version.h
+++ b/version.h
@@ -1,3 +1,3 @@
1/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ 1/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */
2 2
3#define SSH_VERSION "OpenSSH_3.6.1p2" 3#define SSH_VERSION "OpenSSH_3.7p1"