5.1 Diagnostics

If pam_python returns something other than PAM_SUCCESS to PAM a message will be written to the syslog LOG_AUTHPRIV facility. The only exception to this is when pam_python is passing on the return value from a Python pam_sm_...() entry point - nothing is logged in that case. So, if your Python PAM Module is failing in mysterious ways check syslog. The diagnostic or traceback Python would normally print to stderr will be in there.

The PAM result codes returned directly by pam_python are:

PAM_BUF_ERR
Memory allocation failed.

PAM_MODULE_UNKNOWN
The Python PAM module name wasn't supplied.

PAM_OPEN_ERR
The Python PAM module could not be opened.

PAM_SERVICE_ERR
A Python exception was thrown, unless it was because of a memory allocation failure.

PAM_SYMBOL_ERR
A pam_sm_...() called by PAM wasn't defined by the Python PAM module.