summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--acconfig.h209
-rw-r--r--configure.in11
-rw-r--r--defines.h207
4 files changed, 227 insertions, 202 deletions
diff --git a/ChangeLog b/ChangeLog
index 46765e42a..9cf245473 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
2 - Automatically correct paths in manpages and configuration files. Patch 2 - Automatically correct paths in manpages and configuration files. Patch
3 and script from Andre Lucas <andre.lucas@dial.pipex.com> 3 and script from Andre Lucas <andre.lucas@dial.pipex.com>
4 - Removed credits from README to CREDITS file, updated. 4 - Removed credits from README to CREDITS file, updated.
5 - Added --with-default-path to specify custom path for server
6 - Removed #ifdef trickery from acconfig.h into defines.h
5 7
619991226 819991226
7 - Enabled utmpx support by default for Solaris 9 - Enabled utmpx support by default for Solaris
diff --git a/acconfig.h b/acconfig.h
index 2ed1033b7..15de34575 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -1,4 +1,7 @@
1/* config.h.in. Generated by hand, don't use autoheader. */ 1/* Generated automatically from acconfig.h by autoheader. */
2/* Please make your changes there */
3
4@TOP@
2 5
3/* SSL directory. */ 6/* SSL directory. */
4#undef ssldir 7#undef ssldir
@@ -100,207 +103,11 @@
100/* Define if you need to use IP address instead of hostname in $DISPLAY */ 103/* Define if you need to use IP address instead of hostname in $DISPLAY */
101#undef IPADDR_IN_DISPLAY 104#undef IPADDR_IN_DISPLAY
102 105
106/* Specify default $PATH */
107#undef USER_PATH
108
103@BOTTOM@ 109@BOTTOM@
104 110
105/* ******************* Shouldn't need to edit below this line ************** */ 111/* ******************* Shouldn't need to edit below this line ************** */
106 112
107#include <sys/types.h> /* For u_intXX_t */ 113#include "defines.h"
108#include <sys/socket.h> /* For SHUT_XXXX */
109
110#ifdef HAVE_PATHS_H
111# include <paths.h> /* For _PATH_XXX */
112#endif
113
114#ifdef HAVE_UTMP_H
115# include <utmp.h> /* For _PATH_XXX */
116#endif
117
118#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
119# include <utmpx.h> /* For _PATH_XXX */
120#endif
121
122#ifdef HAVE_SYS_TIME_H
123# include <sys/time.h> /* For timersub */
124#endif
125
126#ifdef HAVE_MAILLOCK_H
127#include <maillock.h>
128#endif
129
130#ifndef SHUT_RDWR
131enum
132{
133 SHUT_RD = 0, /* No more receptions. */
134 SHUT_WR, /* No more transmissions. */
135 SHUT_RDWR /* No more receptions or transmissions. */
136};
137# define SHUT_RD SHUT_RD
138# define SHUT_WR SHUT_WR
139# define SHUT_RDWR SHUT_RDWR
140#endif
141
142/* If sys/types.h does not supply intXX_t, supply them ourselves */
143/* (or die trying) */
144#ifndef HAVE_INTXX_T
145# if (SIZEOF_SHORT_INT == 2)
146# define int16_t short int
147# else
148# error "16 bit int type not found."
149# endif
150# if (SIZEOF_INT == 4)
151# define int32_t int
152# else
153# error "32 bit int type not found."
154# endif
155# if (SIZEOF_LONG_INT == 8)
156# define int64_t long int
157# else
158# if (SIZEOF_LONG_LONG_INT == 8)
159# define int64_t long long int
160# else
161# error "64 bit int type not found."
162# endif
163# endif
164#endif
165
166/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
167#ifndef HAVE_U_INTXX_T
168# ifdef HAVE_UINTXX_T
169# define u_int16_t uint16_t
170# define u_int32_t uint32_t
171# define u_int64_t uint64_t
172# else
173# if (SIZEOF_SHORT_INT == 2)
174# define u_int16_t unsigned short int
175# else
176# error "16 bit int type not found."
177# endif
178# if (SIZEOF_INT == 4)
179# define u_int32_t unsigned int
180# else
181# error "32 bit int type not found."
182# endif
183# if (SIZEOF_LONG_INT == 8)
184# define u_int64_t unsigned long int
185# else
186# if (SIZEOF_LONG_LONG_INT == 8)
187# define u_int64_t unsigned long long int
188# else
189# error "64 bit int type not found."
190# endif
191# endif
192# endif
193#endif
194
195/* If quad_t is not supplied, then supply it now. We can rely on int64_t */
196/* being defined by the above */
197#ifndef HAVE_QUAD_T
198# define quad_t int64_t
199#endif
200
201/* If _PATH_LASTLOG is not defined by system headers, set it to the */
202/* lastlog file detected by autoconf */
203#ifndef _PATH_LASTLOG
204# ifdef LASTLOG_LOCATION
205# define _PATH_LASTLOG LASTLOG_LOCATION
206# endif
207#endif
208
209#ifndef _PATH_UTMP
210# ifdef UTMP_FILE
211# define _PATH_UTMP UTMP_FILE
212# else
213# define _PATH_UTMP "/var/adm/utmp"
214# endif
215#endif
216
217#ifndef _PATH_WTMP
218# ifdef WTMP_FILE
219# define _PATH_WTMP WTMP_FILE
220# else
221# define _PATH_WTMP "/var/adm/wtmp"
222# endif
223#endif
224
225#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
226# ifndef _PATH_UTMPX
227# ifdef UTMPX_FILE
228# define _PATH_UTMPX UTMPX_FILE
229# else
230# define _PATH_UTMPX "/var/adm/utmpx"
231# endif
232# endif
233# ifndef _PATH_WTMPX
234# ifdef WTMPX_FILE
235# define _PATH_WTMPX WTMPX_FILE
236# else
237# define _PATH_WTMPX "/var/adm/wtmp"
238# endif
239# endif
240#endif
241
242#ifndef _PATH_BSHELL
243# define _PATH_BSHELL "/bin/sh"
244#endif
245
246#ifndef _PATH_STDPATH
247# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
248#endif
249
250#ifndef _PATH_DEVNULL
251# define _PATH_DEVNULL "/dev/null"
252#endif
253
254#ifndef MAILDIR
255# define MAILDIR MAIL_DIRECTORY
256#endif
257
258#if !defined(_PATH_MAILDIR) && defined(MAILDIR)
259# define _PATH_MAILDIR MAILDIR
260#endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
261
262#ifndef MAX
263# define MAX(a,b) (((a)>(b))?(a):(b))
264# define MIN(a,b) (((a)<(b))?(a):(b))
265#endif
266
267#ifndef timersub
268#define timersub(a, b, result) \
269 do { \
270 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
271 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
272 if ((result)->tv_usec < 0) { \
273 --(result)->tv_sec; \
274 (result)->tv_usec += 1000000; \
275 } \
276 } while (0)
277#endif
278
279/* In older versions of libpam, pam_strerror takes a single argument */
280#ifdef HAVE_OLD_PAM
281# define PAM_STRERROR(a,b) pam_strerror((b))
282#else
283# define PAM_STRERROR(a,b) pam_strerror((a),(b))
284#endif
285
286#ifndef __P
287# define __P(x) x
288#endif
289
290#if !defined(__GNUC__) || (__GNUC__ < 2)
291# define __attribute__(x)
292#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
293
294#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
295# define seteuid(a) setreuid(-1,a)
296#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
297
298#ifndef HAVE_INNETGR
299# define innetgr(a,b,c,d) (0)
300#endif /* HAVE_INNETGR */
301
302#ifndef _PATH_RSH
303# ifdef RSH_PATH
304# define _PATH_RSH RSH_PATH
305# endif /* RSH_PATH */
306#endif /* _PATH_RSH */
diff --git a/configure.in b/configure.in
index 6cfacd2db..17b392d8f 100644
--- a/configure.in
+++ b/configure.in
@@ -267,7 +267,7 @@ AC_EGREP_HEADER(syslen, utmpx.h,
267 267
268dnl Look for lastlog location 268dnl Look for lastlog location
269AC_ARG_WITH(lastlog, 269AC_ARG_WITH(lastlog,
270 [ --with-lastlog Location of lastlog file], 270 [ --with-lastlog=FILE Location of lastlog file],
271 [ 271 [
272 if test "x$withval" = "xno" ; then 272 if test "x$withval" = "xno" ; then
273 AC_DEFINE(DISABLE_LASTLOG) 273 AC_DEFINE(DISABLE_LASTLOG)
@@ -396,6 +396,15 @@ AC_ARG_WITH(ipaddr-display,
396 ] 396 ]
397) 397)
398 398
399AC_ARG_WITH(path,
400 [ --with-default-path=PATH Specify default \$PATH environment for server],
401 [
402 if test "x$withval" != "xno" ; then
403 AC_DEFINE_UNQUOTED(USER_PATH, $withval")
404 fi
405 ]
406)
407
399dnl Check for mail directory (last resort if we cannot get it from headers) 408dnl Check for mail directory (last resort if we cannot get it from headers)
400if test ! -z "$MAIL" ; then 409if test ! -z "$MAIL" ; then
401 maildir=`dirname $MAIL` 410 maildir=`dirname $MAIL`
diff --git a/defines.h b/defines.h
new file mode 100644
index 000000000..9d5d17f2b
--- /dev/null
+++ b/defines.h
@@ -0,0 +1,207 @@
1#include <sys/types.h> /* For u_intXX_t */
2#include <sys/socket.h> /* For SHUT_XXXX */
3
4#ifdef HAVE_PATHS_H
5# include <paths.h> /* For _PATH_XXX */
6#endif
7
8#ifdef HAVE_UTMP_H
9# include <utmp.h> /* For _PATH_XXX */
10#endif
11
12#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
13# include <utmpx.h> /* For _PATH_XXX */
14#endif
15
16#ifdef HAVE_SYS_TIME_H
17# include <sys/time.h> /* For timersub */
18#endif
19
20#ifdef HAVE_MAILLOCK_H
21#include <maillock.h>
22#endif
23
24#ifndef SHUT_RDWR
25enum
26{
27 SHUT_RD = 0, /* No more receptions. */
28 SHUT_WR, /* No more transmissions. */
29 SHUT_RDWR /* No more receptions or transmissions. */
30};
31# define SHUT_RD SHUT_RD
32# define SHUT_WR SHUT_WR
33# define SHUT_RDWR SHUT_RDWR
34#endif
35
36/* If sys/types.h does not supply intXX_t, supply them ourselves */
37/* (or die trying) */
38#ifndef HAVE_INTXX_T
39# if (SIZEOF_SHORT_INT == 2)
40# define int16_t short int
41# else
42# error "16 bit int type not found."
43# endif
44# if (SIZEOF_INT == 4)
45# define int32_t int
46# else
47# error "32 bit int type not found."
48# endif
49# if (SIZEOF_LONG_INT == 8)
50# define int64_t long int
51# else
52# if (SIZEOF_LONG_LONG_INT == 8)
53# define int64_t long long int
54# else
55# error "64 bit int type not found."
56# endif
57# endif
58#endif
59
60/* If sys/types.h does not supply u_intXX_t, supply them ourselves */
61#ifndef HAVE_U_INTXX_T
62# ifdef HAVE_UINTXX_T
63# define u_int16_t uint16_t
64# define u_int32_t uint32_t
65# define u_int64_t uint64_t
66# else
67# if (SIZEOF_SHORT_INT == 2)
68# define u_int16_t unsigned short int
69# else
70# error "16 bit int type not found."
71# endif
72# if (SIZEOF_INT == 4)
73# define u_int32_t unsigned int
74# else
75# error "32 bit int type not found."
76# endif
77# if (SIZEOF_LONG_INT == 8)
78# define u_int64_t unsigned long int
79# else
80# if (SIZEOF_LONG_LONG_INT == 8)
81# define u_int64_t unsigned long long int
82# else
83# error "64 bit int type not found."
84# endif
85# endif
86# endif
87#endif
88
89/* If quad_t is not supplied, then supply it now. We can rely on int64_t */
90/* being defined by the above */
91#ifndef HAVE_QUAD_T
92# define quad_t int64_t
93#endif
94
95/* If _PATH_LASTLOG is not defined by system headers, set it to the */
96/* lastlog file detected by autoconf */
97#ifndef _PATH_LASTLOG
98# ifdef LASTLOG_LOCATION
99# define _PATH_LASTLOG LASTLOG_LOCATION
100# endif
101#endif
102
103#ifndef _PATH_UTMP
104# ifdef UTMP_FILE
105# define _PATH_UTMP UTMP_FILE
106# else
107# define _PATH_UTMP "/var/adm/utmp"
108# endif
109#endif
110
111#ifndef _PATH_WTMP
112# ifdef WTMP_FILE
113# define _PATH_WTMP WTMP_FILE
114# else
115# define _PATH_WTMP "/var/adm/wtmp"
116# endif
117#endif
118
119#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
120# ifndef _PATH_UTMPX
121# ifdef UTMPX_FILE
122# define _PATH_UTMPX UTMPX_FILE
123# else
124# define _PATH_UTMPX "/var/adm/utmpx"
125# endif
126# endif
127# ifndef _PATH_WTMPX
128# ifdef WTMPX_FILE
129# define _PATH_WTMPX WTMPX_FILE
130# else
131# define _PATH_WTMPX "/var/adm/wtmp"
132# endif
133# endif
134#endif
135
136#ifndef _PATH_BSHELL
137# define _PATH_BSHELL "/bin/sh"
138#endif
139
140#ifdef USER_PATH
141# ifdef _PATH_STDPATH
142# undef _PATH_STDPATH
143# endif
144# define _PATH_STDPATH USER_PATH
145#endif
146
147#ifndef _PATH_STDPATH
148# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
149#endif
150
151#ifndef _PATH_DEVNULL
152# define _PATH_DEVNULL "/dev/null"
153#endif
154
155#ifndef MAILDIR
156# define MAILDIR MAIL_DIRECTORY
157#endif
158
159#if !defined(_PATH_MAILDIR) && defined(MAILDIR)
160# define _PATH_MAILDIR MAILDIR
161#endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
162
163#ifndef MAX
164# define MAX(a,b) (((a)>(b))?(a):(b))
165# define MIN(a,b) (((a)<(b))?(a):(b))
166#endif
167
168#ifndef timersub
169#define timersub(a, b, result) \
170 do { \
171 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
172 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
173 if ((result)->tv_usec < 0) { \
174 --(result)->tv_sec; \
175 (result)->tv_usec += 1000000; \
176 } \
177 } while (0)
178#endif
179
180/* In older versions of libpam, pam_strerror takes a single argument */
181#ifdef HAVE_OLD_PAM
182# define PAM_STRERROR(a,b) pam_strerror((b))
183#else
184# define PAM_STRERROR(a,b) pam_strerror((a),(b))
185#endif
186
187#ifndef __P
188# define __P(x) x
189#endif
190
191#if !defined(__GNUC__) || (__GNUC__ < 2)
192# define __attribute__(x)
193#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
194
195#if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
196# define seteuid(a) setreuid(-1,a)
197#endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
198
199#ifndef HAVE_INNETGR
200# define innetgr(a,b,c,d) (0)
201#endif /* HAVE_INNETGR */
202
203#ifndef _PATH_RSH
204# ifdef RSH_PATH
205# define _PATH_RSH RSH_PATH
206# endif /* RSH_PATH */
207#endif /* _PATH_RSH */