[Dovecot] Re: Group-based filesystem quota

Geo Carncross geocar-dovecot at internetconnection.net
Fri Jun 23 18:12:26 EEST 2006


On Fri, 2006-06-23 at 09:27 +0200, Steffen Kaiser wrote:
> On Fri, 23 Jun 2006, Scott Alter wrote:
> 
> > name and the group name must currently be the same.  Does anyone know of a 
> > way to capture the group that the user writes files as?
> 
> Actually, this is not as easy as it sounds, because an user can be member 
> of more than just one group and some filesystems allow to force a 
> particular group on newly created files (e.g. via mount or setgid on the 
> directory). But I suppose that the getegid() style you use in the patch is 
> what most people are using.
> 
> Bye,
> 

Attached is a getfsgid() call that I have used in the past for this very
purpose on Linux. It shouldn't be too hard to make work on other
platforms...

It checks /etc/mtab (should probably also check /etc/mnttab, but none of
my systems use that anymore), checks setgid bit on dir, and falls back
on getegid()

-- 
Internet Connection High Quality Web Hosting
http://www.internetconnection.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: getfsgid.c
Type: text/x-csrc
Size: 1268 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20060623/eb71151c/getfsgid.c


More information about the dovecot mailing list