in reply to View last login times of everyone on your system

Hi, I finally got around to trying this script on my Linux system, and it has a problem where it only reports for root UID 0. When running the script:
root 0 Mon Jan 19 09:02:58 2004 tty1
but when I run "lastlog -u zentara" I can get
zentara tty6 Mon Jan 19 09:03:13 -0500 2004
in addition to root. I tried messing with your script, but had no luck. Any reason why?

Replies are listed 'Best First'.
•Re: Re: View last login times of everyone on your system
by merlyn (Sage) on Jan 19, 2004 at 15:34 UTC
    On Linux, the lastlog.h is different. Since I don't have access to a Linux system, I can't look there, but you need to examine the header file and figure out the right sizes for the struct. Apparently it's not "8" and "256".

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      OK, on linux it's
      my $struct_lastlog = "L a32 a256";