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
****************************************************************************/