diff options
author | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-06-22 19:43:38 (GMT) |
---|---|---|
committer | Holger Weiss <holger@zedat.fu-berlin.de> | 2014-06-22 19:43:38 (GMT) |
commit | 7979837c0d337e11354935fbf5a82c329c18841f (patch) | |
tree | d2371b4082ee755c9c8389e0aab2b6cd239e917a /plugins/check_radius.c | |
parent | 0170bc48d17dbda24f681a24844fc0bbedad8477 (diff) | |
download | monitoring-plugins-7979837c0d337e11354935fbf5a82c329c18841f.tar.gz |
check_radius.c: Add newline to die() calls
Our die() function doesn't append a newline character to the message.
Diffstat (limited to 'plugins/check_radius.c')
-rw-r--r-- | plugins/check_radius.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/plugins/check_radius.c b/plugins/check_radius.c index 9394d26..b294347 100644 --- a/plugins/check_radius.c +++ b/plugins/check_radius.c | |||
@@ -169,7 +169,7 @@ main (int argc, char **argv) | |||
169 | str = strdup ("dictionary"); | 169 | str = strdup ("dictionary"); |
170 | if ((config_file && my_rc_read_config (config_file)) || | 170 | if ((config_file && my_rc_read_config (config_file)) || |
171 | my_rc_read_dictionary (my_rc_conf_str (str))) | 171 | my_rc_read_dictionary (my_rc_conf_str (str))) |
172 | die (STATE_UNKNOWN, _("Config file error")); | 172 | die (STATE_UNKNOWN, _("Config file error\n")); |
173 | 173 | ||
174 | service = PW_AUTHENTICATE_ONLY; | 174 | service = PW_AUTHENTICATE_ONLY; |
175 | 175 | ||
@@ -178,24 +178,24 @@ main (int argc, char **argv) | |||
178 | my_rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) && | 178 | my_rc_avpair_add (&data.send_pairs, PW_USER_NAME, username, 0) && |
179 | my_rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0) | 179 | my_rc_avpair_add (&data.send_pairs, PW_USER_PASSWORD, password, 0) |
180 | )) | 180 | )) |
181 | die (STATE_UNKNOWN, _("Out of Memory?")); | 181 | die (STATE_UNKNOWN, _("Out of Memory?\n")); |
182 | 182 | ||
183 | if (nasid != NULL) { | 183 | if (nasid != NULL) { |
184 | if (!(my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))) | 184 | if (!(my_rc_avpair_add (&data.send_pairs, PW_NAS_IDENTIFIER, nasid, 0))) |
185 | die (STATE_UNKNOWN, _("Invalid NAS-Identifier")); | 185 | die (STATE_UNKNOWN, _("Invalid NAS-Identifier\n")); |
186 | } | 186 | } |
187 | 187 | ||
188 | if (nasipaddress != NULL) { | 188 | if (nasipaddress != NULL) { |
189 | if (rc_good_ipaddr (nasipaddress)) | 189 | if (rc_good_ipaddr (nasipaddress)) |
190 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address")); | 190 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address\n")); |
191 | if ((client_id = rc_get_ipaddr(nasipaddress)) == 0) | 191 | if ((client_id = rc_get_ipaddr(nasipaddress)) == 0) |
192 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address")); | 192 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address\n")); |
193 | } else { | 193 | } else { |
194 | if ((client_id = my_rc_own_ipaddress ()) == 0) | 194 | if ((client_id = my_rc_own_ipaddress ()) == 0) |
195 | die (STATE_UNKNOWN, _("Can't find local IP for NAS-IP-Address")); | 195 | die (STATE_UNKNOWN, _("Can't find local IP for NAS-IP-Address\n")); |
196 | } | 196 | } |
197 | if (my_rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) == NULL) | 197 | if (my_rc_avpair_add (&(data.send_pairs), PW_NAS_IP_ADDRESS, &client_id, 0) == NULL) |
198 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address")); | 198 | die (STATE_UNKNOWN, _("Invalid NAS-IP-Address\n")); |
199 | 199 | ||
200 | my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval, | 200 | my_rc_buildreq (&data, PW_ACCESS_REQUEST, server, port, (int)timeout_interval, |
201 | retries); | 201 | retries); |
@@ -206,19 +206,19 @@ main (int argc, char **argv) | |||
206 | rc_avpair_free (data.receive_pairs); | 206 | rc_avpair_free (data.receive_pairs); |
207 | 207 | ||
208 | if (result == TIMEOUT_RC) | 208 | if (result == TIMEOUT_RC) |
209 | die (STATE_CRITICAL, _("Timeout")); | 209 | die (STATE_CRITICAL, _("Timeout\n")); |
210 | if (result == ERROR_RC) | 210 | if (result == ERROR_RC) |
211 | die (STATE_CRITICAL, _("Auth Error")); | 211 | die (STATE_CRITICAL, _("Auth Error\n")); |
212 | if (result == REJECT_RC) | 212 | if (result == REJECT_RC) |
213 | die (STATE_WARNING, _("Auth Failed")); | 213 | die (STATE_WARNING, _("Auth Failed\n")); |
214 | if (result == BADRESP_RC) | 214 | if (result == BADRESP_RC) |
215 | die (STATE_WARNING, _("Bad Response")); | 215 | die (STATE_WARNING, _("Bad Response\n")); |
216 | if (expect && !strstr (msg, expect)) | 216 | if (expect && !strstr (msg, expect)) |
217 | die (STATE_WARNING, "%s", msg); | 217 | die (STATE_WARNING, "%s\n", msg); |
218 | if (result == OK_RC) | 218 | if (result == OK_RC) |
219 | die (STATE_OK, _("Auth OK")); | 219 | die (STATE_OK, _("Auth OK\n")); |
220 | (void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result); | 220 | (void)snprintf(msg, sizeof(msg), _("Unexpected result code %d"), result); |
221 | die (STATE_UNKNOWN, "%s", msg); | 221 | die (STATE_UNKNOWN, "%s\n", msg); |
222 | } | 222 | } |
223 | 223 | ||
224 | 224 | ||