File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ def self.install_hook(hook_name)
147147 def self . get_local_config_map
148148 local_config_map = Hash . new { |hash , key | hash [ key ] = { } } # default -- empty hash
149149
150- lines = %x[#{ GitHosting . git_user_runner } 'find #{ GitHosting . repository_base } -type d -name "*.git" -prune -print -execdir git config -f {}/config --get-regexp hooks.redmine_gitolite ";" '] . chomp . split ( "\n " )
150+ lines = %x[#{ GitHosting . git_user_runner } 'find #{ GitHosting . repository_base } -type d -name "*.git" -prune -print -exec git config -f {}/config --get-regexp hooks.redmine_gitolite \\ ; '] . chomp . split ( "\n " )
151151 filesplit = /(\. \/ )*(#{ GitHosting . repository_base } .*?[^\/ ]+\. git)/
152152 cur_repo_path = nil
153153 lines . each do |nextline |
Original file line number Diff line number Diff line change @@ -316,6 +316,11 @@ def self.update_git_exec
316316 f . puts 'else'
317317 f . puts '{'
318318 f . puts ' $command =~ s/\\\\/\\\\\\\\/g;'
319+ # Previous line turns \; => \\;
320+ # If old sudo, turn \\; => "\\;" to protect ';' from loss as command separator during eval
321+ if sudo_version < sudo_version_switch
322+ f . puts ' $command =~ s/(\\\\\\\\;)/"$1"/g;'
323+ end
319324 f . puts ' $command =~ s/"/\\\\"/g;'
320325 f . puts ' exec("sudo -u ' + git_user + ' -i eval \"$command\"");'
321326 f . puts '}'
You can’t perform that action at this time.
0 commit comments