few fixes

This commit is contained in:
Sean Finney 2006-11-17 08:37:39 +00:00
parent 06c4a2abb7
commit 98af9a058a
5 changed files with 50 additions and 40 deletions

14
debian/changelog vendored
View file

@ -1,8 +1,16 @@
nagios-plugins (1.4.4-2) UNRELEASED; urgency=low
nagios-plugins (1.4.4-2) unstable; urgency=low
* NOT RELEASED YET
* fix for implicit definition of basename function, thanks to
dann frazier for finding it (closes: #396814).
patch: 26_implicit-basename.dpatch
* aparently the check_ups fix caused problems as well as solved them.
until we ge a real fix for the problem i'm reverting the patch.
thanks to Michael Bussmann (closes: #398767).
* add '-' to allowable characters in is_hostname. thanks again to
Michael Bussmann (closes: #398767).
patch: 27_is_hostname.dpatch
-- sean finney <seanius@debian.org> Wed, 1 Nov 2006 23:00:13 +0100
-- sean finney <seanius@debian.org> Fri, 17 Nov 2006 09:37:17 +0100
nagios-plugins (1.4.4-1) unstable; urgency=low

View file

@ -4,5 +4,6 @@
18_check_game_cmdline.dpatch
22_check_smb_hostaddress.dpatch
23_check_axis.dpatch
24_check_ups.dpatch
25_check_tcp-expect.dpatch
26_implicit-basename.dpatch
27_is_hostname.dpatch

View file

@ -1,36 +0,0 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 24_check_ups.dpatch by <seanius@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad nagios-plugins-1.4.4~/plugins/check_ups.c nagios-plugins-1.4.4/plugins/check_ups.c
--- nagios-plugins-1.4.4~/plugins/check_ups.c 2006-06-18 21:36:48.000000000 +0200
+++ nagios-plugins-1.4.4/plugins/check_ups.c 2006-11-01 20:17:30.000000000 +0100
@@ -393,13 +393,13 @@
/* char command[MAX_INPUT_BUFFER]; */
char temp_buffer[MAX_INPUT_BUFFER];
char send_buffer[MAX_INPUT_BUFFER];
- char *ptr;
+ char *ptr, *end = NULL;
int len;
*buf=0;
/* create the command string to send to the UPS daemon */
- sprintf (send_buffer, "GET VAR %s %s\n", ups_name, varname);
+ sprintf (send_buffer, "GET VAR %s %s\nLOGOUT\n", ups_name, varname);
/* send the command to the daemon and get a response back */
if (process_tcp_request
@@ -433,6 +433,9 @@
}
ptr = temp_buffer + strlen (varname) + strlen (ups_name) + 6;
+ end = strchr(ptr, '\n');
+ if (end)
+ *end = 0;
len = strlen(ptr);
if (len < 2 || ptr[0] != '"' || ptr[len-1] != '"') {
printf ("%s\n", _("Error: unable to parse variable"));

18
debian/patches/26_implicit-basename.dpatch vendored Executable file
View file

@ -0,0 +1,18 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 26-implicit-basename.dpatch by <seanius@localhost.localdomain>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad nagios-plugins-1.4.4~/plugins/check_procs.c nagios-plugins-1.4.4/plugins/check_procs.c
--- nagios-plugins-1.4.4~/plugins/check_procs.c 2006-10-19 02:25:16.000000000 +0200
+++ nagios-plugins-1.4.4/plugins/check_procs.c 2006-11-17 09:26:57.000000000 +0100
@@ -45,6 +45,7 @@
#include "utils.h"
#include <pwd.h>
+#include <dirname.h>
int process_arguments (int, char **);
int validate_arguments (void);

19
debian/patches/27_is_hostname.dpatch vendored Executable file
View file

@ -0,0 +1,19 @@
#! /bin/sh /usr/share/dpatch/dpatch-run
## 27_is_hostname.dpatch by <seanius@localhost.localdomain>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad nagios-plugins-1.4.4~/plugins-scripts/utils.pm.in nagios-plugins-1.4.4/plugins-scripts/utils.pm.in
--- nagios-plugins-1.4.4~/plugins-scripts/utils.pm.in 2006-10-19 20:44:53.000000000 +0200
+++ nagios-plugins-1.4.4/plugins-scripts/utils.pm.in 2006-11-17 09:36:05.000000000 +0100
@@ -76,7 +76,7 @@
sub is_hostname {
my $host1 = shift;
- if ($host1 && $host1 =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)*)$/) {
+ if ($host1 && $host1 =~ m/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*)$/) {
return 1;
}else{
return 0;