Skip to content
This repository
Browse code

Escape filenames during the install process. Fixes #196

  • Loading branch information...
commit 9e469faf7df269c4585cfb67e87f4c5276fb52f0 1 parent 918e8c9
Jordan Sissel authored

Showing 1 changed file with 7 additions and 7 deletions. Show diff stats Hide diff stats

  1. +7 7 templates/rpm.erb
14 templates/rpm.erb
@@ -60,15 +60,15 @@ Obsoletes: <%= repl %>
60 60
61 61 %install
62 62 <% files.each do |path| -%>
63   -<% source = File.join(staging_path, path) -%>
  63 +<% source = Shellwords.shellescape(File.join(staging_path, path)) -%>
64 64 <% # Copy to the build_path/BUILD/ to make rpmbuild happy -%>
65   -<% target = File.join(build_path, "BUILD", path) -%>
  65 +<% target = Shellwords.shellescape(File.join(build_path, "BUILD", path)) -%>
66 66 <% dir = File.dirname(target) %>
67   -mkdir -p "<%= dir %>"
68   -if [ -f "<%= source %>" ] || [ -h "<%= source %>" ] ; then
69   - cp -d "<%= source %>" "<%= target %>"
70   -elif [ -d "<%= source %>" ] ; then
71   - mkdir "<%= target %>"
  67 +mkdir -p <%= dir %>
  68 +if [ -f <%= source %> ] || [ -h <%= source %> ] ; then
  69 + cp -d <%= source %> <%= target %>
  70 +elif [ -d <%= source %> ] ; then
  71 + mkdir <%= target %>
72 72 fi
73 73 <% end %>
74 74

0 comments on commit 9e469fa

Please sign in to comment.
Something went wrong with that request. Please try again.