threads / discuss / 19142

Permissions of objects within shared repo

Subject: Permissions of objects within shared repo

## tl;dr

4 messages between May 1, 2009 and May 1, 2009.

replies: 3people: 3as markdown or json

Adam Mercer· May 1, 2009, 01:49 UTC · lore
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· May 1, 2009, 13:01 UTC · re: Adam Mercer · lore

Re: Permissions of objects within shared repo

Hi,
On Thu, 30 Apr 2009, Adam Mercer wrote:
Show 20 quoted lines
> 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

Adam Mercer· May 1, 2009, 15:15 UTC · re: Johannes Schindelin · lore

Re: Permissions of objects within shared repo

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:
Show 9 quoted lines
> 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
Brandon Casey· May 1, 2009, 13:58 UTC · re: Adam Mercer · lore

Re: Permissions of objects within shared repo

Adam Mercer wrote:
Show 5 quoted lines
> [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

← back to recent threads