s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathn...
authorJeremy Allison <jra@samba.org>
Thu, 26 Mar 2020 23:22:36 +0000 (16:22 -0700)
committerRalph Boehme <slow@samba.org>
Mon, 30 Mar 2020 14:45:31 +0000 (14:45 +0000)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/smbd/filename.c

index d967366a089f83dad9f212c05fb7d7bf604086e8..9faff9da45afc237c2f92cd72880a060c2da5f00 100644 (file)
@@ -445,9 +445,6 @@ 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 the UCF_SAVE_LCOMP flag is passed in, then the unmodified last component
-of the pathname is set in smb_filename->original_lcomp.
-
 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.
 
@@ -477,7 +474,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
        bool posix_pathnames = (ucf_flags & UCF_POSIX_PATHNAMES);
        bool allow_wcard_last_component =
            (ucf_flags & UCF_ALWAYS_ALLOW_WCARD_LCOMP);
-       bool save_last_component = ucf_flags & UCF_SAVE_LCOMP;
        bool snapshot_path = (ucf_flags & UCF_GMT_PATHNAME);
        NTSTATUS status;
        int ret = -1;
@@ -575,25 +571,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                goto err;
        }
 
-       /*
-        * Ensure saved_last_component is valid even if file exists.
-        */
-
-       if(save_last_component) {
-               end = strrchr_m(smb_fname->base_name, '/');
-               if (end) {
-                       smb_fname->original_lcomp = talloc_strdup(smb_fname,
-                                                                 end + 1);
-               } else {
-                       smb_fname->original_lcomp =
-                           talloc_strdup(smb_fname, smb_fname->base_name);
-               }
-               if (smb_fname->original_lcomp == NULL) {
-                       status = NT_STATUS_NO_MEMORY;
-                       goto err;
-               }
-       }
-
        /*
         * Strip off the stream, and add it back when we're done with the
         * base_name.
@@ -856,17 +833,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
                        *end = 0;
                }
 
-               if (save_last_component) {
-                       TALLOC_FREE(smb_fname->original_lcomp);
-                       smb_fname->original_lcomp = talloc_strdup(smb_fname,
-                                                       end ? end + 1 : start);
-                       if (!smb_fname->original_lcomp) {
-                               DBG_ERR("talloc failed\n");
-                               status = NT_STATUS_NO_MEMORY;
-                               goto err;
-                       }
-               }
-
                /* The name cannot have a component of "." */
 
                if (ISDOT(start)) {