* random.c (fill_random_seed): don't use O_NOFOLLOW because
/dev/urandom is a symlink in OpenSolaris. * lib/securerandom.rb (SecureRandom.random_bytes: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7873c05684
commit
19b2909ee8
@ -1,3 +1,10 @@
|
|||||||
|
Sat Feb 6 00:02:31 2010 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* random.c (fill_random_seed): don't use O_NOFOLLOW because
|
||||||
|
/dev/urandom is a symlink in OpenSolaris.
|
||||||
|
|
||||||
|
* lib/securerandom.rb (SecureRandom.random_bytes: ditto.
|
||||||
|
|
||||||
Fri Feb 5 16:38:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Feb 5 16:38:08 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* lib/delegate.rb (Delegator): include copy of Kernel.
|
* lib/delegate.rb (Delegator): include copy of Kernel.
|
||||||
|
@ -64,7 +64,6 @@ module SecureRandom
|
|||||||
flags = File::RDONLY
|
flags = File::RDONLY
|
||||||
flags |= File::NONBLOCK if defined? File::NONBLOCK
|
flags |= File::NONBLOCK if defined? File::NONBLOCK
|
||||||
flags |= File::NOCTTY if defined? File::NOCTTY
|
flags |= File::NOCTTY if defined? File::NOCTTY
|
||||||
flags |= File::NOFOLLOW if defined? File::NOFOLLOW
|
|
||||||
begin
|
begin
|
||||||
File.open("/dev/urandom", flags) {|f|
|
File.open("/dev/urandom", flags) {|f|
|
||||||
unless f.stat.chardev?
|
unless f.stat.chardev?
|
||||||
|
3
random.c
3
random.c
@ -471,9 +471,6 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT])
|
|||||||
#endif
|
#endif
|
||||||
#ifdef O_NOCTTY
|
#ifdef O_NOCTTY
|
||||||
|O_NOCTTY
|
|O_NOCTTY
|
||||||
#endif
|
|
||||||
#ifdef O_NOFOLLOW
|
|
||||||
|O_NOFOLLOW
|
|
||||||
#endif
|
#endif
|
||||||
)) >= 0) {
|
)) >= 0) {
|
||||||
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
|
if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user