/* RAWsmbtests */ RAW-QFSINFO Tests Example: smbtorture -Uuser%pass /// RAW-QFSINFO Summary: Queries server for file system information (TRANS2_QUERY_FS_INFORMATION). This test first queries the server with each information level (level of interest), and then checks the responses received from the server. Query levels: DSKATTR Expects: Total size (16 bit unsigned) Blocks/unit (16 bit unsigned) Block size (16 bit unsigned) Units free (16 bit unsigned) ALLOCATION Info level SMB_INFO_ALLOCATION (0x0001) Expects: filesystem ID (32bit unsigned) Sectors/unit (32 bit unsigned) Total size (32 bit unsigned) Units free (32 bit unsigned) Bytes/sector (16 bit unsigned) VOLUME Info level: 0x0002 Expects: Volume serial number (32 bit unsigned) Volume name length (32 bit unsigned) Volume name Label (string) Notes: This is called "SMB_INFO_VOLUME" in the CIFS spec. Volumes with no label simply return 0 for label length, and no other data. VOLUME_INFO Info level: 0x0102 Expects: Creation Time (64 bit unsigned) Volume serial number (32 bit unsigned) Volume Name (String) Notes: This is called "SMB_QUERY_FS_VOLUME_INFO" in the CIFS spec. SIZE_INFO Info level: 0x0103 Expects: Total volume size (64 bit unsigned) Available units (free units) (64 bit unsigned) Sectors/unit (32 bit unsigned) Bytes/sector (32 bit unsigned) Notes: This is called "SMB_QUERY_FS_SIZE_INFO" in the CIFS spec. DEVICE_INFO Info level: 0x0104 Expects: Device Type (32 bit unsigned) Characteristics (32 bit unsigned) Notes: This is called "SMB_QUERY_FS_DEVICE_INFO" in the CIFS spec. Possible “Device type” and “Characteristics” valuses are documented in the CIFS spec. ATTRIBUTE_INFO Info level: 0x0105 Expects: Filesystem attributes (32 bit unsigned) These values are documented in the CIFS spec. Maximum file component length (32 bit unsigned) Maximum filename length. Filesystem type length (32 bit unsigned) Length of the following string. Filesystem type (string) Example: "NTFS" Notes: This query is labeled as "SMB_QUERY_FS_ATTRIBUTE_INFO" in the CIFS spec. UNIX_INFO Info level: 0x0200 Expects: Major version (16 bit unsigned) Major version number of CIFS supported. Minor version (16 bit unsigned) Minor version number of CIFS supported. Capability (64 bit unsigned) These values are documented in the CIFS spec. Notes: This is called "SMB_QUERY_CIFS_UNIX_INFO" in the CIFS spec. Windows generally returns an error, unknown info level (0x007c) VOLUME_INFORMATION Info level: 0x03e9 Expects: Volume creation time (64 bit unsigned) Volume serial number (32 bit unsigned) Volume label length (32 bit unsigned) Volume label (string) Misc. Notes: Ethereal calls this "FS label info" SIZE_INFORMATION Info level: 0x03eb Expects: Total volume size (64 bit unsigned) Available units (free units) (64 bit unsigned) Sectors/unit (32 bit unsigned) Bytes/sector (32 bit unsigned) DEVICE_INFORMATION Info level: 0x03ec Expects: Device type (32 bit unsigned) Characteristics (32 bit unsigned) ATTRIBUTE_INFORMATION Info level: 0x03ed Expects: Filesystem attributes (32 bit unsigned) These values are documented in the CIFS spec. Maximum file component length (32 bit unsigned) Maximum filename length. Filesystem type length (32 bit unsigned) Length of the following string. Filesystem type (string) Example: "NTFS" QUOTA_INFORMATION Info level: 0x03ee Expects: Unknown Data Quota soft limit (64 bit unsigned) Quota hard limit (64 bit unsigned) Quota flags (64 bit unsigned) FULL_SIZE_INFORMATION Info level: 0x03ef Expects: Total volume size (64 bit unsigned) Caller available units (64 bit unsigned) Actual available units (64 bit unsigned) Sectors/unit (32 bit unsigned) Bytes/sector (32 bit unsigned) OBJECTID_INFORMATION Info level: 0x03f0 Expects: File system GUID (string) Notes: This test appears to be disabled in the latest torture tests, because w2k3 does not appear to support it. W2k3-sp1, however, does seem to support this call. Tests Performed: Check for broken levels and compare this to the information in the "capabilities" section in the flags2 field to see if the server claims to support it. Tests/Expectations: Server should respond with NT_STATUS_OK for all tests that it supports. Check consistency of the data retrieved via the SIZE_INFO (0x0103) and SIZE_INFORMATION (0x03eb) levels. Tests/Expectations: "Total allocation units" should be equal. "Available allocation units" should be equal or approximately equal. "Sectors/unit" should be equal. "Bytes/sector" should be equal. Check consistency of the data retrieved via the DEVICE_INFO (0x0104) and DEVICE_INFORMATION (0x03ec) levels. Tests/Expectations: "Device type" should be equal. "Device characteristics" should be equal. Check consistency of the data retrieved via the VOLUME_INFO (0x0102) and VOLUME_INFORMATION (0x03e9) levels. Tests/Expectations: "Create time" should be equal. "Serial number" should be equal. "Volume name" should be equal. Notes: If the volume has no label the tests fail and no other tests are performed. Check consistency of the data retrieved via the ATTRIBUTE_INFO (0x0105) and ATTRIBUTE_INFORMATION (0x03ed) levels. Tests/Expectations: "FS attributes" should be equal. "Maximum file component length" should be equal. "FS type" should be equal. Check consistent disk size data retrieved via the DSKATTR and the ALLOCATION (0x0001) levels. Tests/Expectations: DSKATTR (total size * blocks per unit * block size) / (blocks_per_unit * block_size) ALLOCATION (sectors per unit * total size * bytes per sector) / (blocks_per_unit * block_size) Check consistent free space data retrieved via the DSKATTR and the ALLOCATION (0x0001) levels. SMBTorture Output: "check for consistent free disk space" Tests/Expectations: DSKATTR (units free * blocks per unit * block size) / (blocks_per_unit * block_size) ALLOCATION (sectors per unit * units free * bytes per sector) / (blocks_per_unit * block_size) Check consistency of the data retrieve via the VOLUME (0x0002) and the VOLUME_INFO (0x0102) levels. SMBTorture Output: "volume info consistency" Tests/Expectations: "Serial number" should be equal. "Volume name" should be the equal. Check consistency of the data retrieved via the SIZE_INFO (0x0103) and FULL_SIZE_INFORMATION (0x03ef) levels. SMBTorture Output: "check for non-zero unknown fields" Tests/Expectations: "Total allocation units" should be equal. "Available allocation units" should be approximately equal. "Sectors/unit" information should be equal. "Bytes/sector" information should be equal. Check QUOTA_INFORMATION and OBJECTID_INFORMATION values. Tests/Expectations: They should be zero. Check for correct termination of strings. SMBTorture Output: "check for correct termination". Tests/Expectations: VOLUME, Volume Name (unterminated) VOLUME_INFO, Volume Name (Unicode) VOLUME_INFORMATION, Volume Name (Unicode) ATTRIBUTE_INFO, Filesystem type (Unicode) ATTRIBUTE_INFORMATION, Filesystem type (Unicode) RAW-QFILEINFO,torture_raw_qfileinfo (QUERY_FILE_INFO) Example: smbtorture -Uuser%pass /// RAW-QFILEINFO Summary: Queries server for file information. Test creates file called 'torture_qfileinfo.txt' at the root of the share, queries the server for information about the file, and then removes the file. Each query is performed twice; once by file ID, and once by the file name. Query levels: GETATTR Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) File data size (32 bit unsigned) File allocation size (32 bit unsigned) File attributes (16 bit unsigned) GETATTRE File attributes (16 bit unsigned) File data size (32 bit unsigned) Last write time (Date/Time stamp) STANDARD (Info level 1) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) File data size (32 bit unsigned) File allocation size (32 bit unsigned) File attributes (16 bit unsigned) EA_SIZE (Info level 2) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) File data size (32 bit unsigned) File allocation size (32 bit unsigned) File attributes (16 bit unsigned) ea_size (32 bit unsigned) Notes: Ethereal does not appear to parse this particular packet correctly: Create time labeled as "EA List Length". Access time labeled as "EA Flags", "EA name length" and "EA data length". Last write time not parsed, but comes right after what's labeled as "EA data length". Then, File data size, File allocation size and File attributes follow the Last write time. ea_size appears to be that last 32 bits. ALL_EAS (Info level 4) EA List length (32 bit unsigned) EA flags (1 byte) EA name length (1 byte) EA data length (16 bit unsigned) EA Name (string) EA data (size is whatever "EA data size" is) IS_NAME_VALID (Info level 6) No returned data. Notes: This query is only performed once by file name. BASIC_INFO (Info level 257) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) Change time (Date/Time stamp) File Attributes (32 bit unsigned) STANDARD_INFO (Info level 258) Allocation Size (64 bit unsigned) Data size (64 bit unsigned) Link count (32 bit unsigned) Delete pending (1 byte bool) Is directory (1 byte bool) Notes: What I've labeled as "data size" above is called "End of File" in ethereal. EA_INFO (Info level 259) EA List length (32 bit unsigned) NAME_INFO (Info level 260) File name length (32 bit unsigned) File name (string) ALL_INFO (Info level 263) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) Change time (Date/Time stamp) File Attributes (32 bit unsigned) File data size (64 bit unsigned) File allocation size (64 bit unsigned) Link count (32 bit unsigned) Delete pending (1 byte bool) Is directory (1 byte bool) EA List length (32 bit unsigned) File name (string) Notes: Just like EA_Size, this response is not parsed correctly by ethereal. The "File name" here is the full path on the system. ALT_NAME_INFO (Info level 264) File name length (32 bit unsigned) File name (string) Notes: Responds with 8.3 filename format. STREAM_INFO (Info level 265) next entry offset (32 bit unsigned) Stream name length (32 bit unsigned) Stream size (64 bit unsigned) Allocation size (64 bit unsigned) Stream name (string) COMPRESSION_INFO (Info level 267) Compressed size (64 bit unsigned) Compression format (16 bit unsigned) Unit shift (8 bit unsigned) Chunk shift (8 bit unsigned) Cluster_shift (8 bit unsigned) UNIX_BASIC_INFO (Info level 512) File size (end of file) (64 bit unsigned) Number of bytes (64 bit unsigned) Last status change (Date/Time stamp) Last access time (Date/Time stamp) Change time (Date/Time stamp) UID (64 bit unsigned) GID (64 bit unsigned) File type (32 bit unsigned) Major Device (64 bit unsigned) Minor Device (64 bit unsigned) Unique ID (64 bit unsigned) File permissions (64 bit unsigned) Link count (64 bit unsigned) Notes: W2k3 (probably all windows) responds with "Unknown info level" UNIX_LINK_INFO (Info level 513) Link destination (string) Notes: W2k3 (probably all windows) responds with "Unknown info level" samba 3.0.14a-2 from SUSE 9.3 responds with "ERROR: level UNIX_LINK_INFO failed - NT_STATUS_UNSUCCESSFUL". BASIC_INFORMATION (Info level 1004) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) Change time (Date/Time stamp) File Attributes (32 bit unsigned) STANDARD_INFORMATION (Info level 1005) Allocation Size (64 bit unsigned) Data size (64 bit unsigned) Link count (32 bit unsigned) Delete pending (1 byte bool) Is directory (1 byte bool) INTERNAL_INFORMATION (Info level 1006) File ID (64 bit unsigned) EA_INFORMATION (Info level 1007) EA List length (32 bit unsigned) ACCESS_INFORMATION (Info level 1008) Access flags (32 bit unsigned) Notes: Neither the query nor the response are parsed properly by ethereal. NAME_INFORMATION (Info level 1009) File name length (32 bit unsigned) File name (string) POSITION_INFORMATION (Info level 1014) Position (64 bit unsigned) MODE_INFORMATION (Info level 1016) Mode (32 bit unsigned) ALIGNMENT_INFORMATION (Info level 1017) Alignment requirement (32 bit unsigned) ALL_INFORMATION (Info level 1018) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) Change time (Date/Time stamp) File Attributes (32 bit unsigned) File data size (64 bit unsigned) File allocation size (64 bit unsigned) Link count (32 bit unsigned) Delete pending (1 byte bool) Is directory (1 byte bool) EA List length (32 bit unsigned) File name (string) Notes: Just like EA_Size, this response is not parsed correctly by ethereal. The "File name" here is the full path on the system. ALT_NAME_INFORMATION (Info level 1021) File name length (32 bit unsigned) File name (string) Notes: Responds with 8.3 filename format. STREAM_INFORMATION (Info level 1022) next entry offset (32 bit unsigned) Stream name length (32 bit unsigned) Stream size (64 bit unsigned) Allocation size (64 bit unsigned) Stream name (string) COMPRESSION_INFORMATION (Info level 1028) Compressed size (64 bit unsigned) Compression format (16 bit unsigned) Unit shift (8 bit unsigned) Chunk shift (8 bit unsigned) Cluster_shift (8 bit unsigned) NETWORK_OPEN_INFORMATION (Info level 1034) Create time (Date/Time stamp) Access time (Date/Time stamp) Last write time (Date/Time stamp) Change time (Date/Time stamp) File allocation size (64 bit unsigned) File data size (64 bit unsigned) File Attributes (32 bit unsigned) ATTRIBUTE_TAG_INFORMATION (Info level 1035) File Attributes (32 bit unsigned) Reparse tag (32 bit unsigned) Notes: Not parsed by ethereal SEC_DESC Not tested Tests Performed: Check for broken levels and compares this to the information in the "capabilities" section in the flags2 field to see if the server claims to support it. Tests/Expectations: Server should respond with NT_STATUS_OK for all tests that it supports. Check the aliases for consistent information BASIC_INFO / BASIC_INFORMATION STANDARD_INFO / STANDARD_INFORMATION EA_INFO / EA_INFORMATION NAME_INFO / NAME_INFORMATION ALL_INFO / ALL_INFORMATION COMPRESSION_INFO / COMPRESSION_INFORMATION ALT_NAME_INFO / ALT_NAME_INFORMATION Tests/Expectations: Values obtained by the aliases should be consistent. Compare "Create time", "Access time", and "Write time" from the BASIC_INFO query to "Create time", "Access time", and "Write time" from the following queries: BASIC_INFO BASIC_INFORMATION GETATTRE STANDARD EA_SIZE ALL_INFO NETWORK_OPEN_INFORMATION Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Compare "Change time" from the BASIC_INFO query to "Change time" from the following queries: BASIC_INFO BASIC_INFORMATION ALL_INFO NETWORK_OPEN_INFORMATION Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Compare file "Data size" and "Allocation size" from the STANDARD_INFO query to the "Data size" and "Allocation size" from the following queries: GETATTR GETATTRE STANDARD EA_SIZE STANDARD_INFO STANDARD_INFORMATION ALL_INFO ALL_INFORMATION COMPRESSION_INFO ("Data size" comparison only) COMPRESSION_INFORMATION ("Data size" comparison only) NETWORK_OPEN_INFORMATION STREAM_INFO STREAM_INFORMATION Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Compare "File Attributes" from the BASIC_INFO query to "File Attributes" from the following queries: GETATTR GETATTRE STANDARD BASIC_INFO BASIC_INFORMATION EA_SIZE ALL_INFO ALL_INFORMATION NETWORK_OPEN_INFORMATION ATTRIBUTE_TAG_INFORMATION Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Compare the file name "torture_qfileinfo.txt" with the "File name" from the following queries: NAME_INFO NAME_INFORMATION ALL_INFO Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Compare "File name" from the ALT_NAME_INFO query to "File name" from the following queries: ALT_NAME_INFO ALT_NAME_INFORMATION Tests/Expectations: Values should be equal. Notes: Each query is performed on the file twice, referencing the file once by name and then by FID. Attempt to open file via the alternate filename (8.3 format). Tests/Expectations: Client should be able to successfully open file. Compare stream name "::$DATA" with the "Stream name" for the following queries: STREAM_INFO STREAM_INFORMATION Tests/Expectations: Values should be equal. Compare EA list length from the ALL_INFO query with the actual list produced by ALL_EAS. Tests/Expectations: EA list length from ALL_INFO query should match actual list length should be consistent. Check the "Delete pending", "Is directory" and "Link count" values from the STANDARD_INFO and the ALL_INFO queries for consistency. Tests/Expectations: Values should be equal. Check the "EA list length" from the EA_INFO and the ALL_INFO queries for consistency. Tests/Expectations: Values should be equal. Check the "EA list length" from the EA_SIZE and the ALL_INFO queries for consistency. Tests/Expectations: Values should be equal. Compare the "File ID" field from the INTERNAL_INFORMATION queries done by file ID and by file name. Tests/Expectations: Values should be equal. Compare the "File position" field from the POSITION_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Compare the "File mode" field from the MODE_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Compares the "Alignment requirement" field from the ALIGNMENT_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Compares the "File attributes" field from the ATTRIBUTE_TAG_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Compares the "Reparse tag" field from the ATTRIBUTE_TAG_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Compares the "Access flags" field from the ACCESS_INFORMATION queries done by file ID and file name. Tests/Expectations: Values should be equal. Note: Apparently these values may differ, so this test is not currently enabled. RAW-SFILEINFO,torture_raw_sfileinfo Example: smbtorture -Uuser%pass /// RAW-SFILEINFO Summary: Tests RAW_SFILEINFO_* commands. This test creates a directory called 'testsfileinfo' at the root of the share, and then creates file 'fname_test_XX.txt', with content 'abc '. All file operations are done on the file 'fname_test_XX.txt' (where XX will be some one or two digit number). These tests are performed by setting a number of different attributes and then using the ALL_INFO query to confirm the correct behavior. Generally, if the ALL_INFO call will reference the file in the same way the test does, either by name of FID. Tests performed: Request is made using the SETATTR call. File is referenced by name. Set the attribute FILE_ATTRIBUTE_READONLY (0x0001). Set "write time" to 'basetime'. SMBTorture Output: "test setattr" Tests/Expectations: Server should respond with NT_STATUS_OK Check ALL_INFO query response should show that the "FILE_ATTRIBUTE_READONLY" attribute was properly set. Check ALL_INFO query response should show that the "Write time" was properly changed. Request is made using the SETATTR call. File is referenced by name. Set the attribute FILE_ATTRIBUTE_NORMAL (0x0080). Set "write time" to 0. SMBTorture Output: "setting to NORMAL doesn't do anything". Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the READONLY attribute is still set. ALL_INFO query response should show that "Write time" wasn't changed. Request is made using the SETATTR call. File is referenced by name. Set all attributes to 0. Set write time to 0. SMBTorture Output: "a zero write_time means don't change" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that only the NORMAL attribute is set. ALL_INFO query response should show that the "Write time" wasn't changed. Request is made using the SETATTRE call. File is referenced by FID. Set "Create time" to basetime + 20. Set "Access time" to basetime + 30. Set "Write time" to basetime + 40. SMBTorture Output: "test setattre" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should reflect the changes to Create/Access/Write times. Request is made using the SETATTRE call. File is referenced by FID. Set Create/Access/Write times to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should show that the Create/Access/Write times have not changed. Request is made using the STANDARD (1) info level (as opposed to using SETATTR/SETATTRE above). File is referenced by FID. Set "Create time" to basetime + 100. Set "Access time" to basetime + 200. Set "Write time" to basetime + 300. SMBTorture Output: test standard level Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should reflect the changes to Create/Access/Write times. The "basetime" variable is incremented 86400 (probably to make the results easier to read). Request is made using the BASIC_INFO (257) info level. File is referenced by FID. Set "Create time" to basetime + 100. Set "Access time" to basetime + 200. Set "Write time" to basetime + 300. Set "Change time" to basetime + 400. Set the attribute FILE_ATTRIBUTE_READONLY (0x0001). SMBTorture Output: "test basic_info level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should reflect the changes to Create/Access/Write/Change times. ALL_INFO query response should show that the READONLY attribute is still set. Request is made using the BASIC_INFO (257) info level. File is referenced by FID. Set "Create time" to 0. Set "Access time" to 0. Set "Write time" to 0. Set "Change time" to 0. Set the attribute FILE_ATTRIBUTE_NORMAL (0x0080). SMBTorture Output: "a zero time means don't change" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should show that the Create/Access/Write/Change times have not changed. ALL_INFO query response should show that the NORMAL attribute is set. Notes: In contrast to the second test in this series, setting FILE_ATTRIBUTE_NORMAL using the BASIC_INFO level actually does cause the "NORMAL" attribute to be set. Doing so via the SETATTR call results in no change to the file attributes. The "basetime" variable is incremented 86400 again (see test #7). Request is made using the BASIC_INFORMATION (1004) info level. File is referenced by FID. Set "Create time" to basetime + 100. Set "Access time" to basetime + 200. Set "Write time" to basetime + 300. Set "Change time" to basetime + 400. Set the attribute FILE_ATTRIBUTE_READONLY (0x0001). SMBTorture Output: "test basic_information level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should reflect the changes to Create/Access/Write/Change times. ALL_INFO query response should show that the READONLY attribute is still set. Notes: This test is identical to test #7, except that the BASIC_INFORMATION level is used instead of BASIC_INFO. Request is made using the BASIC_INFORMATION (1004) info level. File is referenced by name. Set "Create time" to basetime + 100. Set "Access time" to basetime + 200. Set "Write time" to basetime + 300. Set "Change time" to basetime + 400. Set the attribute FILE_ATTRIBUTE_READONLY (0x0001) SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should reflect the changes to Create/Access/Write/Change times. ALL_INFO query response should show that the READONLY attribute is still set. Notes: This test is identical to the previous test, except that the file is referenced by name instead of by FID. Request is made using the BASIC_INFORMATION (1004) info level. File is referenced by FID. Set "Create time" to 0. Set "Access time" to 0. Set "Write time" to 0. Set "Change time" to 0. Set the attribute FILE_ATTRIBUTE_NORMAL (0x0080). SMBTorture Output: "a zero time means don't change" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should show that the Create/Access/Write/Change times have not changed. ALL_INFO query response should show that the NORMAL attribute is set. Notes: In contrast to test #2, setting FILE_ATTRIBUTE_NORMAL using the BASIC_INFO level actually does cause the "NORMAL" attribute to be set. Doing so via the SETATTR call results in no change to the file attributes. Request is made using the BASIC_INFORMATION (1004) info level. File is referenced by name. Set "Create time" to 0. Set "Access time" to 0. Set "Write time" to 0. Set "Change time" to 0. Set the attribute FILE_ATTRIBUTE_NORMAL (0x0080). SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response(s) should show that the Create/Access/Write/Change times have not changed. ALL_INFO query response should show that the NORMAL attribute is set. Notes: This is a repeat of test #11, except that the file is referenced by name instead of FID. Actually, the "Change time" consistency check is commented out. Apparently Win2K3 leaves “Change time” as current time when file is referenced by name. - Confirmed with Win2k3-SP1 Request is made using the DISPOSITION_INFO (258) info level. File is referenced by FID. Mark the file for deletion (delete_pending = 1) SMBTorture Output: "test disposition_info level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the file is marked for deletion. ALL_INFO query response should show that the file link count is 0. Request is made using the DISPOSITION_INFO (258) info level. File is referenced by FID. Unmark the file for deletion (delete_pending = 0) SMBTorture Output: None Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the file is not marked for deletion. ALL_INFO query response should show that the file link count is 1. Request is made using the DISPOSITION_INFORMATION (1013) info level. File is referenced by FID. Mark the file for deletion (delete_pending = 1) SMBTorture Output: "test disposition_information level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the file is marked for deletion. ALL_INFO query response should show that the file link count is 0. Notes: Repeating this test and referencing this file by name will result in deletion of the file. Request is made using the DISPOSITION_INFORMATION (1013) info level. File is referenced by FID. Unmark the file for deletion (delete_pending = 0) SMBTorture Output: None Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the file is not marked for deletion. ALL_INFO query response should show that the file link count is 1. Notes: This test is related to the previous test. Request is made using the DISPOSITION_INFORMATION (1013) info level. File is referenced by name. Unmark the file for deletion (delete_pending = 0) SMBTorture Output: None Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the file is not marked for deletion. ALL_INFO query response should show that the file link count is 1. Notes: This test is related to the previous test, except we're just referencing the file by name. Request is made using the ALLOCATION_INFO (259) info level. File is referenced by FID. Set the allocation size to 0. SMBTorture Output: "test allocation_info level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 0. Request is made using the ALLOCATION_INFO (259) info level. File is referenced by FID. Set the allocation size to 4096. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 4096. File is deleted and then recreated. Request is made using the ALLOCATION_INFORMATION (1019) info level. File is referenced by FID. Set the allocation size to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 0. Request is made using the ALLOCATION_INFORMATION (1019) info level. File is referenced by name. Set the allocation size to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 0. Notes: Same test as above, except file is referenced by name. Request is made using the ALLOCATION_INFORMATION (1019) info level. File is referenced by FID. Set the allocation size to 4096. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 4096. Request is made using the ALLOCATION_INFORMATION (1019) info level. File is referenced by name. Set the allocation size to 4096. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 0. ALL_INFO query response should show that the allocation size is 0. Notes: Same test as above, except file is referenced by name. W2K3 does not set the file allocation up when file is referenced by name. Request is made using the END_OF_FILE_INFO (260) info level. File is referenced by FID. Set the file size to 37. SMBTorture Output: "test end_of_file_info level" Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 37. Request is made using the END_OF_FILE_INFO (260) info level. File is referenced by FID. Set the file size to 7. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 7. Request is made using the END_OF_FILE_INFORMATION (1020) info level. File is referenced by FID. Set the file size to 37. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 37. Request is made using the END_OF_FILE_INFORMATION (1020) info level. File is referenced by NAME. Set the file size to 37. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 37. Notes: Same test as above except the file is referenced by name. Request is made using the END_OF_FILE_INFORMATION (1020) info level. File is referenced by FID. Set the file size to 7. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 7. Request is made using the END_OF_FILE_INFORMATION (1020) info level. File is referenced by NAME. Set the file size to 7. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK ALL_INFO query response should show that the size is 7. Notes: Same test as above except the file is referenced by name. Request is made using the POSITION_INFORMATION (1014) info level. File is referenced by FID. Set the file position to 123456. SMBTorture Output: "test position_information level" Tests/Expectations: Server should respond with NT_STATUS_OK POSITION_INFORMATION query response should show that the file position is 123456. Request is made using the POSITION_INFORMATION (1014) info level. File is referenced by NAME. Set the file position to 123456. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK POSITION_INFORMATION query response should show that the file position is 0. Request is made using the MODE_INFORMATION (1016) info level. File is referenced by FID. Set file mode to 2. SMBTorture Output: "test mode_information level" Tests/Expectations: Server should respond with NT_STATUS_OK MODE_INFORMATION query response should show that the file mode is set to 2. Request is made using the MODE_INFORMATION (1016) info level. File is referenced by NAME. Set file mode to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK MODE_INFORMATION query response should show that the file mode is set to 0. Notes: Same test as above except the file is referenced by name. Request is made using the MODE_INFORMATION (1016) info level. File is referenced by FID. Set file mode to 1. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_INVALID_PARAMETER Request is made using the MODE_INFORMATION (1016) info level. File is referenced by NAME. Set file mode to 1. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_INVALID_PARAMETER Notes: Same test as above except the file is referenced by name. Request is made using the MODE_INFORMATION (1016) info level. File is referenced by FID. Set file mode to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK MODE_INFORMATION query response should show that the file mode is set to 0. Request is made using the MODE_INFORMATION (1016) info level. File is referenced by NAME. Set file mode to 0. SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK MODE_INFORMATION query response should show that the file mode is set to 0. Notes: Same test as above except the file is referenced by name. Files "\testsfileinfo\fnum_test_new_XX.txt" and "\testsfileinfo\fname_test_new_XX.txt" are created. Request is made using the RENAME_INFORMATION (1010) info level. File is referenced by FID (the FID of the original file: fname_test_XX.txt). Set file overwrite to 0. Set root FID to 0. Rename "fname_test_XX.txt" to "fnum_test_new_XX.txt" SMBTorture Output: "finally the rename_information level" Tests/Expectations: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by NAME (the name of the original file: fname_test_XX.txt). Set file overwrite to 0. Set root FID to 0. Rename "fname_test_XX.txt" to "fname_test_new_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Notes: This test is similar to the one above, except the file is referenced by name. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the FID of the original file: fname_test_XX.txt). Set file overwrite to 1. Rename "fname_test_XX.txt" to "\testsfileinfo\fnum_test_new_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_NOT_SUPPORTED Notes: The target file name in this case is given as the full path ("\testsfileinfo\fnum_test_new_XX.txt"). So this looks like a "move and rename" type request, which apparently the server doesn't like eventhough the desination path is the same as the path to the original file. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the FID of the original file: fname_test_XX.txt). Set file overwrite to 1. Rename "fname_test_XX.txt" to "fnum_test_new_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name has changed to "fnum_test_new_XX.txt". The file "fnum_test_XX.txt" is recreated, and written to, but file not closed. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the FID of the original file, which is now called "fnum_test_new_XX.txt"). Set file overwrite to 1. Rename "fnum_test_new_XX.txt" to "fnum_test_XX.txt" SMBTorture Output: "Trying rename with dest file open" Tests/Expectations: Server should respond with NT_STATUS_ACCESS_DENIED NAME_INFO query response should show that the file name ("fnum_test_new_XX.txt") has not changed. Notes: As the smbtorture output says, the filename "fnum_test_XX.txt" is recreated and written to, but the file is not closed - which is why we get the "access denied" message. Request is made using the SET_DISPOSITION_INFORMATION (258) info level. File is referenced by FID, in this case the file: "fnum_test_XX.txt". Mark the file for deletion (delete_pending = 1) SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID Set file overwrite to 1. Rename "fnum_test_new_XX.txt" to "fnum_test_XX.txt" SMBTorture Output: "Trying rename with dest file open and delete_on_close" Tests/Expectations: Server should respond with NT_STATUS_ACCESS_DENIED Notes: The file "fnum_test_XX.txt" is still open for writing, so the test fails. File "fnum_test_XX.txt" is closed. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the file "fnum_test_new_XX.txt"). Rename "fnum_test_new_XX.txt" to "fnum_test_XX.txt" SMBTorture Output: "Trying rename with dest file open and delete_on_close" Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fnum_test_new_XX.txt" has been renamed to "fnum_test_XX.txt". Notes: The file "fnum_test_XX.txt" is still open for writing, so the test should fail. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (now named "fnum_test_XX.txt"). Set file overwrite to 1. Rename "fnum_test_XX.txt" to "fnum_test_XX.txt" (no change) SMBTorture Output: "Trying rename with source file open twice" Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fnum_test_XX.txt" is still called "fnum_test_XX.txt". File "fnum_test_XX.txt is recreated and a new FID is provided. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by the OLD FID (still the file: "fnum_test_XX.txt"). Set file overwrite to 0. Rename "fnum_test_XX.txt" to "fnum_test_new_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fnum_test_XX.txt" is now called "fnum_test_new_XX.txt". Notes: Note that the file "fnum_test_XX.txt" was re-created. Actually what happens is that deleting the file "fnum_test_XX.txt" fails, and then the file is "re-created" and written to with a new file FID. This new FID is not used, but instead the old FID is used to rename the file. The file fnum_test_XX.txt is closed after completing this test. Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the file: "fnum_test_new_XX.txt"). Set file overwrite to 0. Rename "fnum_test_new_XX.txt" to "fnum_test_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fnum_test_new_XX.txt" is now called "fnum_test_XX.txt". Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by NAME (the file: "fname_test_XX.txt"). Set file overwrite to 1. Rename "fname_test_XX.txt" to "fname_test_new_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fname_test_XX.txt" is now called "fname_test_new_XX.txt". Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (the file: "fnum_test_new_XX.txt"). Rename "fnum_test_new_XX.txt" to "fnum_test_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fnum_test_new_XX.txt" is now called "fnum_test_new_XX.txt". Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by NAME (the file: "fname_test_new_XX.txt"). Rename "fname_test_new_XX.txt" to "fname_test_XX.txt" SMBTorture Output: None. Tests/Expectations: Server should respond with NT_STATUS_OK NAME_INFO query response should show that the file name "fname_test_new_XX.txt" is now called "fname_test_XX.txt". Request is made using the SET_RENAME_INFORMATION (1010) info level. File is referenced by FID (fnum_test_XX.txt). Request root directory FID. Rename "fnum_test_XX.txt" to "fnum_test_new_XX.txt". Set the "root directory handle" to the FID requested above. SMBTorture Output: "Trying rename with a root fid" Tests/Expectations: Server should respond with NT_STATUS_OK for directory FID request. Server should respond with NT_STATUS_INVALID_PARAMETER for SET_RENAME_INFORMATION request. RAW-SFILEINFO-BUG,torture_raw_sfileinfo_bug Example: smbtorture --dangerous -Uuser%pass /// RAW-SFILEINFO-BUG Send a SET_PATH_INFO request with level STANDARD (1). File is referenced by NAME. Set "Create time", "Access time", and "Write time" to 0. Set file name to “\bug3.txt”. Tests/Expectations: No tests on the results are done. Notes: W2K3 responds with "NT_STATUS_INTERNAL_ERROR" Ethereal parses response as “DOS Error” and “Unknown info level” RAW-SEARCH,torture_raw_search Example: smbtorture -Uuser%pass /// RAW-SEARCH Notes: A file called "torture_search.txt" is created in the root of the file share which is used for many of these tests. Tests Performed: Run all of the search query levels, check for broken levels and compare this to the information in the "capabilities" section in the flags2 field to see if the server claims to support it. Each RAW_SEARCH_* query is done twice - once using a filename that does exist ("\torture_search.txt"), and again with a file that does not exist ("torture_search-NOTEXIST.txt"). SMBTorture output: "Testing one file searches" FFIRST SMBTorture output: "testing FFIRST" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "STATUS_NO_MORE_FILES" for a file that does not exist. FUNIQUE SMBTorture output: "testing FUNIQUE" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "STATUS_NO_MORE_FILES" for a file that does not exist. SEARCH SMBTorture output: "testing SEARCH" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "STATUS_NO_MORE_FILES" for a file that does not exist. STANDARD (1) SMBTorture output: "testing STANDARD" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. EA_SIZE (2) SMBTorture output: "testing EA_SIZE" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. DIRECTORY_INFO (257) SMBTorture output: "testing DIRECTORY_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. FULL_DIRECTORY_INFO (258) SMBTorture output: "testing FULL_DIRECTORY_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. NAME_INFO (259) SMBTorture output: "testing NAME_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. BOTH_DIRECTORY_INFO (260) SMBTorture output: "testing BOTH_DIRECTORY_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. ID_FULL_DIRECTORY_INFO (261) SMBTorture output: "testing ID_FULL_DIRECTORY_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. ID_BOTH_DIRECTORY_INFO (262) SMBTorture output: "testing ID_BOTH_DIRECTORY_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. UNIX_INFO (514) SMBTorture output: "testing UNIX_INFO" Tests/Expectations: Server should respond with "NT_STATUS_OK" for a file that does exist. Server should respond with "NT_STATUS_NO_SUCH_FILE" for a file that does not exist. Notes: W2K3sp1, Unkown info level SMBTorture Error: "search level UNIX_INFO(514) not supported by server" Perform a FILEINFO_ALL_INFO query to obtain some information about the file (torture_search.txt). Tests/Expectations: Server should return NT_STATUS_OK Perform a FILEINFO_ALT_NAME_INFO query to obtain some information about the file (torture_search.txt). Tests/Expectations: Server should return NT_STATUS_OK Perform a FILEINFO_ALT_INTERNAL_INFORMATION query to obtain some information about the file (torture_search.txt). Tests/Expectations: Server should return NT_STATUS_OK Perform a FILEINFO_ALT_NAME_INFO query to obtain some information about the file (torture_search.txt). Tests/Expectations: Server should return NT_STATUS_OK RAW_SEARCH_SEARCH response tests Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Only partial comparison is done since the RAW_SEARCH_SEARCH query will return an 8-bit attribute field and ALL_INFO returns a 32-bit attribute field. Write time should match write time returned by the ALL_INFO query. Altername name should match alternate name returned by the ALT_INFO query. File size should match file size returned by the ALL_INFO query. RAW_SEARCH_STANDARD response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Only partial comparison is done since the RAW_SEARCH_STANDARD query will return an 8-bit attribute field and ALL_INFO returns a 32-bit attribute field. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. File name should match the actual filename + 1 (null terminated). Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. RAW_SEARCH_EA_SIZE response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Only partial comparison is done since the RAW_SEARCH_STANDARD query will return an 8-bit attribute field and ALL_INFO returns a 32-bit attribute field. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. File name should match the actual filename + 1 (null terminated). Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. EA size should match EA size returned by the ALL_INFO query. RAW_SEARCH_DIRECTORY_INFO response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. File name should match the actual file name. File name should also be null terminated if transmitted as ASCII. RAW_SEARCH_FULL_DIRECTORY_INFO response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. EA size should match EA size returned by the ALL_INFO query. File name should match the actual file name. File name should also be null terminated if transmitted as ASCII. RAW_SEARCH_NAME_INFO response tests: Tests/Expectations: File name should match the actual file name. File name should also be null terminated if transmitted as ASCII. RAW_SEARCH_BOTH_DIRECTORY_INFO response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. EA size should match EA size returned by the ALL_INFO query. File name should match the actual filename. File name should also be null terminated if transmitted as ASCII. The Alternate file name should match the alternate file name returns by the ALT_NAME_INFO query. Alternate file name should be in unicode. RAW_SEARCH_ID_FULL_DIRECTORY_INFO response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. EA size should match EA size returned by the ALL_INFO query. File ID should match file ID returned by the INTERNAL_INFORMATION query. File name should match the actual file name + 1. File name should also be null terminated if transmitted as ASCII. RAW_SEARCH_ID_BOTH_DIRECTORY_INFO response tests: Tests/Expectations: The file attributes returned by server should match attributes returned by the ALL_INFO query. File name should match the actual file name + 1. File name should also be null terminated if transmitted as ASCII. Write time should match write time returned by the ALL_INFO query. Create time should match create time returned by the ALL_INFO query. Access time should match access time returned by the ALL_INFO query. Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. EA size should match EA size returned by the ALL_INFO query. File ID should match file ID returned by the INTERNAL_INFORMATION query. RAW_SEARCH_UNIX_INFO response tests: Tests/Expectations: Allocation size should match allocation size returned by the ALL_INFO query. File size should match file size returned by the ALL_INFO query. File name should match the actual file name + 1. File name should also be null terminated if transmitted as ASCII. Test search calls with multiple files. A directory called "\testsearch" is created. 700 files called "t000-0.txt" to "t699-699.txt" are created in this directory to test. Search query is “\testsearch\*.*” SMBTorture output: "Creating 700 files" RAW_SEARCH_SEARCH via ID SMBTorture output: "Continue SEARCH via ID" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_BOTH_DIRECTORY_INFO (260) via NAME SMBTorture output: "Continue BOTH_DIRECTORY_INFO via NAME" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_BOTH_DIRECTORY_INFO (260) via FLAGS SMBTorture output: "Continue BOTH_DIRECTORY_INFO via FLAGS" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_BOTH_DIRECTORY_INFO (260) via KEY SMBTorture output: "Continue BOTH_DIRECTORY_INFO via KEY" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. Resume key returned should not equal 0. if resume key == 0, NT_STATUS_NOT_SUPPORTED is returned. w2k3sp1 does not support resume by key. SMBTorture error: "Server does not support resume by key" "search failed - NT_STATUS_NOT_SUPPORTED" RAW_SEARCH_STANDARD (1) via NAME SMBTorture output: "Continue STANDARD via NAME" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_STANDARD (1) via FLAGS SMBTorture output: "Continue STANDARD via FLAGS" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_STANDARD (1) via KEY SMBTorture output: "Continue STANDARD via KEY" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. Resume key returned should not equal 0. if resume key == 0, NT_STATUS_NOT_SUPPORTED is returned. w2k3sp1 does not support resume by key. SMBTorture error: "Server does not support resume by key" "search failed - NT_STATUS_NOT_SUPPORTED" RAW_SEARCH_EA_SIZE (2) via NAME SMBTorture output: "Continue EA_SIZE via NAME" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_EA_SIZE (2) via FLAGS SMBTorture output: "Continue EA_SIZE via FLAGS" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. RAW_SEARCH_EA_SIZE (2) via KEY SMBTorture output: "Continue EA_SIZE via KEY" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. Resume key returned should not equal 0. - if reeume key == 0, NT_STATUS_NOT_SUPPORTED is returned. - w2k3sp1 does not support resume by key. SMBTorture error: "Server does not support resume by key" "search failed - NT_STATUS_NOT_SUPPORTED" RAW_SEARCH_DIRECTORY_INFO (257) via NAME SMBTorture output: "Continue EA_SIZE via NAME" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. SMBTorture output: "Continue SEARCH via ID" RAW_SEARCH_DIRECTORY_INFO (257) via FLAGS SMBTorture output: "Continue EA_SIZE via FLAGS" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. SMBTorture output: "Continue SEARCH via ID" RAW_SEARCH_DIRECTORY_INFO (257) via KEY SMBTorture output: "Continue EA_SIZE via KEY" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). File names returned should match the file names that were created. Resume key returned should not equal 0. - if reeume key == 0, NT_STATUS_NOT_SUPPORTED is returned. - w2k3sp1 does not support resume by key. SMBTorture error: "Server does not support resume by key" "search failed - NT_STATUS_NOT_SUPPORTED" Test if search results come back sorted. A directory called "\testsearch" is (re)created. A random list of strings is created, which is used create 700 files with random names. For example: "aaagfhhbee.txt" to "hhhfhghdef.txt" SMBTorture output: "Creating 700 files" Expects: Server should respond with NT_STATUS_OK BOTH_DIRECTORY_INFO (260) by NAME with query string "\testsearch\*.*" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files (700). Test to see if the results come back sorted. SMBTorture Error: "non-alphabetical order at entry [number] [name1] [name2]" "Server does not produce sorted directory listings (not an error)" "[T]est what happens when the directory is modified during a search" A directory called "\testsearch" is (re)created. 20 files called "t019-19.txt" to "t001-1.txt" are created in this directory to test. SMBTorture output: "Creating 20 files" Expects: Server should respond with NT_STATUS_OK Find first query with level BOTH_DIRECTORY_INFO (260) with query string "\testsearch\*.*" SMBTorture output: "pulling the first file" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files requested (1). Find next query with level BOTH_DIRECTORY_INFO (260). SMBTorture output: "pulling the second file" Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files requested so far (2). ## Add/remove some files, change attributes. SMBTorture output: "Changing attributes and deleting" Create file "\testsearch\T003-03.txt.2" Create file "\testsearch\T013-13.txt.2" Create file "\testsearch\T013-13.txt.3" Delete file "\testsearch\T014-14.txt" Set FILE_ATTRIBUTE_HIDDEN on "T015-15.txt" Set FILE_ATTRIBUTE_NORMAL on "T016-16.txt" Set FILE_ATTRIBUTE_SYSTEM on "T017-17.txt" Clear all file attributes on "T018-18.txt" Set "Delete on close" on file "\testsearch\T013-13.txt.3" Server should respond with NT_STATUS_OK Find next query with level BOTH_DIRECTORY_INFO (260). Expects: Server should return NT_STATUS_OK Number of results returned should match the number of files requested so far (20). Test to see if certain files do or do not appear in the output: t009-9.txt should appear in the output and have the ARCHIVE attribute set. t014-14.txt should not appear in output. t015-15.txt should not appear in output. t016-16.txt should appear in the output and have the NORMAL attribute set. t017-17.txt should not appear in output. t018-18.txt should appear in the output and have the ARCHIVE attribute set. t019-19.txt should appear in the output and have the ARCHIVE attribute set. T013-13.txt.2 should appear in the output and have the ARCHIVE attribute set. T003-3.txt.2 should not appear in output. T013-13.txt.3 should appear in the output and have the ARCHIVE attribute set. "[B]asic testing of many old style search calls using separate dirs" 100 directories are created called "d0" to "d99". Three files are created in each directory called dxx-0.txt to dxx-2.txt (where 'xx' is the directory number). SMBTorture output: "Creating 100 dirs" Expects: Server should respond with NT_STATUS_OK Perform a FIND FIRST query with level RAW_SEARCH_SEARCH, once for each directory. Search query is '\testsearch\dx\*.txt'. SMBTorture output: "Search first on 100 dirs" Expects: Server should respond with NT_STATUS_OK Server should return only ONE filename. Filename returned should be fx-0.txt, where 'x' is the directory number (0-99). Perform a FIND NEXT query with level RAW_SEARCH_SEARCH, once for each directory. SMBTorture output: "Search next on 100 dirs" Expects: Server should respond with NT_STATUS_OK Server should return only ONE filename. Filename returned should be fx-1.txt, where 'x' is the directory number (0-99). Perform a FIND NEXT query with level RAW_SEARCH_SEARCH, once for each directory. SMBTorture output: "Search next (rewind) on 100 dirs" Expects: Server should respond with NT_STATUS_OK Server should return only ONE filename. Filename returned should be fx-1.txt, where 'x' is the directory number (0-99). Errors: "(torture/raw/search.c:1065) server did not rewind - got 'f0-2.txt' expected 'f0-1.txt' Notes: W2K3 SP1 fails this test. ## "Testing OS/2 style delete on 700 files" 700 files are created called "file0.txt" to "file99.txt". Expects: Server should respond with NT_STATUS_OK Perform a SEARCH FIRST query with level RAW_SEARCH_EA_SIZE, with return size 100. Query is "\testsearch\*" Expects: Server should respond with NT_STATUS_OK 100 file names should be returned. From the file list returned above, delete four (or whatever delete_count is set to) files. Expects: Server should respond with NT_STATUS_OK Perform a SEARCH NEXT query with level RAW_SEARCH_EA_SIZE, with return size 100. Expects: Server should respond with NT_STATUS_OK 100 file names should be returned. From the file list returned above, delete four (or whatever delete_count is set to) files. Expects: Server should respond with NT_STATUS_OK Repeat the last two steps until all the files are deleted. Expects: Server should respond with NT_STATUS_OK for all delete and search requests. "[T]esting of the rather strange ea_list level" SMBTorture output: "Testing RAW_SEARCH_EA_LIST level" Create three files; file1.txt, file2.txt, file3.txt. Set Extended Attributes on file2.txt EA ONE Data blob: "VALUE 1" SECOND EA Data blob: "Value Two" Set Extended Attributes on file3.txt EA ONE Data blob: "VALUE 1" SECOND EA Data blob: "Value Two" Expects: Server should return with NT_STATUS_OK. Perform a SEARCH FIRST query with level RAW_SEARCH_EA_LIST. Query is "\testsearch\*" Expects: Server should respond with NT_STATUS_OK Errors: W2K3 SP1 fails this test: "(torture/raw/search.c:1253) Incorrect status NT_STATUS_INVALID_PARAMETER - should be NT_STATUS_OK" Perform a SEARCH NEXT query with level RAW_SEARCH_EA_LIST. Expects: Server should respond with NT_STATUS_OK Test responses from the RAW_SEARCH_FIRST and RAW_SEARCH_NEXT queries above: Total result count should be 3. Result list 1 Number EAs should be 2. File name should be "file1.txt". EA name should be SECOND EA. EA length should be 0. EA name should be THIRD EA. EA length should be 0. Result list 2 File name should be "file2.txt". EA name should be SECOND EA. EA length should be 9. EA name should be THIRD EA. EA length should be 0. Result list 3 File name should be "file3.txt". EA name should be SECOND EA. EA length should be 9. EA name should be THIRD EA. EA length should be 0. RAW-CLOSE,torture_raw_close Example: smbtorture -Uuser%pass /// RAW-CLOSE Notes: basic testing of all RAW_CLOSE_* calls Tests Performed: Create file torture_close.txt, and writes 7 bytes ('abc ') to that file. Perform a RAW_CLOSE_CLOSE (0x04) command via FID. Set the write time to 'basetime'. Expects: Server should respond with NT_STATUS_OK Attempt to close the file again using the same arguments as the previous test. Expects: Server should respond with NT_STATUS_INVALID_HANDLE. Perform an ALL_INFO query via FID. SMBTorture output: "testing close.in.write_time" "testing other times" Expects: Server should respond with NT_STATUS_OK Write time returned by ALL_INFO query should match write time set by previous RAW_CLOSE_CLOSE command. The Access time, Create time, and Change time should not be set to the Write time. Delete and recreate the file. Perform an ALL_INFO query via NAME. Expects: Server should respond with NT_STATUS_OK Perform a RAW_CLOSE_CLOSE (0x04) command via FID. Set the write time to 0. Expects: Server should respond with NT_STATUS_OK Perform an ALL_INFO query via NAME. Compare the Write time with the Access time. Expects: Server should respond with NT_STATUS_OK The Write time should be equal to the Access time. SMBTorture Error: "Incorrect write time on file - 0 time should be ignored" File is deleted and recreated. Perform a RAW_CLOSE_SPLCLOSE (0xc2) command via FID. SMBTorture Output: "testing splclose" Expects: Server should respond with Server Error (0x02) (ERRSRV) Close file. Perform a flush request via FID. SMBTorture Output: "testing flush" Expects: Server should respond with NT_STATUS_INVALID_HANDLE (0xc0000008). Perform a flush request using FID "0xffff". Expects: Server should respond with NT_STATUS_OK. Delete and recreate the file. Perform a flush request via FID. Expects: Server should respond with NT_STATUS_OK. Perform a process exit request (0x11). Perform a flush request via FID. SMBTorture Output: "Testing SMBexit" Expects: Server should respond with NT_STATUS_INVALID_HANDLE (0xc0000008). RAW-OPEN,torture_raw_open Example: smbtorture -Uuser%pass /// RAW-OPEN Notes: RAW_OPEN_* individual test suite Tests Performed: ## SMBTorture Output: "Checking RAW_OPEN_OPENX" Perform a RAW_OPEN request with level RAW_OPEN_NTCREATEX. File name is "torture_ntcreatex.txt" SMBTorture Output: "Testing ntcreatex with a byte range locked file" Expects: Server should respond with NT_STATUS_OK Perform a RAW_LOCK request with level RAW_LOCK_LOCKX. Set the lock offset to 0 and the lock length to 1. Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN request with level RAW_OPEN_NTCREATEX. Set disposition attribute to NTCREATEX_DISP_OVERWRITE_IF (Overwrite or create if not exist) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN request with level RAW_OPEN_OPEN. File name is "torture_open.txt". SMBTorture Output: "Checking RAW_OPEN_OPEN" Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND (file not created yet.) Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be readable and writeable. To determine this, 1 byte is read and written to the file. /* check the read/write modes */ Set access mode to (0x00ff) Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be readable and writeable. To determine this, 1 byte is read and written to the file. Tests should return with NT_STATUS_OK. Set search attributes to 0. Set access mode to READ-ONLY (0x0000). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be read-only. To determine this, 1 byte is read and written to the file. WRITE test should return with NT_STATUS_ACCESS_DENIED. Set access mode to WRITE-ONLY (0x0001). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be write-only. To determine this, 1 byte is read and written to the file. READ test should return with NT_STATUS_ACCESS_DENIED. Set access mode to READ-WRITE (0x0002). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be readable and writable. To determine this, 1 byte is read and written to the file. Tests should return with NT_STATUS_OK. /* check the share modes roughly - not a complete matrix */ Set access mode to READ-WRITE and DENY-WRITE (0x0022). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be readable and writable. To determine this, 1 byte is read and written to the file. Tests should return with NT_STATUS_OK. File mode returned by server (rmode) should match mode set by RAW_OPEN_OPEN request. Set access mode to READ-WRITE and DENY-NONE (0x0042). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_SHARING_VIOLATION Set access mode to READ-ONLY and DENY-NONE (0x0040). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK File should be read-only. To determine this, 1 byte is read and written to the file. WRITE test should return with NT_STATUS_ACCESS_DENIED. ## Check some of the returned fields. Set search attributes to 0. Set access mode to READ-ONLY (0x0000). Perform a RAW_OPEN request with level RAW_OPEN_OPEN on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK The WRITE TIME returned from the RAW_OPEN_OPEN request should match the WRITE TIME returned by the ALL INFO (263) query. The SIZE returned from the RAW_OPEN_OPEN request should match the SIZE returned by the ALL INFO (263) query. The ATTRIBUTES returned from the RAW_OPEN_OPEN request should match the ATTRIBUTES returned by the ALL INFO (263) query. ******** test_raw_open_multi(), line 1268 TODO: Need more details from Tridge about this test Create file "test_oplock.dat". Open three connections to server Attempt to open/create a file once per connection. Expects: File 0 returned status NT_STATUS_OBJECT_NAME_COLLISION File 1 returned status NT_STATUS_OBJECT_NAME_COLLISION File 2 returned status NT_STATUS_OK (This apparently correct output) ******** /* test RAW_OPEN_OPENX */ ## SMBTorture Output: "Checking RAW_OPEN_OPENX" Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK (file didn't exist, but was created). Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL (0x0000) Expects: Server should respond with DOS Error (0x01), Invalid open mode (0x00c0). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL (0x0000) Expects: Server should respond with DOS Error (0x01), Invalid open mode (0x00c0). Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OK. Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_TRUNC (0x0002) Expects: Server should respond with NT_STATUS_OK. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_TRUNC (0x0002) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND. Create file '\rawopen\torture_openx.txt' (file is deleted after completing the test). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE (0x0012) Expects: Server should respond with NT_STATUS_OK. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE (0x0012) Expects: Server should respond with NT_STATUS_OK. /* check the basic return fields */ Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK. The SIZE returned from the RAW_OPEN_OPENX request should match the SIZE returned by the ALL INFO (263) query. The WRITE TIME returned from the RAW_OPEN_OPENX request should match the WRITE TIME returned by the ALL INFO (263) query. The ATTRIBUTES returned from the RAW_OPEN_OPENX request should match the ATTRIBUTES returned by the ALL INFO (263) query. The ACCESS MODE returned from the RAW_OPEN_OPENX request should be READ-WRITE. The FILE TYPE returned from the RAW_OPEN_OPENX request should be 0 (disk file or directory). The DEVICE STATE (IPC State) returned from the RAW_OPEN_OPENX request should be 0 (0x0000). The ACTION returned from the RAW_OPEN_OPENX request should be OPENX_ACTION_CREATED (0x0002) The SIZE returned from the RAW_OPEN_OPENX request should be 1024*1024 (1048576). The SIZE returned from the RAW_OPEN_OPENX request should match the SIZE returned by the ALL INFO (263) query. /* check the fields when the file already existed */ Create file '\rawopen\torture_openx.txt'. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OK. The SIZE returned from the RAW_OPEN_OPENX request should match the SIZE returned by the ALL INFO (263) query. The WRITE TIME returned from the RAW_OPEN_OPENX request should match the WRITE TIME returned by the ALL INFO (263) query. The ACTION returned from the RAW_OPEN_OPENX request should be OPENX_ACTION_EXISTED(0x0001) The "unknown" field returned from the RAW_OPEN_OPENX request should be 0. The ATTRIBUTES returned from the RAW_OPEN_OPENX request should match the ATTRIBUTES returned by the ALL INFO (263) query. /* now check the search attrib for hidden files - win2003 ignores this? */ Perform a SET_PATH_INFO Trans2 request with level BASIC_INFO to set the HIDDEN attribute on '\rawopen\torture_openx.txt'. Expects: The attributes returned by the ALL INFO (263) query should show that the HIDDEN attribute is enabled. Enable the HIDDEN attribute in the search attributes (0x0002). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK. Disable the HIDDEN attribute in the search attributes (0x0000). Perform a RAW_OPEN_OPENX request on "torture_open.txt". Expects: Server should respond with NT_STATUS_OK. /* and check attrib on create */ Set RAW_OPEN_OPENX search attributes to 0. Enable the FILE_ATTRIBUTE_SYSTEM attribute. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OK. The attributes returned by the ALL INFO (263) query should show that the SYSTEM and ARCHIVE attributes are enabled. /* check timeout on create - win2003 ignores the timeout! */ Set the file attributes to 0. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Open mode: OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_ALL (0x0012) Expects: Server should respond with NT_STATUS_OK. Set OPENX timeout to 20000. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open mode: OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_NONE (0x0042) Expects: Server should respond with NT_STATUS_SHARING_VIOLATION. /* now this is a really weird one - open for execute implies create?! */ Set ADDITIONAL_INFO flag (0x0001) Set search attributes to 0. Set file attributes to 0. Set timoute to 0. Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_FAIL (0x0000) Open mode: OPENX_MODE_ACCESS_EXEC | OPENX_MODE_DENY_NONE (0x0043) Expects: Server should respond with NT_STATUS_OK. /* check the extended return flag */ Set ADDITIONAL_INFO and EXTENDED_RETURN flags (0x0011) Perform a RAW_OPEN_OPENX request on "torture_open.txt". Open function: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OK. ACCESS MASK returned by RAW_OPEN_OPENX query should be SEC_STD_ALL (0x001F0000) Notes: Ethereal doesn't parse the access mask section of the response. Perform a RAW_OPEN_OPENX request on "\A.+,;=[].B". Open function: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND. /* Check the mapping for open exec. */ /* First create an .exe file. */ Set ADDITIONAL_INFO flag (0x0001) Set search attributes to 0. Set file attributes to 0. Set write time to 0. Set size to 0. Set timeout to 0. Perform a RAW_OPEN_OPENX request on "\rawopen\torture_openx.exe". Open mode: OPENX_MODE_ACCESS_EXEC | OPENX_MODE_DENY_NONE (0x0043) Expects: Server should respond with NT_STATUS_OK. File should be READ-ONLY. /* test RAW_OPEN_NTCREATEX */ ## SMBTorture Output: "Checking RAW_OPEN_NTCREATEX" Options: Query level = RAW_OPEN_NTCREATEX Flags = NTCREATEX_FLAGS_EXTENDED Root FID = 0 Access Mask = SEC_RIGHTS_FILE_ALL Allocation Size = 1024*1024 File Attributes = FILE_ATTRIBUTE_NORMAL Share Access = NTCREATEX_SHARE_ACCESS_NONE Open Disposition = NTCREATEX_DISP_CREATE Create Options = 0 Impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS Security flags = 0 Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_SUPERSEDE (0) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_SUPERSEDE (0) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN_IF (3) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE (4) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE (4) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE_IF (5) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: UNKNOWN (6) Expects: Server should respond with NT_STATUS_INVALID_PARAMETER Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: UNKNOWN (6) Expects: Server should respond with NT_STATUS_INVALID_PARAMETER /* basic field testing */ ## File 'torture_ntcreatex.txt' does not exist yet. Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK OPLOCK LEVEL returned by RAW_OPEN_NTCREATEX request should equal 0. CREATE ACTION returned by RAW_OPEN_NTCREATEX request should be NTCREATEX_ACTION_CREATED (2). CREATE TIME returned by RAW_OPEN_NTCREATEX should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTCREATEX should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTCREATEX should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTCREATEX should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTCREATEX should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTCREATEX should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTCREATEX should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTCREATEX should equal the IS_DIRECTORY returned by the ALL_INFO query. FILE TYPE returned by RAW_OPEN_NTCREATEX request should be FILE_TYPE_DISK (0). /* check fields when the file already existed */ Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OK. OPLOCK LEVEL returned by RAW_OPEN_NTCREATEX request should equal 0. CREATE ACTION returned by RAW_OPEN_NTCREATEX request should be NTCREATEX_ACTION_EXISTED (1). CREATE TIME returned by RAW_OPEN_NTCREATEX should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTCREATEX should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTCREATEX should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTCREATEX should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTCREATEX should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTCREATEX should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTCREATEX should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTCREATEX should equal the IS_DIRECTORY returned by the ALL_INFO query. FILE TYPE returned by RAW_OPEN_NTCREATEX request should be FILE_TYPE_DISK (0). /* create a directory */ Options: Open Disposition = NTCREATEX_DISP_CREATE Access mask = SEC_RIGHTS_FILE_ALL Allocations Size = 0 File Attributes = FILE_ATTRIBUTE_DIRECTORY Share Access = NTCREATEX_SHARE_ACCESS_NONE Open Disposition = NTCREATEX_DISP_CREATE Create Options = 0 Set ACCESS MASK to SEC_FLAG_MAXIMUM_ALLOWED (0x02000000). Set CREATE OPTIONS to NTCREATEX_OPTIONS_DIRECTORY (0x00000001). Set FILE ATTRIBUTES to FILE_ATTRIBUTE_NORMAL (0x00000080). Set SHARE ACCESS to NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE (0x00000003). Perform a RAW_OPEN_NTCREATEX request on "torture_ntcreatex.dir". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK. OPLOCK LEVEL returned by RAW_OPEN_NTCREATEX request should equal 0. CREATE ACTION returned by RAW_OPEN_NTCREATEX request should be NTCREATEX_ACTION_CREATED (2). CREATE TIME returned by RAW_OPEN_NTCREATEX should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTCREATEX should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTCREATEX should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTCREATEX should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTCREATEX should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTCREATEX should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTCREATEX should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTCREATEX should equal the IS_DIRECTORY returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTCREATEX should be 1. SIZE returned by RAW_OPEN_NTCREATEX should be 0. ALLOCATION SIZE returned by RAW_OPEN_NTCREATEX should be 0. FILE TYPE returned by RAW_OPEN_NTCREATEX request should be FILE_TYPE_DISK (0). /* test RAW_OPEN_NTTRANS_CREATE */ ## SMBTorture Output: "Checking RAW_OPEN_NTTRANS_CREATE" Options: Query level = RAW_OPEN_NTTRANS_CREATE Flags = NTCREATEX_FLAGS_EXTENDED Root FID = 0 Access Mask = SEC_RIGHTS_FILE_ALL Allocation Size = 1024*1024 File Attributes = FILE_ATTRIBUTE_NORMAL Share Access = NTCREATEX_SHARE_ACCESS_NONE Open Disposition = NTCREATEX_DISP_CREATE Create Options = 0 Impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS Security Flags = 0 Security Desc. = NULL EA List = NULL Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_SUPERSEDE (0) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_SUPERSEDE (0) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN_IF (3) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN_IF (3) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE (4) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE (4) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE_IF (5) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OVERWRITE_IF (5) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_ntcreatex.txt' (file is deleted after completing the test). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: UNKNOWN (6) Expects: Server should respond with NT_STATUS_INVALID_PARAMETER Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: UNKNOWN (6) Expects: Server should respond with NT_STATUS_INVALID_PARAMETER /* basic field testing */ Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK. OPLOCK LEVEL returned by RAW_OPEN_NTTRANS_CREATE request should equal 0. CREATE ACTION returned by RAW_OPEN_NTTRANS_CREATE request should be NTCREATEX_ACTION_CREATED (2). CREATE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTTRANS_CREATE should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTTRANS_CREATE should equal the IS_DIRECTORY returned by the ALL_INFO query. FILE TYPE returned by RAW_OPEN_NTTRANS_CREATE request should be FILE_TYPE_DISK (0). /* check fields when the file already existed */ Create file '\rawopen\torture_ntcreatex.txt'. Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.txt". Open Disposition: NTCREATEX_DISP_OPEN (1) Expects: Server should respond with NT_STATUS_OK. OPLOCK LEVEL returned by RAW_OPEN_NTTRANS_CREATE request should equal 0. CREATE ACTION returned by RAW_OPEN_NTTRANS_CREATE request should be NTCREATEX_ACTION_EXISTED (1). CREATE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTTRANS_CREATE should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTTRANS_CREATE should equal the IS_DIRECTORY returned by the ALL_INFO query. FILE TYPE returned by RAW_OPEN_NTTRANS_CREATE request should be FILE_TYPE_DISK (0). /* create a directory */ Options: Open Disposition = NTCREATEX_DISP_CREATE Access mask = SEC_RIGHTS_FILE_ALL Allocations Size = 0 File Attributes = FILE_ATTRIBUTE_DIRECTORY Share Access = NTCREATEX_SHARE_ACCESS_NONE Open Disposition = NTCREATEX_DISP_CREATE Create Options = 0 Set ACCESS MASK to SEC_FLAG_MAXIMUM_ALLOWED (0x02000000). Set CREATE OPTIONS to NTCREATEX_OPTIONS_DIRECTORY (0x00000001). Set FILE ATTRIBUTES to FILE_ATTRIBUTE_NORMAL (0x00000080). Set SHARE ACCESS to NTCREATEX_SHARE_ACCESS_READ | NTCREATEX_SHARE_ACCESS_WRITE (0x00000003). Perform a RAW_OPEN_NTTRANS_CREATE request on "torture_ntcreatex.dir". Open Disposition: NTCREATEX_DISP_CREATE (2) Expects: Server should respond with NT_STATUS_OK. OPLOCK LEVEL returned by RAW_OPEN_NTTRANS_CREATE request should equal 0. CREATE ACTION returned by RAW_OPEN_NTTRANS_CREATE request should be NTCREATEX_ACTION_CREATED (2). CREATE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CREATE TIME returned by the ALL_INFO query. ACCESS TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the ACCESS TIME returned by the ALL_INFO query. WRITE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the WRITE TIME returned by the ALL_INFO query. CHANGE TIME returned by RAW_OPEN_NTTRANS_CREATE should equal the CHANGE TIME returned by the ALL_INFO query. ATTRIBUTES returned by RAW_OPEN_NTTRANS_CREATE should equal the ATTRIBUTES returned by the ALL_INFO query. ALLOCATION SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the ALLOCATION SIZE returned by the ALL_INFO query. SIZE returned by RAW_OPEN_NTTRANS_CREATE should equal the SIZE returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTTRANS_CREATE should equal the IS_DIRECTORY returned by the ALL_INFO query. IS_DIRECTORY returned by RAW_OPEN_NTTRANS_CREATE should be 1. SIZE returned by RAW_OPEN_NTTRANS_CREATE should be 0. ALLOCATION SIZE returned by RAW_OPEN_NTTRANS_CREATE should be 0. FILE TYPE returned by RAW_OPEN_NTTRANS_CREATE request should be FILE_TYPE_DISK (0). /* test RAW_OPEN_T2OPEN */ ## SMBTorture Output: "Checking RAW_OPEN_T2OPEN" Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_OPEN (0x0001) Expects: Server should respond with NT_STATUS_OBJECT_NAME_NOT_FOUND Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_FAIL (0x0000) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_FAIL (0x0000) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_TRUNC (0x0002) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_TRUNC (0x0002) Expects: Server should respond with NT_STATUS_OK Create file '\rawopen\torture_t2open_yes.txt' (file is deleted after completing the test). Perform a RAW_OPEN_T2OPEN request on "torture_t2open_yes.txt". Open Disposition: OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE (0x0012) Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_T2OPEN request on "torture_t2open_no.txt". Open Disposition: OPENX_OPEN_FUNC_TRUNC | OPENX_OPEN_FUNC_CREATE (0x0012) Expects: Server should respond with NT_STATUS_OK /* check the basic return fields */ Set WRITE TIME to 0. Perform a RAW_OPEN_T2OPEN request on "torture_t2open_3.txt". Open Disposition: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Expects: Server should respond with NT_STATUS_OK The SIZE returned by the RAW_OPEN_T2OPEN query should equal the SIZE returned by the ALL_INFO query. The ATTRIBUTES returned by the RAW_OPEN_T2OPEN query should equal the ATTRIBUTES returned by the ALL_INFO query. The ACCESS MODE returned by the RAW_OPEN_T2OPEN query should be "OPENX_MODE_DENY_NONE | OPENX_MODE_ACCESS_RDWR" The FILE TYPE returned by the RAW_OPEN_T2OPEN query should be 0. The DEVICE STATE (IPC state) returned by the RAW_OPEN_T2OPEN query should be 0. The ACTION returned by the RAW_OPEN_T2OPEN query should be OPENX_ACTION_CREATED. The WRITE TIME returned by the RAW_OPEN_T2OPEN query should be 0. /* windows appears to leak uninitialised memory here */ Perform a QUERY_PATH_INFO request with level QUERY_EA_FROM_LIST (3) on "torture_t2open_3.txt". EA List: ".CLASSINFO" Expects: Server should respond with NT_STATUS_OK The server should return the correct date about the ".CLASSINFO" EA list. Perform a QUERY_PATH_INFO request with level QUERY_EA_FROM_LIST (3) on "torture_t2open_3.txt". EA List: "EA TWO" Expects: Server should respond with NT_STATUS_OK The server should return the correct date about the "EA TWO" EA list. Perform a QUERY_PATH_INFO request with level QUERY_EA_FROM_LIST (3) on "torture_t2open_3.txt". EA List: "X THIRD" Expects: Server should respond with NT_STATUS_OK The server should return the correct date about the "X THIRD" EA list. /* now check the search attrib for hidden files - win2003 ignores this? */ Set attributes to FILE_ATTRIBUTE_HIDDEN. Perform a RAW_OPEN_T2OPEN request on "torture_t2open_3.txt". (performed twice) Expects: Server should respond with NT_STATUS_OK The ATTRIBUTES returned by ALL_INFO query should show the HIDDEN attribute set. /* and check attrib on create */ Set attributes to FILE_ATTRIBUTE_SYSTEM. Perform a RAW_OPEN_T2OPEN request on "torture_t2open_3.txt". Open Disposition: OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE (0x0010) Expects: Server should respond with NT_STATUS_OK /* check timeout on create - win2003 ignores the timeout! */ Set FILE ATTRIBUTES to 0. Set TIMEOUT to 20000. Open Mode: OPENX_MODE_ACCESS_RDWR | OPENX_MODE_DENY_ALL Open Disposition: OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE (0x0011) Perform a RAW_OPEN_T2OPEN request on "torture_t2open_3.txt". Expects: Server should respond with NT_STATUS_SHARING_VIOLATION /* test RAW_OPEN_MKNEW */ ## SMBTorture Output: "Checking RAW_OPEN_MKNEW" Set ATTRIBUTES to 0. Set WRITE TIME to 0. Perform a RAW_OPEN_MKNEW request on "torture_mknew.txt" Expects: Server should respond with NT_STATUS_OK Perform a RAW_OPEN_MKNEW request on "torture_mknew.txt" - without first deleting the file created by the previous test. Expects: Server should respond with NT_STATUS_OBJECT_NAME_COLLISION /* make sure write_time works */ Set WRITE TIME to basetime. Perform a RAW_OPEN_MKNEW request on "torture_mknew.txt". Expects: Server should respond with NT_STATUS_OK. WRITE TIME returned by RAW_OPEN_MKNEW request should equal WRITE TIME returned by the ALL_INFO query. /* make sure file_attrs works */ Set attributes to FILE_ATTRIBUTE_HIDDEN. Perform a RAW_OPEN_MKNEW request on "torture_mknew.txt". Expects: Server should respond with NT_STATUS_OK. ATTRIBUTES returned by the RAW_OPEN_MKNEW request should equal ATTRIBUTES returned by the ALL_INFO query. Specifically FILE_ATTRIBUTE_HIDDEN and FILE_ATTRIBUTE_ARCHIVE /* test RAW_OPEN_CREATE */ ## SMBTorture Output: "Checking RAW_OPEN_CREATE" Set ATTRIBUTES to 0. Set WRITE TIME to 0. Perform a RAW_OPEN_CREATE request on "torture_create.txt". Expects: Server should respond with NT_STATUS_OK. Perform a RAW_OPEN_CREATE request on "torture_create.txt". Expects: Server should respond with NT_STATUS_OK. /* make sure write_time works */ Set WRITE TIME to basetime. Perform a RAW_OPEN_CREATE request on "torture_create.txt". Expects: Server should respond with NT_STATUS_OK. WRITE TIME returned by RAW_OPEN_CREATE request should equal WRITE TIME returned by the ALL_INFO query. /* make sure file_attrs works */ Set attributes to FILE_ATTRIBUTE_HIDDEN. Perform a RAW_OPEN_CREATE request on "torture_create.txt". Expects: Server should respond with NT_STATUS_OK. ATTRIBUTES returned by the RAW_OPEN_CREATE request should equal ATTRIBUTES returned by the ALL_INFO query. Specifically FILE_ATTRIBUTE_HIDDEN and FILE_ATTRIBUTE_ARCHIVE /* test RAW_OPEN_CTEMP */ ## SMBTorture Output: "Checking RAW_OPEN_CTEMP" Set attributes to FILE_ATTRIBUTE_HIDDEN. Set WRITE TIME to basetime. Perform a RAW_OPEN_CTEMP request for directory "\rawopen". Expects: Server should respond with NT_STATUS_OK. Perform a RAW_FILEINFO_NAME_INFO request on the FID returned by the previous RAW_OPEN_CTEMP request. Expects: Server should respond with NT_STATUS_OK. SMBTorture Output: "ctemp name=XXXXXX real name=\XXXXXX" /* test chained RAW_OPEN_OPENX_READX */ ## SMBTorture Output: "Checking RAW_OPEN_OPENX chained with READX" Create file '\rawopen\torture_chained.txt'. Write four bytes to the file (the word "test"). Set ADDITIONAL INFO flag (0x0001) Set SEARCH ATTRIBUTES to 0. Set FILE ATTRIBUTES to 0. Set WRITE TIME to 0. Set SIZE to 1024*1024. Set TIMEOUT to 0. Set HIGH OFFSET to 0. Set MINCNT to 4. (sizeof(buf)). Set MAXCNT to 4. (sizeof(buf)). Set REMAINING to 0. Open Mode: OPENX_MODE_ACCESS_RDWR (0x0002) Open Function: OPENX_OPEN_FUNC_OPEN (0x0001) Perform a RAW_OPEN_OPENX_READX request on the file "torture_chained.txt". Expects: Server should respond with NT_STATUS_OK. File data returned by the OPENX_OPEN_FUNC_OPEN request should be the same as the file data written to the file (the word "test").