summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2020-12-16 19:49:56 -0800
committerJeremy Allison <jra@samba.org>2020-12-17 18:56:28 +0000
commit59b0fae26e1f7c1d340be4b67bbca13ff8bba43f (patch)
tree9bf1906e7f121f1242f9c0be14a18ab0763c92d5 /source3
parent12dd02d884df84b9e6ea14e67c13a86482cf9cc5 (diff)
downloadsamba-59b0fae26e1f7c1d340be4b67bbca13ff8bba43f.tar.gz
smbd: Move closing a print file out of close_normal_file() (it isn't a normal file) and into close_file().
Streamlines closing print files and allows close_normal_file() to restrict itself to is_fsa fsps. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/smbd/close.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index a0d05570da2..f1aca052470 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -788,13 +788,6 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
fsp->op->global->durable = false;
}
- if (fsp->print_file) {
- /* FIXME: return spool errors */
- print_spool_end(fsp, close_type);
- file_free(req, fsp);
- return NT_STATUS_OK;
- }
-
/* If this is an old DOS or FCB open and we have multiple opens on
the same handle we only have one share mode. Ensure we only remove
the share mode on the last close. */
@@ -1306,6 +1299,11 @@ NTSTATUS close_file(struct smb_request *req, files_struct *fsp,
status = close_directory(req, fsp, close_type);
} else 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 {
status = close_normal_file(req, fsp, close_type);
}