aboutsummaryrefslogtreecommitdiffstats
path: root/test/win32ole/test_win32ole.rb
Commit message (Collapse)AuthorAgeFilesLines
* Warn on access/modify of $SAFE, and remove effects of modifying $SAFEJeremy Evans2019-11-181-49/+0
| | | | | | | | | | | | | | | | | This removes the security features added by $SAFE = 1, and warns for access or modification of $SAFE from Ruby-level, as well as warning when calling all public C functions related to $SAFE. This modifies some internal functions that took a safe level argument to no longer take the argument. rb_require_safe now warns, rb_require_string has been added as a version that takes a VALUE and does not warn. One public C function that still takes a safe level argument and that this doesn't warn for is rb_eval_cmd. We may want to consider adding an alternative method that does not take a safe level argument, and warn for rb_eval_cmd.
* * ext/win32ole/lib/win32ole.rb (methods): COM method elements should besuke2018-09-261-1/+1
| | | | | | | | symbol in return value of methods. * test/win32ole/test_win32ole.rb ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* `$SAFE` as a process global state. [Feature #14250]ko12017-12-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * vm_core.h (rb_vm_t): move `rb_execution_context_t::safe_level` to `rb_vm_t::safe_level_` because `$SAFE` is a process (VM) global state. * vm_core.h (rb_proc_t): remove `rb_proc_t::safe_level` because `Proc` objects don't need to keep `$SAFE` at the creation. Also make `is_from_method` and `is_lambda` as 1 bit fields. * cont.c (cont_restore_thread): no need to keep `$SAFE` for Continuation. * eval.c (ruby_cleanup): use `rb_set_safe_level_force()` instead of access `vm->safe_level_` directly. * eval_jump.c: End procs `END{}` doesn't keep `$SAFE`. * proc.c (proc_dup): removed and introduce `rb_proc_dup` in vm.c. * safe.c (rb_set_safe_level): don't check `$SAFE` 1 -> 0 changes. * safe.c (safe_setter): use `rb_set_safe_level()`. * thread.c (rb_thread_safe_level): `Thread#safe_level` returns `$SAFE`. It should be obsolete. * transcode.c (load_transcoder_entry): `rb_safe_level()` only returns 0 or 1 so that this check is not needed. * vm.c (vm_proc_create_from_captured): don't need to keep `$SAFE` for Proc. * vm.c (rb_proc_create): renamed to `proc_create`. * vm.c (rb_proc_dup): moved from proc.c. * vm.c (vm_invoke_proc): do not need to set and restore `$SAFE` for `Proc#call`. * vm_eval.c (rb_eval_cmd): rename a local variable to represent clearer meaning. * lib/drb/drb.rb: restore `$SAFE`. * lib/erb.rb: restore `$SAFE`, too. * test/lib/leakchecker.rb: check `$SAFE == 0` at the end of tests. * test/rubygems/test_gem.rb: do not set `$SAFE = 1`. * bootstraptest/test_proc.rb: catch up this change. * spec/ruby/optional/capi/string_spec.rb: ditto. * test/bigdecimal/test_bigdecimal.rb: ditto. * test/fiddle/test_func.rb: ditto. * test/fiddle/test_handle.rb: ditto. * test/net/imap/test_imap_response_parser.rb: ditto. * test/pathname/test_pathname.rb: ditto. * test/readline/test_readline.rb: ditto. * test/ruby/test_file.rb: ditto. * test/ruby/test_optimization.rb: ditto. * test/ruby/test_proc.rb: ditto. * test/ruby/test_require.rb: ditto. * test/ruby/test_thread.rb: ditto. * test/rubygems/test_gem_specification.rb: ditto. * test/test_tempfile.rb: ditto. * test/test_tmpdir.rb: ditto. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Thread.current.report_on_exception = falseusa2017-12-141-0/+3
| | | | | | | | * test/win32ole/test_win32ole.rb: set report_on_exception = false in threads which are expected to be throw some exceptions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32ole/lib/win32ole.rb (metods): rescue WIN32OLEQueryInterfaceError.suke2017-11-051-4/+9
| | | | | | | test/win32ole/test_win32ole.rb: add test for WIN32OLE#methods git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/win32ole/win32ole.c (fole_missing): set receiver in NoMethodError.suke2017-10-211-1/+2
| | | | | | | test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add frozen_string_literal: false for all filesnaruse2015-12-161-0/+1
| | | | | | When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole.c: check argument typenobu2015-12-131-0/+3
| | | | | | | | * ext/win32ole/win32ole.c (ole_vstr2wc): check argument type, vstr must be a String here. reported by Marcin 'Icewall' Noga of Cisco Talos. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c(fole_s_connect, fole_initialize): raise asuke2014-08-251-0/+40
| | | | | | | | | | | security error with the tainted string object. * ext/win32ole/win32ole_event.c(ev_advise): ditto. * test/win32ole/test_win32ole.rb(test_s_new_exc_svr_tainted, test_s_new_exc_host_tainted): ditto. * test/win32ole/test_win32ole_event.rb(test_s_new_exc_tainted): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole: get rid of warnings (unused variable).usa2014-03-021-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole.c: check aritynobu2013-04-081-0/+7
| | | | | | | * ext/win32ole/win32ole.c (fole_missing): should check actual argument count before accessing. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb: follow other test files.usa2012-11-061-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb: now source encoding is UTF-8, sousa2012-11-061-1/+1
| | | | | | | binary strings in old scripts are dangerous. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb (test_s_codepage_changed):suke2012-07-041-2/+3
| | | | | | | | FileSystemObject only supports ANSI or UTF-16LE encoding. Patch by h.shirosaki (Hiroshi Shirosaki) [ruby-trunk - Bug #6650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36306 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb (test_s_codepage_changed):luislavena2012-06-281-4/+4
| | | | | | | FileSystemObject only supports ANSI or UTF-16LE encoding. Patch by bosko (Bosko Ivanisevic) [ruby-trunk - Bug #6650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (ole_invoke): raise NoMethodErrorsuke2010-05-201-0/+7
| | | | | | | | | when COM method is not found. [ruby-core:30160] [Bug #3277] * test/win32ole/test_win32ole.rb (test_no_method_error): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb (test_s_codepage_changed,suke2009-07-161-14/+39
| | | | | | | | | | | test_s_locale_set, test_s_locale_change): skip test if Japanese locale is not installed. [ruby-core:23806] * test/win32ole/test_win32ole_variant.rb (test_conversion_str2cy): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * {ext,lib,test}/**/*.rb: removed trailing spaces.nobu2009-03-061-8/+8
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (fole_s_connect, fole_initialize,suke2008-11-061-0/+15
| | | | | | | | | | | | | | | | folevariant_initialize): check argument type of WIN32OLE.connect, WIN32OLE.new, WIN32OLE_VARIANT.new. * test/win32ole/test_win32ole.rb (test_s_new_exc, test_s_connect_exc): ditto. * test/win32ole/test_win32ole_variant.rb (test_s_new_exc): ditto. * test/win32ole/test_win32ole_method.rb: add assertion of WIN32OLE_METHOD.new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (load_conv_function51932): supportsuke2008-10-131-14/+6
| | | | | | | | | CP51932 on cygwin and mingw32. thanks to arton. * test/win32ole/test_win32ole.rb (test_cp51932): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (set_ole_codepage, ole_cp2encoding,suke2008-10-121-0/+24
| | | | | | | | | ole_wc2mb, ole_vstr2wc, ole_mb2wc): support CP51932 (only mswin32). * test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (ole_invoke): WIN32OLE#[] and WIN32OLE#[]=suke2008-08-271-0/+8
| | | | | | | | | accepts number argument. * test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (hash2named_arg): refactoring.suke2008-08-031-0/+7
| | | | | | | | | | | | * ext/win32ole/win32ole.c (ole_invoke, fole_respond_to, ev_on_event, fev_off_event): accepts Symbol argument. * test/win32ole/test_win32ole.rb: ditto. * test/win32ole/test_win32ole_event.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c: add WIN32OLE#ole_respond_to?suke2008-07-051-0/+10
| | | | | | | * test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c : check String encoding whensuke2008-06-271-4/+5
| | | | | | | | | | converting String to VT_BSTR in OLE. * test/win32ole/test_win32ole.rb : ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* modify test according to changing WIN32OLE.codepage behavior.suke2008-02-161-2/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (ole_init_cp): initialize WIN32OLE.codepagesuke2008-02-151-3/+6
| | | | | | | | | according to Encoding.default_external. * test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15488 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb: ruby's encoding support.usa2008-01-291-7/+7
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15330 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb(test_s_codepage_changed) : modify testsuke2008-01-051-11/+22
| | | | | | | for m17n. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/win32ole/test_win32ole.rb(test_s_locale_change) :add assertion whichsuke2008-01-051-0/+3
| | | | | | | should raise WIN32OLERuntimeError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (ole_type_progid): progid getted bysuke2007-08-281-1/+1
| | | | | | | | | | | | | | | ProgIDFromCLSID should be freed by CoTaskMemFree. Thanks, arton. * test/win32ole/test_win32ole.rb (test_raise_message): set negative compareMode value to raise WIN32OLERuntimeError. * test/win32ole/test_win32ole_type.rb (test_implemented_ole_types): support some environment which returns IShellDispatch5 instead of IShellDispatch. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c: add WIN32OLE#ole_query_interface.suke2007-02-101-0/+9
| | | | | | | | | thanks to Mikael Pahmp. * test/win32ole/test_win32ole.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c (ole_val2olevariantdata, ole_val2variant):suke2007-02-031-3/+17
| | | | | | | | | | | | | | fix the bug of WIN32OLE_VARIANT.new when variant type is VT_ARRAY. * ext/win32ole/sample/excel1.rb: rewrite using WIN32OLE_VARIANT. * test/win32ole/test_win32ole.rb: add some test. * test/win32ole/test_win32ole_variant.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/win32ole/win32ole.c: add WIN32OLE.locale=, WIN32OLE.locale,suke2007-01-291-0/+40
| | | | | | | | | | | | | | WIN32OLE_VARIANT#vartype. * test/win32ole/test_win32ole.rb: add test for WIN32OLE.locale=, WIN32OLE.locale. * test/win32ole/test_win32ole_variant.rb: add test for WIN32OLE_VARIANT#vartype. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* WIN32OLE.codepage= accepts installed codepage.suke2007-01-201-1/+16
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* modify WIN32OLERuntimeError message.suke2007-01-201-0/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* move all test from ext/win32ole/tests test/win32olesuke2007-01-201-93/+153
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11545 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* move some test from ext/win32ole/tests to test/win32olesuke2007-01-191-0/+195
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11544 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add some test. update comment for rdoc.suke2007-01-071-0/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* accept hash argument of Symbol key.suke2006-08-191-0/+44
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e