From: Ralph Boehme Date: Sat, 24 Nov 2018 09:45:49 +0000 (+0100) Subject: s3:smbd: add twrp args to filename_convert() X-Git-Tag: tdb-1.3.17~622 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14b6e6842b76d7c3e53249ba026a3ff51615ebd7;p=thirdparty%2Fsamba.git s3:smbd: add twrp args to filename_convert() All existing callers pass NULL, no change in behaviour. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13455 Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c index ac18a73ef4e..2f318550dec 100644 --- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c +++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c @@ -2363,6 +2363,7 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p, r->in.file, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(nt_status)) { werr = ntstatus_to_werror(nt_status); @@ -2496,6 +2497,7 @@ WERROR _srvsvc_NetSetFileSecurity(struct pipes_struct *p, r->in.file, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(nt_status)) { werr = ntstatus_to_werror(nt_status); diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index a2b9d3ae4e5..d861b51771b 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -1710,6 +1710,7 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx, connection_struct *conn, const char *name_in, uint32_t ucf_flags, + time_t *twrp, bool *ppath_contains_wcard, struct smb_filename **pp_smb_fname) { @@ -1718,7 +1719,7 @@ NTSTATUS filename_convert(TALLOC_CTX *ctx, NULL, name_in, ucf_flags, - NULL, + twrp, ppath_contains_wcard, pp_smb_fname); } diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 3c9b0ebb3f5..e7991c051c1 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -543,6 +543,7 @@ void reply_ntcreate_and_X(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); TALLOC_FREE(case_state); @@ -1115,6 +1116,7 @@ static void call_nt_transact_create(connection_struct *conn, fname, ucf_flags, NULL, + NULL, &smb_fname); TALLOC_FREE(case_state); @@ -1636,6 +1638,7 @@ void reply_ntrename(struct smb_request *req) oldname, ucf_flags_src, NULL, + NULL, &smb_fname_old); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status, @@ -1652,6 +1655,7 @@ void reply_ntrename(struct smb_request *req) status = filename_convert(ctx, conn, newname, ucf_flags_dst, + NULL, &dest_has_wcard, &smb_fname_new); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/open.c b/source3/smbd/open.c index a323a42609e..40ba319bf3d 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -5570,6 +5570,7 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn, new_base_name, ucf_flags, NULL, + NULL, smb_fname_out); if (!NT_STATUS_IS_OK(status)) { goto out; diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index d49cd5c2251..a74a79f7569 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -365,6 +365,7 @@ NTSTATUS filename_convert(TALLOC_CTX *mem_ctx, connection_struct *conn, const char *name_in, uint32_t ucf_flags, + time_t *twrp, bool *ppath_contains_wcard, struct smb_filename **pp_smb_fname); NTSTATUS filename_convert_with_privilege(TALLOC_CTX *mem_ctx, diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index 49ca1d70411..956b83ae08b 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1305,6 +1305,7 @@ void reply_checkpath(struct smb_request *req) name, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -1403,6 +1404,7 @@ void reply_getatr(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -1506,6 +1508,7 @@ void reply_setatr(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -1803,6 +1806,7 @@ void reply_search(struct smb_request *req) nt_status = filename_convert(ctx, conn, path, ucf_flags, + NULL, &mask_contains_wcard, &smb_fname); if (!NT_STATUS_IS_OK(nt_status)) { @@ -2146,6 +2150,7 @@ void reply_open(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -2318,6 +2323,7 @@ void reply_open_and_X(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -2562,6 +2568,7 @@ void reply_mknew(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -2698,6 +2705,7 @@ void reply_ctemp(struct smb_request *req) fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -3236,6 +3244,7 @@ void reply_unlink(struct smb_request *req) status = filename_convert(ctx, conn, name, ucf_flags, + NULL, &path_contains_wcard, &smb_fname); if (!NT_STATUS_IS_OK(status)) { @@ -6185,6 +6194,7 @@ void reply_mkdir(struct smb_request *req) directory, ucf_flags, NULL, + NULL, &smb_dname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -6255,6 +6265,7 @@ void reply_rmdir(struct smb_request *req) directory, ucf_flags, NULL, + NULL, &smb_dname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -7377,6 +7388,7 @@ void reply_mv(struct smb_request *req) conn, name, src_ucf_flags, + NULL, &src_has_wcard, &smb_fname_src); @@ -7394,6 +7406,7 @@ void reply_mv(struct smb_request *req) conn, newname, dst_ucf_flags, + NULL, &dest_has_wcard, &smb_fname_dst); @@ -7687,6 +7700,7 @@ void reply_copy(struct smb_request *req) status = filename_convert(ctx, conn, fname_src, ucf_flags_src, + NULL, &source_has_wild, &smb_fname_src); if (!NT_STATUS_IS_OK(status)) { @@ -7702,6 +7716,7 @@ void reply_copy(struct smb_request *req) status = filename_convert(ctx, conn, fname_dst, ucf_flags_dst, + NULL, &dest_has_wild, &smb_fname_dst); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 7f80f6f8138..ac9235c6611 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -423,7 +423,7 @@ static NTSTATUS smbd_smb2_create_durable_lease_check(struct smb_request *smb1req ucf_flags = filename_create_ucf_flags(smb1req, FILE_OPEN); status = filename_convert(talloc_tos(), fsp->conn, filename, ucf_flags, - NULL, &smb_fname); + NULL, NULL, &smb_fname); TALLOC_FREE(filename); if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("filename_convert returned %s\n", @@ -891,6 +891,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx, smb1req->conn, state->fname, ucf_flags, + NULL, NULL, /* ppath_contains_wcards */ &smb_fname); if (!NT_STATUS_IS_OK(status)) { diff --git a/source3/smbd/smb2_query_directory.c b/source3/smbd/smb2_query_directory.c index f3b61737da7..fb77edca2bf 100644 --- a/source3/smbd/smb2_query_directory.c +++ b/source3/smbd/smb2_query_directory.c @@ -428,6 +428,7 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx, conn, fullpath, ucf_flags, + NULL, &wcard_has_wild, &smb_fname); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 6ec319ce870..306174e597d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1296,6 +1296,7 @@ static void call_trans2open(connection_struct *conn, fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -2743,6 +2744,7 @@ close_if_end = %d requires_resume_key = %d backup_priv = %d level = 0x%x, max_da ntstatus = filename_convert(talloc_tos(), conn, directory, ucf_flags, + NULL, &mask_contains_wcard, &smb_dname); } @@ -5857,6 +5859,7 @@ static void call_trans2qfilepathinfo(connection_struct *conn, fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -6695,6 +6698,7 @@ static NTSTATUS smb_set_file_unix_hlink(connection_struct *conn, oldname, ucf_flags, NULL, + NULL, &smb_fname_old); if (!NT_STATUS_IS_OK(status)) { return status; @@ -6770,6 +6774,7 @@ static NTSTATUS smb2_file_rename_information(connection_struct *conn, newname, ucf_flags, NULL, + NULL, &smb_fname_dst); if (!NT_STATUS_IS_OK(status)) { return status; @@ -6880,6 +6885,7 @@ static NTSTATUS smb_file_link_information(connection_struct *conn, newname, ucf_flags, NULL, + NULL, &smb_fname_dst); if (!NT_STATUS_IS_OK(status)) { return status; @@ -8828,6 +8834,7 @@ static void call_trans2setfilepathinfo(connection_struct *conn, fname, ucf_flags, NULL, + NULL, &smb_fname); if (!NT_STATUS_IS_OK(status)) { if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) { @@ -8977,6 +8984,7 @@ static void call_trans2mkdir(connection_struct *conn, struct smb_request *req, directory, ucf_flags, NULL, + NULL, &smb_dname); if (!NT_STATUS_IS_OK(status)) {