ocsev: define _XOPEN_SOURCE when search for or using crypt()
Resolves #544 Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
This commit is contained in:
parent
9808e5c51f
commit
796a524509
2 changed files with 57 additions and 1 deletions
net/ocserv
|
@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ocserv
|
PKG_NAME:=ocserv
|
||||||
PKG_VERSION:=0.8.8
|
PKG_VERSION:=0.8.8
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=2
|
||||||
|
|
||||||
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
|
||||||
|
|
|
@ -0,0 +1,56 @@
|
||||||
|
From ef48fe731f8b43c58b9580a048d793a69bd5a903 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Nikos Mavrogiannopoulos <nmav@gnutls.org>
|
||||||
|
Date: Sat, 29 Nov 2014 19:44:03 +0100
|
||||||
|
Subject: [PATCH] use define _XOPEN_SOURCE to get crypt()
|
||||||
|
|
||||||
|
---
|
||||||
|
configure.ac | 3 ++-
|
||||||
|
src/auth/plain.c | 3 +++
|
||||||
|
src/ocpasswd.c | 3 +++
|
||||||
|
3 files changed, 8 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 8bb0044..622929d 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -190,7 +190,8 @@ fi
|
||||||
|
|
||||||
|
gl_INIT
|
||||||
|
|
||||||
|
-AC_LIB_HAVE_LINKFLAGS(crypt,, [#include <unistd.h>], [crypt(0,0);])
|
||||||
|
+AC_LIB_HAVE_LINKFLAGS(crypt,, [#define _XOPEN_SOURCE
|
||||||
|
+#include <unistd.h>], [crypt(0,0);])
|
||||||
|
|
||||||
|
AC_ARG_WITH(utmp,
|
||||||
|
AS_HELP_STRING([--without-utmp], [do not use libutil for utmp support]),
|
||||||
|
diff --git a/src/auth/plain.c b/src/auth/plain.c
|
||||||
|
index f429ef4..0e13241 100644
|
||||||
|
--- a/src/auth/plain.c
|
||||||
|
+++ b/src/auth/plain.c
|
||||||
|
@@ -22,6 +22,9 @@
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
+#ifndef _XOPEN_SOURCE
|
||||||
|
+# define _XOPEN_SOURCE
|
||||||
|
+#endif
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <vpn.h>
|
||||||
|
#include <c-ctype.h>
|
||||||
|
diff --git a/src/ocpasswd.c b/src/ocpasswd.c
|
||||||
|
index 8b33d76..aced94a 100644
|
||||||
|
--- a/src/ocpasswd.c
|
||||||
|
+++ b/src/ocpasswd.c
|
||||||
|
@@ -23,6 +23,9 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
+#ifndef _XOPEN_SOURCE
|
||||||
|
+# define _XOPEN_SOURCE
|
||||||
|
+#endif
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <gnutls/gnutls.h>
|
||||||
|
#include <gnutls/crypto.h> /* for random */
|
||||||
|
--
|
||||||
|
2.1.3
|
||||||
|
|
Loading…
Reference in a new issue