Update to latest version 2.23.03.28, finally dns cache seems to work on OpenBSD too, ok ? Cheers Giovanni
Index: Makefile =================================================================== RCS file: /cvs/ports/www/webalizer/Makefile,v retrieving revision 1.31 diff -u -p -r1.31 Makefile --- Makefile 22 Nov 2010 08:36:55 -0000 1.31 +++ Makefile 3 Jan 2011 12:08:34 -0000 @@ -2,33 +2,36 @@ COMMENT= web server log file analysis program -DISTNAME= webalizer-2.01-10-RB21-src -PKGNAME= webalizer-2.01.10 -REVISION= 8 +V= 28 +DISTNAME= webalizer-2.23-03-RB${V}-src +PKGNAME= webalizer-2.23.03.${V} CATEGORIES= www -MASTER_SITES= http://www.patrickfrei.ch/webalizer/rb21/ +MASTER_SITES= http://www.patrickfrei.ch/webalizer/rb${V}/ HOMEPAGE= http://www.patrickfrei.ch/webalizer/ -LIB_DEPENDS= graphics/gd \ +LIB_DEPENDS= archivers/bzip2 \ + databases/db/v4 \ + graphics/gd \ net/GeoIP -# GPL +# GPLv2 PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -WANTLIB= c jpeg m png z gd>=18 GeoIP>=5 +WANTLIB= c db jpeg m png z gd>=18 GeoIP>=5 -MODULES= converters/libiconv - -WRKDIST= ${WRKDIR}/webalizer-2.01-10-RB21 +WRKDIST= ${WRKDIR}/webalizer-2.23-03-RB${V} CONFIGURE_STYLE= gnu dest -CONFIGURE_ARGS= --enable-dns --enable-geoip +CONFIGURE_ARGS= --enable-dns --enable-geoip \ + --with-db=${LOCALBASE}/include/db4 \ + --with-dblib=${LOCALBASE}/lib/db4 \ + --with-gd=${LOCALBASE}/include \ + --mandir=${PREFIX}/man CONFIGURE_ENV= LDFLAGS="-L${LOCALBASE}/lib -L${X11BASE}/lib" \ LIBS="-ljpeg" -USE_GROFF = Yes NO_REGRESS= Yes @@ -37,7 +40,6 @@ pre-patch: mv ${WRKSRC}/sample.conf.new ${WRKSRC}/sample.conf post-install: - cd ${PREFIX}/bin && ln -s webalizer webazolver ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/webalizer ${INSTALL_DATA} ${WRKSRC}/DNS.README ${PREFIX}/share/doc/webalizer/ ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/webalizer/ Index: distinfo =================================================================== RCS file: /cvs/ports/www/webalizer/distinfo,v retrieving revision 1.5 diff -u -p -r1.5 distinfo --- distinfo 30 Jan 2008 20:06:48 -0000 1.5 +++ distinfo 3 Jan 2011 12:08:34 -0000 @@ -1,5 +1,5 @@ -MD5 (webalizer-2.01-10-RB21-src.tar.gz) = efQT1eJBWzjkv5Pi6amSWA== -RMD160 (webalizer-2.01-10-RB21-src.tar.gz) = eSbtEWxkmaKdIrkb/hVYJrCmqCc= -SHA1 (webalizer-2.01-10-RB21-src.tar.gz) = DdPmHbTo70i6M/o5mZeLXeUcgO4= -SHA256 (webalizer-2.01-10-RB21-src.tar.gz) = JBZaDMIZQCYh9OusEPwEVw8IIzV44+fcqgBVbv7uoNU= -SIZE (webalizer-2.01-10-RB21-src.tar.gz) = 457585 +MD5 (webalizer-2.23-03-RB28-src.tar.gz) = SrhLajz5xfvgTD0dsow/DQ== +RMD160 (webalizer-2.23-03-RB28-src.tar.gz) = nfRe4wWx8Xe3LXNZ1KBEYy6rfkc= +SHA1 (webalizer-2.23-03-RB28-src.tar.gz) = 4/GqXGRKBxAHkVhLZkhpCVlZz/c= +SHA256 (webalizer-2.23-03-RB28-src.tar.gz) = F1yvZ+nAXhx7bZYf0c7OfVxA4dK50GtHGxYx7Aadoas= +SIZE (webalizer-2.23-03-RB28-src.tar.gz) = 553149 Index: patches/patch-Makefile_in =================================================================== RCS file: patches/patch-Makefile_in diff -N patches/patch-Makefile_in --- patches/patch-Makefile_in 30 Jan 2008 20:06:48 -0000 1.7 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,16 +0,0 @@ -$OpenBSD: patch-Makefile_in,v 1.7 2008/01/30 20:06:48 mbalmer Exp $ ---- Makefile.in.orig Tue Jan 2 14:04:23 2007 -+++ Makefile.in Wed Jan 30 13:21:35 2008 -@@ -87,9 +87,9 @@ distclean: clean - install: all - $(INSTALL_PROGRAM) webalizer ${BINDIR}/webalizer - $(INSTALL_DATA) webalizer.1 ${MANDIR}/webalizer.1 -- $(INSTALL_DATA) sample.conf ${ETCDIR}/webalizer.conf.sample -- rm -f ${BINDIR}/webazolver -- @LN_S@ ${BINDIR}/webalizer ${BINDIR}/webazolver -+# $(INSTALL_DATA) sample.conf ${ETCDIR}/webalizer.conf.sample -+# rm -f ${BINDIR}/webazolver -+# @LN_S@ ${BINDIR}/webalizer ${BINDIR}/webazolver - - uninstall: - rm -f ${BINDIR}/webalizer Index: patches/patch-dns_resolv_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-dns_resolv_c,v retrieving revision 1.4 diff -u -p -r1.4 patch-dns_resolv_c --- patches/patch-dns_resolv_c 30 Jan 2008 20:06:48 -0000 1.4 +++ patches/patch-dns_resolv_c 3 Jan 2011 12:08:34 -0000 @@ -1,26 +1,17 @@ $OpenBSD: patch-dns_resolv_c,v 1.4 2008/01/30 20:06:48 mbalmer Exp $ ---- dns_resolv.c.orig Mon Aug 6 18:29:25 2007 -+++ dns_resolv.c Wed Jan 30 13:24:39 2008 -@@ -158,7 +158,7 @@ void resolve_dns(struct log_struct *log_rec) - case 0: - { - memcpy(&alignedRecord, response.data, sizeof(struct dnsRecord)); -- strncpy (log_rec->hostname, -+ strlcpy (log_rec->hostname, - ((struct dnsRecord *)response.data)->hostName, - MAXHOST); - log_rec->hostname[MAXHOST-1]=0; -@@ -269,7 +269,7 @@ int dns_resolver(void *log_fp) +--- dns_resolv.c.orig Mon Oct 4 19:30:36 2010 ++++ dns_resolv.c Mon Jan 3 11:45:53 2011 +@@ -244,7 +244,7 @@ int dns_resolver(void *log_fp) + continue; /* go get next record if any */ } - memset(tmp_buf, 0, sizeof(tmp_buf)); -- strncpy(tmp_buf, buffer, sizeof(tmp_buf)-1); /* save buffer in case of error */ +- strcpy(tmp_buf, buffer); /* save buffer in case of error */ + strlcpy(tmp_buf, buffer, sizeof(tmp_buf)); /* save buffer in case of error */ if(parse_record(buffer)) /* parse the record */ { struct addrinfo hints, *ares; -@@ -460,8 +460,8 @@ static void process_list(DNODEPTR l_list) - +@@ -418,8 +418,8 @@ static void process_list(DNODEPTR l_list) + { /* If long hostname, take max domain name part */ if ((size = strlen(hbuf)) > MAXHOST-2) - strcpy(child_buf,(hbuf+(size-MAXHOST+1))); Index: patches/patch-graphs_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-graphs_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-graphs_c --- patches/patch-graphs_c 30 Jan 2008 20:06:48 -0000 1.2 +++ patches/patch-graphs_c 3 Jan 2011 12:08:34 -0000 @@ -1,74 +1,83 @@ $OpenBSD: patch-graphs_c,v 1.2 2008/01/30 20:06:48 mbalmer Exp $ ---- graphs.c.orig Tue Aug 7 13:25:17 2007 -+++ graphs.c Wed Jan 30 13:42:39 2008 -@@ -30,6 +30,7 @@ +--- graphs.c.orig Thu Dec 30 14:52:23 2010 ++++ graphs.c Mon Jan 3 11:36:22 2011 +@@ -25,6 +25,7 @@ #include <stdio.h> #include <string.h> #include <sys/types.h> +#include <sys/socket.h> + #include <errno.h> + #include <sys/stat.h> #include <gd.h> - #include <gdfontt.h> - #include <gdfonts.h> -@@ -198,7 +199,7 @@ int year_graph6x( char *fname, /* file nam - if (data7[i] > maxval) maxval = data7[i]; +@@ -214,7 +215,7 @@ int year_graph6x(char *fname, char *title, struct hist + if (j>28) + { + /* format the year string */ +- sprintf(maxvaltxt, "%04d", data[i].year); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%04d", data[i].year); + gdImageString(im,gdFontSmall,ci+((i-s_mth)*cs)+(j/2)-12, + 236, (unsigned char *)maxvaltxt, CHLEGENDCOLOR); + } +@@ -227,7 +228,7 @@ int year_graph6x(char *fname, char *title, struct hist + if (data[i].page > maxval) maxval = data[i].page; } if (maxval <= 0) maxval = 1; -- sprintf(maxvaltxt, "%lu", maxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%lu", maxval); - gdImageStringUp(im,gdFontSmall,8,26+(strlen(maxvaltxt)*6),maxvaltxt,CHLEGENDCOLOR); +- sprintf(maxvaltxt, "%llu", maxval); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%llu", maxval); + gdImageStringUp(im,gdFontSmall,6,26+(strlen(maxvaltxt)*6), + (unsigned char *)maxvaltxt,CHLEGENDCOLOR); - if (graph_legend) /* print color coded legends? */ -@@ -292,7 +293,7 @@ int year_graph6x( char *fname, /* file nam - if (data8[i] > maxval) maxval = data8[i]; +@@ -274,7 +275,7 @@ int year_graph6x(char *fname, char *title, struct hist + if (data[i].visit > maxval) maxval = data[i].visit; } if (maxval <= 0) maxval = 1; -- sprintf(maxvaltxt, "%lu", maxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%lu", maxval); +- sprintf(maxvaltxt, "%llu", maxval); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%llu", maxval); gdImageStringUp(im, gdFontSmall,493,26+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); + (unsigned char *)maxvaltxt, CHLEGENDCOLOR); -@@ -331,7 +332,7 @@ int year_graph6x( char *fname, /* file nam - if (data6[i] > fmaxval) fmaxval = data6[i]; /* get max val */ - } +@@ -310,7 +311,7 @@ int year_graph6x(char *fname, char *title, struct hist + for (i=s_mth; i<HISTSIZE; i++) + if (data[i].xfer > fmaxval) fmaxval = data[i].xfer; if (fmaxval <= 0.0) fmaxval = 1.0; -- sprintf(maxvaltxt, "%.0f", fmaxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%.0f", fmaxval); - gdImageStringUp(im, gdFontSmall,493,130+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); - -@@ -458,7 +459,7 @@ int month_graph6( char *fname, /* filename +- sprintf(maxvaltxt, "%s", hr_size(fmaxval*1024)); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%s", hr_size(fmaxval*1024)); + i=strstr(maxvaltxt,"&")-maxvaltxt; /* search for HTML-tag */ + memset(maxvaltxt+i,' ',1); /* add space */ + memcpy(maxvaltxt+i+1,maxvaltxt+i+6,strlen(maxvaltxt)-i); /* remove */ +@@ -427,7 +428,7 @@ int month_graph6( char *fname, /* filename if (data7[i] > maxval) maxval = data7[i]; } if (maxval <= 0) maxval = 1; -- sprintf(maxvaltxt, "%lu", maxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%lu", maxval); +- sprintf(maxvaltxt, "%llu", maxval); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%llu", maxval); gdImageStringUp(im, gdFontSmall,8,26+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); + (unsigned char *)maxvaltxt,CHLEGENDCOLOR); -@@ -555,7 +556,7 @@ int month_graph6( char *fname, /* filename +@@ -549,7 +550,7 @@ int month_graph6( char *fname, /* filename if (data8[i]>maxval) maxval = data8[i]; } if (maxval <= 0) maxval = 1; -- sprintf(maxvaltxt, "%lu", maxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%lu", maxval); +- sprintf(maxvaltxt, "%llu", maxval); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%llu", maxval); gdImageStringUp(im, gdFontSmall,8,224+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); + (unsigned char *)maxvaltxt, CHLEGENDCOLOR); -@@ -590,7 +591,7 @@ int month_graph6( char *fname, /* filename - if (data6[i]>fmaxval) fmaxval = data6[i]; +@@ -588,7 +589,7 @@ int month_graph6( char *fname, /* filename + } } if (fmaxval <= 0.0) fmaxval = 1.0; -- sprintf(maxvaltxt, "%.0f", fmaxval/1024); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%.0f", fmaxval/1024); - gdImageStringUp(im, gdFontSmall,8,352+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); - -@@ -679,7 +680,7 @@ int day_graph3( char *fname, +- sprintf(maxvaltxt, "%s", hr_size(fmaxval)); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%s", hr_size(fmaxval)); + i=strstr(maxvaltxt,"&")-maxvaltxt; /* search for HTML-tag */ + memset(maxvaltxt+i,' ',1); /* add space */ + memcpy(maxvaltxt+i+1,maxvaltxt+i+6,strlen(maxvaltxt)-i); /* remove */ +@@ -696,7 +697,7 @@ int day_graph3( char *fname, if (data3[i] > maxval) maxval = data3[i]; } if (maxval <= 0) maxval = 1; -- sprintf(maxvaltxt, "%lu", maxval); -+ snprintf(maxvaltxt, sizeof maxvaltxt, "%lu", maxval); +- sprintf(maxvaltxt, "%llu", maxval); ++ snprintf(maxvaltxt, sizeof(maxvaltxt), "%llu", maxval); gdImageStringUp(im, gdFontSmall, 8, 26+(strlen(maxvaltxt)*6), - maxvaltxt,CHLEGENDCOLOR); + (unsigned char *)maxvaltxt, CHLEGENDCOLOR); Index: patches/patch-hashtab_c =================================================================== RCS file: patches/patch-hashtab_c diff -N patches/patch-hashtab_c --- patches/patch-hashtab_c 30 Jan 2008 20:06:48 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -$OpenBSD: patch-hashtab_c,v 1.1 2008/01/30 20:06:48 mbalmer Exp $ ---- hashtab.c.orig Wed Jan 30 13:40:22 2008 -+++ hashtab.c Wed Jan 30 13:40:33 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - - /* ensure getopt */ - #ifdef HAVE_GETOPT_H Index: patches/patch-linklist_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-linklist_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-linklist_c --- patches/patch-linklist_c 30 Jan 2008 20:06:48 -0000 1.2 +++ patches/patch-linklist_c 3 Jan 2011 12:08:34 -0000 @@ -1,15 +1,7 @@ $OpenBSD: patch-linklist_c,v 1.2 2008/01/30 20:06:48 mbalmer Exp $ ---- linklist.c.orig Tue Jan 2 14:20:19 2007 -+++ linklist.c Wed Jan 30 13:41:00 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - - /* ensure getopt */ - #ifdef HAVE_GETOPT_H -@@ -118,7 +119,7 @@ NLISTPTR new_nlist(char *str) +--- linklist.c.orig Mon Oct 4 19:30:36 2010 ++++ linklist.c Mon Jan 3 11:30:14 2011 +@@ -109,7 +109,7 @@ NLISTPTR new_nlist(char *str) fprintf(stderr,"[new_nlist] %s\n",msg_big_one); } if (( newptr = malloc(sizeof(struct nlist))) != NULL) @@ -18,7 +10,7 @@ $OpenBSD: patch-linklist_c,v 1.2 2008/01 return newptr; } -@@ -176,8 +177,8 @@ GLISTPTR new_glist(char *str, char *name) +@@ -167,8 +167,8 @@ GLISTPTR new_glist(char *str, char *name) } if (( newptr = malloc(sizeof(struct glist))) != NULL) { @@ -29,13 +21,3 @@ $OpenBSD: patch-linklist_c,v 1.2 2008/01 newptr->next=NULL; } return newptr; -@@ -194,8 +195,7 @@ int add_glist(char *str, GLISTPTR *list) - char *name=temp_buf; - - /* make local copy of string */ -- strncpy(temp_buf,str,255); -- temp_buf[255]=0; -+ strlcpy(temp_buf,str,sizeof temp_buf); - - while (!isspace((int)*name)&&*name!=0) name++; - if (*name==0) name=temp_buf; Index: patches/patch-output_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-output_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-output_c --- patches/patch-output_c 30 Jan 2008 20:06:48 -0000 1.2 +++ patches/patch-output_c 3 Jan 2011 12:08:34 -0000 @@ -1,46 +1,32 @@ $OpenBSD: patch-output_c,v 1.2 2008/01/30 20:06:48 mbalmer Exp $ ---- output.c.orig Tue Aug 7 13:28:49 2007 -+++ output.c Wed Jan 30 13:42:20 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - #include <stddef.h> - - /* ensure limits */ -@@ -569,7 +570,7 @@ void month_links() - char index_fname[256]; - - fprintf(out_fp,"<SMALL>\n"); -- sprintf(index_fname,"index.%s",html_ext); -+ snprintf(index_fname,sizeof index_fname, "index.%s",html_ext); - fprintf(out_fp, "<A HREF=\"%s\">[%s]</A>\n", index_fname, msg_hlnk_in); - if (ntop_notfound && response[21].count) - fprintf(out_fp,"<A HREF=\"#ERRORSTATS\">[%s]</A>\n",msg_hlnk_nf); -@@ -818,8 +819,8 @@ void month_total_table() - } +--- output.c.orig Thu Dec 30 14:52:23 2010 ++++ output.c Mon Jan 3 11:50:14 2011 +@@ -321,8 +321,8 @@ int write_month_html() + /* fill in filenames */ + snprintf(html_fname,sizeof(html_fname),"usage_%04d%02d.%s", + cur_year,cur_month,html_ext); +- sprintf(png1_fname,"daily_usage_%04d%02d.png",cur_year,cur_month); +- sprintf(png2_fname,"hourly_usage_%04d%02d.png",cur_year,cur_month); ++ snprintf(png1_fname, sizeof(png1_fname), "daily_usage_%04d%02d.png",cur_year,cur_month); ++ snprintf(png2_fname, sizeof(png2_fname), "hourly_usage_%04d%02d.png",cur_year,cur_month); + + /* create PNG images for web page */ + if (daily_graph) +@@ -2707,7 +2707,7 @@ void top_ctry_table() } - -- sprintf(pie_title,"%s %s %d",msg_mtot_rc,l_month[cur_month-1],cur_year); -- sprintf(pie_fname,"responses_%04d%02d.png",cur_year,cur_month); -+ snprintf(pie_title,sizeof pie_title,"%s %s %d",msg_mtot_rc,l_month[cur_month-1],cur_year); -+ snprintf(pie_fname,sizeof pie_fname,"responses_%04d%02d.png",cur_year,cur_month); - - pie_chart(pie_fname,pie_title,t_hit,pie_data,pie_legend); - -@@ -971,12 +972,12 @@ int all_errors_page() - int i; - - /* generate file name */ -- sprintf(error_fname,"error_%04d%02d.%s",cur_year,cur_month,html_ext); -+ snprintf(error_fname,sizeof error_fname,"error_%04d%02d.%s",cur_year,cur_month,html_ext); - - /* open file */ - if ( (out_fp=open_out_file(error_fname))==NULL ) return 0; - -- sprintf(buffer,"%s %d - %s",l_month[cur_month-1],cur_year,msg_h_url); -+ snprintf(buffer,sizeof buffer,"%s %d - %s",l_month[cur_month-1],cur_year,msg_h_url); - write_html_head(buffer, out_fp); - - fprintf(out_fp,"<FONT SIZE=\"-1\"></CENTER><PRE>\n"); + snprintf(pie_title,sizeof(pie_title),"%s %s %d", + msg_ctry_use,l_month[cur_month-1],cur_year); +- sprintf(pie_fname,"ctry_usage_%04d%02d.png",cur_year,cur_month); ++ snprintf(pie_fname, sizeof(pie_fname), "ctry_usage_%04d%02d.png",cur_year,cur_month); + + pie_chart(pie_fname,pie_title,t_hit,pie_data,pie_legend); /* do it */ + +@@ -3366,7 +3366,7 @@ int write_main_index() + --i; // reduce loop-counter to keep the number of required months + continue; + } +- sprintf(filename,"usage_%04d%02d.%s",last_year, last_month, html_ext); ++ snprintf(filename, sizeof(filename), "usage_%04d%02d.%s",last_year, last_month, html_ext); + if (stat(filename, &st)==0) // check if file exists + { + fprintf(out_fp,"<TD WIDTH=\"16.66%%\"><A HREF=\"usage_%04d%02d.%s\">" \ Index: patches/patch-parser_c =================================================================== RCS file: patches/patch-parser_c diff -N patches/patch-parser_c --- patches/patch-parser_c 30 Jan 2008 20:06:48 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ -$OpenBSD: patch-parser_c,v 1.2 2008/01/30 20:06:48 mbalmer Exp $ ---- parser.c.orig Wed Jan 30 13:41:49 2008 -+++ parser.c Wed Jan 30 13:42:01 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - - /* ensure getopt */ - #ifdef HAVE_GETOPT_H Index: patches/patch-preserve_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-preserve_c,v retrieving revision 1.3 diff -u -p -r1.3 patch-preserve_c --- patches/patch-preserve_c 30 Jan 2008 20:06:48 -0000 1.3 +++ patches/patch-preserve_c 3 Jan 2011 12:08:34 -0000 @@ -1,15 +1,34 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01/30 20:06:48 mbalmer Exp $ ---- preserve.c.orig Tue Jul 3 12:19:00 2007 -+++ preserve.c Wed Jan 30 13:41:34 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - - /* ensure getopt */ - #ifdef HAVE_GETOPT_H -@@ -203,7 +204,7 @@ int save_state() +--- preserve.c.orig Thu Dec 30 14:52:23 2010 ++++ preserve.c Mon Jan 3 11:42:14 2011 +@@ -157,7 +157,7 @@ void put_history() + char timestamp[48]; + + /* generate 'new' filename */ +- sprintf(new_fname, "%s.new", hist_fname); ++ snprintf(new_fname, sizeof(new_fname), "%s.new", hist_fname); + + /* stat the file */ + if ( !(lstat(new_fname, &hist_stat)) ) +@@ -207,7 +207,7 @@ void put_history() + /* if time-warp error detected, save old */ + if (hist_gap) + { +- sprintf(old_fname, "%s.sav", hist_fname); ++ snprintf(old_fname, sizeof(old_fname), "%s.sav", hist_fname); + if ((rename(hist_fname,old_fname)==-1)&&(errno!=ENOENT)&&verbose) + fprintf(stderr,"Failed renaming %s to %s: %s\n", + hist_fname,old_fname,strerror(errno)); +@@ -329,7 +329,7 @@ int save_state() + char new_fname[MAXKVAL+4]; + + /* generate 'new' filename */ +- sprintf(new_fname, "%s.new", state_fname); ++ snprintf(new_fname, sizeof(new_fname), "%s.new", state_fname); + + /* stat the file */ + if ( !(lstat(new_fname, &state_stat)) ) +@@ -350,7 +350,7 @@ int save_state() /* Saving current run data... */ if (verbose>1) { @@ -18,143 +37,71 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 cur_month,cur_day,cur_year,cur_hour,cur_min,cur_sec); printf("%s [%s]\n",msg_put_data,buffer); } -@@ -216,25 +217,25 @@ int save_state() +@@ -363,25 +363,25 @@ int save_state() if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Current date/time */ - sprintf(buffer,"%d %d %d %d %d %d\n", -+ snprintf(buffer,sizeof(buffer),"%d %d %d %d %d %d\n", ++ snprintf(buffer, sizeof(buffer), "%d %d %d %d %d %d\n", cur_year, cur_month, cur_day, cur_hour, cur_min, cur_sec); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Monthly totals for sites, urls, etc... */ -- sprintf(buffer,"%lu %lu %lu %lu %lu %lu %.0f %lu %lu %lu %.0f %.0f\n", -+ snprintf(buffer,sizeof buffer,"%lu %lu %lu %lu %lu %lu %.0f %lu %lu %lu %.0f %.0f\n", +- sprintf(buffer,"%llu %llu %llu %llu %llu %llu %.0f %llu %llu %llu %.0f %.0f\n", ++ snprintf(buffer, sizeof(buffer), "%llu %llu %llu %llu %llu %llu %.0f %llu %llu %llu %.0f %.0f\n", t_hit, t_file, t_site, t_url, t_ref, t_agent, t_xfer, t_page, t_visit, t_user, t_ixfer, t_oxfer); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Daily totals for sites, urls, etc... */ -- sprintf(buffer,"%lu %lu %lu %d %d\n", -+ snprintf(buffer,sizeof buffer,"%lu %lu %lu %d %d\n", +- sprintf(buffer,"%llu %llu %llu %d %d\n", ++ snprintf(buffer, sizeof(buffer), "%llu %llu %llu %d %d\n", dt_site, ht_hit, mh_hit, f_day, l_day); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ /* Monthly (by day) total array */ for (i=0;i<31;i++) { -- sprintf(buffer,"%lu %lu %.0f %lu %lu %lu %.0f %.0f\n", -+ snprintf(buffer,sizeof buffer,"%lu %lu %.0f %lu %lu %lu %.0f %.0f\n", +- sprintf(buffer,"%llu %llu %.0f %llu %llu %llu %.0f %.0f\n", ++ snprintf(buffer, sizeof(buffer), "%llu %llu %.0f %llu %llu %llu %.0f %.0f\n", tm_hit[i],tm_file[i],tm_xfer[i],tm_site[i], tm_page[i],tm_visit[i],tm_ixfer[i],tm_oxfer[i]); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ -@@ -243,7 +244,7 @@ int save_state() +@@ -390,7 +390,7 @@ int save_state() /* Daily (by hour) total array */ for (i=0;i<24;i++) { -- sprintf(buffer,"%lu %lu %.0f %lu %.0f %.0f\n", -+ snprintf(buffer,sizeof buffer,"%lu %lu %.0f %lu %.0f %.0f\n", +- sprintf(buffer,"%llu %llu %.0f %llu %.0f %.0f\n", ++ snprintf(buffer, sizeof(buffer), "%llu %llu %.0f %llu %.0f %.0f\n", th_hit[i],th_file[i],th_xfer[i],th_page[i],th_ixfer[i],th_oxfer[i]); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ } -@@ -251,7 +252,7 @@ int save_state() +@@ -398,7 +398,7 @@ int save_state() /* Response codes */ for (i=0;i<TOTAL_RC;i++) { -- sprintf(buffer,"%lu\n",response[i].count); -+ snprintf(buffer,sizeof buffer,"%lu\n",response[i].count); +- sprintf(buffer,"%llu\n",response[i].count); ++ snprintf(buffer, sizeof(buffer), "%llu\n",response[i].count); if (fputs(buffer,fp)==EOF) return 1; /* error exit */ } -@@ -263,7 +264,7 @@ int save_state() - uptr=um_htab[i]; - while (uptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n", uptr->string, -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n", uptr->string, - uptr->flag, uptr->count, uptr->files, uptr->xfer, - uptr->entry, uptr->exit,uptr->ixfer, uptr->oxfer); - if (fputs(buffer,fp)==EOF) return 1; -@@ -280,7 +281,7 @@ int save_state() - hptr=sm_htab[i]; - while (hptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n%s\n", -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n%s\n", - hptr->string, - hptr->flag, - hptr->count, -@@ -304,7 +305,7 @@ int save_state() - hptr=sd_htab[i]; - while (hptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n%s\n", -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n%s\n", - hptr->string, - hptr->flag, - hptr->count, -@@ -330,7 +331,7 @@ int save_state() - rptr=rm_htab[i]; - while (rptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu\n", rptr->string, -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu\n", rptr->string, - rptr->flag, rptr->count); - if (fputs(buffer,fp)==EOF) return 1; /* error exit */ - rptr=rptr->next; -@@ -348,7 +349,7 @@ int save_state() - aptr=am_htab[i]; - while (aptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu\n", aptr->string, -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu\n", aptr->string, - aptr->flag, aptr->count); - if (fputs(buffer,fp)==EOF) return 1; /* error exit */ - aptr=aptr->next; -@@ -364,7 +365,7 @@ int save_state() - sptr=sr_htab[i]; - while (sptr!=NULL) - { -- sprintf(buffer,"%s\n%lu\n", sptr->string,sptr->count); -+ snprintf(buffer,sizeof buffer,"%s\n%lu\n", sptr->string,sptr->count); - if (fputs(buffer,fp)==EOF) return 1; /* error exit */ - sptr=sptr->next; - } -@@ -379,7 +380,7 @@ int save_state() - iptr=im_htab[i]; - while (iptr!=NULL) - { -- sprintf(buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n", -+ snprintf(buffer,sizeof buffer,"%s\n%d %lu %lu %.0f %lu %lu %.0f %.0f\n", - iptr->string, - iptr->flag, - iptr->count, -@@ -396,13 +397,13 @@ int save_state() - if (fputs("# End Of Table - usernames\n",fp)==EOF) return 1; - - /* 404 error list */ -- sprintf(buffer,"%lu\n",resp_counter); /* save total 404 counter */ -+ snprintf(buffer,sizeof buffer,"%lu\n",resp_counter); /* save total 404 counter */ - if (fputs(buffer,fp)==EOF) return 1; /* error exit */ - - if (fputs("# -notfounderrors- \n",fp)==EOF) return 1; /* error exit */ - if (resp_counter>0) { - for (i=0;i<resp_counter;i++) { -- sprintf(buffer,"%s\n%lu\n",respnotfound[i].respurl,respnotfound[i].count); -+ snprintf(buffer,sizeof buffer,"%s\n%lu\n",respnotfound[i].respurl,respnotfound[i].count); - if (fputs(buffer,fp)==EOF) return 1; /* error exit */ - } - } -@@ -444,7 +445,7 @@ int restore_state() +@@ -587,13 +587,13 @@ int restore_state() if (verbose>1) printf("%s %s\n",msg_get_data,state_fname); /* get easy stuff */ - sprintf(tmp_buf,"# Webalizer V%s ",version); + snprintf(tmp_buf,sizeof tmp_buf,"# Webalizer V%s ",version); if ((fgets(buffer,BUFSIZE,fp)) != NULL) /* Header record */ - {if (strncmp(buffer,tmp_buf,17)) return 99;} /* bad magic? */ - else return 1; /* error exit */ -@@ -537,7 +538,7 @@ int restore_state() + { + if (strncmp(buffer,tmp_buf,16)) + { + /* Kludge to allow 2.01 files also */ +- sprintf(tmp_buf,"# Webalizer V2.01-1"); ++ snprintf(tmp_buf, sizeof(tmp_buf), "# Webalizer V2.01-1"); + if (strncmp(buffer,tmp_buf,19)) return 99; /* bad magic? */ + } + } +@@ -687,7 +687,7 @@ int restore_state() while ((fgets(buffer,BUFSIZE,fp)) != NULL) { if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -163,7 +110,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(tmp_buf)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 10; /* error exit */ -@@ -574,7 +575,7 @@ int restore_state() +@@ -724,7 +724,7 @@ int restore_state() { /* Check for end of table */ if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -172,7 +119,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(buffer)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 8; /* error exit */ -@@ -620,7 +621,7 @@ int restore_state() +@@ -769,7 +769,7 @@ int restore_state() { /* Check for end of table */ if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -181,7 +128,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(buffer)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 9; /* error exit */ -@@ -664,7 +665,7 @@ int restore_state() +@@ -813,7 +813,7 @@ int restore_state() while ((fgets(buffer,BUFSIZE,fp)) != NULL) { if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -190,7 +137,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(buffer)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 11; /* error exit */ -@@ -689,7 +690,7 @@ int restore_state() +@@ -838,7 +838,7 @@ int restore_state() while ((fgets(buffer,BUFSIZE,fp)) != NULL) { if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -199,7 +146,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(buffer)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 12; /* error exit */ -@@ -714,7 +715,7 @@ int restore_state() +@@ -863,7 +863,7 @@ int restore_state() while ((fgets(buffer,BUFSIZE,fp)) != NULL) { if (!strncmp(buffer,"# End Of Table ",15)) break; @@ -208,7 +155,7 @@ $OpenBSD: patch-preserve_c,v 1.3 2008/01 tmp_buf[strlen(buffer)-1]=0; if ((fgets(buffer,BUFSIZE,fp)) == NULL) return 13; /* error exit */ -@@ -739,7 +740,7 @@ int restore_state() +@@ -888,7 +888,7 @@ int restore_state() { /* Check for end of table */ if (!strncmp(buffer,"# End Of Table ",15)) break; Index: patches/patch-sample_conf =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-sample_conf,v retrieving revision 1.3 diff -u -p -r1.3 patch-sample_conf --- patches/patch-sample_conf 30 Jan 2008 20:06:48 -0000 1.3 +++ patches/patch-sample_conf 3 Jan 2011 12:08:34 -0000 @@ -1,16 +1,16 @@ $OpenBSD: patch-sample_conf,v 1.3 2008/01/30 20:06:48 mbalmer Exp $ ---- sample.conf.orig Mon Aug 6 18:30:26 2007 -+++ sample.conf Wed Jan 30 13:32:11 2008 -@@ -27,7 +27,7 @@ - # the log filename ends in '.gz' (ie: a gzip compressed file), it will - # be decompressed on the fly as it is being read. +--- sample.conf.orig Mon Jan 3 11:30:14 2011 ++++ sample.conf Mon Jan 3 11:30:14 2011 +@@ -28,7 +28,7 @@ + # (bzip2 compressed file), it will be decompressed on the fly as it + # is being read. -#LogFile /var/lib/httpd/logs/access_log +#LogFile /var/www/logs/access_log # LogType defines the log type being processed. Normally, the Webalizer # expects a CLF or Combined web server log as input. Using this option, -@@ -41,7 +41,7 @@ +@@ -42,7 +42,7 @@ # should be a full path name, however relative ones might work as well. # If no output directory is specified, the current directory will be used. @@ -18,4 +18,4 @@ $OpenBSD: patch-sample_conf,v 1.3 2008/0 +#OutputDir /var/www/htdocs/usage # HistoryName allows you to specify the name of the history file produced - # by the Webalizer. The history file keeps the data for up to 12 months + # by the Webalizer. The history file keeps the data for previous months, Index: patches/patch-wcmgr_c =================================================================== RCS file: patches/patch-wcmgr_c diff -N patches/patch-wcmgr_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-wcmgr_c 3 Jan 2011 12:08:34 -0000 @@ -0,0 +1,21 @@ +$OpenBSD$ +--- wcmgr.c.orig Mon Jan 3 11:50:52 2011 ++++ wcmgr.c Mon Jan 3 11:51:29 2011 +@@ -196,7 +196,7 @@ const char *ttl_age(time_t now, time_t then) + mins=age/60; + + /* format the string */ +- sprintf(our_buffer,"%02dd:%02dh:%02dm",days, hours, mins); ++ snprintf(our_buffer, sizeof(our_buffer), "%02dd:%02dh:%02dm",days, hours, mins); + + /* and return to caller */ + return our_buffer; +@@ -407,7 +407,7 @@ void purge_cache() + + /* generate output filename */ + memset(out_file, 0, sizeof(out_file)); +- sprintf(out_file, "%s.new", in_file); ++ snprintf(out_file, sizeof(out_file), "%s.new", in_file); + + /* open the output database (read-write) */ + if ((i=out_db->open(out_db, NULL, out_file, NULL, Index: patches/patch-webalizer_c =================================================================== RCS file: /cvs/ports/www/webalizer/patches/patch-webalizer_c,v retrieving revision 1.4 diff -u -p -r1.4 patch-webalizer_c --- patches/patch-webalizer_c 30 Jan 2008 20:06:48 -0000 1.4 +++ patches/patch-webalizer_c 3 Jan 2011 12:08:34 -0000 @@ -1,15 +1,7 @@ $OpenBSD: patch-webalizer_c,v 1.4 2008/01/30 20:06:48 mbalmer Exp $ ---- webalizer.c.orig Sat Dec 8 12:49:25 2007 -+++ webalizer.c Wed Jan 30 13:44:10 2008 -@@ -38,6 +38,7 @@ - #include <ctype.h> - #include <sys/utsname.h> - #include <sys/times.h> -+#include <sys/socket.h> - #include <zlib.h> - - /* ensure getopt */ -@@ -687,7 +688,7 @@ int main(int argc, char *argv[]) +--- webalizer.c.orig Thu Dec 30 14:52:23 2010 ++++ webalizer.c Mon Jan 3 13:01:54 2011 +@@ -771,7 +771,7 @@ int main(int argc, char *argv[]) } /* got a record... */ @@ -18,37 +10,16 @@ $OpenBSD: patch-webalizer_c,v 1.4 2008/0 if (parse_record(buffer)) /* parse the record */ { /*********************************************/ -@@ -891,7 +892,7 @@ int main(int argc, char *argv[]) - if (!isurlchar(*cp1)) +@@ -1190,7 +1190,7 @@ int main(int argc, char *argv[]) { - /* Save query portion in log.rec.srchstr */ -- strncpy(log_rec.srchstr,cp1,MAXSRCH); -+ strlcpy(log_rec.srchstr,cp1,sizeof log_rec.srchstr); - *cp1++='\0'; + /* Invalid hostname found! */ + if (strcmp(log_rec.hostname, host_buf)) +- strcpy(log_rec.hostname, host_buf); ++ strlcpy(log_rec.hostname, host_buf, sizeof(log_rec.hostname)); + else strncpy(log_rec.hostname,"Invalid",8); break; } -@@ -1269,7 +1270,7 @@ int main(int argc, char *argv[]) - - /* if this is a IPv4 address in IPv6 notation, normalize it back */ - if (strncmp(log_rec.hostname, "::ffff:", 7) == 0) { -- strcpy(log_rec.hostname, log_rec.hostname+7); -+ strlcpy(log_rec.hostname, log_rec.hostname+7, sizeof(log_rec.hostname)); - } - - /* Save IP address for later checks */ -@@ -1307,9 +1308,9 @@ int main(int argc, char *argv[]) - else - { - if (strcmp(log_rec.hostname,ip)!=0) -- strcpy(log_rec.hostname,ip); -+ strlcpy(log_rec.hostname,ip,sizeof(log_rec.hostname)); - else -- strncpy(log_rec.hostname,"Invalid",8); -+ strlcpy(log_rec.hostname,"Invalid",sizeof(log_rec.hostname)); - invalid = 1; break; - } - } -@@ -1322,7 +1323,7 @@ int main(int argc, char *argv[]) +@@ -1204,7 +1204,7 @@ int main(int argc, char *argv[]) /* Catch blank hostnames here */ if (log_rec.hostname[0]=='\0') @@ -57,12 +28,3 @@ $OpenBSD: patch-webalizer_c,v 1.4 2008/0 /* Ignore/Include check */ if ( (isinlist(include_sites,log_rec.hostname)==NULL) && -@@ -2260,7 +2261,7 @@ void srch_string(char *ptr) - if ( (cps=isinglist(search_list,log_rec.refer))==NULL) return; - - /* Try to find query variable */ -- srch[0]='?'; strcpy(&srch[1],cps); /* First, try "?..." */ -+ srch[0]='?'; strlcpy(&srch[1],cps,(sizeof srch) - 1); /* First, try "?..." */ - if ((cp1=strstr(ptr,srch))==NULL) - { - srch[0]='&'; /* Next, try "&..." */ Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/www/webalizer/pkg/PLIST,v retrieving revision 1.5 diff -u -p -r1.5 PLIST --- pkg/PLIST 8 Nov 2004 16:52:12 -0000 1.5 +++ pkg/PLIST 3 Jan 2011 12:08:34 -0000 @@ -1,7 +1,10 @@ @comment $OpenBSD: PLIST,v 1.5 2004/11/08 16:52:12 pvalchev Exp $ -bin/webalizer +...@bin bin/wcmgr +...@bin bin/webalizer bin/webazolver +...@man man/man1/wcmgr.1 @man man/man1/webalizer.1 +...@man man/man1/webazolver.1 share/doc/webalizer/ share/doc/webalizer/DNS.README share/doc/webalizer/README