Hi, samba 4.6.5 seems to have broken the get quota command. I can't tell in which version this problem surfaced but I can tell that it still kind of worked in 4.2.12. The problem is that the command does not get called with the proper arguments, according to the manpage it is still a combination of either 1 or 3 as query type and the uid/gidnumber or 2 or 4 with -1 as uid/gidnumber. The behavoiur in samba 4.2.12 is to combine 2 or 4 as type of query with a correct uid/gidnumber which is wrong but at least can be worked around in the script: [2017/07/03 11:52:31.582927, 3, pid=11520, effective(1001, 1000), real(1001, 0), class=quota] ../source3/lib/sysquotas.c:218(command_get_quota) get_quota: Running command /usr/local/bin/getsambaquota.pl . 2 1001 It is worse in 4.6.5 - the query type is correct now but there is no uidnumber in the call: [2017/07/03 11:56:22.372398, 3, pid=15426, effective(1001, 1000), real(1001, 0), class=quota] ../source3/lib/sysquotas.c:273(command_get_quota) get_quota: Running command /usr/local/bin/getsambaquota.pl . 1 -1 [2017/07/03 11:56:22.209320, 3, pid=15426, effective(1001, 1000), real(1001, 0), class=quota] ../source3/lib/sysquotas.c:273(command_get_quota) get_quota: Running command /usr/local/bin/getsambaquota.pl . 3 -1 which is why the script fails since it obviously can't tell the quota without a proper uidnumber.
the uid is "-1" if the quota type is SMB_USER_FS_QUOTA_TYPE, which means it asks for the quota of the calling user. The uid is only the actual user's uid if the quota type is SMB_USER_QUOTA_TYPE, which is usually when the quota command is used to query the quota of a different user. Yes, this is a bit confusing but this is how it is designed. Your quota script needs to be fixed accordingly.