diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-03-07 17:18:44 +0100 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2014-03-07 17:18:44 +0100 |
commit | 73c8ea9c0f7fe3d4ab4b829dc348c17e58490ee4 (patch) | |
tree | f256ee7fe52b2c7729ad08f29af0355baf17715d /bin | |
parent | 42571190d1e6f9ae957c66d2786d793d29ae7c2e (diff) | |
download | gitlab-shell-73c8ea9c0f7fe3d4ab4b829dc348c17e58490ee4.tar.gz |
Use safer shell invocations in bin/install
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/install | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bin/install b/bin/install index c55d0da..64ae726 100755 --- a/bin/install +++ b/bin/install @@ -10,18 +10,18 @@ config = GitlabConfig.new key_dir = File.dirname("#{config.auth_file}") commands = [ - "mkdir -p #{config.repos_path}", - "mkdir -p #{key_dir}", - "chmod 700 #{key_dir}", - "touch #{config.auth_file}", - "chmod 600 #{config.auth_file}", - "chmod -R ug+rwX,o-rwx #{config.repos_path}", - "find #{config.repos_path} -type d -print0 | xargs -0 chmod g+s" + %W(mkdir -p #{config.repos_path}), + %W(mkdir -p #{key_dir}), + %W(chmod 700 #{key_dir}), + %W(touch #{config.auth_file}), + %W(chmod 600 #{config.auth_file}), + %W(chmod -R ug+rwX,o-rwx #{config.repos_path}), + %W(find #{config.repos_path} -type d -exec chmod g+s {} ;) ] commands.each do |cmd| - print "#{cmd}: " - if system(cmd) + print "#{cmd.join(' ')}: " + if system(*cmd) puts 'OK' else puts 'Failed' |