3 # Copyright (c) 1999-2004 Damien Miller
5 # Permission to use, copy, modify, and distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 AC_CONFIG_SRCDIR([ssh.c])
20 AC_CONFIG_HEADER(config.h)
25 # Checks for programs.
31 AC_PATH_PROGS(PERL, perl5 perl)
32 AC_PATH_PROG(SED, sed)
34 AC_PATH_PROG(ENT, ent)
36 AC_PATH_PROG(TEST_MINUS_S_SH, bash)
37 AC_PATH_PROG(TEST_MINUS_S_SH, ksh)
38 AC_PATH_PROG(TEST_MINUS_S_SH, sh)
44 if test -z "$AR" ; then
45 AC_MSG_ERROR([*** 'ar' missing, please install or fix your \$PATH ***])
48 # Use LOGIN_PROGRAM from environment if possible
49 if test ! -z "$LOGIN_PROGRAM" ; then
50 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM")
53 AC_PATH_PROG(LOGIN_PROGRAM_FALLBACK, login)
54 if test ! -z "$LOGIN_PROGRAM_FALLBACK" ; then
55 AC_DEFINE_UNQUOTED(LOGIN_PROGRAM_FALLBACK, "$LOGIN_PROGRAM_FALLBACK")
59 AC_PATH_PROG(PATH_PASSWD_PROG, passwd)
60 if test ! -z "$PATH_PASSWD_PROG" ; then
61 AC_DEFINE_UNQUOTED(_PATH_PASSWD_PROG, "$PATH_PASSWD_PROG")
64 if test -z "$LD" ; then
70 if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
71 CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wno-uninitialized"
75 [ --without-rpath Disable auto-added -R linker paths],
77 if test "x$withval" = "xno" ; then
80 if test "x$withval" = "xyes" ; then
86 # Check for some target-specific stuff
89 AC_MSG_CHECKING([how to specify blibpath for linker ($LD)])
90 if (test -z "$blibpath"); then
91 blibpath="/usr/lib:/lib"
93 saved_LDFLAGS="$LDFLAGS"
94 for tryflags in -blibpath: -Wl,-blibpath: -Wl,-rpath, ;do
95 if (test -z "$blibflags"); then
96 LDFLAGS="$saved_LDFLAGS $tryflags$blibpath"
97 AC_TRY_LINK([], [], [blibflags=$tryflags])
100 if (test -z "$blibflags"); then
101 AC_MSG_RESULT(not found)
102 AC_MSG_ERROR([*** must be able to specify blibpath on AIX - check config.log])
104 AC_MSG_RESULT($blibflags)
106 LDFLAGS="$saved_LDFLAGS"
107 dnl Check for authenticate. Might be in libs.a on older AIXes
108 AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)],
109 [AC_CHECK_LIB(s,authenticate,
110 [ AC_DEFINE(WITH_AIXAUTHENTICATE)
114 dnl Check if loginfailed is declared and takes 4 arguments (AIX >= 5.2)
115 AC_CHECK_DECL(loginfailed,
116 [AC_MSG_CHECKING(if loginfailed takes 4 arguments)
118 [#include <usersec.h>],
119 [(void)loginfailed("user","host","tty",0);],
121 AC_DEFINE(AIX_LOGINFAILED_4ARG)],
125 [#include <usersec.h>]
127 AC_CHECK_FUNCS(setauthdb)
128 AC_DEFINE(BROKEN_GETADDRINFO)
129 AC_DEFINE(BROKEN_REALPATH)
130 AC_DEFINE(SETEUID_BREAKS_SETUID)
131 AC_DEFINE(BROKEN_SETREUID)
132 AC_DEFINE(BROKEN_SETREGID)
133 dnl AIX handles lastlog as part of its login message
134 AC_DEFINE(DISABLE_LASTLOG)
135 AC_DEFINE(LOGIN_NEEDS_UTMPX)
136 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
139 check_for_libcrypt_later=1
140 LIBS="$LIBS /usr/lib/textmode.o"
141 AC_DEFINE(HAVE_CYGWIN)
143 AC_DEFINE(DISABLE_SHADOW)
144 AC_DEFINE(IP_TOS_IS_BROKEN)
145 AC_DEFINE(NO_X11_UNIX_SOCKETS)
146 AC_DEFINE(NO_IPPORT_RESERVED_CONCEPT)
147 AC_DEFINE(DISABLE_FD_PASSING)
148 AC_DEFINE(SETGROUPS_NOOP)
151 AC_DEFINE(IP_TOS_IS_BROKEN)
152 AC_DEFINE(SETEUID_BREAKS_SETUID)
153 AC_DEFINE(BROKEN_SETREUID)
154 AC_DEFINE(BROKEN_SETREGID)
157 AC_MSG_CHECKING(if we have working getaddrinfo)
158 AC_TRY_RUN([#include <mach-o/dyld.h>
159 main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
163 }], [AC_MSG_RESULT(working)],
164 [AC_MSG_RESULT(buggy)
165 AC_DEFINE(BROKEN_GETADDRINFO)],
166 [AC_MSG_RESULT(assume it is working)])
167 AC_DEFINE(SETEUID_BREAKS_SETUID)
168 AC_DEFINE(BROKEN_SETREUID)
169 AC_DEFINE(BROKEN_SETREGID)
170 AC_DEFINE_UNQUOTED(BIND_8_COMPAT, 1)
173 if test -z "$GCC"; then
176 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
177 IPADDR_IN_DISPLAY=yes
178 AC_DEFINE(HAVE_SECUREWARE)
180 AC_DEFINE(LOGIN_NO_ENDOPT)
181 AC_DEFINE(LOGIN_NEEDS_UTMPX)
182 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
183 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
184 LIBS="$LIBS -lsec -lsecpw"
185 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
186 disable_ptmx_check=yes
189 if test -z "$GCC"; then
192 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
193 IPADDR_IN_DISPLAY=yes
195 AC_DEFINE(LOGIN_NO_ENDOPT)
196 AC_DEFINE(LOGIN_NEEDS_UTMPX)
197 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
198 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
200 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
203 CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED=1"
204 IPADDR_IN_DISPLAY=yes
205 AC_DEFINE(PAM_SUN_CODEBASE)
207 AC_DEFINE(LOGIN_NO_ENDOPT)
208 AC_DEFINE(LOGIN_NEEDS_UTMPX)
209 AC_DEFINE(DISABLE_UTMP)
210 AC_DEFINE(LOCKED_PASSWD_STRING, "*")
211 AC_DEFINE(SPT_TYPE,SPT_PSTAT)
212 check_for_hpux_broken_getaddrinfo=1
214 AC_CHECK_LIB(xnet, t_error, ,AC_MSG_ERROR([*** -lxnet needed on HP-UX - check config.log ***]))
217 PATH="$PATH:/usr/etc"
218 AC_DEFINE(BROKEN_INET_NTOA)
219 AC_DEFINE(SETEUID_BREAKS_SETUID)
220 AC_DEFINE(BROKEN_SETREUID)
221 AC_DEFINE(BROKEN_SETREGID)
222 AC_DEFINE(WITH_ABBREV_NO_TTY)
223 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
226 PATH="$PATH:/usr/etc"
227 AC_DEFINE(WITH_IRIX_ARRAY)
228 AC_DEFINE(WITH_IRIX_PROJECT)
229 AC_DEFINE(WITH_IRIX_AUDIT)
230 AC_CHECK_FUNC(jlimit_startjob, [AC_DEFINE(WITH_IRIX_JOBS)])
231 AC_DEFINE(BROKEN_INET_NTOA)
232 AC_DEFINE(SETEUID_BREAKS_SETUID)
233 AC_DEFINE(BROKEN_SETREUID)
234 AC_DEFINE(BROKEN_SETREGID)
235 AC_DEFINE(BROKEN_UPDWTMPX)
236 AC_DEFINE(WITH_ABBREV_NO_TTY)
237 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
241 check_for_libcrypt_later=1
242 check_for_openpty_ctty_bug=1
243 AC_DEFINE(DONT_TRY_OTHER_AF)
244 AC_DEFINE(PAM_TTY_KLUDGE)
245 AC_DEFINE(LOCKED_PASSWD_PREFIX, "!")
246 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
247 inet6_default_4in6=yes
250 AC_DEFINE(BROKEN_CMSG_TYPE)
254 mips-sony-bsd|mips-sony-newsos4)
255 AC_DEFINE(HAVE_NEWS4)
259 check_for_libcrypt_before=1
260 if test "x$withval" != "xno" ; then
265 check_for_libcrypt_later=1
268 AC_DEFINE(SETEUID_BREAKS_SETUID)
269 AC_DEFINE(BROKEN_SETREUID)
270 AC_DEFINE(BROKEN_SETREGID)
273 conf_lastlog_location="/usr/adm/lastlog"
274 conf_utmp_location=/etc/utmp
275 conf_wtmp_location=/usr/adm/wtmp
278 AC_DEFINE(BROKEN_REALPATH)
280 AC_DEFINE(BROKEN_SAVED_UIDS)
283 if test "x$withval" != "xno" ; then
286 AC_DEFINE(PAM_SUN_CODEBASE)
287 AC_DEFINE(LOGIN_NEEDS_UTMPX)
288 AC_DEFINE(LOGIN_NEEDS_TERM)
289 AC_DEFINE(PAM_TTY_KLUDGE)
290 AC_DEFINE(LOCKED_PASSWD_STRING, "*LK*")
291 # Pushing STREAMS modules will cause sshd to acquire a controlling tty.
292 AC_DEFINE(SSHD_ACQUIRES_CTTY)
293 external_path_file=/etc/default/login
294 # hardwire lastlog location (can't detect it on some versions)
295 conf_lastlog_location="/var/adm/lastlog"
296 AC_MSG_CHECKING(for obsolete utmp and wtmp in solaris2.x)
297 sol2ver=`echo "$host"| sed -e 's/.*[[0-9]]\.//'`
298 if test "$sol2ver" -ge 8; then
300 AC_DEFINE(DISABLE_UTMP)
301 AC_DEFINE(DISABLE_WTMP)
307 CPPFLAGS="$CPPFLAGS -DSUNOS4"
308 AC_CHECK_FUNCS(getpwanam)
309 AC_DEFINE(PAM_SUN_CODEBASE)
310 conf_utmp_location=/etc/utmp
311 conf_wtmp_location=/var/adm/wtmp
312 conf_lastlog_location=/var/adm/lastlog
318 AC_DEFINE(SSHD_ACQUIRES_CTTY)
319 AC_DEFINE(SETEUID_BREAKS_SETUID)
320 AC_DEFINE(BROKEN_SETREUID)
321 AC_DEFINE(BROKEN_SETREGID)
324 # /usr/ucblib MUST NOT be searched on ReliantUNIX
325 AC_CHECK_LIB(dl, dlsym, ,)
326 IPADDR_IN_DISPLAY=yes
328 AC_DEFINE(IP_TOS_IS_BROKEN)
329 AC_DEFINE(SETEUID_BREAKS_SETUID)
330 AC_DEFINE(BROKEN_SETREUID)
331 AC_DEFINE(BROKEN_SETREGID)
332 AC_DEFINE(SSHD_ACQUIRES_CTTY)
333 external_path_file=/etc/default/login
334 # /usr/ucblib/libucb.a no longer needed on ReliantUNIX
335 # Attention: always take care to bind libsocket and libnsl before libc,
336 # otherwise you will find lots of "SIOCGPGRP errno 22" on syslog
340 AC_DEFINE(SETEUID_BREAKS_SETUID)
341 AC_DEFINE(BROKEN_SETREUID)
342 AC_DEFINE(BROKEN_SETREGID)
346 AC_DEFINE(SETEUID_BREAKS_SETUID)
347 AC_DEFINE(BROKEN_SETREUID)
348 AC_DEFINE(BROKEN_SETREGID)
353 CPPFLAGS="$CPPFLAGS -Dftruncate=chsize"
354 LIBS="$LIBS -los -lprot -lcrypt_i -lx -ltinfo -lm"
357 AC_DEFINE(BROKEN_SYS_TERMIO_H)
359 AC_DEFINE(HAVE_SECUREWARE)
360 AC_DEFINE(DISABLE_SHADOW)
361 AC_DEFINE(BROKEN_SAVED_UIDS)
362 AC_DEFINE(SETEUID_BREAKS_SETUID)
363 AC_DEFINE(BROKEN_SETREUID)
364 AC_DEFINE(BROKEN_SETREGID)
365 AC_DEFINE(WITH_ABBREV_NO_TTY)
366 AC_CHECK_FUNCS(getluid setluid)
368 do_sco3_extra_lib_check=yes
371 if test -z "$GCC"; then
372 CFLAGS="$CFLAGS -belf"
374 LIBS="$LIBS -lprot -lx -ltinfo -lm"
377 AC_DEFINE(HAVE_SECUREWARE)
378 AC_DEFINE(DISABLE_SHADOW)
379 AC_DEFINE(DISABLE_FD_PASSING)
380 AC_DEFINE(SETEUID_BREAKS_SETUID)
381 AC_DEFINE(BROKEN_SETREUID)
382 AC_DEFINE(BROKEN_SETREGID)
383 AC_DEFINE(WITH_ABBREV_NO_TTY)
384 AC_CHECK_FUNCS(getluid setluid)
388 AC_DEFINE(NO_SSH_LASTLOG)
389 AC_DEFINE(SETEUID_BREAKS_SETUID)
390 AC_DEFINE(BROKEN_SETREUID)
391 AC_DEFINE(BROKEN_SETREGID)
393 AC_DEFINE(DISABLE_FD_PASSING)
395 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
399 AC_DEFINE(SETEUID_BREAKS_SETUID)
400 AC_DEFINE(BROKEN_SETREUID)
401 AC_DEFINE(BROKEN_SETREGID)
402 AC_DEFINE(WITH_ABBREV_NO_TTY)
404 AC_DEFINE(DISABLE_FD_PASSING)
406 LIBS="$LIBS -lgen -lacid -ldb"
410 AC_DEFINE(SETEUID_BREAKS_SETUID)
411 AC_DEFINE(BROKEN_SETREUID)
412 AC_DEFINE(BROKEN_SETREGID)
414 AC_DEFINE(DISABLE_FD_PASSING)
415 AC_DEFINE(NO_SSH_LASTLOG)
416 LDFLAGS="$LDFLAGS -Wl,-Dmsglevel=334:fatal"
417 LIBS="$LIBS -lgen -lrsc -lshare -luex -lacm"
421 AC_MSG_CHECKING(for Digital Unix SIA)
424 [ --with-osfsia Enable Digital Unix SIA],
426 if test "x$withval" = "xno" ; then
427 AC_MSG_RESULT(disabled)
432 if test -z "$no_osfsia" ; then
433 if test -f /etc/sia/matrix.conf; then
435 AC_DEFINE(HAVE_OSF_SIA)
436 AC_DEFINE(DISABLE_LOGIN)
437 AC_DEFINE(DISABLE_FD_PASSING)
438 LIBS="$LIBS -lsecurity -ldb -lm -laud"
441 AC_DEFINE(LOCKED_PASSWD_SUBSTR, "Nologin")
444 AC_DEFINE(BROKEN_GETADDRINFO)
445 AC_DEFINE(SETEUID_BREAKS_SETUID)
446 AC_DEFINE(BROKEN_SETREUID)
447 AC_DEFINE(BROKEN_SETREGID)
452 AC_DEFINE(NO_X11_UNIX_SOCKETS)
453 AC_DEFINE(MISSING_NFDBITS)
454 AC_DEFINE(MISSING_HOWMANY)
455 AC_DEFINE(MISSING_FD_MASK)
459 # Allow user to specify flags
461 [ --with-cflags Specify additional flags to pass to compiler],
463 if test "x$withval" != "xno" ; then
464 CFLAGS="$CFLAGS $withval"
468 AC_ARG_WITH(cppflags,
469 [ --with-cppflags Specify additional flags to pass to preprocessor] ,
471 if test "x$withval" != "xno"; then
472 CPPFLAGS="$CPPFLAGS $withval"
477 [ --with-ldflags Specify additional flags to pass to linker],
479 if test "x$withval" != "xno" ; then
480 LDFLAGS="$LDFLAGS $withval"
485 [ --with-libs Specify additional libraries to link with],
487 if test "x$withval" != "xno" ; then
488 LIBS="$LIBS $withval"
493 AC_MSG_CHECKING(compiler and flags for sanity)
498 [ AC_MSG_RESULT(yes) ],
501 AC_MSG_ERROR([*** compiler cannot create working executables, check config.log ***])
505 # Checks for header files.
506 AC_CHECK_HEADERS(bstring.h crypt.h endian.h features.h floatingpoint.h \
507 getopt.h glob.h ia.h lastlog.h limits.h login.h \
508 login_cap.h maillock.h netdb.h netgroup.h \
509 netinet/in_systm.h pam/pam_appl.h paths.h pty.h readpassphrase.h \
510 rpc/types.h security/pam_appl.h shadow.h stddef.h stdint.h \
511 strings.h sys/strtio.h sys/audit.h sys/bitypes.h sys/bsdtty.h \
512 sys/cdefs.h sys/mman.h sys/prctl.h sys/pstat.h sys/ptms.h \
513 sys/select.h sys/stat.h sys/stream.h sys/stropts.h \
514 sys/sysmacros.h sys/time.h sys/timers.h sys/un.h time.h tmpdir.h \
515 ttyent.h usersec.h util.h utime.h utmp.h utmpx.h vis.h)
517 # Checks for libraries.
518 AC_CHECK_FUNC(yp_match, , AC_CHECK_LIB(nsl, yp_match))
519 AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
521 dnl SCO OS3 needs this for libwrap
522 if test "x$with_tcp_wrappers" != "xno" ; then
523 if test "x$do_sco3_extra_lib_check" = "xyes" ; then
524 AC_CHECK_LIB(rpc, innetgr, LIBS="-lrpc -lyp -lrpc $LIBS" , , -lyp -lrpc)
528 dnl IRIX and Solaris 2.5.1 have dirname() in libgen
529 AC_CHECK_FUNCS(dirname, [AC_CHECK_HEADERS(libgen.h)] ,[
530 AC_CHECK_LIB(gen, dirname,[
531 AC_CACHE_CHECK([for broken dirname],
532 ac_cv_have_broken_dirname, [
540 int main(int argc, char **argv) {
543 strncpy(buf,"/etc", 32);
545 if (!s || strncmp(s, "/", 32) != 0) {
552 [ ac_cv_have_broken_dirname="no" ],
553 [ ac_cv_have_broken_dirname="yes" ]
557 if test "x$ac_cv_have_broken_dirname" = "xno" ; then
559 AC_DEFINE(HAVE_DIRNAME)
560 AC_CHECK_HEADERS(libgen.h)
565 AC_CHECK_FUNC(getspnam, ,
566 AC_CHECK_LIB(gen, getspnam, LIBS="$LIBS -lgen"))
567 AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
571 [ --with-zlib=PATH Use zlib in PATH],
573 if test "x$withval" = "xno" ; then
574 AC_MSG_ERROR([*** zlib is required ***])
576 if test -d "$withval/lib"; then
577 if test -n "${need_dash_r}"; then
578 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
580 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
583 if test -n "${need_dash_r}"; then
584 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
586 LDFLAGS="-L${withval} ${LDFLAGS}"
589 if test -d "$withval/include"; then
590 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
592 CPPFLAGS="-I${withval} ${CPPFLAGS}"
597 AC_CHECK_LIB(z, deflate, ,
599 saved_CPPFLAGS="$CPPFLAGS"
600 saved_LDFLAGS="$LDFLAGS"
602 dnl Check default zlib install dir
603 if test -n "${need_dash_r}"; then
604 LDFLAGS="-L/usr/local/lib -R/usr/local/lib ${saved_LDFLAGS}"
606 LDFLAGS="-L/usr/local/lib ${saved_LDFLAGS}"
608 CPPFLAGS="-I/usr/local/include ${saved_CPPFLAGS}"
610 AC_TRY_LINK_FUNC(deflate, AC_DEFINE(HAVE_LIBZ),
612 AC_MSG_ERROR([*** zlib missing - please install first or check config.log ***])
617 AC_CHECK_HEADER([zlib.h], ,AC_MSG_ERROR([*** zlib.h missing - please install first or check config.log ***]))
619 AC_ARG_WITH(zlib-version-check,
620 [ --without-zlib-version-check Disable zlib version check],
621 [ if test "x$withval" = "xno" ; then
622 zlib_check_nonfatal=1
627 AC_MSG_CHECKING(for zlib 1.1.4 or greater)
633 if (sscanf(ZLIB_VERSION, "%d.%d.%d", &a, &b, &c) != 3)
635 v = a*1000000 + b*1000 + c;
643 if test -z "$zlib_check_nonfatal" ; then
644 AC_MSG_ERROR([*** zlib too old - check config.log ***
645 Your reported zlib version has known security problems. It's possible your
646 vendor has fixed these problems without changing the version number. If you
647 are sure this is the case, you can disable the check by running
648 "./configure --without-zlib-version-check".
649 If you are in doubt, upgrade zlib to version 1.1.4 or greater.])
651 AC_MSG_WARN([zlib version may have security problems])
657 AC_CHECK_FUNC(strcasecmp,
658 [], [ AC_CHECK_LIB(resolv, strcasecmp, LIBS="$LIBS -lresolv") ]
660 AC_CHECK_FUNC(utimes,
661 [], [ AC_CHECK_LIB(c89, utimes, [AC_DEFINE(HAVE_UTIMES)
662 LIBS="$LIBS -lc89"]) ]
665 dnl Checks for libutil functions
666 AC_CHECK_HEADERS(libutil.h)
667 AC_SEARCH_LIBS(login, util bsd, [AC_DEFINE(HAVE_LOGIN)])
668 AC_CHECK_FUNCS(logout updwtmp logwtmp)
672 # Check for ALTDIRFUNC glob() extension
673 AC_MSG_CHECKING(for GLOB_ALTDIRFUNC support)
674 AC_EGREP_CPP(FOUNDIT,
677 #ifdef GLOB_ALTDIRFUNC
682 AC_DEFINE(GLOB_HAS_ALTDIRFUNC)
690 # Check for g.gl_matchc glob() extension
691 AC_MSG_CHECKING(for gl_matchc field in glob_t)
692 AC_EGREP_CPP(FOUNDIT,
695 int main(void){glob_t g; g.gl_matchc = 1;}
698 AC_DEFINE(GLOB_HAS_GL_MATCHC)
706 AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
709 #include <sys/types.h>
711 int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
713 [AC_MSG_RESULT(yes)],
716 AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
720 # Check whether user wants S/Key support
723 [ --with-skey[[=PATH]] Enable S/Key support
724 (optionally in PATH)],
726 if test "x$withval" != "xno" ; then
728 if test "x$withval" != "xyes" ; then
729 CPPFLAGS="$CPPFLAGS -I${withval}/include"
730 LDFLAGS="$LDFLAGS -L${withval}/lib"
737 AC_MSG_CHECKING([for s/key support])
742 int main() { char *ff = skey_keyinfo(""); ff=""; exit(0); }
744 [AC_MSG_RESULT(yes)],
747 AC_MSG_ERROR([** Incomplete or missing s/key libraries.])
749 AC_MSG_CHECKING(if skeychallenge takes 4 arguments)
753 [(void)skeychallenge(NULL,"name","",0);],
755 AC_DEFINE(SKEYCHALLENGE_4ARG)],
762 # Check whether user wants TCP wrappers support
764 AC_ARG_WITH(tcp-wrappers,
765 [ --with-tcp-wrappers[[=PATH]] Enable tcpwrappers support
766 (optionally in PATH)],
768 if test "x$withval" != "xno" ; then
770 saved_LDFLAGS="$LDFLAGS"
771 saved_CPPFLAGS="$CPPFLAGS"
772 if test -n "${withval}" -a "${withval}" != "yes"; then
773 if test -d "${withval}/lib"; then
774 if test -n "${need_dash_r}"; then
775 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
777 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
780 if test -n "${need_dash_r}"; then
781 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
783 LDFLAGS="-L${withval} ${LDFLAGS}"
786 if test -d "${withval}/include"; then
787 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
789 CPPFLAGS="-I${withval} ${CPPFLAGS}"
793 LIBS="$LIBWRAP $LIBS"
794 AC_MSG_CHECKING(for libwrap)
797 #include <sys/types.h>
798 #include <sys/socket.h>
799 #include <netinet/in.h>
801 int deny_severity = 0, allow_severity = 0;
811 AC_MSG_ERROR([*** libwrap missing])
819 dnl Checks for library functions. Please keep in alphabetical order
821 arc4random __b64_ntop b64_ntop __b64_pton b64_pton \
822 bcopy bindresvport_sa clock fchmod fchown freeaddrinfo futimes \
823 getaddrinfo getcwd getgrouplist getnameinfo getopt \
824 getpeereid _getpty getrlimit getttyent glob inet_aton \
825 inet_ntoa inet_ntop innetgr login_getcapbool md5_crypt memmove \
826 mkdtemp mmap ngetaddrinfo nsleep ogetaddrinfo openlog_r openpty \
827 pstat prctl readpassphrase realpath recvmsg rresvport_af sendmsg \
828 setdtablesize setegid setenv seteuid setgroups setlogin setpcred \
829 setproctitle setregid setreuid setrlimit \
830 setsid setvbuf sigaction sigvec snprintf socketpair strerror \
831 strlcat strlcpy strmode strnvis strtoul sysconf tcgetpgrp \
832 truncate unsetenv updwtmpx utimes vhangup vsnprintf waitpid \
835 # IRIX has a const char return value for gai_strerror()
836 AC_CHECK_FUNCS(gai_strerror,[
837 AC_DEFINE(HAVE_GAI_STRERROR)
839 #include <sys/types.h>
840 #include <sys/socket.h>
843 const char *gai_strerror(int);],[
846 str = gai_strerror(0);],[
847 AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
848 [Define if gai_strerror() returns const char *])])])
850 AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP))
852 dnl Make sure prototypes are defined for these before using them.
853 AC_CHECK_DECL(strsep, [AC_CHECK_FUNCS(strsep)])
854 AC_CHECK_DECL(getrusage, [AC_CHECK_FUNCS(getrusage)])
856 dnl tcsendbreak might be a macro
857 AC_CHECK_DECL(tcsendbreak,
858 [AC_DEFINE(HAVE_TCSENDBREAK)],
859 [AC_CHECK_FUNCS(tcsendbreak)],
860 [#include <termios.h>]
863 AC_CHECK_DECLS(h_errno, , ,[#include <netdb.h>])
865 AC_CHECK_FUNCS(setresuid, [
866 dnl Some platorms have setresuid that isn't implemented, test for this
867 AC_MSG_CHECKING(if setresuid seems to work)
871 int main(){errno=0; setresuid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
873 [AC_MSG_RESULT(yes)],
874 [AC_DEFINE(BROKEN_SETRESUID)
875 AC_MSG_RESULT(not implemented)]
879 AC_CHECK_FUNCS(setresgid, [
880 dnl Some platorms have setresgid that isn't implemented, test for this
881 AC_MSG_CHECKING(if setresgid seems to work)
885 int main(){errno=0; setresgid(0,0,0); if (errno==ENOSYS) exit(1); else exit(0);}
887 [AC_MSG_RESULT(yes)],
888 [AC_DEFINE(BROKEN_SETRESGID)
889 AC_MSG_RESULT(not implemented)]
893 dnl Checks for time functions
894 AC_CHECK_FUNCS(gettimeofday time)
895 dnl Checks for utmp functions
896 AC_CHECK_FUNCS(endutent getutent getutid getutline pututline setutent)
897 AC_CHECK_FUNCS(utmpname)
898 dnl Checks for utmpx functions
899 AC_CHECK_FUNCS(endutxent getutxent getutxid getutxline pututxline )
900 AC_CHECK_FUNCS(setutxent utmpxname)
902 AC_CHECK_FUNC(daemon,
903 [AC_DEFINE(HAVE_DAEMON)],
904 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
907 AC_CHECK_FUNC(getpagesize,
908 [AC_DEFINE(HAVE_GETPAGESIZE)],
909 [AC_CHECK_LIB(ucb, getpagesize, [LIBS="$LIBS -lucb"; AC_DEFINE(HAVE_GETPAGESIZE)])]
912 # Check for broken snprintf
913 if test "x$ac_cv_func_snprintf" = "xyes" ; then
914 AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
918 int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
920 [AC_MSG_RESULT(yes)],
923 AC_DEFINE(BROKEN_SNPRINTF)
924 AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
929 # Check for missing getpeereid (or equiv) support
931 if test "x$ac_cv_func_getpeereid" != "xyes" ; then
932 AC_MSG_CHECKING([whether system supports SO_PEERCRED getsockopt])
934 [#include <sys/types.h>
935 #include <sys/socket.h>],
936 [int i = SO_PEERCRED;],
937 [AC_MSG_RESULT(yes)],
943 dnl see whether mkstemp() requires XXXXXX
944 if test "x$ac_cv_func_mkdtemp" = "xyes" ; then
945 AC_MSG_CHECKING([for (overly) strict mkstemp])
949 main() { char template[]="conftest.mkstemp-test";
950 if (mkstemp(template) == -1)
952 unlink(template); exit(0);
960 AC_DEFINE(HAVE_STRICT_MKSTEMP)
964 AC_DEFINE(HAVE_STRICT_MKSTEMP)
969 dnl make sure that openpty does not reacquire controlling terminal
970 if test ! -z "$check_for_openpty_ctty_bug"; then
971 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
975 #include <sys/fcntl.h>
976 #include <sys/types.h>
977 #include <sys/wait.h>
983 int fd, ptyfd, ttyfd, status;
986 if (pid < 0) { /* failed */
988 } else if (pid > 0) { /* parent */
989 waitpid(pid, &status, 0);
990 if (WIFEXITED(status))
991 exit(WEXITSTATUS(status));
995 close(0); close(1); close(2);
997 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
998 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
1000 exit(3); /* Acquired ctty: broken */
1002 exit(0); /* Did not acquire ctty: OK */
1011 AC_DEFINE(SSHD_ACQUIRES_CTTY)
1016 if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
1017 AC_MSG_CHECKING(if getaddrinfo seems to work)
1021 #include <sys/socket.h>
1024 #include <netinet/in.h>
1026 #define TEST_PORT "2222"
1032 struct addrinfo *gai_ai, *ai, hints;
1033 char ntop[NI_MAXHOST], strport[NI_MAXSERV], *name = NULL;
1035 memset(&hints, 0, sizeof(hints));
1036 hints.ai_family = PF_UNSPEC;
1037 hints.ai_socktype = SOCK_STREAM;
1038 hints.ai_flags = AI_PASSIVE;
1040 err = getaddrinfo(name, TEST_PORT, &hints, &gai_ai);
1042 fprintf(stderr, "getaddrinfo failed (%s)", gai_strerror(err));
1046 for (ai = gai_ai; ai != NULL; ai = ai->ai_next) {
1047 if (ai->ai_family != AF_INET6)
1050 err = getnameinfo(ai->ai_addr, ai->ai_addrlen, ntop,
1051 sizeof(ntop), strport, sizeof(strport),
1052 NI_NUMERICHOST|NI_NUMERICSERV);
1055 if (err == EAI_SYSTEM)
1056 perror("getnameinfo EAI_SYSTEM");
1058 fprintf(stderr, "getnameinfo failed: %s\n",
1063 sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
1066 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
1079 AC_DEFINE(BROKEN_GETADDRINFO)
1086 # Check for PAM libs
1089 [ --with-pam Enable PAM support ],
1091 if test "x$withval" != "xno" ; then
1092 if test "x$ac_cv_header_security_pam_appl_h" != "xyes" && \
1093 test "x$ac_cv_header_pam_pam_appl_h" != "xyes" ; then
1094 AC_MSG_ERROR([PAM headers not found])
1097 AC_CHECK_LIB(dl, dlopen, , )
1098 AC_CHECK_LIB(pam, pam_set_item, , AC_MSG_ERROR([*** libpam missing]))
1099 AC_CHECK_FUNCS(pam_getenvlist)
1100 AC_CHECK_FUNCS(pam_putenv)
1105 if test $ac_cv_lib_dl_dlopen = yes; then
1115 # Check for older PAM
1116 if test "x$PAM_MSG" = "xyes" ; then
1117 # Check PAM strerror arguments (old PAM)
1118 AC_MSG_CHECKING([whether pam_strerror takes only one argument])
1122 #if defined(HAVE_SECURITY_PAM_APPL_H)
1123 #include <security/pam_appl.h>
1124 #elif defined (HAVE_PAM_PAM_APPL_H)
1125 #include <pam/pam_appl.h>
1128 [(void)pam_strerror((pam_handle_t *)NULL, -1);],
1129 [AC_MSG_RESULT(no)],
1131 AC_DEFINE(HAVE_OLD_PAM)
1133 PAM_MSG="yes (old library)"
1138 # Search for OpenSSL
1139 saved_CPPFLAGS="$CPPFLAGS"
1140 saved_LDFLAGS="$LDFLAGS"
1141 AC_ARG_WITH(ssl-dir,
1142 [ --with-ssl-dir=PATH Specify path to OpenSSL installation ],
1144 if test "x$withval" != "xno" ; then
1145 if test -d "$withval/lib"; then
1146 if test -n "${need_dash_r}"; then
1147 LDFLAGS="-L${withval}/lib -R${withval}/lib ${LDFLAGS}"
1149 LDFLAGS="-L${withval}/lib ${LDFLAGS}"
1152 if test -n "${need_dash_r}"; then
1153 LDFLAGS="-L${withval} -R${withval} ${LDFLAGS}"
1155 LDFLAGS="-L${withval} ${LDFLAGS}"
1158 if test -d "$withval/include"; then
1159 CPPFLAGS="-I${withval}/include ${CPPFLAGS}"
1161 CPPFLAGS="-I${withval} ${CPPFLAGS}"
1166 LIBS="-lcrypto $LIBS"
1167 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1169 dnl Check default openssl install dir
1170 if test -n "${need_dash_r}"; then
1171 LDFLAGS="-L/usr/local/ssl/lib -R/usr/local/ssl/lib ${saved_LDFLAGS}"
1173 LDFLAGS="-L/usr/local/ssl/lib ${saved_LDFLAGS}"
1175 CPPFLAGS="-I/usr/local/ssl/include ${saved_CPPFLAGS}"
1176 AC_TRY_LINK_FUNC(RAND_add, AC_DEFINE(HAVE_OPENSSL),
1178 AC_MSG_ERROR([*** Can't find recent OpenSSL libcrypto (see config.log for details) ***])
1184 # Determine OpenSSL header version
1185 AC_MSG_CHECKING([OpenSSL header version])
1190 #include <openssl/opensslv.h>
1191 #define DATA "conftest.sslincver"
1196 fd = fopen(DATA,"w");
1200 if ((rc = fprintf(fd ,"%x (%s)\n", OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_TEXT)) <0)
1207 ssl_header_ver=`cat conftest.sslincver`
1208 AC_MSG_RESULT($ssl_header_ver)
1211 AC_MSG_RESULT(not found)
1212 AC_MSG_ERROR(OpenSSL version header not found.)
1216 # Determine OpenSSL library version
1217 AC_MSG_CHECKING([OpenSSL library version])
1222 #include <openssl/opensslv.h>
1223 #include <openssl/crypto.h>
1224 #define DATA "conftest.ssllibver"
1229 fd = fopen(DATA,"w");
1233 if ((rc = fprintf(fd ,"%x (%s)\n", SSLeay(), SSLeay_version(SSLEAY_VERSION))) <0)
1240 ssl_library_ver=`cat conftest.ssllibver`
1241 AC_MSG_RESULT($ssl_library_ver)
1244 AC_MSG_RESULT(not found)
1245 AC_MSG_ERROR(OpenSSL library not found.)
1249 # Sanity check OpenSSL headers
1250 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
1254 #include <openssl/opensslv.h>
1255 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
1262 AC_MSG_ERROR([Your OpenSSL headers do not match your library.
1263 Check config.log for details.
1264 Also see contrib/findssl.sh for help identifying header/library mismatches.])
1268 # Some systems want crypt() from libcrypt, *not* the version in OpenSSL,
1269 # because the system crypt() is more featureful.
1270 if test "x$check_for_libcrypt_before" = "x1"; then
1271 AC_CHECK_LIB(crypt, crypt)
1274 # Some Linux systems (Slackware) need crypt() from libcrypt, *not* the
1275 # version in OpenSSL.
1276 if test "x$check_for_libcrypt_later" = "x1"; then
1277 AC_CHECK_LIB(crypt, crypt, LIBS="$LIBS -lcrypt")
1281 ### Configure cryptographic random number support
1283 # Check wheter OpenSSL seeds itself
1284 AC_MSG_CHECKING([whether OpenSSL's PRNG is internally seeded])
1288 #include <openssl/rand.h>
1289 int main(void) { exit(RAND_status() == 1 ? 0 : 1); }
1292 OPENSSL_SEEDS_ITSELF=yes
1297 # Default to use of the rand helper if OpenSSL doesn't
1304 # Do we want to force the use of the rand helper?
1305 AC_ARG_WITH(rand-helper,
1306 [ --with-rand-helper Use subprocess to gather strong randomness ],
1308 if test "x$withval" = "xno" ; then
1309 # Force use of OpenSSL's internal RNG, even if
1310 # the previous test showed it to be unseeded.
1311 if test -z "$OPENSSL_SEEDS_ITSELF" ; then
1312 AC_MSG_WARN([*** Forcing use of OpenSSL's non-self-seeding PRNG])
1313 OPENSSL_SEEDS_ITSELF=yes
1322 # Which randomness source do we use?
1323 if test ! -z "$OPENSSL_SEEDS_ITSELF" -a -z "$USE_RAND_HELPER" ; then
1325 AC_DEFINE(OPENSSL_PRNG_ONLY)
1326 RAND_MSG="OpenSSL internal ONLY"
1327 INSTALL_SSH_RAND_HELPER=""
1328 elif test ! -z "$USE_RAND_HELPER" ; then
1329 # install rand helper
1330 RAND_MSG="ssh-rand-helper"
1331 INSTALL_SSH_RAND_HELPER="yes"
1333 AC_SUBST(INSTALL_SSH_RAND_HELPER)
1335 ### Configuration of ssh-rand-helper
1338 AC_ARG_WITH(prngd-port,
1339 [ --with-prngd-port=PORT read entropy from PRNGD/EGD TCP localhost:PORT],
1348 AC_MSG_ERROR(You must specify a numeric port number for --with-prngd-port)
1351 if test ! -z "$withval" ; then
1352 PRNGD_PORT="$withval"
1353 AC_DEFINE_UNQUOTED(PRNGD_PORT, $PRNGD_PORT)
1358 # PRNGD Unix domain socket
1359 AC_ARG_WITH(prngd-socket,
1360 [ --with-prngd-socket=FILE read entropy from PRNGD/EGD socket FILE (default=/var/run/egd-pool)],
1364 withval="/var/run/egd-pool"
1372 AC_MSG_ERROR(You must specify an absolute path to the entropy socket)
1376 if test ! -z "$withval" ; then
1377 if test ! -z "$PRNGD_PORT" ; then
1378 AC_MSG_ERROR(You may not specify both a PRNGD/EGD port and socket)
1380 if test ! -r "$withval" ; then
1381 AC_MSG_WARN(Entropy socket is not readable)
1383 PRNGD_SOCKET="$withval"
1384 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1388 # Check for existing socket only if we don't have a random device already
1389 if test "$USE_RAND_HELPER" = yes ; then
1390 AC_MSG_CHECKING(for PRNGD/EGD socket)
1391 # Insert other locations here
1392 for sock in /var/run/egd-pool /dev/egd-pool /etc/entropy; do
1393 if test -r $sock && $TEST_MINUS_S_SH -c "test -S $sock -o -p $sock" ; then
1394 PRNGD_SOCKET="$sock"
1395 AC_DEFINE_UNQUOTED(PRNGD_SOCKET, "$PRNGD_SOCKET")
1399 if test ! -z "$PRNGD_SOCKET" ; then
1400 AC_MSG_RESULT($PRNGD_SOCKET)
1402 AC_MSG_RESULT(not found)
1408 # Change default command timeout for hashing entropy source
1410 AC_ARG_WITH(entropy-timeout,
1411 [ --with-entropy-timeout Specify entropy gathering command timeout (msec)],
1413 if test "x$withval" != "xno" ; then
1414 entropy_timeout=$withval
1418 AC_DEFINE_UNQUOTED(ENTROPY_TIMEOUT_MSEC, $entropy_timeout)
1420 SSH_PRIVSEP_USER=sshd
1421 AC_ARG_WITH(privsep-user,
1422 [ --with-privsep-user=user Specify non-privileged user for privilege separation],
1424 if test -n "$withval"; then
1425 SSH_PRIVSEP_USER=$withval
1429 AC_DEFINE_UNQUOTED(SSH_PRIVSEP_USER, "$SSH_PRIVSEP_USER")
1430 AC_SUBST(SSH_PRIVSEP_USER)
1432 # We do this little dance with the search path to insure
1433 # that programs that we select for use by installed programs
1434 # (which may be run by the super-user) come from trusted
1435 # locations before they come from the user's private area.
1436 # This should help avoid accidentally configuring some
1437 # random version of a program in someone's personal bin.
1441 test -h /bin 2> /dev/null && PATH=/usr/bin
1442 test -d /sbin && PATH=$PATH:/sbin
1443 test -d /usr/sbin && PATH=$PATH:/usr/sbin
1444 PATH=$PATH:/etc:$OPATH
1446 # These programs are used by the command hashing source to gather entropy
1447 OSSH_PATH_ENTROPY_PROG(PROG_LS, ls)
1448 OSSH_PATH_ENTROPY_PROG(PROG_NETSTAT, netstat)
1449 OSSH_PATH_ENTROPY_PROG(PROG_ARP, arp)
1450 OSSH_PATH_ENTROPY_PROG(PROG_IFCONFIG, ifconfig)
1451 OSSH_PATH_ENTROPY_PROG(PROG_JSTAT, jstat)
1452 OSSH_PATH_ENTROPY_PROG(PROG_PS, ps)
1453 OSSH_PATH_ENTROPY_PROG(PROG_SAR, sar)
1454 OSSH_PATH_ENTROPY_PROG(PROG_W, w)
1455 OSSH_PATH_ENTROPY_PROG(PROG_WHO, who)
1456 OSSH_PATH_ENTROPY_PROG(PROG_LAST, last)
1457 OSSH_PATH_ENTROPY_PROG(PROG_LASTLOG, lastlog)
1458 OSSH_PATH_ENTROPY_PROG(PROG_DF, df)
1459 OSSH_PATH_ENTROPY_PROG(PROG_VMSTAT, vmstat)
1460 OSSH_PATH_ENTROPY_PROG(PROG_UPTIME, uptime)
1461 OSSH_PATH_ENTROPY_PROG(PROG_IPCS, ipcs)
1462 OSSH_PATH_ENTROPY_PROG(PROG_TAIL, tail)
1466 # Where does ssh-rand-helper get its randomness from?
1467 INSTALL_SSH_PRNG_CMDS=""
1468 if test ! -z "$INSTALL_SSH_RAND_HELPER" ; then
1469 if test ! -z "$PRNGD_PORT" ; then
1470 RAND_HELPER_MSG="TCP localhost:$PRNGD_PORT"
1471 elif test ! -z "$PRNGD_SOCKET" ; then
1472 RAND_HELPER_MSG="Unix domain socket \"$PRNGD_SOCKET\""
1474 RAND_HELPER_MSG="Command hashing (timeout $entropy_timeout)"
1475 RAND_HELPER_CMDHASH=yes
1476 INSTALL_SSH_PRNG_CMDS="yes"
1479 AC_SUBST(INSTALL_SSH_PRNG_CMDS)
1482 # Cheap hack to ensure NEWS-OS libraries are arranged right.
1483 if test ! -z "$SONY" ; then
1484 LIBS="$LIBS -liberty";
1487 # Checks for data types
1488 AC_CHECK_SIZEOF(char, 1)
1489 AC_CHECK_SIZEOF(short int, 2)
1490 AC_CHECK_SIZEOF(int, 4)
1491 AC_CHECK_SIZEOF(long int, 4)
1492 AC_CHECK_SIZEOF(long long int, 8)
1494 # Sanity check long long for some platforms (AIX)
1495 if test "x$ac_cv_sizeof_long_long_int" = "x4" ; then
1496 ac_cv_sizeof_long_long_int=0
1499 # More checks for data types
1500 AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
1502 [ #include <sys/types.h> ],
1504 [ ac_cv_have_u_int="yes" ],
1505 [ ac_cv_have_u_int="no" ]
1508 if test "x$ac_cv_have_u_int" = "xyes" ; then
1509 AC_DEFINE(HAVE_U_INT)
1513 AC_CACHE_CHECK([for intXX_t types], ac_cv_have_intxx_t, [
1515 [ #include <sys/types.h> ],
1516 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1517 [ ac_cv_have_intxx_t="yes" ],
1518 [ ac_cv_have_intxx_t="no" ]
1521 if test "x$ac_cv_have_intxx_t" = "xyes" ; then
1522 AC_DEFINE(HAVE_INTXX_T)
1526 if (test -z "$have_intxx_t" && \
1527 test "x$ac_cv_header_stdint_h" = "xyes")
1529 AC_MSG_CHECKING([for intXX_t types in stdint.h])
1531 [ #include <stdint.h> ],
1532 [ int8_t a; int16_t b; int32_t c; a = b = c = 1;],
1534 AC_DEFINE(HAVE_INTXX_T)
1537 [ AC_MSG_RESULT(no) ]
1541 AC_CACHE_CHECK([for int64_t type], ac_cv_have_int64_t, [
1544 #include <sys/types.h>
1545 #ifdef HAVE_STDINT_H
1546 # include <stdint.h>
1548 #include <sys/socket.h>
1549 #ifdef HAVE_SYS_BITYPES_H
1550 # include <sys/bitypes.h>
1553 [ int64_t a; a = 1;],
1554 [ ac_cv_have_int64_t="yes" ],
1555 [ ac_cv_have_int64_t="no" ]
1558 if test "x$ac_cv_have_int64_t" = "xyes" ; then
1559 AC_DEFINE(HAVE_INT64_T)
1562 AC_CACHE_CHECK([for u_intXX_t types], ac_cv_have_u_intxx_t, [
1564 [ #include <sys/types.h> ],
1565 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1566 [ ac_cv_have_u_intxx_t="yes" ],
1567 [ ac_cv_have_u_intxx_t="no" ]
1570 if test "x$ac_cv_have_u_intxx_t" = "xyes" ; then
1571 AC_DEFINE(HAVE_U_INTXX_T)
1575 if test -z "$have_u_intxx_t" ; then
1576 AC_MSG_CHECKING([for u_intXX_t types in sys/socket.h])
1578 [ #include <sys/socket.h> ],
1579 [ u_int8_t a; u_int16_t b; u_int32_t c; a = b = c = 1;],
1581 AC_DEFINE(HAVE_U_INTXX_T)
1584 [ AC_MSG_RESULT(no) ]
1588 AC_CACHE_CHECK([for u_int64_t types], ac_cv_have_u_int64_t, [
1590 [ #include <sys/types.h> ],
1591 [ u_int64_t a; a = 1;],
1592 [ ac_cv_have_u_int64_t="yes" ],
1593 [ ac_cv_have_u_int64_t="no" ]
1596 if test "x$ac_cv_have_u_int64_t" = "xyes" ; then
1597 AC_DEFINE(HAVE_U_INT64_T)
1601 if test -z "$have_u_int64_t" ; then
1602 AC_MSG_CHECKING([for u_int64_t type in sys/bitypes.h])
1604 [ #include <sys/bitypes.h> ],
1605 [ u_int64_t a; a = 1],
1607 AC_DEFINE(HAVE_U_INT64_T)
1610 [ AC_MSG_RESULT(no) ]
1614 if test -z "$have_u_intxx_t" ; then
1615 AC_CACHE_CHECK([for uintXX_t types], ac_cv_have_uintxx_t, [
1618 #include <sys/types.h>
1620 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1; ],
1621 [ ac_cv_have_uintxx_t="yes" ],
1622 [ ac_cv_have_uintxx_t="no" ]
1625 if test "x$ac_cv_have_uintxx_t" = "xyes" ; then
1626 AC_DEFINE(HAVE_UINTXX_T)
1630 if test -z "$have_uintxx_t" ; then
1631 AC_MSG_CHECKING([for uintXX_t types in stdint.h])
1633 [ #include <stdint.h> ],
1634 [ uint8_t a; uint16_t b; uint32_t c; a = b = c = 1;],
1636 AC_DEFINE(HAVE_UINTXX_T)
1639 [ AC_MSG_RESULT(no) ]
1643 if (test -z "$have_u_intxx_t" || test -z "$have_intxx_t" && \
1644 test "x$ac_cv_header_sys_bitypes_h" = "xyes")
1646 AC_MSG_CHECKING([for intXX_t and u_intXX_t types in sys/bitypes.h])
1649 #include <sys/bitypes.h>
1652 int8_t a; int16_t b; int32_t c;
1653 u_int8_t e; u_int16_t f; u_int32_t g;
1654 a = b = c = e = f = g = 1;
1657 AC_DEFINE(HAVE_U_INTXX_T)
1658 AC_DEFINE(HAVE_INTXX_T)
1666 AC_CACHE_CHECK([for u_char], ac_cv_have_u_char, [
1669 #include <sys/types.h>
1671 [ u_char foo; foo = 125; ],
1672 [ ac_cv_have_u_char="yes" ],
1673 [ ac_cv_have_u_char="no" ]
1676 if test "x$ac_cv_have_u_char" = "xyes" ; then
1677 AC_DEFINE(HAVE_U_CHAR)
1682 AC_CHECK_TYPES(sig_atomic_t,,,[#include <signal.h>])
1684 AC_CACHE_CHECK([for size_t], ac_cv_have_size_t, [
1687 #include <sys/types.h>
1689 [ size_t foo; foo = 1235; ],
1690 [ ac_cv_have_size_t="yes" ],
1691 [ ac_cv_have_size_t="no" ]
1694 if test "x$ac_cv_have_size_t" = "xyes" ; then
1695 AC_DEFINE(HAVE_SIZE_T)
1698 AC_CACHE_CHECK([for ssize_t], ac_cv_have_ssize_t, [
1701 #include <sys/types.h>
1703 [ ssize_t foo; foo = 1235; ],
1704 [ ac_cv_have_ssize_t="yes" ],
1705 [ ac_cv_have_ssize_t="no" ]
1708 if test "x$ac_cv_have_ssize_t" = "xyes" ; then
1709 AC_DEFINE(HAVE_SSIZE_T)
1712 AC_CACHE_CHECK([for clock_t], ac_cv_have_clock_t, [
1717 [ clock_t foo; foo = 1235; ],
1718 [ ac_cv_have_clock_t="yes" ],
1719 [ ac_cv_have_clock_t="no" ]
1722 if test "x$ac_cv_have_clock_t" = "xyes" ; then
1723 AC_DEFINE(HAVE_CLOCK_T)
1726 AC_CACHE_CHECK([for sa_family_t], ac_cv_have_sa_family_t, [
1729 #include <sys/types.h>
1730 #include <sys/socket.h>
1732 [ sa_family_t foo; foo = 1235; ],
1733 [ ac_cv_have_sa_family_t="yes" ],
1736 #include <sys/types.h>
1737 #include <sys/socket.h>
1738 #include <netinet/in.h>
1740 [ sa_family_t foo; foo = 1235; ],
1741 [ ac_cv_have_sa_family_t="yes" ],
1743 [ ac_cv_have_sa_family_t="no" ]
1747 if test "x$ac_cv_have_sa_family_t" = "xyes" ; then
1748 AC_DEFINE(HAVE_SA_FAMILY_T)
1751 AC_CACHE_CHECK([for pid_t], ac_cv_have_pid_t, [
1754 #include <sys/types.h>
1756 [ pid_t foo; foo = 1235; ],
1757 [ ac_cv_have_pid_t="yes" ],
1758 [ ac_cv_have_pid_t="no" ]
1761 if test "x$ac_cv_have_pid_t" = "xyes" ; then
1762 AC_DEFINE(HAVE_PID_T)
1765 AC_CACHE_CHECK([for mode_t], ac_cv_have_mode_t, [
1768 #include <sys/types.h>
1770 [ mode_t foo; foo = 1235; ],
1771 [ ac_cv_have_mode_t="yes" ],
1772 [ ac_cv_have_mode_t="no" ]
1775 if test "x$ac_cv_have_mode_t" = "xyes" ; then
1776 AC_DEFINE(HAVE_MODE_T)
1780 AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
1783 #include <sys/types.h>
1784 #include <sys/socket.h>
1786 [ struct sockaddr_storage s; ],
1787 [ ac_cv_have_struct_sockaddr_storage="yes" ],
1788 [ ac_cv_have_struct_sockaddr_storage="no" ]
1791 if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
1792 AC_DEFINE(HAVE_STRUCT_SOCKADDR_STORAGE)
1795 AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
1798 #include <sys/types.h>
1799 #include <netinet/in.h>
1801 [ struct sockaddr_in6 s; s.sin6_family = 0; ],
1802 [ ac_cv_have_struct_sockaddr_in6="yes" ],
1803 [ ac_cv_have_struct_sockaddr_in6="no" ]
1806 if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
1807 AC_DEFINE(HAVE_STRUCT_SOCKADDR_IN6)
1810 AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
1813 #include <sys/types.h>
1814 #include <netinet/in.h>
1816 [ struct in6_addr s; s.s6_addr[0] = 0; ],
1817 [ ac_cv_have_struct_in6_addr="yes" ],
1818 [ ac_cv_have_struct_in6_addr="no" ]
1821 if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
1822 AC_DEFINE(HAVE_STRUCT_IN6_ADDR)
1825 AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
1828 #include <sys/types.h>
1829 #include <sys/socket.h>
1832 [ struct addrinfo s; s.ai_flags = AI_PASSIVE; ],
1833 [ ac_cv_have_struct_addrinfo="yes" ],
1834 [ ac_cv_have_struct_addrinfo="no" ]
1837 if test "x$ac_cv_have_struct_addrinfo" = "xyes" ; then
1838 AC_DEFINE(HAVE_STRUCT_ADDRINFO)
1841 AC_CACHE_CHECK([for struct timeval], ac_cv_have_struct_timeval, [
1843 [ #include <sys/time.h> ],
1844 [ struct timeval tv; tv.tv_sec = 1;],
1845 [ ac_cv_have_struct_timeval="yes" ],
1846 [ ac_cv_have_struct_timeval="no" ]
1849 if test "x$ac_cv_have_struct_timeval" = "xyes" ; then
1850 AC_DEFINE(HAVE_STRUCT_TIMEVAL)
1851 have_struct_timeval=1
1854 AC_CHECK_TYPES(struct timespec)
1856 # We need int64_t or else certian parts of the compile will fail.
1857 if test "x$ac_cv_have_int64_t" = "xno" -a \
1858 "x$ac_cv_sizeof_long_int" != "x8" -a \
1859 "x$ac_cv_sizeof_long_long_int" = "x0" ; then
1860 echo "OpenSSH requires int64_t support. Contact your vendor or install"
1861 echo "an alternative compiler (I.E., GCC) before continuing."
1865 dnl test snprintf (broken on SCO w/gcc)
1870 #ifdef HAVE_SNPRINTF
1874 char expected_out[50];
1876 #if (SIZEOF_LONG_INT == 8)
1877 long int num = 0x7fffffffffffffff;
1879 long long num = 0x7fffffffffffffffll;
1881 strcpy(expected_out, "9223372036854775807");
1882 snprintf(buf, mazsize, "%lld", num);
1883 if(strcmp(buf, expected_out) != 0)
1890 ], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ]
1894 dnl Checks for structure members
1895 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmp.h, HAVE_HOST_IN_UTMP)
1896 OSSH_CHECK_HEADER_FOR_FIELD(ut_host, utmpx.h, HAVE_HOST_IN_UTMPX)
1897 OSSH_CHECK_HEADER_FOR_FIELD(syslen, utmpx.h, HAVE_SYSLEN_IN_UTMPX)
1898 OSSH_CHECK_HEADER_FOR_FIELD(ut_pid, utmp.h, HAVE_PID_IN_UTMP)
1899 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmp.h, HAVE_TYPE_IN_UTMP)
1900 OSSH_CHECK_HEADER_FOR_FIELD(ut_type, utmpx.h, HAVE_TYPE_IN_UTMPX)
1901 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmp.h, HAVE_TV_IN_UTMP)
1902 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmp.h, HAVE_ID_IN_UTMP)
1903 OSSH_CHECK_HEADER_FOR_FIELD(ut_id, utmpx.h, HAVE_ID_IN_UTMPX)
1904 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmp.h, HAVE_ADDR_IN_UTMP)
1905 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr, utmpx.h, HAVE_ADDR_IN_UTMPX)
1906 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmp.h, HAVE_ADDR_V6_IN_UTMP)
1907 OSSH_CHECK_HEADER_FOR_FIELD(ut_addr_v6, utmpx.h, HAVE_ADDR_V6_IN_UTMPX)
1908 OSSH_CHECK_HEADER_FOR_FIELD(ut_exit, utmp.h, HAVE_EXIT_IN_UTMP)
1909 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmp.h, HAVE_TIME_IN_UTMP)
1910 OSSH_CHECK_HEADER_FOR_FIELD(ut_time, utmpx.h, HAVE_TIME_IN_UTMPX)
1911 OSSH_CHECK_HEADER_FOR_FIELD(ut_tv, utmpx.h, HAVE_TV_IN_UTMPX)
1913 AC_CHECK_MEMBERS([struct stat.st_blksize])
1915 AC_CACHE_CHECK([for ss_family field in struct sockaddr_storage],
1916 ac_cv_have_ss_family_in_struct_ss, [
1919 #include <sys/types.h>
1920 #include <sys/socket.h>
1922 [ struct sockaddr_storage s; s.ss_family = 1; ],
1923 [ ac_cv_have_ss_family_in_struct_ss="yes" ],
1924 [ ac_cv_have_ss_family_in_struct_ss="no" ],
1927 if test "x$ac_cv_have_ss_family_in_struct_ss" = "xyes" ; then
1928 AC_DEFINE(HAVE_SS_FAMILY_IN_SS)
1931 AC_CACHE_CHECK([for __ss_family field in struct sockaddr_storage],
1932 ac_cv_have___ss_family_in_struct_ss, [
1935 #include <sys/types.h>
1936 #include <sys/socket.h>
1938 [ struct sockaddr_storage s; s.__ss_family = 1; ],
1939 [ ac_cv_have___ss_family_in_struct_ss="yes" ],
1940 [ ac_cv_have___ss_family_in_struct_ss="no" ]
1943 if test "x$ac_cv_have___ss_family_in_struct_ss" = "xyes" ; then
1944 AC_DEFINE(HAVE___SS_FAMILY_IN_SS)
1947 AC_CACHE_CHECK([for pw_class field in struct passwd],
1948 ac_cv_have_pw_class_in_struct_passwd, [
1953 [ struct passwd p; p.pw_class = 0; ],
1954 [ ac_cv_have_pw_class_in_struct_passwd="yes" ],
1955 [ ac_cv_have_pw_class_in_struct_passwd="no" ]
1958 if test "x$ac_cv_have_pw_class_in_struct_passwd" = "xyes" ; then
1959 AC_DEFINE(HAVE_PW_CLASS_IN_PASSWD)
1962 AC_CACHE_CHECK([for pw_expire field in struct passwd],
1963 ac_cv_have_pw_expire_in_struct_passwd, [
1968 [ struct passwd p; p.pw_expire = 0; ],
1969 [ ac_cv_have_pw_expire_in_struct_passwd="yes" ],
1970 [ ac_cv_have_pw_expire_in_struct_passwd="no" ]
1973 if test "x$ac_cv_have_pw_expire_in_struct_passwd" = "xyes" ; then
1974 AC_DEFINE(HAVE_PW_EXPIRE_IN_PASSWD)
1977 AC_CACHE_CHECK([for pw_change field in struct passwd],
1978 ac_cv_have_pw_change_in_struct_passwd, [
1983 [ struct passwd p; p.pw_change = 0; ],
1984 [ ac_cv_have_pw_change_in_struct_passwd="yes" ],
1985 [ ac_cv_have_pw_change_in_struct_passwd="no" ]
1988 if test "x$ac_cv_have_pw_change_in_struct_passwd" = "xyes" ; then
1989 AC_DEFINE(HAVE_PW_CHANGE_IN_PASSWD)
1992 dnl make sure we're using the real structure members and not defines
1993 AC_CACHE_CHECK([for msg_accrights field in struct msghdr],
1994 ac_cv_have_accrights_in_msghdr, [
1997 #include <sys/types.h>
1998 #include <sys/socket.h>
1999 #include <sys/uio.h>
2001 #ifdef msg_accrights
2005 m.msg_accrights = 0;
2009 [ ac_cv_have_accrights_in_msghdr="yes" ],
2010 [ ac_cv_have_accrights_in_msghdr="no" ]
2013 if test "x$ac_cv_have_accrights_in_msghdr" = "xyes" ; then
2014 AC_DEFINE(HAVE_ACCRIGHTS_IN_MSGHDR)
2017 AC_CACHE_CHECK([for msg_control field in struct msghdr],
2018 ac_cv_have_control_in_msghdr, [
2021 #include <sys/types.h>
2022 #include <sys/socket.h>
2023 #include <sys/uio.h>
2033 [ ac_cv_have_control_in_msghdr="yes" ],
2034 [ ac_cv_have_control_in_msghdr="no" ]
2037 if test "x$ac_cv_have_control_in_msghdr" = "xyes" ; then
2038 AC_DEFINE(HAVE_CONTROL_IN_MSGHDR)
2041 AC_CACHE_CHECK([if libc defines __progname], ac_cv_libc_defines___progname, [
2043 [ extern char *__progname; printf("%s", __progname); ],
2044 [ ac_cv_libc_defines___progname="yes" ],
2045 [ ac_cv_libc_defines___progname="no" ]
2048 if test "x$ac_cv_libc_defines___progname" = "xyes" ; then
2049 AC_DEFINE(HAVE___PROGNAME)
2052 AC_CACHE_CHECK([whether $CC implements __FUNCTION__], ac_cv_cc_implements___FUNCTION__, [
2056 [ printf("%s", __FUNCTION__); ],
2057 [ ac_cv_cc_implements___FUNCTION__="yes" ],
2058 [ ac_cv_cc_implements___FUNCTION__="no" ]
2061 if test "x$ac_cv_cc_implements___FUNCTION__" = "xyes" ; then
2062 AC_DEFINE(HAVE___FUNCTION__)
2065 AC_CACHE_CHECK([whether $CC implements __func__], ac_cv_cc_implements___func__, [
2069 [ printf("%s", __func__); ],
2070 [ ac_cv_cc_implements___func__="yes" ],
2071 [ ac_cv_cc_implements___func__="no" ]
2074 if test "x$ac_cv_cc_implements___func__" = "xyes" ; then
2075 AC_DEFINE(HAVE___func__)
2078 AC_CACHE_CHECK([whether getopt has optreset support],
2079 ac_cv_have_getopt_optreset, [
2084 [ extern int optreset; optreset = 0; ],
2085 [ ac_cv_have_getopt_optreset="yes" ],
2086 [ ac_cv_have_getopt_optreset="no" ]
2089 if test "x$ac_cv_have_getopt_optreset" = "xyes" ; then
2090 AC_DEFINE(HAVE_GETOPT_OPTRESET)
2093 AC_CACHE_CHECK([if libc defines sys_errlist], ac_cv_libc_defines_sys_errlist, [
2095 [ extern const char *const sys_errlist[]; printf("%s", sys_errlist[0]);],
2096 [ ac_cv_libc_defines_sys_errlist="yes" ],
2097 [ ac_cv_libc_defines_sys_errlist="no" ]
2100 if test "x$ac_cv_libc_defines_sys_errlist" = "xyes" ; then
2101 AC_DEFINE(HAVE_SYS_ERRLIST)
2105 AC_CACHE_CHECK([if libc defines sys_nerr], ac_cv_libc_defines_sys_nerr, [
2107 [ extern int sys_nerr; printf("%i", sys_nerr);],
2108 [ ac_cv_libc_defines_sys_nerr="yes" ],
2109 [ ac_cv_libc_defines_sys_nerr="no" ]
2112 if test "x$ac_cv_libc_defines_sys_nerr" = "xyes" ; then
2113 AC_DEFINE(HAVE_SYS_NERR)
2117 # Check whether user wants sectok support
2119 [ --with-sectok Enable smartcard support using libsectok],
2121 if test "x$withval" != "xno" ; then
2122 if test "x$withval" != "xyes" ; then
2123 CPPFLAGS="$CPPFLAGS -I${withval}"
2124 LDFLAGS="$LDFLAGS -L${withval}"
2125 if test ! -z "$need_dash_r" ; then
2126 LDFLAGS="$LDFLAGS -R${withval}"
2128 if test ! -z "$blibpath" ; then
2129 blibpath="$blibpath:${withval}"
2132 AC_CHECK_HEADERS(sectok.h)
2133 if test "$ac_cv_header_sectok_h" != yes; then
2134 AC_MSG_ERROR(Can't find sectok.h)
2136 AC_CHECK_LIB(sectok, sectok_open)
2137 if test "$ac_cv_lib_sectok_sectok_open" != yes; then
2138 AC_MSG_ERROR(Can't find libsectok)
2140 AC_DEFINE(SMARTCARD)
2141 AC_DEFINE(USE_SECTOK)
2142 SCARD_MSG="yes, using sectok"
2147 # Check whether user wants OpenSC support
2149 AC_HELP_STRING([--with-opensc=PFX],
2150 [Enable smartcard support using OpenSC]),
2151 opensc_config_prefix="$withval", opensc_config_prefix="")
2152 if test x$opensc_config_prefix != x ; then
2153 OPENSC_CONFIG=$opensc_config_prefix/bin/opensc-config
2154 AC_PATH_PROG(OPENSC_CONFIG, opensc-config, no)
2155 if test "$OPENSC_CONFIG" != "no"; then
2156 LIBOPENSC_CFLAGS=`$OPENSC_CONFIG --cflags`
2157 LIBOPENSC_LIBS=`$OPENSC_CONFIG --libs`
2158 CPPFLAGS="$CPPFLAGS $LIBOPENSC_CFLAGS"
2159 LDFLAGS="$LDFLAGS $LIBOPENSC_LIBS"
2160 AC_DEFINE(SMARTCARD)
2161 AC_DEFINE(USE_OPENSC)
2162 SCARD_MSG="yes, using OpenSC"
2166 # Check libraries needed by DNS fingerprint support
2167 AC_SEARCH_LIBS(getrrsetbyname, resolv,
2168 [AC_DEFINE(HAVE_GETRRSETBYNAME)],
2170 # Needed by our getrrsetbyname()
2171 AC_SEARCH_LIBS(res_query, resolv)
2172 AC_SEARCH_LIBS(dn_expand, resolv)
2173 AC_MSG_CHECKING(if res_query will link)
2174 AC_TRY_LINK_FUNC(res_query, AC_MSG_RESULT(yes),
2177 LIBS="$LIBS -lresolv"
2178 AC_MSG_CHECKING(for res_query in -lresolv)
2183 res_query (0, 0, 0, 0, 0);
2187 [LIBS="$LIBS -lresolv"
2188 AC_MSG_RESULT(yes)],
2192 AC_CHECK_FUNCS(_getshort _getlong)
2193 AC_CHECK_MEMBER(HEADER.ad,
2194 [AC_DEFINE(HAVE_HEADER_AD)],,
2195 [#include <arpa/nameser.h>])
2198 # Check whether user wants Kerberos 5 support
2200 AC_ARG_WITH(kerberos5,
2201 [ --with-kerberos5=PATH Enable Kerberos 5 support],
2202 [ if test "x$withval" != "xno" ; then
2203 if test "x$withval" = "xyes" ; then
2204 KRB5ROOT="/usr/local"
2212 AC_MSG_CHECKING(for krb5-config)
2213 if test -x $KRB5ROOT/bin/krb5-config ; then
2214 KRB5CONF=$KRB5ROOT/bin/krb5-config
2215 AC_MSG_RESULT($KRB5CONF)
2217 AC_MSG_CHECKING(for gssapi support)
2218 if $KRB5CONF | grep gssapi >/dev/null ; then
2226 K5CFLAGS="`$KRB5CONF --cflags $k5confopts`"
2227 K5LIBS="`$KRB5CONF --libs $k5confopts`"
2228 CPPFLAGS="$CPPFLAGS $K5CFLAGS"
2229 AC_MSG_CHECKING(whether we are using Heimdal)
2230 AC_TRY_COMPILE([ #include <krb5.h> ],
2231 [ char *tmp = heimdal_version; ],
2232 [ AC_MSG_RESULT(yes)
2233 AC_DEFINE(HEIMDAL) ],
2238 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include"
2239 LDFLAGS="$LDFLAGS -L${KRB5ROOT}/lib"
2240 AC_MSG_CHECKING(whether we are using Heimdal)
2241 AC_TRY_COMPILE([ #include <krb5.h> ],
2242 [ char *tmp = heimdal_version; ],
2243 [ AC_MSG_RESULT(yes)
2245 K5LIBS="-lkrb5 -ldes"
2246 K5LIBS="$K5LIBS -lcom_err -lasn1"
2247 AC_CHECK_LIB(roken, net_write,
2248 [K5LIBS="$K5LIBS -lroken"])
2251 K5LIBS="-lkrb5 -lk5crypto -lcom_err"
2254 AC_SEARCH_LIBS(dn_expand, resolv)
2256 AC_CHECK_LIB(gssapi,gss_init_sec_context,
2258 K5LIBS="-lgssapi $K5LIBS" ],
2259 [ AC_CHECK_LIB(gssapi_krb5,gss_init_sec_context,
2261 K5LIBS="-lgssapi_krb5 $K5LIBS" ],
2262 AC_MSG_WARN([Cannot find any suitable gss-api library - build may fail]),
2267 AC_CHECK_HEADER(gssapi.h, ,
2268 [ unset ac_cv_header_gssapi_h
2269 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2270 AC_CHECK_HEADERS(gssapi.h, ,
2271 AC_MSG_WARN([Cannot find any suitable gss-api header - build may fail])
2277 CPPFLAGS="$CPPFLAGS -I${KRB5ROOT}/include/gssapi"
2278 AC_CHECK_HEADER(gssapi_krb5.h, ,
2279 [ CPPFLAGS="$oldCPP" ])
2282 if test ! -z "$need_dash_r" ; then
2283 LDFLAGS="$LDFLAGS -R${KRB5ROOT}/lib"
2285 if test ! -z "$blibpath" ; then
2286 blibpath="$blibpath:${KRB5ROOT}/lib"
2290 AC_CHECK_HEADERS(gssapi.h gssapi/gssapi.h)
2291 AC_CHECK_HEADERS(gssapi_krb5.h gssapi/gssapi_krb5.h)
2292 AC_CHECK_HEADERS(gssapi_generic.h gssapi/gssapi_generic.h)
2294 LIBS="$LIBS $K5LIBS"
2295 AC_SEARCH_LIBS(k_hasafs, kafs, AC_DEFINE(USE_AFS))
2296 AC_SEARCH_LIBS(krb5_init_ets, $K5LIBS, AC_DEFINE(KRB5_INIT_ETS))
2300 # Looking for programs, paths and files
2302 PRIVSEP_PATH=/var/empty
2303 AC_ARG_WITH(privsep-path,
2304 [ --with-privsep-path=xxx Path for privilege separation chroot (default=/var/empty)],
2306 if test "x$withval" != "$no" ; then
2307 PRIVSEP_PATH=$withval
2311 AC_SUBST(PRIVSEP_PATH)
2314 [ --with-xauth=PATH Specify path to xauth program ],
2316 if test "x$withval" != "xno" ; then
2322 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X/bin"
2323 TestPath="${TestPath}${PATH_SEPARATOR}/usr/bin/X11"
2324 TestPath="${TestPath}${PATH_SEPARATOR}/usr/X11R6/bin"
2325 TestPath="${TestPath}${PATH_SEPARATOR}/usr/openwin/bin"
2326 AC_PATH_PROG(xauth_path, xauth, , $TestPath)
2327 if (test ! -z "$xauth_path" && test -x "/usr/openwin/bin/xauth") ; then
2328 xauth_path="/usr/openwin/bin/xauth"
2334 AC_ARG_ENABLE(strip,
2335 [ --disable-strip Disable calling strip(1) on install],
2337 if test "x$enableval" = "xno" ; then
2344 if test -z "$xauth_path" ; then
2345 XAUTH_PATH="undefined"
2346 AC_SUBST(XAUTH_PATH)
2348 AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path")
2349 XAUTH_PATH=$xauth_path
2350 AC_SUBST(XAUTH_PATH)
2353 # Check for mail directory (last resort if we cannot get it from headers)
2354 if test ! -z "$MAIL" ; then
2355 maildir=`dirname $MAIL`
2356 AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir")
2359 if test -z "$no_dev_ptmx" ; then
2360 if test "x$disable_ptmx_check" != "xyes" ; then
2361 AC_CHECK_FILE("/dev/ptmx",
2363 AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)
2369 AC_CHECK_FILE("/dev/ptc",
2371 AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)
2376 # Options from here on. Some of these are preset by platform above
2377 AC_ARG_WITH(mantype,
2378 [ --with-mantype=man|cat|doc Set man page type],
2385 AC_MSG_ERROR(invalid man type: $withval)
2390 if test -z "$MANTYPE"; then
2391 TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
2392 AC_PATH_PROGS(NROFF, nroff awf, /bin/false, $TestPath)
2393 if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
2395 elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then
2402 if test "$MANTYPE" = "doc"; then
2409 # Check whether to enable MD5 passwords
2411 AC_ARG_WITH(md5-passwords,
2412 [ --with-md5-passwords Enable use of MD5 passwords],
2414 if test "x$withval" != "xno" ; then
2415 AC_DEFINE(HAVE_MD5_PASSWORDS)
2421 # Whether to disable shadow password support
2423 [ --without-shadow Disable shadow password support],
2425 if test "x$withval" = "xno" ; then
2426 AC_DEFINE(DISABLE_SHADOW)
2432 if test -z "$disable_shadow" ; then
2433 AC_MSG_CHECKING([if the systems has expire shadow information])
2436 #include <sys/types.h>
2439 ],[ sp.sp_expire = sp.sp_lstchg = sp.sp_inact = 0; ],
2440 [ sp_expire_available=yes ], []
2443 if test "x$sp_expire_available" = "xyes" ; then
2445 AC_DEFINE(HAS_SHADOW_EXPIRE)
2451 # Use ip address instead of hostname in $DISPLAY
2452 if test ! -z "$IPADDR_IN_DISPLAY" ; then
2453 DISPLAY_HACK_MSG="yes"
2454 AC_DEFINE(IPADDR_IN_DISPLAY)
2456 DISPLAY_HACK_MSG="no"
2457 AC_ARG_WITH(ipaddr-display,
2458 [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY],
2460 if test "x$withval" != "xno" ; then
2461 AC_DEFINE(IPADDR_IN_DISPLAY)
2462 DISPLAY_HACK_MSG="yes"
2468 # check for /etc/default/login and use it if present.
2469 AC_ARG_ENABLE(etc-default-login,
2470 [ --disable-etc-default-login Disable using PATH from /etc/default/login [no]],,
2472 AC_CHECK_FILE("/etc/default/login", [ external_path_file=/etc/default/login ])
2474 if test "x$external_path_file" = "x/etc/default/login"; then
2475 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)
2479 dnl BSD systems use /etc/login.conf so --with-default-path= has no effect
2480 if test $ac_cv_func_login_getcapbool = "yes" -a \
2481 $ac_cv_header_login_cap_h = "yes" ; then
2482 external_path_file=/etc/login.conf
2485 # Whether to mess with the default path
2486 SERVER_PATH_MSG="(default)"
2487 AC_ARG_WITH(default-path,
2488 [ --with-default-path= Specify default \$PATH environment for server],
2490 if test "x$external_path_file" = "x/etc/login.conf" ; then
2492 --with-default-path=PATH has no effect on this system.
2493 Edit /etc/login.conf instead.])
2494 elif test "x$withval" != "xno" ; then
2495 if test ! -z "$external_path_file" ; then
2497 --with-default-path=PATH will only be used if PATH is not defined in
2498 $external_path_file .])
2500 user_path="$withval"
2501 SERVER_PATH_MSG="$withval"
2504 [ if test "x$external_path_file" = "x/etc/login.conf" ; then
2505 AC_MSG_WARN([Make sure the path to scp is in /etc/login.conf])
2507 if test ! -z "$external_path_file" ; then
2509 If PATH is defined in $external_path_file, ensure the path to scp is included,
2510 otherwise scp will not work.])
2514 /* find out what STDPATH is */
2519 #ifndef _PATH_STDPATH
2520 # ifdef _PATH_USERPATH /* Irix */
2521 # define _PATH_STDPATH _PATH_USERPATH
2523 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
2526 #include <sys/types.h>
2527 #include <sys/stat.h>
2529 #define DATA "conftest.stdpath"
2536 fd = fopen(DATA,"w");
2540 if ((rc = fprintf(fd,"%s", _PATH_STDPATH)) < 0)
2545 ], [ user_path=`cat conftest.stdpath` ],
2546 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ],
2547 [ user_path="/usr/bin:/bin:/usr/sbin:/sbin" ]
2549 # make sure $bindir is in USER_PATH so scp will work
2550 t_bindir=`eval echo ${bindir}`
2552 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$prefix~"` ;;
2555 NONE/*) t_bindir=`echo $t_bindir | sed "s~NONE~$ac_default_prefix~"` ;;
2557 echo $user_path | grep ":$t_bindir" > /dev/null 2>&1
2558 if test $? -ne 0 ; then
2559 echo $user_path | grep "^$t_bindir" > /dev/null 2>&1
2560 if test $? -ne 0 ; then
2561 user_path=$user_path:$t_bindir
2562 AC_MSG_RESULT(Adding $t_bindir to USER_PATH so scp will work)
2567 if test "x$external_path_file" != "x/etc/login.conf" ; then
2568 AC_DEFINE_UNQUOTED(USER_PATH, "$user_path")
2572 # Set superuser path separately to user path
2573 AC_ARG_WITH(superuser-path,
2574 [ --with-superuser-path= Specify different path for super-user],
2576 if test "x$withval" != "xno" ; then
2577 AC_DEFINE_UNQUOTED(SUPERUSER_PATH, "$withval")
2578 superuser_path=$withval
2584 AC_MSG_CHECKING([if we need to convert IPv4 in IPv6-mapped addresses])
2585 IPV4_IN6_HACK_MSG="no"
2587 [ --with-4in6 Check for and convert IPv4 in IPv6 mapped addresses],
2589 if test "x$withval" != "xno" ; then
2591 AC_DEFINE(IPV4_IN_IPV6)
2592 IPV4_IN6_HACK_MSG="yes"
2597 if test "x$inet6_default_4in6" = "xyes"; then
2598 AC_MSG_RESULT([yes (default)])
2599 AC_DEFINE(IPV4_IN_IPV6)
2600 IPV4_IN6_HACK_MSG="yes"
2602 AC_MSG_RESULT([no (default)])
2607 # Whether to enable BSD auth support
2609 AC_ARG_WITH(bsd-auth,
2610 [ --with-bsd-auth Enable BSD auth support],
2612 if test "x$withval" != "xno" ; then
2619 # Where to place sshd.pid
2621 # make sure the directory exists
2622 if test ! -d $piddir ; then
2623 piddir=`eval echo ${sysconfdir}`
2625 NONE/*) piddir=`echo $piddir | sed "s~NONE~$ac_default_prefix~"` ;;
2629 AC_ARG_WITH(pid-dir,
2630 [ --with-pid-dir=PATH Specify location of ssh.pid file],
2632 if test "x$withval" != "xno" ; then
2634 if test ! -d $piddir ; then
2635 AC_MSG_WARN([** no $piddir directory on this system **])
2641 AC_DEFINE_UNQUOTED(_PATH_SSH_PIDDIR, "$piddir")
2644 dnl allow user to disable some login recording features
2645 AC_ARG_ENABLE(lastlog,
2646 [ --disable-lastlog disable use of lastlog even if detected [no]],
2648 if test "x$enableval" = "xno" ; then
2649 AC_DEFINE(DISABLE_LASTLOG)
2654 [ --disable-utmp disable use of utmp even if detected [no]],
2656 if test "x$enableval" = "xno" ; then
2657 AC_DEFINE(DISABLE_UTMP)
2661 AC_ARG_ENABLE(utmpx,
2662 [ --disable-utmpx disable use of utmpx even if detected [no]],
2664 if test "x$enableval" = "xno" ; then
2665 AC_DEFINE(DISABLE_UTMPX)
2670 [ --disable-wtmp disable use of wtmp even if detected [no]],
2672 if test "x$enableval" = "xno" ; then
2673 AC_DEFINE(DISABLE_WTMP)
2677 AC_ARG_ENABLE(wtmpx,
2678 [ --disable-wtmpx disable use of wtmpx even if detected [no]],
2680 if test "x$enableval" = "xno" ; then
2681 AC_DEFINE(DISABLE_WTMPX)
2685 AC_ARG_ENABLE(libutil,
2686 [ --disable-libutil disable use of libutil (login() etc.) [no]],
2688 if test "x$enableval" = "xno" ; then
2689 AC_DEFINE(DISABLE_LOGIN)
2693 AC_ARG_ENABLE(pututline,
2694 [ --disable-pututline disable use of pututline() etc. ([uw]tmp) [no]],
2696 if test "x$enableval" = "xno" ; then
2697 AC_DEFINE(DISABLE_PUTUTLINE)
2701 AC_ARG_ENABLE(pututxline,
2702 [ --disable-pututxline disable use of pututxline() etc. ([uw]tmpx) [no]],
2704 if test "x$enableval" = "xno" ; then
2705 AC_DEFINE(DISABLE_PUTUTXLINE)
2709 AC_ARG_WITH(lastlog,
2710 [ --with-lastlog=FILE|DIR specify lastlog location [common locations]],
2712 if test "x$withval" = "xno" ; then
2713 AC_DEFINE(DISABLE_LASTLOG)
2715 conf_lastlog_location=$withval
2720 dnl lastlog, [uw]tmpx? detection
2721 dnl NOTE: set the paths in the platform section to avoid the
2722 dnl need for command-line parameters
2723 dnl lastlog and [uw]tmp are subject to a file search if all else fails
2725 dnl lastlog detection
2726 dnl NOTE: the code itself will detect if lastlog is a directory
2727 AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
2729 #include <sys/types.h>
2731 #ifdef HAVE_LASTLOG_H
2732 # include <lastlog.h>
2741 [ char *lastlog = LASTLOG_FILE; ],
2742 [ AC_MSG_RESULT(yes) ],
2745 AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
2747 #include <sys/types.h>
2749 #ifdef HAVE_LASTLOG_H
2750 # include <lastlog.h>
2756 [ char *lastlog = _PATH_LASTLOG; ],
2757 [ AC_MSG_RESULT(yes) ],
2760 system_lastlog_path=no
2765 if test -z "$conf_lastlog_location"; then
2766 if test x"$system_lastlog_path" = x"no" ; then
2767 for f in /var/log/lastlog /usr/adm/lastlog /var/adm/lastlog /etc/security/lastlog ; do
2768 if (test -d "$f" || test -f "$f") ; then
2769 conf_lastlog_location=$f
2772 if test -z "$conf_lastlog_location"; then
2773 AC_MSG_WARN([** Cannot find lastlog **])
2774 dnl Don't define DISABLE_LASTLOG - that means we don't try wtmp/wtmpx
2779 if test -n "$conf_lastlog_location"; then
2780 AC_DEFINE_UNQUOTED(CONF_LASTLOG_FILE, "$conf_lastlog_location")
2784 AC_MSG_CHECKING([if your system defines UTMP_FILE])
2786 #include <sys/types.h>
2792 [ char *utmp = UTMP_FILE; ],
2793 [ AC_MSG_RESULT(yes) ],
2795 system_utmp_path=no ]
2797 if test -z "$conf_utmp_location"; then
2798 if test x"$system_utmp_path" = x"no" ; then
2799 for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do
2800 if test -f $f ; then
2801 conf_utmp_location=$f
2804 if test -z "$conf_utmp_location"; then
2805 AC_DEFINE(DISABLE_UTMP)
2809 if test -n "$conf_utmp_location"; then
2810 AC_DEFINE_UNQUOTED(CONF_UTMP_FILE, "$conf_utmp_location")
2814 AC_MSG_CHECKING([if your system defines WTMP_FILE])
2816 #include <sys/types.h>
2822 [ char *wtmp = WTMP_FILE; ],
2823 [ AC_MSG_RESULT(yes) ],
2825 system_wtmp_path=no ]
2827 if test -z "$conf_wtmp_location"; then
2828 if test x"$system_wtmp_path" = x"no" ; then
2829 for f in /usr/adm/wtmp /var/log/wtmp; do
2830 if test -f $f ; then
2831 conf_wtmp_location=$f
2834 if test -z "$conf_wtmp_location"; then
2835 AC_DEFINE(DISABLE_WTMP)
2839 if test -n "$conf_wtmp_location"; then
2840 AC_DEFINE_UNQUOTED(CONF_WTMP_FILE, "$conf_wtmp_location")
2844 dnl utmpx detection - I don't know any system so perverse as to require
2845 dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
2847 AC_MSG_CHECKING([if your system defines UTMPX_FILE])
2849 #include <sys/types.h>
2858 [ char *utmpx = UTMPX_FILE; ],
2859 [ AC_MSG_RESULT(yes) ],
2861 system_utmpx_path=no ]
2863 if test -z "$conf_utmpx_location"; then
2864 if test x"$system_utmpx_path" = x"no" ; then
2865 AC_DEFINE(DISABLE_UTMPX)
2868 AC_DEFINE_UNQUOTED(CONF_UTMPX_FILE, "$conf_utmpx_location")
2872 AC_MSG_CHECKING([if your system defines WTMPX_FILE])
2874 #include <sys/types.h>
2883 [ char *wtmpx = WTMPX_FILE; ],
2884 [ AC_MSG_RESULT(yes) ],
2886 system_wtmpx_path=no ]
2888 if test -z "$conf_wtmpx_location"; then
2889 if test x"$system_wtmpx_path" = x"no" ; then
2890 AC_DEFINE(DISABLE_WTMPX)
2893 AC_DEFINE_UNQUOTED(CONF_WTMPX_FILE, "$conf_wtmpx_location")
2897 if test ! -z "$blibpath" ; then
2898 LDFLAGS="$LDFLAGS $blibflags$blibpath"
2899 AC_MSG_WARN([Please check and edit blibpath in LDFLAGS in Makefile])
2902 dnl remove pam and dl because they are in $LIBPAM
2903 if test "$PAM_MSG" = yes ; then
2904 LIBS=`echo $LIBS | sed 's/-lpam //'`
2906 if test "$ac_cv_lib_pam_pam_set_item" = yes ; then
2907 LIBS=`echo $LIBS | sed 's/-ldl //'`
2911 AC_CONFIG_FILES([Makefile openbsd-compat/Makefile scard/Makefile ssh_prng_cmds])
2914 # Print summary of options
2916 # Someone please show me a better way :)
2917 A=`eval echo ${prefix}` ; A=`eval echo ${A}`
2918 B=`eval echo ${bindir}` ; B=`eval echo ${B}`
2919 C=`eval echo ${sbindir}` ; C=`eval echo ${C}`
2920 D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}`
2921 E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}`
2922 F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}`
2923 G=`eval echo ${piddir}` ; G=`eval echo ${G}`
2924 H=`eval echo ${PRIVSEP_PATH}` ; H=`eval echo ${H}`
2925 I=`eval echo ${user_path}` ; I=`eval echo ${I}`
2926 J=`eval echo ${superuser_path}` ; J=`eval echo ${J}`
2929 echo "OpenSSH has been configured with the following options:"
2930 echo " User binaries: $B"
2931 echo " System binaries: $C"
2932 echo " Configuration files: $D"
2933 echo " Askpass program: $E"
2934 echo " Manual pages: $F"
2935 echo " PID file: $G"
2936 echo " Privilege separation chroot path: $H"
2937 if test "x$external_path_file" = "x/etc/login.conf" ; then
2938 echo " At runtime, sshd will use the path defined in $external_path_file"
2939 echo " Make sure the path to scp is present, otherwise scp will not work"
2941 echo " sshd default user PATH: $I"
2942 if test ! -z "$external_path_file"; then
2943 echo " (If PATH is set in $external_path_file it will be used instead. If"
2944 echo " used, ensure the path to scp is present, otherwise scp will not work.)"
2947 if test ! -z "$superuser_path" ; then
2948 echo " sshd superuser user PATH: $J"
2950 echo " Manpage format: $MANTYPE"
2951 echo " PAM support: $PAM_MSG"
2952 echo " KerberosV support: $KRB5_MSG"
2953 echo " Smartcard support: $SCARD_MSG"
2954 echo " S/KEY support: $SKEY_MSG"
2955 echo " TCP Wrappers support: $TCPW_MSG"
2956 echo " MD5 password support: $MD5_MSG"
2957 echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG"
2958 echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG"
2959 echo " BSD Auth support: $BSD_AUTH_MSG"
2960 echo " Random number source: $RAND_MSG"
2961 if test ! -z "$USE_RAND_HELPER" ; then
2962 echo " ssh-rand-helper collects from: $RAND_HELPER_MSG"
2967 echo " Host: ${host}"
2968 echo " Compiler: ${CC}"
2969 echo " Compiler flags: ${CFLAGS}"
2970 echo "Preprocessor flags: ${CPPFLAGS}"
2971 echo " Linker flags: ${LDFLAGS}"
2972 echo " Libraries: ${LIBWRAP} ${LIBPAM} ${LIBS}"
2976 if test "x$PAM_MSG" = "xyes" ; then
2977 echo "PAM is enabled. You may need to install a PAM control file "
2978 echo "for sshd, otherwise password authentication may fail. "
2979 echo "Example PAM control files can be found in the contrib/ "
2984 if test ! -z "$RAND_HELPER_CMDHASH" ; then
2985 echo "WARNING: you are using the builtin random number collection "
2986 echo "service. Please read WARNING.RNG and request that your OS "
2987 echo "vendor includes kernel-based random number collection in "
2988 echo "future versions of your OS."
2992 if test ! -z "$NO_PEERCHECK" ; then
2993 echo "WARNING: the operating system that you are using does not "
2994 echo "appear to support either the getpeereid() API nor the "
2995 echo "SO_PEERCRED getsockopt() option. These facilities are used to "
2996 echo "enforce security checks to prevent unauthorised connections to "
2997 echo "ssh-agent. Their absence increases the risk that a malicious "
2998 echo "user can connect to your agent. "