From: Ralph Boehme Date: Tue, 28 Apr 2020 14:44:00 +0000 (+0200) Subject: smbd: use parent_smb_fname() in open_file_ntcreate() X-Git-Tag: ldb-2.2.0~827 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=16f866a1a0d5bdd791592bf591c64dd59918fe42;p=thirdparty%2Fsamba.git smbd: use parent_smb_fname() in open_file_ntcreate() Prepares for converting a bunch of functions to struct smb_filename later. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/open.c b/source3/smbd/open.c index 4d273aa930a..71be6a4966f 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -3276,6 +3276,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, struct share_mode_lock *lck = NULL; uint32_t open_access_mask = access_mask; NTSTATUS status; + struct smb_filename *parent_dir_fname = NULL; char *parent_dir; SMB_STRUCT_STAT saved_stat = smb_fname->st; struct timespec old_write_time; @@ -3306,10 +3307,14 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn, req->vuid); } - if (!parent_dirname(talloc_tos(), smb_fname->base_name, &parent_dir, - NULL)) { + ok = parent_smb_fname(talloc_tos(), + smb_fname, + &parent_dir_fname, + NULL); + if (!ok) { return NT_STATUS_NO_MEMORY; } + parent_dir = parent_dir_fname->base_name; if (new_dos_attributes & FILE_FLAG_POSIX_SEMANTICS) { posix_open = True;