[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed May 18 03:59:02 MDT 2011


The branch, master has been updated
       via  192198a s3-modules: Fix the build of gpfs.c on RHEL 6.0 with gpfs 3.4.0-4
       via  5608995 s3-docs: change eventlog path from lockdir to statedir
       via  23e23d0 s3-torture/nbio.c: Fix cli_errstr() usage (part of bug #7864)
       via  26f7c07 s3-client/clitar.c: Fix cli_errstr() usage (part of bug #7864)
       via  25f1583 s3-net_rpc_printer.c: Fix cli_errstr() usage (part of bug #7864)
       via  6552ed6 s3-libsmb/passchange.c: Fix cli_errstr() usage (part of bug #7864)
       via  310502a s3-torture/mangle_test.c: Fix cli_errstr() usage (part of bug #7864)
       via  6fd0e06 s3-torture: torture.c: Fix cli_errstr() usage (part of bug #7864)
      from  902b1d9 s4:ntvfs/cifs: return NT_STATUS_INTERNAL_ERROR if no credentials are available

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


- Log -----------------------------------------------------------------
commit 192198ad70474e56d4708b65482eee976ea78a05
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon May 16 14:25:01 2011 +0200

    s3-modules: Fix the build of gpfs.c on RHEL 6.0 with gpfs 3.4.0-4
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Wed May 18 11:58:14 CEST 2011 on sn-devel-104

commit 5608995bd2182c12310ef4b4dd39583b6fe77b1e
Author: Björn Baumbach <bb at sernet.de>
Date:   Thu Feb 3 11:06:57 2011 +0100

    s3-docs: change eventlog path from lockdir to statedir
    
    See elog_tdbname() in source3/lib/eventlog/eventlog.c.
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 23e23d083602d59ec500b4abfc331a451f6e5dbb
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Feb 7 11:27:02 2011 +0100

    s3-torture/nbio.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 26f7c0771bfba85c0d203996aee1d3ada04e56b6
Author: Björn Baumbach <bb at sernet.de>
Date:   Mon Feb 7 11:27:02 2011 +0100

    s3-client/clitar.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 25f1583b9f6eb2a4569b448830bb5ef4d5a06818
Author: Björn Baumbach <bb at sernet.de>
Date:   Tue Feb 1 16:58:48 2011 +0100

    s3-net_rpc_printer.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 6552ed64c1dbae25c3b413b6d7a8f61e8b7033c7
Author: Björn Baumbach <bb at sernet.de>
Date:   Fri Feb 4 14:25:52 2011 +0100

    s3-libsmb/passchange.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 310502a15ac03e642d0015e050e8407351f6dcd9
Author: Björn Baumbach <bb at sernet.de>
Date:   Tue Feb 1 11:27:55 2011 +0100

    s3-torture/mangle_test.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 6fd0e062d3606264967756246964669de2eb2454
Author: Björn Baumbach <bb at sernet.de>
Date:   Thu Jan 20 14:21:40 2011 +0100

    s3-torture: torture.c: Fix cli_errstr() usage (part of bug #7864)
    
    Convert cli_errstr() to nt_errstr()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

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

Summary of changes:
 docs-xml/smbdotconf/protocol/eventloglist.xml |    2 +-
 source3/client/clitar.c                       |   23 +-
 source3/libsmb/passchange.c                   |   17 +-
 source3/modules/gpfs.c                        |    1 +
 source3/torture/mangle_test.c                 |   33 +-
 source3/torture/nbio.c                        |   23 +-
 source3/torture/torture.c                     | 1314 +++++++++++++++----------
 source3/utils/net_rpc_printer.c               |  116 ++--
 8 files changed, 922 insertions(+), 607 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/protocol/eventloglist.xml b/docs-xml/smbdotconf/protocol/eventloglist.xml
index e98559b..101821a 100644
--- a/docs-xml/smbdotconf/protocol/eventloglist.xml
+++ b/docs-xml/smbdotconf/protocol/eventloglist.xml
@@ -6,7 +6,7 @@
     <para>This option defines a list of log names that Samba will 
     report to the Microsoft EventViewer utility.  The listed 
     eventlogs will be associated with tdb file on disk in the 
-    <filename>$(lockdir)/eventlog</filename>.
+    <filename>$(statedir)/eventlog</filename>.
     </para>
 
     <para>
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 2a78a18..4dc202e 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -509,6 +509,7 @@ static bool ensurepath(const char *fname)
 	const char *p=fname;
 	char *basehack;
 	char *saveptr;
+	NTSTATUS status;
 
 	DEBUG(5, ( "Ensurepath called with: %s\n", fname));
 
@@ -542,11 +543,13 @@ static bool ensurepath(const char *fname)
 	while (p) {
 		strlcat(partpath, p, fnamelen);
 
-		if (!NT_STATUS_IS_OK(cli_chkpath(cli, partpath))) {
-			if (!NT_STATUS_IS_OK(cli_mkdir(cli, partpath))) {
+		status = cli_chkpath(cli, partpath);
+		if (!NT_STATUS_IS_OK(status)) {
+			status = cli_mkdir(cli, partpath);
+			if (!NT_STATUS_IS_OK(status)) {
 				SAFE_FREE(partpath);
 				SAFE_FREE(ffname);
-				DEBUG(0, ("Error mkdir %s\n", cli_errstr(cli)));
+				DEBUG(0, ("Error mkdir %s\n", nt_errstr(status)));
 				return False;
 			} else {
 				DEBUG(3, ("mkdirhiering %s\n", partpath));
@@ -581,6 +584,7 @@ static int padit(char *buf, uint64_t bufsize, uint64_t padsize)
 static void do_setrattr(char *name, uint16 attr, int set)
 {
 	uint16 oldattr;
+	NTSTATUS status;
 
 	if (!NT_STATUS_IS_OK(cli_getatr(cli, name, &oldattr, NULL, NULL))) {
 		return;
@@ -592,8 +596,9 @@ static void do_setrattr(char *name, uint16 attr, int set)
 		attr = oldattr & ~attr;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_setatr(cli, name, attr, 0))) {
-		DEBUG(1,("setatr failed: %s\n", cli_errstr(cli)));
+	status = cli_setatr(cli, name, attr, 0);
+	if (!NT_STATUS_IS_OK(status)) {
+		DEBUG(1, ("setatr failed: %s\n", nt_errstr(status)));
 	}
 }
 
@@ -656,7 +661,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname,
 	status = cli_open(cli, rname, O_RDONLY, DENY_NONE, &fnum);
 	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0,("%s opening remote file %s (%s)\n",
-				cli_errstr(cli),rname, client_get_cur_dir()));
+				nt_errstr(status),rname, client_get_cur_dir()));
 		goto cleanup;
 	}
 
@@ -1082,10 +1087,10 @@ static int get_file(file_info2 finfo)
 	}
 
 	/* Now close the file ... */
-
-	if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
+	status = cli_close(cli, fnum);
+	if (!NT_STATUS_IS_OK(status)) {
 		DEBUG(0, ("Error %s closing remote file\n",
-			cli_errstr(cli)));
+			nt_errstr(status)));
 		return(False);
 	}
 
diff --git a/source3/libsmb/passchange.c b/source3/libsmb/passchange.c
index fc68e41..37496bd 100644
--- a/source3/libsmb/passchange.c
+++ b/source3/libsmb/passchange.c
@@ -85,12 +85,12 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 	make_nmb_name(&called , remote_machine, 0x20);
 
 	if (!cli_session_request(cli, &calling, &called)) {
+		result = cli_nt_error(cli);
 		if (asprintf(err_str, "machine %s rejected the session setup. "
 			 "Error was : %s.\n",
-			 remote_machine, cli_errstr(cli)) == -1) {
+			 remote_machine, nt_errstr(result)) == -1) {
 			*err_str = NULL;
 		}
-		result = cli_nt_error(cli);
 		cli_shutdown(cli);
 		return result;
 	}
@@ -126,7 +126,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 		if (!NT_STATUS_EQUAL(result, NT_STATUS_PASSWORD_MUST_CHANGE) &&
 		    !NT_STATUS_EQUAL(result, NT_STATUS_PASSWORD_EXPIRED)) {
 			if (asprintf(err_str, "Could not connect to machine %s: "
-				 "%s\n", remote_machine, cli_errstr(cli)) == -1) {
+				 "%s\n", remote_machine, nt_errstr(result)) == -1) {
 				*err_str = NULL;
 			}
 			cli_shutdown(cli);
@@ -146,7 +146,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 		if (!NT_STATUS_IS_OK(result)) {
 			if (asprintf(err_str, "machine %s rejected the session "
 				 "setup. Error was : %s.\n",        
-				 remote_machine, cli_errstr(cli)) == -1) {
+				 remote_machine, nt_errstr(result)) == -1) {
 				*err_str = NULL;
 			}
 			cli_shutdown(cli);
@@ -204,12 +204,12 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 		if (lp_client_lanman_auth()) {
 			/* Use the old RAP method. */
 			if (!cli_oem_change_password(cli, user_name, new_passwd, old_passwd)) {
+				result = cli_nt_error(cli);
 				if (asprintf(err_str, "machine %s rejected the "
 					 "password change: Error was : %s.\n",
-					 remote_machine, cli_errstr(cli)) == -1) {
+					 remote_machine, nt_errstr(result)) == -1) {
 					*err_str = NULL;
 				}
-				result = cli_nt_error(cli);
 				cli_shutdown(cli);
 				return result;
 			}
@@ -295,12 +295,13 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 				cli_shutdown(cli);
 				return NT_STATUS_OK;
 			}
+
+			result = cli_nt_error(cli);
 			if (asprintf(err_str, "machine %s rejected the password "
 				 "change: Error was : %s.\n",
-				 remote_machine, cli_errstr(cli)) == -1) {
+				 remote_machine, nt_errstr(result)) == -1) {
 				*err_str = NULL;
 			}
-			result = cli_nt_error(cli);
 			cli_shutdown(cli);
 			return result;
 		} else {
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index d690199..d2832ba 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -18,6 +18,7 @@
  */
 
 #include "includes.h"
+#include "system/filesys.h"
 #include "smbd/smbd.h"
 
 #ifdef HAVE_GPFS
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c
index a7719d0..b9e3f6a 100644
--- a/source3/torture/mangle_test.c
+++ b/source3/torture/mangle_test.c
@@ -42,44 +42,51 @@ static bool test_one(struct cli_state *cli, const char *name)
 
 	total++;
 
-	if (!NT_STATUS_IS_OK(cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) {
-		printf("open of %s failed (%s)\n", name, cli_errstr(cli));
+	status = cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("open of %s failed (%s)\n", name, nt_errstr(status));
 		return False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
-		printf("close of %s failed (%s)\n", name, cli_errstr(cli));
+	status = cli_close(cli, fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close of %s failed (%s)\n", name, nt_errstr(status));
 		return False;
 	}
 
 	/* get the short name */
 	status = cli_qpathinfo_alt_name(cli, name, shortname);
 	if (!NT_STATUS_IS_OK(status)) {
-		printf("query altname of %s failed (%s)\n", name, cli_errstr(cli));
+		printf("query altname of %s failed (%s)\n", name, nt_errstr(status));
 		return False;
 	}
 
 	fstr_sprintf(name2, "\\mangle_test\\%s", shortname);
-	if (!NT_STATUS_IS_OK(cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
+	status = cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("unlink of %s  (%s) failed (%s)\n", 
-		       name2, name, cli_errstr(cli));
+		       name2, name, nt_errstr(status));
 		return False;
 	}
 
 	/* recreate by short name */
-	if (!NT_STATUS_IS_OK(cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) {
-		printf("open2 of %s failed (%s)\n", name2, cli_errstr(cli));
+	status = cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("open2 of %s failed (%s)\n", name2, nt_errstr(status));
 		return False;
 	}
-	if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
-		printf("close of %s failed (%s)\n", name, cli_errstr(cli));
+
+	status = cli_close(cli, fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close of %s failed (%s)\n", name, nt_errstr(status));
 		return False;
 	}
 
 	/* and unlink by long name */
-	if (!NT_STATUS_IS_OK(cli_unlink(cli, name, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
+	status = cli_unlink(cli, name, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("unlink2 of %s  (%s) failed (%s)\n", 
-		       name, name2, cli_errstr(cli));
+		       name, name2, nt_errstr(status));
 		failures++;
 		cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
 		return True;
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index 7634f52..0da6bc0 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -135,10 +135,13 @@ void nb_setup(struct cli_state *cli)
 
 void nb_unlink(const char *fname)
 {
-	if (!NT_STATUS_IS_OK(cli_unlink(c, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
+	NTSTATUS status;
+
+	status = cli_unlink(c, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	if (!NT_STATUS_IS_OK(status)) {
 #if NBDEBUG
 		printf("(%d) unlink %s failed (%s)\n", 
-		       line_count, fname, cli_errstr(c));
+		       line_count, fname, nt_errstr(status));
 #endif
 	}
 }
@@ -166,7 +169,7 @@ void nb_createx(const char *fname,
 				create_options, 0, &fd);
 	if (!NT_STATUS_IS_OK(status) && handle != -1) {
 		printf("ERROR: cli_ntcreate failed for %s - %s\n",
-		       fname, cli_errstr(c));
+		       fname, nt_errstr(status));
 		exit(1);
 	}
 	if (NT_STATUS_IS_OK(status) && handle == -1) {
@@ -233,18 +236,24 @@ void nb_close(int handle)
 
 void nb_rmdir(const char *fname)
 {
-	if (!NT_STATUS_IS_OK(cli_rmdir(c, fname))) {
+	NTSTATUS status;
+
+	status = cli_rmdir(c, fname);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("ERROR: rmdir %s failed (%s)\n", 
-		       fname, cli_errstr(c));
+		       fname, nt_errstr(status));
 		exit(1);
 	}
 }
 
 void nb_rename(const char *oldname, const char *newname)
 {
-	if (!NT_STATUS_IS_OK(cli_rename(c, oldname, newname))) {
+	NTSTATUS status;
+
+	status = cli_rename(c, oldname, newname);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("ERROR: rename %s %s failed (%s)\n", 
-		       oldname, newname, cli_errstr(c));
+		       oldname, newname, nt_errstr(status));
 		exit(1);
 	}
 }
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index e413a39..a05fbbf 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -576,7 +576,8 @@ static bool rw_torture(struct cli_state *c)
 		status = cli_open(c, lockfname, O_RDWR, DENY_NONE, &fnum2);
 	}
 	if (!NT_STATUS_IS_OK(status)) {
-		printf("open of %s failed (%s)\n", lockfname, cli_errstr(c));
+		printf("open of %s failed (%s)\n",
+		       lockfname, nt_errstr(status));
 		return False;
 	}
 
@@ -592,8 +593,10 @@ static bool rw_torture(struct cli_state *c)
 			return False;
 		}
 
-		if (!NT_STATUS_IS_OK(cli_open(c, fname, O_RDWR | O_CREAT | O_TRUNC, DENY_ALL, &fnum))) {
-			printf("open failed (%s)\n", cli_errstr(c));
+		status = cli_open(c, fname, O_RDWR | O_CREAT | O_TRUNC,
+                                  DENY_ALL, &fnum);
+		if (!NT_STATUS_IS_OK(status)) {
+			printf("open failed (%s)\n", nt_errstr(status));
 			correct = False;
 			break;
 		}
@@ -628,18 +631,21 @@ static bool rw_torture(struct cli_state *c)
 			correct = False;
 		}
 
-		if (!NT_STATUS_IS_OK(cli_close(c, fnum))) {
-			printf("close failed (%s)\n", cli_errstr(c));
+		status = cli_close(c, fnum);
+		if (!NT_STATUS_IS_OK(status)) {
+			printf("close failed (%s)\n", nt_errstr(status));
 			correct = False;
 		}
 
-		if (!NT_STATUS_IS_OK(cli_unlink(c, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
-			printf("unlink failed (%s)\n", cli_errstr(c));
+		status = cli_unlink(c, fname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+		if (!NT_STATUS_IS_OK(status)) {
+			printf("unlink failed (%s)\n", nt_errstr(status));
 			correct = False;
 		}
 
-		if (!NT_STATUS_IS_OK(cli_unlock(c, fnum2, n*sizeof(int), sizeof(int)))) {
-			printf("unlock failed (%s)\n", cli_errstr(c));
+		status = cli_unlock(c, fnum2, n*sizeof(int), sizeof(int));
+		if (!NT_STATUS_IS_OK(status)) {
+			printf("unlock failed (%s)\n", nt_errstr(status));
 			correct = False;
 		}
 	}
@@ -694,10 +700,11 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
 			printf("unlink failed (%s) (normal, this file should not exist)\n", cli_errstr(c));
 		}
 
-		if (!NT_STATUS_IS_OK(cli_open(c, lockfname, O_RDWR | O_CREAT | O_EXCL, 
-				 DENY_NONE, &fnum))) {
+		status = cli_open(c, lockfname, O_RDWR | O_CREAT | O_EXCL,
+		                  DENY_NONE, &fnum);
+		if (!NT_STATUS_IS_OK(status)) {
 			printf("first open read/write of %s failed (%s)\n",
-					lockfname, cli_errstr(c));
+					lockfname, nt_errstr(status));
 			return False;
 		}
 	}
@@ -714,7 +721,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
 		}
 		if (!NT_STATUS_IS_OK(status)) {
 			printf("second open read-only of %s failed (%s)\n",
-					lockfname, cli_errstr(c));
+					lockfname, nt_errstr(status));
 			return False;
 		}
 	}
@@ -771,8 +778,9 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
 
 	}
 
-	if (!NT_STATUS_IS_OK(cli_close(c, fnum))) {
-		printf("close failed (%s)\n", cli_errstr(c));
+	status = cli_close(c, fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
 
@@ -789,26 +797,30 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
 	char buf_rd[131072];
 	bool correct = True;
 	ssize_t bytes_read;
+	NTSTATUS status;
 
-	if (!NT_STATUS_IS_OK(cli_unlink(c1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
-		printf("unlink failed (%s) (normal, this file should not exist)\n", cli_errstr(c1));
+	status = cli_unlink(c1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("unlink failed (%s) (normal, this file should not exist)\n", nt_errstr(status));
 	}
 
-	if (!NT_STATUS_IS_OK(cli_open(c1, lockfname, O_RDWR | O_CREAT | O_EXCL, 
-			 DENY_NONE, &fnum1))) {
+	status = cli_open(c1, lockfname, O_RDWR | O_CREAT | O_EXCL,
+	                  DENY_NONE, &fnum1);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("first open read/write of %s failed (%s)\n",
-				lockfname, cli_errstr(c1));
+				lockfname, nt_errstr(status));
 		return False;
 	}
-	if (!NT_STATUS_IS_OK(cli_open(c2, lockfname, O_RDONLY, 
-			 DENY_NONE, &fnum2))) {
+
+	status = cli_open(c2, lockfname, O_RDONLY, DENY_NONE, &fnum2);
+	if (!NT_STATUS_IS_OK(status)) {
 		printf("second open read-only of %s failed (%s)\n",
-				lockfname, cli_errstr(c2));
+				lockfname, nt_errstr(status));
 		cli_close(c1, fnum1);
 		return False;
 	}
 
-	for (i=0;i<torture_numops;i++)
+	for (i = 0; i < torture_numops; i++)
 	{
 		NTSTATUS status;
 		size_t buf_size = ((unsigned)sys_random()%(sizeof(buf)-1))+ 1;
@@ -842,17 +854,21 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
 		}
 	}
 
-	if (!NT_STATUS_IS_OK(cli_close(c2, fnum2))) {
-		printf("close failed (%s)\n", cli_errstr(c2));
+	status = cli_close(c2, fnum2);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
-	if (!NT_STATUS_IS_OK(cli_close(c1, fnum1))) {
-		printf("close failed (%s)\n", cli_errstr(c1));
+
+	status = cli_close(c1, fnum1);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_unlink(c1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
-		printf("unlink failed (%s)\n", cli_errstr(c1));
+	status = cli_unlink(c1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("unlink failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
 
@@ -918,6 +934,7 @@ static bool run_readwritelarge_internal(int max_xmit_k)
 	SMB_OFF_T fsize;
 	char buf[126*1024];
 	bool correct = True;
+	NTSTATUS status;
 
 	if (!torture_open_connection(&cli1, 0)) {
 		return False;
@@ -939,17 +956,19 @@ static bool run_readwritelarge_internal(int max_xmit_k)
 
 	cli_unlink(cli1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);
 
-	if (!NT_STATUS_IS_OK(cli_open(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL, DENY_NONE, &fnum1))) {
-		printf("open read/write of %s failed (%s)\n", lockfname, cli_errstr(cli1));
+	status = cli_open(cli1, lockfname, O_RDWR | O_CREAT | O_EXCL,
+	                  DENY_NONE, &fnum1);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("open read/write of %s failed (%s)\n", lockfname, nt_errstr(status));
 		return False;
 	}
 
 	cli_writeall(cli1, fnum1, 0, (uint8_t *)buf, 0, sizeof(buf), NULL);
 
-	if (!NT_STATUS_IS_OK(cli_qfileinfo_basic(
-				     cli1, fnum1, NULL, &fsize, NULL, NULL,
-				     NULL, NULL, NULL))) {
-		printf("qfileinfo failed (%s)\n", cli_errstr(cli1));
+	status = cli_qfileinfo_basic(cli1, fnum1, NULL, &fsize, NULL, NULL,
+				     NULL, NULL, NULL);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("qfileinfo failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
 
@@ -962,18 +981,22 @@ static bool run_readwritelarge_internal(int max_xmit_k)
 		correct = False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
-		printf("close failed (%s)\n", cli_errstr(cli1));
+	status = cli_close(cli1, fnum1);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("close failed (%s)\n", nt_errstr(status));
 		correct = False;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_unlink(cli1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) {
-		printf("unlink failed (%s)\n", cli_errstr(cli1));
+	status = cli_unlink(cli1, lockfname, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list