Backup restore not setting correct permissions on /home/git/repositories/
Created by: d1
I'm using an internally developed Chef cookbook to build gitlab v6.4.3 and I'm seeing the backup restore process not set the correct permissions on /home/git/repositories/
.
Steps To Reproduce:
# Build a fresh instance
$ vagrant destroy && vagrant up && vagrant ssh
$ cd /home/git/gitlab
# Run gitlab:check, all checks should pass
$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# Copy a backup into place and restore
$ sudo -u git -H cp /vagrant/<timestamp>_gitlab_backup.tar /home/git/gitlab/tmp/backups/
$ sudo -u git -H bundle exec rake gitlab:backup:restore RAILS_ENV=production
# Re-run gitlab:check, the check of permissions on /home/git/gitlab should fail
$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
After the restore, the permissions look like this:
$ ls -l /home/git/
...
drwxrwxr-x 5 git git 4096 Jan 15 11:12 repositories
drwxrws--- 3 git git 4096 Jan 15 11:01 repositories.old.1389805956
Running the commands suggested by the check, or re-converging the node via Chef, will fix the permissions.
I'm assuming this is because the restore moves the current /home/git/repositories/
to /home/git/repositories.old.<timestamp>/
and then creates a new /home/git/repositories/
. It also could be that the backup creation should be capturing the permissions acurately.
I'll look deeper and submit a PR unless someone can tell me I'm crazy or doing something wrong.