1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

s3: smbd: SMB1 rename_internals() can figure out the wildcard status of the paths by itself.

No need to pass them as parameters.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2020-09-29 13:08:01 -07:00 committed by Ralph Boehme
parent 83b17f4f3e
commit b89c0a6d3f
4 changed files with 14 additions and 10 deletions

View File

@ -1843,8 +1843,6 @@ void reply_ntrename(struct smb_request *req)
dst_original_lcomp,
attrs,
false,
false, /* src_has_wcard */
dest_has_wcard,
DELETE_ACCESS);
break;
case RENAME_FLAG_HARD_LINK:

View File

@ -1050,8 +1050,6 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
const char *dst_original_lcomp,
uint32_t attrs,
bool replace_if_exists,
bool src_has_wild,
bool dest_has_wild,
uint32_t access_mask);
void reply_mv(struct smb_request *req);
NTSTATUS copy_file(TALLOC_CTX *ctx,

View File

@ -7964,8 +7964,6 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
const char *dst_original_lcomp,
uint32_t attrs,
bool replace_if_exists,
bool src_has_wild,
bool dest_has_wild,
uint32_t access_mask)
{
char *fname_src_dir = NULL;
@ -7981,6 +7979,8 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
bool posix_pathnames = (req != NULL && req->posix_pathnames);
struct smb2_create_blobs *posx = NULL;
int rc;
bool src_has_wild = false;
bool dest_has_wild = false;
/*
* Split the old name into directory and last component
@ -7999,6 +7999,18 @@ NTSTATUS rename_internals(TALLOC_CTX *ctx,
goto out;
}
if (req != NULL && !req->posix_pathnames) {
/*
* Check the wildcard mask *before*
* unmangling. As mangling is done
* for names that can't be returned
* to Windows the unmangled name may
* contain Windows wildcard characters.
*/
src_has_wild = ms_has_wild(fname_src_mask);
dest_has_wild = ms_has_wild(dst_original_lcomp);
}
/*
* We should only check the mangled cache
* here if unix_convert failed. This means
@ -8471,8 +8483,6 @@ void reply_mv(struct smb_request *req)
dst_original_lcomp,
attrs,
false,
src_has_wcard,
dest_has_wcard,
DELETE_ACCESS);
if (!NT_STATUS_IS_OK(status)) {
if (open_was_deferred(req->xconn, req->mid)) {

View File

@ -7501,8 +7501,6 @@ static NTSTATUS smb_file_rename_information(connection_struct *conn,
dst_original_lcomp,
0,
overwrite,
false,
dest_has_wcard,
FILE_WRITE_ATTRIBUTES);
}
out: