pylibsmb: Allow requesting Posix extensions
authorVolker Lendecke <vl@samba.org>
Thu, 25 Aug 2022 14:27:42 +0000 (16:27 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 2 Sep 2022 13:31:38 +0000 (13:31 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/libsmb/pylibsmb.c

index b498d3a0f62a3db458c523101e9cf1fb94d6c981..2313ae88b2a8729d049c01607394608bec5722b0 100644 (file)
@@ -438,7 +438,9 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
        PyObject *py_force_smb1 = Py_False;
        bool force_smb1 = false;
        PyObject *py_ipc = Py_False;
+       PyObject *py_posix = Py_False;
        bool use_ipc = false;
+       bool request_posix = false;
        struct tevent_req *req;
        bool ret;
        int flags = 0;
@@ -447,6 +449,7 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
                "host", "share", "lp", "creds",
                "multi_threaded", "force_smb1",
                "ipc",
+               "posix",
                NULL
        };
 
@@ -457,12 +460,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_force_smb1,
-               &py_ipc);
+               &py_ipc,
+               &py_posix);
 
        Py_DECREF(py_type_Credentials);
 
@@ -488,6 +492,11 @@ static int py_cli_state_init(struct py_cli_state *self, PyObject *args,
                flags |= CLI_FULL_CONNECTION_IPC;
        }
 
+       request_posix = PyObject_IsTrue(py_posix);
+       if (request_posix) {
+               flags |= CLI_FULL_CONNECTION_REQUEST_POSIX;
+       }
+
        if (multi_threaded) {
 #ifdef HAVE_PTHREAD
                ret = py_cli_state_setup_mt_ev(self);