Re: using pam_sm_auth

Tomas Mraz <[email protected]>
Newsgroups gmane.linux.pam
Message-ID <[email protected]>
On Thu, 2011-10-06 at 00:16 -0400, [email protected] wrote: 
> Hi:
> 
> I'm createing a pam_sm_authenticate module for the gnome login windows, in this I
> need the userName and the password, I need to validate this information against a
> database, I have already obtained the username, and use pam_get_item(pamh,
> PAM_AUTHTOK, (const void **) pass);  to obtain the pass, where pass is a (char *),
> everything works fine, but when the user logs on, the variable pass is NULL, and I
> can not get the pass that the user put in the gnome login windows.
> 
> How can I get the password of a user usign pam_get_item, using the item_type
> (PAM_AUTHTOK), can somebody give an example.

If the module is supposed to be used only with Linux-PAM you can use
pam_get_authtok() extension function from it to get the password.
Otherwise you have to copy the code that calls conversation functions to
obtain the password.
-- 
Tomas Mraz
No matter how far down the wrong road you've gone, turn back.
                                              Turkish proverb
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.