Compartir a través de


3.3.5.20.4 Handling SMB2_0_INFO_QUOTA

The server's object store MAY support quotas that are associated with a security principal. If the server exposes support for quotas, it MUST allow security principals to be identified using security identifiers (SIDs) in the format that is specified in [MS-DTYP] section 2.4.2.2.<421>

If the underlying object store does not support user quotas, the server MUST fail the request with STATUS_NOT_SUPPORTED.

The server MUST verify that the InputBufferOffset and InputBufferLength of the client request describe an SMB2_QUERY_QUOTA_INFO structure following the syntax specified in section 2.2.37.1. If not, the server MUST fail the request with STATUS_INVALID_PARAMETER.

The server MUST query the quota information retrieved from the underlying volume that hosts the open in the object store.<422>

FullQuotaList:  The list of the volume's quota information entries maintained by the underlying object store.

SidList:  The list of FILE_GET_QUOTA_INFORMATION structures as specified in [MS-FSCC] section 2.4.40.1.

  • If ReturnSingle is TRUE, the server MUST return at most a single quota information entry to the client.

  • If SidListLength is nonzero, the server MUST ignore the values of StartSidOffset and StartSidLength, and enumerate the quota information entries for all the SIDs specified in SidList. If SidList is not a list of FILE_GET_QUOTA_INFORMATION structures linked via the NextEntryOffset field, the server MUST fail the request with STATUS_INVALID_PARAMETER. If the server can't find the corresponding quota information entry through the SID specified in the FILE_GET_QUOTA_INFORMATION structure, then the server MUST return FILE_QUOTA_INFORMATION for the SID with the following fields set to zero: ChangeTime, QuotaUsed, QuotaThreshold, and QuotaLimit.

  • If SidListLength is zero, SidBuffer.StartSid is nonzero and StartSidLength is nonzero, the server SHOULD enumerate the quota information entries for the SIDs following the StartSid.

  • If StartSidLength or StartSidOffset or SidListLength are nonzero, the server MUST ignore the value of RestartScan.

  • If StartSidLength and StartSidOffset and SidListLength are all zero, the server MUST check the value of RestartScan. If RestartScan is TRUE, the server MUST set Open.CurrentQuotaIndex to 1. The server MUST use Open.CurrentQuotaIndex as the starting index in FullQuotaList to enumerate the quota information entries until the buffer is full or has run out of the quota information entries in FullQuotaList. Open.CurrentQuotaIndex MUST be incremented by the number of quota information entries returned to the client.

The server MUST return STATUS_SUCCESS if at least one FILE_QUOTA_INFORMATION entry is returned.

If the OutputBufferLength given in the client request is either zero or is insufficient to hold single FILE_QUOTA_INFORMATION entry, the server MUST fail the request with STATUS_BUFFER_TOO_SMALL and return error data, as specified in section 2.2.2, with ByteCount set to zero.

If the underlying object store returns STATUS_NO_MORE_ENTRIES, indicating that no information was returned, the server MUST set the same error in the Status field of the SMB2 header. The server MUST also construct an SMB2 QUERY_INFO Response with OutputBufferOffset, OutputBufferLength and Buffer set to 0.

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

If the underlying object store returns the information successfully, the server MUST construct an SMB2 QUERY_INFO Response with the following values:

  • OutputBufferOffset MUST be set to the offset, in bytes, from the beginning of the SMB2 header to the attribute data at Buffer[].

  • OutputBufferLength MUST be set to the length of the attribute data being returned to the client.

  • The data MUST be placed in the response in Buffer[].

The response MUST then be sent to the client.