Browse Source

ocsev: define _XOPEN_SOURCE when search for or using crypt()

Resolves #544

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Nikos Mavrogiannopoulos 10 years ago
parent
commit
796a524509

+ 1
- 1
net/ocserv/Makefile View File

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=ocserv
11 11
 PKG_VERSION:=0.8.8
12
-PKG_RELEASE:=1
12
+PKG_RELEASE:=2
13 13
 
14 14
 PKG_BUILD_DIR :=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
15 15
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz

+ 56
- 0
net/ocserv/patches/001-use-define-_XOPEN_SOURCE-to-get-crypt.patch View File

@@ -0,0 +1,56 @@
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
+---
7
+ configure.ac     | 3 ++-
8
+ src/auth/plain.c | 3 +++
9
+ src/ocpasswd.c   | 3 +++
10
+ 3 files changed, 8 insertions(+), 1 deletion(-)
11
+
12
+diff --git a/configure.ac b/configure.ac
13
+index 8bb0044..622929d 100644
14
+--- a/configure.ac
15
++++ b/configure.ac
16
+@@ -190,7 +190,8 @@ fi
17
+ 
18
+ gl_INIT
19
+ 
20
+-AC_LIB_HAVE_LINKFLAGS(crypt,, [#include <unistd.h>], [crypt(0,0);])
21
++AC_LIB_HAVE_LINKFLAGS(crypt,, [#define _XOPEN_SOURCE
22
++#include <unistd.h>], [crypt(0,0);])
23
+ 
24
+ AC_ARG_WITH(utmp,
25
+   AS_HELP_STRING([--without-utmp], [do not use libutil for utmp support]),
26
+diff --git a/src/auth/plain.c b/src/auth/plain.c
27
+index f429ef4..0e13241 100644
28
+--- a/src/auth/plain.c
29
++++ b/src/auth/plain.c
30
+@@ -22,6 +22,9 @@
31
+ #include <stdlib.h>
32
+ #include <string.h>
33
+ #include <syslog.h>
34
++#ifndef _XOPEN_SOURCE
35
++# define _XOPEN_SOURCE
36
++#endif
37
+ #include <unistd.h>
38
+ #include <vpn.h>
39
+ #include <c-ctype.h>
40
+diff --git a/src/ocpasswd.c b/src/ocpasswd.c
41
+index 8b33d76..aced94a 100644
42
+--- a/src/ocpasswd.c
43
++++ b/src/ocpasswd.c
44
+@@ -23,6 +23,9 @@
45
+ #include <string.h>
46
+ #include <stdlib.h>
47
+ #include <stdint.h>
48
++#ifndef _XOPEN_SOURCE
49
++# define _XOPEN_SOURCE
50
++#endif
51
+ #include <unistd.h>
52
+ #include <gnutls/gnutls.h>
53
+ #include <gnutls/crypto.h>	/* for random */
54
+-- 
55
+2.1.3
56
+