ruby-changes:27601
From: nagachika <ko1@a...>
Date: Sat, 9 Mar 2013 21:26:28 +0900 (JST)
Subject: [ruby-changes:27601] nagachika:r39653 (ruby_2_0_0): merge revision(s) 39353: [Backport #8057]
nagachika 2013-03-09 21:26:17 +0900 (Sat, 09 Mar 2013) New Revision: 39653 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39653 Log: merge revision(s) 39353: [Backport #8057] * file.c (rb_group_member): added an error check. SUS says, getgroups(small_value) may return EINVAL. Modified directories: branches/ruby_2_0_0/ Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/file.c branches/ruby_2_0_0/version.h Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 39652) +++ ruby_2_0_0/ChangeLog (revision 39653) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Sat Mar 9 21:25:45 2013 KOSAKI Motohiro <kosaki.motohiro@g...> + + * file.c (rb_group_member): added an error check. SUS says, + getgroups(small_value) may return EINVAL. + Sat Mar 9 21:23:36 2013 KOSAKI Motohiro <kosaki.motohiro@g...> * process.c (RB_MAX_GROUPS): moved to Index: ruby_2_0_0/version.h =================================================================== --- ruby_2_0_0/version.h (revision 39652) +++ ruby_2_0_0/version.h (revision 39653) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1 #define RUBY_VERSION "2.0.0" #define RUBY_RELEASE_DATE "2013-03-09" -#define RUBY_PATCHLEVEL 22 +#define RUBY_PATCHLEVEL 23 #define RUBY_RELEASE_YEAR 2013 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_0_0/file.c =================================================================== --- ruby_2_0_0/file.c (revision 39652) +++ ruby_2_0_0/file.c (revision 39653) @@ -1036,7 +1036,7 @@ rb_group_member(GETGROUPS_T gid) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/file.c#L1036 while (groups <= RB_MAX_GROUPS) { gary = ALLOCV_N(GETGROUPS_T, v, groups); anum = getgroups(groups, gary); - if (anum != groups) + if (anum != -1 && anum != groups) break; groups *= 2; if (v) { @@ -1044,6 +1044,8 @@ rb_group_member(GETGROUPS_T gid) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/file.c#L1044 v = 0; } } + if (anum == -1) + return FALSE; while (--anum >= 0) { if (gary[anum] == gid) { Property changes on: ruby_2_0_0 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r39353 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/