Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 244911 - sys-auth/nsvs-20070407: multiple bugs: getgrent skips group w/ many members, last group, & reconnect problem
Summary: sys-auth/nsvs-20070407: multiple bugs: getgrent skips group w/ many members, ...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Luca Longinotti (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-29 18:32 UTC by noah
Modified: 2010-06-03 07:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Multiple getgrent fixes (nsvs-fix-getgrent.patch,1.82 KB, patch)
2008-10-29 18:34 UTC, noah
Details | Diff
Manual reconnect code (nsvs-fix-nsvsd-reconnect.patch,812 bytes, patch)
2008-10-29 18:35 UTC, noah
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description noah 2008-10-29 18:32:02 UTC
With nsvs installed on a system with a large number of groups, some large (more than 15 members), any utility based on getgrent was failing to show the first large group encountered, and the last group. Other group functions are not affected. So, for example, "id <user>", works fine, but "getent group" or "groups user" do not work correctly.

The reason for this appears to be iterating the grent record (and/or the grent_rec counter) before returning with an EXHAUSTED_BUFFER/RETRY.  To correct this behavior, I had to add a buffer exhaustion check prior to loading the member list, and add code to decrement grent.cur_rec before returning a RETRY error. (There are essentially 2 bugs in the nsvsd getgrent function)

Also, the current reconnect behavior didn't seem to have any effect with our old (4.0.x) mysql client libraries, so I've also included a patch to manually attempt a reconnect.

I've posted these patches to the fssos-users mailing list, but, given the unmaintained state of this project, I don't know whether they'll get into CVS.  If they do not, I wanted to make sure they can be added to the ebuild, as they're fairly important.

I've been running these patches on an amd64 gentoo linux test server without any issues for a week or so now.

Reproducible: Always

Steps to Reproduce:
1. Create a large group with more than 15 members in your SQL backend
2. Run 'getent group'

Actual Results:  
As long as your group was large enough to prompt an "exhausted buffer" when loading the member list, it fails to appear in the output list.

Expected Results:  
All groups defined in the SQL tables should show up in the list of groups
Comment 1 noah 2008-10-29 18:34:32 UTC
Created attachment 170244 [details, diff]
Multiple getgrent fixes
Comment 2 noah 2008-10-29 18:35:04 UTC
Created attachment 170245 [details, diff]
Manual reconnect code
Comment 3 Wormo (RETIRED) gentoo-dev 2008-10-29 22:45:06 UTC
Thanks for submitting your fixes! You're right that upstream seems a little stale to say the least, and the mailing list seems pretty crowded with spam :(

Assigning to ebuild maintainer.
Comment 4 Torsten Veller (RETIRED) gentoo-dev 2010-06-03 07:19:31 UTC
Already treecleaned