AC_TYPE_GETGROUPS
AC_TYPE_SIGNAL
AC_FUNC_UTIME_NULL
-AC_FUNC_STRFTIME
AC_REPLACE_FUNCS(mkdir putgrent putpwent putspent rename rmdir)
AC_REPLACE_FUNCS(sgetgrent sgetpwent sgetspent)
AC_REPLACE_FUNCS(snprintf strcasecmp strdup strerror strstr)
void failprint (const struct faillog *fail)
{
struct tm *tp;
-
-#if HAVE_STRFTIME
char lasttimeb[256];
char *lasttime = lasttimeb;
-#else
- char *lasttime;
-#endif
time_t NOW;
if (0 == fail->fail_cnt) {
tp = localtime (&(fail->fail_time));
(void) time (&NOW);
-#if HAVE_STRFTIME
/*
* Print all information we have.
*/
(void) strftime (lasttimeb, sizeof lasttimeb, "%c", tp);
-#else
-
- /*
- * Do the same thing, but don't use strftime since it
- * probably doesn't exist on this system
- */
- lasttime = asctime (tp);
- lasttime[24] = '\0';
- if ((NOW - fail->fail_time) < YEAR) {
- lasttime[19] = '\0';
- }
- if ((NOW - fail->fail_time) < DAY) {
- lasttime = lasttime + 11;
- }
-
- if (' ' == *lasttime) {
- lasttime++;
- }
-#endif
/*@-formatconst@*/
(void) printf (ngettext ("%d failure since last login.\n"
"Last was %s on %s.\n",
static void print_date (time_t date)
{
-#ifdef HAVE_STRFTIME
struct tm *tp;
char buf[80];
char format[80];
(void) strftime (buf, sizeof buf, format, tp);
(void) puts (buf);
}
-#else
- struct tm *tp;
- char *cp = NULL;
-
- tp = gmtime (&date);
- if (NULL != tp) {
- cp = asctime (tp);
- }
- if (NULL != cp) {
- (void) printf ("%6.6s, %4.4s\n", cp + 4, cp + 20);
- } else {
- (void) printf ("time_t: %lu\n", date);
- }
-#endif
}
/*
off_t offset;
struct faillog fl;
time_t now;
-
-#ifdef HAVE_STRFTIME
char *cp;
char ptime[80];
-#endif
if (NULL == pw) {
return;
fprintf (stderr, "Cannot read time from faillog.\n");
return;
}
-#ifdef HAVE_STRFTIME
strftime (ptime, sizeof (ptime), "%D %H:%M:%S %z", tm);
cp = ptime;
-#endif
+
printf ("%-9s %5d %5d ",
pw->pw_name, fl.fail_cnt, fl.fail_max);
- /* FIXME: cp is not defined ifndef HAVE_STRFTIME */
printf ("%s %s", cp, fl.fail_line);
if (0 != fl.fail_locktime) {
if ( ((fl.fail_time + fl.fail_locktime) > now)
time_t ll_time;
off_t offset;
struct lastlog ll;
-
-#ifdef HAVE_STRFTIME
char ptime[80];
-#endif
#ifdef HAVE_LL_HOST
int maxIPv6Addrlen;
ll_time = ll.ll_time;
tm = localtime (&ll_time);
-#ifdef HAVE_STRFTIME
strftime (ptime, sizeof (ptime), "%a %b %e %H:%M:%S %z %Y", tm);
cp = ptime;
-#else
- cp = asctime (tm);
- cp[24] = '\0';
-#endif
if (ll.ll_time == (time_t) 0) {
cp = _("**Never logged in**\0");
#ifdef RLOGIN
char term[128] = "";
#endif /* RLOGIN */
-#if defined(HAVE_STRFTIME) && !defined(USE_PAM)
+#if !defined(USE_PAM)
char ptime[80];
#endif
unsigned int delay;
&& (ll.ll_time != 0)) {
time_t ll_time = ll.ll_time;
-#ifdef HAVE_STRFTIME
(void) strftime (ptime, sizeof (ptime),
"%a %b %e %H:%M:%S %z %Y",
localtime (&ll_time));
printf (_("Last login: %s on %s"),
ptime, ll.ll_line);
-#else
- printf (_("Last login: %.19s on %s"),
- ctime (&ll_time), ll.ll_line);
-#endif
#ifdef HAVE_LL_HOST /* __linux__ || SUN4 */
if ('\0' != ll.ll_host[0]) {
printf (_(" from %.*s"),