summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 13:53:48 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-14 13:53:48 +0000
commit0207c68ea39b74fc99e445231c1ac08ad5406720 (patch)
tree925166e77362c800c71d3539415e5bb804845e1a /lib
parentfc824f2a81725ae021a75291c790a55b9755c55c (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_2@61246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ftp.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/net/ftp.rb b/lib/net/ftp.rb
index c9b80c6804..79edb80864 100644
--- a/lib/net/ftp.rb
+++ b/lib/net/ftp.rb
@@ -606,10 +606,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 = ""
@@ -637,7 +637,7 @@ module Net
def gettextfile(remotefile, localfile = File.basename(remotefile)) # :yield: line
result = nil
if localfile
- f = open(localfile, "w")
+ f = File.open(localfile, "w")
elsif !block_given?
result = ""
end
@@ -683,7 +683,7 @@ module Net
else
rest_offset = nil
end
- f = open(localfile)
+ f = File.open(localfile)
begin
f.binmode
if rest_offset
@@ -702,7 +702,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