diff --git a/nut-ipv6.patch b/nut-ipv6.patch index 9128896..90f7077 100644 --- a/nut-ipv6.patch +++ b/nut-ipv6.patch @@ -1,5 +1,5 @@ ---- nut-2.0.3/server/access.c.ipv6 2006-10-24 11:16:43.000000000 +0200 -+++ nut-2.0.3/server/access.c 2006-10-24 11:06:41.000000000 +0200 +--- nut-2.0.5/server/access.c.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/server/access.c 2007-01-23 10:11:31.000000000 -0500 @@ -25,33 +25,72 @@ #include "common.h" #include "access.h" @@ -181,8 +181,8 @@ if (last == NULL) /* first */ acl_head = tmp; ---- nut-2.0.3/server/user.c.ipv6 2006-10-24 11:16:54.000000000 +0200 -+++ nut-2.0.3/server/user.c 2006-10-23 23:15:30.000000000 +0200 +--- nut-2.0.5/server/user.c.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/server/user.c 2007-01-23 10:11:31.000000000 -0500 @@ -290,7 +290,7 @@ users = NULL; } @@ -210,8 +210,8 @@ const char *un, const char *pw, const char *action) { ulist_t *tmp = users; ---- nut-2.0.3/server/user.h.ipv6 2006-10-24 11:17:17.000000000 +0200 -+++ nut-2.0.3/server/user.h 2006-10-23 23:16:10.000000000 +0200 +--- nut-2.0.5/server/user.h.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/server/user.h 2007-01-23 10:11:31.000000000 -0500 @@ -19,10 +19,10 @@ void user_load(void); @@ -225,8 +225,8 @@ const char *un, const char *pw, const char *action); void user_flush(void); ---- nut-2.0.3/server/ctype.h.ipv6 2006-10-24 11:17:47.000000000 +0200 -+++ nut-2.0.3/server/ctype.h 2006-10-22 17:01:30.000000000 +0200 +--- nut-2.0.5/server/ctype.h.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/server/ctype.h 2007-01-23 10:11:31.000000000 -0500 @@ -32,7 +32,7 @@ char *addr; int fd; @@ -236,8 +236,8 @@ char rq[SMALLBUF]; size_t rqpos; char *loginups; ---- nut-2.0.3/server/upsd.c.ipv6 2006-10-24 11:16:32.000000000 +0200 -+++ nut-2.0.3/server/upsd.c 2006-10-24 11:26:24.000000000 +0200 +--- nut-2.0.5/server/upsd.c.IPv6 2006-12-29 16:29:35.000000000 -0500 ++++ nut-2.0.5/server/upsd.c 2007-01-23 10:11:31.000000000 -0500 @@ -26,6 +26,7 @@ #include @@ -280,7 +280,7 @@ /* return a pointer to the named ups if possible */ upstype *get_ups_ptr(const char *name) { -@@ -131,35 +150,63 @@ +@@ -131,35 +150,62 @@ /* create a listening socket for tcp connections */ static void setuptcp(void) { @@ -290,13 +290,13 @@ int res, one = 1; - if ((listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) -- fatal("socket"); +- fatal_with_errno("socket"); - - res = setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (void *) &one, - sizeof(one)); - - if (res != 0) -- fatal("setsockopt(SO_REUSEADDR)"); +- fatal_with_errno("setsockopt(SO_REUSEADDR)"); - - memset(&server, '\0', sizeof(server)); - server.sin_addr = listenaddr; @@ -304,13 +304,16 @@ - server.sin_port = htons(net_port); - - if (bind(listenfd, (struct sockaddr *) &server, sizeof(server)) == -1) -- fatal("Can't bind TCP port number %d", net_port); +- fatal_with_errno("Can't bind TCP port number %d", net_port); +- +- if ((res = fcntl(listenfd, F_GETFL, 0)) == -1) +- fatal_with_errno("fcntl(get)"); + memset (&hints, 0, sizeof (struct addrinfo)); + hints.ai_family = opt_af; + hints.ai_flags = AI_PASSIVE; + hints.ai_protocol = IPPROTO_TCP; + hints.ai_socktype = SOCK_STREAM; -+ ++ + service = malloc (sizeof (char) * 6); + if (service == NULL) + fatal("malloc"); @@ -331,9 +334,6 @@ + fatal("socket"); + continue; + } - -- if ((res = fcntl(listenfd, F_GETFL, 0)) == -1) -- fatal("fcntl(get)"); + res = setsockopt(listenfd, SOL_SOCKET, SO_REUSEADDR, (void *) &one, sizeof(one)); + if (res != 0) + fatal("setsockopt(SO_REUSEADDR)"); @@ -346,12 +346,12 @@ + } - if (fcntl(listenfd, F_SETFL, res | O_NDELAY) == -1) -- fatal("fcntl(set)"); +- fatal_with_errno("fcntl(set)"); + if ((res = fcntl(listenfd, F_GETFL, 0)) == -1) + fatal("fcntl(get)"); - if (listen(listenfd, 16)) -- fatal("listen"); +- fatal_with_errno("listen"); + if (fcntl(listenfd, F_SETFL, res | O_NDELAY) == -1) + fatal("fcntl(set)"); @@ -367,7 +367,7 @@ return; } -@@ -412,7 +459,7 @@ +@@ -412,7 +458,7 @@ static void answertcp(void) { int acc; @@ -376,7 +376,7 @@ ctype *tmp, *last; socklen_t clen; -@@ -424,7 +471,7 @@ +@@ -424,7 +470,7 @@ if (!access_check(&csock)) { upslogx(LOG_NOTICE, "Rejecting TCP connection from %s", @@ -385,7 +385,7 @@ shutdown(acc, shutdown_how); close(acc); return; -@@ -439,10 +486,10 @@ +@@ -439,10 +485,10 @@ tmp = xmalloc(sizeof(ctype)); @@ -398,7 +398,7 @@ tmp->rqpos = 0; memset(tmp->rq, '\0', sizeof(tmp->rq)); -@@ -463,7 +510,7 @@ +@@ -463,7 +509,7 @@ else last->next = tmp; @@ -407,7 +407,7 @@ } /* read tcp messages and handle them */ -@@ -668,6 +715,8 @@ +@@ -668,6 +714,8 @@ printf(" -r chroots to \n"); printf(" -u switch to (if started as root)\n"); printf(" -V display the version of this software\n"); @@ -416,7 +416,7 @@ exit(EXIT_SUCCESS); } -@@ -819,13 +868,11 @@ +@@ -737,13 +785,11 @@ datapath = xstrdup(DATADIR); /* set up some things for later */ @@ -431,17 +431,17 @@ switch (i) { case 'h': help(progname); -@@ -834,8 +881,7 @@ +@@ -752,8 +798,7 @@ net_port = atoi(optarg); break; case 'i': - if (!inet_aton(optarg, &listenaddr)) -- fatal("Invalid IP address"); +- fatal_with_errno("Invalid IP address"); + listenaddr = xstrdup (optarg); break; case 'r': chroot_path = optarg; -@@ -866,6 +912,15 @@ +@@ -784,6 +829,15 @@ do_background = 0; nut_debug_level++; break; @@ -457,8 +457,8 @@ default: help(progname); break; ---- nut-2.0.3/server/access.h.ipv6 2006-10-24 11:17:25.000000000 +0200 -+++ nut-2.0.3/server/access.h 2006-10-22 20:14:23.000000000 +0200 +--- nut-2.0.5/server/access.h.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/server/access.h 2007-01-23 10:11:31.000000000 -0500 @@ -26,8 +26,8 @@ /* ACL structure */ struct acl_t { @@ -481,8 +481,8 @@ void acl_add(const char *aclname, char *ipblock); void access_add(int type, int numargs, const char **arg); void acl_free(void); ---- nut-2.0.3/clients/upsclient.h.ipv6 2006-10-24 11:15:38.000000000 +0200 -+++ nut-2.0.3/clients/upsclient.h 2006-10-22 01:52:46.000000000 +0200 +--- nut-2.0.5/clients/upsclient.h.IPv6 2005-02-28 04:14:07.000000000 -0500 ++++ nut-2.0.5/clients/upsclient.h 2007-01-23 10:11:31.000000000 -0500 @@ -148,6 +148,8 @@ #define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */ @@ -492,8 +492,8 @@ #ifdef __cplusplus } ---- nut-2.0.3/clients/upsc.c.ipv6 2006-10-24 11:15:20.000000000 +0200 -+++ nut-2.0.3/clients/upsc.c 2006-10-22 01:32:39.000000000 +0200 +--- nut-2.0.5/clients/upsc.c.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/clients/upsc.c 2007-01-23 10:11:31.000000000 -0500 @@ -25,6 +25,9 @@ #include "upsclient.h" @@ -504,8 +504,8 @@ static void help(const char *prog) { printf("Network UPS Tools upsc %s\n\n", UPS_VERSION); ---- nut-2.0.3/clients/upsclient.c.ipv6 2006-10-24 11:15:44.000000000 +0200 -+++ nut-2.0.3/clients/upsclient.c 2006-10-24 10:49:04.000000000 +0200 +--- nut-2.0.5/clients/upsclient.c.IPv6 2005-01-27 09:33:14.000000000 -0500 ++++ nut-2.0.5/clients/upsclient.c 2007-01-23 10:11:31.000000000 -0500 @@ -38,6 +38,8 @@ #define shutdown_how 2 #endif diff --git a/nut.spec b/nut.spec index 73b4850..e4e388c 100644 --- a/nut.spec +++ b/nut.spec @@ -10,8 +10,8 @@ Summary: Network UPS Tools Name: nut -Version: 2.0.4 -Release: 2 +Version: 2.0.5 +Release: 1 Group: Applications/System License: GPL BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root @@ -279,6 +279,9 @@ rm -rf %{buildroot} %{_mandir}/man8/upsset.cgi.8.gz %changelog +* Tue Jan 23 2007 Karsten Hopp 2.0.5-1 +- update to 2.0.5 + * Wed Nov 29 2006 Karsten Hopp 2.0.4-2 - rebuild with new net-snmp-libs - disable nut-2.0.1-bad.patch, not required