From 18f67e354f36e5b0ddb2f04e41d9463f35d7957c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 2020 15:31:43 -0700 Subject: [PATCH] s3: smbd: Add dirfsp parameter to user_can_write_file(). Not yet used. Currently always conn->cwd_fsp. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- source3/smbd/dir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 1ac273664f8..1758bbd98c9 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1153,8 +1153,11 @@ static bool user_can_read_file(connection_struct *conn, ********************************************************************/ static bool user_can_write_file(connection_struct *conn, + struct files_struct *dirfsp, const struct smb_filename *smb_fname) { + SMB_ASSERT(dirfsp == conn->cwd_fsp); + /* * Never hide files from the root user. * We use (uid_t)0 here not sec_initial_uid() @@ -1281,6 +1284,7 @@ bool is_visible_file(connection_struct *conn, /* Honour _hide unwriteable_ option */ if (hide_unwriteable && !user_can_write_file(conn, + conn->cwd_fsp, smb_fname_base)) { DEBUG(10,("is_visible_file: file %s is unwritable.\n", -- 2.47.3