]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Remove TWRP handing inside get_original_lcomp().
authorJeremy Allison <jra@samba.org>
Tue, 2 Aug 2022 21:24:46 +0000 (14:24 -0700)
committerJeremy Allison <jra@samba.org>
Thu, 4 Aug 2022 17:09:31 +0000 (17:09 +0000)
Now we know all @GMT paths are removed before get_original_lcomp()
is called, we can eliminate this code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
source3/smbd/filename.c

index dc89dfffa5e25b4a46b6503340d36161a770b7fc..eb746f81105080ecb59cfdad079ada112db50a86 100644 (file)
@@ -1919,38 +1919,6 @@ char *get_original_lcomp(TALLOC_CTX *ctx,
                ucf_flags &= ~UCF_DFS_PATHNAME;
        }
 
-       /*
-        * NB. We don't need to care about
-        * is_fake_file_path(filename_in) here as these
-        * code paths don't ever return original_lcomp
-        * or use it anyway.
-        */
-
-       if (ucf_flags & UCF_GMT_PATHNAME) {
-               /*
-                * Ensure we don't return a @GMT
-                * value as the last component.
-                */
-               smb_fname = synthetic_smb_fname(ctx,
-                                       filename_in,
-                                       NULL,
-                                       NULL,
-                                       twrp,
-                                       0);
-               if (smb_fname == NULL) {
-                       TALLOC_FREE(fname);
-                       return NULL;
-               }
-               status = canonicalize_snapshot_path(smb_fname,
-                                                   ucf_flags,
-                                                   twrp);
-               if (!NT_STATUS_IS_OK(status)) {
-                       TALLOC_FREE(fname);
-                       TALLOC_FREE(smb_fname);
-                       return NULL;
-               }
-               filename_in = smb_fname->base_name;
-       }
        last_slash = strrchr(filename_in, '/');
        if (last_slash != NULL) {
                orig_lcomp = talloc_strdup(ctx, last_slash+1);