# Permissions of objects within shared repo

4 messages from 2009-05-01 to 2009-05-01. Participants: Adam Mercer, Johannes Schindelin, Brandon Casey.
Thread: https://gitlist.dev/t/19142

## Adam Mercer, 2009-05-01 01:49

Subject: Permissions of objects within shared repo
Message-ID: <799406d60904301849t1e77e81bgc6d58ecd0e9d6b7d@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60904301849t1e77e81bgc6d58ecd0e9d6b7d%40mail.gmail.com

```
Hi

We have a shared repository with the following config:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
        sharedrepository = 1
[receive]
        denyNonFastforwards = true

Users push their commits to the repository over ssh, all users are in
group 1000 and so far everything seems to be working OK. However I
have noticed that something seems to be strange with the permissions
of the objects, e.g.:

[ram@g3 ~]$ cd /path/to/repo.git/objects/00/
[ram@g3 00]$ ls -l
total 43
-r--r--r--+ 1 user1           1000  2729 Apr 19 13:13
028ade623678384fca34c51e0ea3ae91b8a50d
-r--r--r--+ 1 user1           1000 10697 Apr 20 21:19
0d9f5769a65081bf95d64b0a23b62b55095f2f
-r--r--r--+ 1 user2           1000   297 Apr 17 10:00
2b3138d14b41d5a01308edd32e8af5ad4c4886
-r--r--r--+ 1 user3           1000   169 Apr  9 12:03
8ab284186f0ceb450d86e3ff1eca486eb6f5b3
-r--r--r--+ 1 user4           1000   846 Apr 27 16:51
90192a4a1843e5849129312ac3bc98766c4c85
-r--r--r--+ 1 user5           1000   602 Apr 13 20:37
948b07abc15345dc31a15757cbc248fa95e49e
-r--r--r--+ 1 user4           1000   435 Apr 20 17:44
a30f4ded65434a2a2d050d98657c118665578f
-r--r--r--+ 1 user6           1000   818 Apr 25 04:11
a5fed2108570efb32e6db519cda92b07e91994
-r--r--r--+ 1 user6           1000   169 Apr 26 13:34
a756fb8966f4564e522471230f5bfe72e33776
-r--r--r--+ 1 user7           1000   379 Apr  9 04:59
bb60a52d841151b564267de8c37a2198a5812e
-r--r--r--+ 1 user8           1000   846 Apr 16 10:55
db929d4496f84b5d7e6a5bd9aeda904bf1b3e6
-r--r--r--+ 1 user2           1000  2089 Apr 20 07:24
ddd0edf3c9b1b94e7036f44a65cf71ace1cfb2
[ram@g3 00]$

will this cause a problem when git gc --auto decides its time to put
these loose objects into a pack, i.e. will they be able to be removed?

Cheers

Adam

```

## Johannes Schindelin, 2009-05-01 13:01

Subject: Re: Permissions of objects within shared repo
Message-ID: <alpine.DEB.1.00.0905011500530.10279@pacific.mpi-cbg.de>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0905011500530.10279%40pacific.mpi-cbg.de
In-Reply-To: <799406d60904301849t1e77e81bgc6d58ecd0e9d6b7d@mail.gmail.com>

```
Hi,

On Thu, 30 Apr 2009, Adam Mercer wrote:

> We have a shared repository with the following config:
> 
> [core]
>         repositoryformatversion = 0
>         filemode = true
>         bare = true
>         sharedrepository = 1
> [receive]
>         denyNonFastforwards = true
> 
> Users push their commits to the repository over ssh, all users are in
> group 1000 and so far everything seems to be working OK. However I
> have noticed that something seems to be strange with the permissions
> of the objects, e.g.:
> 
> [ram@g3 ~]$ cd /path/to/repo.git/objects/00/
> [ram@g3 00]$ ls -l
> total 43
> -r--r--r--+ 1 user1           1000  2729 Apr 19 13:13
> 028ade623678384fca34c51e0ea3ae91b8a50d

Objects are immutable.  So they do not need to be writable at all.

Hth,
Dscho

```

## Brandon Casey, 2009-05-01 13:58

Subject: Re: Permissions of objects within shared repo
Message-ID: <b_0Yr2BIOq-ZcTAxvkSlKVaJjU1_GJhkRLKGCkG7Uj5ft73JWFjWlA@cipher.nrlssc.navy.mil>
URL: https://gitlist.dev/e/b_0Yr2BIOq-ZcTAxvkSlKVaJjU1_GJhkRLKGCkG7Uj5ft73JWFjWlA%40cipher.nrlssc.navy.mil
In-Reply-To: <799406d60904301849t1e77e81bgc6d58ecd0e9d6b7d@mail.gmail.com>

```
Adam Mercer wrote:

> [ram@g3 ~]$ cd /path/to/repo.git/objects/00/
> [ram@g3 00]$ ls -l
> total 43
> -r--r--r--+ 1 user1           1000  2729 Apr 19 13:13
> 028ade623678384fca34c51e0ea3ae91b8a50d

> will this cause a problem when git gc --auto decides its time to put
> these loose objects into a pack, i.e. will they be able to be removed?

On POSIX filesystems it's the _directory_ permissions which control whether
or not the directory contents can be deleted.

Do:

   ls -ld /path/to/repo.git/objects/00/

and you should see that the group has write permission to this directory
which will allow group members to delete files residing in the directory.

-brandon

```

## Adam Mercer, 2009-05-01 15:15

Subject: Re: Permissions of objects within shared repo
Message-ID: <799406d60905010815h634638f6hf5aa0f149f627607@mail.gmail.com>
URL: https://gitlist.dev/e/799406d60905010815h634638f6hf5aa0f149f627607%40mail.gmail.com
In-Reply-To: <alpine.DEB.1.00.0905011500530.10279@pacific.mpi-cbg.de>

```
On Fri, May 1, 2009 at 08:01, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:

> Objects are immutable.  So they do not need to be writable at all.

On Fri, May 1, 2009 at 08:58, Brandon Casey <casey@nrlssc.navy.mil> wrote:

> On POSIX filesystems it's the _directory_ permissions which control whether
> or not the directory contents can be deleted.
>
> Do:
>
>   ls -ld /path/to/repo.git/objects/00/
>
> and you should see that the group has write permission to this directory
> which will allow group members to delete files residing in the directory.

Of course, thanks! Sorry for the noise.

Cheers

Adam

```
