Group quota with Linux

joost joost at
Sun Jul 23 12:13:44 GMT 2000

Dear Samba team,

I have been running samba 2.0.7 with quota support enabled. It works
fine, but I think it needs to be improved.
Samba is checking user quota, so it limits the total diskspace a user
can use on all shares together. However, this is not the most logical
approach. Setting limits on a share basis is more logical and intuitive
for the user. The share represents a logical disk with a fixed capacity,
like any physical disk in the system.
By changing quota.c to check group quota instead of user quota, I found
an easy way to accomplish this.
RedHat Linux works with the User Private Group scheme (UPG). Every user
has a private group with the same name as the user itself and a default
umask of 002. This allows for setting a quotum on the group, having user
quota support completely switched off. Also, a quotum can be set on a
group share which is writable for all members of that group.

As an example for putting quota on group shares, this would make a share
for the company's website:

force create mode = 660
force directory mode = 660
#note: Makes samba behave similar to umask 002

    comment = The company's website
    path = /home/httpd/html
    writable = yes
    force group = +www

Change the group of /home/httpd/html and all directories and files below
to www, and set the sgid bit on the directories to make it compatible
with the UPG scheme.
Note that the user must be a member of group www to have access and that
all newly created files are owned by group www. The disk size reported
by the windows client is equal to the quotum set on group www.

I suggest quota.c should be changed to check both user and group quota
and report the smallest value of the two. This way it reflects much
better the actual quota on the unix system.
Smbd should have a configure option to conform to the UPG scheme, with a
default create/directory mode of 660 and do an automatic 'force group'
by checking the sgid bit on the directory. This would also make it
possible to implement different group access rights in subdirectories,
much more like NT does. Together with quota support, I think these
changes would make Samba much more competitive with NT server.

I would like to contribute code, but I have very little experience in
programming on unix, so I hope someone else will pick this up.

Best Regards,
Joost Ruijsch

More information about the samba mailing list