diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-07-04 10:05:50 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-07-12 04:31:59 +0200 |
commit | 760e36ddbcb8543f99fd34d97e8b6851dd022c1f (patch) | |
tree | 28148280625b298d283e387ab5b60d7591acd0f8 /source3/smbd/pysmbd.c | |
parent | 356f39534036064a5aef49c524b6395469f7098f (diff) | |
download | samba-760e36ddbcb8543f99fd34d97e8b6851dd022c1f.tar.gz |
pysmbd: add session_info arg to get_conn_tos
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>
Diffstat (limited to 'source3/smbd/pysmbd.c')
-rw-r--r-- | source3/smbd/pysmbd.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index b220fbe691f..faf4565fff9 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -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; |