summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-15 17:10:57 +1100
committerDamien Miller <djm@mindrot.org>1999-11-15 17:10:57 +1100
commit3f905872b0d15be24078c4db131f0ecdb5ebb5e6 (patch)
tree700210571ddc52d55dcbaabf593e52b5d7531c3f
parentc6d5ce86a9ed296dbc99b8fc593099a87830fd18 (diff)
- Merged more Solaris compability from Marc G. Fournier
<marc.fournier@acadiau.ca> - Wrote autoconf tests for __progname symbol
-rw-r--r--ChangeLog3
-rw-r--r--acconfig.h45
-rw-r--r--configure.in38
-rw-r--r--log-server.c9
-rw-r--r--ssh-add.c9
-rw-r--r--ssh-agent.c9
-rw-r--r--ssh-keygen.c9
-rw-r--r--ssh.c9
-rw-r--r--sshd.c6
9 files changed, 115 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a16d278b..8df749486 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
2719991114 3019991114
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, , )
55AC_CHECK_LIB(pam, pam_authenticate, , ) 55AC_CHECK_LIB(pam, pam_authenticate, , )
56 56
57dnl Checks for header files. 57dnl Checks for header files.
58AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h) 58AC_CHECK_HEADERS(pty.h endian.h paths.h lastlog.h shadow.h netgroup.h maillock.h)
59
60dnl Check for ut_host field in utmp
61AC_MSG_CHECKING([whether utmp.h has ut_host field])
62AC_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
67dnl Checks for library functions. 60dnl Checks for library functions.
68AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle setlogin) 61AC_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])
145fi 138fi
146 139
140dnl Check for ut_host field in utmp
141AC_MSG_CHECKING([whether utmp.h has ut_host field])
142AC_EGREP_HEADER(ut_host, utmp.h,
143 [AC_DEFINE(HAVE_HOST_IN_UTMP) AC_MSG_RESULT(yes); ],
144 [AC_MSG_RESULT(no)]
145)
146
147dnl Look for lastlog location
148AC_MSG_CHECKING([location of lastlog file])
149for 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
155done
156
157AC_MSG_CHECKING([whether libc defines __progname])
158AC_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
147AC_OUTPUT(Makefile) 169AC_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"
18RCSID("$Id: log-server.c,v 1.3 1999/11/15 04:25:10 damien Exp $"); 18RCSID("$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
26extern char *__progname;
27#else /* HAVE___PROGNAME */
28const char *__progname = "sshd";
29#endif /* HAVE___PROGNAME */
30
25static LogLevel log_level = SYSLOG_LEVEL_INFO; 31static LogLevel log_level = SYSLOG_LEVEL_INFO;
26static int log_on_stderr = 0; 32static int log_on_stderr = 0;
27static int log_facility = LOG_AUTH; 33static 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;
diff --git a/ssh-add.c b/ssh-add.c
index bf3d7faea..0f01d5dfd 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -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"
17RCSID("$Id: ssh-add.c,v 1.7 1999/11/15 03:25:30 damien Exp $"); 17RCSID("$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 $");
25int askpass(const char *filename, RSA *key, const char *saved_comment, char **comment); 25int 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
29extern char *__progname;
30#else /* HAVE___PROGNAME */
31const char *__progname = "ssh-add";
32#endif /* HAVE___PROGNAME */
33
28void 34void
29delete_file(AuthenticationConnection *ac, const char *filename) 35delete_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
39extern char *__progname;
40#else /* HAVE___PROGNAME */
41const char *__progname = "ssh-agent";
42#endif /* HAVE___PROGNAME */
43
38typedef struct 44typedef struct
39{ 45{
40 int fd; 46 int fd;
@@ -505,8 +511,6 @@ cleanup_exit(int i)
505void 511void
506usage() 512usage()
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"
17RCSID("$Id: ssh-keygen.c,v 1.3 1999/11/12 04:19:27 damien Exp $"); 17RCSID("$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
24extern char *__progname;
25#else /* HAVE___PROGNAME */
26const char *__progname = "ssh-keygen";
27#endif /* HAVE___PROGNAME */
28
23/* Generated private key. */ 29/* Generated private key. */
24RSA *private_key; 30RSA *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",
diff --git a/ssh.c b/ssh.c
index 2f3b5fc1b..43950f7c5 100644
--- a/ssh.c
+++ b/ssh.c
@@ -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"
21RCSID("$Id: ssh.c,v 1.8 1999/11/15 04:25:10 damien Exp $"); 21RCSID("$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
32extern char *__progname;
33#else /* HAVE___PROGNAME */
34const 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. */
33int debug_flag = 0; 39int 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",
diff --git a/sshd.c b/sshd.c
index 2eeb6d6b7..2bf8193b7 100644
--- a/sshd.c
+++ b/sshd.c
@@ -18,7 +18,7 @@ agent connections.
18*/ 18*/
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: sshd.c,v 1.19 1999/11/15 04:40:55 damien Exp $"); 21RCSID("$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>