git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alex Riesen <raa.lkml@gmail.com>, git@vger.kernel.org
Subject: Re: bsd group semantics
Date: Tue, 31 Mar 2009 12:08:42 -0400	[thread overview]
Message-ID: <20090331160842.GA9019@coredump.intra.peff.net> (raw)
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.

> 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

  reply	other threads:[~2009-03-31 16:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-31 11:26 bsd group semantics Jeff King
2009-03-31 15:55 ` Junio C Hamano
2009-03-31 16:08   ` Jeff King [this message]
2009-03-31 17:32     ` Junio C Hamano
2009-03-31 18:46       ` Jeff King
2009-03-31 20:26         ` Junio C Hamano
2009-03-31 20:36           ` Jeff King
2009-03-31 21:33             ` Junio C Hamano
2009-03-31 22:25               ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090331160842.GA9019@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=raa.lkml@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).