1 |
dertobi123 09/05/30 07:58:26 |
2 |
|
3 |
Added: nagios-plugins-1.4.13-mysqlpass-917fcc7.patch |
4 |
nagios-plugins-1.4.13-upslogout.patch |
5 |
Log: |
6 |
Revbump, fix #243384 and #253893 |
7 |
(Portage version: 2.2_rc33/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-mysqlpass-917fcc7.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-mysqlpass-917fcc7.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-mysqlpass-917fcc7.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: nagios-plugins-1.4.13-mysqlpass-917fcc7.patch |
16 |
=================================================================== |
17 |
From: Thomas Guyot-Sionnest <dermoth@×××.ca> |
18 |
Date: Wed, 20 May 2009 04:20:11 +0000 (-0400) |
19 |
Subject: Fix check_mysql* not using password set in my.cnf (#2531905 - Ben Timby) |
20 |
X-Git-Url: http://repo.or.cz/w/nagiosplugins.git?a=commitdiff_plain;h=917fcc7c302f67b42482a1a3e16e62f3b39d4e80 |
21 |
|
22 |
Fix check_mysql* not using password set in my.cnf (#2531905 - Ben Timby) |
23 |
--- |
24 |
|
25 |
diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c |
26 |
index 689648e..05d2b01 100644 |
27 |
--- a/plugins/check_mysql.c |
28 |
+++ b/plugins/check_mysql.c |
29 |
@@ -5,7 +5,7 @@ |
30 |
* License: GPL |
31 |
* Copyright (c) 1999 Didi Rieder (adrieder@×××××××××××××××.at) |
32 |
* Copyright (c) 2000 Karl DeBisschop (kdebisschop@×××××××××××××××××.net) |
33 |
-* Copyright (c) 1999-2007 Nagios Plugins Development Team |
34 |
+* Copyright (c) 1999-2009 Nagios Plugins Development Team |
35 |
* |
36 |
* Description: |
37 |
* |
38 |
@@ -358,9 +358,6 @@ validate_arguments (void) |
39 |
if (db_host == NULL) |
40 |
db_host = strdup(""); |
41 |
|
42 |
- if (db_pass == NULL) |
43 |
- db_pass = strdup(""); |
44 |
- |
45 |
if (db == NULL) |
46 |
db = strdup(""); |
47 |
|
48 |
@@ -417,6 +414,9 @@ print_help (void) |
49 |
printf ("\n"); |
50 |
printf ("%s\n", _("Notes:")); |
51 |
printf (_(UT_EXTRA_OPTS_NOTES)); |
52 |
+ printf ("\n"); |
53 |
+ printf (" %s\n", _("You must specify -p with an empty string to force an empty password,")); |
54 |
+ printf (" %s\n", _("overriding any my.cnf settings.")); |
55 |
#endif |
56 |
|
57 |
printf (_(UT_SUPPORT)); |
58 |
diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c |
59 |
index 802e345..47dd861 100644 |
60 |
--- a/plugins/check_mysql_query.c |
61 |
+++ b/plugins/check_mysql_query.c |
62 |
@@ -3,7 +3,7 @@ |
63 |
* Nagios check_mysql_query plugin |
64 |
* |
65 |
* License: GPL |
66 |
-* Copyright (c) 2006-2007 Nagios Plugins Development Team |
67 |
+* Copyright (c) 2006-2009 Nagios Plugins Development Team |
68 |
* Original code from check_mysql, copyright 1999 Didi Rieder |
69 |
* |
70 |
* Description: |
71 |
@@ -266,9 +266,6 @@ validate_arguments (void) |
72 |
if (db_host == NULL) |
73 |
db_host = strdup(""); |
74 |
|
75 |
- if (db_pass == NULL) |
76 |
- db_pass = strdup(""); |
77 |
- |
78 |
if (db == NULL) |
79 |
db = strdup(""); |
80 |
|
81 |
@@ -317,6 +314,9 @@ print_help (void) |
82 |
printf ("\n"); |
83 |
printf ("%s\n", _("Notes:")); |
84 |
printf (_(UT_EXTRA_OPTS_NOTES)); |
85 |
+ printf ("\n"); |
86 |
+ printf (" %s\n", _("You must specify -p with an empty string to force an empty password,")); |
87 |
+ printf (" %s\n", _("overriding any my.cnf settings.")); |
88 |
#endif |
89 |
|
90 |
printf (_(UT_SUPPORT)); |
91 |
|
92 |
|
93 |
|
94 |
1.1 net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-upslogout.patch |
95 |
|
96 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-upslogout.patch?rev=1.1&view=markup |
97 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-analyzer/nagios-plugins/files/nagios-plugins-1.4.13-upslogout.patch?rev=1.1&content-type=text/plain |
98 |
|
99 |
Index: nagios-plugins-1.4.13-upslogout.patch |
100 |
=================================================================== |
101 |
diff --git a/plugins/check_ups.c b/plugins/check_ups.c |
102 |
index 154508d..bbd963a 100644 |
103 |
--- a/plugins/check_ups.c |
104 |
+++ b/plugins/check_ups.c |
105 |
@@ -398,12 +398,15 @@ get_ups_variable (const char *varname, char *buf, size_t buflen) |
106 |
char temp_buffer[MAX_INPUT_BUFFER]; |
107 |
char send_buffer[MAX_INPUT_BUFFER]; |
108 |
char *ptr; |
109 |
+ char *logout = "OK Goodbye\n"; |
110 |
+ int logout_len = strlen(logout); |
111 |
int len; |
112 |
|
113 |
*buf=0; |
114 |
|
115 |
/* create the command string to send to the UPS daemon */ |
116 |
- sprintf (send_buffer, "GET VAR %s %s\n", ups_name, varname); |
117 |
+ /* Add LOGOUT to avoid read failure logs */ |
118 |
+ sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname); |
119 |
|
120 |
/* send the command to the daemon and get a response back */ |
121 |
if (process_tcp_request |
122 |
@@ -415,6 +418,7 @@ get_ups_variable (const char *varname, char *buf, size_t buflen) |
123 |
|
124 |
ptr = temp_buffer; |
125 |
len = strlen(ptr); |
126 |
+ if (len > logout_len && strcmp (ptr + len - logout_len, logout) == 0) len -= logout_len; |
127 |
if (len > 0 && ptr[len-1] == '\n') ptr[len-1]=0; |
128 |
if (strcmp (ptr, "ERR UNKNOWN-UPS") == 0) { |
129 |
printf (_("CRITICAL - no such ups '%s' on that host\n"), ups_name); |