[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Sat Oct 30 04:35:01 UTC 2021


The branch, master has been updated
       via  be3a47e22ad s3:modules:recycle - fix crash in recycle_unlink_internal
      from  14f56750fcf fix undefined-shift in put_res_rec fuzz error: ../../source3/libsmb/nmblib.c:451:4: runtime error: left shift of 65312 by 16 places cannot be represented in type 'int'

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


- Log -----------------------------------------------------------------
commit be3a47e22ad6be204f4a7d6070f82f990c17e6fb
Author: Andrew Walker <awalker at ixsystems.com>
Date:   Thu Oct 28 16:01:42 2021 -0400

    s3:modules:recycle - fix crash in recycle_unlink_internal
    
    Original logic for separating path from base name assumed
    that we were using same string to determine offset when
    getting the parent dir name (smb_fname->base_name).
    
    Simplify by using parent_dirname() to split the path
    from base name.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=14888
    
    Signed-off-by: Andrew Walker <awalker at ixsystems.com>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Oct 30 04:34:53 UTC 2021 on sn-devel-184

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

Summary of changes:
 source3/modules/vfs_recycle.c | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c
index 1c18f232c32..6e657943110 100644
--- a/source3/modules/vfs_recycle.c
+++ b/source3/modules/vfs_recycle.c
@@ -571,17 +571,10 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 	 */
 
 	/* extract filename and path */
-	base = strrchr(full_fname->base_name, '/');
-	if (base == NULL) {
-		base = full_fname->base_name;
-		path_name = SMB_STRDUP("/");
-		ALLOC_CHECK(path_name, done);
-	}
-	else {
-		path_name = SMB_STRDUP(full_fname->base_name);
-		ALLOC_CHECK(path_name, done);
-		path_name[base - smb_fname->base_name] = '\0';
-		base++;
+	if (!parent_dirname(talloc_tos(), full_fname->base_name, &path_name, &base)) {
+		rc = -1;
+		errno = ENOMEM;
+		goto done;
 	}
 
 	/* original filename with path */
@@ -716,7 +709,7 @@ static int recycle_unlink_internal(vfs_handle_struct *handle,
 				 recycle_touch_mtime(handle));
 
 done:
-	SAFE_FREE(path_name);
+	TALLOC_FREE(path_name);
 	SAFE_FREE(temp_name);
 	SAFE_FREE(final_name);
 	TALLOC_FREE(full_fname);


-- 
Samba Shared Repository



More information about the samba-cvs mailing list