Hi!
I just need a way to write via stdin to "passwd" or "chpasswd" or whatever... PvdH> Might I add yppasswd to that on my own behalf? I could hack the source, PvdH> but would prefer something more docile.
I think it should work but I'm not sure because I don't use NIS/YP...
The problem in my case was to find a possibility to write to the
passwd-tools via stdin. The normal 'passwd' does not support this, I
don't know if 'yppasswd' reads from stdin?
If so, you could just do it like I did it for Samba:
char popenstr[256]="yppasswd ";
FILE *fhd_w;
strcat(popenstr,username);
//(so you will a have string like "yppasswd myuser")
fhd_w = popen(popenstr,"w")) ==NULL;
fprintf(fhd_w,"%s\n",key); //"enter" password :)
fprintf(fhd_w,"%s\n",key); //confirm it
//the fprintf's just type in the passwords two times like
//a normal input on the shell
Or perhaps there is something like a 'useradd'-skript for NIS that reads
from stdin?
Bye.