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 /python/libmu_py | |
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.
Diffstat (limited to 'python/libmu_py')
-rw-r--r-- | python/libmu_py/auth.c | 15 |
1 files changed, 15 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 } }; |