[ruby-dev:14699] patch for doc/NEWS (Re: restore terminal mode evenifreadlineinterrupted.)
From:
Koji Arai <JCA02266@...>
Date:
2001-09-05 18:37:59 UTC
List:
ruby-dev #14699
新井です。
In message "[ruby-dev:14694] Re: restore terminal mode evenifreadlineinterrupted."
on 06 Sep 2001 01:12:22 +0900,
Koji Arai <JCA02266@nifty.ne.jp> wrote:
> 新井です。
> 特に何かのメンテナを引き受けるわけでもつもりでもないのであん
> ま commit はしないと思うのですが。。。あっ doc/NEWS ぐらいは
> 触るかも。
と言いつつ、英語できないのでかな混じりパッチ(for 1.6)です。
せめてと思い ((<>)) をとっぱらっておきました。あと、可能な限
り例もつけてます。
以下について注意。(パッチ中では ?????と印つけてます)
: lib/resolv.rb, lib/resolv-replace.rb
これを使えば、名前解決中のタイムアウトの処理が可能になるかどうかを
試してません。該当部分の記述は削って良いかな。
: $SAFE / def
$SAFE == 4 のときのメソッド定義は現状でも許されてないみたいです。
(エラーメッセージは変わってるけど、どういう変更だったのか
をまだ追ってません)
例
$SAFE = 4; def a; end
=> -:1: Insecure operation `(null)' at level 4 (SecurityError)
ruby 1.6.4 (2001-06-04) [i586-linux]
=> -:1: Insecure: can't define method (SecurityError)
ruby 1.6.4 (2001-08-06) [i586-linux]
詳細は
<http://www.ruby-lang.org/ja/man-1.6/?cmd=view;name=ruby+1.6+feature>
を参照願います。
: Ctrl-C (Interrupt)が効かなくなる
というのを ruby 1.6 feature には書いていたのですが
# [ruby-dev:13195] で報告 [ruby-dev:13204] でパッチが出てますが。
これって 1.6 にはバックポートしないのかな?それならそれで
いいのですが。
Index: NEWS
===================================================================
RCS file: /usr/local/cvsup/ruby/ruby/doc/NEWS,v
retrieving revision 1.1.2.13
diff -u -u -r1.1.2.13 NEWS
--- NEWS 16 Aug 2001 08:10:47 -0000 1.1.2.13
+++ NEWS 5 Sep 2001 18:00:34 -0000
@@ -1,4 +1,94 @@
-Summary of the changes since 1.6.4:
+Summary of the changes since 1.6.4 (2001-06-04):
+
+: Dir.glob
+
+ Dir.glob("*/**/*")がサブディレクトリのファイルを二度返していました。
+ [ruby-dev:14576]
+
+ Dir.mkdir('foo') rescue nil
+ Dir.mkdir('foo/bar') rescue nil
+ p Dir.glob('*/**/*')
+
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ ["foo/bar", "foo/bar"]
+
+ => ruby 1.6.4 (2001-08-26) [i586-linux]
+ ["foo/bar"]
+
+: UnboundMethod#bind
+
+ モジュールの UnboundMethod オブジェクトを bind することができませんでした。
+ [rubyist:0728]
+
+ module Foo
+ def foo
+ :foo
+ end
+ end
+
+ class Bar
+ include Foo
+ end
+
+ m = Foo.instance_method :foo
+ p m.bind(Bar.new).call
+
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ -:12:in `bind': first argument must be an instance of Foo (TypeError)
+ from -:12
+
+ => ruby 1.6.4 (2001-08-23) [i586-linux]
+ :foo
+
+: 組込みクラスの置き換え
+
+ 組込みクラス/モジュール(を代入した定数)への代入を行ったときに警告を
+ 出すようになりました。
+
+ Array = nil
+ p Array
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ nil
+
+ => -:1: warning: already initialized constant Array
+ ruby 1.6.4 (2001-08-23) [i586-linux]
+ nil
+
+: Regexp
+
+ 括弧の数より大きな数のバックリファレンスが何にでもマッチしていました。
+ [ruby-list:30975]
+
+ p /(foo)\2/ =~ "foobar"
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ 0
+ => ruby 1.6.4 (2001-08-23) [i586-linux]
+ nil
+
+: TCPSocket.open
+
+ Cygwin で TCPSocket.open がタイミングによってエラー(Errno::EINVAL,
+ EALREADY)になることがある問題に対処しました。(1.6.4 20010712以降)
+ [ruby-talk:9939], [ruby-talk:16632],
+ [ruby-list:24702], [ruby-list:27805], [ruby-list:30512] 等など
+
+: lib/resolv.rb, lib/resolv-replace.rb
+
+ 追加。rubyで実装したリゾルバ(DNSの名前解決) とSocket関連のクラスでこ
+ のライブラリを使用するためのライブラリです。
+
+ rubyで実装したリゾルバは、timeout.rb の制御が効きます(つまり、名前解
+ 決中にThreadが切替え可能ということです)?????
+
+ require 'resolv'
+ p Resolv.new.getaddress("www.ruby-lang.org").to_s
+
+ => /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as method call
+ /usr/local/lib/ruby/1.6/resolv.rb:55: warning: instance variable @initialized not initialized
+ /usr/local/lib/ruby/1.6/resolv.rb:113: warning: instance variable @initialized not initialized
+ /usr/local/lib/ruby/1.6/resolv.rb:392: warning: instance variable @initialized not initialized
+ ruby 1.6.4 (2001-08-23) [i586-linux]
+ "210.251.121.214"
: Digest module
@@ -17,14 +107,45 @@
Fixed to check frozen and taint status before modifying.
+ cat = Struct.new("Cat", :name, :age, :life)
+ a = cat.new("cat", 12, 7).freeze
+ a.name = "dog"
+ p a
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ #<Struct::Cat name="dog", age=12, life=7>
+ => ruby 1.6.4 (2001-08-06) [i586-linux]
+ -:4:in `name=': can't modify frozen Struct (TypeError)
+ from -:4
+
+ cat = Struct.new("Cat", :name, :age, :life)
+ a = cat.new("cat", 12, 7)
+ Thread.new do
+ abort_on_exception = true
+ $SAFE = 4
+ a.life -= 1
+ end.join
+ p a.life
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ 6
+ => ruby 1.6.4 (2001-08-06) [i586-linux]
+ -:6:in `life=': Insecure: can't modify Struct (SecurityError)
+ from -:3:in `join'
+ from -:3
+
: String#rindex
Fixed with a bug when a regex is given. [ruby-dev:13843]
+ (enbug since 1.6.4 release)
+
+ p "foobar".rindex(/b/)
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ 3
+
+ => ruby 1.6.4 (2001-06-19) [i386-freebsd5.0]
+ nil
- "foobar".index("b") #=> 3
- "foobar".index(/b/) #=> 3
- "foobar".rindex("b") #=> 3
- "foobar".rindex(/b/) #=> nil <- ???
+ => ruby 1.6.4 (2001-08-06) [i586-linux]
+ 3
: require
@@ -46,10 +167,26 @@
Fixed to properly propagate taintness. [ruby-dev:13755]
+ "foo\nbar\n".taint.each_line {|v| p v.tainted?}
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ false
+ true
+ => ruby 1.6.4 (2001-08-06) [i586-linux]
+ true
+ true
+
: NKF::nkf
Fixed to properly propagate taintness. [ruby-dev:13754]
+ require 'nkf'
+ p NKF.nkf("-j", "a".taint).tainted?
+
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ false
+ => ruby 1.6.4 (2001-08-06) [i586-linux]
+ true
+
: ruby -x
Fixed with a bug that when a `-x' is specified the interpreter might exit
@@ -68,14 +205,29 @@
end
puts C.new.message(1,2,3) # raises ArgumentError
-: Readline::completion_append_characte
+: Readline::completion_append_character
: Readline::completion_append_character=
- Added.
+ Added.[ruby-ext:01760]
-: Socket::SO_*
+: Socket::Constants::SO_*
- Added.
+ Added below (if the system has them).
+
+ SO_PASSCRED
+ SO_PEERCRED
+ SO_RCVLOWAT
+ SO_SNDLOWAT
+ SO_RCVTIMEO
+ SO_SNDTIMEO
+ SO_SECURITY_AUTHENTICATION
+ SO_SECURITY_ENCRYPTION_TRANSPORT
+ SO_SECURITY_ENCRYPTION_NETWORK
+ SO_BINDTODEVICE
+ SO_ATTACH_FILTER
+ SO_DETACH_FILTER
+ SO_PEERNAME
+ SO_TIMESTAMP
: require / $LOAD_PATH
@@ -100,7 +252,7 @@
The previous behavior had a potential security risk because a
foo.rb (if exists) in the current directory is located prior to a
foo.so in $prefix/lib/ruby/site_ruby/$ver/$arch.
- [ruby-bugs (PR#140)]
+ [ruby-bugs (PR#140)], [ruby-ext:01778], [ruby-dev:13659]
: lib/sync.rb
: lib/mutex_m.rb
@@ -129,7 +281,7 @@
: $SAFE / def
Fixed so defining a new method is allowed under $SAFE == 4, which
- previously wasn't.
+ previously wasn't. ?????
ruby -e '$SAFE = 4; def a; end'
=> -e:1: Insecure operation `(null)' at level 4 (SecurityError)
@@ -138,7 +290,7 @@
Fixed to accept a Bignum as the second argument.
-Summary of the changes since 1.6.3:
+Summary of the changes since 1.6.3 (2001-03-19):
: Hash#replace
@@ -156,18 +308,62 @@
: $SAFE / File::unlink
- Changed to be forbidden under $SAFE >= 2.
+ Changed to be forbidden under $SAFE >= 2. [ruby-dev:13426]
+
+ touch foo
+ ruby -v -e '$SAFE=2;File.unlink("foo")'
+
+ => ruby 1.6.3 (2001-03-19) [i586-linux]
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ -e:1:in `unlink': Insecure operation `unlink' at level 2 (SecurityError)
+ from -e:1
+
+: Object#untaint
+
+ 凍結したオブジェクトに対してuntaintできないようにしました。[ruby-dev:13409]
+
+ a = Object.new
+ a.taint
+ a.freeze
+ a.untaint
+
+ => ruby 1.6.3 (2001-03-19) [i586-linux]
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ -:4:in `untaint': can't modify frozen object (TypeError)
+ from -:4
: ruby -T4
Fixed. ARGV is now properly marked as tainted so ruby -T4 no longer
fails in SecurityError.
+ touch foo
+ ruby-1.6.3 -v -T4 foo
+ => ruby 1.6.3 (2001-03-19) [i586-linux]
+ foo: Insecure: can't modify array (SecurityError)
+
: Regexp
Fixed. Now \1 .. \9 always mean backreferences, and referring to
unclosed/unmatched parentheses always fails.
+ p /(foo)\2/ =~ "foo\002"
+ => ruby 1.6.3 (2001-03-19) [i586-linux]
+ 0
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ 0
+ => ruby 1.6.4 (2001-08-23) [i586-linux]
+ nil
+
+ (上記の通り 1.6.4 にはまだバグがありました 2001-08-23 あたりで修正さ
+ れています [ruby-list:30975])
+
+ p /(foo\1)/ =~ "foo"
+ => ruby 1.6.3 (2001-03-19) [i586-linux]
+ 0
+ => ruby 1.6.4 (2001-06-04) [i586-linux]
+ nil
+
: String taint infection
Fixed for the following cases. [ruby-dev:13340]
@@ -200,6 +396,7 @@
Fixed so it adjusts a 1-element array when yielded from C API, as
well. Previously, the following code produced a wrong result:
+ [ruby-dev:13299]
class X
include Enumerable
@@ -219,36 +416,41 @@
: $SAFE / alias
Fixed so aliasing global variables is disallowed under $SAFE == 4.
- ((<ruby-dev:13287>))
+ [ruby-dev:13287]
: Open3::popen3
Fixed to do exit! instead of exit so the dying process does not
- invoke at_exit. ((<ruby-dev:13170>))
+ invoke at_exit. [ruby-dev:13170]
: SizedQueue#pop
Fixed so the following code does not cause a dead lock.
- ((<ruby-dev:13169>))
+ [ruby-dev:13169]
ruby -r thread -e 'q = SizedQueue.new(1); q.push(1);'
-e 'Thread.new{sleep 1; q.pop}; q.push(1);'
: SizedQueue#max=
- Fixed so it really works. ((<ruby-dev:13170>))
+ Fixed so it really works. [ruby-dev:13170]
: Queue
: SizedQueue
Fixed to rescue ThreadError in case the thread is dead just before
- calling Thread#run. ((<ruby-dev:13194>))
+ calling Thread#run. [ruby-dev:13194]
+
+: Ctrl-C (Interrupt)が効かなくなる
+[ruby-dev:13195]?????
+ (確認できる限りでは ruby-1.7.0 (2001-05-17) 以降で治ってますが、
+ 1.6 には取り込まれていません)
: Array#&
: Array#|
: Array#uniq
- Fixed so they do not freeze the elements. ((<ruby-list:29665>))
+ Fixed so they do not freeze the elements. [ruby-list:29665]
(%w(foo bar) & %w(foo baz))[0].upcase!
=> -:1:in `upcase!': can't modify frozen string (TypeError)
@@ -283,10 +485,14 @@
Support SIGINFO of 4.4BSD. [ruby-bugs-ja (PR#45)]
+: Segmentation fault at Thread.stop
+
+ Fixed so the Thread.stop cause SEGV. [ruby-dev:13189]
+
: Modifier rescue
Fixed so the following code does not emit a parse error any more.
- ((<ruby-dev:13073>)), ((<ruby-dev:13292>))
+ [ruby-dev:13073], [ruby-dev:13292]
raise "" rescue []
raise "" rescue (p "foo"; true)
@@ -311,12 +517,12 @@
: Module#const_set
Fixed so they do not access to anything other than constants.
- ((<ruby-dev:13019>))
+ [ruby-dev:13019]
: Marshal.dump
Improved so it dumps Float with better precision: "%.12g" -> "%.16g"
- ((<ruby-list:29349>))
+ [ruby-list:29349]
: Fixnum#[]
@@ -324,11 +530,11 @@
: Regular Expression
- Fixed with a couple of minor bugs. ((<ruby-talk:13658>)), ((<ruby-talk:13744>))
+ Fixed with a couple of minor bugs. [ruby-talk:13658], [ruby-talk:13744]
: retry
- Fixed so the following code works correctly again. ((<ruby-talk:13957>))
+ Fixed so the following code works correctly again. [ruby-talk:13957]
def WHILE(cond)
return if not cond
@@ -351,7 +557,7 @@
ruby 1.6.4 (2001-05-02) [i586-linux]
=> 012
-: ((<File::Stat>))#size
+: File::Stat#size
Fixed to return a correct value for files larger than 1G bytes.
@@ -367,30 +573,30 @@
# => ruby 1.6.4 (2001-04-19) [i586-linux]
1073741824
-: ((<Float>))#modulo, ((<Float>))#divmod
+: Float#modulo, Float#divmod
- Fixed. ((<ruby-dev:12718>))
+ Fixed. [ruby-dev:12718]
-: ((<ObjectSpace>))#_id2ref
+: ObjectSpace#_id2ref
Fixed so it does not raise a exception.
: recursive malloc problem
Fixed by preallocating a buffer for stdio using setvbuf().
- ((<ruby-dev:12795>))
+ [ruby-dev:12795]
-: ((<File>))#flock
+: File#flock
Fixed so it does not raise Errno::EACCES when the file to flock is
already locked. (only applicable to the platforms which lack
flock())
-: ((<File::Stat>)).new(filename)
+: File::Stat.new(filename)
- Added. ((<ruby-dev:12803>))
+ Added. [ruby-dev:12803]
-: ((<Bignum>))#% miscalculation
+: Bignum#% miscalculation
(Re-)Fixed.
@@ -407,7 +613,7 @@
0
0
-: ((<Marshal>))
+: Marshal
Fixed so a Bignum is properly restored through dump & load.
@@ -417,7 +623,7 @@
(`(({/}))') instead of backslash (`(({\}))') for separating
components.
-: ((<Dir>)).glob (win32)
+: Dir.glob (win32)
Fixed so it works for the current directory as well.
--
新井康司 (Koji Arai)