This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Ruby on Rails 2.0.2/Cygwin Bug


On Dec 20, 2007 4:29 PM, Frodak Baksik <frodak17@gmail.com> wrote:
> On Dec 20, 2007 10:28 AM, Mike Boone  wrote:
> Can you access /dev/urandom outside of ruby?  It might be a simpler
> check to ensure that /dev/urandom is working.

I ran all the commands you suggested with no problems.

The problem function is this in the Rails code:
def generate_secret_with_urandom
  return File.read("/dev/urandom", 64).unpack("H*")[0]
end

If I put that function directly in its own Ruby code file and run it
from Cygwin, there is no problem, so I guess it has something to do
with how it's called.

Also, for some reason you can change the function to this in the Rails
code and everything works.

def generate_secret_with_urandom
  puts "meaningless output"
  return File.read("/dev/urandom", 64).unpack("H*")[0]
end

I'm going to re-strace things with the modified function and see what
the difference might be.

Mike Boone
http://boonedocks.net/mike/

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]