change pam authtok from c code

Christopher J. Ruwe cjr at cruwe.de
Tue Dec 28 18:46:40 UTC 2010


I am trying to implement a feature in a UNIX passwd-programm. The
authok, which is to be the future passwd for login, is randomly
generated and stored in char * randstring[].

I want to get pam inject that randstring, so that this randstring is
the new password.

I have tried

retval = pam_set_item(pamh, PAM_AUTHTOK, randstring);

which does not work, although it returns PAM_SUCCESS. Eventually, I get
a permission denied error and the program exits. Can anybody point me
in the right direction or show me how to properly set a password from a
string in PAM API?

Thank you,
-- 
Christopher J. Ruwe
TZ GMT + 1




More information about the Pam-list mailing list