From 96ac5a80cbedaf8bd6edc5ba7634aa9622eaef6d Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 24 May 2018 16:34:04 +0200 Subject: [PATCH] smbd: make use of create_conn_struct_tos() in get_nt_acl_no_snum() Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/smbd/posix_acls.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index fb074772134..70834d5fc7d 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -4570,7 +4570,7 @@ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname, struct security_descriptor **sd) { TALLOC_CTX *frame = talloc_stackframe(); - connection_struct *conn; + struct conn_struct_tos *c = NULL; NTSTATUS status = NT_STATUS_OK; struct smb_filename *smb_fname = synthetic_smb_fname(talloc_tos(), fname, @@ -4588,14 +4588,11 @@ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname, return NT_STATUS_NO_MEMORY; } - status = create_conn_struct(ctx, - server_event_context(), - server_messaging_context(), - &conn, - -1, - "/", - NULL); - + status = create_conn_struct_tos(server_messaging_context(), + -1, + "/", + NULL, + &c); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("create_conn_struct returned %s.\n", nt_errstr(status))); @@ -4603,7 +4600,7 @@ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname, return status; } - status = SMB_VFS_GET_NT_ACL(conn, + status = SMB_VFS_GET_NT_ACL(c->conn, smb_fname, security_info_wanted, ctx, @@ -4613,7 +4610,6 @@ NTSTATUS get_nt_acl_no_snum(TALLOC_CTX *ctx, const char *fname, nt_errstr(status))); } - conn_free(conn); TALLOC_FREE(frame); return status; -- 2.34.1