diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | acconfig.h | 45 | ||||
-rw-r--r-- | configure.in | 38 | ||||
-rw-r--r-- | log-server.c | 9 | ||||
-rw-r--r-- | ssh-add.c | 9 | ||||
-rw-r--r-- | ssh-agent.c | 9 | ||||
-rw-r--r-- | ssh-keygen.c | 9 | ||||
-rw-r--r-- | ssh.c | 9 | ||||
-rw-r--r-- | sshd.c | 6 |
9 files changed, 115 insertions, 22 deletions
@@ -23,6 +23,9 @@ | |||
23 | [sshconnect.c] disconnect if getpeername() fails | 23 | [sshconnect.c] disconnect if getpeername() fails |
24 | - OpenBSD's changes to sshd.c broke the PAM stuff, re-merged it. | 24 | - OpenBSD's changes to sshd.c broke the PAM stuff, re-merged it. |
25 | - Various small cleanups to bring diff (against OpenBSD) size down. | 25 | - Various small cleanups to bring diff (against OpenBSD) size down. |
26 | - Merged more Solaris compability from Marc G. Fournier | ||
27 | <marc.fournier@acadiau.ca> | ||
28 | - Wrote autoconf tests for __progname symbol | ||
26 | 29 | ||
27 | 19991114 | 30 | 19991114 |
28 | - Solaris compilation fixes (still imcomplete) | 31 | - Solaris compilation fixes (still imcomplete) |
diff --git a/acconfig.h b/acconfig.h index 8678b7cdb..2844bdca2 100644 --- a/acconfig.h +++ b/acconfig.h | |||
@@ -3,7 +3,10 @@ | |||
3 | /* SSL directory. */ | 3 | /* SSL directory. */ |
4 | #undef ssldir | 4 | #undef ssldir |
5 | 5 | ||
6 | /* Random number pool */ | 6 | /* Location of lastlog file */ |
7 | #undef LASTLOG_LOCATION | ||
8 | |||
9 | /* Location of random number pool */ | ||
7 | #undef RANDOM_POOL | 10 | #undef RANDOM_POOL |
8 | 11 | ||
9 | /* Are we using the Entropy gathering daemon */ | 12 | /* Are we using the Entropy gathering daemon */ |
@@ -21,9 +24,12 @@ | |||
21 | /* Define is libutil has login() function */ | 24 | /* Define is libutil has login() function */ |
22 | #undef HAVE_LIBUTIL_LOGIN | 25 | #undef HAVE_LIBUTIL_LOGIN |
23 | 26 | ||
24 | /* Define if you *don't* want to use an external ssh-askpass */ | 27 | /* Define if you want external askpass support */ |
25 | #undef USE_EXTERNAL_ASKPASS | 28 | #undef USE_EXTERNAL_ASKPASS |
26 | 29 | ||
30 | /* Define if libc defines __progname */ | ||
31 | #undef HAVE___PROGNAME | ||
32 | |||
27 | @BOTTOM@ | 33 | @BOTTOM@ |
28 | 34 | ||
29 | /* ******************* Shouldn't need to edit below this line ************** */ | 35 | /* ******************* Shouldn't need to edit below this line ************** */ |
@@ -40,6 +46,9 @@ enum | |||
40 | }; | 46 | }; |
41 | #endif | 47 | #endif |
42 | 48 | ||
49 | #include <sys/types.h> /* For u_intXX_t */ | ||
50 | #include <paths.h> /* For _PATH_XXX */ | ||
51 | |||
43 | #if !defined(u_int32_t) && defined(uint32_t) | 52 | #if !defined(u_int32_t) && defined(uint32_t) |
44 | #define u_int32_t uint32_t | 53 | #define u_int32_t uint32_t |
45 | #endif | 54 | #endif |
@@ -47,3 +56,35 @@ enum | |||
47 | #if !defined(u_int16_t) && defined(uint16_t) | 56 | #if !defined(u_int16_t) && defined(uint16_t) |
48 | #define u_int16_t uint16_t | 57 | #define u_int16_t uint16_t |
49 | #endif | 58 | #endif |
59 | |||
60 | #ifndef _PATH_LASTLOG | ||
61 | # ifdef LASTLOG_LOCATION | ||
62 | # define _PATH_LASTLOG LASTLOG_LOCATION | ||
63 | # endif | ||
64 | #endif | ||
65 | |||
66 | #ifndef _PATH_UTMP | ||
67 | # ifdef UTMP_FILE | ||
68 | # define _PATH_UTMP UTMP_FILE | ||
69 | # endif | ||
70 | #endif | ||
71 | |||
72 | #ifndef _PATH_WTMP | ||
73 | # ifdef WTMP_FILE | ||
74 | # define _PATH_WTMP WTMP_FILE | ||
75 | # endif | ||
76 | #endif | ||
77 | |||
78 | #ifndef _PATH_BSHELL | ||
79 | # define _PATH_BSHELL "/bin/sh" | ||
80 | #endif | ||
81 | |||
82 | #ifndef _PATH_STDPATH | ||
83 | # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin:" | ||
84 | #endif | ||
85 | |||
86 | #ifndef _PATH_MAILDIR | ||
87 | # ifdef MAILDIR | ||
88 | # define _PATH_MAILDIR MAILDIR | ||
89 | # endif | ||
90 | #endif | ||
diff --git a/configure.in b/configure.in index fd6aea36b..9fe1a92ff 100644 --- a/configure.in +++ b/configure.in | |||
@@ -55,14 +55,7 @@ AC_CHECK_LIB(dl, dlopen, , ) | |||
55 | AC_CHECK_LIB(pam, pam_authenticate, , ) | 55 | AC_CHECK_LIB(pam, pam_authenticate, , ) |
56 | 56 | ||
57 | dnl Checks for header files. | 57 | dnl Checks for header files. |
58 | AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h) | 58 | AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h maillock.h) |
59 | |||
60 | dnl Check for ut_host field in utmp | ||
61 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) | ||
62 | AC_EGREP_HEADER(ut_host, utmp.h, | ||
63 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], | ||
64 | [AC_MSG_RESULT(no)] | ||
65 | ) | ||
66 | 59 | ||
67 | dnl Checks for library functions. | 60 | dnl Checks for library functions. |
68 | AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin) | 61 | AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin) |
@@ -144,4 +137,33 @@ if test -z "$RANDOM_POOL" -a -z "$EGD_POOL"; then | |||
144 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) | 137 | AC_MSG_ERROR([No random device found, and no EGD random pool specified]) |
145 | fi | 138 | fi |
146 | 139 | ||
140 | dnl Check for ut_host field in utmp | ||
141 | AC_MSG_CHECKING([whether utmp.h has ut_host field]) | ||
142 | AC_EGREP_HEADER(ut_host, utmp.h, | ||
143 | [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ], | ||
144 | [AC_MSG_RESULT(no)] | ||
145 | ) | ||
146 | |||
147 | dnl Look for lastlog location | ||
148 | AC_MSG_CHECKING([location of lastlog file]) | ||
149 | for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do | ||
150 | if test -f $lastlog ; then | ||
151 | AC_MSG_RESULT($lastlog) | ||
152 | AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") | ||
153 | break | ||
154 | fi | ||
155 | done | ||
156 | |||
157 | AC_MSG_CHECKING([whether libc defines __progname]) | ||
158 | AC_TRY_LINK([], | ||
159 | [extern char *__progname;], | ||
160 | [ | ||
161 | AC_DEFINE(HAVE___PROGNAME) | ||
162 | AC_MSG_RESULT(yes) | ||
163 | ], | ||
164 | [ | ||
165 | AC_MSG_RESULT(no) | ||
166 | ] | ||
167 | ) | ||
168 | |||
147 | AC_OUTPUT(Makefile) | 169 | AC_OUTPUT(Makefile) |
diff --git a/log-server.c b/log-server.c index 805df6b6f..42f567af4 100644 --- a/log-server.c +++ b/log-server.c | |||
@@ -15,13 +15,19 @@ to the system log. | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "includes.h" | 17 | #include "includes.h" |
18 | RCSID("$Id: log-server.c,v 1.3 1999/11/15 04:25:10 damien Exp $"); | 18 | RCSID("$Id: log-server.c,v 1.4 1999/11/15 06:10:57 damien Exp $"); |
19 | 19 | ||
20 | #include <syslog.h> | 20 | #include <syslog.h> |
21 | #include "packet.h" | 21 | #include "packet.h" |
22 | #include "xmalloc.h" | 22 | #include "xmalloc.h" |
23 | #include "ssh.h" | 23 | #include "ssh.h" |
24 | 24 | ||
25 | #ifdef HAVE___PROGNAME | ||
26 | extern char *__progname; | ||
27 | #else /* HAVE___PROGNAME */ | ||
28 | const char *__progname = "sshd"; | ||
29 | #endif /* HAVE___PROGNAME */ | ||
30 | |||
25 | static LogLevel log_level = SYSLOG_LEVEL_INFO; | 31 | static LogLevel log_level = SYSLOG_LEVEL_INFO; |
26 | static int log_on_stderr = 0; | 32 | static int log_on_stderr = 0; |
27 | static int log_facility = LOG_AUTH; | 33 | static int log_facility = LOG_AUTH; |
@@ -104,7 +110,6 @@ do_log(LogLevel level, const char *fmt, va_list args) | |||
104 | char fmtbuf[MSGBUFSIZE]; | 110 | char fmtbuf[MSGBUFSIZE]; |
105 | char *txt = NULL; | 111 | char *txt = NULL; |
106 | int pri = LOG_INFO; | 112 | int pri = LOG_INFO; |
107 | extern char *__progname; | ||
108 | 113 | ||
109 | if (level > log_level) | 114 | if (level > log_level) |
110 | return; | 115 | return; |
@@ -14,7 +14,7 @@ Adds an identity to the authentication server, or removes an identity. | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: ssh-add.c,v 1.7 1999/11/15 03:25:30 damien Exp $"); | 17 | RCSID("$Id: ssh-add.c,v 1.8 1999/11/15 06:10:57 damien Exp $"); |
18 | 18 | ||
19 | #include "rsa.h" | 19 | #include "rsa.h" |
20 | #include "ssh.h" | 20 | #include "ssh.h" |
@@ -25,6 +25,12 @@ RCSID("$Id: ssh-add.c,v 1.7 1999/11/15 03:25:30 damien Exp $"); | |||
25 | int askpass(const char *filename, RSA *key, const char *saved_comment, char **comment); | 25 | int askpass(const char *filename, RSA *key, const char *saved_comment, char **comment); |
26 | #endif /* USE_EXTERNAL_ASKPASS */ | 26 | #endif /* USE_EXTERNAL_ASKPASS */ |
27 | 27 | ||
28 | #ifdef HAVE___PROGNAME | ||
29 | extern char *__progname; | ||
30 | #else /* HAVE___PROGNAME */ | ||
31 | const char *__progname = "ssh-add"; | ||
32 | #endif /* HAVE___PROGNAME */ | ||
33 | |||
28 | void | 34 | void |
29 | delete_file(AuthenticationConnection *ac, const char *filename) | 35 | delete_file(AuthenticationConnection *ac, const char *filename) |
30 | { | 36 | { |
@@ -175,7 +181,6 @@ main(int argc, char **argv) | |||
175 | 181 | ||
176 | /* check if RSA support exists */ | 182 | /* check if RSA support exists */ |
177 | if (rsa_alive() == 0) { | 183 | if (rsa_alive() == 0) { |
178 | extern char *__progname; | ||
179 | 184 | ||
180 | fprintf(stderr, | 185 | fprintf(stderr, |
181 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", | 186 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", |
diff --git a/ssh-agent.c b/ssh-agent.c index 7f4543e92..27e064d64 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -35,6 +35,12 @@ RCSID("$OpenBSD: ssh-agent.c,v 1.17 1999/11/02 19:42:36 markus Exp $"); | |||
35 | #include <ssl/md5.h> | 35 | #include <ssl/md5.h> |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | #ifdef HAVE___PROGNAME | ||
39 | extern char *__progname; | ||
40 | #else /* HAVE___PROGNAME */ | ||
41 | const char *__progname = "ssh-agent"; | ||
42 | #endif /* HAVE___PROGNAME */ | ||
43 | |||
38 | typedef struct | 44 | typedef struct |
39 | { | 45 | { |
40 | int fd; | 46 | int fd; |
@@ -505,8 +511,6 @@ cleanup_exit(int i) | |||
505 | void | 511 | void |
506 | usage() | 512 | usage() |
507 | { | 513 | { |
508 | extern char *__progname; | ||
509 | |||
510 | fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION); | 514 | fprintf(stderr, "ssh-agent version %s\n", SSH_VERSION); |
511 | fprintf(stderr, "Usage: %s [-c | -s] [-k] [command {args...]]\n", | 515 | fprintf(stderr, "Usage: %s [-c | -s] [-k] [command {args...]]\n", |
512 | __progname); | 516 | __progname); |
@@ -524,7 +528,6 @@ main(int ac, char **av) | |||
524 | 528 | ||
525 | /* check if RSA support exists */ | 529 | /* check if RSA support exists */ |
526 | if (rsa_alive() == 0) { | 530 | if (rsa_alive() == 0) { |
527 | extern char *__progname; | ||
528 | fprintf(stderr, | 531 | fprintf(stderr, |
529 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", | 532 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", |
530 | __progname); | 533 | __progname); |
diff --git a/ssh-keygen.c b/ssh-keygen.c index 4d950aee8..10289cab7 100644 --- a/ssh-keygen.c +++ b/ssh-keygen.c | |||
@@ -14,12 +14,18 @@ Identity and host key generation and maintenance. | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | RCSID("$Id: ssh-keygen.c,v 1.3 1999/11/12 04:19:27 damien Exp $"); | 17 | RCSID("$Id: ssh-keygen.c,v 1.4 1999/11/15 06:10:57 damien Exp $"); |
18 | 18 | ||
19 | #include "rsa.h" | 19 | #include "rsa.h" |
20 | #include "ssh.h" | 20 | #include "ssh.h" |
21 | #include "xmalloc.h" | 21 | #include "xmalloc.h" |
22 | 22 | ||
23 | #ifdef HAVE___PROGNAME | ||
24 | extern char *__progname; | ||
25 | #else /* HAVE___PROGNAME */ | ||
26 | const char *__progname = "ssh-keygen"; | ||
27 | #endif /* HAVE___PROGNAME */ | ||
28 | |||
23 | /* Generated private key. */ | 29 | /* Generated private key. */ |
24 | RSA *private_key; | 30 | RSA *private_key; |
25 | 31 | ||
@@ -317,7 +323,6 @@ main(int ac, char **av) | |||
317 | 323 | ||
318 | /* check if RSA support exists */ | 324 | /* check if RSA support exists */ |
319 | if (rsa_alive() == 0) { | 325 | if (rsa_alive() == 0) { |
320 | extern char *__progname; | ||
321 | 326 | ||
322 | fprintf(stderr, | 327 | fprintf(stderr, |
323 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", | 328 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", |
@@ -18,7 +18,7 @@ Modified to work with SSL by Niels Provos <provos@citi.umich.edu> in Canada. | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: ssh.c,v 1.8 1999/11/15 04:25:10 damien Exp $"); | 21 | RCSID("$Id: ssh.c,v 1.9 1999/11/15 06:10:57 damien Exp $"); |
22 | 22 | ||
23 | #include "xmalloc.h" | 23 | #include "xmalloc.h" |
24 | #include "ssh.h" | 24 | #include "ssh.h" |
@@ -28,6 +28,12 @@ RCSID("$Id: ssh.c,v 1.8 1999/11/15 04:25:10 damien Exp $"); | |||
28 | #include "readconf.h" | 28 | #include "readconf.h" |
29 | #include "uidswap.h" | 29 | #include "uidswap.h" |
30 | 30 | ||
31 | #ifdef HAVE___PROGNAME | ||
32 | extern char *__progname; | ||
33 | #else /* HAVE___PROGNAME */ | ||
34 | const char *__progname = "ssh"; | ||
35 | #endif /* HAVE___PROGNAME */ | ||
36 | |||
31 | /* Flag indicating whether debug mode is on. This can be set on the | 37 | /* Flag indicating whether debug mode is on. This can be set on the |
32 | command line. */ | 38 | command line. */ |
33 | int debug_flag = 0; | 39 | int debug_flag = 0; |
@@ -399,7 +405,6 @@ main(int ac, char **av) | |||
399 | 405 | ||
400 | /* check if RSA support exists */ | 406 | /* check if RSA support exists */ |
401 | if (rsa_alive() == 0) { | 407 | if (rsa_alive() == 0) { |
402 | extern char *__progname; | ||
403 | 408 | ||
404 | fprintf(stderr, | 409 | fprintf(stderr, |
405 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", | 410 | "%s: no RSA support in libssl and libcrypto. See ssl(8).\n", |
@@ -18,7 +18,7 @@ agent connections. | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include "includes.h" | 20 | #include "includes.h" |
21 | RCSID("$Id: sshd.c,v 1.19 1999/11/15 04:40:55 damien Exp $"); | 21 | RCSID("$Id: sshd.c,v 1.20 1999/11/15 06:10:57 damien Exp $"); |
22 | 22 | ||
23 | #include "xmalloc.h" | 23 | #include "xmalloc.h" |
24 | #include "rsa.h" | 24 | #include "rsa.h" |
@@ -32,6 +32,10 @@ RCSID("$Id: sshd.c,v 1.19 1999/11/15 04:40:55 damien Exp $"); | |||
32 | #include "uidswap.h" | 32 | #include "uidswap.h" |
33 | #include "compat.h" | 33 | #include "compat.h" |
34 | 34 | ||
35 | #ifdef HAVE_MAILLOCK_H | ||
36 | # include <maillock.h> | ||
37 | #endif | ||
38 | |||
35 | #ifdef LIBWRAP | 39 | #ifdef LIBWRAP |
36 | #include <tcpd.h> | 40 | #include <tcpd.h> |
37 | #include <syslog.h> | 41 | #include <syslog.h> |