diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | acconfig.h | 3 | ||||
-rw-r--r-- | configure.in | 448 | ||||
-rw-r--r-- | ssh.c | 6 | ||||
-rw-r--r-- | sshd.c | 3 |
6 files changed, 251 insertions, 219 deletions
@@ -1,3 +1,11 @@ | |||
1 | 20000302 | ||
2 | - Big cleanup of autoconf code | ||
3 | - Rearranged to be a little more logical | ||
4 | - Added -R option for Solaris | ||
5 | - Rewrote OpenSSL detection code. Now uses AC_TRY_RUN with a test program | ||
6 | to detect library and header location _and_ ensure library has proper | ||
7 | RSA support built in (this is a problem with OpenSSL 0.9.5). | ||
8 | |||
1 | 20000207 | 9 | 20000207 |
2 | - Removed SOCKS code. Will support through a ProxyCommand. | 10 | - Removed SOCKS code. Will support through a ProxyCommand. |
3 | 11 | ||
@@ -10,3 +10,5 @@ | |||
10 | - Move all compatability cruft (bsd-*, fake-*) into subordinate library | 10 | - Move all compatability cruft (bsd-*, fake-*) into subordinate library |
11 | 11 | ||
12 | - Cleanup configure.in | 12 | - Cleanup configure.in |
13 | |||
14 | - A good source of strong random numbers. Waiting on a Yarrow port. | ||
diff --git a/acconfig.h b/acconfig.h index e96b195dc..9af1117c7 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -6,9 +6,6 @@ | |||
6 | 6 | ||
7 | @TOP@ | 7 | @TOP@ |
8 | 8 | ||
9 | /* SSL directory. */ | ||
10 | #undef ssldir | ||
11 | |||
12 | /* Define if you want to disable PAM support */ | 9 | /* Define if you want to disable PAM support */ |
13 | #undef DISABLE_PAM | 10 | #undef DISABLE_PAM |
14 | 11 | ||
diff --git a/configure.in b/configure.in index f2128d7f1..1cb46525c 100644 --- a/configure.in +++ b/configure.in | |||
@@ -3,7 +3,11 @@ AC_INIT(ssh.c) | |||
3 | AC_CONFIG_HEADER(config.h) | 3 | AC_CONFIG_HEADER(config.h) |
4 | AC_CANONICAL_HOST | 4 | AC_CANONICAL_HOST |
5 | 5 | ||
6 | dnl Checks for programs. | 6 | # C Compiler features |
7 | if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi | ||
8 | AC_C_INLINE | ||
9 | |||
10 | # Checks for programs. | ||
7 | AC_PROG_CC | 11 | AC_PROG_CC |
8 | AC_PROG_CPP | 12 | AC_PROG_CPP |
9 | AC_PROG_RANLIB | 13 | AC_PROG_RANLIB |
@@ -12,78 +16,7 @@ AC_CHECK_PROG(AR, ar, ar) | |||
12 | AC_PATH_PROG(PERL, perl) | 16 | AC_PATH_PROG(PERL, perl) |
13 | AC_SUBST(PERL) | 17 | AC_SUBST(PERL) |
14 | 18 | ||
15 | AC_ARG_WITH(rsh, | 19 | # Check for some target-specific stuff |
16 | [ --with-rsh=PATH Specify path to remote shell program ], | ||
17 | [ | ||
18 | if test "x$withval" != "$xno" ; then | ||
19 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") | ||
20 | fi | ||
21 | ], | ||
22 | [ | ||
23 | AC_PATH_PROG(rsh_path, rsh) | ||
24 | ] | ||
25 | ) | ||
26 | |||
27 | AC_ARG_WITH(xauth, | ||
28 | [ --with-xauth=PATH Specify path to xauth program ], | ||
29 | [ | ||
30 | if test "x$withval" != "$xno" ; then | ||
31 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") | ||
32 | fi | ||
33 | ], | ||
34 | [ | ||
35 | AC_PATH_PROG(xauth_path, xauth) | ||
36 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then | ||
37 | xauth_path="/usr/openwin/bin/xauth" | ||
38 | fi | ||
39 | ] | ||
40 | ) | ||
41 | |||
42 | if test ! -z "$xauth_path" ; then | ||
43 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") | ||
44 | fi | ||
45 | if test ! -z "$rsh_path" ; then | ||
46 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") | ||
47 | fi | ||
48 | |||
49 | if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi | ||
50 | |||
51 | AC_C_INLINE | ||
52 | |||
53 | AC_ARG_WITH(ssl-dir, | ||
54 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], | ||
55 | [ | ||
56 | if test "x$withval" != "$xno" ; then | ||
57 | ssldir=$withval | ||
58 | fi | ||
59 | ] | ||
60 | ) | ||
61 | |||
62 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) | ||
63 | for ssldir in $ssldir $prefix /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local $prefix /usr/pkg ; do | ||
64 | if test -f "$ssldir/include/openssl/crypto.h"; then | ||
65 | AC_DEFINE(HAVE_OPENSSL) | ||
66 | GOT_SSL="yes" | ||
67 | break | ||
68 | fi | ||
69 | if test -f "$ssldir/include/ssl/crypto.h"; then | ||
70 | AC_DEFINE(HAVE_SSL) | ||
71 | GOT_SSL="yes" | ||
72 | break | ||
73 | fi | ||
74 | done | ||
75 | if test -z "$GOT_SSL" ; then | ||
76 | AC_MSG_ERROR([Could not find SSLeay / OpenSSL libraries, please install]) | ||
77 | fi | ||
78 | AC_SUBST(ssldir) | ||
79 | AC_DEFINE_UNQUOTED(ssldir, "$ssldir") | ||
80 | if test "$ssldir" != "/usr"; then | ||
81 | CFLAGS="$CFLAGS -I$ssldir/include" | ||
82 | LDFLAGS="$LDFLAGS -L$ssldir/lib" | ||
83 | fi | ||
84 | AC_MSG_RESULT($ssldir) | ||
85 | |||
86 | dnl Check for some target-specific stuff | ||
87 | case "$host" in | 20 | case "$host" in |
88 | *-*-aix*) | 21 | *-*-aix*) |
89 | AFS_LIBS="-lld" | 22 | AFS_LIBS="-lld" |
@@ -124,11 +57,10 @@ case "$host" in | |||
124 | no_dev_ptmx=1 | 57 | no_dev_ptmx=1 |
125 | ;; | 58 | ;; |
126 | *-*-netbsd*) | 59 | *-*-netbsd*) |
127 | if test "$GOT_SSL" = "yes"; then | 60 | need_dash_r=1 |
128 | LDFLAGS="$LDFLAGS -R$ssldir/lib" | ||
129 | fi | ||
130 | ;; | 61 | ;; |
131 | *-*-solaris*) | 62 | *-*-solaris*) |
63 | need_dash_r=1 | ||
132 | AC_DEFINE(USE_UTMPX) | 64 | AC_DEFINE(USE_UTMPX) |
133 | ;; | 65 | ;; |
134 | *-*-sysv*) | 66 | *-*-sysv*) |
@@ -139,17 +71,7 @@ case "$host" in | |||
139 | ;; | 71 | ;; |
140 | esac | 72 | esac |
141 | 73 | ||
142 | dnl Check for RSAref library. | 74 | # Checks for libraries. |
143 | AC_MSG_CHECKING([for RSAref library]) | ||
144 | saved_LIBS="$LIBS" | ||
145 | LIBS="$saved_LIBS -lRSAglue -lrsaref" | ||
146 | AC_TRY_LINK([], [], | ||
147 | [AC_MSG_RESULT(yes); | ||
148 | AC_DEFINE(RSAREF)], | ||
149 | [AC_MSG_RESULT(no)]; LIBS="$saved_LIBS") | ||
150 | |||
151 | dnl Checks for libraries. | ||
152 | AC_CHECK_LIB(crypto, CRYPTO_lock, ,AC_MSG_ERROR([*** libcrypto missing - please install first ***])) | ||
153 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) | 75 | AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first ***])) |
154 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") | 76 | AC_CHECK_LIB(util, login, AC_DEFINE(HAVE_LIBUTIL_LOGIN) LIBS="$LIBS -lutil") |
155 | 77 | ||
@@ -160,10 +82,10 @@ if test -z "$no_libnsl" ; then | |||
160 | AC_CHECK_LIB(socket, main, , ) | 82 | AC_CHECK_LIB(socket, main, , ) |
161 | fi | 83 | fi |
162 | 84 | ||
163 | dnl Checks for header files. | 85 | # Checks for header files. |
164 | AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) | 86 | AC_CHECK_HEADERS(bstring.h endian.h lastlog.h login.h maillock.h netdb.h netgroup.h paths.h poll.h pty.h shadow.h security/pam_appl.h sys/bitypes.h sys/bsdtty.h sys/cdefs.h sys/poll.h sys/select.h sys/stropts.h sys/sysmacros.h sys/time.h sys/ttcompat.h stddef.h util.h utmp.h utmpx.h) |
165 | 87 | ||
166 | dnl Checks for library functions. | 88 | # Checks for library functions. |
167 | AC_CHECK_FUNCS(arc4random bindresvport_af freeaddrinfo gai_strerror getaddrinfo getpagesize getnameinfo innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty) | 89 | AC_CHECK_FUNCS(arc4random bindresvport_af freeaddrinfo gai_strerror getaddrinfo getpagesize getnameinfo innetgr md5_crypt mkdtemp openpty rresvport_af setenv seteuid setlogin setproctitle setreuid snprintf strlcat strlcpy updwtmpx vsnprintf _getpty) |
168 | 90 | ||
169 | AC_CHECK_FUNC(login, | 91 | AC_CHECK_FUNC(login, |
@@ -176,14 +98,114 @@ AC_CHECK_FUNC(daemon, | |||
176 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] | 98 | [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] |
177 | ) | 99 | ) |
178 | 100 | ||
179 | dnl Checks for data types | 101 | AC_ARG_WITH(pam, |
102 | [ --without-pam Disable PAM support ], | ||
103 | [ | ||
104 | if test "x$withval" = "xno" ; then | ||
105 | no_pam=1 | ||
106 | AC_DEFINE(DISABLE_PAM) | ||
107 | fi | ||
108 | ] | ||
109 | ) | ||
110 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then | ||
111 | AC_CHECK_LIB(dl, dlopen, , ) | ||
112 | LIBS="$LIBS -lpam" | ||
113 | |||
114 | # Check PAM strerror arguments (old PAM) | ||
115 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) | ||
116 | AC_TRY_COMPILE( | ||
117 | [ | ||
118 | #include <stdlib.h> | ||
119 | #include <security/pam_appl.h> | ||
120 | ], | ||
121 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], | ||
122 | [AC_MSG_RESULT(no)], | ||
123 | [ | ||
124 | AC_DEFINE(HAVE_OLD_PAM) | ||
125 | AC_MSG_RESULT(yes) | ||
126 | ] | ||
127 | ) | ||
128 | fi | ||
129 | |||
130 | # The big search for OpenSSL | ||
131 | AC_ARG_WITH(ssl-dir, | ||
132 | [ --with-ssl-dir=PATH Specify path to OpenSSL installation ], | ||
133 | [ | ||
134 | if test "x$withval" != "$xno" ; then | ||
135 | tryssldir=$withval | ||
136 | fi | ||
137 | ] | ||
138 | ) | ||
139 | |||
140 | saved_LIBS="$LIBS" | ||
141 | saved_CFLAGS="$CFLAGS" | ||
142 | if test "x$prefix" != "xNONE" ; then | ||
143 | tryssldir="$tryssldir $prefix" | ||
144 | fi | ||
145 | AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) | ||
146 | for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg /opt /opt/openssl ; do | ||
147 | if test ! -z "$ssldir" ; then | ||
148 | LIBS="$saved_LIBS -L$ssldir" | ||
149 | CFLAGS="$CFLAGS -I$ssldir/include" | ||
150 | if test "x$need_dash_r" = "x1" ; then | ||
151 | LIBS="$LIBS -R$ssldir" | ||
152 | fi | ||
153 | fi | ||
154 | LIBS="$LIBS -lcrypto" | ||
155 | |||
156 | AC_TRY_RUN( | ||
157 | [ | ||
158 | #include <openssl/rsa.h> | ||
159 | #include <openssl/bn.h> | ||
160 | #include <openssl/sha.h> | ||
161 | int main(void) | ||
162 | {RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);} | ||
163 | ], | ||
164 | [ | ||
165 | AC_DEFINE(HAVE_OPENSSL) | ||
166 | found_crypto=1 | ||
167 | break; | ||
168 | ], [] | ||
169 | ) | ||
170 | AC_TRY_RUN( | ||
171 | [ | ||
172 | #include <ssl/rsa.h> | ||
173 | #include <ssl/bn.h> | ||
174 | #include <ssl/sha.h> | ||
175 | int main(void) | ||
176 | {RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);} | ||
177 | ], | ||
178 | [ | ||
179 | AC_DEFINE(HAVE_SSL) | ||
180 | found_crypto=1 | ||
181 | break; | ||
182 | ], [] | ||
183 | ) | ||
184 | done | ||
185 | |||
186 | if test -z "$found_crypto" ; then | ||
187 | AC_MSG_ERROR([Could not find working SSLeay / OpenSSL libraries, please install]) | ||
188 | fi | ||
189 | if test -z "$ssldir" ; then | ||
190 | ssldir="(system)" | ||
191 | else | ||
192 | CFLAGS="$CFLAGS -I$ssldir/include" | ||
193 | LDFLAGS="$LDFLAGS -L$ssldir/lib" | ||
194 | if test "x$need_dash_r" = "x1" ; then | ||
195 | LDFLAGS="$LDFLAGS -R$ssldir" | ||
196 | fi | ||
197 | fi | ||
198 | LIBS="$saved_LIBS -lcrypto" | ||
199 | AC_MSG_RESULT($ssldir) | ||
200 | |||
201 | # Checks for data types | ||
180 | AC_CHECK_SIZEOF(char, 1) | 202 | AC_CHECK_SIZEOF(char, 1) |
181 | AC_CHECK_SIZEOF(short int, 2) | 203 | AC_CHECK_SIZEOF(short int, 2) |
182 | AC_CHECK_SIZEOF(int, 4) | 204 | AC_CHECK_SIZEOF(int, 4) |
183 | AC_CHECK_SIZEOF(long int, 4) | 205 | AC_CHECK_SIZEOF(long int, 4) |
184 | AC_CHECK_SIZEOF(long long int, 8) | 206 | AC_CHECK_SIZEOF(long long int, 8) |
185 | 207 | ||
186 | dnl More checks for data types | 208 | # More checks for data types |
187 | AC_MSG_CHECKING([for intXX_t types]) | 209 | AC_MSG_CHECKING([for intXX_t types]) |
188 | AC_TRY_COMPILE( | 210 | AC_TRY_COMPILE( |
189 | [#include <sys/types.h>], | 211 | [#include <sys/types.h>], |
@@ -316,89 +338,7 @@ AC_TRY_COMPILE( | |||
316 | [AC_MSG_RESULT(no)] | 338 | [AC_MSG_RESULT(no)] |
317 | ) | 339 | ) |
318 | 340 | ||
319 | AC_ARG_WITH(pam, | 341 | # Checks for structure members |
320 | [ --without-pam Disable PAM support ], | ||
321 | [ | ||
322 | if test "x$withval" = "xno" ; then | ||
323 | no_pam=1 | ||
324 | AC_DEFINE(DISABLE_PAM) | ||
325 | fi | ||
326 | ] | ||
327 | ) | ||
328 | |||
329 | if test -z "$no_pam" -a "x$ac_cv_header_security_pam_appl_h" = "xyes" ; then | ||
330 | AC_CHECK_LIB(dl, dlopen, , ) | ||
331 | LIBS="$LIBS -lpam" | ||
332 | dnl Check PAM strerror arguments | ||
333 | AC_MSG_CHECKING([whether pam_strerror takes only one argument]) | ||
334 | AC_TRY_COMPILE( | ||
335 | [ | ||
336 | #include <stdlib.h> | ||
337 | #include <security/pam_appl.h> | ||
338 | ], | ||
339 | [(void)pam_strerror((pam_handle_t *)NULL, -1);], | ||
340 | [AC_MSG_RESULT(no)], | ||
341 | [ | ||
342 | AC_DEFINE(HAVE_OLD_PAM) | ||
343 | AC_MSG_RESULT(yes) | ||
344 | ] | ||
345 | ) | ||
346 | fi | ||
347 | |||
348 | AC_MSG_CHECKING([whether to build GNOME ssh-askpass]) | ||
349 | dnl Check whether user wants GNOME ssh-askpass | ||
350 | AC_ARG_WITH(gnome-askpass, | ||
351 | [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)], | ||
352 | [ | ||
353 | if test x$withval = xno ; then | ||
354 | GNOME_ASKPASS=""; | ||
355 | else | ||
356 | GNOME_ASKPASS="gnome-ssh-askpass"; | ||
357 | fi | ||
358 | ]) | ||
359 | AC_SUBST(GNOME_ASKPASS) | ||
360 | |||
361 | if test -z "$GNOME_ASKPASS" ; then | ||
362 | AC_MSG_RESULT(no) | ||
363 | else | ||
364 | AC_MSG_RESULT(yes) | ||
365 | fi | ||
366 | |||
367 | dnl Check for user-specified random device | ||
368 | AC_ARG_WITH(random, | ||
369 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], | ||
370 | [ | ||
371 | RANDOM_POOL="$withval"; | ||
372 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
373 | ], | ||
374 | [ | ||
375 | dnl Check for random device | ||
376 | AC_CHECK_FILE("/dev/urandom", | ||
377 | [ | ||
378 | RANDOM_POOL="/dev/urandom"; | ||
379 | AC_SUBST(RANDOM_POOL) | ||
380 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
381 | ] | ||
382 | ) | ||
383 | ] | ||
384 | ) | ||
385 | |||
386 | dnl Check for EGD pool file | ||
387 | AC_ARG_WITH(egd-pool, | ||
388 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], | ||
389 | [ | ||
390 | RANDOM_POOL="$withval"; | ||
391 | AC_DEFINE(HAVE_EGD) | ||
392 | AC_SUBST(RANDOM_POOL) | ||
393 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
394 | ] | ||
395 | ) | ||
396 | |||
397 | dnl Make sure we have random number support | ||
398 | if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then | ||
399 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) | ||
400 | fi | ||
401 | |||
402 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) | 342 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) |
403 | AC_EGREP_HEADER(ut_host, utmp.h, | 343 | AC_EGREP_HEADER(ut_host, utmp.h, |
404 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], | 344 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], |
@@ -482,7 +422,60 @@ AC_TRY_COMPILE( | |||
482 | [AC_MSG_RESULT(no)] | 422 | [AC_MSG_RESULT(no)] |
483 | ) | 423 | ) |
484 | 424 | ||
485 | dnl Look for lastlog location | 425 | AC_MSG_CHECKING([whether libc defines __progname]) |
426 | AC_TRY_LINK([], | ||
427 | [extern char *__progname; printf("%s", __progname);], | ||
428 | [ | ||
429 | AC_DEFINE(HAVE___PROGNAME) | ||
430 | AC_MSG_RESULT(yes) | ||
431 | ], | ||
432 | [ | ||
433 | AC_MSG_RESULT(no) | ||
434 | ] | ||
435 | ) | ||
436 | |||
437 | # Looking for programs, paths and files | ||
438 | AC_ARG_WITH(rsh, | ||
439 | [ --with-rsh=PATH Specify path to remote shell program ], | ||
440 | [ | ||
441 | if test "x$withval" != "$xno" ; then | ||
442 | AC_DEFINE_UNQUOTED(RSH_PATH, "$withval") | ||
443 | fi | ||
444 | ], | ||
445 | [ | ||
446 | AC_PATH_PROG(rsh_path, rsh) | ||
447 | ] | ||
448 | ) | ||
449 | |||
450 | AC_ARG_WITH(xauth, | ||
451 | [ --with-xauth=PATH Specify path to xauth program ], | ||
452 | [ | ||
453 | if test "x$withval" != "$xno" ; then | ||
454 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$withval") | ||
455 | fi | ||
456 | ], | ||
457 | [ | ||
458 | AC_PATH_PROG(xauth_path, xauth) | ||
459 | if test ! -z "$xauth_path" -a -x "/usr/openwin/bin/xauth" ; then | ||
460 | xauth_path="/usr/openwin/bin/xauth" | ||
461 | fi | ||
462 | ] | ||
463 | ) | ||
464 | |||
465 | if test ! -z "$xauth_path" ; then | ||
466 | AC_DEFINE_UNQUOTED(XAUTH_PATH, "$xauth_path") | ||
467 | fi | ||
468 | if test ! -z "$rsh_path" ; then | ||
469 | AC_DEFINE_UNQUOTED(RSH_PATH, "$rsh_path") | ||
470 | fi | ||
471 | |||
472 | # Check for mail directory (last resort if we cannot get it from headers) | ||
473 | if test ! -z "$MAIL" ; then | ||
474 | maildir=`dirname $MAIL` | ||
475 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") | ||
476 | fi | ||
477 | |||
478 | # Look for lastlog location | ||
486 | AC_ARG_WITH(lastlog, | 479 | AC_ARG_WITH(lastlog, |
487 | [ --with-lastlog=FILE Location of lastlog file], | 480 | [ --with-lastlog=FILE Location of lastlog file], |
488 | [ | 481 | [ |
@@ -524,6 +517,67 @@ if test ! -z "$nolastlog" ; then | |||
524 | AC_DEFINE(DISABLE_LASTLOG) | 517 | AC_DEFINE(DISABLE_LASTLOG) |
525 | fi | 518 | fi |
526 | 519 | ||
520 | if test -z "$no_dev_ptmx" ; then | ||
521 | AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)) | ||
522 | fi | ||
523 | AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)) | ||
524 | |||
525 | # Options from here on. Some of these are preset by platform above | ||
526 | |||
527 | # Check whether user wants GNOME ssh-askpass | ||
528 | AC_MSG_CHECKING([whether to build GNOME ssh-askpass]) | ||
529 | AC_ARG_WITH(gnome-askpass, | ||
530 | [ --with-gnome-askpass Build the GNOME passphrase requester (default=no)], | ||
531 | [ | ||
532 | if test x$withval = xno ; then | ||
533 | GNOME_ASKPASS=""; | ||
534 | else | ||
535 | GNOME_ASKPASS="gnome-ssh-askpass"; | ||
536 | fi | ||
537 | ]) | ||
538 | AC_SUBST(GNOME_ASKPASS) | ||
539 | |||
540 | if test -z "$GNOME_ASKPASS" ; then | ||
541 | AC_MSG_RESULT(no) | ||
542 | else | ||
543 | AC_MSG_RESULT(yes) | ||
544 | fi | ||
545 | |||
546 | # Check for user-specified random device, otherwise check /dev/urandom | ||
547 | AC_ARG_WITH(random, | ||
548 | [ --with-random=FILE read randomness from FILE (default=/dev/urandom)], | ||
549 | [ | ||
550 | RANDOM_POOL="$withval"; | ||
551 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
552 | ], | ||
553 | [ | ||
554 | # Check for random device | ||
555 | AC_CHECK_FILE("/dev/urandom", | ||
556 | [ | ||
557 | RANDOM_POOL="/dev/urandom"; | ||
558 | AC_SUBST(RANDOM_POOL) | ||
559 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
560 | ] | ||
561 | ) | ||
562 | ] | ||
563 | ) | ||
564 | |||
565 | # Check for EGD pool file | ||
566 | AC_ARG_WITH(egd-pool, | ||
567 | [ --with-egd-pool=FILE read randomness from EGD pool FILE (default none)], | ||
568 | [ | ||
569 | RANDOM_POOL="$withval"; | ||
570 | AC_DEFINE(HAVE_EGD) | ||
571 | AC_SUBST(RANDOM_POOL) | ||
572 | AC_DEFINE_UNQUOTED(RANDOM_POOL, "$RANDOM_POOL") | ||
573 | ] | ||
574 | ) | ||
575 | |||
576 | # Make sure we have some random number support | ||
577 | if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then | ||
578 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) | ||
579 | fi | ||
580 | |||
527 | AC_ARG_WITH(catman, | 581 | AC_ARG_WITH(catman, |
528 | [ --with-catman=man|cat Install preformatted manpages[no]], | 582 | [ --with-catman=man|cat Install preformatted manpages[no]], |
529 | [ | 583 | [ |
@@ -543,24 +597,7 @@ AC_ARG_WITH(catman, | |||
543 | AC_SUBST(MANTYPE) | 597 | AC_SUBST(MANTYPE) |
544 | AC_SUBST(mansubdir) | 598 | AC_SUBST(mansubdir) |
545 | 599 | ||
546 | if test -z "$no_dev_ptmx" ; then | 600 | # Check whether user wants Kerberos support |
547 | AC_CHECK_FILE("/dev/ptmx", AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX)) | ||
548 | fi | ||
549 | AC_CHECK_FILE("/dev/ptc", AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC)) | ||
550 | |||
551 | AC_MSG_CHECKING([whether libc defines __progname]) | ||
552 | AC_TRY_LINK([], | ||
553 | [extern char *__progname; printf("%s", __progname);], | ||
554 | [ | ||
555 | AC_DEFINE(HAVE___PROGNAME) | ||
556 | AC_MSG_RESULT(yes) | ||
557 | ], | ||
558 | [ | ||
559 | AC_MSG_RESULT(no) | ||
560 | ] | ||
561 | ) | ||
562 | |||
563 | dnl Check whether user wants Kerberos support | ||
564 | AC_ARG_WITH(kerberos4, | 601 | AC_ARG_WITH(kerberos4, |
565 | [ --with-kerberos4=PATH Enable Kerberos 4 support], | 602 | [ --with-kerberos4=PATH Enable Kerberos 4 support], |
566 | [ | 603 | [ |
@@ -592,7 +629,7 @@ AC_ARG_WITH(kerberos4, | |||
592 | ] | 629 | ] |
593 | ) | 630 | ) |
594 | 631 | ||
595 | dnl Check whether user wants AFS support | 632 | # Check whether user wants AFS support |
596 | AC_ARG_WITH(afs, | 633 | AC_ARG_WITH(afs, |
597 | [ --with-afs=PATH Enable AFS support], | 634 | [ --with-afs=PATH Enable AFS support], |
598 | [ | 635 | [ |
@@ -617,7 +654,7 @@ AC_ARG_WITH(afs, | |||
617 | ) | 654 | ) |
618 | LIBS="$LIBS $KLIBS" | 655 | LIBS="$LIBS $KLIBS" |
619 | 656 | ||
620 | dnl Check whether user wants S/Key support | 657 | # Check whether user wants S/Key support |
621 | AC_ARG_WITH(skey, | 658 | AC_ARG_WITH(skey, |
622 | [ --with-skey Enable S/Key support], | 659 | [ --with-skey Enable S/Key support], |
623 | [ | 660 | [ |
@@ -628,7 +665,7 @@ AC_ARG_WITH(skey, | |||
628 | ] | 665 | ] |
629 | ) | 666 | ) |
630 | 667 | ||
631 | dnl Check whether user wants TCP wrappers support | 668 | # Check whether user wants TCP wrappers support |
632 | AC_ARG_WITH(tcp-wrappers, | 669 | AC_ARG_WITH(tcp-wrappers, |
633 | [ --with-tcp-wrappers Enable tcpwrappers support], | 670 | [ --with-tcp-wrappers Enable tcpwrappers support], |
634 | [ | 671 | [ |
@@ -639,7 +676,7 @@ AC_ARG_WITH(tcp-wrappers, | |||
639 | ] | 676 | ] |
640 | ) | 677 | ) |
641 | 678 | ||
642 | dnl Check whether to enable MD5 passwords | 679 | # Check whether to enable MD5 passwords |
643 | AC_ARG_WITH(md5-passwords, | 680 | AC_ARG_WITH(md5-passwords, |
644 | [ --with-md5-passwords Enable use of MD5 passwords], | 681 | [ --with-md5-passwords Enable use of MD5 passwords], |
645 | [ | 682 | [ |
@@ -649,7 +686,7 @@ AC_ARG_WITH(md5-passwords, | |||
649 | ] | 686 | ] |
650 | ) | 687 | ) |
651 | 688 | ||
652 | dnl Check whether to enable utmpx support | 689 | # Check whether to enable utmpx support |
653 | AC_ARG_WITH(utmpx, | 690 | AC_ARG_WITH(utmpx, |
654 | [ --with-utmpx Enable utmpx support], | 691 | [ --with-utmpx Enable utmpx support], |
655 | [ | 692 | [ |
@@ -659,7 +696,7 @@ AC_ARG_WITH(utmpx, | |||
659 | ] | 696 | ] |
660 | ) | 697 | ) |
661 | 698 | ||
662 | dnl Whether to disable shadow password support | 699 | # Whether to disable shadow password support |
663 | AC_ARG_WITH(shadow, | 700 | AC_ARG_WITH(shadow, |
664 | [ --without-shadow Disable shadow password support], | 701 | [ --without-shadow Disable shadow password support], |
665 | [ | 702 | [ |
@@ -669,7 +706,7 @@ AC_ARG_WITH(shadow, | |||
669 | ] | 706 | ] |
670 | ) | 707 | ) |
671 | 708 | ||
672 | dnl Use ip address instead of hostname in $DISPLAY | 709 | # Use ip address instead of hostname in $DISPLAY |
673 | AC_ARG_WITH(ipaddr-display, | 710 | AC_ARG_WITH(ipaddr-display, |
674 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], | 711 | [ --with-ipaddr-display Use ip address instead of hostname in \$DISPLAY], |
675 | [ | 712 | [ |
@@ -679,6 +716,7 @@ AC_ARG_WITH(ipaddr-display, | |||
679 | ] | 716 | ] |
680 | ) | 717 | ) |
681 | 718 | ||
719 | # Whether to mess with the default path | ||
682 | AC_ARG_WITH(default-path, | 720 | AC_ARG_WITH(default-path, |
683 | [ --with-default-path=PATH Specify default \$PATH environment for server], | 721 | [ --with-default-path=PATH Specify default \$PATH environment for server], |
684 | [ | 722 | [ |
@@ -688,6 +726,7 @@ AC_ARG_WITH(default-path, | |||
688 | ] | 726 | ] |
689 | ) | 727 | ) |
690 | 728 | ||
729 | # Whether to force IPv4 by default (needed on broken glibc Linux) | ||
691 | AC_ARG_WITH(ipv4-default, | 730 | AC_ARG_WITH(ipv4-default, |
692 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], | 731 | [ --with-ipv4-default Use IPv4 by connections unless '-6' specified], |
693 | [ | 732 | [ |
@@ -697,6 +736,7 @@ AC_ARG_WITH(ipv4-default, | |||
697 | ] | 736 | ] |
698 | ) | 737 | ) |
699 | 738 | ||
739 | # Where to place sshd.pid | ||
700 | piddir=/var/run | 740 | piddir=/var/run |
701 | AC_ARG_WITH(pid-dir, | 741 | AC_ARG_WITH(pid-dir, |
702 | [ --with-pid-dir=PATH Specify location of ssh.pid file], | 742 | [ --with-pid-dir=PATH Specify location of ssh.pid file], |
@@ -709,12 +749,4 @@ AC_ARG_WITH(pid-dir, | |||
709 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") | 749 | AC_DEFINE_UNQUOTED(PIDDIR, "$piddir") |
710 | AC_SUBST(piddir) | 750 | AC_SUBST(piddir) |
711 | 751 | ||
712 | dnl Check for mail directory (last resort if we cannot get it from headers) | ||
713 | if test ! -z "$MAIL" ; then | ||
714 | maildir=`dirname $MAIL` | ||
715 | AC_DEFINE_UNQUOTED(MAIL_DIRECTORY, "$maildir") | ||
716 | fi | ||
717 | |||
718 | AC_OUTPUT(Makefile) | 752 | AC_OUTPUT(Makefile) |
719 | |||
720 | |||
@@ -11,7 +11,7 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include "includes.h" | 13 | #include "includes.h" |
14 | RCSID("$Id: ssh.c,v 1.19 2000/02/07 02:20:26 damien Exp $"); | 14 | RCSID("$Id: ssh.c,v 1.20 2000/03/02 12:09:21 damien Exp $"); |
15 | 15 | ||
16 | #include "xmalloc.h" | 16 | #include "xmalloc.h" |
17 | #include "ssh.h" | 17 | #include "ssh.h" |
@@ -325,11 +325,7 @@ main(int ac, char **av) | |||
325 | case 'V': | 325 | case 'V': |
326 | fprintf(stderr, "SSH Version %s, protocol version %d.%d.\n", | 326 | fprintf(stderr, "SSH Version %s, protocol version %d.%d.\n", |
327 | SSH_VERSION, PROTOCOL_MAJOR, PROTOCOL_MINOR); | 327 | SSH_VERSION, PROTOCOL_MAJOR, PROTOCOL_MINOR); |
328 | #ifndef RSAREF | ||
329 | fprintf(stderr, "Compiled with SSL.\n"); | 328 | fprintf(stderr, "Compiled with SSL.\n"); |
330 | #else | ||
331 | fprintf(stderr, "Compiled with SSL (RSAref version).\n"); | ||
332 | #endif | ||
333 | if (opt == 'V') | 329 | if (opt == 'V') |
334 | exit(0); | 330 | exit(0); |
335 | debug_flag = 1; | 331 | debug_flag = 1; |
@@ -379,9 +379,6 @@ main(int ac, char **av) | |||
379 | case '?': | 379 | case '?': |
380 | default: | 380 | default: |
381 | fprintf(stderr, "sshd version %s\n", SSH_VERSION); | 381 | fprintf(stderr, "sshd version %s\n", SSH_VERSION); |
382 | #ifdef RSAREF | ||
383 | fprintf(stderr, "Compiled with RSAref.\n"); | ||
384 | #endif | ||
385 | fprintf(stderr, "Usage: %s [options]\n", av0); | 382 | fprintf(stderr, "Usage: %s [options]\n", av0); |
386 | fprintf(stderr, "Options:\n"); | 383 | fprintf(stderr, "Options:\n"); |
387 | fprintf(stderr, " -f file Configuration file (default %s)\n", SERVER_CONFIG_FILE); | 384 | fprintf(stderr, " -f file Configuration file (default %s)\n", SERVER_CONFIG_FILE); |