From: "URABE Shyouhei aka.mput" Date: 2005-02-12T06:30:12+09:00 Subject: [ruby-dev:25675] Etc.getgrman が正しくない結果を返す --Apple-Mail-1-1001176731 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=ISO-2022-JP; format=flowed mput でございます。 Mac OS X で Etc.getgrman の結果が奇妙な事になっているのに気付きました。 % ruby -v -retc -e'p Etc.getgrnam("wheel")' ruby 1.9.0 (2005-02-11) [powerpc-darwin7.7.0] # これは、 HAVE_ST_GR_PASSWD のチェックが etc.c の中で対応していないためのようです。添付のパッチで正しい結果が帰ってくる事を確認しています。 % ruby -retc -e'p Etc.getgrnam("wheel")' # --Apple-Mail-1-1001176731 Content-Transfer-Encoding: 7bit Content-Type: application/octet-stream; x-unix-mode=0644; name="etc.patch" Content-Disposition: attachment; filename=etc.patch Index: ChangeLog =================================================================== RCS file: /src/ruby/ChangeLog,v retrieving revision 1.4003 diff -u -p -1 -w -r1.4003 ChangeLog --- ChangeLog 11 Feb 2005 08:42:56 -0000 1.4003 +++ ChangeLog 11 Feb 2005 21:27:41 -0000 @@ -1 +1,5 @@ +Sat Feb 12 06:18:28 2005 URABE Shyouhei + + * ext/etc/etc.c (Init_etc): sGroup needs HAVE_ST_GR_PASSWD check + Fri Feb 11 17:37:50 2005 GOTOU Yuuzou Index: ext/etc/etc.c =================================================================== RCS file: /src/ruby/ext/etc/etc.c,v retrieving revision 1.16 diff -u -p -1 -w -r1.16 etc.c --- ext/etc/etc.c 24 Nov 2003 10:42:17 -0000 1.16 +++ ext/etc/etc.c 11 Feb 2005 21:27:42 -0000 @@ -412,3 +412,7 @@ Init_etc() #ifdef HAVE_GETGRENT - sGroup = rb_struct_define("Group", "name", "passwd", "gid", "mem", NULL); + sGroup = rb_struct_define("Group", "name", +#ifdef HAVE_ST_GR_PASSWD + "passwd", +#endif + "gid", "mem", NULL); rb_global_variable(&sGroup); --Apple-Mail-1-1001176731--