This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make getlogin_r thread safe


This change is wrong because it causes getutline_r to rewind on every call
and so only ever return the first match in the file.  That's not what the
function is defined to do, regardless of the fact that more than one match
for a line doesn't normally occur in utmp.

I have instead changed getlogin_r so that it holds the lock during the
entire search, by using the internal functions instead of __setutent et al.
This passes make check, but I have not done any real testing on a live system.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]