# [PATCH] don't set-group-id on directories on apple

4 messages from 2007-10-22 to 2007-10-23. Participants: Scott R Parish, Johannes Schindelin, Scott Parish.
Thread: https://gitlist.dev/t/10423

## Scott R Parish, 2007-10-22 07:55

Subject: [PATCH] don't set-group-id on directories on apple
Message-ID: <20071022075459.GA1157@srparish.net>
URL: https://gitlist.dev/e/20071022075459.GA1157%40srparish.net

```
"git init --shared=all" was failing because chmod was returning
EPERM. According to the man page, the set-group-id behavior is
already default: man 2 mkdir:

  The directory's group ID is set to that of the parent directory
  in which it is created.

Signed-off-by: Scott R Parish <srp@srparish.net>
---
 path.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/path.c b/path.c
index 4260952..4089753 100644
--- a/path.c
+++ b/path.c
@@ -282,8 +282,10 @@ int adjust_shared_perm(const char *path)
 			 : (shared_repository == PERM_EVERYBODY
 			    ? (S_IXGRP|S_IXOTH)
 			    : 0));
+#if !defined(__APPLE__)
 	if (S_ISDIR(mode))
 		mode |= S_ISGID;
+#endif
 	if ((mode & st.st_mode) != mode && chmod(path, mode) < 0)
 		return -2;
 	return 0;
-- 
1.5.3.4.209.g5d1ce-dirty

```

## Johannes Schindelin, 2007-10-22 14:16

Subject: Re: [PATCH] don't set-group-id on directories on apple
Message-ID: <Pine.LNX.4.64.0710221234070.25221@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0710221234070.25221%40racer.site
In-Reply-To: <20071022075459.GA1157@srparish.net>

```
Hi,

On Mon, 22 Oct 2007, Scott R Parish wrote:

> "git init --shared=all" was failing because chmod was returning
> EPERM.

Not here.  This is git version 1.5.3.rc4.1716.gc3498, and "uname -a" says

Darwin michael-stirrats-mac-mini.local 8.10.0 Darwin Kernel Version 
8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC 
Power Macintosh powerpc

Is it possible that you have stricter permission settings?  Or that you 
try to re-initialise a repository that somebody else initialised 
originally?

Ciao,
Dscho

```

## Scott Parish, 2007-10-22 14:29

Subject: Re: [PATCH] don't set-group-id on directories on apple
Message-ID: <20071022142945.GO16291@srparish.net>
URL: https://gitlist.dev/e/20071022142945.GO16291%40srparish.net
In-Reply-To: <Pine.LNX.4.64.0710221234070.25221@racer.site>

```
On Mon, Oct 22, 2007 at 03:16:01PM +0100, Johannes Schindelin wrote:

> On Mon, 22 Oct 2007, Scott R Parish wrote:
> 
> > "git init --shared=all" was failing because chmod was returning
> > EPERM.
> 
> Not here.  This is git version 1.5.3.rc4.1716.gc3498, and "uname -a" says
> 
> Darwin michael-stirrats-mac-mini.local 8.10.0 Darwin Kernel Version 
> 8.10.0: Wed May 23 16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC 
> Power Macintosh powerpc

Darwin poplar.local 8.10.1 Darwin Kernel Version 8.10.1: Wed May 23 16:33:00 PDT 2007; root:xnu-792.22.5~1/RELEASE_I386 i386 i386

> Is it possible that you have stricter permission settings?

This is a possibility, but i have no idea what that might be. I've
tried googling around without any luck (except for a post about
reading "mkdir(2)").

> Or that you try to re-initialise a repository that somebody else
> initialised originally?

No, this was a failure when running tests (t1301-shared-repo.sh)

sRp

-- 
Scott Parish
http://srparish.net/

```

## Scott Parish, 2007-10-23 04:30

Subject: Re: [PATCH] don't set-group-id on directories on apple
Message-ID: <20071023043022.GB17089@srparish.net>
URL: https://gitlist.dev/e/20071023043022.GB17089%40srparish.net
In-Reply-To: <20071022142945.GO16291@srparish.net>

```
On Mon, Oct 22, 2007 at 07:29:45AM -0700, Scott Parish wrote:

> On Mon, Oct 22, 2007 at 03:16:01PM +0100, Johannes Schindelin wrote:
> 
> > On Mon, 22 Oct 2007, Scott R Parish wrote:
> > 
> > > "git init --shared=all" was failing because chmod was returning EPERM.
> > 
> > Not here. 
> > 
> > Is it possible that you have stricter permission settings?

I finally figured it out. I keep my home directory encrypted, but
its pretty slow (especially compiles) and i don't care who steals
open source code i'm playing with, so i keep that in /Users/Shared.
Since mkdir() on darwin keeps the parents group by default, the
group on my git clone was wheel, which i'm not a member of.

sRp

-- 
Scott Parish
http://srparish.net/

```
