Operating System - HP-UX
1833514 Members
3359 Online
110061 Solutions
New Discussion

Replacement code for yppasswd

 
Travis Rebok
Advisor

Replacement code for yppasswd

I needed to be able to change almost all user's passwords on the server so I created a C program to run in batch which mimics the interactive passwd command (thanks to Clay's help).This program utilizes the getpwent() and putpwent() functions to go throught the /etc/passwd file on the local machine and do the password modiciations in a batch mode. This is fine if I run on a machine not using NIS.

However, I need to run on a machine using NIS as well, so I need to mimic yppasswd(3N) command for running in batch(the same way I was able to mimic passwd command with the use of getpwent() and putpwent() commands).

Does anyone know what functions I can use in a C program to mimic the yppasswd command? Or where I might be able to find a program as example?
Thanks.