This is the mail archive of the
mailing list for the glibc project.
Re: NSS error reporting (bug 20532)
On 08/10/2017 07:39 PM, Carlos O'Donell wrote:
> On 08/04/2017 11:08 AM, Florian Weimer wrote:
>> In short, if we made this change, way too much code would break.
> I half expected this answer, which is why my original suggestion had
> save/restore errno and then modify it in the outbound case.
> We have a decision to make, and I would err on the side of caution,
> which means we have to break POSIX requirements here, and accept that
> getpwnam_r modifies errno in the event of an error even if POSIX says
> it doesn't, which means we change errno when the user isn't expecting.
I think POSIX allows us to clobber errno. The conformance issue arises
when we set errno to 0 on success. I'm not sure if we have to do this
for backwards compatibility.