gitblit icon indicating copy to clipboard operation
gitblit copied to clipboard

Repository permission problem

Open ts65 opened this issue 4 years ago • 1 comments

I use Gitblit GO on a Ubuntu server to allow https access to the repositories additionally to the previous ssh access without Gitblit. The repository is setup as shared but the files in /logs/refs/heads have incorrect file permissions. Gitblit runs as service with gitblit user (who is a member of git group).

Steps to reproduce:

  • create repository with git init --bare --shared=0660 (I've done it via ssh but git.createRepositoriesShared=0660 is set too)
  • clone with https over gitblit
  • push changes
  • /logs/refs/heads/master has 644 permission with owner gitblit and group git instead of 660
  • clone with another user in git group. f.e. git via ssh (without Gitblit)
  • push changes
  • error because /logs/refs/heads/master is not writable for group

Any ideas how to solve this (preferably without changing default umask)? Thanks in advance

ts65 avatar Feb 25 '21 11:02 ts65

Excellent question. I am not sure why that is. One thing contributing could be that on Ubuntu normal users have a umask of 0002, while the Gitblit service, which probably was started in a system context, will have umask 0022. But I just tested and disabled USERGROUPS_ENAB, logged in via SSH and verified that the umask was 0022. Nevertheless a push via Ssh resulted in 0660.

But why set the default umask? It should be enough to set the umask of the Gitblit process to 0002. For example in the gitblit.sh script or the init script or however it is started.

flaix avatar Nov 23 '22 22:11 flaix