[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

/etc/shadow and /etc/passwd I/O



Hi all,
 
I´m studying PAM and now I´m facing a dilemma: I want to create a small program like "/bin/passwd", to allow one user to change his/her shadowed password or someone´s password based on  pre-defined polices (Ok, I know it was already built, but I want to know the details abou PAM, GETPWNAM, etc).
 
I have found source from shadow-utils, PAM, passwd, et cetera, and in almost all of them, the I/O handling is made by shadowio.c, passwdio.c or commonio.c, from "Julianne Frances Haugh" source.
 
My questions are:
Do I must get those files and compile them with my own source, or is there a lib or another way to use functions like spw_update, spw_lock to do the job ?
 
How is the "link" between a programa like mine (to allow a user to change your own password) and PAM ? For example, in Julianne's passwd.c there are a lot of "#ifndef USE_PAM" but, for what ? I didn't understand the context at all.
 
I'm not sure that my questions are clear, but any help is welcome!
 
Thanks in advance,
 
Valdir Leite
Sao Paulo
Brasil

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]