Re: setting a random password with PAM API

2011-01-05 Thread Christopher J. Ruwe
On Wed, 05 Jan 2011 11:45:08 +0100
Dag-Erling Smørgrav  wrote:

> "Christopher J. Ruwe"  writes:
> > I am trying to implement the feature to set a random password like
> > in BSD "pw usermod -W" in the Solaris passwd. Regrettably, I have
> > not found or perhaps not understood the PAM API documentation on
> > how to _inject a given string_ into the change-auth-token function
> > pam_chauthtok(...), which always jumps in an interactive pw-changing
> > loop.
> 
> There is no reliable way to do that.  You don't even know that there
> is such a thing as a password.
> 
> DES

Thank you very much for your answer, although I suspected so, I still
hoped for another content. 

Kind regards,
-- 
Christopher J. Ruwe
TZ GMT + 1


signature.asc
Description: PGP signature


Re: setting a random password with PAM API

2011-01-05 Thread Dag-Erling Smørgrav
"Christopher J. Ruwe"  writes:
> I am trying to implement the feature to set a random password like in
> BSD "pw usermod -W" in the Solaris passwd. Regrettably, I have not
> found or perhaps not understood the PAM API documentation on how to
> _inject a given string_ into the change-auth-token function
> pam_chauthtok(...), which always jumps in an interactive pw-changing
> loop.

There is no reliable way to do that.  You don't even know that there is
such a thing as a password.

DES
-- 
Dag-Erling Smørgrav - d...@des.no
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"


setting a random password with PAM API

2010-12-29 Thread Christopher J. Ruwe
Hi,

First, I'd like to apologise for my choice of lists to post to ... the
question is more PAM-specific than FreeBSD, but the idea comes from
BSD, so I hope someone will have an idea or knows where to turn to (and
I don't know where to turn else).

I am trying to implement the feature to set a random password like in
BSD "pw usermod -W" in the Solaris passwd. Regrettably, I have not
found or perhaps not understood the PAM API documentation on how to
_inject a given string_ into the change-auth-token function
pam_chauthtok(...), which always jumps in an interactive pw-changing
loop.

After I have generated a random string char * randstring, I have tried
setting that string using

retval = pam_set_item( pamh, PAM_AUTHTOK, randstring);
 
which returns PAM_SUCCESS. The password / authentication token remains
unchanged, however. My second idea, i.e., using pam_sm_chauthtok(...),
did not work, either, as I have not understood the arguments to be
passed.

Should anybody know how to inject a given/known string into PAM to set
a user password, know where to look for documentation regarding that
issue or have another idea, I would really appreciate it ... and again
my apologies for being more than just slightly off topic.

Kind regards,
-- 
Christopher J. Ruwe
TZ GMT + 1


signature.asc
Description: PGP signature