SARG ChangeLog
-Dec-27-2009 Version 2.2.7
+Dec-31-2009 Version 2.2.7
- Extra compile and run time protection (FORTIFY_SOURCE) fixed in configure.
- Use tabulations as columns separator in intermediary files to avoid problems when a field of the log contains a space.
- Input log file type detection partly rewritten to clearly distinguish which type is processed where.
- Use string pointers in getword instead of copying the strings over and over.
- Use LC_TIME to format some dates and times in the report according to the selected locale.
- Sarg.conf can list up to 255 access.log files.
- - Downloaded files suffixes are matched against a sorted list and use a dicchotomic search.
+ - Downloaded files suffixes are matched against a sorted list and use a dichotomic search.
- Added getword_atoll to read a number directly from a file without an intermediary string storage.
- Use boolean to enable the options instead of string compares.
- Accept an absolute path for the language file in sarg.conf.
- Experimental: Can show the backtrace of the program when a getword loop is detected to help in locating the origin of the error.
- Protect the creation of the index against invalid directories.
- Only copy the files when creating the directory with the images to link the reports to.
+ - Directories deleted without using the rm system command.
Dec-17-2009 Version 2.2.6.1
- - Remove unecessary dependency on off_t.
+ - Remove unnecessary dependency on off_t.
- Configuration doesn't fail if rlim_t is not available.
- Test for the availability of -Werror=implicit-function-declaration and -Werror=format flags in gcc (thanks to Murilo Moreira de Oliveira and pjetko).
- Fix sort delimiter when reading useragent log (thanks to Maxim Britov).
- Fix user agent report font size and statistics on user agent.
- Test for the availability of -Werror=format-security in gcc (thanks to Maxim Britov).
- - Test the existence of bzero with autoconf and don't redefine it (tkanks to Maxim Britov).
+ - Test the existence of bzero with autoconf and don't redefine it (thanks to Maxim Britov).
- Remove warnings if libgd is not available.
- The date stored in sarg-date is now stored in a more machine readable form (thanks to rcastanheira for pointing this out).
- - The date read from sarg-date was not properly parsed and would produce a wrongly sorted index accross a year change (thanks to rcastanheira for pointing this out).
+ - The date read from sarg-date was not properly parsed and would produce a wrongly sorted index across a year change (thanks to rcastanheira for pointing this out).
- my_mkdir changed to avoid the use of getword, be simpler and, maybe, work reliably on windows.
Oct-14-2009 Version 2.2.6
- Replaced the ifdef FOPEN64 by a single call to MY_FOPEN for code clarity.
- User IP/ID is searched only in the first column of the usertab file.
- Some of indentation fixes.
- - Speed up by removing two uncessary ip resolutions.
+ - Speed up by removing two unnecessary ip resolutions.
- Applied debian patches: sarg-polish.patch, sarg-turkish.patch
- Applied debian patch: opensuse_2_enlarge_report_buffers.patch
- Applied debian patch: opensuse_3_too_small_font_buffer.patch
- Applied and extended debian patch: opensuse_5_limit_sprintf.patch
- Function debuga format the output string itself, so there is no need to use sprintf.
- Applied debian patch: opensuse_7_year_assertion.patch
- - Removed a few unecessary strings copy.
+ - Removed a few unnecessary strings copy.
- Embryo of documentation for the code with doxygen.
- Changed subs to replace the string in place and avoid allocating a memory that was freed on only one occasion.
- A few improvements on strings manipulations.
- Compute the report date without resorting to the system command.
- Allow the use of spaces in the temporary directory.
- Fixed bug #2863485.
- - Removed missplaced off_t as suggested in bug #2864425.
+ - Removed misplaced off_t as suggested in bug #2864425.
- Z files are uncompressed by zcat to avoid deleting the original log file.
- Compressed log files are uncompressed in /tmp/sarg to delete the file when the process completes.
- Fixed several memory leaks.
- wrong results when userid contain '%20' character
- previous reports info wrong in index.html
-Dez/23/2006 Version 2.2.3
+Dec/23/2006 Version 2.2.3
- gd graph font change from FreeSans.ttf to DejaVuSans.ttf
- minor fixes when only denied records in access.log file.
- ulimit tag changed. If you run sarg with a low privilege user,
- after reading the squidGuard configuration, the data read from the
usertab file was corrupted.
Thanks to Daniel Vogel <daniel_vogel@t-online.de>
- - milisec values showed as bytes. Thanks to Carlos <ke09@terra.com.br>
+ - millisec values showed as bytes. Thanks to Carlos <ke09@terra.com.br>
- with squidGuard, you can log groups in only one log file.
We must parse each log files only one time.
Thanks to Christophe BADINA <christophe.badina@ch-moulins-yzeure.fr>
- temporary file names changed to sarg-... to avoid conflicts
with usernames. Thanks to Ukrainian Elephant <superlamer@users.sourceforge.net>
- SARG support Japanese wordset but not support charset.
- submited by anonymous at sourceforge.net Many thanks.
+ submitted by anonymous at sourceforge.net Many thanks.
- support for utf-8 character set added by Peter Warasin
<peter-endian@users.sourceforge.net>. Many thanks.
- - if all the data is at the hour each day, totaliza_day() treates it all as being
+ - if all the data is at the hour each day, totaliza_day() treats it all as being
on the last day. This is observed for users which only download via a cron job
at the same time each day. Now the date and time will be
checked to see if changed.
- Russian_koi8 and Russian_windows1251 languages updated by
Stas Degteff <stas.grumbler@gmail.com>. Many thanks
- realtime reporting is sorted by URL, and not by Date/Time.
- Thanks tp Puce-Xcit <puce-xcit@users.sourceforge.net>
+ Thanks to Puce-Xcit <puce-xcit@users.sourceforge.net>
Aug/29/2006 Version 2.2.2
- malloc test implemented to avoid high-memory consuming.
Thanks to Antonio F. Zago <zagolinux@uol.com.br>
to share your Fedora Core 5 64 bits with me.
- fixed conflict types for 'saverecs2' in .configure
- - fixed no index.html when lastlog tag is greather then 0,
+ - fixed no index.html when lastlog tag is greater then 0,
caused by some debug messages.
- removed some development debug message
- user_limit_block script added to block users when limit exceeded
. strcpy+strcat is faster than sprintf (fixed in some places);
. unused variables removed;
. fixed headers look and feel (<th class="header3">);
- . fixed word 'BYTES' localisation for datetime user report;
+ . fixed word 'BYTES' localization for datetime user report;
. fixed corrupted top header on index, denied, download and tt-reports;
. fixed "No" table header in topsites;
. fixed user report table look;
TAG: realtime_access_log_lines num
TAG: realtime_types: GET,PUT,CONNECT,ICP_QUERY,POST
TAG: realtime_unauthenticated_records: ignore|show
- - garbage in topuser report with unitialized variable.
+ - garbage in topuser report with uninitialized variable.
Thanks to Craig Brockmeier <craig@ppco.com>
- memory leaks caused by a wrong variable size
Fixed by Klaus Singvogel <kssingvo@suse.de>. Thanks.
Thanks to Fabio Lo Votrico <fabio@link.it>
- bug fixed in squidguard report module
- squidguard_ignore_date on|off tag added to sarg.conf file
- You can ignore the squidguard log record date if outisde of
+ You can ignore the squidguard log record date if outside of
date range in squid access.log file.
- alternate squidguard log added using -L option on sarg command line.
Thanks to Dave Karlson <dkarlson@r9esd.k12.or.us>
- - fixed malloc withou free.
+ - fixed malloc without free.
- datafile-url ip|name added to sarg.conf file - saves ip address or name
in url when using datafile tag. Thanks to Calvin Muller <calvin@siryn.co.za>
- - wronk link point in Generated by sarg-2..
+ - wrong link point in Generated by sarg-2..
Thanks to Markus Hoffmann <ipcop@mh-lantech.de>
- Russian_UTF-8 language added by Alex Deiter <tiamat@komi.mts.ru>
added.
Thanks to Filippo Grassilli
- Spanish language fixed by Jos� Luis Hern�ndez L�pez. Thanks.
- - url variable size changed to acomodate big urls with coded symbols and some
+ - url variable size changed to accommodate big urls with coded symbols and some
minor changes in util.c file.
Thanks to Oleg <xsov@mail.ru>
- download suffixes improved by Oleg <xsov@mail.ru>. Thanks.
- exclude_users ignored in some situations.
- Fixes by Sapon Oleg from Russia:
. there are two equal lines about Evren Yurtesen in CONTRIBUTORS file.
- . Internationalisation of SARG user graph added, using iconv function, which
+ . Internationalization of SARG user graph added, using iconv function, which
is presented only in Linux, so I add required #ifdef and other stuff to clean
compile code on other platforms.
. 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
+ doesn't support '?' symbol in links (all of them interpret this like
parameter to cgi script);
- some good optimization to all three similar cicles in these files by
reducing false checks in 'if ...' strings.
- . Fixes segfault, produced by inproper use of strncpy functions, look - strncpy
+ . Fixes segfault, produced by improper use of strncpy functions, look - strncpy
doesn't copy leading '\0' symbol!
- . Just localisation support for repday report.
+ . Just localization support for repday report.
. Support usertab IP->USERNAME change in siteuser report.
- . Just proper Russian koi8 localisation.
+ . Just proper Russian koi8 localization.
Apr/22/2005 version 2.0.6
- Greek language by Antonis Maglaras <vegos@magla.gr>
vrfydir(): fix segfault if sub-directory "images" is not exists
function builddia() don't check the parameters. Result: segmentation fault in some cases.
Thanks to Stas Degteff stas_degteff@users.sourceforge.net for the fixes.
- - fixed: wrond date period in squidguard_log when using european date format.
+ - fixed: wrong date period in squidguard_log when using European date format.
Thanks to Guenther Mair <gunnyst@users.sourceforge.net>
- ulimit tag added on sarg.conf to avoid "Too many open files" error.
Thanks to Paulo Pires <paulo.pires@vodafone.pt>
-Feb/02/2005 verion 2.0.3
+Feb/02/2005 version 2.0.3
- squidguard parse logs method changed.
Thanks to Joao Mendes <jmendes@credibom.pt>
Thanks to Guenther Mair <gunnyst@users.sourceforge.net>
- grepday with invalid font path.
Thanks to Marcelo Ricardo Leitner <mrl@conectiva.com.br>
- -v option added to display Sarg version on console
- - Segmenation fault caused by an unclosed file.
+ - Segmentation fault caused by an unclosed file.
Thanks to Pustovalov Leonid
- SquidGuard log formats added.
Thanks to Kolotov Alexandr
- Report limits implemented
- Download report implemented
- Sarg logo by Osamu Matsuzaki <matsu_o@robata.org> added.
- - Internal mkdir added to easy port to various plataform.
+ - Internal mkdir added to easy port to various platform.
- long url now show only accessed site and module name.
- now you can add a user report url to a flat file to be blocked
by some Squid acl.
Request by Francesco Collini <collini@colliniconsulting.it>
- - remove temporary files, if already exist, to avoid conflits with a
+ - remove temporary files, if already exist, to avoid conflicts with a
previous sarg process..
Thanks to Renato Leon <rl_sita@hotmail.com>
- squidGuard improved
and using long_url
Thanks to Enrico Sorge <enrico.sorge@activevr.it>
-Dez/10/2001: - Added: sarg now shows statistics when readding the log file
+Dez/10/2001: - Added: sarg now shows statistics when reading the log file
if running with -x option
-Dez/05/2001: - bug fixed: - loop proccess when using "tmp" chars in usernames
+Dez/05/2001: - bug fixed: - loop process when using "tmp" chars in usernames
Thanks to Jasper vd Heijden <extern@midkemia.nl>
new tag added: show_successful_message yes
Show "Successful report generated on dir" message at end of process.
topuser_num
Now you can choose which fields must be in Topuser report and how many users.
Requested by Hidde Beumer <Hidde.Beumer@cmg.nl>
- bug fiexed: auth_failures report missing
+ bug fixed: auth_failures report missing
Thanks to Clary Harridge <clary@csee.uq.edu.au>
Polish language added by Wszebor Boksa <Wszebor_Boksa@koncept.pl>
Thank you.
- Latvian languages by Juris Valdovskis <juris@auce.lv>
Thank you
-Mar/22/2001: - Now te user can choose the language using the language TAG in /usr/local/sarg/sarg.conf file.
+Mar/22/2001: - Now the user can choose the language using the language TAG in /usr/local/sarg/sarg.conf file.
There is no more --enable-language in configure script.
- - New report added: Autentication Failures
+ - New report added: Authentication Failures
Requested by Sergei Dushenkov <dusha@dnttm.ru>
- NONE/400 (bad request) is excluded by default (/usr/local/sarg/exclude_codes)
- Now sarg support big numbers (64 bits) in any platform.
Thanks to vrush_22@softhome.net
- bug fixed: per_user_limit file with duplicate users.
- Russian languages fixed by Nikolai V. Ivanyushin <koko@infocenter.bryansk.ru>. Thank you.
- - charset TAG added to sarg.conf file. The following charsets are avaiable:
+ - charset TAG added to sarg.conf file. The following charsets are available:
Latin1 (West European), Latin2 (East European), Latin3 (South European)
Latin4 (North European), Cyrillic, Arabic, Greek, Hebrew
Latin5 (Turkish), Latin6 (Nordic)
Thank you.
Bug fixed: wrong sort field when lower case used in
sort tags.
- Thaks to Scott Larsen <slarsen@cascorp.com>
+ Thanks to Scott Larsen <slarsen@cascorp.com>
and to WOLETZ, Dusan <woletz@globtel.sk>
Abuse report removed.
Changed: report1_sort_field TAG in sqmgrlog.conf
changed to user_sort_field
Added: topsites sort field options added:
# TAG: topsites_sort_order CONNECT|BYTES A|D
- # Sort for topsites report, where A=Ascendent, D=Descendent
+ # Sort for topsites report, where A=Ascendant, D=Descendant
#
#topsite_sort_oder CONNECT D
Implementation requested by
You can set the top num sites in topuser_num tag in sqmgrlog.conf file.
Bug fixed: wrong userid when using Samba authenticator.
Thanks to klaubert@bcb.gov.br (Klaubert Herr da Silveira)
- Changed: -v option removed. No more suport for Squid-1 log format.
+ Changed: -v option removed. No more support for Squid-1 log format.
Thanks to Nik Oxley <nik.oxley@iholland.co.uk>
Aug/18/1999: New fields added to sqmgrlog.conf:
Thank you for your help.
- remove_temp_files yes|no
Remove temporary files: geral, usuarios, top, periodo from root report directory.
- Impementation requested by Fred Pacquier <fredp@dial.oleane.com>
+ Implementation requested by Fred Pacquier <fredp@dial.oleane.com>
- index yes|no|only
- Usage: index yes - will genereate the main index.html in reports
+ Usage: index yes - will generate the main index.html in reports
index no - dont generate the main index.html in reports
index only - generate only the main index.html in reports
Implementation asked by Fred Pacquier <fredp@dial.oleane.com>
- overwrite_report yes|no
- If yes and the report already exist for that date, the reports will be overwrited.
- If no and the report alread exist, that report will be renamed to filename.n, filename.n+1
+ If yes and the report already exist for that date, the reports will be overwritten.
+ If no and the report already exist, that report will be renamed to filename.n, filename.n+1
Implementation requested by Eugeny Kuzakov <CoreDumped@CoreDumped.null.ru>
- records_without_userid ignore|ip|everybody
What can I do with records without user id (no authentication) in access.log file ?
Added: now every squid code that contain the MISS word will be counted as out cache.
Implementation requested by Eugeny Kuzakov <CoreDumped@CoreDumped.null.ru>
Thank you for your help and for share your FreeBSD with me.
- Changed: the field url was changed to 8192 bytes to suport big urls.
+ Changed: the field url was changed to 8192 bytes to support big urls.
Thanks to Eugeny Kuzakov <CoreDumped@CoreDumped.null.ru>
Changed: the header "TIME SPENT" changed to "USED TIME" in topuser report.
Changed: no more nouser will be in reports but IP address instead.
Jun/09/1999: Bug fixed: to send reports via mail, use mail instead mailx in FreeBSD.
Thanks to Evren Yurtesen <yurtesen@ispro.net.tr> to share your FreeBSD with me.
- Bug fixed: wrong userid when using smb_auth autenticator.
+ Bug fixed: wrong userid when using smb_auth authenticator.
The userid will be changed from NTDOMAIN\username to NTDOMAIN.username.
Thanks to Jouko Ylikulju <Jouko.Ylikulju@pkcables.com>
Nov/09/1998: Version 2.0 released
-p option added. Allow redirect output report to email address.
- sqmgrlog.conf with colors, headers, title, font size, backgound color, text color,
+ sqmgrlog.conf with colors, headers, title, font size, background color, text color,
background image, font face, etc... added.
Reports will be generated only for users in passwd file (tag password in sqmgrlog.conf).
Many changes in html output layout.
Sep/28/1998: Bug fixed for log with emulate http on (Squid 1.2.beta)
Thanks to Alp <support@x5.net>
- -p option added. Generated reports with IP Address insted Userid.
+ -p option added. Generated reports with IP Address instead Userid.
Use this option if you do not use Proxy authentication on Squid.
Implementation requested by Szalma Zoltan <zszalma@file.matav.hu>
char m1[8], m2[8];
time_t curtime;
struct tm *loctm;
- int cstatus;
if(strcmp(IndexTree,"date") == 0) {
bzero(y1,sizeof(y1));
strcat(wdir,site);
}
- if(strcmp(dirname,wdir) != 0)
- strcpy(dirname,wdir);
+ strcpy(dirname,wdir);
if(strcmp(IndexTree,"date") != 0) {
if(!OverwriteReport) {
rename(dirname,wdir);
}
} else {
- if(access(wdir,R_OK) == 0) {
- sprintf(csort,"rm -r \"%s\"",wdir);
- cstatus=system(csort);
- if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
- fprintf(stderr, "SARG: command return status %d\n",WEXITSTATUS(cstatus));
- fprintf(stderr, "SARG: command: %s\n",csort);
- exit(1);
- }
+ if(access(dirname,R_OK) == 0) {
+ unlinkdir(dirname,1);
}
}
my_mkdir(dirname);
}
} else {
if(access(wdir,R_OK) == 0) {
- sprintf(csort,"rm -r \"%s\"",wdir);
- cstatus=system(csort);
- if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
- fprintf(stderr, "SARG: command return status %d\n",WEXITSTATUS(cstatus));
- fprintf(stderr, "SARG: command: %s\n",csort);
- exit(1);
- }
+ unlinkdir(wdir,1);
}
}
void baddata(void)
{
- char cmd[1024];
- int cstatus;
+ char dir[1024];
printf("SARG: ------------------------------------------------------------------------------\n");
printf("SARG: MALICIUS CODE DETECTED.\n");
printf("SARG: process stoped. No actions taken.\n");
printf("SARG: ------------------------------------------------------------------------------\n");
- if (snprintf(cmd,sizeof(cmd),"rm -rf \"%s/sarg\"",tmp)>=sizeof(cmd)) {
+ if (snprintf(dir,sizeof(dir),"%s/sarg",tmp)>=sizeof(dir)) {
fprintf(stderr,"SARG: temporary directory too long: %s/sarg\n",tmp);
exit(1);
}
- cstatus=system(cmd);
- if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
- fprintf(stderr, "SARG: command return status %d\n",WEXITSTATUS(cstatus));
- fprintf(stderr, "SARG: command: %s\n",cmd);
- exit(1);
- }
- if (snprintf(cmd,sizeof(cmd),"rm -rf \"%s\"",dirname)>=sizeof(cmd)) {
- fprintf(stderr,"SARG: directory to delete too long: %s\n",dirname);
- exit(1);
- }
- cstatus=system(cmd);
- if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
- fprintf(stderr, "SARG: command return status %d\n",WEXITSTATUS(cstatus));
- fprintf(stderr, "SARG: command: %s\n",cmd);
- exit(1);
- }
+ unlinkdir(dir,0);
+ unlinkdir(dirname,0);
exit(1);
}
}
}
}
+
+void unlinkdir(const char *dir,int contentonly)
+{
+ struct stat st;
+ DIR *dirp;
+ struct dirent *direntp;
+ char dname[MAXLEN];
+
+ dirp=opendir(dir);
+ if (!dirp) return;
+ while ((direntp = readdir(dirp)) != NULL) {
+ if (direntp->d_name[0] == '.' && (direntp->d_name[1] == '\0' ||
+ (direntp->d_name[1] == '.' && direntp->d_name[2] == '\0')))
+ continue;
+ if (snprintf(dname,sizeof(dname),"%s/%s",dir,direntp->d_name)>=sizeof(dname)) {
+ fprintf(stderr,"SARG: directory name to delete too long: %s/%s\n",dir,direntp->d_name);
+ exit(1);
+ }
+ if (lstat(dname,&st)) {
+ fprintf(stderr,"SARG: cannot stat %s\n",dname);
+ exit(1);
+ }
+ if (S_ISREG(st.st_mode)) {
+ if (unlink(dname)) {
+ fprintf(stderr,"SARG: cannot delete %s - %s\n",dname,strerror(errno));
+ exit(1);
+ }
+ } else if (S_ISDIR(st.st_mode)) {
+ unlinkdir(dname,1);
+ } else {
+ fprintf(stderr,"SARG: unknown path type %s\n",dname);
+ }
+ }
+ closedir(dirp);
+
+ if (!contentonly) {
+ if (rmdir(dir)) {
+ fprintf(stderr,"SARG: cannot delete %s - %s\n",dir,strerror(errno));
+ exit(1);
+ }
+ }
+}