From 433775a809dc9722b4a467364b2208f50ef8df24 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 30 Aug 2016 13:32:01 +0000 Subject: Merge branch 'fix-backup-restore' into 'master' lib/backup: fix broken permissions when creating repo dir ## What does this MR do? This MR fixes an issue where gitlab:backup:restore will not work because the repositories directory is set up with bad permissions. The bad permissions will prevent access to the repositories by the git user, causing all kinds of troubles (e.g. gitlab-shell won't install hooks). ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Rake task gitlab:backup:restore would complete successfully, but gitlab:check will report errors and gitlab cannot access repos. ## Screenshots (if relevant) * repositories.old.1472478726 was created without the fix * repositories was created with the fix ![gitlab-repo-permissions](/uploads/6cf2de57fe4f1be0bd5b5e1a13234889/gitlab-repo-permissions.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? See merge request !6098 --- CHANGELOG | 7 +++++++ lib/backup/repository.rb | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index a9c07295d52..4ae21c171e7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,13 @@ v 8.11.4 - Fix issue boards leak private label names and descriptions v 8.11.3 + +v 8.11.4 (unreleased) + - Fix broken gitlab:backup:restore because of bad permissions on repo storage !6098 (Dirk Hörner) + +v 8.11.3 (unreleased) + - Allow system info page to handle case where info is unavailable + - Label list shows all issues (opened or closed) with that label - Don't show resolve conflicts link before MR status is updated - Fix IE11 fork button bug !5982 - Don't prevent viewing the MR when git refs for conflicts can't be found on disk diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb index f117fc3d37d..9fcd9a3f999 100644 --- a/lib/backup/repository.rb +++ b/lib/backup/repository.rb @@ -55,7 +55,7 @@ module Backup bk_repos_path = File.join(path, '..', 'repositories.old.' + Time.now.to_i.to_s) FileUtils.mv(path, bk_repos_path) # This is expected from gitlab:check - FileUtils.mkdir_p(path, mode: 2770) + FileUtils.mkdir_p(path, mode: 02770) end Project.find_each(batch_size: 1000) do |project| -- cgit v1.2.1