--- plugins/check_radius.c.orig 2007-02-23 14:25:25.000000000 -0600
+++ plugins/check_radius.c 2007-02-23 14:26:50.000000000 -0600
@@ -43,7 +43,7 @@
#include "utils.h"
#include "netutils.h"
-#include <radiusclient.h>
+#include <radiusclient-ng.h>
int process_arguments (int, char **);
void print_help (void);
@@ -124,6 +124,7 @@
int result = STATE_UNKNOWN;
UINT4 client_id;
char *str;
+ rc_handle *rh;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
@@ -133,33 +134,32 @@
usage4 (_("Could not parse arguments"));
str = strdup ("dictionary");
- if ((config_file && rc_read_config (config_file)) ||
- rc_read_dictionary (rc_conf_str (str)))
+ if (!config_file || ((rh = rc_read_config(config_file)) == NULL))
die (STATE_UNKNOWN, _("Config file error"));
+
+ if (rc_read_dictionary(rh, rc_conf_str(rh, "dictionary")) != 0)
+ die (STATE_UNKNOWN, _("Config file error"));
service = PW_AUTHENTICATE_ONLY;
+ data.send_pairs = NULL;
+ data.receive_pairs = NULL;
memset (&data, 0, sizeof(data));
- if (!(rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0) &&
- rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) &&
- rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0) &&
- (nasid==NULL || rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))))
- die (STATE_UNKNOWN, _("Out of Memory?"));
/*
* Fill in NAS-IP-Address
*/
- if ((client_id = rc_own_ipaddress ()) == 0)
+ if ((client_id = rc_own_ipaddress (rh)) == 0)
return (ERROR_RC);
- if (rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) ==
+ if (rc_avpair_add (rh, &data.send_pairs, PW_NAS_IP_ADDRESS, &client_id, 0, 0) ==
NULL) return (ERROR_RC);
- rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval,
+ rc_buildreq (rh, &data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval,
retries);
- result = rc_send_server (&data, msg);
+ result = rc_send_server (rh, &data, msg);
rc_avpair_free (data.send_pairs);
if (data.receive_pairs)
rc_avpair_free (data.receive_pairs);
--- configure.orig 2007-02-23 14:24:52.000000000 -0600
+++ configure 2007-02-23 14:26:21.000000000 -0600
@@ -20983,13 +20983,13 @@
_SAVEDLIBS="$LIBS"
-echo "$as_me:$LINENO: checking for rc_read_config in -lradiusclient" >&5
-echo $ECHO_N "checking for rc_read_config in -lradiusclient... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for rc_read_config in -lradiusclient-ng" >&5
+echo $ECHO_N "checking for rc_read_config in -lradiusclient-ng... $ECHO_C" >&6
if test "${ac_cv_lib_radiusclient_rc_read_config+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lradiusclient $LIBS"
+LIBS="-lradiusclient-ng $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21051,13 +21051,13 @@
#define HAVE_LIBRADIUSCLIENT 1
_ACEOF
- LIBS="-lradiusclient $LIBS"
+ LIBS="-lradiusclient-ng $LIBS"
fi
if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
EXTRAS="$EXTRAS check_radius"
- RADIUSLIBS="-lradiusclient"
+ RADIUSLIBS="-lradiusclient-ng"
else
{ echo "$as_me:$LINENO: WARNING: Skipping radius plugin" >&5
--- configure.in.orig 2007-02-23 14:25:00.000000000 -0600
+++ configure.in 2007-02-23 14:26:31.000000000 -0600
@@ -199,7 +199,7 @@
AC_CHECK_LIB(radiusclient,rc_read_config)
if test "$ac_cv_lib_radiusclient_rc_read_config" = "yes"; then
EXTRAS="$EXTRAS check_radius"
- RADIUSLIBS="-lradiusclient"
+ RADIUSLIBS="-lradiusclient-ng"
AC_SUBST(RADIUSLIBS)
else
AC_MSG_WARN([Skipping radius plugin])