diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-10-27 19:50:33 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-11-05 11:56:22 +0100 |
commit | b2e91d41194abcc7abc803fc3dc66eb635fcbd25 (patch) | |
tree | 25e270b6649abc2f8cb0a363092b482d01c51e7a /source4 | |
parent | a10b522a0a5cc32cf535beb48f5bbe096a8e85de (diff) | |
download | samba-b2e91d41194abcc7abc803fc3dc66eb635fcbd25.tar.gz samba-b2e91d41194abcc7abc803fc3dc66eb635fcbd25.tar.bz2 samba-b2e91d41194abcc7abc803fc3dc66eb635fcbd25.zip |
s4:samdb python bindings - Reorder some function bodies to match the order in "ldb_wrap_connect"
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/pyglue.c | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c index 2f7023ea5d..adb665dc72 100644 --- a/source4/scripting/python/pyglue.c +++ b/source4/scripting/python/pyglue.c @@ -102,6 +102,27 @@ static PyObject *py_set_debug_level(PyObject *self, PyObject *args) Py_RETURN_NONE; } +static PyObject *py_ldb_set_session_info(PyObject *self, PyObject *args) +{ + PyObject *py_session_info, *py_ldb; + struct auth_session_info *info; + struct ldb_context *ldb; + if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_session_info)) + return NULL; + + PyErr_LDB_OR_RAISE(py_ldb, ldb); + /*if (!PyAuthSession_Check(py_session_info)) { + PyErr_SetString(PyExc_TypeError, "Expected session info object"); + return NULL; + }*/ + + info = PyAuthSession_AsSession(py_session_info); + + ldb_set_opaque(ldb, "sessionInfo", info); + + Py_RETURN_NONE; +} + static PyObject *py_ldb_set_credentials(PyObject *self, PyObject *args) { PyObject *py_creds, *py_ldb; @@ -144,28 +165,6 @@ static PyObject *py_ldb_set_loadparm(PyObject *self, PyObject *args) Py_RETURN_NONE; } - -static PyObject *py_ldb_set_session_info(PyObject *self, PyObject *args) -{ - PyObject *py_session_info, *py_ldb; - struct auth_session_info *info; - struct ldb_context *ldb; - if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_session_info)) - return NULL; - - PyErr_LDB_OR_RAISE(py_ldb, ldb); - /*if (!PyAuthSession_Check(py_session_info)) { - PyErr_SetString(PyExc_TypeError, "Expected session info object"); - return NULL; - }*/ - - info = PyAuthSession_AsSession(py_session_info); - - ldb_set_opaque(ldb, "sessionInfo", info); - - Py_RETURN_NONE; -} - static PyObject *py_ldb_set_utf8_casefold(PyObject *self, PyObject *args) { PyObject *py_ldb; @@ -455,12 +454,12 @@ static PyMethodDef py_misc_methods[] = { "Generate random password with specified length." }, { "unix2nttime", (PyCFunction)py_unix2nttime, METH_VARARGS, "unix2nttime(timestamp) -> nttime" }, - { "ldb_set_credentials", (PyCFunction)py_ldb_set_credentials, METH_VARARGS, - "ldb_set_credentials(ldb, credentials) -> None\n" - "Set credentials to use when connecting." }, { "ldb_set_session_info", (PyCFunction)py_ldb_set_session_info, METH_VARARGS, "ldb_set_session_info(ldb, session_info)\n" "Set session info to use when connecting." }, + { "ldb_set_credentials", (PyCFunction)py_ldb_set_credentials, METH_VARARGS, + "ldb_set_credentials(ldb, credentials)\n" + "Set credentials to use when connecting." }, { "ldb_set_loadparm", (PyCFunction)py_ldb_set_loadparm, METH_VARARGS, "ldb_set_loadparm(ldb, session_info)\n" "Set loadparm context to use when connecting." }, |