diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_radius.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 37176257..b2f5732c 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c | |||
| @@ -63,6 +63,13 @@ void print_usage (void); | |||
| 63 | #define my_rc_avpair_add(a,b,c,d) rc_avpair_add(a, b, c, d) | 63 | #define my_rc_avpair_add(a,b,c,d) rc_avpair_add(a, b, c, d) |
| 64 | #define my_rc_read_dictionary(a) rc_read_dictionary(a) | 64 | #define my_rc_read_dictionary(a) rc_read_dictionary(a) |
| 65 | #endif | 65 | #endif |
| 66 | |||
| 67 | /* REJECT_RC is only defined in some version of radiusclient. It has | ||
| 68 | * been reported from radiusclient-ng 0.5.6 on FreeBSD 7.2-RELEASE */ | ||
| 69 | #ifndef REJECT_RC | ||
| 70 | #define REJECT_RC BADRESP_RC | ||
| 71 | #endif | ||
| 72 | |||
| 66 | int my_rc_read_config(char *); | 73 | int my_rc_read_config(char *); |
| 67 | 74 | ||
| 68 | char *server = NULL; | 75 | char *server = NULL; |
| @@ -195,13 +202,16 @@ main (int argc, char **argv) | |||
| 195 | die (STATE_CRITICAL, _("Timeout")); | 202 | die (STATE_CRITICAL, _("Timeout")); |
| 196 | if (result == ERROR_RC) | 203 | if (result == ERROR_RC) |
| 197 | die (STATE_CRITICAL, _("Auth Error")); | 204 | die (STATE_CRITICAL, _("Auth Error")); |
| 198 | if (result == BADRESP_RC) | 205 | if (result == REJECT_RC) |
| 199 | die (STATE_WARNING, _("Auth Failed")); | 206 | die (STATE_WARNING, _("Auth Failed")); |
| 207 | if (result == BADRESP_RC) | ||
| 208 | die (STATE_WARNING, _("Bad Response")); | ||
| 200 | if (expect && !strstr (msg, expect)) | 209 | if (expect && !strstr (msg, expect)) |
| 201 | die (STATE_WARNING, "%s", msg); | 210 | die (STATE_WARNING, "%s", msg); |
| 202 | if (result == OK_RC) | 211 | if (result == OK_RC) |
| 203 | die (STATE_OK, _("Auth OK")); | 212 | die (STATE_OK, _("Auth OK")); |
| 204 | return (0); | 213 | (void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result); |
| 214 | die (STATE_UNKNOWN, msg); | ||
| 205 | } | 215 | } |
| 206 | 216 | ||
| 207 | 217 | ||
