]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pysmbd: add session_info arg to get_conn_tos
authorJoe Guo <joeg@catalyst.net.nz>
Tue, 3 Jul 2018 22:05:50 +0000 (10:05 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 02:31:59 +0000 (04:31 +0200)
Add session_info arg, so caller can pass it in to reuse authentication info
later. This will improve performance a lot while doing ntacl operations
on large amount of files, e.g.: sysvolreset.

Modification for upstream caller will come in following patches.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13521

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
source3/smbd/pysmbd.c

index b220fbe691f800882e91aa0d1d1aa7c1f3ceabcc..faf4565fff9419073e7900b72163ca2856a13aee 100644 (file)
@@ -44,7 +44,10 @@ extern const struct generic_mapping file_generic_mapping;
 #define DIRECTORY_FLAGS O_RDONLY
 #endif
 
-static connection_struct *get_conn_tos(const char *service)
+
+static connection_struct *get_conn_tos(
+       const char *service,
+       const struct auth_session_info *session_info)
 {
        struct conn_struct_tos *c = NULL;
        int snum = -1;
@@ -66,7 +69,7 @@ static connection_struct *get_conn_tos(const char *service)
        status = create_conn_struct_tos(NULL,
                                        snum,
                                        "/",
-                                       NULL,
+                                       session_info,
                                        &c);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
 
@@ -410,7 +413,7 @@ static PyObject *py_smbd_set_simple_acl(PyObject *self, PyObject *args, PyObject
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -451,7 +454,7 @@ static PyObject *py_smbd_chown(PyObject *self, PyObject *args, PyObject *kwargs)
 
        frame = talloc_stackframe();
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -510,7 +513,7 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -576,7 +579,7 @@ static PyObject *py_smbd_set_nt_acl(PyObject *self, PyObject *args, PyObject *kw
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -611,7 +614,7 @@ static PyObject *py_smbd_get_nt_acl(PyObject *self, PyObject *args, PyObject *kw
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -653,7 +656,7 @@ static PyObject *py_smbd_set_sys_acl(PyObject *self, PyObject *args, PyObject *k
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -694,7 +697,7 @@ static PyObject *py_smbd_get_sys_acl(PyObject *self, PyObject *args, PyObject *k
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -739,7 +742,7 @@ static PyObject *py_smbd_mkdir(PyObject *self, PyObject *args, PyObject *kwargs)
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;
@@ -792,7 +795,7 @@ static PyObject *py_smbd_create_file(PyObject *self, PyObject *args, PyObject *k
                return NULL;
        }
 
-       conn = get_conn_tos(service);
+       conn = get_conn_tos(service, NULL);
        if (!conn) {
                TALLOC_FREE(frame);
                return NULL;