summaryrefslogtreecommitdiffstats
path: root/plugins/check_pgsql.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_pgsql.c')
-rw-r--r--plugins/check_pgsql.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c
index 2eb699e..b8fc5f1 100644
--- a/plugins/check_pgsql.c
+++ b/plugins/check_pgsql.c
@@ -34,6 +34,7 @@ const char *email = "devel@monitoring-plugins.org";
34 34
35#include "common.h" 35#include "common.h"
36#include "utils.h" 36#include "utils.h"
37#include "utils_cmd.h"
37 38
38#include "netutils.h" 39#include "netutils.h"
39#include <libpq-fe.h> 40#include <libpq-fe.h>
@@ -346,7 +347,7 @@ process_arguments (int argc, char **argv)
346 if (!is_pg_dbname (optarg)) /* checks length and valid chars */ 347 if (!is_pg_dbname (optarg)) /* checks length and valid chars */
347 usage2 (_("Database name is not valid"), optarg); 348 usage2 (_("Database name is not valid"), optarg);
348 else /* we know length, and know optarg is terminated, so us strcpy */ 349 else /* we know length, and know optarg is terminated, so us strcpy */
349 strcpy (dbName, optarg); 350 snprintf(dbName, NAMEDATALEN, "%s", optarg);
350 break; 351 break;
351 case 'l': /* login name */ 352 case 'l': /* login name */
352 if (!is_pg_logname (optarg)) 353 if (!is_pg_logname (optarg))
@@ -565,7 +566,7 @@ print_help (void)
565 566
566 printf (" %s\n", _("Typically, the monitoring user (unless the --logname option is used) should be")); 567 printf (" %s\n", _("Typically, the monitoring user (unless the --logname option is used) should be"));
567 printf (" %s\n", _("able to connect to the database without a password. The plugin can also send")); 568 printf (" %s\n", _("able to connect to the database without a password. The plugin can also send"));
568 printf (" %s\n", _("a password, but no effort is made to obsure or encrypt the password.")); 569 printf (" %s\n", _("a password, but no effort is made to obscure or encrypt the password."));
569 570
570 printf (UT_SUPPORT); 571 printf (UT_SUPPORT);
571} 572}