Skip to content

Two suggestions for readme (PAM not thread-safe and sample) #37

@mar10

Description

@mar10

It seems that python_pam is not thread-safe, or I am using it in a wrong way.
At least adding an RLock solved one issue for me:
mar10/wsgidav#265

Maybe you want to add a remark in the readme (or give me a hint how to use it correctly)?

Currently I create an instance p = pam.pam() on startup, then re-use it in request handlers (p.authenticate(...)).
This led to errors, that I was able to fix by wrapping it like

with lock:
    p.authenticate(...)

Should a new pam.pam() instance be created in every request-hander instead and would this impact performance?

Also, the readme says

>>> import pam
>>> p = pam.authenticate()
>>> p.authenticate('david', 'correctpassword')
True
...

which gives an exception. I assume it should be

>>> import pam
>>> p = pam
>>> p.authenticate('david', 'correctpassword')
True
...

instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions