summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>1999-11-20 12:18:40 +1100
committerDamien Miller <djm@mindrot.org>1999-11-20 12:18:40 +1100
commitc6398efcbaa2c8fea00420940fcf99b183ff24e9 (patch)
treea431c08590880a435c51c2df9dc3d7b218a81b7b
parent36fb30f6dd11515087e6298cb17e96a3f2f5b679 (diff)
- Merged more Solaris support from Marc G. Fournier
<marc.fournier@acadiau.ca> - Wrote autoconf tests for integer bit-types - Fixed enabling kerberos support
-rw-r--r--ChangeLog6
-rw-r--r--TODO6
-rw-r--r--acconfig.h77
-rw-r--r--bsd-daemon.c5
-rw-r--r--bsd-login.c4
-rw-r--r--configure.in68
6 files changed, 149 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a60cb318..0bf1a5575 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
119991120
2 - Merged more Solaris support from Marc G. Fournier
3 <marc.fournier@acadiau.ca>
4 - Wrote autoconf tests for integer bit-types
5 - Fixed enabling kerberos support
6
119991119 719991119
2 - Merged PAM buffer overrun patch from Chip Salzenberg <chip@valinux.com> 8 - Merged PAM buffer overrun patch from Chip Salzenberg <chip@valinux.com>
3 - Merged OpenBSD CVS changes 9 - Merged OpenBSD CVS changes
diff --git a/TODO b/TODO
index e6a89d3a4..fffdb1caa 100644
--- a/TODO
+++ b/TODO
@@ -8,6 +8,8 @@
8 8
9- Fix paths in manpages using autoconf 9- Fix paths in manpages using autoconf
10 10
11- Enable libwrap support using autoconf switch
12
13- Better testing on non-PAM systems 11- Better testing on non-PAM systems
12
13- Replace the horror in acconfig.h which tries to comphensate for the
14 lack of u_intXX_t types. There must be a better way.
15
diff --git a/acconfig.h b/acconfig.h
index d5a12b2bc..a37c0823c 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -6,6 +6,9 @@
6/* Location of lastlog file */ 6/* Location of lastlog file */
7#undef LASTLOG_LOCATION 7#undef LASTLOG_LOCATION
8 8
9/* If lastlog is a directory */
10#undef LASTLOG_IS_DIR
11
9/* Location of random number pool */ 12/* Location of random number pool */
10#undef RANDOM_POOL 13#undef RANDOM_POOL
11 14
@@ -51,13 +54,22 @@
51/* Define if you want to allow MD5 passwords */ 54/* Define if you want to allow MD5 passwords */
52#undef HAVE_MD5_PASSWORDS 55#undef HAVE_MD5_PASSWORDS
53 56
57/* Data types */
58#undef HAVE_QUAD_T
59#undef HAVE_INTXX_T
60#undef HAVE_U_INTXX_T
61#undef HAVE_UINTXX_T
62
54@BOTTOM@ 63@BOTTOM@
55 64
56/* ******************* Shouldn't need to edit below this line ************** */ 65/* ******************* Shouldn't need to edit below this line ************** */
57 66
58#include <sys/types.h> /* For u_intXX_t */ 67# include <sys/types.h> /* For u_intXX_t */
59#include <sys/socket.h> /* For SHUT_XXXX */ 68# include <sys/socket.h> /* For SHUT_XXXX */
60#include <paths.h> /* For _PATH_XXX */ 69
70#ifdef HAVE_PATHS_H
71# include <paths.h> /* For _PATH_XXX */
72#endif
61 73
62#ifndef SHUT_RDWR 74#ifndef SHUT_RDWR
63enum 75enum
@@ -71,16 +83,63 @@ enum
71}; 83};
72#endif 84#endif
73 85
74#if !defined(u_int32_t) && defined(uint32_t) 86/* If sys/types.h does not supply intXX_t, supply them ourselves */
75#define u_int32_t uint32_t 87/* (or die trying) */
88#ifndef HAVE_INTXX_T
89# if (SIZEOF_SHORT_INT == 2)
90# define int16_t short int
91# else
92# error "16 bit int type not found."
93# endif
94# if (SIZEOF_INT == 4)
95# define int32_t int
96# else
97# error "32 bit int type not found."
98# endif
99# if (SIZEOF_LONG_INT == 8)
100# define int64_t long int
101# else
102# if (SIZEOF_LONG_LONG_INT == 8)
103# define int64_t long long int
104# else
105# error "64 bit int type not found."
106# endif
107# endif
76#endif 108#endif
77 109
78#if !defined(u_int16_t) && defined(uint16_t) 110/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
79#define u_int16_t uint16_t 111#ifndef HAVE_U_INTXX_T
112# ifdef HAVE_UINTXX_T
113# define u_int16_t uint16_t
114# define u_int32_t uint32_t
115# define u_int64_t uint64_t
116# else
117# if (SIZEOF_SHORT_INT == 2)
118# define u_int16_t unsigned short int
119# else
120# error "16 bit int type not found."
121# endif
122# if (SIZEOF_INT == 4)
123# define u_int32_t unsigned int
124# else
125# error "32 bit int type not found."
126# endif
127# if (SIZEOF_LONG_INT == 8)
128# define u_int64_t unsigned long int
129# else
130# if (SIZEOF_LONG_LONG_INT == 8)
131# define u_int64_t unsigned long long int
132# else
133# error "64 bit int type not found."
134# endif
135# endif
136# endif
80#endif 137#endif
81 138
82#if !defined(quad_t) && defined(int64_t) 139/* If quad_t is not supplied, then supply it now. We can rely on int64_t */
83#define quad_t int64_t 140/* being defined by the above */
141#ifndef HAVE_QUAD_T
142# define quad_t int64_t
84#endif 143#endif
85 144
86#ifndef _PATH_LASTLOG 145#ifndef _PATH_LASTLOG
diff --git a/bsd-daemon.c b/bsd-daemon.c
index 7b292c126..fe92b76b6 100644
--- a/bsd-daemon.c
+++ b/bsd-daemon.c
@@ -40,9 +40,12 @@ static char rcsid[] = "$OpenBSD: daemon.c,v 1.2 1996/08/19 08:22:13 tholo Exp $"
40#endif /* LIBC_SCCS and not lint */ 40#endif /* LIBC_SCCS and not lint */
41 41
42#include <fcntl.h> 42#include <fcntl.h>
43#include <paths.h>
44#include <unistd.h> 43#include <unistd.h>
45 44
45#ifdef HAVE_PATHS_H
46# include <paths.h>
47#endif
48
46int 49int
47daemon(nochdir, noclose) 50daemon(nochdir, noclose)
48 int nochdir, noclose; 51 int nochdir, noclose;
diff --git a/bsd-login.c b/bsd-login.c
index 8c84272f8..98010ec3c 100644
--- a/bsd-login.c
+++ b/bsd-login.c
@@ -37,7 +37,7 @@
37 37
38#if defined(LIBC_SCCS) && !defined(lint) 38#if defined(LIBC_SCCS) && !defined(lint)
39/* from: static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93"; */ 39/* from: static char sccsid[] = "@(#)login.c 8.1 (Berkeley) 6/4/93"; */
40static char *rcsid = "$Id: bsd-login.c,v 1.1 1999/11/19 04:32:34 damien Exp $"; 40static char *rcsid = "$Id: bsd-login.c,v 1.2 1999/11/20 01:18:40 damien Exp $";
41#endif /* LIBC_SCCS and not lint */ 41#endif /* LIBC_SCCS and not lint */
42 42
43#include <sys/types.h> 43#include <sys/types.h>
@@ -58,6 +58,7 @@ login(utp)
58 58
59 tty = ttyslot(); 59 tty = ttyslot();
60 if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) { 60 if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) {
61#ifdef HAVE_HOST_IN_UTMP
61 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); 62 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
62 /* 63 /*
63 * Prevent luser from zero'ing out ut_host. 64 * Prevent luser from zero'ing out ut_host.
@@ -70,6 +71,7 @@ login(utp)
70 strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 && 71 strncmp(old_ut.ut_line, utp->ut_line, UT_LINESIZE) == 0 &&
71 strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0) 72 strncmp(old_ut.ut_name, utp->ut_name, UT_NAMESIZE) == 0)
72 (void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE); 73 (void)memcpy(utp->ut_host, old_ut.ut_host, UT_HOSTSIZE);
74#endif /* HAVE_HOST_IN_UTMP */
73 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); 75 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
74 (void)write(fd, utp, sizeof(struct utmp)); 76 (void)write(fd, utp, sizeof(struct utmp));
75 (void)close(fd); 77 (void)close(fd);
diff --git a/configure.in b/configure.in
index 649c789dc..2a4a2c7de 100644
--- a/configure.in
+++ b/configure.in
@@ -70,6 +70,57 @@ AC_CHECK_FUNC(daemon,
70 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])] 70 [AC_CHECK_LIB(bsd, daemon, [LIBS="$LIBS -lbsd"; AC_DEFINE(HAVE_DAEMON)])]
71) 71)
72 72
73dnl Checks for data types
74AC_CHECK_SIZEOF(short int, 2)
75AC_CHECK_SIZEOF(int, 4)
76AC_CHECK_SIZEOF(long int, 4)
77AC_CHECK_SIZEOF(long long int, 8)
78
79dnl More checks for data types
80AC_MSG_CHECKING([For quad_t])
81AC_TRY_COMPILE(
82 [#include <sys/types.h>],
83 [quad_t a; a = 1235;],
84 [
85 AC_DEFINE(HAVE_QUAD_T)
86 AC_MSG_RESULT(yes)
87 ],
88 [AC_MSG_RESULT(no)]
89)
90
91AC_MSG_CHECKING([For intXX_t types])
92AC_TRY_COMPILE(
93 [#include <sys/types.h>],
94 [int16_t a; int32_t b; a = 1235; b = 1235;],
95 [
96 AC_DEFINE(HAVE_INTXX_T)
97 AC_MSG_RESULT(yes)
98 ],
99 [AC_MSG_RESULT(no)]
100)
101
102AC_MSG_CHECKING([For u_intXX_t types])
103AC_TRY_COMPILE(
104 [#include <sys/types.h>],
105 [u_int16_t c; u_int32_t d; c = 1235; d = 1235;],
106 [
107 AC_DEFINE(HAVE_U_INTXX_T)
108 AC_MSG_RESULT(yes)
109 ],
110 [AC_MSG_RESULT(no)]
111)
112
113AC_MSG_CHECKING([For uintXX_t types])
114AC_TRY_COMPILE(
115 [#include <sys/types.h>],
116 [uint16_t c; uint32_t d; c = 1235; d = 1235;],
117 [
118 AC_DEFINE(HAVE_UINTXX_T)
119 AC_MSG_RESULT(yes)
120 ],
121 [AC_MSG_RESULT(no)]
122)
123
73dnl Check whether use wants to disable the external ssh-askpass 124dnl Check whether use wants to disable the external ssh-askpass
74INSTALL_ASKPASS="yes" 125INSTALL_ASKPASS="yes"
75AC_MSG_CHECKING([whether to enable external ssh-askpass support]) 126AC_MSG_CHECKING([whether to enable external ssh-askpass support])
@@ -158,14 +209,23 @@ dnl Look for lastlog location
158AC_MSG_CHECKING([location of lastlog file]) 209AC_MSG_CHECKING([location of lastlog file])
159for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do 210for lastlog in /var/log/lastlog /var/adm/lastlog /etc/security/lastlog ; do
160 if test -f $lastlog ; then 211 if test -f $lastlog ; then
161 gotlastlog="yes" 212 gotlastlog="file"
162 AC_MSG_RESULT($lastlog) 213 break
163 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog") 214 fi
215 if test -d $lastlog ; then
216 gotlastlog="dir"
164 break 217 break
165 fi 218 fi
166done 219done
167if test -z "$gotlastlog" ; then 220if test -z "$gotlastlog" ; then
168 AC_MSG_ERROR([*** Cannot find lastlog ***]) 221 AC_MSG_ERROR([*** Cannot find lastlog ***])
222else
223 if test "x$gotlastlog" = "xdir" ; then
224 AC_DEFINE(LASTLOG_IS_DIR)
225 AC_MSG_ERROR([*** Directory-based lastlogs are not yet supported ***])
226 fi
227 AC_MSG_RESULT($lastlog)
228 AC_DEFINE_UNQUOTED(LASTLOG_LOCATION, "$lastlog")
169fi 229fi
170 230
171AC_MSG_CHECKING([whether libc defines __progname]) 231AC_MSG_CHECKING([whether libc defines __progname])
@@ -191,7 +251,7 @@ AC_ARG_WITH(kerberos4,
191) 251)
192 252
193dnl Check whether user wants AFS support 253dnl Check whether user wants AFS support
194AC_ARG_WITH(kerberos4, 254AC_ARG_WITH(afs,
195 [ --with-afs Enable AFS support], 255 [ --with-afs Enable AFS support],
196 [ 256 [
197 AC_DEFINE(AFS) 257 AC_DEFINE(AFS)