summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM. Sean Finney <seanius@users.sourceforge.net>2006-06-06 16:48:48 (GMT)
committerM. Sean Finney <seanius@users.sourceforge.net>2006-06-06 16:48:48 (GMT)
commit73255d1551f787151a518e35b1fbc175a4150133 (patch)
treeb63375d3d8ced443392242594a7771920aeb4910
parent84abd4c3eafc614738a5a6bb753f12e1e1c5d153 (diff)
downloadmonitoring-plugins-73255d1551f787151a518e35b1fbc175a4150133.tar.gz
modify the is_pg_dbname() function to allow databases with '-' in their name.
reference: sf tracker #1500752 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1414 f882894a-f735-0410-b71e-b25c423dba1c
-rw-r--r--plugins/check_pgsql.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index d56ce9b..8cfc1ab 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -329,9 +329,9 @@ is_pg_dbname (char *dbname)
329 return (FALSE); 329 return (FALSE);
330 strncpy (txt, dbname, NAMEDATALEN - 1); 330 strncpy (txt, dbname, NAMEDATALEN - 1);
331 txt[NAMEDATALEN - 1] = 0; 331 txt[NAMEDATALEN - 1] = 0;
332 if (sscanf (txt, "%[_a-zA-Z]%[^_a-zA-Z0-9]", tmp, tmp) == 1) 332 if (sscanf (txt, "%[_a-zA-Z]%[^_a-zA-Z0-9-]", tmp, tmp) == 1)
333 return (TRUE); 333 return (TRUE);
334 if (sscanf (txt, "%[_a-zA-Z]%[_a-zA-Z0-9]%[^_a-zA-Z0-9]", tmp, tmp, tmp) == 334 if (sscanf (txt, "%[_a-zA-Z]%[_a-zA-Z0-9-]%[^_a-zA-Z0-9-]", tmp, tmp, tmp) ==
335 2) return (TRUE); 335 2) return (TRUE);
336 return (FALSE); 336 return (FALSE);
337} 337}