From: Jeremy Allison Date: Tue, 2 Aug 2022 21:24:46 +0000 (-0700) Subject: s3: smbd: Remove TWRP handing inside get_original_lcomp(). X-Git-Tag: samba-4.17.0rc1~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2d9938dac32ff4afb1dee840bcab50dc84b76bb4;p=thirdparty%2Fsamba.git s3: smbd: Remove TWRP handing inside get_original_lcomp(). Now we know all @GMT paths are removed before get_original_lcomp() is called, we can eliminate this code. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index dc89dfffa5e..eb746f81105 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -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);