Fix uninitialized variable when double checking the top users
The configuration option --enable-doublecheck was compiling in an
invalid piece of code that could potentially use an uninitialized
variable when building the list of the top users.
Escape the LDAP search string instead of truncating it.
A few characters must be escaped in a LDAP search string. Sarg used to
truncate the user login name at the first "dubious" character found in
the string and the list of "dubious" character was much longer than
necessary. Instead of truncating the user login, this patch escape the
characters.
Report an error if the tail command cannot read the last lines of the log file when creating a realtime report.
Surrond the log file name with quotes in the command that read the trailing lines of the log file when creating a realtime report.
Frédéric Marchal [Fri, 27 Aug 2010 13:16:43 +0000 (13:16 +0000)]
Initialize the variables that are used to build the date range when command line option -d is used.
It should prevent a segfault if the complex nesting of "if" fails to set a variable.
Thanks to ItalianPenguin for reporting this bug.
Frédéric Marchal [Tue, 17 Aug 2010 09:00:43 +0000 (09:00 +0000)]
Don't delete the temporary directory after sending the e-mail as it is deleted later by the program and it prevent the purging routine from working properly.
Frédéric Marchal [Tue, 17 Aug 2010 09:00:22 +0000 (09:00 +0000)]
Remove the quotes around the MailUtility command to allow the user to call a script or to add more options to the command.
The description of the mail_utility configuration option has been amended accordingly.
Frédéric Marchal [Sun, 15 Aug 2010 17:49:47 +0000 (17:49 +0000)]
Don't use string comparison to sort the top users, top sites and user lists.
Allow for the translation of the sort criterion and order of the top users, top sites and user lists.
Add a configuration option to report any error in the sum of the in-cache and out-cache columns of the reports. The sum must be 100.00%.
The total column is also checked for any discrepency.
The check is activated at compile time as it will likely be used by me alone.
Don't save the unnecessary columns in the intermediary file that is sorted to produce the report with the IP addresses from which the user connected to the internet. It should reduce the required amount of free disk space to run sarg.
Fix the reporting of the IP addresses from which the user connected to the internet. The date column was limited to 8 characters which is too short for a date formated as dd/mm/yyyy.
The two sarg.conf options "hours" and "weekdays" lacked a return statement after processing the option. That produced an error stating that the options were invalid but was not preventing sarg from working just fine.
Frédéric Marchal [Thu, 10 Jun 2010 08:49:48 +0000 (08:49 +0000)]
Replace redirector_ignore_date by redirector_filter_out_date that behave as the name implies.
Replace dansguardian_ignore_date by dansguardian_filter_out_date that behave as the name implies.
Initialize the variables used when reading a redirector log with a custom format.
Frédéric Marchal [Tue, 18 May 2010 20:46:56 +0000 (20:46 +0000)]
Output both date/time textual reports.
Sarg log file stores the date as dd/mm/yyyy and doesn't change it depending on the current date representation selected in sarg.conf.
Intermediary log files store the date as dd/mm/yyyy irrespective of the current date representation in sarg.conf.
Frédéric Marchal [Tue, 11 May 2010 07:00:43 +0000 (07:00 +0000)]
Accept the old option squidguard_log_format but display a warning if it is used.
Replace squidguard_ignore_date by redirector_ignore_date but keep the old option with a warning.
Frédéric Marchal [Mon, 10 May 2010 08:13:09 +0000 (08:13 +0000)]
Fix a regression when processing an input log not in the squid format (the date was not written into the intermediary logs).
Check more return code when writing files.
Use a boolean to select the content of the graph instead of a string (the two possible values are not mutually exclusive on purpose).
Use parameteric dimensions in the graph creation instead of hard coded constants.
Remove the temporary file and sorting in graph creation.
Add the redirector_log option in sarg.conf to read a log file created by squidGuard or Rejik (thanks to Maxim Britov for pointing out this missing option).
Allow up to 64 redirector log files to be passed through the command line option -L and the sarg.conf option redirector_log.
Configuration option squidguard_log_format renamed into redirector_log_format for equity with the various redirectors that can be used with sarg.
Strengthen the making of the report file name to drastically limit the characters from the user ID that can appear in the file name. The presence of an unescaped backquote in the user ID would execute the rest of the name as a shell command (fixes bug #2997707 reported by anonymous).
Compute the size of the excluded codes file instead of always allocating 1024 bytes.
Check the return codes when moving the file pointers to compute the file size.
Use the word "Redirector" instead of squidGuard in the report as other redirectors may be compatible with sarg.
Display the correct user id and ip in the redirector report.
Reduce the number of ip resolution when computing the redirector report.