Граф коммитов

49314 Коммитов

Автор SHA1 Сообщение Дата
nobu 70001d5fda ifaddr.c: get_ifaddrs
* ext/socket/ifaddr.c (get_ifaddrs): extract ifaddrs from
  Socket::Ifaddr.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:49:00 +00:00
nobu 6e0074d0ff iseq.c (rb_insn_operand_intern): needs parenthesies
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:12:02 +00:00
normal f2aa7f409a webrick/httputils: note Kernel#open behavior
I don't know who uses the load_mime_types method; but it is
conceivable that a user would want to read the results of a
command instead of reading a regular file to load MIME types.

None of the WEBrick-related code in Ruby or default/bundled gems
seems to rely on this method; but it is likely 3rd-party code does.

* lib/webrick/httputils.rb (load_mime_types): note Kernel#open behavior
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:08:05 +00:00
normal 1ad355bd53 webrick/httpservlet/*handler: use File.open
This makes future code audits easier.  None of these changes
fix realistic remote code execution vulnerabilities because
we stat(2) before attempting Kernel#open.

* lib/webrick/httpservlet/erbhandler.rb (do_GET): use File.open
* lib/webrick/httpservlet/filehandler.rb (do_GET): use File.open
  (make_partial_content): ditto
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:08:00 +00:00
normal 1989371d10 webrick: WEBrick::Log requires path arg when given string
Allowing a user to specify "| command" via Kernel#open is
nonsensical since we never read from the resultant IO.

* lib/webrick/log.rb (initialize): replace Kernel#open with File.open
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:07:55 +00:00
normal 1895a48856 webrick: add test for WEBrick::HTTPServlet::ERBHandler
This previously had no coverage.

* test/webrick/test_filehandler.rb (test_erbhandler): new test
* test/webrick/webrick.rhtml: new file for test
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:07:50 +00:00
normal 646b83af2a webrick/httpservlet/cgi_runner.rb: remove unnecessary open
IO#reopen already takes string path names as well as IO objects
(but not "| command" strings)

This makes further auditing for inadvertant code execution
easier.  There's no actual bugfix or behavior change here,
as no external data is passed to cgi_runner.rb.

* lib/webrick/httpservlet/cgi_runner.rb: remove Kernel#open call
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:07:45 +00:00
normal edddc28f62 webrick: httpauth requires regular files
Be sure we do not try to open a pipe to read from, since we care
about mtime in all cases.

* lib/webrick/httpauth/htdigest.rb: use File.open
* lib/webrick/httpauth/htgroup.rb: ditto
* lib/webrick/httpauth/htpasswd.rb: ditto
  [Misc #14216]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61397 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:07:39 +00:00
nobu e2479cc43f encoding.c: rb_enc_find_index2
* string.c (str_undump): use rb_enc_find_index2 to find encoding
  by unterminated string.  check the format before encoding name.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 01:03:17 +00:00
nobu b4dc51ce10 iseq.c: defined insn operand
* iseq.c (rb_insn_operand_intern): improve operands of defined
  instruction.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-22 00:29:38 +00:00
svn 93dcc40bb7 * 2017-12-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 23:28:16 +00:00
shugo c55200763d Extend timeout for CI.
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/266962

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 23:28:15 +00:00
akr bf287424fd open-uri defines URI.open defined as an alias.
open-uri's Kernel.open will be deprecated in future.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 14:15:04 +00:00
nobu 7a54b5b4ce test for [Bug #14214]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61391 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 11:59:31 +00:00
hsbt 722306265d Added detailed version of Bundler on NEWS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 09:29:47 +00:00
eregon 82d63fcaac Simplify Thread#[]= spec
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 09:29:18 +00:00
hsbt 4525cf2cd5 Merge release version of bundler-1.16.1 from upstream.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 09:22:15 +00:00
ko1 85277d5be0 revert r61371 for [Bug #14214]
Reverted patch doesn't check overwritten value.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 08:29:56 +00:00
nobu 168c019998 string.c: fix memory leak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 07:59:00 +00:00
nobu c364252926 common.mk: revert r58542 [Bug #14213]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 07:50:46 +00:00
yui-knk 69ae0f0f42 iseq.c (rb_iseq_code_range): Remove needless `;`
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 07:09:03 +00:00
mame c2f10299ac parse.y: change NODE_SCOPE's nd_loc to one of the parent NODE
This change (ad-hocly) adjusts the code range of NODE_SCOPE in
class/module definition because the same adjust is already done in
method definition.  I intend to just remove inconsistency between
class/module definition and method definition, but this kind of adjust
is dirty, so it should be fixed later (maybe in 2.6).

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 06:52:15 +00:00
ko1 e9a184ed63 add experimental API.
* iseq.c (rb_iseq_code_range): added to access iseq's code range.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 06:40:28 +00:00
naruse 05d1d29d1f Don't allow mixed escape
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 05:09:17 +00:00
naruse 188d85934b move dump format validation into parsing epilogue
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 05:09:16 +00:00
naruse 29c6ca423c fix escapes in undump
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61379 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 05:08:57 +00:00
sonots 7176eb2df9 * lib/logger.rb (Logger::LogDevice#open_logfile, #create_logfile):
Logger should be able to open only files [Bug #14212]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 05:07:43 +00:00
tenderlove 2c075d3863 Fix `imemo_name` to dump new imemo types
New IMEMO types were introduced, this just fixes the function that
converts the type to support the new types.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 00:40:54 +00:00
normal 3b174fb7d6 io.c: IO#pwrite uses tmp buffer to avoid parallel modification
Since we release GVL, we must freeze and duplicate the string buffer
to prevent other threads from modifying our buffer while we are
waiting on pwrite(2).

* io.c (rb_io_pwrite): use_rb_str_tmp_frozen_{acquire/release}
  [Bug #14195]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 00:26:24 +00:00
ko1 b895c402a5 fix threading bug.
* spec/ruby/core/thread/element_set_spec.rb: `t` can be uninitialized.
  Use `Thread.current` explicitly.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 23:49:30 +00:00
usa 098c8d5491 fix test errors on Windows
* test/resolv/test_addr.rb (test_hosts_by_command): on Windows, `|` is
	  invalid charactor for path and raises `Errno::EINVAL` if trying to
	  open.

	* test/resolv/test_dns.rb (test_resolv_conf_by_command): ditto.

	cf. [Bug #14205]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 16:04:41 +00:00
svn ac6db01fea * 2017-12-21
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 15:45:02 +00:00
nobu a94ede7a5a compile.c: branch on block param
* compile.c (compile_branch_condition): replace block param value
  in branch conditions with `defined(yield)`, to get rid of
  creating proc value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 15:45:01 +00:00
nobu e105ee2bed iseq.c: block param name
* iseq.c (rb_insn_operand_intern): show local variable name at
  getblockparam/setblockparam too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 14:10:06 +00:00
naruse 0078e40115 raise error if value contains CR/LF in iniheader of initialize_http_header
like r59693, initialize_http_header also should raise error. [Bug #14208]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 12:06:59 +00:00
stomar 677c539d1f NEWS: update news for Psych
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 09:51:29 +00:00
stomar d51151cf30 NEWS: "absent operator" is now called "absence operator"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 09:31:58 +00:00
stomar efe8be7332 NEWS: grammar fixes
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 09:31:22 +00:00
hsbt 71e5c12578 Update rdoc-6.0.0 entry on NEWS file
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 08:50:26 +00:00
mame be3439026a iseq.c (get_insn_info): use binary search instead of linear search
This change introduces get_insn_info_binary_search, which is (should be)
equivalent to the old get_insn_info.
The old get_insn_info is renamed to get_insn_info_linear_search.  When
VM_CHECK_MODE > 0, the equivalence is validated at finish_iseq_build.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 07:38:24 +00:00
mame 799db969e9 test/coverage/test_coverage.rb: make the expected value the same as 2.4
A follow up of r61350

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 04:45:05 +00:00
nobu cdf1b85ae7 Fixed command Injection
* lib/resolv.rb (Resolv::Config.parse_resolv_conf): fixed
  potential command injection by use of Kernel#open.
  [ruby-core:84347] [Bug #14205]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61351 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 04:25:01 +00:00
mame c08e8886ba compile.c: add a RUBY_EVENT_COVERAGE_LINE event for line coverage
2.5's line coverage measurement was about two times slower than 2.4
because of two reasons; (1) vm_trace uses rb_iseq_event_flags (which
takes O(n) currently where n is the length of iseq) to get an event
type, and (2) RUBY_EVENT_LINE uses setjmp to call an event hook.

This change adds a special event for line coverage,
RUBY_EVENT_COVERAGE_LINE, and adds `tracecoverage` instructions where
the event occurs in iseq.
`tracecoverage` instruction calls an event hook without vm_trace.
And, RUBY_EVENT_COVERAGE_LINE is an internal event which does not
use setjmp.

This change also cancells lineno change due to the deletion of trace
instructions [Feature #14104].  So fixes [Bug #14191].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 04:24:14 +00:00
nobu e7464561b5 Fixed command Injection
* resolv.rb (Resolv::Hosts#lazy_initialize): fixed potential
  command Injection in Hosts::new() by use of Kernel#open.
  [Fix GH-1777] [ruby-core:84347] [Bug #14205]

From: Drigg3r <drigg3r@yandex.com>

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 04:18:31 +00:00
mame 6df552eaee vm_insnhelper.c (vm_trace): fix a typo
Typical code clone bug.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 01:51:50 +00:00
ko1 cc2f982852 extend timeout limit.
* test/ruby/test_process.rb (test_threading_works_after_exec_fail):
  extend timeout limit from 30 to 90 because some test nodes fails
  with timeout error.

  Also use a Queue instead of a local variable to communicate with
  threads.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 00:24:19 +00:00
nobu 032e8fdf40 parse.y: end of script at newline
* parse.y (parser_yylex): deal with end of script chars just after
  ignored newline as other places.  [ruby-core:84349] [Bug #14206]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-20 00:09:51 +00:00
ngoto b37fc5aa7e skip test_aspawn_too_long_path on Solaris 10 or earlier
* test/ruby/test_process.rb (TestProcess#test_aspawn_too_long_path):
  skip test_aspawn_too_long_path on Solaris 10 or earlier versions
  because they lack Process::RLIMIT_NPROC and the test creates
  extraordinary number of processes that makes the system unstable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-19 17:09:13 +00:00
ngoto 504842d81f Workaround for optimization bug of Oracle Developer Studio 12.4-12.6
* pack.c (pack_unpack, AVOID_CC_BUG): Very ugly workaround for
  optimization bug of Oracle Developer Studio (Oracle Solaris Studio)
  12.4, 12.5, and 12.6 on Solaris 10 with -xO4 optimization option.
  [Bug #11684] [ruby-core:84351]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61344 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-19 16:55:08 +00:00
svn 8c34a8a127 * 2017-12-20
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61343 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-19 15:40:14 +00:00