From: Jeremy Allison Date: Fri, 4 Jun 2021 20:46:08 +0000 (-0700) Subject: s3: smbd: Remove user_can_write_file(). X-Git-Tag: tevent-0.11.0~558 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0c8f928198c99b183ca60e4372d73ebafb8100d3;p=thirdparty%2Fsamba.git s3: smbd: Remove user_can_write_file(). No longer used. Signed-off-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c index 892db195d7b..20fee6dc3e8 100644 --- a/source3/smbd/dir.c +++ b/source3/smbd/dir.c @@ -1237,42 +1237,6 @@ static bool user_can_read_fsp(struct files_struct *fsp) return true; } -#if 0 -/******************************************************************* - Check to see if a user can write a file (and only files, we do not - check dirs on this one). This is only approximate, - it is used as part of the "hide unwriteable" option. Don't - use it for anything security sensitive. -********************************************************************/ - -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() - * as make test uses a single user context. - */ - - if (get_current_uid(conn) == (uid_t)0) { - return True; - } - - SMB_ASSERT(VALID_STAT(smb_fname->st)); - - /* Pseudo-open the file */ - - if(S_ISDIR(smb_fname->st.st_ex_mode)) { - return True; - } - - return can_write_to_file(conn, dirfsp, smb_fname); -} -#endif - /******************************************************************* Check to see if a user can write to an fsp. Always return true for directories.