1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

s3: smbd: Convert reply_setatr() 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:33:31 -07:00
parent a457d59e98
commit c71368a080

View File

@ -768,12 +768,14 @@ void reply_setatr(struct smb_request *req)
struct smb_file_time ft; struct smb_file_time ft;
connection_struct *conn = req->conn; connection_struct *conn = req->conn;
struct smb_filename *smb_fname = NULL; struct smb_filename *smb_fname = NULL;
struct files_struct *dirfsp = NULL;
char *fname = NULL; char *fname = NULL;
int mode; int mode;
time_t mtime; time_t mtime;
const char *p; const char *p;
NTSTATUS status; NTSTATUS status;
uint32_t ucf_flags = ucf_flags_from_smb_request(req); uint32_t ucf_flags = ucf_flags_from_smb_request(req);
NTTIME twrp = 0;
TALLOC_CTX *ctx = talloc_tos(); TALLOC_CTX *ctx = talloc_tos();
START_PROFILE(SMBsetatr); START_PROFILE(SMBsetatr);
@ -791,12 +793,16 @@ void reply_setatr(struct smb_request *req)
goto out; goto out;
} }
status = filename_convert(ctx, if (ucf_flags & UCF_GMT_PATHNAME) {
conn, extract_snapshot_token(fname, &twrp);
fname, }
ucf_flags, status = filename_convert_dirfsp(ctx,
0, conn,
&smb_fname); fname,
ucf_flags,
twrp,
&dirfsp,
&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)) {
reply_botherror(req, NT_STATUS_PATH_NOT_COVERED, reply_botherror(req, NT_STATUS_PATH_NOT_COVERED,