diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-02-25 20:22:52 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-02-26 21:38:42 +1100 |
commit | 25723914c5f5b18a25f758f1098ddded3c5aa074 (patch) | |
tree | 7c636a7cfa580c45bc1c05e3125a881e2bdf2123 /source4/auth/credentials | |
parent | ee547e715eff60fd26fa65655b00b80202088319 (diff) | |
download | samba-25723914c5f5b18a25f758f1098ddded3c5aa074.tar.gz samba-25723914c5f5b18a25f758f1098ddded3c5aa074.tar.bz2 samba-25723914c5f5b18a25f758f1098ddded3c5aa074.zip |
s4:python Add bindings to set GENSEC flags on credentials in python
This should allow these to be manipulated by python scripts that need
encrypted connections.
Andrew Bartlett
Diffstat (limited to 'source4/auth/credentials')
-rw-r--r-- | source4/auth/credentials/pycredentials.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/auth/credentials/pycredentials.c b/source4/auth/credentials/pycredentials.c index 8602be8060..f5e802958b 100644 --- a/source4/auth/credentials/pycredentials.c +++ b/source4/auth/credentials/pycredentials.c @@ -278,6 +278,27 @@ static PyObject *py_creds_get_named_ccache(py_talloc_Object *self, PyObject *arg return NULL; } +static PyObject *py_creds_set_gensec_features(py_talloc_Object *self, PyObject *args) +{ + unsigned int gensec_features; + + if (!PyArg_ParseTuple(args, "I", &gensec_features)) + return NULL; + + cli_credentials_set_gensec_features(PyCredentials_AsCliCredentials(self), gensec_features); + + Py_RETURN_NONE; +} + +static PyObject *py_creds_get_gensec_features(py_talloc_Object *self, PyObject *args) +{ + unsigned int gensec_features; + + gensec_features = cli_credentials_get_gensec_features(PyCredentials_AsCliCredentials(self)); + return PyInt_FromLong(gensec_features); +} + + static PyMethodDef py_creds_methods[] = { { "get_username", (PyCFunction)py_creds_get_username, METH_NOARGS, "S.get_username() -> username\nObtain username." }, @@ -335,6 +356,8 @@ static PyMethodDef py_creds_methods[] = { { "guess", (PyCFunction)py_creds_guess, METH_VARARGS, NULL }, { "set_machine_account", (PyCFunction)py_creds_set_machine_account, METH_VARARGS, NULL }, { "get_named_ccache", (PyCFunction)py_creds_get_named_ccache, METH_VARARGS, NULL }, + { "set_gensec_features", (PyCFunction)py_creds_set_gensec_features, METH_VARARGS, NULL }, + { "get_gensec_features", (PyCFunction)py_creds_get_gensec_features, METH_NOARGS, NULL }, { NULL } }; |