From c9c8c83ca24e18a56cefaa257d46615c6b10aec9 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 2020 16:05:34 -0700 Subject: [PATCH] s3: smbd: Add a dirfsp parameter to user_can_read_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 fe001a18a6c..17eeec05577 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1069,6 +1069,7 @@ bool get_dir_entry(TALLOC_CTX *ctx, ********************************************************************/ static bool user_can_read_file(connection_struct *conn, + struct files_struct *dirfsp, struct smb_filename *smb_fname) { NTSTATUS status; @@ -1080,6 +1081,8 @@ static bool user_can_read_file(connection_struct *conn, FILE_READ_ATTRIBUTES| SEC_STD_READ_CONTROL; + SMB_ASSERT(dirfsp == conn->cwd_fsp); + /* * Never hide files from the root user. * We use (uid_t)0 here not sec_initial_uid() @@ -1276,6 +1279,7 @@ bool is_visible_file(connection_struct *conn, /* Honour _hide unreadable_ option */ if (hide_unreadable && !user_can_read_file(conn, + conn->cwd_fsp, smb_fname_base)) { DEBUG(10,("is_visible_file: file %s is unreadable.\n", -- 2.47.3