Malus has asked for the wisdom of the Perl Monks concerning the following question:

I am seeking information for writing PAM modules with PERL, not programs that use PAM.

For instance, a module to replace the normal /etc/pam.conf entry of

/usr/lib/security/pam_unix.so.1

with

/usr/lib/security/mypam.pl.so.1

for Unix-like Operating Systems.

Thank you for your time in advance,
Malus
  • Comment on PERL & PAM (Pluggable Authentication Modules)

Replies are listed 'Best First'.
Re: PERL & PAM (Pluggable Authentication Modules)
by hagus (Monk) on May 20, 2002 at 23:00 UTC
    I don't think such a thing is possible. You can get away with writing them in C++ though.

    On second thoughts, you might be able to write a bootstrapping .so which calls your perl code for you. But if you are good enough to do that, you would probably just code it directly in C/C++ yourself!

    There are three PAM guides you should examine, if you haven't already, this page contains them all.

    --
    Ash OS durbatulk, ash OS gimbatul,
    Ash OS thrakatulk, agh burzum-ishi krimpatul!
    Uzg-Microsoft-ishi amal fauthut burguuli.

Re: PERL & PAM (Pluggable Authentication Modules)
by Aristotle (Chancellor) on May 21, 2002 at 09:56 UTC
    This isn't directly possible. You'll need to write a shared lib that embeds Perl; you can go from there. It's likely going to be a lot of work though - probably much more than you will want to invest, judging from the fact that you'd prefer to write your PAM module in Perl.

    Makeshifts last the longest.

      It shouldn't be too hard to write a shared lib that makes RPC calls to a server writen in perl, listening on a unix or internet socket, implementing what the shared lib pretends to implement. There are already tons of PAM modules that consult various servers for information.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: PERL & PAM (Pluggable Authentication Modules)
by sflitman (Hermit) on May 30, 2009 at 20:09 UTC