s3: smbd: SMB1 Remove the crazy semantics in filename_convert_internal() using UCF_CO...
authorJeremy Allison <jra@samba.org>
Tue, 29 Sep 2020 03:10:32 +0000 (20:10 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 30 Sep 2020 20:46:39 +0000 (20:46 +0000)
In the places where wildcards are allowed in SMB1
we always pass in UCF_ALWAYS_ALLOW_WCARD_LCOMP.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/filename.c

index 73ea63ffd25b0890db5896e7fac20b1352bfa41d..f7c49cc907f9f9a05da60e1d9460577e61414446 100644 (file)
@@ -487,8 +487,8 @@ Note NT_STATUS_OK doesn't mean the name exists or is valid, just that we
 didn't get any fatal errors that should immediately terminate the calling SMB
 processing whilst resolving.
 
-If UCF_ALWAYS_ALLOW_WCARD_LCOMP is passed in, then a MS wildcard was detected
-and should be allowed in the last component of the path only.
+If UCF_ALWAYS_ALLOW_WCARD_LCOMP is passed in, then a MS wildcard
+should be allowed in the last component of the path only.
 
 If the orig_path was a stream, smb_filename->base_name will point to the base
 filename, and smb_filename->stream_name will point to the stream name.  If
@@ -1901,9 +1901,6 @@ char *get_original_lcomp(TALLOC_CTX *ctx,
  * @param smbreq       SMB request if we're using privileges.
  * @param name_in      The unconverted name.
  * @param ucf_flags    flags to pass through to unix_convert().
- *                     UCF_ALWAYS_ALLOW_WCARD_LCOMP will be OR'd in if
- *                     p_cont_wcard != NULL and is true and
- *                     UCF_COND_ALLOW_WCARD_LCOMP.
  * @param twrp         Optional VSS time
  * @param p_cont_wcard If not NULL, will be set to true if the dfs path
  *                     resolution detects a wildcard.
@@ -1962,15 +1959,6 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       /*
-        * If the caller conditionally allows wildcard lookups, only add the
-        * always allow if the path actually does contain a wildcard.
-        */
-       if (ucf_flags & UCF_COND_ALLOW_WCARD_LCOMP &&
-           ppath_contains_wcard != NULL && *ppath_contains_wcard) {
-               ucf_flags |= UCF_ALWAYS_ALLOW_WCARD_LCOMP;
-       }
-
        status = unix_convert(ctx, conn, name_in, twrp, &smb_fname, ucf_flags);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(10,("filename_convert_internal: unix_convert failed "