Re: [RFC PATCH 1/2] libselinux: replace strerror by %m

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 9, 2021 at 6:54 AM Christian Göttsche
<cgzones@xxxxxxxxxxxxxx> wrote:
>
> The standard function `strerror(3)` is not thread safe.  This does not
> only affect the concurrent usage of libselinux itself but also with
> other `strerror(3)` linked libraries.
> Use the thread safe GNU extension format specifier `%m`[1].
>
> libselinux already uses the GNU extension format specifier `%ms`.
>
> [1]: https://www.gnu.org/software/libc/manual/html_node/Other-Output-Conversions.html
>
> Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx>

Just FYI, we want libselinux to work with not only glibc but also
Android's bionic and ideally other major libc implementations like
musl.
In this case, it appears that they all support the %m extension these
days so I think this change is safe.




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux