You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.4 KiB

  1. From ef48fe731f8b43c58b9580a048d793a69bd5a903 Mon Sep 17 00:00:00 2001
  2. From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
  3. Date: Sat, 29 Nov 2014 19:44:03 +0100
  4. Subject: [PATCH] use define _XOPEN_SOURCE to get crypt()
  5. ---
  6. configure.ac | 3 ++-
  7. src/auth/plain.c | 3 +++
  8. src/ocpasswd.c | 3 +++
  9. 3 files changed, 8 insertions(+), 1 deletion(-)
  10. diff --git a/configure.ac b/configure.ac
  11. index 8bb0044..622929d 100644
  12. --- a/configure.ac
  13. +++ b/configure.ac
  14. @@ -190,7 +190,8 @@ fi
  15. gl_INIT
  16. -AC_LIB_HAVE_LINKFLAGS(crypt,, [#include <unistd.h>], [crypt(0,0);])
  17. +AC_LIB_HAVE_LINKFLAGS(crypt,, [#define _XOPEN_SOURCE
  18. +#include <unistd.h>], [crypt(0,0);])
  19. AC_ARG_WITH(utmp,
  20. AS_HELP_STRING([--without-utmp], [do not use libutil for utmp support]),
  21. diff --git a/src/auth/plain.c b/src/auth/plain.c
  22. index f429ef4..0e13241 100644
  23. --- a/src/auth/plain.c
  24. +++ b/src/auth/plain.c
  25. @@ -22,6 +22,9 @@
  26. #include <stdlib.h>
  27. #include <string.h>
  28. #include <syslog.h>
  29. +#ifndef _XOPEN_SOURCE
  30. +# define _XOPEN_SOURCE
  31. +#endif
  32. #include <unistd.h>
  33. #include <vpn.h>
  34. #include <c-ctype.h>
  35. diff --git a/src/ocpasswd.c b/src/ocpasswd.c
  36. index 8b33d76..aced94a 100644
  37. --- a/src/ocpasswd.c
  38. +++ b/src/ocpasswd.c
  39. @@ -23,6 +23,9 @@
  40. #include <string.h>
  41. #include <stdlib.h>
  42. #include <stdint.h>
  43. +#ifndef _XOPEN_SOURCE
  44. +# define _XOPEN_SOURCE
  45. +#endif
  46. #include <unistd.h>
  47. #include <gnutls/gnutls.h>
  48. #include <gnutls/crypto.h> /* for random */
  49. --
  50. 2.1.3