Package: nagios-plugins<br>Priority: extra<br>Section: net<br>Architecture: amd64<br>Version: 1.4.4-1<br><br>Hello. check_radius plugin segfaults on invocation with commandline:<br>/usr/lib/nagios/plugins/check_radius -F /etc/radiusclient/radiusclient.conf -u test -p test -H localhost -t 10 -P 1812
<br><br>Debug with strace:<br>open("/etc/radiusclient/dictionary", O_RDONLY) = 3<br>fstat(3, {st_mode=S_IFREG|0644, st_size=7329, ...}) = 0<br>mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2abbf6c0e000
<br>read(3, "#\n# Updated 97/06/13 to livingst"..., 4096) = 4096<br>read(3, "\tCallback-Framed-User\t4\nVALUE\t\tS"..., 4096) = 3233<br>read(3, "", 4096) = 0<br>close(3) = 0
<br>munmap(0x2abbf6c0e000, 4096) = 0<br>--- SIGSEGV (Segmentation fault) @ 0 (0) ---<br>+++ killed by SIGSEGV +++<br><br>The problem is that neither valuepair data nor data_send are initialized.<br>So my patch works: (dpatch).
<br><br>#! /bin/sh /usr/share/dpatch/dpatch-run<br>## 26-check_radius.dpatch by <Yasper Casper <<a href="mailto:komputnik@gmail.com">komputnik@gmail.com</a>><br>##<br>## All lines beginning with `## DP:' are a description of the patch.
<br>## DP: No description.<br><br>@DPATCH@<br>--- nagios-plugins-1.4.4/plugins/check_radius.c 2006-06-20 13:17:02.000000000 +0200<br>+++ /var/cache/apt-build/build/nagios-plugins-1.4.4/plugins/check_radius.c 2006-11-20 12:22:
46.000000000 +0100<br>@@ -134,6 +134,14 @@<br> rc_read_dictionary (rc_conf_str (str)))<br> die (STATE_UNKNOWN, _("Config file error"));<br> <br>+ /*Initialize Value Pair to prevent segfault on rc_avpair_add.
<br>+ * debugging on radiuslib-ng show that the mem isn't allocated,<br>+ * and some random memory is in the USER-PASSWORD pair.<br>+ * So, after initialization, the password is filled with the correct values
<br>+ */<br>+ data.send_pairs = NULL;<br>+ data.receive_pairs = NULL;<br>+<br> service = PW_AUTHENTICATE_ONLY;<br> <br> if (!(rc_avpair_add (&data.send_pairs, PW_SERVICE_TYPE, &service, 0) &&
<br><br><br>Rgds. Y.a.s.p.e.r C.a.s.p.e.r<br>