From 02b8978ff10b05304dbb46d73b49a2cf3a87cb92 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 14 Dec 2017 15:08:49 +0000 Subject: * test/net/ftp/test_ftp.rb (process_port_or_eprt): merge a part of r56973 to pass the test introduced at previous commit. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@61255 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ test/net/ftp/test_ftp.rb | 18 ++++++++++++++++++ version.h | 6 +++--- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecff5aff99..d9d9629ffa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 15 00:08:26 2017 NAKAMURA Usaku + + * test/net/ftp/test_ftp.rb (process_port_or_eprt): merge a part of + r56973 to pass the test introduced at previous commit. + Thu Dec 14 22:52:11 2017 Shugo Maeda Fix a command injection vulnerability in Net::FTP. diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index 91a6002c5c..52e5873d61 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -1081,4 +1081,22 @@ EOF end end end + + def process_port_or_eprt(sock, line) + case line + when /\APORT (.*)/ + port_args = $1.split(/,/) + host = port_args[0, 4].join(".") + port = port_args[4, 2].map(&:to_i).inject {|x, y| (x << 8) + y} + sock.print("200 PORT command successful.\r\n") + return host, port + when /\AEPRT \|2\|(.*?)\|(.*?)\|/ + host = $1 + port = $2.to_i + sock.print("200 EPRT command successful.\r\n") + return host, port + else + flunk "PORT or EPRT expected" + end + end end diff --git a/version.h b/version.h index 1453fe8dfc..5ef0a3ead6 100644 --- a/version.h +++ b/version.h @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.2.9" -#define RUBY_RELEASE_DATE "2017-12-14" -#define RUBY_PATCHLEVEL 479 +#define RUBY_RELEASE_DATE "2017-12-15" +#define RUBY_PATCHLEVEL 480 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 12 -#define RUBY_RELEASE_DAY 14 +#define RUBY_RELEASE_DAY 15 #include "ruby/version.h" -- cgit v1.2.3