[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Nov 3 17:33:01 UTC 2021


The branch, master has been updated
       via  b919798f575 smbd: early out in is_visible_fsp()
       via  3cb9f8f5ff2 vfs_fruit: remove a fsp check from ad_fset()
      from  bbdcd66c048 s3: smbd: dirfsp is being used uninitialized inside rmdir_internals().

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit b919798f5758e3284ff7f6f7402312c0a4b24d03
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Nov 3 14:40:01 2021 +0100

    smbd: early out in is_visible_fsp()
    
    This is used in a hot codepath (directory enumeration) so we should avoiding the
    string comparisions by adding an early exit.
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Nov  3 17:33:00 UTC 2021 on sn-devel-184

commit 3cb9f8f5ff29c14e117b57896c4540cc66510a1a
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Nov 2 05:34:59 2021 +0100

    vfs_fruit: remove a fsp check from ad_fset()
    
    This comes from times before we had pathref fsps. Back then if you wanted to
    check if fsp->fh->fd contained a valid value != -1, you'd also first check that
    the passed in fsp and fsp->fh are non NULL. With pathref fsps we don't need this
    anymore.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14890
    RN: Crash in vfs_fruit asking for fsp_get_io_fd() for an XATTR call
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/adouble.c | 7 -------
 source3/smbd/dir.c    | 8 ++++++++
 2 files changed, 8 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c
index fd435b6592d..f809a445081 100644
--- a/source3/lib/adouble.c
+++ b/source3/lib/adouble.c
@@ -2591,13 +2591,6 @@ int ad_fset(struct vfs_handle_struct *handle,
 
 	DBG_DEBUG("Path [%s]\n", fsp_str_dbg(fsp));
 
-	if ((fsp == NULL)
-	    || (fsp->fh == NULL)
-	    || (fsp_get_io_fd(fsp) == -1))
-	{
-		smb_panic("bad fsp");
-	}
-
 	ok = ad_pack(handle, ad, fsp);
 	if (!ok) {
 		return -1;
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 4d61bb0d56d..856a3625a75 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -1356,6 +1356,14 @@ bool is_visible_fsp(struct files_struct *fsp)
 	hide_special = lp_hide_special_files(SNUM(fsp->conn));
 	hide_new_files_timeout = lp_hide_new_files_timeout(SNUM(fsp->conn));
 
+	if (!hide_unreadable &&
+	    !hide_unwriteable &&
+	    !hide_special &&
+	    (hide_new_files_timeout == 0))
+	{
+		return true;
+	}
+
 	if (fsp->base_fsp != NULL) {
 		/* Only operate on non-stream files. */
 		fsp = fsp->base_fsp;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list