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,
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;
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
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
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)) {