update to 2.23_05

This commit is contained in:
Joe Orton 2011-07-14 09:36:00 +01:00
commit 4e103968db
6 changed files with 27 additions and 274 deletions

1
.gitignore vendored
View file

@ -4,3 +4,4 @@ clog
x86_64
webalizer-2.20-01-src.tgz
webalizer-2.21-02-src.tar.bz2
/webalizer-2.23-05-src.tgz

View file

@ -1 +1 @@
29af2558a5564493df654b6310b152e7 webalizer-2.21-02-src.tar.bz2
304338cf3b1e9389123380d5f7d88d58 webalizer-2.23-05-src.tgz

View file

@ -1,241 +0,0 @@
#IPv6 patch by Arkadiusz Mi¶kiewicz <misiek@pld.org.pl> for webalizer >= 2.01-10
#
#Ported to Red Hat Linux/Fedora Core by Robert Scheck
#
--- webalizer-2.01-10/dns_resolv.c 2004-05-25 01:21:50.000000000 +0200
+++ webalizer-2.01-10/dns_resolv.c.ipv6 2004-05-25 01:35:12.000000000 +0200
@@ -61,6 +61,11 @@
#include <sys/types.h>
#endif
+/* ensure getaddrinfo/getnameinfo */
+#ifndef _NETDB_H
+#include <netdb.h>
+#endif
+
/* some systems need this */
#ifdef HAVE_MATH_H
#include <math.h>
@@ -266,9 +271,16 @@
strcpy(tmp_buf, buffer); /* 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);
@@ -414,12 +426,10 @@
{
int size;
- struct hostent *res_ent;
-
close(child[i].inpipe[0]);
close(child[i].outpipe[1]);
- /* get struct in_addr here */
+ /* get struct sockaddr_storage here */
while((size = read(child[i].outpipe[0], child_buf, MAXHOST)))
{
if(size < 0)
@@ -429,37 +439,40 @@
}
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-2)
- strcpy(child_buf,(res_ent->h_name+(size-MAXHOST+1)));
- 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)
@@ -538,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;
@@ -547,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 */
@@ -640,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 2001-06-15 10:34:24.000000000 +0200
+++ webalizer-2.01-10/hashtab.c.ipv6 2004-05-25 01:36:24.000000000 +0200
@@ -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 2000-09-29 05:50:30.000000000 +0200
+++ webalizer-2.01-10/hashtab.h.ipv6 2004-05-25 01:37:26.000000000 +0200
@@ -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 2001-06-15 10:34:24.000000000 +0200
+++ webalizer-2.01-10/parser.c.ipv6 2004-05-25 01:37:56.000000000 +0200
@@ -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 2004-05-25 01:21:50.000000000 +0200
+++ webalizer-2.01-10/webalizer.c.ipv6 2004-05-25 01:39:31.000000000 +0200
@@ -63,6 +63,7 @@
#ifdef USE_DNS
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <netdb.h>
#ifdef HAVE_DB_185_H
#include <db_185.h>
@@ -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 2001-02-10 01:58:18.000000000 +0100
+++ webalizer-2.01-10/webalizer.h.ipv6 2004-05-25 01:40:09.000000000 +0200
@@ -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) */

View file

@ -3,15 +3,6 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=158174
--- webalizer-2.01-10/webalizer.c.confuser 2005-09-21 13:32:40.000000000 +0100
+++ webalizer-2.01-10/webalizer.c 2005-09-21 13:33:43.000000000 +0100
@@ -50,6 +50,8 @@
#include <sys/types.h>
#endif
+#include <sys/stat.h>
+
/* some systems need this */
#ifdef HAVE_MATH_H
#include <math.h>
@@ -252,6 +254,8 @@
int max_ctry; /* max countries defined */

View file

@ -1,15 +1,16 @@
--- webalizer-2.01-10/hashtab.c.groupvisit 2001-06-15 11:34:24.000000000 +0300
+++ webalizer-2.01-10/hashtab.c 2006-03-30 12:52:30.000000000 +0300
@@ -94,6 +94,8 @@
diff -uap webalizer-2.23-05/hashtab.c.groupvisit webalizer-2.23-05/hashtab.c
--- webalizer-2.23-05/hashtab.c.groupvisit 2011-01-10 01:47:49.000000000 +0000
+++ webalizer-2.23-05/hashtab.c 2011-07-14 09:26:11.645377843 +0100
@@ -88,6 +88,8 @@ INODEPTR im_htab[MAXHASH];
DNODEPTR host_table[MAXHASH]; /* DNS hash table */
#endif /* USE_DNS */
+u_long pre_tstamp = 0; /* prev. real record tstamp */
+
/*********************************************/
/* DEL_HTABS - clear out our hash tables */
@@ -184,6 +186,7 @@
/* Last node pointers */
HNODEPTR lm_hnode=NULL;
HNODEPTR ld_hnode=NULL;
@@ -186,6 +188,7 @@ int put_hnode( char *str, /* Hostn
nptr->visit=(visit-1);
nptr->lasturl=find_url(lasturl);
nptr->tstamp=tstamp;
@ -17,7 +18,7 @@
return 0;
}
else
@@ -193,6 +196,7 @@
@@ -195,6 +198,7 @@ int put_hnode( char *str, /* Hostn
if (htab==sm_htab) update_entry(log_rec.url);
nptr->lasturl=find_url(log_rec.url);
nptr->tstamp=tstamp;
@ -25,7 +26,7 @@
nptr->visit=1;
}
}
@@ -214,7 +218,8 @@
@@ -225,7 +229,8 @@ int put_hnode( char *str, /* Hostn
if (ispage(log_rec.url))
{
@ -35,7 +36,7 @@
{
cptr->visit++;
if (htab==sm_htab)
@@ -247,6 +252,7 @@
@@ -262,6 +267,7 @@ int put_hnode( char *str, /* Hostn
nptr->visit = (visit-1);
nptr->lasturl=find_url(lasturl);
nptr->tstamp= tstamp;
@ -43,7 +44,7 @@
return 0;
}
else
@@ -256,6 +262,7 @@
@@ -271,6 +277,7 @@ int put_hnode( char *str, /* Hostn
if (htab==sm_htab) update_entry(log_rec.url);
nptr->lasturl=find_url(log_rec.url);
nptr->tstamp= tstamp;
@ -51,7 +52,7 @@
nptr->visit=1;
}
}
@@ -840,11 +847,16 @@
@@ -875,11 +882,16 @@ int put_inode( char *str, /* ident
{
nptr->visit=(visit-1);
nptr->tstamp=tstamp;
@ -69,7 +70,7 @@
}
}
}
@@ -864,7 +876,8 @@
@@ -899,7 +911,8 @@ int put_inode( char *str, /* ident
if (ispage(log_rec.url))
{
@ -79,7 +80,7 @@
cptr->visit++;
cptr->tstamp=tstamp;
}
@@ -888,11 +901,16 @@
@@ -923,11 +936,16 @@ int put_inode( char *str, /* ident
{
nptr->visit = (visit-1);
nptr->tstamp= tstamp;

View file

@ -1,23 +1,21 @@
%define ver 2.21
%define patchlevel 02
%define _default_patch_fuzz 2
%define ver 2.23
%define patchlevel 05
Name: webalizer
Summary: A flexible Web server log file analysis program
Group: Applications/Internet
Version: 2.21_02
Release: 5
Version: 2.23_05
Release: 1
URL: http://www.mrunix.net/webalizer/
License: GPLv2+
Source0: ftp://ftp.mrunix.net/pub/webalizer/%{name}-%{ver}-%{patchlevel}-src.tar.bz2
Source0: ftp://ftp.mrunix.net/pub/webalizer/%{name}-%{ver}-%{patchlevel}-src.tgz
Source1: webalizer.conf
Source2: webalizer.cron
Source3: webalizer-httpd.conf
Source4: webalizer.sysconfig
Patch4: webalizer-2.21-02-underrun.patch
Patch6: webalizer-2.01_10-confuser.patch
Patch9: webalizer-2.01-10-groupvisit.patch
Patch6: webalizer-2.23-05-confuser.patch
Patch9: webalizer-2.23-05-groupvisit.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: gd-devel, db4-devel, bzip2-devel
Requires(pre): /usr/sbin/useradd
@ -87,6 +85,9 @@ rm -rf $RPM_BUILD_ROOT
%attr(-, webalizer, root) %{_localstatedir}/www/usage/*.png
%changelog
* Thu Jul 14 2011 Joe Orton <jorton@redhat.com> - 2.23_05-1
- update to 2.23_05
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.21_02-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild