Commit 73c8ea9c authored by Jacob Vosmaer's avatar Jacob Vosmaer

Use safer shell invocations in bin/install

parent 42571190
...@@ -10,18 +10,18 @@ config = GitlabConfig.new ...@@ -10,18 +10,18 @@ config = GitlabConfig.new
key_dir = File.dirname("#{config.auth_file}") key_dir = File.dirname("#{config.auth_file}")
commands = [ commands = [
"mkdir -p #{config.repos_path}", %W(mkdir -p #{config.repos_path}),
"mkdir -p #{key_dir}", %W(mkdir -p #{key_dir}),
"chmod 700 #{key_dir}", %W(chmod 700 #{key_dir}),
"touch #{config.auth_file}", %W(touch #{config.auth_file}),
"chmod 600 #{config.auth_file}", %W(chmod 600 #{config.auth_file}),
"chmod -R ug+rwX,o-rwx #{config.repos_path}", %W(chmod -R ug+rwX,o-rwx #{config.repos_path}),
"find #{config.repos_path} -type d -print0 | xargs -0 chmod g+s" %W(find #{config.repos_path} -type d -exec chmod g+s {} ;)
] ]
commands.each do |cmd| commands.each do |cmd|
print "#{cmd}: " print "#{cmd.join(' ')}: "
if system(cmd) if system(*cmd)
puts 'OK' puts 'OK'
else else
puts 'Failed' puts 'Failed'
......
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