From: Stefan Metzmacher Date: Wed, 16 Dec 2020 13:50:08 +0000 (+0100) Subject: s3:smbd: let openat_pathref_fsp() allocate fsp->fsp_name directly on fsp X-Git-Tag: samba-4.14.0rc1~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cff29e58ffaa81785e89f240808af84d6db836c8;p=thirdparty%2Fsamba.git s3:smbd: let openat_pathref_fsp() allocate fsp->fsp_name directly on fsp Otherwise we'll always keep the current talloc_stackframe arround. Signed-off-by: Stefan Metzmacher Reviewed-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/files.c b/source3/smbd/files.c index 70e128a3c5c..092cfcc0110 100644 --- a/source3/smbd/files.c +++ b/source3/smbd/files.c @@ -445,7 +445,7 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp, open_flags |= O_DIRECTORY; } - full_fname = full_path_from_dirfsp_atname(talloc_tos(), + full_fname = full_path_from_dirfsp_atname(fsp, dirfsp, smb_fname); if (full_fname == NULL) { @@ -453,12 +453,12 @@ NTSTATUS openat_pathref_fsp(const struct files_struct *dirfsp, goto fail; } - fsp->fsp_name = talloc_move(fsp, &full_fname); - - if (is_ntfs_default_stream_smb_fname(fsp->fsp_name)) { - fsp->fsp_name->stream_name = NULL; + if (is_ntfs_default_stream_smb_fname(full_fname)) { + full_fname->stream_name = NULL; } + fsp->fsp_name = full_fname; + status = file_name_hash(fsp->conn, smb_fname_str_dbg(fsp->fsp_name), &fsp->name_hash);