Skip to content

Commit 352ecb6

Browse files
committed
Merge branch 'master-2.6' into dist/2.6/focal
2 parents 97e1ec4 + 01a6c82 commit 352ecb6

File tree

19 files changed

+404
-37
lines changed

19 files changed

+404
-37
lines changed

ChangeLog

Lines changed: 122 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,127 @@
11
------------------------------------------------------------------------
2-
r67941 | usa | 2021-04-05 20:48:34 +0900 (Mon, 05 Apr 2021) | 1 line
2+
r67951 | usa | 2021-07-07 19:38:58 +0900 (Wed, 07 Jul 2021) | 1 line
3+
4+
add tag v2_6_8
5+
------------------------------------------------------------------------
6+
r67950 | usa | 2021-07-07 19:38:10 +0900 (Wed, 07 Jul 2021) | 6 lines
7+
8+
Fix StartTLS stripping vulnerability
9+
10+
Reported by Alexandr Savca in https://hackerone.com/reports/1178562
11+
12+
Co-authored-by: Shugo Maeda <[email protected]>
13+
14+
------------------------------------------------------------------------
15+
r67949 | usa | 2021-07-07 19:34:08 +0900 (Wed, 07 Jul 2021) | 7 lines
16+
17+
Ignore IP addresses in PASV responses by default, and add new option use_pasv_ip
18+
19+
This fixes CVE-2021-31810.
20+
Reported by Alexandr Savca.
21+
22+
Co-authored-by: Shugo Maeda <[email protected]>
23+
24+
------------------------------------------------------------------------
25+
r67948 | usa | 2021-07-04 02:10:56 +0900 (Sun, 04 Jul 2021) | 2 lines
26+
27+
patchlevel for previous commit
28+
29+
------------------------------------------------------------------------
30+
r67947 | usa | 2021-07-04 02:10:28 +0900 (Sun, 04 Jul 2021) | 8 lines
31+
32+
merge revision(s) b1c73f23,c9ab8fe2: [Backport #17877]
33+
34+
[ruby/rdoc] Use File.open to fix the OS Command Injection vulnerability in CVE-2021-31799
35+
36+
https://github.com/ruby/rdoc/commit/a7f5d6ab88
37+
38+
The test for command injection on Unix platforms should be omitted on Windows
39+
40+
------------------------------------------------------------------------
41+
r67946 | usa | 2021-07-04 01:56:34 +0900 (Sun, 04 Jul 2021) | 23 lines
42+
43+
merge revision(s) 9edc1625: [Backport #17781]
44+
45+
[ruby/resolv] Fix confusion of received response message
46+
47+
This is a follow up for commit 33fb966197f1 ("Remove sender/message_id
48+
pair after response received in resolv", 2020-09-11).
49+
50+
As the @senders instance variable is also used for tracking transaction
51+
ID allocation, simply removing an entry without releasing the ID would
52+
eventually deplete the ID space and cause
53+
Resolv::DNS.allocate_request_id to hang.
54+
55+
It seems the intention of the code was to check that the received DNS
56+
message is actually the response for the question made within the method
57+
earlier. Let's have it actually do so.
58+
59+
[Bug #12838] https://bugs.ruby-lang.org/issues/12838
60+
[Bug #17748] https://bugs.ruby-lang.org/issues/17748
61+
62+
https://github.com/ruby/resolv/commit/53ca9c9209
63+
---
64+
lib/resolv.rb | 6 +++---
65+
1 file changed, 3 insertions(+), 3 deletions(-)
66+
------------------------------------------------------------------------
67+
r67945 | usa | 2021-07-04 01:53:29 +0900 (Sun, 04 Jul 2021) | 11 lines
68+
69+
merge revision(s) d8a13e50: [Backport #17780]
70+
71+
[Bug #17780] Fix Method#super_method for module alias
72+
73+
Method#super_method crashes for aliased module methods because they are
74+
not defined on a class. This bug was introduced in
75+
c60aaed1856b2b6f90de0992c34771830019e021 as part of bug #17130.
76+
---
77+
proc.c | 2 +-
78+
test/ruby/test_method.rb | 13 +++++++++++++
79+
2 files changed, 14 insertions(+), 1 deletion(-)
80+
------------------------------------------------------------------------
81+
r67944 | usa | 2021-06-24 00:47:43 +0900 (Thu, 24 Jun 2021) | 30 lines
82+
83+
merge revision(s) 17aeff3e77e6fe0d37a9943dd93bcb16c4bb9f66,1616dcb16ef34ebf4ffc2167292f9a779f3e121e,1616dcb16ef34ebf4ffc2167292f9a779f3e121e:
84+
85+
make-snapshot: get rid of circular dependency
86+
87+
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
88+
---
89+
tool/make-snapshot | 5 ++---
90+
1 file changed, 2 insertions(+), 3 deletions(-)
91+
92+
make-snapshot: try downloading Unicode files
93+
94+
[Bug #15593]
95+
96+
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
97+
---
98+
tool/make-snapshot | 7 +------
99+
1 file changed, 1 insertion(+), 6 deletions(-)
100+
101+
make-snapshot: try downloading Unicode files
102+
103+
[Bug #15593]
104+
105+
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67038 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
106+
---
107+
tool/make-snapshot | 7 +------
108+
1 file changed, 1 insertion(+), 6 deletions(-)
109+
110+
these patches are not for security issue, but are needed to resolv a
111+
packaging problem.
112+
113+
------------------------------------------------------------------------
114+
r67943 | usa | 2021-05-10 12:24:37 +0900 (Mon, 10 May 2021) | 1 line
115+
116+
fix previous commit
117+
------------------------------------------------------------------------
118+
r67942 | usa | 2021-05-10 01:11:52 +0900 (Mon, 10 May 2021) | 5 lines
119+
120+
fix macos build
121+
122+
note that this is not a security fix, but recognized as critical build problem.
123+
[Backport #17777]
3124

4-
add tag v2_6_7
5125
------------------------------------------------------------------------
6126
r67940 | usa | 2021-04-05 20:48:23 +0900 (Mon, 05 Apr 2021) | 2 lines
7127

debian/changelog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
ruby2.6 (2.6.8-0nkmi1~dist) unstable; urgency=medium
2+
3+
* 2.6.8
4+
* Update maintainer email
5+
6+
-- Sorah Fukumori <[email protected]> Thu, 08 Jul 2021 04:25:43 +0900
7+
18
ruby2.6 (2.6.7-0nkmi1~dist) unstable; urgency=medium
29

310
* 2.6.7

debian/control

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Source: ruby2.6
22
Section: ruby
33
Priority: optional
4-
Maintainer: Sorah Fukumori <[email protected]>,
5-
Sorah Fukumori <[email protected]>
4+
Maintainer: Sorah Fukumori <[email protected]>
65
Build-Depends: bison,
76
chrpath,
87
coreutils (>= 7.5),

ext/fiddle/closure.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ typedef struct {
1414
} fiddle_closure;
1515

1616
#if defined(USE_FFI_CLOSURE_ALLOC)
17-
#elif defined(__OpenBSD__) || defined(__APPLE__) || defined(__linux__)
18-
# define USE_FFI_CLOSURE_ALLOC 0
19-
#elif defined(RUBY_LIBFFI_MODVERSION) && RUBY_LIBFFI_MODVERSION < 3000005 && \
20-
(defined(__i386__) || defined(__x86_64__) || defined(_M_IX86) || defined(_M_AMD64))
17+
#elif !defined(HAVE_FFI_CLOSURE_ALLOC)
2118
# define USE_FFI_CLOSURE_ALLOC 0
2219
#else
2320
# define USE_FFI_CLOSURE_ALLOC 1

ext/fiddle/extconf.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
if have_header(ffi_header = 'ffi.h')
1414
true
1515
elsif have_header(ffi_header = 'ffi/ffi.h')
16-
$defs.push(format('-DUSE_HEADER_HACKS'))
16+
$defs.push('-DUSE_HEADER_HACKS')
1717
true
1818
end and (have_library('ffi') || have_library('libffi'))
1919
end or
@@ -114,8 +114,17 @@
114114

115115
if ver
116116
ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
117-
ver = (ver.split('.') + [0,0])[0,3]
117+
ver = (ver.split('.').map(&:to_i) + [0,0])[0,3]
118118
$defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
119+
warn "libffi_version: #{ver.join('.')}"
120+
end
121+
122+
case
123+
when $mswin, $mingw, (ver && (ver <=> [3, 2]) >= 0)
124+
$defs << "-DUSE_FFI_CLOSURE_ALLOC=1"
125+
when (ver && (ver <=> [3, 2]) < 0)
126+
else
127+
have_func('ffi_closure_alloc', ffi_header)
119128
end
120129

121130
have_header 'sys/mman.h'
@@ -142,7 +151,7 @@
142151
if /^\#define\s+SIZEOF_#{type}\s+(SIZEOF_(.+)|\d+)/ =~ config
143152
if size = $2 and size != 'VOIDP'
144153
size = types.fetch(size) {size}
145-
$defs << format("-DTYPE_%s=TYPE_%s", signed||type, size)
154+
$defs << "-DTYPE_#{signed||type}=TYPE_#{size}"
146155
end
147156
if signed
148157
check_signedness(type.downcase, "stddef.h")

lib/net/ftp.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ class FTP < Protocol
9797
# When +true+, the connection is in passive mode. Default: +true+.
9898
attr_accessor :passive
9999

100+
# When +true+, use the IP address in PASV responses. Otherwise, it uses
101+
# the same IP address for the control connection. Default: +false+.
102+
attr_accessor :use_pasv_ip
103+
100104
# When +true+, all traffic to and from the server is written
101105
# to +$stdout+. Default: +false+.
102106
attr_accessor :debug_mode
@@ -205,6 +209,9 @@ def FTP.open(host, *args)
205209
# handshake.
206210
# See Net::FTP#ssl_handshake_timeout for
207211
# details. Default: +nil+.
212+
# use_pasv_ip:: When +true+, use the IP address in PASV responses.
213+
# Otherwise, it uses the same IP address for the control
214+
# connection. Default: +false+.
208215
# debug_mode:: When +true+, all traffic to and from the server is
209216
# written to +$stdout+. Default: +false+.
210217
#
@@ -265,6 +272,7 @@ def initialize(host = nil, user_or_options = {}, passwd = nil, acct = nil)
265272
@open_timeout = options[:open_timeout]
266273
@ssl_handshake_timeout = options[:ssl_handshake_timeout]
267274
@read_timeout = options[:read_timeout] || 60
275+
@use_pasv_ip = options[:use_pasv_ip] || false
268276
if host
269277
connect(host, options[:port] || FTP_PORT)
270278
if options[:username]
@@ -1330,7 +1338,12 @@ def parse227(resp) # :nodoc:
13301338
raise FTPReplyError, resp
13311339
end
13321340
if m = /\((?<host>\d+(,\d+){3}),(?<port>\d+,\d+)\)/.match(resp)
1333-
return parse_pasv_ipv4_host(m["host"]), parse_pasv_port(m["port"])
1341+
if @use_pasv_ip
1342+
host = parse_pasv_ipv4_host(m["host"])
1343+
else
1344+
host = @bare_sock.remote_address.ip_address
1345+
end
1346+
return host, parse_pasv_port(m["port"])
13341347
else
13351348
raise FTPProtoError, resp
13361349
end

lib/net/imap.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1215,12 +1215,14 @@ def get_tagged_response(tag, cmd)
12151215
end
12161216
resp = @tagged_responses.delete(tag)
12171217
case resp.name
1218+
when /\A(?:OK)\z/ni
1219+
return resp
12181220
when /\A(?:NO)\z/ni
12191221
raise NoResponseError, resp
12201222
when /\A(?:BAD)\z/ni
12211223
raise BadResponseError, resp
12221224
else
1223-
return resp
1225+
raise UnknownResponseError, resp
12241226
end
12251227
end
12261228

@@ -3716,6 +3718,10 @@ class BadResponseError < ResponseError
37163718
class ByeResponseError < ResponseError
37173719
end
37183720

3721+
# Error raised upon an unknown response from the server.
3722+
class UnknownResponseError < ResponseError
3723+
end
3724+
37193725
RESPONSE_ERRORS = Hash.new(ResponseError)
37203726
RESPONSE_ERRORS["NO"] = NoResponseError
37213727
RESPONSE_ERRORS["BAD"] = BadResponseError

lib/rdoc/rdoc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def remove_unparseable files
430430
files.reject do |file|
431431
file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
432432
(file =~ /tags$/i and
433-
open(file, 'rb') { |io|
433+
File.open(file, 'rb') { |io|
434434
io.read(100) =~ /\A(\f\n[^,]+,\d+$|!_TAG_)/
435435
})
436436
end

lib/rdoc/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ module RDoc
33
##
44
# RDoc version you are using
55

6-
VERSION = '6.1.2'
6+
VERSION = '6.1.2.1'
77

88
end

lib/resolv.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,17 +691,17 @@ def request(sender, tout)
691691
rescue DecodeError
692692
next # broken DNS message ignored
693693
end
694-
if s = sender_for(from, msg)
694+
if sender == sender_for(from, msg)
695695
break
696696
else
697697
# unexpected DNS message ignored
698698
end
699699
end
700-
return msg, s.data
700+
return msg, sender.data
701701
end
702702

703703
def sender_for(addr, msg)
704-
@senders.delete([addr,msg.id])
704+
@senders[[addr,msg.id]]
705705
end
706706

707707
def close

0 commit comments

Comments
 (0)