summaryrefslogtreecommitdiff
path: root/lib/backup
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-29 11:18:55 +0200
committerJacob Vosmaer <contact@jacobvosmaer.nl>2015-07-29 11:18:55 +0200
commitc5aae3077335ab0eaafb73f51548d4c85413a1d1 (patch)
tree62bd9db97d6c60fcb0f4be8e8ac77226750fbb5e /lib/backup
parent5efb58b09a9c0c794a66ae0b46df4c7d58064b60 (diff)
downloadgitlab-ce-c5aae3077335ab0eaafb73f51548d4c85413a1d1.tar.gz
Set internal backup directory modes on create
This sidesteps problems with running 'chmod' on some CIFS mounts.
Diffstat (limited to 'lib/backup')
-rw-r--r--lib/backup/database.rb2
-rw-r--r--lib/backup/manager.rb2
-rw-r--r--lib/backup/repository.rb2
-rw-r--r--lib/backup/uploads.rb2
4 files changed, 3 insertions, 5 deletions
diff --git a/lib/backup/database.rb b/lib/backup/database.rb
index c5a5396cbbf..8450019980f 100644
--- a/lib/backup/database.rb
+++ b/lib/backup/database.rb
@@ -7,7 +7,7 @@ module Backup
def initialize
@config = YAML.load_file(File.join(Rails.root,'config','database.yml'))[Rails.env]
@db_dir = File.join(Gitlab.config.backup.path, 'db')
- FileUtils.mkdir_p(@db_dir) unless Dir.exists?(@db_dir)
+ FileUtils.mkdir_p(@db_dir, mode: 0700)unless Dir.exists?(@db_dir)
end
def dump
diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb
index 6fa2079d1a8..9ae4b346436 100644
--- a/lib/backup/manager.rb
+++ b/lib/backup/manager.rb
@@ -16,8 +16,6 @@ module Backup
file << s.to_yaml.gsub(/^---\n/,'')
end
- FileUtils.chmod(0700, folders_to_backup)
-
# create archive
$progress.print "Creating backup archive: #{tar_file} ... "
orig_umask = File.umask(0077)
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index dfb2da9f84e..36d43d62982 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -130,7 +130,7 @@ module Backup
def prepare
FileUtils.rm_rf(backup_repos_path)
- FileUtils.mkdir_p(backup_repos_path)
+ FileUtils.mkdir_p(backup_repos_path, mode: 0700)
end
def silent
diff --git a/lib/backup/uploads.rb b/lib/backup/uploads.rb
index bf43610acf6..ed445f79084 100644
--- a/lib/backup/uploads.rb
+++ b/lib/backup/uploads.rb
@@ -10,7 +10,7 @@ module Backup
# Copy uploads from public/uploads to backup/uploads
def dump
- FileUtils.mkdir_p(backup_uploads_dir)
+ FileUtils.mkdir_p(backup_uploads_dir, mode: 0700)
FileUtils.cp_r(app_uploads_dir, backup_dir)
end