Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <A914634C-F598-4187-A85A-03BBA280A884@gmail.com>
Date: Tue, 20 Aug 2024 11:50:02 +0200
From: Gil Pedersen <kanongil@...il.com>
To: musl@...ts.openwall.com
Subject: bug: isatty() can return wrong value

Hi,

I found a musl related issue in systemd, where it relies on glibc specific behaviour for isatty(), which happens to work out. When using musl, it will fail in another way, causing some essential retry logic to not run.

The error occurs when the isatty() implementation calls an ioctl() that sets the EIO error. glibc will directly forward any errors, while musl remaps it to an ENOTTY error.

Neither behaviour are POSIX compliant. glibc sets an undocumented errno, while musl sets ENOTTY for something that is definitely a TTY.

It seems that the correct fix is to remap the EIO to a success (1).

See https://github.com/systemd/systemd/pull/34039 and https://sourceware.org/bugzilla/show_bug.cgi?id=32103.

I'm not on the mailing list, so please CC any replies.

Regards,
Gil
Content of type "text/html" skipped

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.