diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-05 15:04:38 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-05 15:04:38 +0000 |
commit | 19b2909ee87c67fae96f77637b3245b81cbce722 (patch) | |
tree | 2476c22fe526baf4fe20e5da80f42bb419ba740a | |
parent | 7873c05684839a88b1b9fd61272f3e70af8e3ac4 (diff) |
* 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
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/securerandom.rb | 1 | ||||
-rw-r--r-- | random.c | 3 |
3 files changed, 7 insertions, 4 deletions
@@ -1,3 +1,10 @@ +Sat Feb 6 00:02:31 2010 Tanaka Akira <[email protected]> + + * 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 <[email protected]> * lib/delegate.rb (Delegator): include copy of Kernel. diff --git a/lib/securerandom.rb b/lib/securerandom.rb index fe0e005554..1c88a61fd7 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -64,7 +64,6 @@ module SecureRandom flags = File::RDONLY flags |= File::NONBLOCK if defined? File::NONBLOCK flags |= File::NOCTTY if defined? File::NOCTTY - flags |= File::NOFOLLOW if defined? File::NOFOLLOW begin File.open("/dev/urandom", flags) {|f| unless f.stat.chardev? @@ -472,9 +472,6 @@ fill_random_seed(unsigned int seed[DEFAULT_SEED_CNT]) #ifdef O_NOCTTY |O_NOCTTY #endif -#ifdef O_NOFOLLOW - |O_NOFOLLOW -#endif )) >= 0) { if (fstat(fd, &statbuf) == 0 && S_ISCHR(statbuf.st_mode)) { (void)read(fd, seed, DEFAULT_SEED_LEN); |