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(&quot;/etc/radiusclient/dictionary&quot;, 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, &quot;#\n# Updated 97/06/13 to livingst&quot;..., 4096) = 4096<br>read(3, &quot;\tCallback-Framed-User\t4\nVALUE\t\tS&quot;..., 4096) = 3233<br>read(3, &quot;&quot;, 4096)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0<br>close(3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 0
<br>munmap(0x2abbf6c0e000, 4096)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 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&nbsp; &lt;Yasper Casper &lt;<a href="mailto:komputnik@gmail.com">komputnik@gmail.com</a>&gt;<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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2006-11-20 12:22:
46.000000000 +0100<br>@@ -134,6 +134,14 @@<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rc_read_dictionary (rc_conf_str (str)))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; die (STATE_UNKNOWN, _(&quot;Config file error&quot;));<br>&nbsp;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*Initialize Value Pair to prevent segfault on rc_avpair_add.
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * debugging on radiuslib-ng show that the mem isn't allocated,<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * and some random memory is in the USER-PASSWORD pair.<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * So, after initialization, the password is filled with the correct values
<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data.send_pairs = NULL;<br>+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; data.receive_pairs = NULL;<br>+<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; service = PW_AUTHENTICATE_ONLY;<br>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!(rc_avpair_add (&amp;data.send_pairs, PW_SERVICE_TYPE, &amp;service, 0) &amp;&amp;
<br><br><br>Rgds. Y.a.s.p.e.r C.a.s.p.e.r<br>