Commit 56c85cbf authored by SZ Lin (林上智)'s avatar SZ Lin (林上智)

enable radcli for radius function

parent da067127
From: =?utf-8?b?IlNaIExpbiAo5p6X5LiK5pm6KSI=?= <szlin@debian.org>
Date: Fri, 4 May 2018 15:36:25 +0800
Subject: allow radcli in addition to freeradius-client to provide radius
authentication support
This patch is modified from [1].
[1] https://wald.intevation.org/tracker/index.php?func=detail&aid=6929&group_id=29&atid=220
---
misc/CMakeLists.txt | 22 +++++++++++++++-------
misc/radius.c | 6 ++++--
2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt
index 81b824c..bd9b609 100644
--- a/misc/CMakeLists.txt
+++ b/misc/CMakeLists.txt
@@ -45,14 +45,22 @@ if (NOT MINGW)
if (BUILD_WITH_RADIUS)
message (STATUS "Looking for freeradius-client library...")
- find_library (LIBRADIUS freeradius-client)
- if (NOT LIBRADIUS)
- message (SEND_ERROR " No freeradius-client library found")
- else (NOT LIBRADIUS)
- message (STATUS " Found ${LIBRADIUS} - radius support enabled")
+ find_library (LIBFREERADIUS freeradius-client)
+ if (NOT LIBFREERADIUS)
+ message (STATUS "Looking for radcli library...")
+ find_library (LIBRADCLI radcli)
+ endif (NOT LIBFREERADIUS)
+ if (NOT LIBFREERADIUS AND NOT LIBRADCLI)
+ message (SEND_ERROR " No suitable radius library found")
+ elseif (LIBFREERADIUS)
+ message (STATUS " Found ${LIBFREERADIUS} - radius support enabled")
set (RADIUS_LDFLAGS "-lfreeradius-client")
- add_definitions (-DENABLE_RADIUS_AUTH=1)
- endif (NOT LIBRADIUS)
+ add_definitions (-DENABLE_RADIUS_AUTH=1 -DRADIUS_AUTH_FREERADIUS=1)
+ elseif (LIBRADCLI)
+ message (STATUS " Found ${LIBRADCLI} - radius support enabled")
+ set (RADIUS_LDFLAGS "-lradcli")
+ add_definitions (-DENABLE_RADIUS_AUTH=1 -DRADIUS_AUTH_RADCLI=1)
+ endif (NOT LIBFREERADIUS AND NOT LIBRADCLI)
endif (BUILD_WITH_RADIUS)
if (NOT BUILD_WITHOUT_LDAP)
diff --git a/misc/radius.c b/misc/radius.c
index 14aeb33..1eb6136 100644
--- a/misc/radius.c
+++ b/misc/radius.c
@@ -23,9 +23,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
-#ifdef ENABLE_RADIUS_AUTH
-
+#ifdef RADIUS_AUTH_FREERADIUS
#include <freeradius-client.h>
+#elif defined(RADIUS_AUTH_RADCLI)
+#include <radcli/radcli.h>
+
#include "../base/openvas_networking.h"
#include <glib.h>
allow-radcli-in-addition-to-freeradius-client-to-provide-.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment