diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-23 09:38:54 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-23 15:02:26 +0200 |
commit | e8e24a251b7625647352764298f108769bbad922 (patch) | |
tree | 23a31515d2fc68e0720f20a345a9bced4eb7f371 | |
parent | 7cf50b9f305d6c2cdc57f38c9b4e5f8b73301f8a (diff) | |
download | samba-e8e24a251b7625647352764298f108769bbad922.tar.gz samba-e8e24a251b7625647352764298f108769bbad922.tar.bz2 samba-e8e24a251b7625647352764298f108769bbad922.zip |
s3-smbd: Add talloc_stackframe() to get_nt_acl_no_snum()
This is required because the functions it calls use talloc_tos().
Andrew Bartlett
-rw-r--r-- | source3/smbd/posix_acls.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index 7e1bab51ea..1394266c4a 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -4849,8 +4849,9 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna files_struct finfo; struct fd_handle fh; NTSTATUS status; + TALLOC_CTX *frame = talloc_stackframe(); - conn = talloc_zero(ctx, connection_struct); + conn = talloc_zero(frame, connection_struct); if (conn == NULL) { DEBUG(0, ("talloc failed\n")); return NULL; @@ -4858,7 +4859,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna if (!(conn->params = talloc(conn, struct share_params))) { DEBUG(0,("get_nt_acl_no_snum: talloc() failed!\n")); - TALLOC_FREE(conn); + TALLOC_FREE(frame); return NULL; } @@ -4869,6 +4870,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna if (!smbd_vfs_init(conn)) { DEBUG(0,("get_nt_acl_no_snum: Unable to create a fake connection struct!\n")); conn_free(conn); + TALLOC_FREE(frame); return NULL; } @@ -4880,10 +4882,11 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna finfo.fh = &fh; finfo.fh->fd = -1; - status = create_synthetic_smb_fname(talloc_tos(), fname, NULL, NULL, + status = create_synthetic_smb_fname(frame, fname, NULL, NULL, &finfo.fsp_name); if (!NT_STATUS_IS_OK(status)) { conn_free(conn); + TALLOC_FREE(frame); return NULL; } @@ -4891,6 +4894,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna DEBUG(0,("get_nt_acl_no_snum: get_nt_acl returned zero.\n")); TALLOC_FREE(finfo.fsp_name); conn_free(conn); + TALLOC_FREE(frame); return NULL; } @@ -4898,6 +4902,7 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna TALLOC_FREE(finfo.fsp_name); conn_free(conn); + TALLOC_FREE(frame); return ret_sd; } |