From 2d5a6fc850844fb30c94c749fed5564f54052b77 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 26 Nov 2012 13:07:16 +0200 Subject: [PATCH] Fix dir permission on creation --- app/models/namespace.rb | 2 +- lib/gitlab/project_mover.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/namespace.rb b/app/models/namespace.rb index 7fe864403..013660406 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -44,7 +44,7 @@ class Namespace < ActiveRecord::Base def ensure_dir_exist namespace_dir_path = File.join(Gitlab.config.git_base_path, path) - Dir.mkdir(namespace_dir_path, 0770) unless File.exists?(namespace_dir_path) + system("mkdir -m 770 #{namespace_dir_path}") unless File.exists?(namespace_dir_path) end def move_dir diff --git a/lib/gitlab/project_mover.rb b/lib/gitlab/project_mover.rb index 4ee50a1ae..4b23a5461 100644 --- a/lib/gitlab/project_mover.rb +++ b/lib/gitlab/project_mover.rb @@ -16,7 +16,7 @@ module Gitlab def execute # Create new dir if missing new_dir_path = File.join(Gitlab.config.git_base_path, new_dir) - Dir.mkdir(new_dir_path, 0770) unless File.exists?(new_dir_path) + system("mkdir -m 770 #{new_dir_path}") unless File.exists?(new_dir_path) old_path = File.join(Gitlab.config.git_base_path, old_dir, "#{project.path}.git") new_path = File.join(new_dir_path, "#{project.path}.git") -- 2.11.0