[Bug nscd/15139] New: getpwuid_r does not return ERANGE consistently
tsegismo at redhat dot com
sourceware-bugzilla@sourceware.org
Wed Feb 13 11:13:00 GMT 2013
http://sourceware.org/bugzilla/show_bug.cgi?id=15139
Bug #: 15139
Summary: getpwuid_r does not return ERANGE consistently
Product: glibc
Version: 2.12
Status: NEW
Severity: normal
Priority: P2
Component: nscd
AssignedTo: unassigned@sourceware.org
ReportedBy: tsegismo@redhat.com
CC: drepper.fsp@gmail.com
Classification: Unclassified
Hi,
I have a problem when calling getpwuid_r on a RHEL6 64 bit machine and as it
seems, it does not return ERANGE consistently.
Here are the details.
In my Java project we use a library called Sigar to do things we can't do with
pure Java code. In particular, we use Sigar to determine user name from user
id.
On a 64 bit RHEL6 machine, Sigar fails to find a particular user (hudson,
uid=600, LDAP database). The code involved uses getpwuid_r which returns
ERANGE.
I tried two things:
* I downloaded the library sources [1], changed the value of R_SIZE_MAX to 2048
and rebuilt it; then it worked
* I extracted the original code as a simple program [2] and kept original
R_SIZE_MAX value (1024); it was also able to find the user name (prints
'hudson')
How come the same piece of code works alone and not through the Sigar library?
May the code in getXXbyYY_r.c behave differently in different contexts?
getpwuid_r does not return ERANGE consistently?
Thanks for your help.
[1] http://tinyurl.com/d2hkgtq (see sigar_user_name_get function)
[2] http://pastebin.com/1bXycrnW
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list