[SCM] Samba Shared Repository - branch master updated - 11576353f645d7d7f44a74d27545b946c6175658

Jeremy Allison jra at samba.org
Fri Jan 2 19:39:27 GMT 2009


The branch, master has been updated
       via  11576353f645d7d7f44a74d27545b946c6175658 (commit)
       via  2234173220c51c2e37818149ddf41421672904c0 (commit)
      from  268f3e93a4dd66ce43dc53278eff01f801ba5083 (commit)

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


- Log -----------------------------------------------------------------
commit 11576353f645d7d7f44a74d27545b946c6175658
Merge: 2234173220c51c2e37818149ddf41421672904c0 268f3e93a4dd66ce43dc53278eff01f801ba5083
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 2 11:39:04 2009 -0800

    Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba

commit 2234173220c51c2e37818149ddf41421672904c0
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Jan 2 11:38:24 2009 -0800

    Fix warnings in make test code.
    Jeremy.

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

Summary of changes:
 lib/replace/test/os2_delete.c |    8 ++++++--
 source3/torture/nbio.c        |   19 +++++++++++++++----
 source3/torture/torture.c     |   18 ++++++++++++++----
 source3/torture/utable.c      |    6 +++++-
 source4/torture/util_smb.c    |    5 ++++-
 5 files changed, 44 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/test/os2_delete.c b/lib/replace/test/os2_delete.c
index b45c135..44efeea 100644
--- a/lib/replace/test/os2_delete.c
+++ b/lib/replace/test/os2_delete.c
@@ -30,7 +30,9 @@ static int test_readdir_os2_delete_ret;
 static void cleanup(void)
 {
 	/* I'm a lazy bastard */
-	system("rm -rf " TESTDIR);
+	if (system("rm -rf " TESTDIR)) {
+		FAILED("system");
+	}
 	mkdir(TESTDIR, 0700) == 0 || FAILED("mkdir");
 }
 
@@ -118,7 +120,9 @@ int test_readdir_os2_delete(void)
 
 	rmdir(TESTDIR) == 0 || FAILED("rmdir");
 
-	system("rm -rf " TESTDIR);
+	if (system("rm -rf " TESTDIR) == -1) {
+		FAILED("system");
+	}
 
 	return test_readdir_os2_delete_ret;
 }
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 81d0eb8..a010c80 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -111,7 +111,9 @@ static void sigsegv(int sig)
 	printf("segv at line %d\n", line_count);
 	slprintf(line, sizeof(line), "/usr/X11R6/bin/xterm -e gdb /proc/%d/exe %d", 
 		(int)getpid(), (int)getpid());
-	system(line);
+	if (system(line) == -1) {
+		printf("system() failed\n");
+	}
 	exit(1);
 }
 
@@ -280,10 +282,16 @@ static void delete_fn(const char *mnt, file_info *finfo, const char *name, void
 
 	n = SMB_STRDUP(name);
 	n[strlen(n)-1] = 0;
-	asprintf(&s, "%s%s", n, finfo->name);
+	if (asprintf(&s, "%s%s", n, finfo->name) == -1) {
+		printf("asprintf failed\n");
+		return;
+	}
 	if (finfo->mode & aDIR) {
 		char *s2;
-		asprintf(&s2, "%s\\*", s);
+		if (asprintf(&s2, "%s\\*", s) == -1) {
+			printf("asprintf failed\n");
+			return;
+		}
 		cli_list(c, s2, aDIR, delete_fn, NULL);
 		nb_rmdir(s);
 	} else {
@@ -297,7 +305,10 @@ static void delete_fn(const char *mnt, file_info *finfo, const char *name, void
 void nb_deltree(const char *dname)
 {
 	char *mask;
-	asprintf(&mask, "%s\\*", dname);
+	if (asprintf(&mask, "%s\\*", dname) == -1) {
+		printf("asprintf failed\n");
+		return;
+	}
 
 	total_deleted = 0;
 	cli_list(c, mask, aDIR, delete_fn, NULL);
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 63942da..3261e78 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -1213,7 +1213,9 @@ static bool run_tcon2_test(int dummy)
 
 	printf("starting tcon2 test\n");
 
-	asprintf(&service, "\\\\%s\\%s", host, share);
+	if (asprintf(&service, "\\\\%s\\%s", host, share) == -1) {
+		return false;
+	}
 
 	status = cli_raw_tcon(cli, service, password, "?????", &max_xmit, &cnum);
 
@@ -5280,8 +5282,13 @@ static bool run_local_rbtree(int dummy)
 	for (i=0; i<1000; i++) {
 		char *key, *value;
 
-		asprintf(&key, "key%ld", random());
-		asprintf(&value, "value%ld", random());
+		if (asprintf(&key, "key%ld", random()) == -1) {
+			goto done;
+		}
+		if (asprintf(&value, "value%ld", random()) == -1) {
+			SAFE_FREE(key);
+			goto done;
+		}
 
 		if (!rbt_testval(db, key, value)) {
 			SAFE_FREE(key);
@@ -5290,7 +5297,10 @@ static bool run_local_rbtree(int dummy)
 		}
 
 		SAFE_FREE(value);
-		asprintf(&value, "value%ld", random());
+		if (asprintf(&value, "value%ld", random()) == -1) {
+			SAFE_FREE(key);
+			goto done;
+		}
 
 		if (!rbt_testval(db, key, value)) {
 			SAFE_FREE(key);
diff --git a/source3/torture/utable.c b/source3/torture/utable.c
index 7032cea..e36b038 100644
--- a/source3/torture/utable.c
+++ b/source3/torture/utable.c
@@ -84,7 +84,11 @@ bool torture_utable(int dummy)
 		d_printf("Failed to create valid.dat - %s", strerror(errno));
 		return False;
 	}
-	write(fd, valid, 0x10000);
+	if (write(fd, valid, 0x10000) != 0x10000) {
+		d_printf("Failed to create valid.dat - %s", strerror(errno));
+		close(fd);
+		return false;
+	}
 	close(fd);
 	d_printf("wrote valid.dat\n");
 
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c
index f88a641..732b84a 100644
--- a/source4/torture/util_smb.c
+++ b/source4/torture/util_smb.c
@@ -656,7 +656,10 @@ double torture_create_procs(struct torture_context *tctx,
 			pid_t mypid = getpid();
 			srandom(((int)mypid) ^ ((int)time(NULL)));
 
-			asprintf(&myname, "CLIENT%d", i);
+			if (asprintf(&myname, "CLIENT%d", i) == -1) {
+				printf("asprintf failed\n");
+				return -1;
+			}
 			lp_set_cmdline(tctx->lp_ctx, "netbios name", myname);
 			free(myname);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list