Skip to content

Commit

Permalink
#2 shellwords
Browse files Browse the repository at this point in the history
  • Loading branch information
Yegor Bugayenko committed Sep 30, 2014
1 parent 5e0f713 commit 1fbc22b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/rultor/encrypt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.

require 'shellwords'
require 'English'

# Rultor main module.
Expand All @@ -50,8 +51,9 @@ def run
set -e
gpg --keyserver hkp://pool.sks-keyservers.net \
--verbose --recv-keys 9AF0FA4C
gpg --trust-model always --output '#{@dest}' \
--batch --armor --encrypt --verbose --recipient 9AF0FA4C '#{@file}'
gpg --trust-model always --output #{Shellwords::escape(@dest)} \
--batch --armor --encrypt --verbose \
--recipient 9AF0FA4C #{Shellwords::escape(@file)}
"
)
fail 'Failed to PGP encrypt' unless $CHILD_STATUS.exitstatus == 0
Expand Down

0 comments on commit 1fbc22b

Please sign in to comment.