Vulnerability Development mailing list archives

Re: WTMP file


From: Valdis.Kletnieks () vt edu
Date: Wed, 05 Nov 2003 19:51:26 -0500

On Wed, 05 Nov 2003 17:58:42 +0100, BORJA RUIZ CASTRO MORON <padre () fedro ugr es>  said:

while((acceso=getpwent())!=NULL) { 
lseek(fd,sizeof(struct utmp)*acceso->pw_uid,SEEK_SET);
pututline(&rosita);
} 

So if you're going to smash every single entry, why did you bother
doing a test for the username?

Other issues:

Your system may use a utmpx format rather than utmp.

Note the distinction between utmp and wtmp files.

Use the _PATH_UTMP and/or _PATH_WTMP macros that most sane systems give you,
in case the file isn't in /var/log...

Attachment: _bin
Description:


Current thread: