svn commit: samba r3108 - in branches/SAMBA_4_0/source/torture/raw: .

tridge at samba.org tridge at samba.org
Thu Oct 21 06:37:15 GMT 2004


Author: tridge
Date: 2004-10-21 06:37:15 +0000 (Thu, 21 Oct 2004)
New Revision: 3108

WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/torture/raw&rev=3108&nolog=1

Log:
try to cope with servers that put FILE_ATTRIBUTE_NONINDEXED on files in the RAW-OPEN test

Modified:
   branches/SAMBA_4_0/source/torture/raw/open.c


Changeset:
Modified: branches/SAMBA_4_0/source/torture/raw/open.c
===================================================================
--- branches/SAMBA_4_0/source/torture/raw/open.c	2004-10-21 06:36:14 UTC (rev 3107)
+++ branches/SAMBA_4_0/source/torture/raw/open.c	2004-10-21 06:37:15 UTC (rev 3108)
@@ -115,9 +115,9 @@
 	finfo.all_info.in.fname = fname; \
 	status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); \
 	CHECK_STATUS(status, NT_STATUS_OK); \
-	if ((v) != finfo.all_info.out.field) { \
+	if ((v) != (finfo.all_info.out.field)) { \
 		printf("(%s) wrong value for field %s  0x%x - 0x%x\n", \
-		       __location__, #field, (int)v, (int)finfo.all_info.out.field); \
+		       __location__, #field, (int)v, (int)(finfo.all_info.out.field)); \
 		dump_all_info(mem_ctx, &finfo); \
 		ret = False; \
 	}} while (0)
@@ -125,7 +125,7 @@
 #define CHECK_VAL(v, correct) do { \
 	if ((v) != (correct)) { \
 		printf("(%s) wrong value for %s  0x%x - 0x%x\n", \
-		       __location__, #v, (int)v, (int)correct); \
+		       __location__, #v, (int)(v), (int)correct); \
 		ret = False; \
 	}} while (0)
 
@@ -242,7 +242,7 @@
 	/* check other reply fields */
 	CHECK_TIME(io.open.out.write_time, write_time);
 	CHECK_ALL_INFO(io.open.out.size, size);
-	CHECK_ALL_INFO(io.open.out.attrib, attrib);
+	CHECK_ALL_INFO(io.open.out.attrib, attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 
 done:
 	smbcli_close(cli->tree, fnum);
@@ -331,7 +331,7 @@
 	CHECK_VAL(io.openx.out.size, 1024*1024);
 	CHECK_ALL_INFO(io.openx.in.size, size);
 	CHECK_TIME(io.openx.out.write_time, write_time);
-	CHECK_ALL_INFO(io.openx.out.attrib, attrib);
+	CHECK_ALL_INFO(io.openx.out.attrib, attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	CHECK_VAL(io.openx.out.access, OPENX_MODE_ACCESS_RDWR);
 	CHECK_VAL(io.openx.out.ftype, 0);
 	CHECK_VAL(io.openx.out.devstate, 0);
@@ -356,7 +356,7 @@
 	CHECK_TIME(io.openx.out.write_time, write_time);
 	CHECK_VAL(io.openx.out.action, OPENX_ACTION_EXISTED);
 	CHECK_VAL(io.openx.out.unknown, 0);
-	CHECK_ALL_INFO(io.openx.out.attrib, attrib);
+	CHECK_ALL_INFO(io.openx.out.attrib, attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	smbcli_close(cli->tree, fnum);
 
 	/* now check the search attrib for hidden files - win2003 ignores this? */
@@ -382,7 +382,8 @@
 	io.openx.in.file_attrs = FILE_ATTRIBUTE_SYSTEM;
 	status = smb_raw_open(cli->tree, mem_ctx, &io);
 	CHECK_STATUS(status, NT_STATUS_OK);
-	CHECK_ALL_INFO(FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE, attrib);
+	CHECK_ALL_INFO(FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE, 
+		       attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	smbcli_close(cli->tree, io.openx.out.fnum);
 	smbcli_unlink(cli->tree, fname);
 
@@ -526,7 +527,7 @@
 
 	CHECK_ALL_INFO(io.t2open.out.size, size);
 	CHECK_VAL(io.t2open.out.write_time, 0);
-	CHECK_ALL_INFO(io.t2open.out.attrib, attrib);
+	CHECK_ALL_INFO(io.t2open.out.attrib, attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	CHECK_VAL(io.t2open.out.access, OPENX_MODE_DENY_NONE | OPENX_MODE_ACCESS_RDWR);
 	CHECK_VAL(io.t2open.out.ftype, 0);
 	CHECK_VAL(io.t2open.out.devstate, 0);
@@ -722,7 +723,8 @@
 	CHECK_NTTIME(io.ntcreatex.out.write_time, write_time);
 	CHECK_NTTIME(io.ntcreatex.out.change_time, change_time);
 	CHECK_ALL_INFO(io.ntcreatex.out.attrib, attrib);
-	CHECK_VAL(io.ntcreatex.out.attrib, FILE_ATTRIBUTE_DIRECTORY);
+	CHECK_VAL(io.ntcreatex.out.attrib & ~FILE_ATTRIBUTE_NONINDEXED, 
+		  FILE_ATTRIBUTE_DIRECTORY);
 	CHECK_ALL_INFO(io.ntcreatex.out.alloc_size, alloc_size);
 	CHECK_ALL_INFO(io.ntcreatex.out.size, size);
 	CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory);
@@ -858,7 +860,8 @@
 	status = smb_raw_open(cli->tree, mem_ctx, &io);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum = io.mknew.out.fnum;
-	CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, attrib);
+	CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, 
+		       attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	
 done:
 	smbcli_close(cli->tree, fnum);
@@ -913,7 +916,8 @@
 	status = smb_raw_open(cli->tree, mem_ctx, &io);
 	CHECK_STATUS(status, NT_STATUS_OK);
 	fnum = io.create.out.fnum;
-	CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, attrib);
+	CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, 
+		       attrib & ~FILE_ATTRIBUTE_NONINDEXED);
 	
 done:
 	smbcli_close(cli->tree, fnum);



More information about the samba-cvs mailing list