diff options
author | Jeremy Allison <jra@samba.org> | 2022-08-17 11:35:29 -0700 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-08-23 07:45:16 +0000 |
commit | 706c64c6f0ee8cca24715cf4d591ed504432ce0f (patch) | |
tree | bebe7eaac8f34fcaf2c3e2a58dcd4e5dec7a8b7e | |
parent | d1bc0d0b51bb8145c4d1597a39f72d85b28f8b35 (diff) | |
download | samba-706c64c6f0ee8cca24715cf4d591ed504432ce0f.tar.gz |
s3: smbd: Add "enum file_close_type close_type" parameter to close_cnum().
Not yet used, but needed so we can differentiate between
SHUTDOWN_CLOSE and ERROR_CLOSE in smbXsrv_tcon_disconnect()
if we fail to chdir. In that case we want to close the fd,
but not run any delete-on-close actions.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15128
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
(cherry picked from commit 9203d17106c0e55a30813ff1ed76869c7581a343)
[npower@samba.org Adjusted for 4.15 filename change
smb2-service.c -> service.c]
-rw-r--r-- | source3/smbd/proto.h | 4 | ||||
-rw-r--r-- | source3/smbd/service.c | 4 | ||||
-rw-r--r-- | source3/smbd/smbXsrv_tcon.c | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 598ca1de2e2..b3397f29f32 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -1124,7 +1124,9 @@ connection_struct *make_connection(struct smb_request *req, const char *service_in, const char *pdev, uint64_t vuid, NTSTATUS *status); -void close_cnum(connection_struct *conn, uint64_t vuid); +void close_cnum(connection_struct *conn, + uint64_t vuid, + enum file_close_type close_type); /* The following definitions come from smbd/session.c */ struct sessionid; diff --git a/source3/smbd/service.c b/source3/smbd/service.c index ef7c14d92d0..b07239cc6fe 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -1111,7 +1111,9 @@ connection_struct *make_connection(struct smb_request *req, Close a cnum. ****************************************************************************/ -void close_cnum(connection_struct *conn, uint64_t vuid) +void close_cnum(connection_struct *conn, + uint64_t vuid, + enum file_close_type close_type) { char rootpath[2] = { '/', '\0'}; struct smb_filename root_fname = { .base_name = rootpath }; diff --git a/source3/smbd/smbXsrv_tcon.c b/source3/smbd/smbXsrv_tcon.c index b515b19e88f..8707082edd6 100644 --- a/source3/smbd/smbXsrv_tcon.c +++ b/source3/smbd/smbXsrv_tcon.c @@ -921,12 +921,12 @@ NTSTATUS smbXsrv_tcon_disconnect(struct smbXsrv_tcon *tcon, uint64_t vuid) * removed from the linked list * conn->sconn->connections. */ - close_cnum(tcon->compat, vuid); + close_cnum(tcon->compat, vuid, ERROR_CLOSE); tcon->compat = NULL; return status; } - close_cnum(tcon->compat, vuid); + close_cnum(tcon->compat, vuid, SHUTDOWN_CLOSE); tcon->compat = NULL; } |