1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
|
$NetBSD: patch-ab,v 1.1 2000/03/20 02:25:33 itojun Exp $
--- configure.in.orig Wed May 12 20:20:02 1999
+++ configure.in Sat Mar 18 13:21:59 2000
@@ -30,8 +30,132 @@
fi
AC_PROG_CC
+AC_PROG_CPP
AC_ISC_POSIX
+AC_MSG_CHECKING([whether to enable ipv6])
+AC_ARG_ENABLE(ipv6,
+[ --enable-ipv6 Enable ipv6 (with ipv4) support
+ --disable-ipv6 Disable ipv6 support],
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ ipv6=no
+ ;;
+ *) AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_IPV6)
+ ipv6=yes
+ ;;
+ esac ],
+
+ AC_TRY_RUN([ /* AF_INET6 avalable check */
+#include <sys/types.h>
+#include <sys/socket.h>
+main()
+{
+ if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
+ exit(1);
+ else
+ exit(0);
+}
+],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_IPV6)
+ ipv6=yes,
+ AC_MSG_RESULT(no)
+ ipv6=no,
+ AC_MSG_RESULT(no)
+ ipv6=no
+))
+
+ipv6type=unknown
+ipv6lib=none
+
+if test "$ipv6" = "yes"; then
+ AC_MSG_CHECKING([ipv6 stack type])
+ for i in inria kame linux toshiba v6d zeta; do
+ case $i in
+ inria)
+ dnl http://www.kame.net/
+ AC_EGREP_CPP(yes, [dnl
+#include <netinet/in.h>
+#ifdef IPV6_INRIA_VERSION
+yes
+#endif],
+ [ipv6type=$i;
+ CPPFLAGS="-DINET6 $CPPFLAGS"])
+ ;;
+ kame)
+ dnl http://www.kame.net/
+ AC_EGREP_CPP(yes, [dnl
+#include <netinet/in.h>
+#ifdef __KAME__
+yes
+#endif],
+ [ipv6type=$i;
+ CPPFLAGS="-DINET6 $CPPFLAGS"])
+ ;;
+ linux)
+ dnl http://www.v6.linux.or.jp/
+ if test -d /usr/inet6; then
+ ipv6type=$i
+ ipv6lib=inet6
+ ipv6libdir=/usr/inet6/lib
+ CPPFLAGS="-DINET6 -I/usr/inet6/include $CPPFLAGS"
+ fi
+ ;;
+ toshiba)
+ AC_EGREP_CPP(yes, [dnl
+#include <sys/param.h>
+#ifdef _TOSHIBA_INET6
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=inet6;
+ ipv6libdir=/usr/local/v6/lib;
+ CPPFLAGS="-DINET6 $CPPFLAGS"])
+ ;;
+ v6d)
+ AC_EGREP_CPP(yes, [dnl
+#include </usr/local/v6/include/sys/v6config.h>
+#ifdef __V6D__
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=v6;
+ ipv6libdir=/usr/local/v6/lib;
+ CPPFLAGS="-I/usr/local/v6/include $CPPFLAGS"])
+ ;;
+ zeta)
+ AC_EGREP_CPP(yes, [dnl
+#include <sys/param.h>
+#ifdef _ZETA_MINAMI_INET6
+yes
+#endif],
+ [ipv6type=$i;
+ ipv6lib=inet6;
+ ipv6libdir=/usr/local/v6/lib;
+ CPPFLAGS="-DINET6 $CPPFLAGS"])
+ ;;
+ esac
+ if test "$ipv6type" != "unknown"; then
+ break
+ fi
+ done
+ AC_MSG_RESULT($ipv6type)
+fi
+
+if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
+ if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
+ LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
+ else
+ echo 'Fatal: no $ipv6lib library found. cannot continue.'
+ echo "You need to fetch lib$ipv6lib.a from appropriate"
+ echo 'ipv6 kit and compile beforehand.'
+ exit 1
+ fi
+fi
+
AC_DEFINE_UNQUOTED(HOSTTYPE, "$host")
case "$host" in
@@ -42,11 +166,12 @@
;;
*-*-solaris*)
# solaris stuff. appro@fy.chalmers.se
- AC_DEFINE(SECURE_RPC)
- AC_DEFINE(SECURE_NFS)
+# this stuff breaks AFS/Kerberos. YUCK.
+# AC_DEFINE(SECURE_RPC)
+# AC_DEFINE(SECURE_NFS)
# NIS+ is forced so that we don't have to recompile
# if we move to NIS+. appro@fy.chalmers.se
- AC_DEFINE(NIS_PLUS)
+# AC_DEFINE(NIS_PLUS)
;;
*-*-sunos*)
os_sunos=yes
@@ -311,9 +436,9 @@
export CFLAGS CC
-# Socket pairs appear to be broken on several systems. I don't know exactly
-# where, so I'll use pipes everywhere for now.
-AC_DEFINE(USE_PIPES)
+dnl # Socket pairs appear to be broken on several systems. I don't know exactly
+dnl # where, so I'll use pipes everywhere for now.
+dnl AC_DEFINE(USE_PIPES)
AC_MSG_CHECKING([that the compiler works])
AC_TRY_RUN([ main(int ac, char **av) { return 0; } ],
@@ -370,7 +495,7 @@
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(unistd.h rusage.h sys/time.h lastlog.h utmp.h shadow.h)
-AC_CHECK_HEADERS(sgtty.h sys/select.h sys/ioctl.h machine/endian.h)
+AC_CHECK_HEADERS(sgtty.h sys/select.h sys/ioctl.h sys/filio.h machine/endian.h)
AC_CHECK_HEADERS(paths.h usersec.h utime.h netinet/in_systm.h)
AC_CHECK_HEADERS(netinet/in_system.h netinet/ip.h netinet/tcp.h ulimit.h)
AC_CHECK_HEADERS(sys/resource.h login_cap.h sys/stream.h sys/conf.h)
@@ -399,6 +524,16 @@
[ AC_DEFINE(HAVE_INCOMPATIBLE_SIGINFO)
AC_MSG_RESULT(yes)] , AC_MSG_RESULT(no))
+AC_MSG_CHECKING([whether sys/socket.h have struct sockaddr_storage])
+AC_EGREP_HEADER(sockaddr_storage, sys/socket.h,
+ [ AC_DEFINE(HAVE_SOCKADDR_STORAGE) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
+AC_MSG_CHECKING([whether sys/socket.h have __ss_family])
+AC_EGREP_HEADER(__ss_family, sys/socket.h,
+ [ AC_DEFINE(HAVE_NEW_SS_FAMILY) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
+AC_MSG_CHECKING([whether sys/socket.h have sa_len])
+AC_EGREP_HEADER(sa_len, sys/socket.h,
+ [ AC_DEFINE(HAVE_SOCKADDR_LEN) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
+
AC_CHECK_LIB(c, crypt, [true], AC_CHECK_LIB(crypt, crypt))
AC_CHECK_LIB(sec, getspnam)
AC_CHECK_LIB(seq, get_process_stats)
@@ -436,6 +571,107 @@
AC_REPLACE_FUNCS(strerror memmove remove random putenv crypt socketpair snprintf)
+AC_MSG_CHECKING(getaddrinfo bug)
+AC_TRY_RUN([
+#include <sys/types.h>
+#include <netdb.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+main()
+{
+ int passive, gaierr, inet4 = 0, inet6 = 0;
+ struct addrinfo hints, *ai, *aitop;
+ char straddr[INET6_ADDRSTRLEN], strport[16];
+
+ for (passive = 0; passive <= 1; passive++) {
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_flags = passive ? AI_PASSIVE : 0;
+ hints.ai_socktype = SOCK_STREAM;
+ if ((gaierr = getaddrinfo(NULL, "54321", &hints, &aitop)) != 0) {
+ (void)gai_strerror(gaierr);
+ goto bad;
+ }
+ for (ai = aitop; ai; ai = ai->ai_next) {
+ if (ai->ai_addr == NULL ||
+ ai->ai_addrlen == 0 ||
+ getnameinfo(ai->ai_addr, ai->ai_addrlen,
+ straddr, sizeof(straddr), strport, sizeof(strport),
+ NI_NUMERICHOST|NI_NUMERICSERV) != 0) {
+ goto bad;
+ }
+ if (strcmp(strport, "54321") != 0) {
+ goto bad;
+ }
+ switch (ai->ai_family) {
+ case AF_INET:
+ if (passive) {
+ if (strcmp(straddr, "0.0.0.0") != 0) {
+ goto bad;
+ }
+ } else {
+ if (strcmp(straddr, "127.0.0.1") != 0) {
+ goto bad;
+ }
+ }
+ inet4++;
+ break;
+ case AF_INET6:
+ if (passive) {
+ if (strcmp(straddr, "::") != 0) {
+ goto bad;
+ }
+ } else {
+ if (strcmp(straddr, "::1") != 0) {
+ goto bad;
+ }
+ }
+ inet6++;
+ break;
+ case AF_UNSPEC:
+ goto bad;
+ break;
+ default:
+ /* another family support? */
+ break;
+ }
+ }
+ }
+
+ if (inet4 != 0 && inet4 != 2)
+ goto bad;
+ if (inet6 != 0 && inet6 != 2)
+ goto bad;
+
+ if (aitop)
+ freeaddrinfo(aitop);
+ exit(0);
+
+ bad:
+ if (aitop)
+ freeaddrinfo(aitop);
+ exit(1);
+}
+],
+AC_MSG_RESULT(good)
+buggygetaddrinfo=no,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes,
+AC_MSG_RESULT(buggy)
+buggygetaddrinfo=yes)
+
+if test "$buggygetaddrinfo" = "yes"; then
+ if test "$ipv6" = "yes"; then
+ echo 'Fatal: You must get working getaddrinfo() function.'
+ echo ' or you can specify "--disable-ipv6"'.
+ exit 1
+ else
+ AC_REPLACE_FUNCS(getaddrinfo getnameinfo)
+ fi
+fi
+
AC_PROG_LN_S
AC_PROG_INSTALL
AC_CHECK_PROG(AR, ar, ar, echo)
@@ -903,8 +1139,8 @@
fi
AC_MSG_RESULT(Assuming TIS headers and libraries are in $withval.)
AC_DEFINE(HAVE_TIS)
- CFLAGS="$CFLAGS -I$withval -DHAVE_TIS"
- LIBS="-L$withval -lauth -lfwall $LIBS"
+ CFLAGS="$CFLAGS -I$withval/include -DHAVE_TIS"
+ LIBS="-L$withval/lib -lauth -lfwall $LIBS"
AC_MSG_WARN(Remember to read README.TIS. The connection between sshd and TIS authentication
server is clear text!)
;;
@@ -912,55 +1148,117 @@
AC_MSG_RESULT(no)
)
-AC_MSG_CHECKING(whether to use Kerberos)
-AC_ARG_WITH(kerberos5,
-[ --with-kerberos5=[KRB_PREFIX] Compile in Kerberos5 support.],
+AC_MSG_CHECKING(whether to use Kerberos v4)
+AC_ARG_WITH(krb4,
+[ --with-krb4[=PATH] Compile in Kerberos v4 support.],
[ case "$withval" in
yes)
- with_kerberos5=/usr/local
+ with_krb4=/usr/kerberos
;;
esac ],
-[ with_kerberos5=no ]
+[ with_krb4=no ]
)
-case "$with_kerberos5" in
+case "$with_krb4" in
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_RESULT(yes)
- AC_DEFINE(KERBEROS)
- AC_DEFINE(KRB5)
- KERBEROS_ROOT="$with_kerberos5"
- KERBEROS_INCS="-I${KERBEROS_ROOT}/include"
- KERBEROS_LIBS="-L${KERBEROS_ROOT}/lib -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
- AC_CHECK_LIB(ndbm, dbm_open, KERBEROS_LIBS="$KERBEROS_LIBS -lndbm")
+ AC_DEFINE(KRB4)
+ KERBEROS_ROOT="$with_krb4"
+ KERBEROS_INCS="-I${KERBEROS_ROOT}/include/kerberosIV"
+ KERBEROS_LIBS="-L${KERBEROS_ROOT}/lib -lkrb -ldes"
KERBEROS_OBJS="auth-kerberos.o"
+ AC_CHECK_LIB(resolv, dn_expand, KERBEROS_LIBS="$KERBEROS_LIBS -lresolv")
+ dnl Check whether or not the AFS lifetime conversion routines exist.
+ AC_MSG_CHECKING(whether AFS lifetime conversion routines are present)
+ keeplibs="$LIBS"
+ keepcflags="$CFLAGS"
+ LIBS="-L${KERBEROS_ROOT}/lib -lkrb -ldes $LIBS"
+ CFLAGS="-I${KERBEROS_ROOT}/include $CFLAGS"
+ AC_TRY_LINK([#include <krb.h>], [ krb_life_to_time(10, 10);],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_KRB_LIFE_TO_TIME)],
+ [AC_MSG_RESULT(no)])
+ LIBS="$keeplibs"
+ CFLAGS="$keepcflags"
;;
esac
-AC_SUBST(KERBEROS_ROOT)
-AC_SUBST(KERBEROS_INCS)
-AC_SUBST(KERBEROS_LIBS)
-AC_SUBST(KERBEROS_OBJS)
-
-AC_MSG_CHECKING(whether to enable passing the Kerberos TGT)
-AC_ARG_ENABLE(kerberos-tgt-passing,
-[ --enable-kerberos-tgt-passing Pass Kerberos ticket-granting-ticket.],
-[ case "$enableval" in
+
+AC_MSG_CHECKING(whether to use Kerberos v5)
+AC_ARG_WITH(krb5,
+[ --with-krb5[=PATH] Compile in Kerberos v5 support.],
+[ case "$withval" in
+ yes)
+ with_krb5=/usr/local
+ ;;
+ esac ],
+[ with_krb5=no ]
+)
+case "$with_krb5" in
no)
AC_MSG_RESULT(no)
;;
*)
- if test "$with_kerberos5" = no ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(KRB5)
+ KERBEROS_ROOT="$with_krb5"
+ KERBEROS_INCS="-I${KERBEROS_ROOT}/include/krb5"
+ KERBEROS_LIBS="-L${KERBEROS_ROOT}/lib -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
+ AC_CHECK_LIB(ndbm, dbm_open, KERBEROS_LIBS="$KERBEROS_LIBS -lndbm")
+ KERBEROS_OBJS="auth-kerberos.o"
+ ;;
+esac
+
+AC_MSG_CHECKING(whether to use AFS)
+AC_ARG_WITH(afs,
+[ --with-afs Compile in AFS support (requires KTH krb4).],
+if test "$with_afs" = no; then
AC_MSG_RESULT(no)
- AC_MSG_WARN("Passing Kerberos TGT requires Kerberos5 support.")
else
AC_MSG_RESULT(yes)
- AC_DEFINE(KERBEROS_TGT_PASSING)
+ AC_DEFINE(AFS)
+ if test "$with_krb4" = no; then
+ AC_MSG_RESULT(no)
+ AC_MSG_WARN("AFS requires Kerberos v4 support.")
+ else
+ KERBEROS_LIBS="${KERBEROS_LIBS} -lkafs"
+ if test -n "$os_aix"; then
+ KERBEROS_LIBS="${KERBEROS_LIBS} -lld"
fi
+ fi
+fi
+)
+AC_SUBST(KERBEROS_ROOT)dnl
+AC_SUBST(KERBEROS_INCS)dnl
+AC_SUBST(KERBEROS_LIBS)dnl
+AC_SUBST(KERBEROS_OBJS)dnl
+
+AC_MSG_CHECKING(whether to use Hesiod)
+AC_ARG_WITH(hesiod,
+[ --with-hesiod[=PATH] Compile in Hesiod support.],
+[ case "$withval" in
+ yes)
+ with_hesiod=/usr/local/athena
;;
esac ],
- AC_MSG_RESULT(no)
+[ with_hesiod=no ]
)
+case "$with_hesiod" in
+no)
+ AC_MSG_RESULT(no)
+ ;;
+*)
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HESIOD)
+ HESIOD_ROOT="$with_hesiod"
+ HESIOD_INCS="-I${HESIOD_ROOT}/include"
+ HESIOD_LIBS="-L${HESIOD_ROOT}/lib -lhesiod"
+ ;;
+esac
+AC_SUBST(HESIOD_ROOT)dnl
+AC_SUBST(HESIOD_INCS)dnl
+AC_SUBST(HESIOD_LIBS)dnl
AC_MSG_CHECKING(whether to use libwrap)
AC_ARG_WITH(libwrap,
@@ -970,11 +1268,19 @@
AC_MSG_RESULT(no)
;;
yes)
- AC_MSG_RESULT(yes)
- AC_CHECK_LIB(wrap, request_init, [
- AC_DEFINE(LIBWRAP)
- WRAPLIBS="-lwrap"
- AC_DEFINE(HAVE_LIBWRAP) ])
+ WRAPLIBS="-lwrap"
+ OLDLIBS="$LIBS"
+ LIBS="$WRAPLIBS $LIBS"
+ AC_TRY_LINK([ int allow_severity; int deny_severity; ],
+ [ request_init(); ], [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(LIBWRAP)
+ AC_DEFINE(HAVE_LIBWRAP)
+ ], [
+ AC_MSG_RESULT(no)
+ WRAPLIBS=""
+ ])
+ LIBS="$OLDLIBS"
;;
*)
AC_MSG_RESULT(yes)
@@ -1227,14 +1533,14 @@
[ case "$enableval" in
no)
AC_MSG_RESULT(no)
- SSHINSTALLMODE=0711
+ SSHINSTALLMODE=0511
;;
*) AC_MSG_RESULT(yes)
- SSHINSTALLMODE=04711
+ SSHINSTALLMODE=04511
;;
esac ],
AC_MSG_RESULT(yes)
- SSHINSTALLMODE=04711
+ SSHINSTALLMODE=04511
)
AC_MSG_CHECKING(whether to enable TCP_NODELAY)
@@ -1252,6 +1558,38 @@
AC_DEFINE(ENABLE_TCP_NODELAY)
)
+AC_MSG_CHECKING(whether to enable another port try support)
+AC_ARG_ENABLE(another-port-try,
+[ --enable-another-port-try Enable another port try support (default)
+ --disable-another-port-try Disable another port try support],
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *) AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_ANOTHER_PORT_TRY)
+ ;;
+ esac ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_ANOTHER_PORT_TRY)
+)
+
+AC_MSG_CHECKING(whether to enable logging auth info support)
+AC_ARG_ENABLE(log-auth,
+[ --enable-log-auth Enable logging auth info support (default)
+ --disable-log-auth Disable logging auth info support],
+[ case "$enableval" in
+ no)
+ AC_MSG_RESULT(no)
+ ;;
+ *) AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_LOG_AUTH)
+ ;;
+ esac ],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ENABLE_LOG_AUTH)
+)
+
AC_MSG_CHECKING(whether to enable SO_LINGER)
AC_ARG_ENABLE(so-linger,
[ --enable-so-linger Enable setting SO_LINGER socket option],
@@ -1311,6 +1649,8 @@
AC_DEFINE(SCP_ALL_STATISTICS_ENABLED)
)
+CFLAGS="$CPPFLAGS $CFLAGS"
+
# We include this here only to make it visible in --help; this is only used
# in the gmp subdirectory.
AC_ARG_ENABLE(asm,
@@ -1336,4 +1676,4 @@
AC_SUBST(SSHDCONFOBJS)
AC_SUBST(SSHINSTALLMODE)
-AC_OUTPUT(Makefile sshd.8 ssh.1 make-ssh-known-hosts.1 zlib-1.0.4/Makefile)
+AC_OUTPUT(Makefile sshd.8 ssh.1 make-ssh-known-hosts.pl make-ssh-known-hosts.1 zlib-1.0.4/Makefile)
|