svn commit: samba r15865 - in branches/SAMBA_4_0/source/torture/basic: .

metze at samba.org metze at samba.org
Wed May 24 14:45:07 GMT 2006


Author: metze
Date: 2006-05-24 14:45:07 +0000 (Wed, 24 May 2006)
New Revision: 15865

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=15865

Log:
using dirname for a variable isn't that good,
but making it a global symbol is really bad...

fix linking on sun1 in the build-farm

metze
Modified:
   branches/SAMBA_4_0/source/torture/basic/base.c
   branches/SAMBA_4_0/source/torture/basic/delete.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/basic/base.c
===================================================================
--- branches/SAMBA_4_0/source/torture/basic/base.c	2006-05-24 14:38:11 UTC (rev 15864)
+++ branches/SAMBA_4_0/source/torture/basic/base.c	2006-05-24 14:45:07 UTC (rev 15865)
@@ -1619,7 +1619,7 @@
 	BOOL result = False;
 	int fnum;
 	const char *os2_fname = ".+,;=[].";
-	const char *dirname = "samba3_errordir";
+	const char *dname = "samba3_errordir";
 	union smb_open io;
 	TALLOC_CTX *mem_ctx = talloc_init(NULL);
 	NTSTATUS status;
@@ -1656,10 +1656,10 @@
 	}
 
 	smbcli_unlink(cli_nt->tree, os2_fname);
-	smbcli_rmdir(cli_nt->tree, dirname);
+	smbcli_rmdir(cli_nt->tree, dname);
 
-	if (!NT_STATUS_IS_OK(smbcli_mkdir(cli_nt->tree, dirname))) {
-		printf("smbcli_mkdir(%s) failed: %s\n", dirname,
+	if (!NT_STATUS_IS_OK(smbcli_mkdir(cli_nt->tree, dname))) {
+		printf("smbcli_mkdir(%s) failed: %s\n", dname,
 		       smbcli_errstr(cli_nt->tree));
 		goto fail;
 	}
@@ -1675,7 +1675,7 @@
 	io.ntcreatex.in.create_options = 0;
 	io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
 	io.ntcreatex.in.security_flags = 0;
-	io.ntcreatex.in.fname = dirname;
+	io.ntcreatex.in.fname = dname;
 
 	status = smb_raw_open(cli_nt->tree, mem_ctx, &io);
 	if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
@@ -1692,14 +1692,14 @@
 		goto fail;
 	}
 
-	status = smbcli_mkdir(cli_nt->tree, dirname);
+	status = smbcli_mkdir(cli_nt->tree, dname);
 	if (!NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_COLLISION)) {
 		printf("(%s) incorrect status %s should be %s\n",
 		       __location__, nt_errstr(status),
 		       nt_errstr(NT_STATUS_OBJECT_NAME_COLLISION));
 		goto fail;
 	}
-	status = smbcli_mkdir(cli_dos->tree, dirname);
+	status = smbcli_mkdir(cli_dos->tree, dname);
 	if (!NT_STATUS_EQUAL(status, NT_STATUS_DOS(ERRDOS, ERRnoaccess))) {
 		printf("(%s) incorrect status %s should be %s\n",
 		       __location__, nt_errstr(status),

Modified: branches/SAMBA_4_0/source/torture/basic/delete.c
===================================================================
--- branches/SAMBA_4_0/source/torture/basic/delete.c	2006-05-24 14:38:11 UTC (rev 15864)
+++ branches/SAMBA_4_0/source/torture/basic/delete.c	2006-05-24 14:45:07 UTC (rev 15865)
@@ -145,13 +145,13 @@
 		goto fail; \
 	}} while (0)
 
-const char *fname = "\\delete.file";
-const char *fname_new = "\\delete.new";
-const char *dirname = "\\delete.dir";
+static const char *fname = "\\delete.file";
+static const char *fname_new = "\\delete.new";
+static const char *dname = "\\delete.dir";
 
 static void del_clean_area(struct smbcli_state *cli1, struct smbcli_state *cli2)
 {
-	smbcli_deltree(cli1->tree, dirname);
+	smbcli_deltree(cli1->tree, dname);
 	smbcli_setatr(cli1->tree, fname, 0, 0);
 	smbcli_unlink(cli1->tree, fname);
 	smbcli_setatr(cli1->tree, fname_new, 0, 0);
@@ -886,7 +886,7 @@
 
 	/* Test 14 -- directory */
 
-	dnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0,
+	dnum1 = smbcli_nt_create_full(cli1->tree, dname, 0,
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -897,24 +897,24 @@
 				      NTCREATEX_DISP_CREATE, 0, 0);
 	if (dnum1 == -1) {
 		printf("(%s) open of %s failed: %s!\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
 
-	correct &= check_delete_on_close(cli1, dnum1, dirname, False, __location__);
+	correct &= check_delete_on_close(cli1, dnum1, dname, False, __location__);
 	if (NT_STATUS_IS_ERR(smbcli_nt_delete_on_close(cli1->tree, dnum1, True))) {
 		printf("(%s) setting delete_on_close on file failed !\n",
 		       __location__);
 		correct = False;
 		goto fail;
 	}
-	correct &= check_delete_on_close(cli1, dnum1, dirname, True, __location__);
+	correct &= check_delete_on_close(cli1, dnum1, dname, True, __location__);
 	smbcli_close(cli1->tree, dnum1);
 
 	/* Now it should be gone... */
 
-	dnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0,
+	dnum1 = smbcli_nt_create_full(cli1->tree, dname, 0,
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -1277,10 +1277,10 @@
 	smbcli_close(cli1->tree, fnum1);
 	smbcli_close(cli1->tree, fnum2);
 
-	smbcli_deltree(cli1->tree, dirname);
+	smbcli_deltree(cli1->tree, dname);
 
 	/* Firstly create with all access, but delete on close. */
-	fnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum1 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -1293,16 +1293,16 @@
 	
 	if (fnum1 == -1) {
 		printf("(%s) open - 1 of %s failed (%s)\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
 
 	/* The delete on close bit is *not* reported as being set. */
-	correct &= check_delete_on_close(cli1, fnum1, dirname, False, __location__);
+	correct &= check_delete_on_close(cli1, fnum1, dname, False, __location__);
 
 	/* Now try opening again for read-only. */
-	fnum2 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum2 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_RIGHTS_FILE_READ,
 				      FILE_ATTRIBUTE_DIRECTORY,
 				      NTCREATEX_SHARE_ACCESS_READ|
@@ -1315,22 +1315,22 @@
 	/* Should work. */
 	if (fnum2 == -1) {
 		printf("(%s) open - 1 of %s failed (%s)\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
 
-	correct &= check_delete_on_close(cli1, fnum1, dirname, False, __location__);
-	correct &= check_delete_on_close(cli1, fnum2, dirname, False, __location__);
+	correct &= check_delete_on_close(cli1, fnum1, dname, False, __location__);
+	correct &= check_delete_on_close(cli1, fnum2, dname, False, __location__);
 
 	smbcli_close(cli1->tree, fnum1);
 
-	correct &= check_delete_on_close(cli1, fnum2, dirname, True, __location__);
+	correct &= check_delete_on_close(cli1, fnum2, dname, True, __location__);
 
 	smbcli_close(cli1->tree, fnum2);
 
 	/* And the directory should be deleted ! */
-	fnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum1 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_RIGHTS_FILE_READ,
 				      FILE_ATTRIBUTE_DIRECTORY,
 				      NTCREATEX_SHARE_ACCESS_READ|
@@ -1340,7 +1340,7 @@
 				      NTCREATEX_OPTIONS_DIRECTORY, 0);
 	if (fnum1 != -1) {
 		printf("(%s) open of %s succeeded (should fail)\n", 
-		       __location__, dirname);
+		       __location__, dname);
 		correct = False;
 		goto fail;
 	}
@@ -1363,10 +1363,10 @@
 
 	/* Test 19. */
 
-	smbcli_deltree(cli1->tree, dirname);
+	smbcli_deltree(cli1->tree, dname);
 
 	/* Firstly open and create with all access */
-	fnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum1 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -1379,7 +1379,7 @@
 	
 	if (fnum1 == -1) {
 		printf("(%s) open - 1 of %s failed (%s)\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
@@ -1388,7 +1388,7 @@
 	smbcli_close(cli1->tree, fnum1);
 	
 	/* Next open with all access, but add delete on close. */
-	fnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum1 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -1407,10 +1407,10 @@
 	}
 
 	/* The delete on close bit is *not* reported as being set. */
-	correct &= check_delete_on_close(cli1, fnum1, dirname, False, __location__);
+	correct &= check_delete_on_close(cli1, fnum1, dname, False, __location__);
 
 	/* Now try opening again for read-only. */
-	fnum2 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum2 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_RIGHTS_FILE_READ,
 				      FILE_ATTRIBUTE_DIRECTORY,
 				      NTCREATEX_SHARE_ACCESS_READ|
@@ -1422,19 +1422,19 @@
 	/* Should work. */
 	if (fnum2 == -1) {
 		printf("(%s) open - 1 of %s failed (%s)\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
 
 	smbcli_close(cli1->tree, fnum1);
 
-	correct &= check_delete_on_close(cli1, fnum2, dirname, True, __location__);
+	correct &= check_delete_on_close(cli1, fnum2, dname, True, __location__);
 
 	smbcli_close(cli1->tree, fnum2);
 
 	/* See if the file is deleted - for a directory this seems to be true ! */
-	fnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0, 
+	fnum1 = smbcli_nt_create_full(cli1->tree, dname, 0, 
 				      SEC_RIGHTS_FILE_READ,
 				      FILE_ATTRIBUTE_DIRECTORY,
 				      NTCREATEX_SHARE_ACCESS_READ|
@@ -1447,7 +1447,7 @@
 
 	if (fnum1 != -1) {
 		printf("(%s) open of %s succeeded (should fail)\n", 
-		       __location__, dirname);
+		       __location__, dname);
 		correct = False;
 		goto fail;
 	}
@@ -1471,9 +1471,9 @@
 
 	/* Test 20 -- non-empty directory hardest to get right... */
 
-	smbcli_deltree(cli1->tree, dirname);
+	smbcli_deltree(cli1->tree, dname);
 
-	dnum1 = smbcli_nt_create_full(cli1->tree, dirname, 0,
+	dnum1 = smbcli_nt_create_full(cli1->tree, dname, 0,
 				      SEC_FILE_READ_DATA|
 				      SEC_FILE_WRITE_DATA|
 				      SEC_STD_DELETE,
@@ -1485,17 +1485,17 @@
 				      NTCREATEX_OPTIONS_DIRECTORY, 0);
 	if (dnum1 == -1) {
 		printf("(%s) open of %s failed: %s!\n", 
-		       __location__, dirname, smbcli_errstr(cli1->tree));
+		       __location__, dname, smbcli_errstr(cli1->tree));
 		correct = False;
 		goto fail;
 	}
 
-	correct &= check_delete_on_close(cli1, dnum1, dirname, False, __location__);
+	correct &= check_delete_on_close(cli1, dnum1, dname, False, __location__);
 	status = smbcli_nt_delete_on_close(cli1->tree, dnum1, True);
 
 	{
 		char *fullname;
-		asprintf(&fullname, "\\%s%s", dirname, fname);
+		asprintf(&fullname, "\\%s%s", dname, fname);
 		fnum1 = smbcli_open(cli1->tree, fullname, O_CREAT|O_RDWR,
 				    DENY_NONE);
 		if (fnum1 != -1) {
@@ -1526,7 +1526,7 @@
 		
 	{
 		char *fullname;
-		asprintf(&fullname, "\\%s%s", dirname, fname);
+		asprintf(&fullname, "\\%s%s", dname, fname);
 		fnum1 = smbcli_open(cli1->tree, fullname, O_CREAT|O_RDWR,
 				    DENY_NONE);
 		if (fnum1 == -1) {



More information about the samba-cvs mailing list