diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index 0c2e365c239..6b31670eff3 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -57,7 +57,9 @@ uint32_t ucf_flags_from_smb_request(struct smb_request *req) return ucf_flags; } -uint32_t filename_create_ucf_flags(struct smb_request *req, uint32_t create_disposition) +uint32_t filename_create_ucf_flags(struct smb_request *req, + uint32_t create_disposition, + uint32_t create_options) { uint32_t ucf_flags = 0; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 4a3d8259160..fe2ad67a03b 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -288,7 +288,9 @@ NTSTATUS sync_file(connection_struct *conn, files_struct *fsp, bool write_throug /* The following definitions come from smbd/filename.c */ uint32_t ucf_flags_from_smb_request(struct smb_request *req); -uint32_t filename_create_ucf_flags(struct smb_request *req, uint32_t create_disposition); +uint32_t filename_create_ucf_flags(struct smb_request *req, + uint32_t create_disposition, + uint32_t create_options); NTSTATUS canonicalize_snapshot_path(struct smb_filename *smb_fname, uint32_t ucf_flags, NTTIME twrp); diff --git a/source3/smbd/smb1_nttrans.c b/source3/smbd/smb1_nttrans.c index 001e3be6df9..554059059d4 100644 --- a/source3/smbd/smb1_nttrans.c +++ b/source3/smbd/smb1_nttrans.c @@ -626,7 +626,9 @@ void reply_ntcreate_and_X(struct smb_request *req) fname = new_fname; } - ucf_flags = filename_create_ucf_flags(req, create_disposition); + ucf_flags = filename_create_ucf_flags(req, + create_disposition, + create_options); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); } @@ -1087,7 +1089,9 @@ static void call_nt_transact_create(connection_struct *conn, fname = new_fname; } - ucf_flags = filename_create_ucf_flags(req, create_disposition); + ucf_flags = filename_create_ucf_flags(req, + create_disposition, + create_options); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); } diff --git a/source3/smbd/smb1_reply.c b/source3/smbd/smb1_reply.c index 3b71f5fb8ba..4256593897d 100644 --- a/source3/smbd/smb1_reply.c +++ b/source3/smbd/smb1_reply.c @@ -1789,7 +1789,9 @@ void reply_open(struct smb_request *req) goto out; } - ucf_flags = filename_create_ucf_flags(req, create_disposition); + ucf_flags = filename_create_ucf_flags(req, + create_disposition, + create_options); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); @@ -1990,7 +1992,9 @@ void reply_open_and_X(struct smb_request *req) goto out; } - ucf_flags = filename_create_ucf_flags(req, create_disposition); + ucf_flags = filename_create_ucf_flags(req, + create_disposition, + create_options); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); @@ -2428,7 +2432,9 @@ void reply_mknew(struct smb_request *req) goto out; } - ucf_flags = filename_create_ucf_flags(req, create_disposition); + ucf_flags = filename_create_ucf_flags(req, + create_disposition, + create_options); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); } @@ -2583,7 +2589,7 @@ void reply_ctemp(struct smb_request *req) goto out; } - ucf_flags = filename_create_ucf_flags(req, FILE_CREATE); + ucf_flags = filename_create_ucf_flags(req, FILE_CREATE, 0); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(fname, &twrp); } @@ -6179,7 +6185,7 @@ void reply_mkdir(struct smb_request *req) goto out; } - ucf_flags = filename_create_ucf_flags(req, FILE_CREATE); + ucf_flags = filename_create_ucf_flags(req, FILE_CREATE, 0); if (ucf_flags & UCF_GMT_PATHNAME) { extract_snapshot_token(directory, &twrp); } diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 65744e0bf37..b2a60e2a4b7 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -520,7 +520,7 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(struct smb_request *smb1req return status; } - ucf_flags = filename_create_ucf_flags(smb1req, FILE_OPEN); + ucf_flags = filename_create_ucf_flags(smb1req, FILE_OPEN, 0); status = filename_convert_dirfsp(talloc_tos(), fsp->conn, filename, @@ -1063,8 +1063,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, return tevent_req_post(req, state->ev); } - ucf_flags = filename_create_ucf_flags( - smb1req, state->in_create_disposition); + ucf_flags = filename_create_ucf_flags(smb1req, + state->in_create_disposition, + state->in_create_options); status = filename_convert_dirfsp( req,