aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Stefan Becker <chemobejk@gmail.com>2018-05-02 12:05:08 +0300
committerGravatar Peter Korsgaard <peter@korsgaard.com>2018-05-03 23:24:43 +0200
commit36e19e3f6a5edb7b644e5269d2b07be3d44c5288 (patch)
tree866aa58e6f71535e421c7c750721c73766acf4fe
parent314c9050e525e6e1e19663415074ad0fdd972ab1 (diff)
downloadbuildroot-36e19e3f6a5edb7b644e5269d2b07be3d44c5288.tar.gz
buildroot-36e19e3f6a5edb7b644e5269d2b07be3d44c5288.tar.bz2
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 <chemobejk@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit 3c514c2dc5186c4357b2c0fc2e1c4b47e0f555c7) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/mkpasswd/mkpasswd.c5
1 files changed, 5 insertions, 0 deletions
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 <sys/time.h>
#endif
+/* glibc without crypt() */
+#ifndef _XOPEN_CRYPT
+#include <crypt.h>
+#endif
+
/* Application-specific */
#include "utils.h"