]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:pylibsmb: Add ipc=True support for CLI_FULL_CONNECTION_IPC
authorAndreas Schneider <asn@samba.org>
Thu, 28 May 2020 15:29:25 +0000 (17:29 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Wed, 19 Aug 2020 16:22:41 +0000 (16:22 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/libsmb/pylibsmb.c

index 3fcc3424a57721518af8de169d8de921854ebc29..3579a0408301c1a38fe02b74b99e041898df9f5e 100644 (file)
@@ -445,6 +445,8 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
        int signing_state = SMB_SIGNING_DEFAULT;
        PyObject *py_force_smb1 = Py_False;
        bool force_smb1 = false;
+       PyObject *py_ipc = Py_False;
+       bool use_ipc = false;
        struct tevent_req *req;
        bool ret;
        int flags = 0;
@@ -452,6 +454,7 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
        static const char *kwlist[] = {
                "host", "share", "lp", "creds",
                "multi_threaded", "sign", "force_smb1",
+               "ipc",
                NULL
        };
 
@@ -462,12 +465,13 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
        }
 
        ret = ParseTupleAndKeywords(
-               args, kwds, "ssO|O!OOO", kwlist,
+               args, kwds, "ssO|O!OOOO", kwlist,
                &host, &share, &py_lp,
                py_type_Credentials, &creds,
                &py_multi_threaded,
                &py_sign,
-               &py_force_smb1);
+               &py_force_smb1,
+               &py_ipc);
 
        Py_DECREF(py_type_Credentials);
 
@@ -493,6 +497,11 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
                flags = CLI_FULL_CONNECTION_FORCE_SMB1;
        }
 
+       use_ipc = PyObject_IsTrue(py_ipc);
+       if (use_ipc) {
+               flags |= CLI_FULL_CONNECTION_IPC;
+       }
+
        if (multi_threaded) {
 #ifdef HAVE_PTHREAD
                ret = py_cli_state_setup_mt_ev(self);