That's the libc macro for this file.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
done])
AC_DEFINE_UNQUOTED([_WTMP_FILE], ["$shadow_cv_logdir/wtmp"],
[Path for wtmp file.])
-AC_DEFINE_UNQUOTED([LASTLOG_FILE], ["$shadow_cv_logdir/lastlog"],
- [Path for lastlog file.])
AC_DEFINE_UNQUOTED([FAILLOG_FILE], ["$shadow_cv_logdir/faillog"],
[Path for faillog file.])
#include "config.h"
-#ident "$Id$"
-
-#include <sys/types.h>
+#include <lastlog.h>
+#include <paths.h>
#include <pwd.h>
#include <fcntl.h>
+#include <sys/types.h>
#include <time.h>
+
#include "defines.h"
-#include <lastlog.h>
#include "prototypes.h"
#include "string/memset/memzero.h"
#include "string/strcpy/strncpy.h"
* If the file does not exist, don't create it.
*/
- fd = open (LASTLOG_FILE, O_RDWR);
+ fd = open(_PATH_LASTLOG, O_RDWR);
if (-1 == fd) {
return;
}
if (lseek (fd, offset, SEEK_SET) != offset) {
SYSLOG ((LOG_WARN,
"Can't read last lastlog entry for UID %lu in %s. Entry not updated.",
- (unsigned long) pw->pw_uid, LASTLOG_FILE));
+ (unsigned long) pw->pw_uid, _PATH_LASTLOG));
(void) close (fd);
return;
}
err_close:
SYSLOG ((LOG_WARN,
"Can't write lastlog entry for UID %lu in %s: %m",
- (unsigned long) pw->pw_uid, LASTLOG_FILE));
+ (unsigned long) pw->pw_uid, _PATH_LASTLOG));
}
#include <getopt.h>
#include <lastlog.h>
+#include <paths.h>
#include <pwd.h>
#include <stdio.h>
#include <sys/stat.h>
#include "string/strftime.h"
-
-/*
- * Needed for MkLinux DR1/2/2.1 - J.
- */
-#ifndef LASTLOG_FILE
-#define LASTLOG_FILE "/var/log/lastlog"
-#endif
-
/*
* Global variables
*/
}
}
- lastlogfile = fopen (LASTLOG_FILE, (Cflg || Sflg)?"r+":"r");
+ lastlogfile = fopen(_PATH_LASTLOG, (Cflg || Sflg)?"r+":"r");
if (NULL == lastlogfile) {
- perror (LASTLOG_FILE);
+ perror(_PATH_LASTLOG);
exit (EXIT_FAILURE);
}
if (fstat (fileno (lastlogfile), &statbuf) != 0) {
fprintf (stderr,
_("%s: Cannot get the size of %s: %s\n"),
- Prog, LASTLOG_FILE, strerror (errno));
+ Prog, _PATH_LASTLOG, strerror(errno));
exit (EXIT_FAILURE);
}
#endif /* USE_PAM */
-#ifndef USE_PAM
-/*
- * Needed for MkLinux DR1/2/2.1 - J.
- */
-#ifndef LASTLOG_FILE
-#define LASTLOG_FILE "/var/log/lastlog"
-#endif
-#endif /* !USE_PAM */
/*
* Global variables
#include "pam_defs.h"
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
+#include <paths.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#define USER_DEFAULTS_FILE "/etc/default/useradd"
#define NEW_USER_FILE "/etc/default/nuaddXXXXXX"
#endif
-/*
- * Needed for MkLinux DR1/2/2.1 - J.
- */
-#ifndef LASTLOG_FILE
-#define LASTLOG_FILE "/var/log/lastlog"
-#endif
+
+
/*
* Global variables
*/
uid_t max_uid;
struct stat st;
- if (stat (LASTLOG_FILE, &st) != 0 || st.st_size <= offset_uid) {
+ if (stat(_PATH_LASTLOG, &st) != 0 || st.st_size <= offset_uid) {
return;
}
memzero (&ll, sizeof (ll));
- fd = open (LASTLOG_FILE, O_RDWR);
+ fd = open(_PATH_LASTLOG, O_RDWR);
if (-1 == fd) {
fprintf (stderr,
_("%s: failed to open the lastlog file for UID %lu: %s\n"),
#include "pam_defs.h"
#endif /* USE_PAM */
#endif /* ACCT_TOOLS_SETUID */
+#include <paths.h>
#include <stdio.h>
#include <strings.h>
#include <sys/stat.h>
off_t off_newuid = (off_t) user_newid * sizeof ll;
uid_t max_uid;
- if (access (LASTLOG_FILE, F_OK) != 0) {
+ if (access(_PATH_LASTLOG, F_OK) != 0) {
return;
}
return;
}
- fd = open (LASTLOG_FILE, O_RDWR);
+ fd = open(_PATH_LASTLOG, O_RDWR);
if (-1 == fd) {
fprintf (stderr,