Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aqDSxqfFee4DUe2K@pirotess>
Date: Wed, 9 Sep 2026 05:30:14 +0200
From: Ismael Luceno <ismael@...ev.co.uk>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: [PATCH] catgets: Handle invalid catalog descriptor

On 08/Sep/2026 16:23, Rich Felker wrote:
> On Sat, Aug 29, 2026 at 02:52:24AM +0200, Ismael Luceno wrote:
> > On 28/Aug/2026 19:14, Rich Felker wrote:
> > <...> 
> > > Is this widespread behavior on all existing implementations other than
> > > musl that's just not standardized?
> > <...>
> > 
> > Yes, it's universal.
> 
> I looked and noticed that glibc is not setting errno in this case. Do
> the others?

Everyone providing an actual implementation sets errno to EBADF,
except for glibc.

> It seems harmful -- it's going to clobber any errno that
> might be about to be passed to strerror (or used by %m) printing an
> error message.
> 
> My leaning, if we're going to do this, would be to treat it not as an
> error condition but as a choice to define a case that's left
> undefined in the way other implementations define it.

I suppose it can't hurt, but writing portable sofware means saving
errno around this function anyway.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.