Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Sep 2009 15:18:41 -0700 (PDT)
From:      Nate Eldredge <nate@thatsmathematics.com>
To:        Giulio Ferro <auryn@zirakzigil.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: ZFS group ownership
Message-ID:  <Pine.GSO.4.64.0909151507080.8152@zeno.ucsd.edu>
In-Reply-To: <4AAB8AD0.5010302@zirakzigil.org>
References:  <4AAB8AD0.5010302@zirakzigil.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 12 Sep 2009, Giulio Ferro wrote:

> I don't know if this is the correct list to discuss this matter, if not
> I apologize in advance.

freebsd-questions might have been better, but I don't think you're too far 
off.  It wasn't necessary to post three times though :)

[On UFS, files are created with the same group as the directory that 
contains them.  On ZFS, they are created with the primary group of the 
user who creates them.]

> What I ask now is: is this a bug or a feature?

Both, I think :)

The behavior you describe on UFS (group comes from the directory) is 
standard for BSD-based systems like FreeBSD.  On SysV-based systems, 
however, the default is that the group comes from the user, as you 
describe on ZFS.  ZFS was originally developed for Solaris, a descendent 
of SysV, so it's not surprising that it also has this behavior.  However, 
this is at least a documentation bug, since the open(2) man page describes 
the BSD behavior without mentioning exceptions.

> How can I achieve my goal in ZFS, that is allowing members of the same
> group to operate with the files / dirs they create?

On SysV, you can get BSD-type behavior by setting the sgid bit on the 
directory in question, e.g. "chmod g+s dir".  Then new files will inherit 
their group from the directory.  I suspect this will work on FreeBSD/ZFS 
too even though "chmod g+s" on a directory is undocumented.

-- 

Nate Eldredge
nate@thatsmathematics.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.0909151507080.8152>