From: Ralph Boehme Date: Tue, 28 Apr 2020 16:09:18 +0000 (+0200) Subject: smbd: pass struct smb_filename parent_dir to file_set_dosmode() X-Git-Tag: ldb-2.2.0~818 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=214dea7defeb3d87cfaaf02a0b1171b8ca28ba91;p=thirdparty%2Fsamba.git smbd: pass struct smb_filename parent_dir to file_set_dosmode() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 95d1606f122..1baee073a36 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -953,7 +953,7 @@ NTSTATUS dos_mode_at_recv(struct tevent_req *req, uint32_t *dosmode) int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, uint32_t dosmode, - const char *parent_dir, + struct smb_filename *parent_dir, bool newfile) { int mask=0; @@ -1006,7 +1006,7 @@ int file_set_dosmode(connection_struct *conn, } /* Fall back to UNIX modes. */ - unixmode = unix_mode(conn, dosmode, smb_fname, parent_dir); + unixmode = unix_mode(conn, dosmode, smb_fname, parent_dir->base_name); /* preserve the file type bits */ mask |= S_IFMT; diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 04420b362d4..a99aa78bde8 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -1569,7 +1569,7 @@ static NTSTATUS copy_internals(TALLOC_CTX *ctx, status = NT_STATUS_NO_MEMORY; goto out; } - file_set_dosmode(conn, smb_fname_dst, fattr, parent->base_name, false); + file_set_dosmode(conn, smb_fname_dst, fattr, parent, false); TALLOC_FREE(parent); if (ret < (off_t)smb_fname_src->st.st_ex_size) { diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 76f85fcc25c..4f2f7d2923d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3978,7 +3978,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, if (!posix_open) { if (file_set_dosmode(conn, smb_fname, new_dos_attributes | FILE_ATTRIBUTE_ARCHIVE, - parent_dir, true) == 0) { + parent_dir_fname, true) == 0) { unx_mode = smb_fname->st.st_ex_mode; } } @@ -4145,7 +4145,7 @@ static NTSTATUS mkdir_internal(connection_struct *conn, if (!posix_open) { file_set_dosmode(conn, smb_dname, file_attributes | FILE_ATTRIBUTE_DIRECTORY, - parent_dir, true); + parent_dir_fname, true); } } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index d926058857a..e1c892209a1 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -271,7 +271,7 @@ NTSTATUS dos_mode_at_recv(struct tevent_req *req, uint32_t *dosmode); int file_set_dosmode(connection_struct *conn, struct smb_filename *smb_fname, uint32_t dosmode, - const char *parent_dir, + struct smb_filename *parent_dir, bool newfile); NTSTATUS file_set_sparse(connection_struct *conn, struct files_struct *fsp,