From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96280725208272.tru64-unix-managers.marc@archive.invalid> From: Hasan Atasoy Date: Wed, 05 Jul 2000 14:31:51 +0000 To: tru64-unix-managers Subject: SUMMARY : getting finger style information X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96280725208272 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------InterScan_NT_MIME_Boundary" This is a multipart message in MIME format --------------InterScan_NT_MIME_Boundary Content-Type: text/plain; charset=iso-8859-9 Content-Transfer-Encoding: 7bit ****** Message from InterScan E-Mail VirusWall NT ****** ** No virus found in attached file noname.htm Bu mailin virus taramasi test programi ile yapilmistir. ***************** End of message *************** --------------InterScan_NT_MIME_Boundary Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable answer is from Bob Vickers /* thanks a lot for the c code that is =FD = want hundred percentage */ #include #include #include #include #include #define MAXUID 65535 #define MAXSHELL 20 #define USLENGTH 10 #define LASTLOG_FILE "/var/adm/lastlog" main(int argc, char *argv[]) { =09 time_t logtime; struct lastlog llrec; struct passwd *pw; uid_t uid; FILE *llfile; =09 struct userinfo { char name[USLENGTH+1]; char shell[MAXSHELL+1]; }; struct userinfo ui[MAXUID]; =09 setpwent(); =09 while (pw=3Dgetpwent()) { uid=3Dpw->pw_uid; if (uid >=3D MAXUID ) { fprintf(stderr, "lastlog: MAXUID=3D%d is too small", MAXUID); sprintf(ui[uid].name, "%ld", (long)uid ); } else strncpy(ui[uid].name, pw->pw_name, USLENGTH); strncpy( ui[uid].shell, pw->pw_shell, MAXSHELL); } =09 =09 llfile=3Dfopen(LASTLOG_FILE, "rb"); for (uid=3D0;;uid++) { if (fread(&llrec, sizeof llrec, 1, llfile) !=3D 1) break; if (ui[uid].name[0] =3D=3D NULL) continue; /* unassigned UID */ logtime=3Dllrec.ll_time; printf("%-10.10s %-19s%11ld ", ui[uid].name, ui[uid].shell, logtime); =20 if (logtime =3D=3D 0 ) printf("never logged on\n"); else printf("%s", ctime(&logtime)); } } Hasan Atasoy=20 Unix System Admin. Ihlas Finans Kurumu Sistem =DDleti=FEim M=FCd=FCrl=FCg=FC 29 Ekim C. No:23 34530=20 Y.bosna/Istanbul-Turkey ++90.212.454 1362 tel. =20 * hatasoy@ifk.com.tr --------------InterScan_NT_MIME_Boundary--