[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Sep 10 18:31:02 MDT 2012


The branch, master has been updated
       via  6a1fa3e samba3.smb2.durable-open.delete_on_close1 is now flapping (sometimes passes).
       via  79f0524 s3: Run raw.oplock
       via  814dc3c smbtorture: Test that delete requests are not special
       via  ab70954 s3: delete requests are not special
       via  008bb29 Set trans to a value that is not LDB_SUCCESS (all LDB_ constants are positive) so that any "goto failed:" call does not end up calling ldb_transaction_cancel() if trans is initialized to 0 (LDB_SUCCESS) by chance.
       via  da731c1 Call TALLOC_FREE() before we return otherwise we will never free sam_account
      from  ba5f557 Fix talloc memory heirarchy bug. If there's an SMB2 sessionsetup in flight when we're shut down, we end up freeing the struct smbXsrv_session *session pointer twice.

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


- Log -----------------------------------------------------------------
commit 6a1fa3e0a7f5f268e193c8b9ef40432d3d51f4aa
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Sep 10 15:46:27 2012 -0700

    samba3.smb2.durable-open.delete_on_close1 is now flapping (sometimes passes).
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Tue Sep 11 02:30:55 CEST 2012 on sn-devel-104

commit 79f05247d56603552d750b5d8cc6e82793ff7cb5
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Sep 10 15:52:20 2012 +0200

    s3: Run raw.oplock
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 814dc3c62b87c9a69116e82e57ff7b0466bbd61d
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Sep 10 12:25:06 2012 +0200

    smbtorture: Test that delete requests are not special
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit ab709544f4ebddc1ae1838312c43cdeb734dfc19
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Sep 10 11:25:03 2012 +0200

    s3: delete requests are not special
    
    The only difference between batch and exclusive oplocks is the time of
    the check: Batch is checked before the share mode check, exclusive after.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit 008bb29023ed6875d4ed2def0976b55051de02bf
Author: Michele Baldessari <michele at acksyn.org>
Date:   Mon Sep 10 14:58:28 2012 -0700

    Set trans to a value that is not LDB_SUCCESS (all LDB_ constants are
    positive) so that any "goto failed:" call does not end up calling
    ldb_transaction_cancel() if trans is initialized to 0 (LDB_SUCCESS)
    by chance.
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

commit da731c1c587dc081d81f03f08920791039c47d0e
Author: Michele Baldessari <michele at acksyn.org>
Date:   Mon Sep 10 13:31:11 2012 -0700

    Call TALLOC_FREE() before we return otherwise we will never free sam_account
    
    Signed-off-by: Jeremy Allison <jra at samba.org>

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

Summary of changes:
 selftest/flapping            |    1 +
 source3/selftest/tests.py    |    2 +-
 source3/smbd/open.c          |   16 --------
 source3/utils/pdbedit.c      |    2 +-
 source4/torture/raw/oplock.c |   78 ++++++++++++++++++++++++++++++++++++++++++
 source4/winbind/idmap.c      |    2 +-
 6 files changed, 82 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/flapping b/selftest/flapping
index f0b1528..cce6a9a 100644
--- a/selftest/flapping
+++ b/selftest/flapping
@@ -24,3 +24,4 @@
 ^samba3.raw.samba3checkfsp.samba3checkfsp\(plugin_s4_dc\) # Seems to flap - succeeds on sn-devel, fails on Fedora 16
 ^samba3.raw.samba3closeerr.samba3closeerr\(plugin_s4_dc\) # Seems to flap - succeeds on sn-devel, fails on Fedora 16
 ^samba4.nss.test.*using.*winbind # fails sometimes on sn-devel
+^samba3.smb2.durable-open.delete_on_close1 # another intermittent failure
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index f887f7f..f4a0d54 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -274,7 +274,7 @@ base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.de
         "base.xcopy", "base.samba3error"]
 
 raw = ["raw.acls", "raw.chkpath", "raw.close", "raw.composite", "raw.context", "raw.eas",
-       "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock"
+       "raw.ioctl", "raw.lock", "raw.mkdir", "raw.mux", "raw.notify", "raw.open", "raw.oplock",
        "raw.qfileinfo", "raw.qfsinfo", "raw.read", "raw.rename", "raw.search", "raw.seek",
        "raw.sfileinfo.base", "raw.sfileinfo.bug", "raw.streams", "raw.unlink", "raw.write",
        "raw.samba3hide", "raw.samba3badpath", "raw.sfileinfo.rename", "raw.session",
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 5fa45aa..0da2386 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1155,11 +1155,6 @@ static NTSTATUS open_mode_check(connection_struct *conn,
 	return NT_STATUS_OK;
 }
 
-static bool is_delete_request(files_struct *fsp) {
-	return ((fsp->access_mask == DELETE_ACCESS) &&
-		(fsp->oplock_type == NO_OPLOCK));
-}
-
 /*
  * Send a break message to the oplock holder and delay the open for
  * our client.
@@ -1330,8 +1325,6 @@ static bool delay_for_exclusive_oplocks(files_struct *fsp,
 					int oplock_request,
 					struct share_mode_entry *ex_entry)
 {
-	bool delay_it;
-
 	if ((oplock_request & INTERNAL_OPEN_ONLY) || is_stat_open(fsp->access_mask)) {
 		return false;
 	}
@@ -1348,15 +1341,6 @@ static bool delay_for_exclusive_oplocks(files_struct *fsp,
 		return false;
 	}
 
-	/* Found an exclusive or batch oplock */
-
-	delay_it = is_delete_request(fsp) ?
-		BATCH_OPLOCK_TYPE(ex_entry->op_type) : true;
-
-	if (!delay_it) {
-		return false;
-	}
-
 	send_break_message(fsp, ex_entry, mid, oplock_request);
 	return true;
 }
diff --git a/source3/utils/pdbedit.c b/source3/utils/pdbedit.c
index 8a3551b..908f0ba 100644
--- a/source3/utils/pdbedit.c
+++ b/source3/utils/pdbedit.c
@@ -965,8 +965,8 @@ static int delete_machine_entry(const char *machinename)
 	if (!pdb_getsampwnam(samaccount, name)) {
 		fprintf (stderr,
 			 "machine %s does not exist in the passdb\n", name);
-		return -1;
 		TALLOC_FREE(samaccount);
+		return -1;
 	}
 
 	if (!NT_STATUS_IS_OK(pdb_delete_sam_account(samaccount))) {
diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c
index 7eb88a4..bd43ef4 100644
--- a/source4/torture/raw/oplock.c
+++ b/source4/torture/raw/oplock.c
@@ -867,6 +867,82 @@ done:
 	return ret;
 }
 
+static bool test_raw_oplock_exclusive8(struct torture_context *tctx,
+				       struct smbcli_state *cli1,
+				       struct smbcli_state *cli2)
+{
+	const char *fname = BASEDIR "\\test_exclusive8.dat";
+	NTSTATUS status;
+	bool ret = true;
+	union smb_open io;
+	uint16_t fnum1 = 0;
+	uint16_t fnum2 = 0;
+	uint16_t fnum3 = 0;
+
+	if (!torture_setup_dir(cli1, BASEDIR)) {
+		return false;
+	}
+
+	/* cleanup */
+	smbcli_unlink(cli1->tree, fname);
+
+	smbcli_oplock_handler(cli1->transport, oplock_handler_ack_to_given,
+			      cli1->tree);
+
+	/*
+	  base ntcreatex parms
+	*/
+	io.generic.level = RAW_OPEN_NTCREATEX;
+	io.ntcreatex.in.root_fid.fnum = 0;
+	io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+	io.ntcreatex.in.alloc_size = 0;
+	io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+	io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ |
+		NTCREATEX_SHARE_ACCESS_WRITE | NTCREATEX_SHARE_ACCESS_DELETE;
+	io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+	io.ntcreatex.in.create_options = 0;
+	io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+	io.ntcreatex.in.security_flags = 0;
+	io.ntcreatex.in.fname = fname;
+
+	torture_comment(tctx, "open a file with an exclusive oplock (share "
+			"mode: all)\n");
+	ZERO_STRUCT(break_info);
+	io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED |
+		NTCREATEX_FLAGS_REQUEST_OPLOCK;
+	status = smb_raw_open(cli1->tree, tctx, &io);
+	CHECK_STATUS(tctx, status, NT_STATUS_OK);
+	fnum1 = io.ntcreatex.out.file.fnum;
+	CHECK_VAL(io.ntcreatex.out.oplock_level, EXCLUSIVE_OPLOCK_RETURN);
+
+	torture_comment(tctx, "second open with delete should trigger a "
+			"break\n");
+
+	io.ntcreatex.in.access_mask = SEC_STD_DELETE;
+	io.ntcreatex.in.flags = 0;
+	status = smb_raw_open(cli2->tree, tctx, &io);
+	CHECK_STATUS(tctx, status, NT_STATUS_OK);
+	fnum2 = io.ntcreatex.out.file.fnum;
+	CHECK_VAL(break_info.count, get_break_level1_to_none_count(tctx));
+	CHECK_VAL(break_info.failures, 0);
+	CHECK_VAL(break_info.level, OPLOCK_BREAK_TO_LEVEL_II);
+
+	/* Trigger a little panic in "old" samba code.. */
+	status = smb_raw_open(cli2->tree, tctx, &io);
+	CHECK_STATUS(tctx, status, NT_STATUS_OK);
+	fnum3 = io.ntcreatex.out.file.fnum;
+
+	smbcli_close(cli2->tree, fnum3);
+	smbcli_close(cli2->tree, fnum2);
+	smbcli_close(cli1->tree, fnum1);
+
+done:
+	smbcli_deltree(cli1->tree, BASEDIR);
+	smb_raw_exit(cli1->session);
+	smb_raw_exit(cli2->session);
+	return ret;
+}
+
 static bool test_raw_oplock_batch1(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
 {
 	const char *fname = BASEDIR "\\test_batch1.dat";
@@ -3956,6 +4032,8 @@ struct torture_suite *torture_raw_oplock(TALLOC_CTX *mem_ctx)
 	torture_suite_add_2smb_test(suite, "exclusive5", test_raw_oplock_exclusive5);
 	torture_suite_add_2smb_test(suite, "exclusive6", test_raw_oplock_exclusive6);
 	torture_suite_add_2smb_test(suite, "exclusive7", test_raw_oplock_exclusive7);
+	torture_suite_add_2smb_test(suite, "exclusive8",
+				    test_raw_oplock_exclusive8);
 	torture_suite_add_2smb_test(suite, "batch1", test_raw_oplock_batch1);
 	torture_suite_add_2smb_test(suite, "batch2", test_raw_oplock_batch2);
 	torture_suite_add_2smb_test(suite, "batch3", test_raw_oplock_batch3);
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c
index 976a2d0..a6cc88f 100644
--- a/source4/winbind/idmap.c
+++ b/source4/winbind/idmap.c
@@ -387,7 +387,7 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
 	struct ldb_dn *dn;
 	struct ldb_message *hwm_msg, *map_msg, *sam_msg;
 	struct ldb_result *res = NULL;
-	int trans;
+	int trans = -1;
 	uint32_t low, high, hwm, new_xid;
 	char *sid_string, *unixid_string, *hwm_string;
 	bool hwm_entry_exists;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list