Sachin,

Regarding the SMB NT_TRANSACT_QUERY_QUOTA behavior, please find my answers as 
follows.
-       SidListLength is the length, in bytes, of the SidList array. It is NOT 
the count of SID entries. 
-       This is legacy code and Windows server behavior appears to deviate from 
the current specification. A document update with a behavior note will appear 
in a future release of MS-SMB to clarify Section 3.3.5.11.2   Receiving an 
NT_TRANS_QUERY_QUOTA Request.

When the SidList is not empty, Windows server does the following validations:
-       Bound checks of StartSidOffset, StartSidLength and SidListLength with 
respect to the DataCount field of the Query Quota Transaction;
-       Check that StartSidOffset is greater or equal to SidListLength.

If any of preceding checks fails, the Windows-based SMB server passes an empty 
SidList to the object store. The object store then enumerates and returns quota 
information for all SIDs on the file. If in addition ReturnSingleEntry is 
enabled, the object store returns quota information of the first SID in its 
list.

This explains the observed behavior in the network trace you provided where 
StartSidOffset (0) is less than SidListLength (1), even if the SidListLength 
should have been the number of bytes in SidList. 

Based on this clarification of Windows server implementation, I’d expect that 
to query quota information for a set of SIDs specified in SidList, a client can 
supply StartSidLength set to zero and StartSidOffset set to SidListLength (see 
validation checks). 

The object store algorithm is described in MS-FSA 2.1.5.20 Server Requests 
Querying Quota Information.

NOTE that non-Windows SMB server implementations may perform different 
validation checks.

Thanks,
Edgar

-----Original Message-----
From: Edgar Olougouna 
Sent: Thursday, January 10, 2013 11:59 AM
To: Sachin Prabhu; MSSolve Case Email
Cc: [email protected]; Christopher R. Hertel; [email protected]
Subject: RE: [REG:113011010129260] NT_TRANSACT_QUERY_QUOTA: Help needed

Hello Sachin,

I will have a look and follow-up.

Thank you,
Edgar

-----Original Message-----
From: Bryan Burgin 
Sent: Thursday, January 10, 2013 11:32 AM
To: Sachin Prabhu; MSSolve Case Email
Cc: [email protected]; Christopher R. Hertel; [email protected]
Subject: [REG:113011010129260] NT_TRANSACT_QUERY_QUOTA: Help needed

[dochelp to bcc]
[adding case mail]

Hi Sachin,

Thank you for your question.  We created the case SR 113011010129260 to track 
this issue.  An engineer from the Protocols Team will contact you soon.

Bryan



-----Original Message-----
From: Sachin Prabhu [mailto:[email protected]] 
Sent: Thursday, January 10, 2013 6:43 AM
To: Interoperability Documentation Help
Cc: [email protected]; Christopher R. Hertel; [email protected]
Subject: NT_TRANSACT_QUERY_QUOTA: Help needed

Hello,

I am attempting to implement a function in the cifs linux kernel module to 
obtain the Quota information for the a SID from the server and seem to have hit 
a road block. Could someone please review the request and responses I receive 
and suggest any changes resulting out of me misinterpreting the document.
I use the NT Transact Subcommand - NT_TRANSACT_QUERY_QUOTA as documented at 
http://msdn.microsoft.com/en-us/library/cc246309.aspx

The current status of the project is that we can query the server for quota 
information on a particular file which results in the Quota information for all 
users returned by the server.

However I am facing problems when I attempt to restrict the SIDs I obtain the 
quota for. I would like the server to return the quota information only for the 
SIDs I pass to it. However it instead returns quota information for all SIDs. 
According to the document linked above, it should be possible to request Quota 
information only for the specified SIDs. 

The tcpdump from the query is available at 
http://people.redhat.com/sprabhu/quota.pcap

The NT Transact Parameters set are
ReturnSingleEntry 0,<- I may request multiple SIDs so have set this to 0 
RestartScan 0, SidListLength 1,<- I have a single SID in the list at the moment.
StartSidLength 0,<- This is set to 0 since I have SidListLength set to 1 
StartSidOffset 0 In this case, I receive the quota information for all SIDs on 
the server.

I have tried the following too:
ReturnSingleEntry 1, This results in only 1 SID being returned. This however is 
the first SID on the list returned by the server as above but one which isn't 
what I want. ie. it returns quota information for
S-1-5-32-544 instead of for SID
S-1-5-21-1322539220-2955252235-775258050-1105.

Set SidListLength to 0 and set StartSidLength to a non zero value. This always 
returns an Invalid SID error.

Set SidListLength to the length in bytes instead of the list length and still 
receive the same result.

Could someone please point out the problem in this request.

Sachin Prabhu




_______________________________________________
cifs-protocol mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/cifs-protocol

Reply via email to