SPDX: Mass-update to GPL-2.0-or-later
[exim.git] / src / src / auths / call_radius.c
index 9d10b34c69da804e330747714ebe98a55d11be1b..65882c1089a1af6a5d6be7d42f37a646090d7dab 100644 (file)
@@ -2,23 +2,14 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2022 */
 /* Copyright (c) University of Cambridge 1995 - 2016 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 /* This file was originally supplied by Ian Kirk. The libradius support came
 from Alex Kiernan. */
 
-/* ugly hack to work around redefinition of ENV by radiusclient.h and
- * db.h: define _DB_H_ so the db.h include thinks it's already included,
- * we can get away with it like this, since this file doesn't use any db
- * functions. */
-#ifndef _DB_H_
-# define _DB_H_ 1
-# define _DB_EXT_PROT_IN_ 1
-# define DB void
-#endif
-
 #include "../exim.h"
 
 /* This module contains functions that call the Radius authentication
@@ -44,17 +35,18 @@ static void dummy(int x) { dummy2(x-1); }
 using its original API. At release 0.4.0 the API changed. */
 
 #ifdef RADIUS_LIB_RADLIB
-  #include <radlib.h>
+include <radlib.h>
 #else
-  #if !defined(RADIUS_LIB_RADIUSCLIENT) && !defined(RADIUS_LIB_RADIUSCLIENTNEW)
-  # define RADIUS_LIB_RADIUSCLIENT
-  #endif
-
-  #ifdef RADIUS_LIB_RADIUSCLIENTNEW
-  # include <freeradius-client.h>
-  #else
-  # include <radiusclient.h>
-  #endif
+# if !defined(RADIUS_LIB_RADIUSCLIENT) && !defined(RADIUS_LIB_RADIUSCLIENTNEW)
+#  define RADIUS_LIB_RADIUSCLIENT
+# endif
+
+# ifdef RADIUS_LIB_RADIUSCLIENTNEW
+#  define ENV FREERADIUSCLIENT_ENV     /* Avoid clash with Berkeley DB */
+#  include <freeradius-client.h>
+# else
+#  include <radiusclient.h>
+# endif
 #endif