c code to change current user password using PAM API

Kok, Auke sofar at foo-projects.org
Wed Jul 16 23:36:59 CEST 2008

ashish yadav wrote:
> Hi,
>  I want to write c code to change current user password.

cool idea!

> The code first check for current password & then set new password.
> The code must use PAM API just like passwd utility.
> Also code must work without user intervention ie only by argument current
> password & new password are given.
> So, can any one know that already this work is done  or  i can use  passwd
> utility in my c code using system command.

no, you cannot use the /sbin/passwd program in this work, since it allows other
applications to read the connection data between your progam and /sbin/passwd even
if you would program it correctly,

> Also may be user may not root which is using this application.

what you are trying to do is terribly complex and dangerous - which is why I
haven't seen many people do it yet. You need a terribly good knowledge of security
and how to handle secure data properly in something (as insecure) as gtk+

it's an interesting project but it's hard, and terribly treacherous. are you sure
you want to do this?


More information about the Xfce mailing list