summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2022-02-03 15:59:51 -0800
committerJule Anger <janger@samba.org>2022-02-09 11:09:41 +0000
commitcdcf23aac2f979d1ffa33a3a7b3fe98aa47c83d7 (patch)
tree9dff2281ee4948f5ceda5dfc968942fafe69feb0
parent35a250f49ee8ae49fc8a9dfbb704211b189c9435 (diff)
downloadsamba-cdcf23aac2f979d1ffa33a3a7b3fe98aa47c83d7.tar.gz
s3: libsmb: Call cli_dfs_target_check() from cli_smb2_rename_send().
Strips off any DFS prefix from the target if passed in. Remove knownfail selftest/knownfail.d/msdfs-rename. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14169 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Feb 4 12:02:36 UTC 2022 on sn-devel-184 (cherry picked from commit b9b82f3611c56e837e9189f5275ae9a78e647262)
-rw-r--r--selftest/knownfail.d/msdfs-rename1
-rw-r--r--source3/libsmb/cli_smb2_fnum.c14
2 files changed, 14 insertions, 1 deletions
diff --git a/selftest/knownfail.d/msdfs-rename b/selftest/knownfail.d/msdfs-rename
deleted file mode 100644
index 1961e5de1fc..00000000000
--- a/selftest/knownfail.d/msdfs-rename
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.blackbox.smbclient_s3.SMB3.*.Rename\ on\ MS-DFS\ share\(.*\)
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 87c56b5564d..13d23ed6566 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -3215,12 +3215,26 @@ struct tevent_req *cli_smb2_rename_send(
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_smb2_rename_state *state = NULL;
+ NTSTATUS status;
req = tevent_req_create(
mem_ctx, &state, struct cli_smb2_rename_state);
if (req == NULL) {
return NULL;
}
+
+ /*
+ * Strip a MSDFS path from fname_dst if we were given one.
+ */
+ status = cli_dfs_target_check(state,
+ cli,
+ fname_src,
+ fname_dst,
+ &fname_dst);
+ if (tevent_req_nterror(req, status)) {
+ return tevent_req_post(req, ev);
+ }
+
state->ev = ev;
state->cli = cli;
state->fname_dst = fname_dst;