X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Message-ID: <d45df6780712201649mbe5e5f7o89efca27d6f27606@mail.gmail.com>
Date: Thu, 20 Dec 2007 19:49:38 -0500
From: "Mike Boone" <boonedocks@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Ruby on Rails 2.0.2/Cygwin Bug
In-Reply-To: <9ae083a20712201329s46afd5cm1cd6a350df368941@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
References: <d45df6780712191829xaab8c3kc844f16d04d247ad@mail.gmail.com> 	 <Pine.GSO.4.63.0712192355080.18738@access1.cims.nyu.edu> 	 <d45df6780712200728s19e1fbd6t4dbcc03e872f7685@mail.gmail.com> 	 <9ae083a20712201329s46afd5cm1cd6a350df368941@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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/

