Re: Passing information to application

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

 



Hi pammers :),


I want to do exactly the same...
and it bothered me since quite a long time! (Actually, it's my biggest
"problem")

I'm extending the pam_mysql module and want to fetch HOME and SHELL from a
MySQL db and pass them to the PAM application (login, ssh,...) to use them
accordingly.

What works (perfectly at least with login [tested]) is to specify shell
environment variables.
(It's done by setting them with 'pam_putenv' ; and login/ssh reads them
into the shell environment)

I browsed the application code of 'login' and 'ssh(/sshd)' to see how it
would be possible to specify the shell and home dir ...

What I found was, that they fetch the info, which SHELL to execute and
which HOME directory to use, directly by means of the functions you,
Jason, named (getpw*) and therefor (often) directly from /etc/passwd !

I've collected what I found on a web page:
  http://fvg.zapto.org/informatica/tbsc/welcome.php


Is there really no way to do it from a PAM module ???


I think it would be possible to do something like this by writing a new
(or using an existant) nss library...
Have a look at:
 /etc/nsswitch.conf
 man nssswitch.conf
 /lib/libnss_*
It's the 'Name Servicce Switch' package...
You can specify other "sources" than /etc/{passwd,shadow,group} !

I didn't look at it deeply yet...

Maybe, I'll write a nss library which gets that infos out of a MySQL
database...
(You can ask me at end of July if I've done so ;o) )


Does anyone see/think, that this wouldn't work ?

It would be very nice if we could do this with a PAM module !!!
... together with authentification, which, in fact, is something very
similar!


________________________________________
\|Jason Clifford <jason@xxxxxxxxxx> ha scrit als Wed, 28 May 2003 09:03:43
+0100 (BST):
 |On Tue, 27 May 2003, Wanner Vinicius Fagundes Lima wrote:
 |
 |> Is it posible to pass same information like user home_dir, UID or GID
from 
 |> a module to an application? I'd like to pass it to an application like

 |> login.
 |
 |Not from PAM however you don't need to. 
 |
 |All of this information is available via the standard getpw* system
calls. 
 |In the case of the data you specified you get retrieve all the
information 
 |you need by calling getpwnam. See man getpwnam for more details.

As I understood it, the problem was to _set_ (pass over to) these values,
not to _get_ (retrieve) them ;/

 |
 |Jason Clifford


PS:
I conldn't figure out a mailing list for login, nor for login-utils, nor
for util-linux :(
Anyone a hint ?


I'll appreciate your answers!
thanks,
sincerly,
blers salüds,
_________ 
Florian Verdet _goto
GnuPG: fvg.zapto.org/informatica/gpg.php
_______________________________________________

Pam-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/pam-list

[Index of Archives]     [Fedora Users]     [Kernel]     [Red Hat Install]     [Linux for the blind]     [Gimp]

  Powered by Linux