[Nagiosplug-devel] [ nagiosplug-Bugs-1218438 ] check_radius.c: In function `main':
SourceForge.net
noreply at sourceforge.net
Mon Sep 24 02:44:16 CEST 2007
Bugs item #1218438, was opened at 2005-06-10 21:34
Message generated for change (Comment added) made by hweiss
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1218438&group_id=29880
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compilation
Group: None
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Sébastien Guay (sebasguay)
Assigned to: M. Sean Finney (seanius)
Summary: check_radius.c: In function `main':
Initial Comment:
When trying to compile on slackware I got the following
check_radius.c: In function `main':
check_radius.c:126: error: too few arguments to
function `rc_avpair_add'
check_radius.c:127: error: too few arguments to
function `rc_avpair_add'
check_radius.c:128: error: too few arguments to
function `rc_avpair_add'
check_radius.c:129: error: too few arguments to
function `rc_avpair_add'
check_radius.c:139: error: too few arguments to
function `rc_avpair_add'
check_radius.c:145: error: too few arguments to
function `rc_send_server'
make[2]: *** [check_radius.o] Error 1
make[2]: Leaving directory
`/usr/local/src/nagios-plugins-1.4/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/usr/local/src/nagios-plugins-1.4'
make: *** [all] Error 2
I uninstalled the package ppp-2.4.2-i486-2 and redo a
make and all was fine.
After I reinstalled ppp-2.4.2-i486-2.
ppp-2.4.2-i486-2 has a file radiusclient.h.
Sébas
----------------------------------------------------------------------
>Comment By: Holger Weiss (hweiss)
Date: 2007-09-24 02:44
Message:
Logged In: YES
user_id=759506
Originator: NO
Works fine for me with the old radiusclient library, too. Thanks a lot,
Matthias!
----------------------------------------------------------------------
Comment By: Thomas Guyot (dermoth)
Date: 2007-09-23 16:57
Message:
Logged In: YES
user_id=375623
Originator: NO
I confirm backward-compatibility with the old radiusclient library
On a side note I accidentally noticed it segfaults if the -u parameter is
not given (the segfault happens in the library, confirmed on multiple
releases dating as far as 1.4.3). You might want to make sure all required
parameters are enforced.
NB: Changed the resolution to Fixed.
----------------------------------------------------------------------
Comment By: Matthias Eble (psychotrahe)
Date: 2007-09-23 13:15
Message:
Logged In: YES
user_id=1694341
Originator: NO
I committed the changes as you proposed.
Nearly everything is implemented as defines, now.
Please check if everything works fine using the old library.
But I don't think there will be a problem.
The plugin has some strange option parsing. This should be changed imo.
if (argc == 9)
causes positional parameter parsing. Nobody expects that. It's a mess for
end users.
Thanks for your input, Holger
Matthias
----------------------------------------------------------------------
Comment By: Holger Weiss (hweiss)
Date: 2007-09-15 16:56
Message:
Logged In: YES
user_id=759506
Originator: NO
JFTR (as we chattet on this issue via IRC already): IMO both solutions are
just fine, though I'd prefer wrapper functions over #ifdefs. Most of the
wrapper functions could actually be replaced by simple macros, but I don't
really care. Thanks, Matthias! Please commit :-)
Holger
----------------------------------------------------------------------
Comment By: Matthias Eble (psychotrahe)
Date: 2007-08-07 23:33
Message:
Logged In: YES
user_id=1694341
Originator: NO
File Added: ifdef.patch
----------------------------------------------------------------------
Comment By: Matthias Eble (psychotrahe)
Date: 2007-08-07 23:32
Message:
Logged In: YES
user_id=1694341
Originator: NO
File Added: wrapper.patch
----------------------------------------------------------------------
Comment By: Matthias Eble (psychotrahe)
Date: 2007-08-07 23:31
Message:
Logged In: YES
user_id=1694341
Originator: NO
i made two patches for this one. one using ifdefs all the time rc_
functions are called and one using wrapper functions for the majority(the
incompatible) functions of radiusclient.
Please post your objections about which approach we should check in..
Matthias
File Added: configure.patch
----------------------------------------------------------------------
Comment By: Bob Ingraham (rwingraham)
Date: 2005-09-22 21:42
Message:
Logged In: YES
user_id=1086870
Here's the patch to check_radius.c in 'diff -u' format:
--- check_radius.c.ORIGINAL 2004-12-25
16:17:44.000000000 -0700
+++ check_radius.c 2005-09-19 16:03:49.000000000 -
0600
@@ -27,7 +27,7 @@
#include "utils.h"
#include "netutils.h"
-#include <radiusclient.h>
+#include <radiusclient-ng.h>
int process_arguments (int, char **);
void print_help (void);
@@ -108,6 +108,7 @@
int result = STATE_UNKNOWN;
UINT4 client_id;
char *str;
+ rc_handle *rch = NULL;
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
@@ -117,32 +118,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 && (rch = rc_read_config (config_file))) ||
+ rc_read_dictionary (rch, rc_conf_str (rch,
str)))
die (STATE_UNKNOWN, _("Config file error"));
service = PW_AUTHENTICATE_ONLY;
- 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))))
+ if (!(rc_avpair_add (rch, &data.send_pairs,
PW_SERVICE_TYPE, &service, -1, 0) &&
+ rc_avpair_add (rch, &data.send_pairs,
PW_USER_NAME, username, -1, 0) &&
+ rc_avpair_add (rch, &data.send_pairs,
PW_USER_PASSWORD, password, -1, 0) &&
+ (nasid==NULL || rc_avpair_add (rch,
&data.send_pairs, PW_NAS_IDENTIFIER, nasid, -1, 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 (rch)) == 0)
return (ERROR_RC);
- if (rc_avpair_add (&(data.send_pairs),
PW_NAS_IP_ADDRESS, &client_id, 0) ==
+ if (rc_avpair_add (rch, &(data.send_pairs),
PW_NAS_IP_ADDRESS, &client_id, -1, 0) ==
NULL) return (ERROR_RC);
- rc_buildreq (&data, PW_ACCESS_REQUEST, server,
port, (int)timeout_interval,
+ rc_buildreq (rch, &data, PW_ACCESS_REQUEST,
server, port, (int)timeout_interval,
retries);
- result = rc_send_server (&data, msg);
+ result = rc_send_server (rch, &data, msg);
rc_avpair_free (data.send_pairs);
if (data.receive_pairs)
rc_avpair_free (data.receive_pairs);
----------------------------------------------------------------------
Comment By: Bob Ingraham (rwingraham)
Date: 2005-09-22 21:36
Message:
Logged In: YES
user_id=1086870
I ran into this same problem.
The current radiusclient library (radiusclient-ng) has an
updated API which requires a "config-file-handle" first
argument to most of the API entry points.
I've updated check_radius.c to adhere to the new radiusclient-
ng API conventions. Assuming that you have this current
library installed, then check_radius.c compiles and link
cleanly now.
I don't see where I can attach the updated check_radius.c file
as an upload with this comment... Let me know how I can
send it in without opening a new case.
Note also that the configure script needs to be updated to
check for libradisclient-ng (instead of libradiusclient).
Bob
----------------------------------------------------------------------
Comment By: Bradley Hook (coder7)
Date: 2005-09-22 19:13
Message:
Logged In: YES
user_id=903812
Just an update to my previous post. I emailed the
distribution maintainer for Slackware, Patrick Volkerding.
Here is his response:
---begin quote---
Generally I won't move header files since their location
should be up to
the upstream maintainer(s), not me. In this case the version of
radiusclient is rather old though, and perhaps it's useless
to everyone
anyway and should simply be removed. You might try writing
to them to see
if they have an opinion about it, though. Also, even if I
were to keep
the functional parts of the included radiusclient I could
remove the
header, .a library, and .so symlink if everyone is using
radiusclient-ng
to compile against now anyway.
Anyway, thanks for the info. I'll ponder a bit whether
radiusclient is
useless on Slackware. (it is to me, but... :)
---end quote---
----------------------------------------------------------------------
Comment By: Bradley Hook (coder7)
Date: 2005-09-21 20:47
Message:
Logged In: YES
user_id=903812
Can we get a small note added to the README until a more
permanent solution is found? I will submit this to the
Slackware people to see if the radiusclient.h is even needed
in the ppp package, they might be able to remove it or move it.
----------------------------------------------------------------------
Comment By: M. Sean Finney (seanius)
Date: 2005-07-14 13:25
Message:
Logged In: YES
user_id=226838
hi,
thanks for the extra info. i'll try and look more into this
in the next couple of weeks, and see if i can do some voodoo
in autoconf to determine the correct prototypes and version
of radiusclient.
----------------------------------------------------------------------
Comment By: John Warburton (johnwarburton)
Date: 2005-07-14 03:05
Message:
Logged In: YES
user_id=1192023
Hi Guys
The problem isn't specific to Slackware. It is anyone that
runs with newer versions of the radiusclient library.
The REQUIREMENTS file says they can be found at
http://www.cityline.net/~lf/radius/ versions
radiusclient-0.3.1-1
That website no longer exists, but I have tracked down the
developer to
http://developer.berlios.de/projects/radiusclient-ng/
I was getting the same compile time errors on Solaris 8 with
radiusclient-0.4.9 as Sébastien. I downloaded an earlier
client library - radiusclient-0.3.3, which compiled, but I
have no idea on configuring, so doesn't seem to work.
It seems to me the radius client library has moved on, but
the Nagios plugin hasn't.
Since my site has moved to openradius, I will just use a
very simple shell script as a plugin to attempt login using
the openradius "radclient" program.
Regards
John
----------------------------------------------------------------------
Comment By: Sébastien Guay (sebasguay)
Date: 2005-07-05 20:11
Message:
Logged In: YES
user_id=265586
Hi Sean,
> this looks like a problem with slackware or the slackware
> package of ppp then. where is the radiusclient.h provided
> by your libradius package (or whatever the slackware
> equivalent is that provides radiusclient.h)?
The file radiusclient.h is part of the package ppp (or I
misunderstood your question?).
> i'm not sure why installing ppp would plop an include file
> used to build ppp in a compiler accessible directory in the
> first place,
Not sure either :)
> but unless you can provide a convincing reason
> why this is a problem with the nagios plugins, i'm going to
> close out the bug in a week's time.
My goal was not to convince anybody, it was just to let you
know that any Slackware user may have a problem to compile
nagios plugins if they have the ppp package installed. As I
said, the problem was easily solved on my side by
uninstalling ppp and re-installing it after.
Here's the definition of rc_avpair_add() function in the
radiusclient.h file in the ppp package
VALUE_PAIR *rc_avpair_add __P((VALUE_PAIR **, int, void *,
int, int));
and here's the call of rc_avpair_add in check_radius.c
rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0)
I don't know anything about libradius. Do you know what is
the *supposed* arguments number for rc_avpair_add()? If
it's 4, I can send a bug report to Patrick.
The radiusclient.h file is in attach.
Sébas
----------------------------------------------------------------------
Comment By: M. Sean Finney (seanius)
Date: 2005-06-28 04:06
Message:
Logged In: YES
user_id=226838
hi sebastien,
this looks like a problem with slackware or the slackware
package of ppp then. where is the radiusclient.h provided
by your libradius package (or whatever the slackware
equivalent is that provides radiusclient.h)?
i'm not sure why installing ppp would plop an include file
used to build ppp in a compiler accessible directory in the
first place, but unless you can provide a convincing reason
why this is a problem with the nagios plugins, i'm going to
close out the bug in a week's time.
thanks,
sean
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1218438&group_id=29880
More information about the Devel
mailing list