[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Fri Jan 6 10:59:02 MST 2012


The branch, master has been updated
       via  76ca46e s3: Avoid a potential alignment requirement issue
       via  421aab2 s3: Avoid a potential alignment requirement issue
       via  6529e52 s3: Use DELETE_ON_CLOSE instead of unlink
      from  487c9d3 s3: No value change, just use the correct enum value

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


- Log -----------------------------------------------------------------
commit 76ca46ecfe469e11ccc4d20647ebc88ec4b10973
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jan 6 16:42:08 2012 +0100

    s3: Avoid a potential alignment requirement issue
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Fri Jan  6 18:58:11 CET 2012 on sn-devel-104

commit 421aab2e12d3890fe16924ce0a7ad16008a2ec79
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jan 6 16:38:44 2012 +0100

    s3: Avoid a potential alignment requirement issue

commit 6529e520ee777e279f8211e24fc7575326298d0c
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Jan 6 14:28:55 2012 +0100

    s3: Use DELETE_ON_CLOSE instead of unlink

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

Summary of changes:
 source3/param/loadparm.c       |    5 ++---
 source3/torture/test_cleanup.c |   13 ++++++-------
 source3/torture/torture.c      |   11 +++++------
 3 files changed, 13 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 1310353..2ab32f8 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -8504,9 +8504,8 @@ static int process_usershare_file(const char *dir_name, const char *file_name, i
 
 		if (NT_STATUS_IS_OK(status) &&
 		    (data.dptr != NULL) &&
-		    (data.dsize == sizeof(iService)))
-		{
-			iService = *(int *)data.dptr;
+		    (data.dsize == sizeof(iService))) {
+			memcpy(&iService, data.dptr, sizeof(iService));
 		}
 	}
 
diff --git a/source3/torture/test_cleanup.c b/source3/torture/test_cleanup.c
index 2b4989e..39f579a 100644
--- a/source3/torture/test_cleanup.c
+++ b/source3/torture/test_cleanup.c
@@ -52,7 +52,12 @@ bool run_cleanup1(int dummy)
 	if (!torture_open_connection(&cli, 1)) {
 		return false;
 	}
-	status = cli_openx(cli, fname, O_RDWR|O_CREAT, DENY_ALL, &fnum);
+	status = cli_ntcreate(
+		cli, fname, 0,
+		FILE_GENERIC_READ|FILE_GENERIC_WRITE|DELETE_ACCESS,
+		FILE_ATTRIBUTE_NORMAL,
+		FILE_SHARE_READ|FILE_SHARE_WRITE|FILE_SHARE_DELETE,
+		FILE_OPEN, FILE_DELETE_ON_CLOSE, 0, &fnum);
 	if (!NT_STATUS_IS_OK(status)) {
 		printf("2nd open of %s failed (%s)\n", fname,
 		       nt_errstr(status));
@@ -60,12 +65,6 @@ bool run_cleanup1(int dummy)
 	}
 	cli_close(cli, fnum);
 
-	status = cli_unlink(cli, fname, 0);
-	if (!NT_STATUS_IS_OK(status)) {
-		printf("cli_unlink failed: %s\n", nt_errstr(status));
-		goto done;
-	}
-done:
 	torture_close_connection(cli);
 	return NT_STATUS_IS_OK(status);
 }
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 8bc9cef..3b023e7 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -8515,7 +8515,7 @@ fail:
 static bool dbtrans_inc(struct db_context *db)
 {
 	struct db_record *rec;
-	uint32_t *val;
+	uint32_t val;
 	bool ret = false;
 	NTSTATUS status;
 	TDB_DATA value;
@@ -8534,12 +8534,11 @@ static bool dbtrans_inc(struct db_context *db)
 		goto fail;
 	}
 
-	val = (uint32_t *)value.dptr;
-	*val += 1;
+	memcpy(&val, value.dptr, sizeof(val));
+	val += 1;
 
-	status = dbwrap_record_store(rec, make_tdb_data((uint8_t *)val,
-					       sizeof(uint32_t)),
-			    0);
+	status = dbwrap_record_store(
+		rec, make_tdb_data((uint8_t *)&val, sizeof(val)), 0);
 	if (!NT_STATUS_IS_OK(status)) {
 		printf(__location__ "store failed: %s\n",
 		       nt_errstr(status));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list