1
0
mirror of https://github.com/samba-team/samba.git synced 2025-09-11 09:44:19 +03:00

s3: smbd: Convert call_trans2qfilepathinfo() to use filename_convert_dirfsp().

One less use of filename_convert().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison
2022-07-28 10:39:12 -07:00
parent c71368a080
commit a9ed7f6064

View File

@@ -1946,6 +1946,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
struct smb_filename *smb_fname = NULL; struct smb_filename *smb_fname = NULL;
bool delete_pending = False; bool delete_pending = False;
struct timespec write_time_ts; struct timespec write_time_ts;
struct files_struct *dirfsp = NULL;
files_struct *fsp = NULL; files_struct *fsp = NULL;
struct file_id fileid; struct file_id fileid;
struct ea_list *ea_list = NULL; struct ea_list *ea_list = NULL;
@@ -2060,6 +2061,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
uint32_t name_hash; uint32_t name_hash;
char *fname = NULL; char *fname = NULL;
uint32_t ucf_flags = ucf_flags_from_smb_request(req); uint32_t ucf_flags = ucf_flags_from_smb_request(req);
NTTIME twrp = 0;
/* qpathinfo */ /* qpathinfo */
if (total_params < 7) { if (total_params < 7) {
@@ -2106,11 +2108,15 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
return; return;
} }
status = filename_convert(req, if (ucf_flags & UCF_GMT_PATHNAME) {
extract_snapshot_token(fname, &twrp);
}
status = filename_convert_dirfsp(req,
conn, conn,
fname, fname,
ucf_flags, ucf_flags,
0, twrp,
&dirfsp,
&smb_fname); &smb_fname);
if (!NT_STATUS_IS_OK(status)) { if (!NT_STATUS_IS_OK(status)) {
if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
@@ -2125,8 +2131,8 @@ static void call_trans2qfilepathinfo(connection_struct *conn,
/* /*
* qpathinfo must operate on an existing file, so we * qpathinfo must operate on an existing file, so we
* can exit early if filename_convert() returned the "new file" * can exit early if filename_convert_dirfsp() returned the
* NT_STATUS_OK, !VALID_STAT case. * "new file" NT_STATUS_OK, !VALID_STAT case.
*/ */
if (!VALID_STAT(smb_fname->st)) { if (!VALID_STAT(smb_fname->st)) {