BDB: specific build-time error for version 1 library
authorJeremy Harris <jgh146exb@wizmail.org>
Sat, 19 Mar 2022 17:18:30 +0000 (17:18 +0000)
committerJeremy Harris <jgh146exb@wizmail.org>
Sat, 19 Mar 2022 17:56:26 +0000 (17:56 +0000)
Broken-by: 990ba85353
src/src/auths/call_radius.c
src/src/dbstuff.h

index 1c048923ea7fa930892ab6dac07fc383efad9c33..8a3195cc16d13a7e11ea75c52ad9c73d06f687e2 100644 (file)
@@ -9,16 +9,6 @@
 /* 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 +34,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
 
 
index 510fe4f366d025f1fc06856beaaf5dc4d6ba0aa1..8ebf6f6e40e875234865473cc1f05eba497eabd8 100644 (file)
@@ -300,6 +300,8 @@ before use, but we don't have to free anything after reading data. */
 #  else /* DB_VERSION_MAJOR >= 3 */
 #   error Berkeley DB versions earlier than 3 are not supported */
 #  endif /* DB_VERSION_MAJOR */
+# else
+#  error Berkeley DB version 1 is no longer supported
 # endif /* DB_VERSION_STRING */