diff options
author | andre <andre> | 2000-06-03 14:57:40 +0000 |
---|---|---|
committer | andre <andre> | 2000-06-03 14:57:40 +0000 |
commit | 2ff7b5d02817eb74a3ac2bf02eadef127b09d77c (patch) | |
tree | 13273092785271978f00ba33f3b14519d5ca1409 /defines.h | |
parent | e340f73b53aa3451f88fd9d41b652b659b0398f8 (diff) |
Added new login recording code
Added test program for login code (make logintest)
Diffstat (limited to 'defines.h')
-rw-r--r-- | defines.h | 125 |
1 files changed, 76 insertions, 49 deletions
@@ -19,14 +19,6 @@ | |||
19 | # include <paths.h> /* For _PATH_XXX */ | 19 | # include <paths.h> /* For _PATH_XXX */ |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #ifdef HAVE_UTMP_H | ||
23 | # include <utmp.h> /* For _PATH_XXX */ | ||
24 | #endif | ||
25 | |||
26 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) | ||
27 | # include <utmpx.h> /* For _PATH_XXX */ | ||
28 | #endif | ||
29 | |||
30 | #ifdef HAVE_SYS_TIME_H | 22 | #ifdef HAVE_SYS_TIME_H |
31 | # include <sys/time.h> /* For timersub */ | 23 | # include <sys/time.h> /* For timersub */ |
32 | #endif | 24 | #endif |
@@ -161,47 +153,6 @@ typedef int ssize_t; | |||
161 | 153 | ||
162 | /* Paths */ | 154 | /* Paths */ |
163 | 155 | ||
164 | /* If _PATH_LASTLOG is not defined by system headers, set it to the */ | ||
165 | /* lastlog file detected by autoconf */ | ||
166 | #ifndef _PATH_LASTLOG | ||
167 | # ifdef LASTLOG_LOCATION | ||
168 | # define _PATH_LASTLOG LASTLOG_LOCATION | ||
169 | # endif | ||
170 | #endif | ||
171 | |||
172 | #ifndef _PATH_UTMP | ||
173 | # ifdef UTMP_FILE | ||
174 | # define _PATH_UTMP UTMP_FILE | ||
175 | # else | ||
176 | # define _PATH_UTMP "/var/adm/utmp" | ||
177 | # endif | ||
178 | #endif | ||
179 | |||
180 | #ifndef _PATH_WTMP | ||
181 | # ifdef WTMP_FILE | ||
182 | # define _PATH_WTMP WTMP_FILE | ||
183 | # else | ||
184 | # define _PATH_WTMP "/var/adm/wtmp" | ||
185 | # endif | ||
186 | #endif | ||
187 | |||
188 | #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) | ||
189 | # ifndef _PATH_UTMPX | ||
190 | # ifdef UTMPX_FILE | ||
191 | # define _PATH_UTMPX UTMPX_FILE | ||
192 | # else | ||
193 | # define _PATH_UTMPX "/var/adm/utmpx" | ||
194 | # endif | ||
195 | # endif | ||
196 | # ifndef _PATH_WTMPX | ||
197 | # ifdef WTMPX_FILE | ||
198 | # define _PATH_WTMPX WTMPX_FILE | ||
199 | # else | ||
200 | # define _PATH_WTMPX "/var/adm/wtmp" | ||
201 | # endif | ||
202 | # endif | ||
203 | #endif | ||
204 | |||
205 | #ifndef _PATH_BSHELL | 156 | #ifndef _PATH_BSHELL |
206 | # define _PATH_BSHELL "/bin/sh" | 157 | # define _PATH_BSHELL "/bin/sh" |
207 | #endif | 158 | #endif |
@@ -297,4 +248,80 @@ typedef int ssize_t; | |||
297 | # define atexit(a) on_exit(a) | 248 | # define atexit(a) on_exit(a) |
298 | #endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */ | 249 | #endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */ |
299 | 250 | ||
251 | /** | ||
252 | ** login recorder definitions | ||
253 | **/ | ||
254 | |||
255 | /* preprocess */ | ||
256 | |||
257 | #ifdef HAVE_UTMP_H | ||
258 | # ifdef HAVE_TIME_IN_UTMP | ||
259 | # include <time.h> | ||
260 | # endif | ||
261 | # include <utmp.h> | ||
262 | #endif | ||
263 | #ifdef HAVE_UTMPX_H | ||
264 | # ifdef HAVE_TV_IN_UTMPX | ||
265 | # include <sys/time.h> | ||
266 | # endif | ||
267 | # include <utmpx.h> | ||
268 | #endif | ||
269 | #ifdef HAVE_LASTLOG_H | ||
270 | # include <lastlog.h> | ||
271 | #endif | ||
272 | #ifdef HAVE_PATHS_H | ||
273 | # include <paths.h> | ||
274 | #endif | ||
275 | |||
276 | /* FIXME: put default paths back in */ | ||
277 | #if !defined(UTMP_FILE) && defined(_PATH_UTMP) | ||
278 | # define UTMP_FILE _PATH_UTMP | ||
279 | #endif | ||
280 | #if !defined(WTMP_FILE) && defined(_PATH_WTMP) | ||
281 | # define WTMP_FILE _PATH_WTMP | ||
282 | #endif | ||
283 | /* pick up the user's location for lastlog if given */ | ||
284 | #ifdef CONF_LASTLOG_FILE | ||
285 | # define LASTLOG_FILE CONF_LASTLOG_FILE | ||
286 | #endif | ||
287 | #if !defined(LASTLOG_FILE) && defined(_PATH_LASTLOG) | ||
288 | # define LASTLOG_FILE _PATH_LASTLOG | ||
289 | #endif | ||
290 | |||
291 | |||
292 | /* The login() library function in libutil is first choice */ | ||
293 | #if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN) | ||
294 | # define USE_LOGIN | ||
295 | |||
296 | #else | ||
297 | /* Simply select your favourite login types. */ | ||
298 | /* Can't do if-else because some systems use several... <sigh> */ | ||
299 | # if defined(UTMPX_FILE) && !defined(DISABLE_UTMPX) | ||
300 | # define USE_UTMPX | ||
301 | # endif | ||
302 | # if defined(UTMP_FILE) && !defined(DISABLE_UTMP) | ||
303 | # define USE_UTMP | ||
304 | # endif | ||
305 | # if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX) | ||
306 | # define USE_WTMPX | ||
307 | # endif | ||
308 | # if defined(WTMP_FILE) && !defined(DISABLE_WTMP) | ||
309 | # define USE_WTMP | ||
310 | # endif | ||
311 | |||
312 | #endif | ||
313 | |||
314 | /* I hope that the presence of LASTLOG_FILE is enough to detect this */ | ||
315 | #if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG) | ||
316 | # define USE_LASTLOG | ||
317 | #endif | ||
318 | |||
319 | /* which type of time to use? (api.c) */ | ||
320 | #ifdef HAVE_SYS_TIME_H | ||
321 | # define USE_TIMEVAL | ||
322 | #endif | ||
323 | |||
324 | /** end of login recorder definitions */ | ||
325 | |||
326 | |||
300 | #endif /* _DEFINES_H */ | 327 | #endif /* _DEFINES_H */ |