}
}
- if (fsp->fsp_flags.is_directory) {
- status = close_directory(req, fsp, close_type);
- } else if (fsp->fake_file_handle != NULL) {
+ if (fsp->fake_file_handle != NULL) {
status = close_fake_file(req, fsp);
} else if (fsp->print_file != NULL) {
/* FIXME: return spool errors */
print_spool_end(fsp, close_type);
file_free(req, fsp);
status = NT_STATUS_OK;
+ } else if (!fsp->fsp_flags.is_fsa) {
+ if (close_type == NORMAL_CLOSE) {
+ DBG_ERR("unexpected NORMAL_CLOSE for [%s] "
+ "is_fsa[%u] is_pathref[%u] is_directory[%u]\n",
+ fsp_str_dbg(fsp),
+ fsp->fsp_flags.is_fsa,
+ fsp->fsp_flags.is_pathref,
+ fsp->fsp_flags.is_directory);
+ }
+ SMB_ASSERT(close_type != NORMAL_CLOSE);
+ fd_close(fsp);
+ file_free(req, fsp);
+ status = NT_STATUS_OK;
+ } else if (fsp->fsp_flags.is_directory) {
+ status = close_directory(req, fsp, close_type);
} else {
status = close_normal_file(req, fsp, close_type);
}