From: Harry Ohlsen Date: 2001-11-30T00:14:32+09:00 Subject: [ruby-talk:26909] Fixed ... partly ... maybe a bug? In article <20011130.014233.786039021.2571@zipworld.com.au>, "Harry Ohlsen" wrote: > I was very pleased to find that the Etc module provided a getpwnam() > method to get at a passwd entry. > > However, when I tried to call it, my program hung at that point. Has > anyone seen this behaviour before or can someone suggest what might be > going on ... or how I could go about working that out myself? OK. I discovered that I needed to do a "require 'etc.so'" and then it worked fine. However, I found a couple of problems. One is that I accidentally sent it something like "harryo/xyz" and it again hung, even with the necessary require of "etc.so". I'm always reluctant to say this, but that feels like a bug. Secondly, on my Linux box, the passwords are stored in a shadow password file (/etc/shadow) and getpwnam() doesn't seem to know about that. The passwd field in the object it returns contains "x", which is what's in /etc/passwd to indicate that the password can be found in /etc/shadow. Maybe the code needs to be changed to understand shadow password files.