diff options
Diffstat (limited to 'web/attachments/310361-nagios-1.4.13-no_pass.diff')
-rw-r--r-- | web/attachments/310361-nagios-1.4.13-no_pass.diff | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/web/attachments/310361-nagios-1.4.13-no_pass.diff b/web/attachments/310361-nagios-1.4.13-no_pass.diff new file mode 100644 index 0000000..b621967 --- /dev/null +++ b/web/attachments/310361-nagios-1.4.13-no_pass.diff | |||
@@ -0,0 +1,44 @@ | |||
1 | --- nagios-plugins-1.4.13/plugins/check_mysql.c 2008-08-16 00:47:32.000000000 -0400 | ||
2 | +++ nagios-plugins-1.4.13-no_pass/plugins/check_mysql.c 2009-01-23 18:10:48.000000000 -0500 | ||
3 | @@ -265,7 +265,7 @@ | ||
4 | return ERROR; | ||
5 | |||
6 | while (1) { | ||
7 | - c = getopt_long (argc, argv, "hvVSP:p:u:d:H:s:c:w:", longopts, &option); | ||
8 | + c = getopt_long (argc, argv, "hvVSP:p::u:d:H:s:c:w:", longopts, &option); | ||
9 | |||
10 | if (c == -1 || c == EOF) | ||
11 | break; | ||
12 | @@ -289,12 +289,16 @@ | ||
13 | db_user = optarg; | ||
14 | break; | ||
15 | case 'p': /* authentication information: password */ | ||
16 | - db_pass = strdup(optarg); | ||
17 | - | ||
18 | - /* Delete the password from process list */ | ||
19 | - while (*optarg != '\0') { | ||
20 | - *optarg = 'X'; | ||
21 | - optarg++; | ||
22 | + if (optarg == NULL) | ||
23 | + db_pass = strdup(""); | ||
24 | + else | ||
25 | + { | ||
26 | + db_pass = strdup(optarg); | ||
27 | + /* Delete the password from process list */ | ||
28 | + while (*optarg != '\0') { | ||
29 | + *optarg = 'X'; | ||
30 | + optarg++; | ||
31 | + } | ||
32 | } | ||
33 | break; | ||
34 | case 'P': /* critical time threshold */ | ||
35 | @@ -361,9 +365,6 @@ | ||
36 | if (db_host == NULL) | ||
37 | db_host = strdup(""); | ||
38 | |||
39 | - if (db_pass == NULL) | ||
40 | - db_pass = strdup(""); | ||
41 | - | ||
42 | if (db == NULL) | ||
43 | db = strdup(""); | ||
44 | |||