Lines 23-31
Link Here
|
23 |
#include <stdarg.h> |
23 |
#include <stdarg.h> |
24 |
#include <stdio.h> |
24 |
#include <stdio.h> |
25 |
#include <string.h> |
25 |
#include <string.h> |
|
|
26 |
#include <sys/file.h> |
26 |
#include <sys/types.h> |
27 |
#include <sys/types.h> |
27 |
#include <syslog.h> |
28 |
#include <syslog.h> |
28 |
#include <unistd.h> |
29 |
#include <unistd.h> |
|
|
30 |
#include <paths.h> |
29 |
|
31 |
|
30 |
#if defined(hpux) || defined(sunos) || defined(solaris) |
32 |
#if defined(hpux) || defined(sunos) || defined(solaris) |
31 |
# ifndef _PATH_LASTLOG |
33 |
# ifndef _PATH_LASTLOG |
Lines 332-337
last_login_read(pam_handle_t *pamh, int
Link Here
|
332 |
return retval; |
334 |
return retval; |
333 |
} |
335 |
} |
334 |
|
336 |
|
|
|
337 |
#ifndef __GLIBC__ |
338 |
static void logwtmp(const char * line, const char * name, const char * host) |
339 |
{ |
340 |
struct utmp u; |
341 |
memset(&u, 0, sizeof(u)); |
342 |
|
343 |
u.ut_pid = getpid(); |
344 |
u.ut_type = name[0] ? USER_PROCESS : DEAD_PROCESS; |
345 |
strncpy(u.ut_line, line, sizeof(u.ut_line)); |
346 |
strncpy(u.ut_name, name, sizeof(u.ut_name)); |
347 |
strncpy(u.ut_host, host, sizeof(u.ut_host)); |
348 |
gettimeofday(&(u.ut_tv), NULL); |
349 |
|
350 |
updwtmp(_PATH_WTMP, &u); |
351 |
} |
352 |
#endif /* __GLIBC__ */ |
353 |
|
335 |
static int |
354 |
static int |
336 |
last_login_write(pam_handle_t *pamh, int announce, int last_fd, |
355 |
last_login_write(pam_handle_t *pamh, int announce, int last_fd, |
337 |
uid_t uid, const char *user) |
356 |
uid_t uid, const char *user) |