pyauth: Remove imessaging_ctx parameter to new
authorGary Lockyer <gary@catalyst.net.nz>
Sun, 30 Sep 2018 23:20:44 +0000 (12:20 +1300)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 10 Oct 2018 04:16:22 +0000 (06:16 +0200)
The pyauth code assumes the messaging context code is a py_talloc
object.  But the code in pymessaging returns a wrapped talloc object.
Removing the parameter as it's not currently used by any code.

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Noel Power <nopower@suse.com>
source4/auth/pyauth.c

index ada89ef0c8fc0f79f1d22d85b1a1cb03ebd02af1..b8d7a4c8d96193b3dd89e07276ee304e26297e0d 100644 (file)
@@ -265,23 +265,25 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
 {
        PyObject *py_lp_ctx = Py_None;
        PyObject *py_ldb = Py_None;
-       PyObject *py_imessaging_ctx = Py_None;
        PyObject *py_auth_context = Py_None;
        PyObject *py_methods = Py_None;
        TALLOC_CTX *mem_ctx;
        struct auth4_context *auth_context;
-       struct imessaging_context *imessaging_context = NULL;
        struct loadparm_context *lp_ctx;
        struct tevent_context *ev;
        struct ldb_context *ldb = NULL;
        NTSTATUS nt_status;
        const char **methods;
 
-       const char * const kwnames[] = { "lp_ctx", "messaging_ctx", "ldb", "methods", NULL };
+       const char *const kwnames[] = {"lp_ctx", "ldb", "methods", NULL};
 
-       if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|OOOO",
+       if (!PyArg_ParseTupleAndKeywords(args,
+                                        kwargs,
+                                        "|OOO",
                                         discard_const_p(char *, kwnames),
-                                        &py_lp_ctx, &py_imessaging_ctx, &py_ldb, &py_methods))
+                                        &py_lp_ctx,
+                                        &py_ldb,
+                                        &py_methods))
                return NULL;
 
        mem_ctx = talloc_new(NULL);
@@ -306,12 +308,9 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
                return NULL;
        }
 
-       if (py_imessaging_ctx != Py_None) {
-               imessaging_context = pytalloc_get_type(py_imessaging_ctx, struct imessaging_context);
-       }
-
        if (py_methods == Py_None && py_ldb == Py_None) {
-               nt_status = auth_context_create(mem_ctx, ev, imessaging_context, lp_ctx, &auth_context);
+               nt_status = auth_context_create(
+                   mem_ctx, ev, NULL, lp_ctx, &auth_context);
        } else {
                if (py_methods != Py_None) {
                        methods = PyList_AsStringList(mem_ctx, py_methods, "methods");
@@ -322,9 +321,8 @@ static PyObject *py_auth_context_new(PyTypeObject *type, PyObject *args, PyObjec
                } else {
                        methods = auth_methods_from_lp(mem_ctx, lp_ctx);
                }
-               nt_status = auth_context_create_methods(mem_ctx, methods, ev, 
-                                                       imessaging_context, lp_ctx,
-                                                       ldb, &auth_context);
+               nt_status = auth_context_create_methods(
+                   mem_ctx, methods, ev, NULL, lp_ctx, ldb, &auth_context);
        }
 
        if (!NT_STATUS_IS_OK(nt_status)) {