From: Jeremy Allison Date: Thu, 26 Mar 2020 23:22:36 +0000 (-0700) Subject: s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathn... X-Git-Tag: ldb-2.2.0~1146 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79b945d44eac5891e2a3cd4ef3c4aef9a1923c0a;p=thirdparty%2Fsamba.git s3: smbd: Now we no longer use it, remove all references to original_lcomp from pathname processing code. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c index d967366a089..9faff9da45a 100644 --- a/source3/smbd/filename.c +++ b/source3/smbd/filename.c @@ -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)) {