From: Jeremy Allison Date: Wed, 27 Jul 2022 19:36:23 +0000 (-0700) Subject: s3: smbd: Convert call_trans2open() to use filename_convert_dirfsp(). X-Git-Tag: samba-4.17.0rc1~175 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12001941a4f77b1595ff4f64c7377dbc64f2dead;p=thirdparty%2Fsamba.git s3: smbd: Convert call_trans2open() to use filename_convert_dirfsp(). One less use of filename_convert(). Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/smb1_trans2.c b/source3/smbd/smb1_trans2.c index 8c3bafa3a00..120d63d5ca8 100644 --- a/source3/smbd/smb1_trans2.c +++ b/source3/smbd/smb1_trans2.c @@ -512,6 +512,7 @@ static void call_trans2open(connection_struct *conn, int fattr=0,mtime=0; SMB_INO_T inode = 0; int smb_action = 0; + struct files_struct *dirfsp = NULL; files_struct *fsp; struct ea_list *ea_list = NULL; uint16_t flags = 0; @@ -521,6 +522,7 @@ static void call_trans2open(connection_struct *conn, uint32_t create_disposition; uint32_t create_options = 0; uint32_t private_flags = 0; + NTTIME twrp = 0; uint32_t ucf_flags = ucf_flags_from_smb_request(req); TALLOC_CTX *ctx = talloc_tos(); @@ -583,12 +585,16 @@ static void call_trans2open(connection_struct *conn, fname, (unsigned int)deny_mode, (unsigned int)open_attr, (unsigned int)open_ofun, open_size)); - status = filename_convert(ctx, - conn, - fname, - ucf_flags, - 0, - &smb_fname); + if (ucf_flags & UCF_GMT_PATHNAME) { + extract_snapshot_token(fname, &twrp); + } + status = filename_convert_dirfsp(ctx, + conn, + fname, + ucf_flags, + twrp, + &dirfsp, + &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { reply_botherror(req, @@ -660,7 +666,7 @@ static void call_trans2open(connection_struct *conn, status = SMB_VFS_CREATE_FILE( conn, /* conn */ req, /* req */ - NULL, /* dirfsp */ + dirfsp, /* dirfsp */ smb_fname, /* fname */ access_mask, /* access_mask */ share_mode, /* share_access */