diff options
author | Wojciech Polak <polak@gnu.org> | 2009-09-02 17:05:22 +0200 |
---|---|---|
committer | Wojciech Polak <polak@gnu.org> | 2009-09-02 17:05:22 +0200 |
commit | 025af57ccc94b0552e1d832373b0faab8ef411eb (patch) | |
tree | 73d83e7660269ecd1ff0b8f0d71dd686fb4d339f | |
parent | f6db8dababc96b62cc564a3f8d9048d0c5f2dd63 (diff) | |
download | mailutils-025af57ccc94b0552e1d832373b0faab8ef411eb.tar.gz mailutils-025af57ccc94b0552e1d832373b0faab8ef411eb.tar.bz2 |
Python: Allow to set mu_pam_service.
* python/libmu_py/auth.c (api_set_pam_service): New function.
* python/mailutils/auth.py (set_pam_service): New function.
-rw-r--r-- | python/libmu_py/auth.c | 15 | ||||
-rw-r--r-- | python/mailutils/auth.py | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/python/libmu_py/auth.c b/python/libmu_py/auth.c index 7613f1227..1cd9511b5 100644 --- a/python/libmu_py/auth.c +++ b/python/libmu_py/auth.c @@ -19,6 +19,7 @@ */ #include "libmu_py.h" +#include <mailutils/pam.h> #define PY_MODULE "auth" #define PY_CSNAME1 "AuthorityType" @@ -621,6 +622,17 @@ api_authenticate (PyObject *self, PyObject *args) return _ro (PyInt_FromLong (status)); } +static PyObject * +api_set_pam_service (PyObject *self, PyObject *args) +{ + char *pam_service; + + if (!PyArg_ParseTuple (args, "s", &pam_service)) + return NULL; + + mu_pam_service = pam_service; + return _ro (Py_None); +} static PyMethodDef methods[] = { { "authority_create", (PyCFunction) api_authority_create, METH_VARARGS, @@ -668,6 +680,9 @@ static PyMethodDef methods[] = { { "authenticate", (PyCFunction) api_authenticate, METH_VARARGS, "" }, + { "set_pam_service", (PyCFunction) api_set_pam_service, METH_VARARGS, + "" }, + { NULL, NULL, 0, NULL } }; diff --git a/python/mailutils/auth.py b/python/mailutils/auth.py index 57e5d0009..8095aa0d8 100644 --- a/python/mailutils/auth.py +++ b/python/mailutils/auth.py @@ -47,6 +47,9 @@ def authenticate (auth_data, password): if status: raise AuthError (status) +def set_pam_service (pam_service): + auth.set_pam_service (pam_service) + class Authority: __owner = False |