From: Jeremy Allison Date: Thu, 28 Jul 2022 18:52:36 +0000 (-0700) Subject: s3: smbd: Convert reply_unlink() to use filename_convert_dirfsp(). X-Git-Tag: samba-4.17.0rc1~132 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=79257334c22823de3587caacdd430655112e888b;p=thirdparty%2Fsamba.git s3: smbd: Convert reply_unlink() 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_reply.c b/source3/smbd/smb1_reply.c index cbe15a1fac6..440283c2084 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -2368,10 +2368,12 @@ void reply_unlink(struct smb_request *req) { connection_struct *conn = req->conn; char *name = NULL; + struct files_struct *dirfsp = NULL; struct smb_filename *smb_fname = NULL; uint32_t dirtype; NTSTATUS status; uint32_t ucf_flags = ucf_flags_from_smb_request(req); + NTTIME twrp = 0; TALLOC_CTX *ctx = talloc_tos(); START_PROFILE(SMBunlink); @@ -2390,11 +2392,16 @@ void reply_unlink(struct smb_request *req) goto out; } - status = filename_convert(ctx, conn, - name, - ucf_flags, - 0, - &smb_fname); + if (ucf_flags & UCF_GMT_PATHNAME) { + extract_snapshot_token(name, &twrp); + } + status = filename_convert_dirfsp(ctx, + conn, + name, + 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, NT_STATUS_PATH_NOT_COVERED, @@ -2407,7 +2414,7 @@ void reply_unlink(struct smb_request *req) DEBUG(3,("reply_unlink : %s\n", smb_fname_str_dbg(smb_fname))); - status = unlink_internals(conn, req, dirtype, NULL, smb_fname); + status = unlink_internals(conn, req, dirtype, dirfsp, smb_fname); if (!NT_STATUS_IS_OK(status)) { if (open_was_deferred(req->xconn, req->mid)) { /* We have re-scheduled this call. */