Bug 236647
Summary: | Etc.getgrgid broken? | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Kostas Georgiou <k.georgiou> | ||||||
Component: | ruby | Assignee: | Akira TAGOH <tagoh> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Bill Huang <bhuang> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 6 | CC: | jeff, lutter | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 1.8.5.52-1.fc6 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2007-09-10 21:50:36 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Kostas Georgiou
2007-04-16 22:39:11 UTC
Looking at the code it is obvious why it doesn't work. static VALUE etc_getgrgid(obj, id) VALUE obj, id; { #ifdef HAVE_GETGRENT gid_t gid; struct group *grp; rb_secure(4); gid = getgid(); grp = getgrgid(gid); if (grp == 0) rb_raise(rb_eArgError, "can't find group for %d", gid); return setup_group(grp); #else return Qnil; #endif } The attached patch, which reverts Etc::getgrgid to what's in both the 1.8.5 and 1.8.6 branches (no idea what happened with p35), seems to work .. at least on i386 .. at least with the very simple test of ruby -retc -e 'p Etc::getgrgid(1)' #<struct Struct::Group name="bin", passwd="x", gid=1, mem=["root", "bin", "daemon"]> Created attachment 152729 [details]
Patch promised in #3
Created attachment 152730 [details]
Trivial patch for spec file
Patch for ruby.spec
Looks like this bug has been fixed in Ruby SVN as well: http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ext/etc/etc.c?view=log#rev12071 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/tags/v1_8_5_39/ext/etc/etc.c?r1=11708&r2=12079&view=patch Thanks for certain info. Fixed in 1.8.5.52-1.fc6. sorry for taking a long time for this bug. |