Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2002 01:22:08 -0700
From:      Bill Fenner <fenner@research.att.com>
To:        des@ofug.org
Cc:        current@FreeBSD.ORG
Subject:   Re: PAM & OpenSSH: two incorrect "last login"
Message-ID:  <200204220822.BAA11918@windsor.research.att.com>
References:   <20020420011633.GA66468@nagual.pp.ru> <xzp8z7iqrjp.fsf@flood.ping.uio.no> <200204212015.NAA06317@windsor.research.att.com> <xzp1yd846tp.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help

>Might, might not.  ISTR strftime() can't correctly emulate ctime(),
>but some other format might be preferrable.  Do you have a format
>string handy?

I'd think something like what "last" does would be good.

        d_first = (*nl_langinfo(D_MD_ORDER) == 'd');

...

        (void) strftime(ct, sizeof(ct), d_first ?
            (yflag ? "%a %e %b %Y %R" : "%a %e %b %R") :
            (yflag ? "%a %b %e %Y %R" : "%a %b %e %R"), tm);

except you probably want "%T" instead of "%R" if you want the seconds.
You could either pretend that yflag was not set (what ache was
suggesting) or set yflag if the year of the last login was not
this year (possibly more useful).

  Bill

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204220822.BAA11918>