summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorTon Voon <ton.voon@opsera.com>2010-06-21 21:40:29 (GMT)
committerTon Voon <ton.voon@opsera.com>2010-06-21 21:40:29 (GMT)
commit10364a6004616c2e52852d80b1e1817056aa7119 (patch)
tree24ee913df772bd0b14b6e4e9252adc331aad20bb /lib/utils_base.c
parent72074a8f2e99d3a36899f7c5533f2bbe8c5e18cd (diff)
downloadmonitoring-plugins-10364a6004616c2e52852d80b1e1817056aa7119.tar.gz
Invalid chars in keyname now die()
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c
index 7027917..4e8d2ef 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -432,11 +432,11 @@ void np_enable_state(char *keyname, int expected_data_version) {
432 if(temp_keyname==NULL) 432 if(temp_keyname==NULL)
433 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno)); 433 die(STATE_UNKNOWN, _("Cannot execute strdup: %s"), strerror(errno));
434 } 434 }
435 /* Convert all non-alphanumerics to _ */ 435 /* Die if invalid characters used for keyname */
436 p = temp_keyname; 436 p = temp_keyname;
437 while(*p!='\0') { 437 while(*p!='\0') {
438 if(! isalnum(*p)) { 438 if(! (isalnum(*p) || *p == '_')) {
439 *p='_'; 439 die(STATE_UNKNOWN, _("Invalid character for keyname - only alphanumerics or '_'"));
440 } 440 }
441 p++; 441 p++;
442 } 442 }