From b9eff7b90c508dfe61a5739d144bb8532bf3fb4c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 25 Aug 2022 16:27:42 +0200 Subject: [PATCH] pylibsmb: Allow requesting Posix extensions Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- source3/libsmb/pylibsmb.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index b498d3a0f62..2313ae88b2a 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -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); -- 2.47.3