From: ts Date: 2001-11-30T00:28:41+09:00 Subject: [ruby-talk:26911] Re: Fixed ... partly ... maybe a bug? >>>>> "H" == Harry Ohlsen writes: H> OK. I discovered that I needed to do a "require 'etc.so'" and then it H> worked fine. ruby must give an error message in this case pigeon% ruby -e 'Etc.getpwnam("ts")' -e:1: uninitialized constant Etc (NameError) pigeon% H> However, I found a couple of problems. One is that I accidentally sent H> it something like "harryo/xyz" and it again hung, even with the necessary H> require of "etc.so". I'm always reluctant to say this, but that feels like a H> bug. Try this program and see if it hung pigeon% cat a.c #include #include #include main() { struct passwd *pwd = getpwnam("harryo/xyz"); if (pwd != NULL) printf("%s\n", pwd->pw_name); } pigeon% then try it with a valid uid H> The passwd field in the object it returns contains "x", which is what's H> in /etc/passwd to indicate that the password can be found in /etc/shadow. H> Maybe the code needs to be changed to understand shadow password files. why ? you want to try to crack the passwords ? :-))))) Guy Decoux