lib/backup/encryptor/open_ssl.rb in backup-4.1.8 vs lib/backup/encryptor/open_ssl.rb in backup-4.1.9
- old
+ new
@@ -60,11 +60,16 @@
# but will prefer the password_file option if both are given.
def options
opts = ['aes-256-cbc']
opts << '-base64' if @base64
opts << '-salt' if @salt
- opts << ( @password_file.to_s.empty? ?
- "-k '#{@password}'" : "-pass file:#{@password_file}" )
+
+ if @password_file.to_s.empty?
+ opts << "-k #{Shellwords.escape(@password)}"
+ else
+ opts << "-pass file:#{@password_file}"
+ end
+
opts.join(' ')
end
end
end