Bug 12270 - smbcquotas cannot list quotas against a Windows server
Summary: smbcquotas cannot list quotas against a Windows server
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.5.0
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-16 18:56 UTC by Uri Simchoni
Modified: 2016-10-24 09:26 UTC (History)
1 user (show)

See Also:


Attachments
git-am fix for 4.5.next (3.15 KB, patch)
2016-10-04 19:40 UTC, Uri Simchoni
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Uri Simchoni 2016-09-16 18:56:33 UTC
When running the following command against a Windows 2012R2 server, the command fails, even if volume quotas are enabled (e.g. individual user's quota can be queried).

smbcquotas -L -U <user>%<password> //<server-ip>/C$

The output is:
NT_TRANSACT_GET_USER_QUOTA failed: NT_STATUS_NO_MORE_ENTRIES
NT_STATUS_NO_MORE_ENTRIES cli_set_user_quota <user>

The bug is both in the failure, and also the failure message (cli_set_user_quota) is wrong.
Comment 1 Uri Simchoni 2016-09-22 13:58:56 UTC
*** Bug 12288 has been marked as a duplicate of this bug. ***
Comment 2 Uri Simchoni 2016-09-22 14:06:01 UTC
(piling some more trivial bugs on this one, because smbcquotas is probably not a heavily used tool and the overhead of dealing with several bugs is not worth it)

So in addition to the failure against Windows and the wrong error message, the following is noted as well:

Wrong param count in setting fs quota
======================================
When running the command below, the TRANS2 SMB1 command contains a wrong number of parameters, which also results in out-of-bounds memory read while sending the data on the wire.

Windows and Samba servers ignore this so no functional impact is observed other than the valgrind complaint.

smbcquotas -S 'FSGLAGS:QUOTA_ENABLED' -U <credentials> //server/share

Possible crash when listing user quota, if zero quota records are returned
============================================================================
Well, the heading says it.
Comment 3 Uri Simchoni 2016-10-04 19:40:58 UTC
Created attachment 12544 [details]
git-am fix for 4.5.next
Comment 4 Uri Simchoni 2016-10-04 19:43:43 UTC
(In reply to Uri Simchoni from comment #2)
In response to comments by Team members, the additional bugs have been "unpiled" and assigned their own bugs.
Comment 5 Jeremy Allison 2016-10-05 20:43:22 UTC
Re-assigning to Karolin for inclusion in 4.5.next.
Comment 6 Karolin Seeger 2016-10-19 07:47:12 UTC
(In reply to Jeremy Allison from comment #5)
Pushed to autobuild-v4-5-test.
Comment 7 Karolin Seeger 2016-10-24 09:26:52 UTC
(In reply to Karolin Seeger from comment #6)
Pushed to v4-5-test.
Closing out bug report.

Thanks!