In smb.conf(5) for get quota command parameter, ----- The type of query can be one of : o 1 - user quotas o 2 - user default quotas (uid = -1) o 3 - group quotas o 4 - group default quotas (gid = -1) ----- This should be: ----- The type of query can be one of : o 1 - user default quotas (uid = -1) o 2 - user quotas o 3 - group default quotas (gid = -1) o 4 - group quotas ----- Because in include/ntquotas.h, SMB_QUOTA_TYPE is defined as: ----- enum SMB_QUOTA_TYPE { SMB_INVALID_QUOTA_TYPE = -1, SMB_USER_FS_QUOTA_TYPE = 1, SMB_USER_QUOTA_TYPE = 2, SMB_GROUP_FS_QUOTA_TYPE = 3,/* not used yet */ SMB_GROUP_QUOTA_TYPE = 4 /* not in use yet, maybe for disk_free queries */ }; ----- and smbcquotas command which has just used the definition above works well.
In smb.conf(5) for get quota command parameter, ----- This script should print one line as output with spaces between the arguments. The arguments are: o Arg 1 - quota flags (0 = no quotas, 1 = quotas enabled, 2 = quotas enabled and enforced) ----- is invalid. In lib/sysquotas.c, ----- 222 DEBUG (3, ("Read output from get_quota, \"%s\"\n", line)); 223 224 /* we need to deal with long long unsigned here, if supported */ 225 226 dp->qflags = (enum SMB_QUOTA_TYPE)strtoul(line,&p2, 10); 227 p = p2; ----- this shows the 1st argument of "get quota command" should be one of SMB_QUOTA_TYPE, not "quota flags".
(In reply to comment #0) > In smb.conf(5) for get quota command parameter, > > ----- > The type of query can be one of : > o 1 - user quotas > o 2 - user default quotas (uid = -1) > o 3 - group quotas > o 4 - group default quotas (gid = -1) > ----- > > This should be: > > ----- > The type of query can be one of : > o 1 - user default quotas (uid = -1) > o 2 - user quotas > o 3 - group default quotas (gid = -1) > o 4 - group quotas > ----- > > Because in include/ntquotas.h, SMB_QUOTA_TYPE is defined as: > > ----- > enum SMB_QUOTA_TYPE { > SMB_INVALID_QUOTA_TYPE = -1, > SMB_USER_FS_QUOTA_TYPE = 1, > SMB_USER_QUOTA_TYPE = 2, > SMB_GROUP_FS_QUOTA_TYPE = 3,/* not used yet */ > SMB_GROUP_QUOTA_TYPE = 4 /* not in use yet, maybe for disk_free queries > */ > }; > ----- > > and smbcquotas command which has just used the definition above works well. I'm not sure about that. Metze that patch is initially from you says git, what do you think about the proposed fix ? :-) > 226 dp->qflags = (enum SMB_QUOTA_TYPE)strtoul(line,&p2, 10); > 227 p = p2; > ----- > > this shows the 1st argument of "get quota command" should be one of > SMB_QUOTA_TYPE, not "quota flags". I think the enum cast is not quite right here, uint32 would fit better.
the wrong cast is fixed with 4.0 and the docu is also improved now, so I close this one now, hope things are okay now,