From d62563342e8c83d67dbcfb0c4b8e2ed886742006 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 28 Apr 2008 10:31:49 +0200 Subject: Remove connection_struct->mem_ctx, connection_struct is its own parent (This used to be commit 559180f7d30606d1999399d954ceedc798c669a4) --- source3/smbd/posix_acls.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'source3/smbd/posix_acls.c') diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 732199e0e9..33042faf56 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -4262,30 +4262,29 @@ bool set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char * SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname) { SEC_DESC *psd, *ret_sd; - connection_struct conn; + connection_struct *conn; files_struct finfo; struct fd_handle fh; - ZERO_STRUCT( conn ); - - if ( !(conn.mem_ctx = talloc_init( "novfs_get_nt_acl" )) ) { - DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n")); + conn = TALLOC_ZERO_P(ctx, connection_struct); + if (conn == NULL) { + DEBUG(0, ("talloc failed\n")); return NULL; } - if (!(conn.params = TALLOC_P(conn.mem_ctx, struct share_params))) { + if (!(conn->params = TALLOC_P(conn, struct share_params))) { DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n")); - TALLOC_FREE(conn.mem_ctx); + TALLOC_FREE(conn); return NULL; } - conn.params->service = -1; + conn->params->service = -1; - set_conn_connectpath(&conn, "/"); + set_conn_connectpath(conn, "/"); - if (!smbd_vfs_init(&conn)) { + if (!smbd_vfs_init(conn)) { DEBUG(0,("get_nt_acl_no_snum: Unable to create a fake connection struct!\n")); - conn_free_internal( &conn ); + conn_free_internal( conn ); return NULL; } @@ -4293,20 +4292,20 @@ SEC_DESC *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fname) ZERO_STRUCT( fh ); finfo.fnum = -1; - finfo.conn = &conn; + finfo.conn = conn; finfo.fh = &fh; finfo.fh->fd = -1; finfo.fsp_name = CONST_DISCARD(char *,fname); if (!NT_STATUS_IS_OK(posix_fget_nt_acl( &finfo, DACL_SECURITY_INFORMATION, &psd))) { DEBUG(0,("get_nt_acl_no_snum: get_nt_acl returned zero.\n")); - conn_free_internal( &conn ); + conn_free_internal( conn ); return NULL; } ret_sd = dup_sec_desc( ctx, psd ); - conn_free_internal( &conn ); + conn_free_internal( conn ); return ret_sd; } -- cgit