Operating System - HP-UX
1833777 Members
1816 Online
110063 Solutions
New Discussion

recording successful pwd changes via putprpwnam()

 
David Nixon
Valued Contributor

recording successful pwd changes via putprpwnam()

I am testing a password changing application that uses the putprpwnam() function to update the "u_pwd" field of a user's record
in a Trusted system database: this works fine.

I also attempt to time stamp password changes; by setting the "u_succhg" field:
This only works if the record already contains
that field.

The majority of my Trusted system records lack a "u_succhg" field: what tool could I use
to create the missing entries?

David.

2 REPLIES 2
Zeev Schultz
Honored Contributor

Re: recording successful pwd changes via putprpwnam()

IMHO its modified by passwd command.
From the prpasswd(4) man pg:

u_succhg The time in this field is a time_t value that indicates the time of the last successful password change. This field should only be set by programs that can be used to change the account password.

What type of value are you using there, not some int/long but time_t I guess?

I mean it looks like digging a little bit about syscalls used by passwd could also help.

rgds

Zeev
So computers don't think yet. At least not chess computers. - Seymour Cray
David Nixon
Valued Contributor

Re: recording successful pwd changes via putprpwnam()

Needed to set the relevant flag in
the bitmap structure for getprpwent(3) routines.

prpwd.uflg.fg_schange=1; prpwd.ufld.fd_schange=tstamp;

...before calling putprpwnam().