git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: bsd group semantics

From
Jeff King <peff@peff.net>
Date
Mar 31, 2009, 16:08 UTC
Message-ID
<20090331160842.GA9019@coredump.intra.peff.net>
In-Reply-To
<7vvdpp6623.fsf@gitster.siamese.dyndns.org>
On Tue, Mar 31, 2009 at 08:55:00AM -0700, Junio C Hamano wrote:
> IIRC, DIR_HAS_BSD_GROUP_SEMANTICS means you do not have to ask explicitly
> with g+s to the filesystem to use the "subdirectory is owned by the same
> group as its parent" semantics.  On SysV you have to ask; on BSD you do
> not have to (and do not need FORCE_DIR_SET_GID).

OK, I see. Thanks for the explanation. So the test is wrong, since it explicitly checks for g+s, and we only need it sometimes.

> That one was not about "you do not have to ask", but "you are not allowed
> to ask because the request will fail".  Perhaps between FBSD4 and FBSD6
> things changed, and you can now make g+s request (which I presume is still
> a no-op other than setting the bit on)?
Yes, you can ask just fine now:
  $ uname -sr
  FreeBSD 6.1-RELEASE-p17-jc1
  $ mkdir foo
  $ ls -ld foo
  drwxr-xr-x  2 peff  peff  512 Mar 31 09:04 foo/
  $ chmod g+s foo
  $ ls -ld foo
  drwxr-sr-x  2 peff  peff  512 Mar 31 09:04 foo/
But it isn't necessary.
Show 5 quoted lines
> Ideally the test should be checking if the subdirectory is owned by the
> same group as the toplevel, but that is rather hard to correctly arrange,
> as it depends on the set of groups the user who runs the test belongs to,
> how the git work tree is set up (if it is owned by his primary group or a
> secondary), etc.
Shouldn't that just be:
  perl -e 'sub group { return (stat(shift))[5] }' \
       -e 'exit group($ARGV[0]) == group($ARGV[1]) ? 0 : 1' \
       a b
?
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “bsd group semantics”
  1. Jeff KingMar 31, 2009
  2. Junio C HamanoMar 31, 2009
  3. Jeff KingMar 31, 2009
  4. Junio C HamanoMar 31, 2009
  5. Jeff KingMar 31, 2009
  6. Junio C HamanoMar 31, 2009
  7. Jeff KingMar 31, 2009
  8. Junio C HamanoMar 31, 2009
  9. Jeff KingMar 31, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.