Hello community,
here is the log from the commit of package webalizer
checked in at Fri Dec 8 17:52:15 CET 2006.
--------
--- webalizer/webalizer.changes 2006-03-16 14:50:24.000000000 +0100
+++ /mounts/work_src_done/STABLE/webalizer/webalizer.changes 2006-12-08 17:35:30.000000000 +0100
@@ -1,0 +2,5 @@
+Fri Dec 8 17:34:17 CET 2006 - anicka@suse.cz
+
+- add IPv6 patch from Arkadiusz Miskiewicz [#219403]
+
+-------------------------------------------------------------------
New:
----
webalizer-2.01-10-ipv6.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ webalizer.spec ++++++
--- /var/tmp/diff_new_pack.pmxxvO/_old 2006-12-08 17:52:07.000000000 +0100
+++ /var/tmp/diff_new_pack.pmxxvO/_new 2006-12-08 17:52:07.000000000 +0100
@@ -13,13 +13,13 @@
Name: webalizer
BuildRequires: apache2-devel db-devel db1-devel gd-devel libapr-util1-devel libjpeg-devel libpng-devel mm pcre-devel xorg-x11 xorg-x11-devel
%define editlvl 10
-License: LGPL
+License: GNU Library General Public License v. 2.0 and 2.1 (LGPL)
Group: Productivity/Networking/Web/Utilities
Provides: webalize
Obsoletes: webalize
Autoreqprov: on
Version: 2.01
-Release: 739
+Release: 770
URL: http://www.mrunix.net/webalizer/
Summary: A Web Server Log File Analysis Program
Source: %{name}-%{version}-%{editlvl}-src.tar.bz2
@@ -28,6 +28,7 @@
Patch2: %{name}-%{version}-%{editlvl}-overflow.diff
Patch3: %{name}-%{version}-%{editlvl}-maxagent.diff
Patch4: %{name}-%{version}-%{editlvl}-configuration.diff
+Patch5: %{name}-%{version}-%{editlvl}-ipv6.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define apache_serverroot %(/usr/sbin/apxs2 -q datadir 2>/dev/null || apxs -q PREFIX)
@@ -58,6 +59,7 @@
%patch2
%patch3
%patch4
+%patch5 -p1
%build
%{suse_update_config -f}
@@ -95,6 +97,8 @@
/var/lib/webalizer
%changelog -n webalizer
+* Fri Dec 08 2006 - anicka@suse.cz
+- add IPv6 patch from Arkadiusz Miskiewicz [#219403]
* Thu Mar 16 2006 - anicka@suse.cz
- change LogFile to /var/log/apache2/access_log (#157931)
- create separate patch with configuration changes
++++++ webalizer-2.01-10-ipv6.diff ++++++
#IPv6 patch by Arkadiusz Mi¶kiewicz for webalizer >= 2.01-10
#
#Ported to Red Hat Linux/Fedora Core by Robert Scheck
#
================================================================================
--- webalizer-2.01-10/dns_resolv.c
+++ webalizer-2.01-10/dns_resolv.c
@@ -61,6 +61,11 @@
#include
#endif
+/* ensure getaddrinfo/getnameinfo */
+#ifndef _NETDB_H
+#include
+#endif
+
/* some systems need this */
#ifdef HAVE_MATH_H
#include
@@ -267,9 +272,16 @@
strncpy(tmp_buf, buffer, sizeof(tmp_buf)-1); /* save buffer in case of error */
if(parse_record(buffer)) /* parse the record */
{
- if((log_rec.addr.s_addr = inet_addr(log_rec.hostname)) != INADDR_NONE)
+ struct addrinfo hints, *ares;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_NUMERICHOST;
+ if (0 == getaddrinfo(log_rec.hostname, "0", &hints, &ares))
{
DBT q, r;
+ memcpy(&log_rec.addr, ares->ai_addr, ares->ai_addrlen);
+ freeaddrinfo(ares);
q.data = log_rec.hostname;
q.size = strlen(log_rec.hostname);
@@ -415,13 +427,11 @@
{
int size;
- struct hostent *res_ent;
-
close(child[i].inpipe[0]);
close(child[i].outpipe[1]);
- /* get struct in_addr here */
- while((size = read(child[i].outpipe[0], child_buf, MAXHOST)))
+ /* get struct sockaddr_storage here */
+ while((size = read(child[i].outpipe[0], child_buf, MAXHOST)))
{
if(size < 0)
{
@@ -430,37 +440,39 @@
}
else
{
+ char hbuf[NI_MAXHOST];
if(debug_mode)
printf("Child got work: %lx(%d)\n",
- *((unsigned long *)child_buf), size);
+ *(unsigned long *)((struct sockaddr*)child_buf)->sa_data, size);
- if((res_ent = gethostbyaddr(child_buf, size, AF_INET)))
+ if(0 == getnameinfo((struct sockaddr*)child_buf, sizeof(struct sockaddr_storage),
+ hbuf, sizeof(hbuf), NULL, 0, NI_NAMEREQD))
{
/* must be at least 4 chars */
- if (strlen(res_ent->h_name)>3)
+ if (strlen(hbuf)>3)
{
if(debug_mode)
- printf("Child got %s for %lx(%d), %d bytes\n",
- res_ent->h_name,
- *((unsigned long *)child_buf),
- size,strlen(res_ent->h_name));
+ printf("Child got %s for %x(%d), %d bytes\n",
+ hbuf,
+ *(unsigned long *)((struct sockaddr *)child_buf)->sa_data,
+ size,strlen(hbuf));
/* If long hostname, take max domain name part */
- if ((size = strlen(res_ent->h_name)) > MAXHOST)
- strcpy(child_buf,(res_ent->h_name+(size-MAXHOST)));
- else strcpy(child_buf, res_ent->h_name);
+ if ((size = strlen(hbuf)) > MAXHOST-2)
+ strcpy(child_buf,(hbuf+(size-MAXHOST+1)));
+ else strcpy(child_buf, hbuf);
size = strlen(child_buf);
}
else
{
if (debug_mode)
- printf("gethostbyaddr returned bad h_name!\n");
+ printf("getnameinfor returned bad hbuf!\n");
}
}
else
{
if(debug_mode)
- printf("gethostbyaddr returned NULL! (%d)\n",h_errno);
+ printf("getnameinfo didn't return any usable information!\n");
}
if (write(child[i].inpipe[1], child_buf, size) == -1)
@@ -539,8 +551,8 @@
if(trav) /* something to resolve */
{
- if (write(child[i].outpipe[1], &(trav->addr.s_addr),
- sizeof(trav->addr.s_addr)) != -1)
+ if (write(child[i].outpipe[1], &trav->addr,
+ sizeof(trav->addr)) != -1)
{
/* We will watch this child */
child[i].cur = trav;
@@ -548,10 +560,9 @@
max_fd = MAX(max_fd, child[i].inpipe[0]);
if(debug_mode)
- printf("Giving %s (%lx) to Child %d for resolving\n",
+ printf("Giving %s (%x) to Child %d for resolving\n",
child[i].cur->string,
- (unsigned long)child[i].cur->addr.s_addr, i);
-
+ *(unsigned long *)((struct sockaddr *)&child[i].cur->addr)->sa_data, i);
trav = trav->llist;
}
else /* write error */
@@ -641,8 +652,8 @@
default:
{
dns_buf[size] = '\0';
- if(memcmp(dns_buf, &(child[i].cur->addr.s_addr),
- sizeof(child[i].cur->addr.s_addr)))
+ if(memcmp(dns_buf, &(child[i].cur->addr),
+ sizeof(child[i].cur->addr)))
{
if(debug_mode)
printf("Got a result (%d): %s -> %s\n",
--- webalizer-2.01-10/hashtab.c
+++ webalizer-2.01-10/hashtab.c
@@ -976,7 +976,7 @@
/* PUT_DNODE - insert/update dns host node */
/*********************************************/
-int put_dnode(char *str, struct in_addr *addr, DNODEPTR *htab)
+int put_dnode(char *str, struct sockaddr_storage *addr, DNODEPTR *htab)
{
DNODEPTR cptr,nptr;
@@ -988,8 +988,8 @@
/* not hashed */
if ( (nptr=new_dnode(str)) != NULL)
{
- if (addr) memcpy(&nptr->addr, addr, sizeof(struct in_addr));
- else memset(&nptr->addr, 0, sizeof(struct in_addr));
+ if (addr) memcpy(&nptr->addr, addr, sizeof(struct sockaddr_storage));
+ else memset(&nptr->addr, 0, sizeof(struct sockaddr_storage));
nptr->next = NULL;
htab[hash(str)] = nptr;
}
@@ -1005,8 +1005,8 @@
/* not found... */
if ( (nptr = new_dnode(str)) != NULL)
{
- if (addr) memcpy(&nptr->addr, addr, sizeof(struct in_addr));
- else memset(&nptr->addr, 0, sizeof(struct in_addr));
+ if (addr) memcpy(&nptr->addr, addr, sizeof(struct sockaddr_storage));
+ else memset(&nptr->addr, 0, sizeof(struct sockaddr_storage));
nptr->next = htab[hash(str)];
htab[hash(str)]=nptr;
}
--- webalizer-2.01-10/hashtab.h
+++ webalizer-2.01-10/hashtab.h
@@ -18,7 +18,7 @@
#ifdef USE_DNS
struct dnode { char *string; /* DNS node hash table struct */
- struct in_addr addr;
+ struct sockaddr_storage addr;
struct dnode *llist;
struct dnode *next; };
#endif
@@ -87,7 +87,7 @@
extern int put_snode(char *, u_long, SNODEPTR *);
#ifdef USE_DNS
-extern int put_dnode(char *, struct in_addr *, DNODEPTR *);
+extern int put_dnode(char *, struct sockaddr_storage *, DNODEPTR *);
extern void del_dlist(DNODEPTR *);
#endif
--- webalizer-2.01-10/parser.c
+++ webalizer-2.01-10/parser.c
@@ -114,7 +114,7 @@
log_rec.ident[0]=0;
*/
#ifdef USE_DNS
- memset(&log_rec.addr,0,sizeof(struct in_addr));
+ memset(&log_rec.addr,0,sizeof(struct sockaddr_storage));
#endif
/* call appropriate handler */
--- webalizer-2.01-10/webalizer.c
+++ webalizer-2.01-10/webalizer.c
@@ -63,6 +63,7 @@
#ifdef USE_DNS
#include
#include
+#include
#ifdef HAVE_DB_185_H
#include
@@ -991,8 +992,15 @@
/* Resolve IP address if needed */
if (dns_db)
{
- if (inet_addr(log_rec.hostname) != INADDR_NONE)
- resolve_dns(&log_rec);
+ struct addrinfo hints, *ares;
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
+ hints.ai_socktype = SOCK_STREAM;
+ hints.ai_flags = AI_NUMERICHOST;
+ if (0 == getaddrinfo(log_rec.hostname, "0", &hints, &ares)) {
+ freeaddrinfo(ares);
+ resolve_dns(&log_rec);
+ }
}
#endif
--- webalizer-2.01-10/webalizer.h
+++ webalizer-2.01-10/webalizer.h
@@ -143,7 +143,7 @@
int resp_code; /* response code */
u_long xfer_size; /* xfer size in bytes */
#ifdef USE_DNS
- struct in_addr addr; /* IP address structure */
+ struct sockaddr_storage addr; /* IP address structure */
#endif /* USE_DNS */
char refer[MAXREF]; /* referrer */
char agent[MAXAGENT]; /* user agent (browser) */
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org