[SCM] Samba Shared Repository - branch master updated

David Disseldorp ddiss at samba.org
Tue Nov 12 11:23:02 MST 2013


The branch, master has been updated
       via  744abc8 s4-dsdb: Fix a use after free segfault.
       via  4cf8f10 s4-torture: Relax time checking in CHECK_NTTIME.
       via  654b784 s3-vfs: Fix stream_depot vfs module on btrfs.
       via  2405e79 Revert "s3-vfs: Fix stream_depot vfs module on btrfs."
      from  25be92b s3-libnetjoin: Fix Bug #10262: use upper-case realm when composing default upn.

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


- Log -----------------------------------------------------------------
commit 744abc882284bfde41b087bc06e13160b915f371
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Nov 12 14:09:56 2013 +0100

    s4-dsdb: Fix a use after free segfault.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>
    
    Autobuild-User(master): David Disseldorp <ddiss at samba.org>
    Autobuild-Date(master): Tue Nov 12 19:22:28 CET 2013 on sn-devel-104

commit 4cf8f105005b1f9839be3d9de6d41b5f90bdb158
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Nov 12 14:09:55 2013 +0100

    s4-torture: Relax time checking in CHECK_NTTIME.
    
    NTTIME has a nanosecond resolution. We should be tolerate if the system
    is busy writing and reading the value. To reproduce this problem just
    run the test under valgrind.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>

commit 654b784e9c9c3563afd1af853f4795117c258e56
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Nov 8 15:41:18 2013 +0100

    s3-vfs: Fix stream_depot vfs module on btrfs.
    
    Checking if the directory is empty using 'nlink == 2' only checks if
    there are no subdirectories. It doesn't indicate if there are files in
    the directory. However checking link count for no subdirectories is
    wrong and applications shouldn't rely on it, see:
    
    https://lkml.org/lkml/2012/2/1/756
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: David Disseldorp <ddiss at samba.org>

commit 2405e7906c41a2cd08f7e643dfc83b6380cadcf4
Author: David Disseldorp <ddiss at samba.org>
Date:   Tue Nov 12 16:33:20 2013 +0100

    Revert "s3-vfs: Fix stream_depot vfs module on btrfs."
    
    This reverts commit 29f12e7d5960906935e3af1405e9759a07d64750.
    
    The wrong patch was pushed, according to Andreas:
    	I sent a second version cause the first was not complete. I've
    	discussed with Volker after I sent the patch and then sent a new
    	patch which
    
    	a) also does the right thin in the unlink case
    	b) only tried to remove the server is the deletion of the file
    	   was successful.
    
    Signed-off-by: David Disseldorp <ddiss at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>

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

Summary of changes:
 source3/modules/vfs_streams_depot.c      |   24 +++++++++++-------------
 source4/dsdb/samdb/ldb_modules/rootdse.c |    7 ++++---
 source4/torture/raw/open.c               |    2 +-
 source4/torture/smb2/create.c            |    2 +-
 4 files changed, 17 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_streams_depot.c b/source3/modules/vfs_streams_depot.c
index f33d998..ae1af24 100644
--- a/source3/modules/vfs_streams_depot.c
+++ b/source3/modules/vfs_streams_depot.c
@@ -646,7 +646,8 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
 		return -1;
 	}
 
-	if (smb_fname_base->st.st_ex_nlink == 1) {
+	ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
+	if (ret == 0) {
 		char *dirname = stream_dir(handle, smb_fname_base,
 					   &smb_fname_base->st, false);
 
@@ -656,8 +657,6 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
 		TALLOC_FREE(dirname);
 	}
 
-	ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-
 	TALLOC_FREE(smb_fname_base);
 	return ret;
 }
@@ -665,7 +664,6 @@ static int streams_depot_unlink(vfs_handle_struct *handle,
 static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
 {
 	struct smb_filename *smb_fname_base = NULL;
-	char *dirname;
 	int ret = -1;
 
 	DEBUG(10, ("streams_depot_rmdir called for %s\n", path));
@@ -691,16 +689,16 @@ static int streams_depot_rmdir(vfs_handle_struct *handle, const char *path)
 		return -1;
 	}
 
-	dirname = stream_dir(handle,
-			     smb_fname_base,
-			     &smb_fname_base->st,
-			     false);
-	if (dirname != NULL) {
-		SMB_VFS_NEXT_RMDIR(handle, dirname);
-	}
-	TALLOC_FREE(dirname);
-
 	ret = SMB_VFS_NEXT_RMDIR(handle, path);
+	if (ret == 0) {
+		char *dirname = stream_dir(handle, smb_fname_base,
+					   &smb_fname_base->st, false);
+
+		if (dirname != NULL) {
+			SMB_VFS_NEXT_RMDIR(handle, dirname);
+		}
+		TALLOC_FREE(dirname);
+	}
 
 	TALLOC_FREE(smb_fname_base);
 	return ret;
diff --git a/source4/dsdb/samdb/ldb_modules/rootdse.c b/source4/dsdb/samdb/ldb_modules/rootdse.c
index f905aa2..7e1d277 100644
--- a/source4/dsdb/samdb/ldb_modules/rootdse.c
+++ b/source4/dsdb/samdb/ldb_modules/rootdse.c
@@ -1373,6 +1373,7 @@ static void rootdse_fsmo_transfer_callback(struct tevent_req *treq)
 	int ret;
 	struct ldb_request *req = fsmo->req;
 	struct ldb_context *ldb = fsmo->ldb;
+	struct ldb_module *module = fsmo->module;
 
 	status = dcerpc_drepl_takeFSMORole_recv(treq, fsmo, &werr);
 	talloc_free(fsmo);
@@ -1382,7 +1383,7 @@ static void rootdse_fsmo_transfer_callback(struct tevent_req *treq)
 		 * Now that it is failed, start the transaction up
 		 * again so the wrappers can close it without additional error
 		 */
-		ldb_next_start_trans(fsmo->module);
+		ldb_next_start_trans(module);
 		ldb_module_done(req, NULL, NULL, LDB_ERR_UNAVAILABLE);
 		return;
 	}
@@ -1392,7 +1393,7 @@ static void rootdse_fsmo_transfer_callback(struct tevent_req *treq)
 		 * Now that it is failed, start the transaction up
 		 * again so the wrappers can close it without additional error
 		 */
-		ldb_next_start_trans(fsmo->module);
+		ldb_next_start_trans(module);
 		ldb_module_done(req, NULL, NULL, LDB_ERR_UNAVAILABLE);
 		return;
 	}
@@ -1401,7 +1402,7 @@ static void rootdse_fsmo_transfer_callback(struct tevent_req *treq)
 	 * Now that it is done, start the transaction up again so the
 	 * wrappers can close it without error
 	 */
-	ret = ldb_next_start_trans(fsmo->module);
+	ret = ldb_next_start_trans(module);
 	ldb_module_done(req, NULL, NULL, ret);
 }
 
diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c
index 0968cfe..0ec28c3 100644
--- a/source4/torture/raw/open.c
+++ b/source4/torture/raw/open.c
@@ -112,7 +112,7 @@ static const char *rdwr_string(enum rdwr_mode m)
 	status = smb_raw_pathinfo(cli->tree, tctx, &finfo); \
 	CHECK_STATUS(status, NT_STATUS_OK); \
 	t2 = finfo.all_info.out.field; \
-	if (t != t2) { \
+	if (abs(t-t2) > 20000) { \
 		torture_result(tctx, TORTURE_FAIL, \
 		       "(%s) wrong time for field %s  %s - %s\n", \
 		       __location__, #field, \
diff --git a/source4/torture/smb2/create.c b/source4/torture/smb2/create.c
index fcf40e1..f5b40b6 100644
--- a/source4/torture/smb2/create.c
+++ b/source4/torture/smb2/create.c
@@ -81,7 +81,7 @@
 	status = smb2_getinfo_file(tree, tctx, &finfo); \
 	CHECK_STATUS(status, NT_STATUS_OK); \
 	t2 = finfo.all_info.out.field; \
-	if (t != t2) { \
+	if (abs(t-t2) > 20000) { \
 		torture_result(tctx, TORTURE_FAIL, \
 			"(%s) wrong time for field %s  %s - %s\n", \
 		       __location__, #field, \


-- 
Samba Shared Repository


More information about the samba-cvs mailing list