From: Stefan Becker Date: Wed, 2 May 2018 09:05:08 +0000 (+0300) Subject: host-mkpasswd: fix crash on Fedora 28 build host X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3c514c2dc5186c4357b2c0fc2e1c4b47e0f555c7;p=buildroot.git host-mkpasswd: fix crash on Fedora 28 build host crypt() is an optional glibc feature. Some distros, like Fedora 28, are phasing it out to be replaced with libxcrypt [1]. Unfortunately this change is only ABI compatible, not source code compatible, i.e. the code will compile with warnings about undefined crypt(), but the resulting binary will crash. Follow the guidance in the Fedora bug and include crypt.h when _XOPEN_CRYPT is not defined. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1566464 Signed-off-by: Stefan Becker Reviewed-by: "Yann E. MORIN" Signed-off-by: Thomas Petazzoni --- diff --git a/package/mkpasswd/mkpasswd.c b/package/mkpasswd/mkpasswd.c index 5820f32501..fd16230468 100644 --- a/package/mkpasswd/mkpasswd.c +++ b/package/mkpasswd/mkpasswd.c @@ -44,6 +44,11 @@ #include #endif +/* glibc without crypt() */ +#ifndef _XOPEN_CRYPT +#include +#endif + /* Application-specific */ #include "utils.h"