Open mrvanes opened 6 years ago
To answer my own question:
auth optional pam_env.so envfile=/lib/security/pam_websso/env
where /lib/security/pam_websso/env contains a single line
PATH=/lib/security/pam_websso/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
seems to do the trick
Or, add
#!/usr/bin/env /lib/security/pam_websso/bin/python
at the top of the module
It turns out I was testing (pamtester) from an activated virtualenv which was sufficient to let pamtester succeed. It still fails from a clean env using any combination of the above tests, so I still don't have a way to start the virtualenv from within pam-python. For now, I'll install the required modules system wide.
It fails because your script is not being run as a program (using the interpreter specified by the #! line) - the python interpreter is actually embedded in this module.
You just need to add the virtualenv path to sys.path before importing the other modules. Something like this:
import os.path
import sys
activate_this = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'venv/bin/activate_this.py')
exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this))
Wow, thx. It's been a while since I worked on this (the proof of concept module works) but I'll keep this in mind if and when the module will be deployed in the wild!
What would the PAM configuration line look like if the python PAM module is developed in a virtualenv?