From: "reeze (reeze xia)" Date: 2012-08-07T01:48:00+09:00 Subject: [ruby-core:47022] [ruby-trunk - Bug #6831] test_getpwuid() on Mountain Lion Issue #6831 has been updated by reeze (reeze xia). Hi, I got a question about Etc.getpwnam && Etc.getgrnam in Mac OS X, Both of them will return a found entry for empty string "". Since they are related to Etc. so I posted here. 1.9.3p125 :007 > Etc.getpwnam("") => # 1.9.3p125 :008 > Etc.getgrnam("") => # This didn't happen in other OS��� Does OSX have an empty user and group ? Thanks ---------------------------------------- Bug #6831: test_getpwuid() on Mountain Lion https://bugs.ruby-lang.org/issues/6831#change-28681 Author: kosaki (Motohiro KOSAKI) Status: Closed Priority: Normal Assignee: nobu (Nobuyoshi Nakada) Category: ext Target version: 2.0.0 ruby -v: ruby 2.0.0dev (2012-08-04 trunk 36617) [x86_64-darwin12.0.0] When using Mountain Lion, following test failure occur. 1) Failure: test_getpwuid(TestEtc) [/ruby/git/test/etc/test_etc.rb:34]: <#> expected but was <#>. ------------------------------------------ getpwent() of Mountain Lion seems buggy. see below: test_getpwent.c ----------------------------------------- #include #include #include #include #include int main(void) { struct passwd *ent; while((ent = getpwent()) != NULL) { if (ent->pw_uid == 55) printf("%s:%d:%s\n", ent->pw_name, ent->pw_uid, ent->pw_gecos); } return 0; } result ---------------- _appleevents:55:AppleEvents Daemon _pcastagent:55:Podcast Producer Agent mrkn, what do you think? -- http://bugs.ruby-lang.org/