]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Remove the old unlink_internals() implementation.
authorJeremy Allison <jra@samba.org>
Fri, 10 Dec 2021 00:16:52 +0000 (16:16 -0800)
committerRalph Boehme <slow@samba.org>
Sat, 11 Dec 2021 07:17:28 +0000 (07:17 +0000)
No longer used. filename_convert() already handles mangled
names just fine, so we don't need this logic.

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

index 71be06ecc8c953ab51b630d187cc369c84dbe2ba..2623165966fd76700239148e7b1c57e474a2d9f1 100644 (file)
@@ -3275,88 +3275,6 @@ NTSTATUS unlink_internals(connection_struct *conn,
        return close_file(req, fsp, NORMAL_CLOSE);
 }
 
-#if 0
-/****************************************************************************
- The guts of the unlink command, split out so it may be called by the NT SMB
- code.
-****************************************************************************/
-
-NTSTATUS unlink_internals(connection_struct *conn,
-                       struct smb_request *req,
-                       uint32_t dirtype,
-                       struct smb_filename *smb_fname)
-{
-       char *fname_dir = NULL;
-       char *fname_mask = NULL;
-       NTSTATUS status = NT_STATUS_OK;
-       struct smb_filename *smb_fname_dir = NULL;
-       TALLOC_CTX *ctx = talloc_tos();
-       bool posix_pathname = (smb_fname->flags & SMB_FILENAME_POSIX_PATH);
-
-       /* Split up the directory from the filename/mask. */
-       status = split_fname_dir_mask(ctx, smb_fname->base_name,
-                                     &fname_dir, &fname_mask);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto out;
-       }
-
-       /*
-        * We should only check the mangled cache
-        * here if unix_convert failed. This means
-        * that the path in 'mask' doesn't exist
-        * on the file system and so we need to look
-        * for a possible mangle. This patch from
-        * Tine Smukavec <valentin.smukavec@hermes.si>.
-        */
-
-       if (!VALID_STAT(smb_fname->st) &&
-           !posix_pathname &&
-           mangle_is_mangled(fname_mask, conn->params)) {
-               char *new_mask = NULL;
-               mangle_lookup_name_from_8_3(ctx, fname_mask,
-                                           &new_mask, conn->params);
-               if (new_mask) {
-                       TALLOC_FREE(fname_mask);
-                       fname_mask = new_mask;
-               }
-       }
-
-       /*
-        * Only one file needs to be unlinked. Append the mask back
-        * onto the directory.
-        */
-       TALLOC_FREE(smb_fname->base_name);
-       if (ISDOT(fname_dir)) {
-               /* Ensure we use canonical names on open. */
-               smb_fname->base_name = talloc_asprintf(smb_fname,
-                                               "%s",
-                                               fname_mask);
-       } else {
-               smb_fname->base_name = talloc_asprintf(smb_fname,
-                                               "%s/%s",
-                                               fname_dir,
-                                               fname_mask);
-       }
-       if (!smb_fname->base_name) {
-               status = NT_STATUS_NO_MEMORY;
-               goto out;
-       }
-
-       status = check_name(conn, smb_fname);
-       if (!NT_STATUS_IS_OK(status)) {
-               goto out;
-       }
-
-       status = do_unlink(conn, req, smb_fname, dirtype);
-
- out:
-       TALLOC_FREE(smb_fname_dir);
-       TALLOC_FREE(fname_dir);
-       TALLOC_FREE(fname_mask);
-       return status;
-}
-#endif
-
 /****************************************************************************
  Reply to a unlink
 ****************************************************************************/