From 3a03e18340fd94cad88d0edeedc383aad2d107a3 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sat, 19 Mar 2022 17:18:30 +0000 Subject: [PATCH] BDB: specific build-time error for version 1 library Broken-by: 990ba85353 --- src/src/auths/call_radius.c | 31 +++++++++++-------------------- src/src/dbstuff.h | 2 ++ 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/src/auths/call_radius.c b/src/src/auths/call_radius.c index 1c048923e..8a3195cc1 100644 --- a/src/src/auths/call_radius.c +++ b/src/src/auths/call_radius.c @@ -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 +# include #else - #if !defined(RADIUS_LIB_RADIUSCLIENT) && !defined(RADIUS_LIB_RADIUSCLIENTNEW) - # define RADIUS_LIB_RADIUSCLIENT - #endif - - #ifdef RADIUS_LIB_RADIUSCLIENTNEW - # include - #else - # include - #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 +# else +# include +# endif #endif diff --git a/src/src/dbstuff.h b/src/src/dbstuff.h index 510fe4f36..8ebf6f6e4 100644 --- a/src/src/dbstuff.h +++ b/src/src/dbstuff.h @@ -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 */ -- 2.30.2