[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha3-1712-g2bba77a

Andrew Tridgell tridge at samba.org
Thu May 22 13:29:15 GMT 2008


The branch, v4-0-test has been updated
       via  2bba77a768c3ed984af05b99c2f7781577d08ec3 (commit)
       via  1590494daf5abe43e43402e7602f92267bcda34b (commit)
       via  f9708184a2037f83ebb97c847414326a42436154 (commit)
       via  9d523debb7ee59bdadf9865e023be370b7ab7b39 (commit)
       via  af31030e0b78b6b220740529901ec8d2d9f5a3fe (commit)
       via  198ed9336756f973cebd7cc3df7f51e2c4575205 (commit)
       via  dd21e3d9d788a67d4673625ed4892a875f4600dc (commit)
       via  d7f3348c891e14de0e1b195714468ff998400f60 (commit)
       via  c38658c6c05fd65d729693904d35886431582537 (commit)
       via  607bf6a946ffd7f768bda44c461ee82fcfc101c1 (commit)
       via  3883a7286fd32cd6c77269f67d1366c3b946b5a0 (commit)
       via  b139b471072f20288f126b5a9ee7613cc6c40681 (commit)
       via  a7be5ba22e0cf2c61501f5a05e64673f31ba145c (commit)
       via  8f7cfa5d2e190ddb74ba859a3f68ec0ed33ae089 (commit)
       via  1c5dd2d1b655218f875a4e512ed3e94fee624fe4 (commit)
       via  de7626e1c29f04e54afb6d95f4051bc52b17dd80 (commit)
      from  84b5652d3e5766521436e4c7d59615b08b2bb198 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit 2bba77a768c3ed984af05b99c2f7781577d08ec3
Merge: 1590494daf5abe43e43402e7602f92267bcda34b 84b5652d3e5766521436e4c7d59615b08b2bb198
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 23:28:44 2008 +1000

    Merge commit 'origin/v4-0-test' into v4-0-test

commit 1590494daf5abe43e43402e7602f92267bcda34b
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 23:07:16 2008 +1000

    SMB2 read returns NT_STATUS_END_OF_FILE on read past end of file

commit f9708184a2037f83ebb97c847414326a42436154
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 23:00:08 2008 +1000

    fixes for EAs and filename in gentest_smb2 results
    
    - SMB2 returns 0 for a null EA
    - return the share qualified name for the filename in SMB2 ALL_INFO
      level

commit 9d523debb7ee59bdadf9865e023be370b7ab7b39
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 22:46:43 2008 +1000

    added a --noeas option to gentest_smb2

commit af31030e0b78b6b220740529901ec8d2d9f5a3fe
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 22:46:29 2008 +1000

    pass in the required alignment to the EA construction routines

commit 198ed9336756f973cebd7cc3df7f51e2c4575205
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 17:54:06 2008 +1000

    added a define for all valid file attributes

commit dd21e3d9d788a67d4673625ed4892a875f4600dc
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 17:53:50 2008 +1000

    check for invalid file attribute values in create

commit d7f3348c891e14de0e1b195714468ff998400f60
Merge: c38658c6c05fd65d729693904d35886431582537 761e667e45475d3a7d5a41558b400ba4c94c4650
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 16:09:10 2008 +1000

    Merge commit 'origin/v4-0-test' into v4-0-test

commit c38658c6c05fd65d729693904d35886431582537
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 15:44:13 2008 +1000

    added testing of SMB2 setfileinfo in gentest_smb2

commit 607bf6a946ffd7f768bda44c461ee82fcfc101c1
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 15:35:52 2008 +1000

    added EAs in the generated SMB2 create operation

commit 3883a7286fd32cd6c77269f67d1366c3b946b5a0
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 14:51:32 2008 +1000

    added --maskindexing and qfileinfo testing
    
     - added --maskindexing to mask the 0x2000 noindex bit in file
       attributes
     - added testing of qfileinfo in gentest_smb2

commit b139b471072f20288f126b5a9ee7613cc6c40681
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 14:50:36 2008 +1000

    minor cleanup in SMB2 getinfo test

commit a7be5ba22e0cf2c61501f5a05e64673f31ba145c
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 14:49:21 2008 +1000

    fixed parsing of the SMB2 ALL_INFO qfileinfo level

commit 8f7cfa5d2e190ddb74ba859a3f68ec0ed33ae089
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 13:43:04 2008 +1000

    added SMB2 gentest generation of SMB2 echo packets

commit 1c5dd2d1b655218f875a4e512ed3e94fee624fe4
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 13:14:55 2008 +1000

    badly formed SMB2 packets get NT_STATUS_INVALID_PARAMETER

commit de7626e1c29f04e54afb6d95f4051bc52b17dd80
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu May 22 13:14:36 2008 +1000

    fixes to the SMB2 lock test after recent SMB2 locking changes

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

Summary of changes:
 source/libcli/raw/interfaces.h       |    3 +-
 source/libcli/raw/raweas.c           |    9 +-
 source/libcli/raw/rawfile.c          |    4 +-
 source/libcli/raw/rawfileinfo.c      |    3 +-
 source/libcli/raw/smb.h              |    1 +
 source/libcli/smb2/create.c          |    4 +-
 source/ntvfs/ntvfs_generic.c         |    5 +
 source/ntvfs/posix/pvfs_open.c       |    4 +
 source/ntvfs/posix/pvfs_qfileinfo.c  |   13 ++-
 source/smb_server/blob.c             |    7 +-
 source/smb_server/smb2/smb2_server.h |    4 +-
 source/torture/gentest_smb2.c        |  260 +++++++++++++---------------------
 source/torture/smb2/getinfo.c        |   12 +-
 source/torture/smb2/lock.c           |   20 ++-
 14 files changed, 155 insertions(+), 194 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libcli/raw/interfaces.h b/source/libcli/raw/interfaces.h
index 3370021..bae0e67 100644
--- a/source/libcli/raw/interfaces.h
+++ b/source/libcli/raw/interfaces.h
@@ -684,7 +684,8 @@ union smb_fileinfo {
 			uint32_t ea_size;
 			uint32_t access_mask;
 			uint64_t position;
-			uint64_t mode;
+			uint32_t mode;
+			uint32_t alignment_requirement;
 			struct smb_wire_string fname;
 		} out;
 	} all_info2;
diff --git a/source/libcli/raw/raweas.c b/source/libcli/raw/raweas.c
index 8ea8e62..07b517a 100644
--- a/source/libcli/raw/raweas.c
+++ b/source/libcli/raw/raweas.c
@@ -54,13 +54,13 @@ static uint_t ea_name_list_size(uint_t num_names, struct ea_name *eas)
   This assumes the names are strict ascii, which should be a
   reasonable assumption
 */
-size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas)
+size_t ea_list_size_chained(uint_t num_eas, struct ea_struct *eas, unsigned alignment)
 {
 	uint_t total = 0;
 	int i;
 	for (i=0;i<num_eas;i++) {
 		uint_t len = 8 + strlen(eas[i].name.s)+1 + eas[i].value.length;
-		len = (len + 3) & ~3;
+		len = (len + (alignment-1)) & ~(alignment-1);
 		total += len;
 	}
 	return total;
@@ -96,14 +96,15 @@ void ea_put_list(uint8_t *data, uint_t num_eas, struct ea_struct *eas)
   put a chained ea_list into a pre-allocated buffer - buffer must be
   at least of size ea_list_size()
 */
-void ea_put_list_chained(uint8_t *data, uint_t num_eas, struct ea_struct *eas)
+void ea_put_list_chained(uint8_t *data, uint_t num_eas, struct ea_struct *eas,
+			 unsigned alignment)
 {
 	int i;
 
 	for (i=0;i<num_eas;i++) {
 		uint_t nlen = strlen(eas[i].name.s);
 		uint32_t len = 8+nlen+1+eas[i].value.length;
-		uint_t pad = ((len + 3) & ~3) - len;
+		uint_t pad = ((len + (alignment-1)) & ~(alignment-1)) - len;
 		if (i == num_eas-1) {
 			SIVAL(data, 0, 0);
 		} else {
diff --git a/source/libcli/raw/rawfile.c b/source/libcli/raw/rawfile.c
index 3c5c1b7..d39c615 100644
--- a/source/libcli/raw/rawfile.c
+++ b/source/libcli/raw/rawfile.c
@@ -314,14 +314,14 @@ static struct smbcli_request *smb_raw_nttrans_create_send(struct smbcli_tree *tr
 
 	if (parms->ntcreatex.in.ea_list) {
 		uint32_t ea_size = ea_list_size_chained(parms->ntcreatex.in.ea_list->num_eas,
-							parms->ntcreatex.in.ea_list->eas);
+							parms->ntcreatex.in.ea_list->eas, 4);
 		ea_blob = data_blob_talloc(mem_ctx, NULL, ea_size);
 		if (ea_blob.data == NULL) {
 			return NULL;
 		}
 		ea_put_list_chained(ea_blob.data, 
 				    parms->ntcreatex.in.ea_list->num_eas,
-				    parms->ntcreatex.in.ea_list->eas);
+				    parms->ntcreatex.in.ea_list->eas, 4);
 	}
 
 	nt.in.params = data_blob_talloc(mem_ctx, NULL, 53);
diff --git a/source/libcli/raw/rawfileinfo.c b/source/libcli/raw/rawfileinfo.c
index 71900be..0ea5a93 100644
--- a/source/libcli/raw/rawfileinfo.c
+++ b/source/libcli/raw/rawfileinfo.c
@@ -243,7 +243,8 @@ NTSTATUS smb_raw_fileinfo_passthru_parse(const DATA_BLOB *blob, TALLOC_CTX *mem_
 		parms->all_info2.out.ea_size        = IVAL(blob->data, 0x48);
 		parms->all_info2.out.access_mask    = IVAL(blob->data, 0x4C);
 		parms->all_info2.out.position       = BVAL(blob->data, 0x50);
-		parms->all_info2.out.mode           = BVAL(blob->data, 0x58);
+		parms->all_info2.out.mode           = IVAL(blob->data, 0x58);
+		parms->all_info2.out.alignment_requirement = IVAL(blob->data, 0x5C);
 		smbcli_blob_pull_string(NULL, mem_ctx, blob,
 					&parms->all_info2.out.fname, 0x60, 0x64, STR_UNICODE);
 		return NT_STATUS_OK;
diff --git a/source/libcli/raw/smb.h b/source/libcli/raw/smb.h
index e054ed6..74869e8 100644
--- a/source/libcli/raw/smb.h
+++ b/source/libcli/raw/smb.h
@@ -370,6 +370,7 @@
 #define FILE_ATTRIBUTE_OFFLINE		0x1000
 #define FILE_ATTRIBUTE_NONINDEXED	0x2000
 #define FILE_ATTRIBUTE_ENCRYPTED	0x4000
+#define FILE_ATTRIBUTE_ALL_MASK 	0x7FFF
 
 /* Flags - combined with attributes. */
 #define FILE_FLAG_WRITE_THROUGH    0x80000000L
diff --git a/source/libcli/smb2/create.c b/source/libcli/smb2/create.c
index 6ac32a4..9d28bbf 100644
--- a/source/libcli/smb2/create.c
+++ b/source/libcli/smb2/create.c
@@ -117,8 +117,8 @@ struct smb2_request *smb2_create_send(struct smb2_tree *tree, struct smb2_create
 
 	if (io->in.eas.num_eas != 0) {
 		DATA_BLOB b = data_blob_talloc(req, NULL, 
-					       ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas));
-		ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas);
+					       ea_list_size_chained(io->in.eas.num_eas, io->in.eas.eas, 8));
+		ea_put_list_chained(b.data, io->in.eas.num_eas, io->in.eas.eas, 8);
 		status = smb2_create_blob_add(req, &io->in.blobs,
 					      SMB2_CREATE_TAG_EXTA, b);
 		if (!NT_STATUS_IS_OK(status)) {
diff --git a/source/ntvfs/ntvfs_generic.c b/source/ntvfs/ntvfs_generic.c
index a706e62..62a1427 100644
--- a/source/ntvfs/ntvfs_generic.c
+++ b/source/ntvfs/ntvfs_generic.c
@@ -1276,6 +1276,11 @@ static NTSTATUS ntvfs_map_read_finish(struct ntvfs_module_context *ntvfs,
 		rd->smb2.out.data.length= rd2->generic.out.nread;
 		rd->smb2.out.remaining	= 0;
 		rd->smb2.out.reserved	= 0;
+		if (NT_STATUS_IS_OK(status) &&
+		    rd->smb2.out.data.length == 0 &&
+		    rd->smb2.in.length != 0) {
+			status = NT_STATUS_END_OF_FILE;
+		}
 		break;
 	default:
 		return NT_STATUS_INVALID_LEVEL;
diff --git a/source/ntvfs/posix/pvfs_open.c b/source/ntvfs/posix/pvfs_open.c
index 6793732..cc4f0ad 100644
--- a/source/ntvfs/posix/pvfs_open.c
+++ b/source/ntvfs/posix/pvfs_open.c
@@ -548,6 +548,10 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
 	uint32_t oplock_level = OPLOCK_NONE, oplock_granted;
 	bool allow_level_II_oplock = false;
 
+	if (io->ntcreatex.in.file_attr & ~FILE_ATTRIBUTE_ALL_MASK) {
+		return NT_STATUS_INVALID_PARAMETER;
+	}
+	    
 	if ((io->ntcreatex.in.file_attr & FILE_ATTRIBUTE_READONLY) &&
 	    (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE)) {
 		return NT_STATUS_CANNOT_DELETE;
diff --git a/source/ntvfs/posix/pvfs_qfileinfo.c b/source/ntvfs/posix/pvfs_qfileinfo.c
index 6bc21e5..102660a 100644
--- a/source/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source/ntvfs/posix/pvfs_qfileinfo.c
@@ -298,10 +298,21 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
 			(name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)? 1 : 0;
 		info->all_info2.out.file_id        = name->dos.file_id;
 		info->all_info2.out.ea_size        = name->dos.ea_size;
+		if (info->all_info2.out.ea_size == 4) {
+			/* SMB2 uses zero for a empty EA set */
+			info->all_info2.out.ea_size = 0;
+		}
 		info->all_info2.out.access_mask    = 0; /* only set by qfileinfo */
 		info->all_info2.out.position       = 0; /* only set by qfileinfo */
 		info->all_info2.out.mode           = 0; /* only set by qfileinfo */
-		info->all_info2.out.fname.s        = name->original_name;
+		/* windows wants the full path on disk for this
+		   result, but I really don't want to expose that on
+		   the wire, so I'll give the path with a share
+		   prefix, which is a good approximation */
+		info->all_info2.out.fname.s = talloc_asprintf(req, "\\%s\\%s",
+							      pvfs->share_name, 
+							      name->original_name);
+		NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s);
 		return NT_STATUS_OK;
 	}
 
diff --git a/source/smb_server/blob.c b/source/smb_server/blob.c
index 8834c44..cea4c60 100644
--- a/source/smb_server/blob.c
+++ b/source/smb_server/blob.c
@@ -476,12 +476,12 @@ NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
 		}
 
 		list_size = ea_list_size_chained(st->all_eas.out.num_eas,
-						 st->all_eas.out.eas);
+						 st->all_eas.out.eas, 8);
 		BLOB_CHECK(smbsrv_blob_grow_data(mem_ctx, blob, list_size));
 
 		ea_put_list_chained(blob->data,
 				    st->all_eas.out.num_eas,
-				    st->all_eas.out.eas);
+				    st->all_eas.out.eas, 8);
 		return NT_STATUS_OK;
 
 	case RAW_FILEINFO_SMB2_ALL_INFORMATION:
@@ -503,7 +503,8 @@ NTSTATUS smbsrv_push_passthru_fileinfo(TALLOC_CTX *mem_ctx,
 		SIVAL(blob->data,       0x48, st->all_info2.out.ea_size);
 		SIVAL(blob->data,	0x4C, st->all_info2.out.access_mask);
 		SBVAL(blob->data,	0x50, st->all_info2.out.position);
-		SBVAL(blob->data,	0x58, st->all_info2.out.mode);
+		SIVAL(blob->data,	0x58, st->all_info2.out.mode);
+		SIVAL(blob->data,	0x5C, st->all_info2.out.alignment_requirement);
 		BLOB_CHECK(smbsrv_blob_append_string(mem_ctx, blob,
 						     st->all_info2.out.fname.s,
 						     0x60, default_str_flags,
diff --git a/source/smb_server/smb2/smb2_server.h b/source/smb_server/smb2/smb2_server.h
index fc40a92..ae4abbd 100644
--- a/source/smb_server/smb2/smb2_server.h
+++ b/source/smb_server/smb2/smb2_server.h
@@ -78,13 +78,13 @@ struct smbsrv_request;
 	if (is_size < (size)) { \
 		DEBUG(0,("%s: buffer too small 0x%x. Expected 0x%x\n", \
 			 __location__, (unsigned)is_size, (unsigned)want_size)); \
-		smb2srv_send_error(req,  NT_STATUS_FOOBAR); \
+		smb2srv_send_error(req,  NT_STATUS_INVALID_PARAMETER); \
 		return; \
 	}\
 	if (field_size != want_size) { \
 		DEBUG(0,("%s: unexpected fixed body size 0x%x. Expected 0x%x\n", \
 			 __location__, (unsigned)field_size, (unsigned)want_size)); \
-		smb2srv_send_error(req,  NT_STATUS_FOOBAR); \
+		smb2srv_send_error(req,  NT_STATUS_INVALID_PARAMETER); \
 		return; \
 	} \
 } while (0)
diff --git a/source/torture/gentest_smb2.c b/source/torture/gentest_smb2.c
index fc6dbcb..6546ba6 100644
--- a/source/torture/gentest_smb2.c
+++ b/source/torture/gentest_smb2.c
@@ -53,6 +53,8 @@ static struct gentest_options {
 	const char *seeds_file;
 	int use_preset_seeds;
 	int fast_reconnect;
+	int mask_indexing;
+	int no_eas;
 } options;
 
 /* mapping between open handles on the server and local handles */
@@ -543,15 +545,6 @@ static uint16_t gen_lock_flags(void)
 }
 
 /*
-  generate a pid 
-*/
-static uint16_t gen_pid(void)
-{
-	if (gen_chance(10)) return gen_bits_mask(0xFFFF);
-	return getpid();
-}
-
-/*
   generate a lock count
 */
 static off_t gen_lock_count(void)
@@ -599,34 +592,6 @@ static uint32_t gen_open_disp(void)
 }
 
 /*
-  generate an openx open mode
-*/
-static uint16_t gen_openx_mode(void)
-{
-	if (gen_chance(20)) return gen_bits_mask(0xFFFF);
-	if (gen_chance(20)) return gen_bits_mask(0xFF);
-	return OPENX_MODE_DENY_NONE | gen_bits_mask(0x3);
-}
-
-/*
-  generate an openx flags field
-*/
-static uint16_t gen_openx_flags(void)
-{
-	if (gen_chance(20)) return gen_bits_mask(0xFFFF);
-	return gen_bits_mask(0x7);
-}
-
-/*
-  generate an openx open function
-*/
-static uint16_t gen_openx_func(void)
-{
-	if (gen_chance(20)) return gen_bits_mask(0xFFFF);
-	return gen_bits_mask(0x13);
-}
-
-/*
   generate a file attrib combination
 */
 static uint32_t gen_attrib(void)
@@ -721,6 +686,25 @@ static struct ea_struct gen_ea_struct(void)
 }
 
 /*
+  generate an ea_struct
+*/
+static struct smb_ea_list gen_ea_list(void)
+{
+	struct smb_ea_list eas;
+	int i;
+	if (options.no_eas) {
+		ZERO_STRUCT(eas);
+		return eas;
+	}
+	eas.num_eas = gen_int_range(0, 3);
+	eas.eas = talloc_array(current_op.mem_ctx, struct ea_struct, eas.num_eas);
+	for (i=0;i<eas.num_eas;i++) {
+		eas.eas[i] = gen_ea_struct();
+	}
+	return eas;
+}
+
+/*
   the idle function tries to cope with getting an oplock break on a connection, and
   an operation on another connection blocking until that break is acked
   we check for operations on all transports in the idle function
@@ -953,6 +937,16 @@ again:
 
 #define CHECK_EQUAL(field) do { \
 	if (parm[0].field != parm[1].field && !ignore_pattern(#field)) { \
+		printf("Mismatch in %s - 0x%llx 0x%llx\n", #field, \
+		       (unsigned long long)parm[0].field, (unsigned long long)parm[1].field); \
+		return false; \
+	} \
+} while(0)
+
+#define CHECK_ATTRIB(field) do { \
+		if (!options.mask_indexing) { \
+		CHECK_EQUAL(field); \
+	} else if ((~FILE_ATTRIBUTE_NONINDEXED & parm[0].field) != (~FILE_ATTRIBUTE_NONINDEXED & parm[1].field) && !ignore_pattern(#field)) { \
 		printf("Mismatch in %s - 0x%x 0x%x\n", #field, \
 		       (int)parm[0].field, (int)parm[1].field); \
 		return false; \
@@ -1026,6 +1020,7 @@ static bool handler_create(int instance)
 	parm[0].in.create_disposition         = gen_open_disp();
 	parm[0].in.create_options             = gen_create_options();
 	parm[0].in.fname                      = gen_fname_open(instance);
+	parm[0].in.eas			      = gen_ea_list();
 
 	if (!options.use_oplocks) {
 		/* mask out oplocks */
@@ -1044,7 +1039,7 @@ static bool handler_create(int instance)
 	CHECK_NTTIMES_EQUAL(out.change_time);
 	CHECK_EQUAL(out.alloc_size);
 	CHECK_EQUAL(out.size);
-	CHECK_EQUAL(out.file_attr);
+	CHECK_ATTRIB(out.file_attr);
 	CHECK_EQUAL(out.reserved2);
 
 	/* ntcreatex creates a new file handle */
@@ -1077,7 +1072,7 @@ static bool handler_close(int instance)
 	CHECK_NTTIMES_EQUAL(out.change_time);
 	CHECK_EQUAL(out.alloc_size);
 	CHECK_EQUAL(out.size);
-	CHECK_EQUAL(out.file_attr);
+	CHECK_ATTRIB(out.file_attr);
 
 	REMOVE_HANDLE(in.file.handle);
 
@@ -1194,7 +1189,19 @@ static bool handler_flush(int instance)
 	return true;
 }
 
-#if 0
+/*
+  generate echo operations
+*/
+static bool handler_echo(int instance)
+{
+	NTSTATUS status[NSERVERS];
+
+	GEN_CALL(smb2_keepalive(tree->session->transport));
+
+	return true;
+}
+
+
 
 /*
   generate a fileinfo query structure
@@ -1207,16 +1214,13 @@ static void gen_fileinfo(int instance, union smb_fileinfo *info)
 		enum smb_fileinfo_level level;
 		const char *name;
 	}  levels[] = {
-		LVL(GETATTR), LVL(GETATTRE), LVL(STANDARD),
-		LVL(EA_SIZE), LVL(ALL_EAS), LVL(IS_NAME_VALID),
-		LVL(BASIC_INFO), LVL(STANDARD_INFO), LVL(EA_INFO),
-		LVL(NAME_INFO), LVL(ALL_INFO), LVL(ALT_NAME_INFO),
-		LVL(STREAM_INFO), LVL(COMPRESSION_INFO), LVL(BASIC_INFORMATION),
+		LVL(BASIC_INFORMATION),
 		LVL(STANDARD_INFORMATION), LVL(INTERNAL_INFORMATION), LVL(EA_INFORMATION),
 		LVL(ACCESS_INFORMATION), LVL(NAME_INFORMATION), LVL(POSITION_INFORMATION),
-		LVL(MODE_INFORMATION), LVL(ALIGNMENT_INFORMATION), LVL(ALL_INFORMATION),
+		LVL(MODE_INFORMATION), LVL(ALIGNMENT_INFORMATION), LVL(SMB2_ALL_INFORMATION),
 		LVL(ALT_NAME_INFORMATION), LVL(STREAM_INFORMATION), LVL(COMPRESSION_INFORMATION),
-		LVL(NETWORK_OPEN_INFORMATION), LVL(ATTRIBUTE_TAG_INFORMATION)
+		LVL(NETWORK_OPEN_INFORMATION), LVL(ATTRIBUTE_TAG_INFORMATION),
+		LVL(SMB2_ALL_EAS), LVL(SMB2_ALL_INFORMATION),
 	};
 	do {
 		i = gen_int_range(0, ARRAY_SIZE(levels)-1);
@@ -1238,62 +1242,14 @@ static bool cmp_fileinfo(int instance,
 	case RAW_FILEINFO_GENERIC:
 		return false;
 
-	case RAW_FILEINFO_GETATTR:
-		CHECK_EQUAL(getattr.out.attrib);
-		CHECK_EQUAL(getattr.out.size);
-		CHECK_TIMES_EQUAL(getattr.out.write_time);
-		break;
-
-	case RAW_FILEINFO_GETATTRE:
-		CHECK_TIMES_EQUAL(getattre.out.create_time);
-		CHECK_TIMES_EQUAL(getattre.out.access_time);
-		CHECK_TIMES_EQUAL(getattre.out.write_time);
-		CHECK_EQUAL(getattre.out.size);
-		CHECK_EQUAL(getattre.out.alloc_size);
-		CHECK_EQUAL(getattre.out.attrib);
-		break;
-
-	case RAW_FILEINFO_STANDARD:
-		CHECK_TIMES_EQUAL(standard.out.create_time);
-		CHECK_TIMES_EQUAL(standard.out.access_time);
-		CHECK_TIMES_EQUAL(standard.out.write_time);
-		CHECK_EQUAL(standard.out.size);
-		CHECK_EQUAL(standard.out.alloc_size);
-		CHECK_EQUAL(standard.out.attrib);
-		break;
-
-	case RAW_FILEINFO_EA_SIZE:
-		CHECK_TIMES_EQUAL(ea_size.out.create_time);
-		CHECK_TIMES_EQUAL(ea_size.out.access_time);
-		CHECK_TIMES_EQUAL(ea_size.out.write_time);
-		CHECK_EQUAL(ea_size.out.size);
-		CHECK_EQUAL(ea_size.out.alloc_size);
-		CHECK_EQUAL(ea_size.out.attrib);
-		CHECK_EQUAL(ea_size.out.ea_size);
-		break;
-
-	case RAW_FILEINFO_ALL_EAS:
-		CHECK_EQUAL(all_eas.out.num_eas);
-		for (i=0;i<parm[0].all_eas.out.num_eas;i++) {
-			CHECK_EQUAL(all_eas.out.eas[i].flags);
-			CHECK_WSTR_EQUAL(all_eas.out.eas[i].name);
-			CHECK_BLOB_EQUAL(all_eas.out.eas[i].value);
-		}
-		break;
-
-	case RAW_FILEINFO_IS_NAME_VALID:
-		break;
-		
-	case RAW_FILEINFO_BASIC_INFO:
 	case RAW_FILEINFO_BASIC_INFORMATION:
 		CHECK_NTTIMES_EQUAL(basic_info.out.create_time);
 		CHECK_NTTIMES_EQUAL(basic_info.out.access_time);
 		CHECK_NTTIMES_EQUAL(basic_info.out.write_time);
 		CHECK_NTTIMES_EQUAL(basic_info.out.change_time);
-		CHECK_EQUAL(basic_info.out.attrib);
+		CHECK_ATTRIB(basic_info.out.attrib);
 		break;
 
-	case RAW_FILEINFO_STANDARD_INFO:
 	case RAW_FILEINFO_STANDARD_INFORMATION:
 		CHECK_EQUAL(standard_info.out.alloc_size);
 		CHECK_EQUAL(standard_info.out.size);
@@ -1302,38 +1258,18 @@ static bool cmp_fileinfo(int instance,
 		CHECK_EQUAL(standard_info.out.directory);
 		break;
 
-	case RAW_FILEINFO_EA_INFO:
 	case RAW_FILEINFO_EA_INFORMATION:
 		CHECK_EQUAL(ea_info.out.ea_size);
 		break;
 
-	case RAW_FILEINFO_NAME_INFO:
 	case RAW_FILEINFO_NAME_INFORMATION:
 		CHECK_WSTR_EQUAL(name_info.out.fname);
 		break;
 
-	case RAW_FILEINFO_ALL_INFO:
-	case RAW_FILEINFO_ALL_INFORMATION:
-		CHECK_NTTIMES_EQUAL(all_info.out.create_time);
-		CHECK_NTTIMES_EQUAL(all_info.out.access_time);
-		CHECK_NTTIMES_EQUAL(all_info.out.write_time);
-		CHECK_NTTIMES_EQUAL(all_info.out.change_time);
-		CHECK_EQUAL(all_info.out.attrib);
-		CHECK_EQUAL(all_info.out.alloc_size);
-		CHECK_EQUAL(all_info.out.size);
-		CHECK_EQUAL(all_info.out.nlink);
-		CHECK_EQUAL(all_info.out.delete_pending);
-		CHECK_EQUAL(all_info.out.directory);
-		CHECK_EQUAL(all_info.out.ea_size);
-		CHECK_WSTR_EQUAL(all_info.out.fname);
-		break;
-
-	case RAW_FILEINFO_ALT_NAME_INFO:
 	case RAW_FILEINFO_ALT_NAME_INFORMATION:
 		CHECK_WSTR_EQUAL(alt_name_info.out.fname);
 		break;
 
-	case RAW_FILEINFO_STREAM_INFO:
 	case RAW_FILEINFO_STREAM_INFORMATION:
 		CHECK_EQUAL(stream_info.out.num_streams);
 		for (i=0;i<parm[0].stream_info.out.num_streams;i++) {
@@ -1343,7 +1279,6 @@ static bool cmp_fileinfo(int instance,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list