Commit 7ed8b76f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'no-chmod-r' into 'master'

Don't use chmod_R for backup tars

When creating backup tar files, only change permissions on the `db`, `uploads`, and `repositories` directories, not their contents.  See https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/1716#note_40472

See merge request !1744
parents d71fbe71 0f78d92e
...@@ -17,7 +17,7 @@ module Backup ...@@ -17,7 +17,7 @@ module Backup
file << s.to_yaml.gsub(/^---\n/,'') file << s.to_yaml.gsub(/^---\n/,'')
end end
FileUtils.chmod_R(0700, %w{db uploads repositories}) FileUtils.chmod(0700, %w{db uploads repositories})
# create archive # create archive
$progress.print "Creating backup archive: #{tar_file} ... " $progress.print "Creating backup archive: #{tar_file} ... "
......
...@@ -87,7 +87,7 @@ describe 'gitlab:app namespace rake task' do ...@@ -87,7 +87,7 @@ describe 'gitlab:app namespace rake task' do
expect(tar_contents).to match('db/') expect(tar_contents).to match('db/')
expect(tar_contents).to match('uploads/') expect(tar_contents).to match('uploads/')
expect(tar_contents).to match('repositories/') expect(tar_contents).to match('repositories/')
expect(tar_contents).not_to match(/^.{4,9}[rwx]/) expect(tar_contents).not_to match(/^.{4,9}[rwx].*(db|uploads|repositories)\/$/)
end end
it 'should delete temp directories' do it 'should delete temp directories' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment