From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/439112-check_pgsql.c.patch | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 web/attachments/439112-check_pgsql.c.patch (limited to 'web/attachments/439112-check_pgsql.c.patch') diff --git a/web/attachments/439112-check_pgsql.c.patch b/web/attachments/439112-check_pgsql.c.patch new file mode 100644 index 0000000..62e2db4 --- /dev/null +++ b/web/attachments/439112-check_pgsql.c.patch @@ -0,0 +1,64 @@ +*** check_pgsql.c.old Thu Mar 22 09:58:45 2012 +--- check_pgsql.c Thu Mar 22 10:05:08 2012 +*************** +*** 32,37 **** +--- 32,39 ---- + const char *copyright = "1999-2007"; + const char *email = "nagiosplug-devel@lists.sourceforge.net"; + ++ #include ++ + #include "common.h" + #include "utils.h" + +*************** +*** 57,62 **** +--- 59,65 ---- + void print_help (void); + int is_pg_dbname (char *); + int is_pg_logname (char *); ++ int is_directory(char *); + + char *pghost = NULL; /* host name of the backend server */ + char *pgport = NULL; /* port of the backend server */ +*************** +*** 265,272 **** + twarn = strtod (optarg, NULL); + break; + case 'H': /* host */ +! if (!is_host (optarg)) +! usage2 (_("Invalid hostname/address"), optarg); + else + pghost = optarg; + break; +--- 268,275 ---- + twarn = strtod (optarg, NULL); + break; + case 'H': /* host */ +! if (!is_host (optarg) && !is_directory(optarg)) +! usage2 (_("Invalid hostname/address/directory"), optarg); + else + pghost = optarg; + break; +*************** +*** 411,416 **** +--- 414,432 ---- + -@@ + ******************************************************************************/ + ++ int ++ is_directory (char *pathname) ++ { ++ struct stat s; ++ ++ if (lstat(pathname, &s) != 0) ++ return (FALSE); ++ ++ if (S_ISDIR(s.st_mode)) ++ return (TRUE); ++ else ++ return (FALSE); ++ } + + + void -- cgit v1.2.3-74-g34f1