From xsov@mail.ru Sun Apr 24 16:42:06 2005
Received: 194.67.23.121 / smx1.brturbo.com
Received: from [212.48.203.89] (port=1505 helo=[192.168.0.77]) by
	mx1.mail.ru with asmtp  id 1DPgEw-0006L9-00 for orso@brturbo.com; Sun, 24
	Apr 2005 16:29:35 +0400
From: Oleg <xsov@mail.ru>
To: Pedro Lineu Orso <orso@brturbo.com>
Subject: sarg-2.0.6 new patches
Date: Sun, 24 Apr 2005 16:42:06 +0400
User-Agent: KMail/1.7.2
MIME-Version: 1.0
Content-Type: Multipart/Mixed; boundary="Boundary-00=_eQ5aCJp/CximSea"
Message-Id: <200504241642.06841.xsov@mail.ru>
X-Evolution-Source: pop://orso@pop.brturbo.com


--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/plain; charset="koi8-r"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit

     Good day, Pedro!

 Again me :-) I just make some new good patches for sarg and review my old 
patches to sarg, so there is:

1) CONTRIBUTORS.patch:
Look at the CONTRIBUTORS file, there is two equal lines about Evren Yurtesen 
<yurtesen@ispro.net.tr>, I just remove first one, the second (equal to first) 
is here, on place.

2) grepday.patch:
I add internationalisation of SARG user graph by using iconv function, which 
is presented only in Linux, so I add required #ifdef and other stuff to clean 
compile code on other platforms.

3) htmllogreport.patch:
Fixed two issues:
- '?' symbol problems for apache and other cgi-supporting web server which 
doesn't support '?' symbol in links (all of them interprete this like 
parameter to cgi script);
- some good optimization to all three similar cicles in these files by 
reducing false checks in 'if ...' strings.

4) index.patch:
Fixes segfault, produced by inproper use of strncpy functions, look - strncpy 
doesn't copy leading '\0' symbol!

5) repday.patch:
Just localisation support for this type of report, patch is simple, just look 
at it.

6) siteuser.patch:
Support usertab IP->USERNAME change in siteuser report, which was removed 
prior to sarg-2.0.0 versions.
WARNING: I'm not sure about bugs in this patch, but must warn you, that we 
don't heavily test this patch in other configurations!

7) Russian_koi8.patch:
Just proper Russian koi8 localisation, believe me, it is good enought, because 
I'm russian :-)

Pedro, can you tell which my patches you will include in next sarg release? 
None of all previous sended to you my patches was included in sarg 
releases ... :-(

And one bugreport:
SARG version: 2.0.6 (clean, downloaded from sf.net, without any additional 
patches)
OS: Linux Slackware 10.1
Reproduction of bug:
tar xvfz sarg-2.0.6.tar.gz
cd sarg-2.0.6
autoconf
./configure
make
gcc -c -I.  -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" 
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_DIRENT_H=1 
-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 
-DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 
-DHAVE_STRING_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TIME_H=1 
-DHAVE_UNISTD_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_NETDB_H=1 
-DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_NETINET_IN_H=1 
-DHAVE_SYS_STAT_H=1 -DHAVE_CTYPE_H=1 -DHAVE_GD_H=1 -DHAVE_GDFONTL_H=1 
-DHAVE_GDFONTT_H=1 -DHAVE_GDFONTS_H=1 -DHAVE_GDFONTMB_H=1 -DHAVE_GDFONTG_H=1 
-DHAVE_ERRNO_H=1 -DHAVE_FOPEN64=1   -g -O2 -w -DBINDIR=\"/usr/bin\" 
-DSYSCONFDIR=\"/usr/local/sarg\" -DHTMLDIR=\"/var/www/html\" log.c
log.c: In function `main':
log.c:127: error: storage size of 'rl' isn't known
log.c:668: error: `RLIMIT_OFILE' undeclared (first use in this function)
log.c:668: error: (Each undeclared identifier is reported only once
log.c:668: error: for each function it appears in.)
make: *** [log.o] Error 1

Best regards,
Sapon Oleg,
RusBusinessSecurity Co. Ltd.

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="CONTRIBUTORS.patch"
Content-Disposition: attachment; filename="CONTRIBUTORS.patch"
Content-Transfer-Encoding: 8bit

diff -ru sarg-2.0.6/CONTRIBUTORS sarg-2.0.6rbs/CONTRIBUTORS
--- sarg-2.0.6/CONTRIBUTORS	2004-11-22 16:37:02.000000000 +0300
+++ sarg-2.0.6rbs/CONTRIBUTORS	2004-11-25 03:05:24.000000000 +0300
@@ -10,7 +10,6 @@
 Dima I. Allaverdov <allav@ur.rags.ru>
 Eugeny Kuzakov <CoreDumped@CoreDumped.null.ru>
 Evren Yurtesen <yurtesen@ispro.net.tr>
-Evren Yurtesen <yurtesen@ispro.net.tr>
 Hanni Daniel <daniel.haenni@softlab.ch>
 Ilya V. Komarov <mur@mur.lynx.ru>
 Jose Luiz <jluiz@projesom.com.br>

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="grepday.patch"
Content-Disposition: attachment; filename="grepday.patch"
Content-Transfer-Encoding: 8bit

diff -ur sarg-2.0.6/configure.in sarg-2.0.6rbs/configure.in
--- sarg-2.0.6/configure.in	2005-02-21 21:13:21.000000000 +0300
+++ sarg-2.0.6rbs/configure.in	2005-04-24 15:31:31.000000000 +0400
@@ -40,7 +40,7 @@
 
 AC_CHECK_HEADERS(stdio.h stdlib.h string.h strings.h sys/time.h time.h unistd.h sys/dirent.h \
 		 dirent.h sys/socket.h netdb.h arpa/inet.h sys/types.h netinet/in.h sys/stat.h \
-		 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h errno.h)
+		 ctype.h gd.h gdfontl.h gdfontt.h gdfonts.h gdfontmb.h gdfontg.h iconv.h errno.h)
 
 AC_CHECK_LIB(gd, gdImagePng,LIBS="-lgd ${LIBS}"; HAVE_GD="yes", HAVE_GD="")
 
diff -ur sarg-2.0.6/grepday.c sarg-2.0.6rbs/grepday.c
--- sarg-2.0.6/grepday.c	2005-04-23 02:27:48.000000000 +0400
+++ sarg-2.0.6rbs/grepday.c	2005-04-24 15:34:19.000000000 +0400
@@ -36,6 +36,38 @@
 char *font1 = SYSCONFDIR"/fonts/Verdana.TTF";
 char s[15];
 
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#define SARGgdImageStringFT I18NgdImageStringFT
+
+BGD_DECLARE(char *) I18NgdImageStringFT (gdImage * im, int *brect, int fg, char *fontlist,
+                         double ptsize, double angle, int x, int y,
+                                                 char *string)
+{
+ iconv_t localtoutf;
+ char *sstring, *str, *sstr, *retval;
+ size_t slen, sslen;
+
+ slen = strlen(string) + 1; // We must include string termination character
+ sslen = slen * 2;          // We assume that UTF8 maximum 2 times large than local
+ sstring = (char *)malloc(sslen);
+
+ str = (char *) string;
+ sstr = (char *) sstring;
+
+ localtoutf = iconv_open ("UTF-8", CharSet);
+ iconv (localtoutf, &str, &slen, &sstr, &sslen);
+ iconv_close (localtoutf);
+
+ retval = gdImageStringFTEx (im, brect, fg, fontlist, ptsize, angle, x, y, sstring, gdFTEX_Unicode);
+ free(sstring);
+
+ return retval;
+}
+#else
+#define SARGgdImageStringFT gdImageStringFT
+#endif
+
 void *bar(long long int *n)
 {     
 #ifdef HAVE_GD
@@ -173,7 +205,7 @@
 
    snprintf(v,6,"%s",fixnum(num,0));
 
-   gdImageStringFT(im,&brect[0],black,font1,5,0.0,x1-1,val-12,v);
+   SARGgdImageStringFT(im,&brect[0],black,font1,5,0.0,x1-1,val-12,v);
    
    points[0].x = x1+17;
    points[0].y = val-5;
@@ -270,7 +302,7 @@
    y=65;
    for(x=1; x<=31; x++) {
       sprintf(s,"%02d",x);
-      gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,y,437,s);
+      SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,y,437,s);
       y=y+20;
    }
 
@@ -281,51 +313,51 @@
    if(strcmp(DateFormat,"e") == 0)
       strftime(ftime, 127, "%d/%b/%Y-%H:%M", local);
 
-   gdImageStringFT(im,&brect[0],darkblue,font1,6,0.0,620,470,ftime);
-   gdImageStringFT(im,&brect[0],darkblue,font1,9,0.0,257,15,"SARG, ");
-   gdImageStringFT(im,&brect[0],darkblue,font1,9,0.0,300,15,Title);
+   SARGgdImageStringFT(im,&brect[0],darkblue,font1,6,0.0,620,470,ftime);
+   if(strcmp(ShowSargInfo,"yes") == 0) SARGgdImageStringFT(im,&brect[0],darkblue,font1,9,0.0,257,15,"SARG, ");
+   SARGgdImageStringFT(im,&brect[0],darkblue,font1,9,0.0,300,15,Title);
    sprintf(warea,"%s: %s",text[89],periodo);
-   gdImageStringFT(im,&brect[0],darkblue,font1,7,0.0,300,27,warea);
+   SARGgdImageStringFT(im,&brect[0],darkblue,font1,7,0.0,300,27,warea);
    sprintf(warea,"%s: %s",text[90],name);
-   gdImageStringFT(im,&brect[0],darkblue,font1,7,0.0,300,38,warea);
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,418,"  50K");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,408,"250K");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,398,"500K");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,388,"   1M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,378,"   2M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,368,"   3M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,358,"   4M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,348,"   5M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,338,"   6M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,328,"   7M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,318,"   8M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,308,"   9M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,298," 10M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,288," 15M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,278," 20M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,268," 30M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,258," 40M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,248," 50M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,238," 60M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,228," 70M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,218," 80M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,208," 90M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,198,"100M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,188,"200M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,178,"300M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,168,"400M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,158,"500M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,148,"600M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,138,"700M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,128,"800M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,118,"900M");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,108,"   1G");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 98,"   2G");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 88,"   3G");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 78,"   4G");
-   gdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 68,"   5G");
-   gdImageStringFT(im,&brect[0],black,font1,10,3.14/2,20,248,text[93]);
-   gdImageStringFT(im,&brect[0],black,font1,10,0.0,330,460,text[127]);
+   SARGgdImageStringFT(im,&brect[0],darkblue,font1,7,0.0,300,38,warea);
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,418,"  50K");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,408,"250K");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,398,"500K");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,388,"   1M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,378,"   2M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,368,"   3M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,358,"   4M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,348,"   5M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,338,"   6M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,328,"   7M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,318,"   8M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,308,"   9M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,298," 10M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,288," 15M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,278," 20M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,268," 30M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,258," 40M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,248," 50M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,238," 60M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,228," 70M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,218," 80M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,208," 90M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,198,"100M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,188,"200M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,178,"300M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,168,"400M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,158,"500M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,148,"600M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,138,"700M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,128,"800M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,118,"900M");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23,108,"   1G");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 98,"   2G");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 88,"   3G");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 78,"   4G");
+   SARGgdImageStringFT(im,&brect[0],dimgray,font1,7,0.0,23, 68,"   5G");
+   SARGgdImageStringFT(im,&brect[0],black,font1,10,3.14/2,20,248,text[93]);
+   SARGgdImageStringFT(im,&brect[0],black,font1,10,0.0,330,460,text[127]);
  
    sprintf(graph,"%s/%s/graph_day.png",dirname,user);
    sprintf(wdirname,"%s/%s.day",tmp,user);

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="htmllogreport.patch"
Content-Disposition: attachment; filename="htmllogreport.patch"
Content-Transfer-Encoding: 8bit

diff -ur sarg-2.0.6/html.c sarg-2.0.6rbs/html.c
--- sarg-2.0.6/html.c	2005-04-23 02:27:48.000000000 +0400
+++ sarg-2.0.6rbs/html.c	2005-04-24 15:58:36.000000000 +0400
@@ -349,23 +349,11 @@
                for(s=ltext110; *s; ++s)
                   *s=tolower(*s);
             }
-            z1=0;
-            z2=0;
-            strcpy(siteind,url);
+            strcpy(siteind,urly);
             str=siteind;
-            for(z1=0; z1<=strlen(str); z1++) {
-               if(str[z1]=='-')
+            for(z1=0; z1<strlen(str); z1++) {
+	       if(str[z1]=='?' || str[z1]=='-' || str[z1]=='.' || str[z1]==':' || str[z1]=='/' || str[z1]=='\\')
                   str[z1]='_';
-               if(str[z1]=='.')
-                  str[z1]='_';
-               if(str[z1]==':')
-                  str[z1]='_';
-               if(str[z1]=='/')
-                  str[z1]='_';
-               if(str[z1]=='\\')
-                  str[z1]='_';
-               siteind[z2]=str[z1];
-               z2++;
             }
             sprintf(href2,"<a href=\"tt%s-%s.html\"><img src=\"../../images/datetime.png\" border=\"0\" title=\"%s %s\"></a>",usuario,siteind,ltext110,text[55]);
          } else {
diff -ur sarg-2.0.6/log.c sarg-2.0.6rbs/log.c
--- sarg-2.0.6/log.c	2005-04-23 01:03:19.000000000 +0400
+++ sarg-2.0.6rbs/log.c	2005-04-24 16:00:53.000000000 +0400
@@ -974,21 +974,11 @@
            sprintf(user,"%s.%s",w,wuser);
         }
 
-	z1=0;
-	z2=0;
 	str=user;
-	for(z1=0; z1<=strlen(str); z1++) {
+	for(z1=0; z1<strlen(str); z1++) {
 	   if(isalnum(str[z1]) || ispunct(str[z1])) {
-	      if(str[z1]=='/')
-	         str[z1]='_';
-	      if(str[z1]=='\\')
-	         str[z1]='_';
-	      if(str[z1]==';')
-	         str[z1]='_';
-	      if(str[z1]=='\'')
-	         str[z1]='_';
-	      user[z2]=str[z1];
-	      z2++;
+	   if(str[z1]=='?' || str[z1]=='-' || str[z1]=='.' || str[z1]==':' || str[z1]=='/' || str[z1]=='\\')
+	      str[z1]='_';
 	   }
 	}
 
diff -ur sarg-2.0.6/report.c sarg-2.0.6rbs/report.c
--- sarg-2.0.6/report.c	2005-04-23 00:57:22.000000000 +0400
+++ sarg-2.0.6rbs/report.c	2005-04-24 16:02:12.000000000 +0400
@@ -186,22 +186,10 @@
          if(!ttopen) {
             ind2++;
 	    strcpy(siteind,accurl);
-            z1=0;
-	    z2=0;
 	    str=siteind;
-	    for(z1=0; z1<=strlen(str); z1++) {
-	       if(str[z1]=='-')
-                  str[z1]='_';
-	       if(str[z1]=='.')
-                  str[z1]='_';
-	       if(str[z1]==':')
-                  str[z1]='_';
-	       if(str[z1]=='/')
-                  str[z1]='_';
-	       if(str[z1]=='?')
-                  str[z1]='_';
-               siteind[z2]=str[z1];
-               z2++;
+	    for(z1=0; z1<strlen(str); z1++) {
+	    if(str[z1]=='?' || str[z1]=='-' || str[z1]=='.' || str[z1]==':' || str[z1]=='/' || str[z1]=='\\')
+	                     str[z1]='_';
             }
 	    sprintf(arqtt,"%s/%s",dirname,accuser);
 	    if(access(arqtt, R_OK) != 0)

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="repday.patch"
Content-Disposition: attachment; filename="repday.patch"
Content-Transfer-Encoding: 8bit

diff -ur sarg-2.0.6/repday.c sarg-2.0.6rbs/repday.c
--- sarg-2.0.6/repday.c	2005-02-21 21:13:22.000000000 +0300
+++ sarg-2.0.6rbs/repday.c	2005-04-21 01:37:06.000000000 +0400
@@ -140,13 +140,13 @@
    fputs( "<tr><td border=0></td>\n", fp_ou );
 
    if(strcmp(datetimeby,"bytes") == 0)
-     strcpy( html, "BYTES" );
+     strcpy( html, text[93] );
    else
      strcpy( html, "H:M:S" );
 
    for( i = 0; i < hours.len; i++ )
      fprintf( fp_ou,
-	"<td class=\"header3\">%02dH<br>%s</td>\n", hours.list[ i ], html );
+	"<td class=\"header3\">%d%s<br>%s</td>\n", hours.list[ i ], text[129], html );
    fprintf( fp_ou,
      "<td class=\"header3\">%s<br>%s</td></tr>\n", text[107], html );
 

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="Russian_koi8.patch"
Content-Disposition: attachment; filename="Russian_koi8.patch"
Content-Transfer-Encoding: 8bit

diff -ru sarg-2.0.6/languages/Russian_koi8 sarg-2.0.6rbs/languages/Russian_koi8
--- sarg-2.0.6/languages/Russian_koi8	2004-11-22 16:37:02.000000000 +0300
+++ sarg-2.0.6rbs/languages/Russian_koi8	2004-11-25 03:02:36.000000000 +0300
@@ -1,4 +1,4 @@
-# by Andrew Okhmat <andy@crgu.com>
+# by Andrew Okhmat <andy@crgu.com> and Sapon Oleg <xsov@mail.ru>
 ""
 ""
 "Russian"
@@ -27,7 +27,7 @@
 ""
 ""
 "IP "
-" Ip-   "
+" IP-   "
 ""
 ""
 ""
@@ -81,7 +81,7 @@
 "  "
 "   "
 "  "
-""
+" "
 ""
 "  "
 "  "
@@ -113,13 +113,18 @@
 "OUT"
 "IN"
 "CACHE"
-"SitesUsers"
-""
-" "
+"  "
+"SmartFilter"
+" "
+""
+" "
 "SQUIDGUARD"
-"RULE"
+""
 "squidGuard"
-"Sarg parsed log saved as"
-"Sarg log format"
-"Graphic"
-"DAYS"
+",  Sarg  "
+"   Sarg"
+""
+""
+""
+""
+""

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="siteuser.patch"
Content-Disposition: attachment; filename="siteuser.patch"
Content-Transfer-Encoding: 8bit

diff -ru sarg-2.0.6/siteuser.c sarg-2.0.6rbs/siteuser.c
--- sarg-2.0.6/siteuser.c	2005-04-20 20:52:20.000000000 +0400
+++ sarg-2.0.6rbs/siteuser.c	2005-02-21 21:13:23.000000000 +0300
@@ -131,6 +131,24 @@
          continue;
       if(userip)
          fixip(user);
+
+	if(UserTabFile[0] != '\0') {
+	    sprintf(warea,":%s:",user);
+	    if((str=(char *) strstr(userfile,warea)) != (char *) NULL ) {
+    		z1=0;
+    		str2=(char *) strstr(str+1,":");
+    		str2++;
+		bzero(name, MAXLEN);
+                while(str2[z1] != ':') {
+            	    name[z1]=str2[z1];
+	            z1++;
+		}
+	    } else strcpy(name,user);
+	} else strcpy(name,user);
+
+      if(strcmp(Ip2Name,"yes") == 0)
+         ip2name(user);
+
       if(strcmp(Ip2Name,"yes") == 0)
          ip2name(user);
 
@@ -143,9 +161,9 @@
          regs++;
       }
       
-      sprintf(wuser," %s ",user);
+      sprintf(wuser," %s ",name);
       if(strstr(users,wuser) == 0 && strcmp(url,ourl) == 0) {
-         strcat(users,user);
+         strcat(users,name);
          strcat(users," ");
          ucount++;
          if(ucount>4) {
@@ -168,7 +186,7 @@
          fputs(html,fp_ou);
          regs++;
          ucount=0;
-	 strcpy(users,user);
+	 strcpy(users,name);
          strcat(users," ");
          strcpy(ourl,url);
       }

--Boundary-00=_eQ5aCJp/CximSea
Content-Type: text/x-diff; charset="koi8-r"; name="index.patch"
Content-Disposition: attachment; filename="index.patch"
Content-Transfer-Encoding: 8bit

diff -ur sarg-2.0.6/index.c sarg-2.0.6rbs/index.c
--- sarg-2.0.6/index.c	2005-02-21 21:13:23.000000000 +0300
+++ sarg-2.0.6rbs/index.c	2005-04-24 07:40:41.000000000 +0400
@@ -78,6 +78,7 @@
       bzero(newname, 512);
       strncat(newname,direntp->d_name,4);
       strncpy(month,direntp->d_name+4,3);
+      month[3]='\0';
       conv_month(month);
       strcat(newname,month);
       strncat(newname,direntp->d_name+7,2);

--Boundary-00=_eQ5aCJp/CximSea--

