1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3: smbd: Fix SMB1 reply_mv() to handle wildcards.

Pass in the original source last component to rename_internals()
from reply_mv().

Change the wildcard detection in rename_internals() to
look at the correct thing for the source path.

This is now correctly set only from the unmangled last component
of the source path sent to reply_mv().

We now pass:

Samba3.smbtorture_s3.crypt_client.SMB1-WILD-MANGLE-RENAME(nt4_dc_smb1)
samba3.smbtorture_s3.plain.SMB1-WILD-MANGLE-RENAME(fileserver_smb1)

so remove the knownfail.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Oct  8 16:29:27 UTC 2020 on sn-devel-184
This commit is contained in:
Jeremy Allison 2020-10-05 12:16:32 -07:00 committed by Ralph Boehme
parent f75e633fde
commit f696d29fcc
2 changed files with 15 additions and 5 deletions

View File

@ -1,3 +0,0 @@
# Check SMB1 wildcard demangle
^samba3.smbtorture_s3.plain.SMB1-WILD-MANGLE-RENAME.smbtorture\(fileserver_smb1\)
^samba3.smbtorture_s3.crypt_client.SMB1-WILD-MANGLE-RENAME.smbtorture\(nt4_dc_smb1\)

View File

@ -7909,7 +7909,9 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
* to Windows the unmangled name may
* contain Windows wildcard characters.
*/
src_has_wild = ms_has_wild(fname_src_mask);
if (src_original_lcomp != NULL) {
src_has_wild = ms_has_wild(src_original_lcomp);
}
dest_has_wild = ms_has_wild(dst_original_lcomp);
}
@ -8264,6 +8266,7 @@ void reply_mv(struct smb_request *req)
NTSTATUS status;
TALLOC_CTX *ctx = talloc_tos();
struct smb_filename *smb_fname_src = NULL;
const char *src_original_lcomp = NULL;
struct smb_filename *smb_fname_dst = NULL;
const char *dst_original_lcomp = NULL;
uint32_t src_ucf_flags = ucf_flags_from_smb_request(req) |
@ -8329,6 +8332,16 @@ void reply_mv(struct smb_request *req)
goto out;
}
/* Get the last component of the source for rename_internals(). */
src_original_lcomp = get_original_lcomp(ctx,
conn,
name,
dst_ucf_flags);
if (src_original_lcomp == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
goto out;
}
status = filename_convert(ctx,
conn,
newname,
@ -8375,7 +8388,7 @@ void reply_mv(struct smb_request *req)
conn,
req,
smb_fname_src,
NULL,
src_original_lcomp,
smb_fname_dst,
dst_original_lcomp,
attrs,