Partager via


3.3.5.21.1 Handling SMB2_0_INFO_FILE

The information classes that are supported for setting file information are listed in section 2.2.39. Documentation for these is provided in [MS-FSCC] section 2.4.

Requests for information classes documented in [MS-FSCC] section 2.4 with "Set" not specified in the Uses column are not allowed and SHOULD be failed with STATUS_INVALID_INFO_CLASS.

Requests for information classes not documented in section 2.4 of [MS-FSCC] SHOULD<421> be failed with STATUS_INVALID_INFO_CLASS.

Requests for information classes not listed in section 2.2.39 but documented in [MS-FSCC] section 2.4 with "Set" specified in the Uses column are not allowed and SHOULD be failed with STATUS_NOT_SUPPORTED.

If FileInfoClass is FileRenameInformation, the server does the following:

  • If the size of the buffer is less than the size of FILE_RENAME_INFORMATION_TYPE_2 as specified in [MS-FSCC] section 2.4.41.2, the server MUST fail the request with STATUS_INFO_LENGTH_MISMATCH.

  • If the file name pointed to by the FileName parameter of the FILE_RENAME_INFORMATION_TYPE_2, as specified in [MS-FSCC] section 2.4.41.2, contains a separator character, then the server MUST fail the request with STATUS_NOT_SUPPORTED.

  • If the RootDirectory field of FILE_RENAME_INFORMATION_TYPE_2 as specified in [MS-FSCC] section 2.4.41.2 is zero, the FileName field MUST specify a full pathname as specified in [MS-FSCC] section 2.1.5 to be assigned to the file. If the RootDirectory field is not zero, the server MUST return STATUS_INVALID_PARAMETER.

If the object store supports security and FileInfoClass is FileBasicInformation or FilePipeInformation, and Open.GrantedAccess does not include FILE_WRITE_ATTRIBUTES, the server MUST fail the request with STATUS_ACCESS_DENIED.

If the object store supports security and FileInfoClass is FileRenameInformation, FileDispositionInformation, or FileShortNameInformation, and Open.GrantedAccess does not include DELETE, the server MUST fail the request with STATUS_ACCESS_DENIED.

If the object store supports security and FileInfoClass is FileFullEaInformation, and Open.GrantedAccess does not include FILE_WRITE_EA, the server MUST fail the request with STATUS_ACCESS_DENIED.

If the object store supports security and FileInfoClass is FileFullEaInformation and the EA buffer in the Buffer field is not in a valid format, the server MUST fail the request with STATUS_EA_LIST_INCONSISTENT.

If the object store supports security and FileInfoClass is FileAllocationInformation, FileEndOfFileInformation, or FileValidDataLengthInformation, and Open.GrantedAccess does not include FILE_WRITE_DATA, the server MUST fail the request with STATUS_ACCESS_DENIED.

The server MUST apply the information requested to the underlying object store.<422> If the store does not support the information class requested, the server MUST fail the request with STATUS_NOT_SUPPORTED.

If the underlying object store returns an error, the server MUST fail the request with the error code received.

Otherwise, the server MUST initialize an SMB2 SET_INFO Response following the syntax given in section 2.2.40.

If the underlying object store returns successfully, FileInfoClass is FileDispositionInformation, Connection.Dialect is not “2.0.2” , and Open.Lease is not NULL, the server MUST set Open.Lease.FileDeleteOnClose to TRUE.

If the underlying object store returns successfully, FileInfoClass is FileRenameInformation, Connection.Dialect is not “2.0.2”, and Open.Lease is not NULL, the server MUST update Open.Lease.Filename to the new name for the file and Open.Lease.FileDeleteOnClose to FALSE.

The response MUST then be sent to the client.