quota group

Massimo Del Sarto massimo.delsarto at inpe.unipi.it
Wed Mar 5 12:42:28 GMT 2003


At 21.55 05/03/2003 +1100, Andrew Bartlett wrote:
>On Wed, 2003-03-05 at 20:32, Massimo Del Sarto wrote:
> > I use samba on redhat linux (7.1)
> > For default in redhat each user has also his own group.
> >
> > I created a new group for each samba share that I defined so I can control
> > which users can access to the shares, but if I use the user quota I can't
> > control the quota on this shares.
> > Using a group quota I can assign separate quota to each share (the shares
> > are on the same HD partition):
> > - each user has a quota on the home share
> > - each "not home" share has its own quota
> >
> > The only problem is that I can't see the quota in windows box. So I
> > modified the smbd/quotas.c to read the quota group associated to the group
> > of the file/directory if the user quota result is 0 (zero). I added a
> > parameter to the function get_smb_linux_* to get an user or a group quota.
>
>Wouldn't it be better to report the smaller of the two quotas?

I forgotten:
- All user have umask set to 002;
- In (not home) share I sgid the directory with "chmod 2770 <share dir>" 
and assign a group at this directory (chgrp <share group> <share dir>).
- In the smb.conf I use "inherit permissions = Yes" in the share definition.
So each files that are created are forced to have the same group of the 
parent directory
In the home directory the files have the gid equal to the uid. In not home 
(share) directory the files have the gid equal to the group that i created 
for this share.

The result of user quota is 0 (zero) because the user quota are set to 0 
(No limit in the user quota) so I can't report a value of 0. Only the group 
quota is set to a value > 0

My patch is tested only in rehat 7.1  and work only on linux. A "lot" of 
work must done to extended my idea to all the O.S.
Can Stefan Metzmacher do this work and insert in on own patch?

         Massimo




> > I attach the output of the commnad:
> > diff -u -r samba-2.2.7a/source/smbd/quotas.c
> > samba-2.2.7amds/source/smbd/quotas.c
> >
> >
> > --- samba-2.2.7a/source/smbd/quotas.c   Wed Dec 11 10:17:40 2002
> > +++ samba-2.2.7amds/source/smbd/quotas.c        Tue Mar  4 09:43:05 2003
> > @@ -66,13 +66,18 @@
> >    Abstract out the XFS Quota Manager quota get call.
> > 
> ****************************************************************************/
> >
> > -static int get_smb_linux_xfs_quota(char *path, uid_t euser_id,
> > LINUX_SMB_DISK_QUOTA *dp)
> > +static int get_smb_linux_xfs_quota(char *path, uid_t euser_id,
> > LINUX_SMB_DISK_QUOTA *dp, char type )
>
>Make this a BOOL for type 'group_quota' or even better an enum with
>values 'USER_QUOTA, GROUP_QUOTA'.
>
>If you can repatch this against HEAD, and check with metze (Stefan
>(metze) Metzmacher <metze at metzemix.de>) on how this might conflict with
>his work in this area.  In particular, it might work out best that metze
>picks this up into his patch.  (He is working on being able to modify
>the quota from an Windows client!).
>
>Either way, this certainly is a very nice idea!
>
>Andrew Bartlett
>
>--
>Andrew Bartlett                                 abartlet at pcug.org.au
>Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
>Student Network Administrator, Hawker College   abartlet at hawkerc.net
>http://samba.org     http://build.samba.org     http://hawkerc.net

----------------------------------------------------------
Ing. Massimo Del Sarto                   Capo Ufficio CED
IRCCS Fondazione Stella Maris    http://www.inpe.unipi.it
Tel. +39 050 886268                    Fax. +39 050 32214
---------------------------------------------------------- 



More information about the samba-technical mailing list