suggestions for pam_python?

Discussion in 'Python' started by Kyler Laird, Oct 30, 2003.

  1. Kyler Laird

    Kyler Laird Guest

    I've been looking for a way to authenticate users through PAM using a
    Python script. I didn't find any so I wrote my own. I call it using
    a pam.conf line such as this.
    auth required pam_python.so test --foo=bar --blah=123

    I wrote pam_python.so in C. It passes on calls to pam_sm_authenticate,
    pam_sm_setcred, etc. to the "pam_handler" function in a Python script
    specified as the first argument ("test" -> "test.py"). The pam_handler
    script is called with the name of the function it's handling
    ("pam_sm_authenticate"), and the options given in the PAM configuration.
    It parses the options and then calls the appropriate function.

    I still haven't decided how to handle calls such as pam_get_user() (to
    get the user ID). Right now I'm running it in the C program and then
    passing it to pam_handler. I'd rather give the Python script a way to
    call such routines as they're needed. That'll take some more wrapping.

    Anyway...I'm not thrilled with how I'm doing this, so I thought I'd
    check to see if anyone has strong feelings about the One True Way that
    this should be done.

    Suggestions?

    Thank you.

    --kyler
     
    Kyler Laird, Oct 30, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GriffithsJ

    Book suggestions

    GriffithsJ, Aug 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    905
    Wayne Wengert
    Aug 16, 2003
  2. Jeff Gaines

    Book Suggestions Please!

    Jeff Gaines, Sep 8, 2003, in forum: ASP .Net
    Replies:
    9
    Views:
    531
    William Ryan
    Sep 28, 2003
  3. JerryK
    Replies:
    2
    Views:
    608
    Ray Cassick \(Home\)
    Jan 29, 2004
  4. Victor Hannak
    Replies:
    1
    Views:
    567
    Mike Treseler
    Nov 25, 2003
  5. Maxim
    Replies:
    0
    Views:
    426
    Maxim
    Jul 7, 2003
Loading...

Share This Page