diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 13:51:34 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 13:51:34 +0000 |
commit | 95645f55510e445d00186ef41761a78fcb79764e (patch) | |
tree | eab99431c73253d5e03e233d3a0e08093bd71525 /lib/net/ftp.rb | |
parent | 2e728d51e70ed3756ad760c687a08b8487b0112f (diff) |
merge revision(s) 61242: [Backport #14185]
Fix a command injection vulnerability in Net::FTP.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@61245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/net/ftp.rb')
-rw-r--r-- | lib/net/ftp.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb index 601d2cb4c3..bd74323987 100644 --- a/lib/net/ftp.rb +++ b/lib/net/ftp.rb @@ -754,10 +754,10 @@ module Net if localfile if @resume rest_offset = File.size?(localfile) - f = open(localfile, "a") + f = File.open(localfile, "a") else rest_offset = nil - f = open(localfile, "w") + f = File.open(localfile, "w") end elsif !block_given? result = String.new @@ -787,7 +787,7 @@ module Net f = nil result = nil if localfile - f = open(localfile, "w") + f = File.open(localfile, "w") elsif !block_given? result = String.new end @@ -833,7 +833,7 @@ module Net else rest_offset = nil end - f = open(localfile) + f = File.open(localfile) begin f.binmode if rest_offset @@ -852,7 +852,7 @@ module Net # passing in the transmitted data one line at a time. # def puttextfile(localfile, remotefile = File.basename(localfile), &block) # :yield: line - f = open(localfile) + f = File.open(localfile) begin storlines("STOR #{remotefile}", f, &block) ensure |