]> git.ipfire.org Git - thirdparty/sarg.git/log
thirdparty/sarg.git
12 years agoFix some errors introduced by the previous patch for windows v2.3.2
Frédéric Marchal [Wed, 23 Nov 2011 19:26:47 +0000 (19:26 +0000)] 
Fix some errors introduced by the previous patch for windows

The changes made to make the realtime report compatible with windows
produced some errors on linux. This patch fixes those problems.

This fix also correctly sorts the entries by date and time whatever the
requested output date format is.

12 years agoFixes to compile sarg with mingw32
Frédéric Marchal [Wed, 23 Nov 2011 08:31:15 +0000 (08:31 +0000)] 
Fixes to compile sarg with mingw32

The mkstemp function isn't available on mingw32 so it is replaced by the less
safe mktemp/open calls.

mkstemp is used whenever possible. The weaker code is only used if mkstemp is
not available.

12 years agoRemove one more unused variable
Frédéric Marchal [Wed, 23 Nov 2011 07:49:05 +0000 (07:49 +0000)] 
Remove one more unused variable

12 years agoRemove unused variables
Frédéric Marchal [Wed, 23 Nov 2011 07:18:42 +0000 (07:18 +0000)] 
Remove unused variables

The variables were not detected as unused because they were assigned a value
but the value was never actually used.

12 years agoAdd missing \n on several debug messages
Frédéric Marchal [Thu, 10 Nov 2011 19:59:17 +0000 (19:59 +0000)] 
Add missing \n on several debug messages

Some messages were missing the carriage return. The consequence was a
concatenation of the following message with the previous one potentially
letting it go unnoticed.

12 years agoAdd the xml manpage to the archive
Frédéric Marchal [Fri, 4 Nov 2011 19:29:22 +0000 (19:29 +0000)] 
Add the xml manpage to the archive

That file is required to generate the manpage.

12 years agoRename the file to better suit its purpose
Frédéric Marchal [Wed, 2 Nov 2011 05:52:36 +0000 (05:52 +0000)] 
Rename the file to better suit its purpose

12 years agoUpdate the PO files
Frédéric Marchal [Tue, 1 Nov 2011 12:56:55 +0000 (12:56 +0000)] 
Update the PO files

12 years agoDelete the unused user's directories
Frédéric Marchal [Tue, 1 Nov 2011 12:56:16 +0000 (12:56 +0000)] 
Delete the unused user's directories

Some directories are created to store the user's data but if they end up
not being used, they are deleted along with their content. It saves
space on the disk.

A nicer fix would be not to create the directories and their content in
the first place but I'll keep that for the next release.

12 years agoAdd a script to prepare the archive to distribute
Frédéric Marchal [Tue, 1 Nov 2011 07:57:37 +0000 (07:57 +0000)] 
Add a script to prepare the archive to distribute

The shell script builds a list of the files to include in the archive,
build the archive and compute the checksums.

12 years agoUpdate the po files
Frédéric Marchal [Tue, 1 Nov 2011 07:45:26 +0000 (07:45 +0000)] 
Update the po files

12 years agoAdd a note about sorttable.js to README
Frédéric Marchal [Tue, 1 Nov 2011 07:31:07 +0000 (07:31 +0000)] 
Add a note about sorttable.js to README

Now, sorttable.js is distributed along with sarg.

12 years agoDon't link the download report to users not in the topusers list
Frédéric Marchal [Tue, 1 Nov 2011 07:30:48 +0000 (07:30 +0000)] 
Don't link the download report to users not in the topusers list

If the topusers list is truncated, don't link the download page to the
missing users.

12 years agoDon't process the details of the users that are not listed
Frédéric Marchal [Sun, 30 Oct 2011 19:04:54 +0000 (19:04 +0000)] 
Don't process the details of the users that are not listed

When the topusers list is limited to some users, the details of those
users are not processed and the corresponding files are not generated.

Some files are still generated but the changes needed to remove those
files are too intrusives for this release.

12 years agoAdd links on the Sites & Users page to the user's page
Frédéric Marchal [Sun, 30 Oct 2011 19:04:33 +0000 (19:04 +0000)] 
Add links on the Sites & Users page to the user's page

The page listing the links visited and who visited them contains links to
jump directly to the page of each user provided they are on the top
users page.

12 years agoUse a function to safely copy the strings
Frédéric Marchal [Sun, 30 Oct 2011 19:04:12 +0000 (19:04 +0000)] 
Use a function to safely copy the strings

Some calls already used strncpy to copy strings but, now, we are using a
function to encapsulate the code and it is used to copy the arguments
passed to sarg by the user.

12 years agoFix some translations
Frédéric Marchal [Sun, 30 Oct 2011 19:03:41 +0000 (19:03 +0000)] 
Fix some translations

The messages were produced through strings manipulations that are
incompatibles with the translation process.

12 years agoUpdate ChangeLog
Frédéric Marchal [Sun, 30 Oct 2011 14:43:41 +0000 (14:43 +0000)] 
Update ChangeLog

12 years agoUpdate the po files
Frédéric Marchal [Sun, 30 Oct 2011 14:43:25 +0000 (14:43 +0000)] 
Update the po files

12 years agoDisplay some messages to understand why sarg isn't doing something
Frédéric Marchal [Sun, 30 Oct 2011 14:42:42 +0000 (14:42 +0000)] 
Display some messages to understand why sarg isn't doing something

One common class of questions from users is to ask why sarg isn't
producing some kind of report. Considering the number of configuration
parameters, it is not surprising that some users get lost.

To help the users help themselves, the -z command line option has been
enhanced to print messages indicating why sarg don't produce a report.

12 years agoProtect a few buffers against overflows
Frédéric Marchal [Sun, 30 Oct 2011 14:42:07 +0000 (14:42 +0000)] 
Protect a few buffers against overflows

Use snprintf instead of strcpy, strcat or sprintf.

12 years agoDecouple the denied and authentication failure reports
Frédéric Marchal [Sun, 30 Oct 2011 14:41:46 +0000 (14:41 +0000)] 
Decouple the denied and authentication failure reports

Both reports were produced if only one of them was requested in the
report_type option and there were enough material to produce the other
report.

12 years agoFix a sorting issue in the DansGuardian log
Frédéric Marchal [Wed, 14 Sep 2011 07:35:05 +0000 (07:35 +0000)] 
Fix a sorting issue in the DansGuardian log

Times with a one digit hour must be sorted before the times with two
digits. To fix this issue, a padding zero is prefixed to the hour if it
contains only one digit.

Thanks to Iain Lopata for the patch.

12 years agoFix the computing of the date to filter out in the dansguardian log
Frédéric Marchal [Sun, 4 Sep 2011 14:19:30 +0000 (14:19 +0000)] 
Fix the computing of the date to filter out in the dansguardian log

The date to filter out when reading a dansguardian log is computed
through a string manipulation that fails when the day is encoded over
one digit.

This patch should fix the computation of the date value.

Thanks to Iain Lopata for reporting this bug.

12 years agoCheck for an integer overflow in getword_atoll
Frédéric Marchal [Sun, 4 Sep 2011 14:19:12 +0000 (14:19 +0000)] 
Check for an integer overflow in getword_atoll

Just to be sure we are reading correct data, the number build by
getword_atoll is checked for any overflow.

12 years agoFix the date range exclusion while reading the dansguardian log
Frédéric Marchal [Sun, 4 Sep 2011 14:18:58 +0000 (14:18 +0000)] 
Fix the date range exclusion while reading the dansguardian log

The exclusion of the entries in the dansguardian log based on the
selected date range was not working.

Thanks to Iain Lopata for fixing this bug.

12 years agoWrite a note about the ignored items in the reports
Frédéric Marchal [Fri, 2 Sep 2011 10:21:34 +0000 (10:21 +0000)] 
Write a note about the ignored items in the reports

Several parameters of sarg.conf can limit the number of lines written in the
reports but, so far, only the denied report was reporting how many entries were
left out.

Now, the authentication failure, the dansguardian and the redirector reports do
write the number of ignored lines.

That change should spare some headaches to the users trying to understand the
reports.

Thanks to Iain Lopata for reporting this problem.

12 years agoAttempt to fix a FreeBSD IP address resolution
Frédéric Marchal [Thu, 4 Aug 2011 06:10:43 +0000 (06:10 +0000)] 
Attempt to fix a FreeBSD IP address resolution

According to this post:

http://lists.freebsd.org/pipermail/freebsd-standards/2005-July/000948.html

Some old version of FreeBSD requires that the sa_len of the sockaddr_in
structure be initialized with the exact length passed to getnameinfo.

As Linux doesn't have the sa_len member, it is not initialized in sarg.
Therefore the IP address resolution fails when sarg is compiled on FreeBSD.

12 years agoUpdate version number and release date
Frédéric Marchal [Mon, 1 Aug 2011 05:40:48 +0000 (05:40 +0000)] 
Update version number and release date

The ChangeLog is updated too and the po files have been rebuild for this
version.

12 years agoCorrectly append a suffix to the mangled temporary file name
Frédéric Marchal [Thu, 28 Jul 2011 15:21:20 +0000 (15:21 +0000)] 
Correctly append a suffix to the mangled temporary file name

When two users end up with the same mangled temporary file name, a suffix is
supposed to be added at the end of the new file name to make it distinct from the
previous one but the suffix was added one byte too far making it useless.

The result was that the log entries of two or more users were written into the
same file overwritting each other's data and corrupting the report.

Thanks to Mark Dennison for reporting this bug.

12 years agoReplace tabs by spaces in the URL and the code
Frédéric Marchal [Thu, 28 Jul 2011 13:07:03 +0000 (13:07 +0000)] 
Replace tabs by spaces in the URL and the code

Any tab encountered in a field of the input log file will send sarg off track
as it uses a tab to delimit columns in its temporary files.

To prevent this problem, the URL and the HTML code found in the input log file
are processed to replace any tab character by a single space.

12 years agoDon't abort if topusers is not in report_type
Frédéric Marchal [Fri, 22 Jul 2011 08:19:14 +0000 (08:19 +0000)] 
Don't abort if topusers is not in report_type

If topusers is not set in report_type, sarg fails with a message indicating
that it can't open sarg-users.

This is expected as the file is not created if the top users list is not
generated.

Thanks to Peter for reporting this bug.

12 years agoProtect the columns sorting against missing or invalid dates
Frédéric Marchal [Mon, 4 Jul 2011 11:55:43 +0000 (11:55 +0000)] 
Protect the columns sorting against missing or invalid dates

Sorttable.js fails on columns containing a date on the first row but not on
subsequent rows. This patch assumes a zero date for any missing or invalid date
sorting those rows at the top of the table.

12 years agoUse locale aware comparison when sorting tables
Frédéric Marchal [Mon, 4 Jul 2011 11:55:27 +0000 (11:55 +0000)] 
Use locale aware comparison when sorting tables

12 years agoConvert sorttable.js to UTF-8
Frédéric Marchal [Mon, 4 Jul 2011 11:55:11 +0000 (11:55 +0000)] 
Convert sorttable.js to UTF-8

Original script was in ISO8859-1.

12 years agoAdd the javascript to dynamically sort the tables in the reports
Frédéric Marchal [Mon, 4 Jul 2011 11:54:51 +0000 (11:54 +0000)] 
Add the javascript to dynamically sort the tables in the reports

This is the original script written by Stuart Langridge and downloaded on
http://www.kryogenix.org/code/browser/sorttable/. It is included here as the
script contains some bugs and the author doesn't seem to be supporting his
script any more.

12 years agoUpdate the po files for translation
Frédéric Marchal [Mon, 4 Jul 2011 08:35:16 +0000 (08:35 +0000)] 
Update the po files for translation

12 years agoUpdate the list of the sources files to include in the po files
Frédéric Marchal [Mon, 4 Jul 2011 08:34:27 +0000 (08:34 +0000)] 
Update the list of the sources files to include in the po files

The translation files did not include the replacement of squidguard_log.c
and squidguard_report.c by redirector.c.

12 years agoUpdate the ChangeLog file
Frédéric Marchal [Mon, 4 Jul 2011 08:34:11 +0000 (08:34 +0000)] 
Update the ChangeLog file

12 years agoSet the correct release date in the code
Frédéric Marchal [Mon, 4 Jul 2011 08:33:56 +0000 (08:33 +0000)] 
Set the correct release date in the code

12 years agoExclude IPv6 hosts
Frédéric Marchal [Sat, 2 Jul 2011 19:49:43 +0000 (19:49 +0000)] 
Exclude IPv6 hosts

Host exclusion didn't support IPv6 addresses. This change add the
possibility to exclude host identified by a IPv6 address in the log.

The change required some extensive changes to the code to alias the host
names as several strings had to be made constants.

12 years agoStop parsing the URL at the parameters
Frédéric Marchal [Sat, 2 Jul 2011 19:49:23 +0000 (19:49 +0000)] 
Stop parsing the URL at the parameters

The end of a host name is marked by a / for a path or a ? for
parameters. Both must end the host name.

12 years agoAdd documentation for IP addresses in hostalias
Frédéric Marchal [Sat, 2 Jul 2011 19:49:07 +0000 (19:49 +0000)] 
Add documentation for IP addresses in hostalias

Previous commit added support for IP addresses in the hostalias file but
I forgot to update the documentation in sarg.conf.

12 years agoAdd support for IPv6 in the aliasing of host names
Frédéric Marchal [Sat, 25 Jun 2011 12:49:04 +0000 (12:49 +0000)] 
Add support for IPv6 in the aliasing of host names

IPv6 addresses can be defined in the hostalias file and accept the CIDR
notation.

Squares brackets are not required around the IP address in the hostalias
file but the log file should enclose the IPv6 address between square
brackets to avoid confusion with the port number.

12 years agoA IPv6 address is made of 8 short int
Frédéric Marchal [Fri, 24 Jun 2011 07:53:10 +0000 (07:53 +0000)] 
A IPv6 address is made of 8 short int

The allocated buffer was too small.

12 years agoProperly check the boundary of an array
Frédéric Marchal [Thu, 23 Jun 2011 13:57:53 +0000 (13:57 +0000)] 
Properly check the boundary of an array

12 years agoIncrease the limit on the number of days that can be processed
Frédéric Marchal [Thu, 23 Jun 2011 13:57:33 +0000 (13:57 +0000)] 
Increase the limit on the number of days that can be processed

If a log file (possibly restricted to a date range) ends up with more than 90
different dates, sarg aborts and complains that there are too many dates.

That restriction is just a safety and isn't critical so it has been increased
to a more reasonable value.

12 years agoAlias IP addresses in the URL using the CIDR notation
Frédéric Marchal [Mon, 20 Jun 2011 20:31:06 +0000 (20:31 +0000)] 
Alias IP addresses in the URL using the CIDR notation

Listing all the addresses in a range is tedious so the syntax is
extended to support the CIDR notation.

Only IPv4 are fully supported at the moment.

12 years agoAdd underscore in scheme characters
Frédéric Marchal [Mon, 20 Jun 2011 07:48:15 +0000 (07:48 +0000)] 
Add underscore in scheme characters

The underscore is not a valid character in the scheme of a URL but it is used
by squid as in cache_object://.

12 years agoUpdate ChangeLog
Frédéric Marchal [Sun, 19 Jun 2011 19:41:31 +0000 (19:41 +0000)] 
Update ChangeLog

12 years agoMerge squidguard_log.c and squidguard_report.c into one file
Frédéric Marchal [Sun, 19 Jun 2011 19:34:15 +0000 (19:34 +0000)] 
Merge squidguard_log.c and squidguard_report.c into one file

The functions are renamed to make them less specific to squidGuard as
they are compatible with other redirectors.

12 years agoAlias the host names in the redirector report
Frédéric Marchal [Sun, 19 Jun 2011 19:33:48 +0000 (19:33 +0000)] 
Alias the host names in the redirector report

The scheme is removed from the URL even for a custom report format and the
URL is always truncated to keep only the host name. The full URL was
always reported for a custom log format.

In addition, the reported host name is replaced by the alias if one is
defined.

There is no grouping of the identical host names as the report list one
access per line along with the access time so there is no grouping any
way.

12 years agoImprove a bit the processing of the URL
Frédéric Marchal [Sun, 19 Jun 2011 19:33:33 +0000 (19:33 +0000)] 
Improve a bit the processing of the URL

Detect more strictly the scheme prefixing the URL to avoid any false
positive.

The caller decides if the full URL must be kept or truncated.

12 years agoDon't report clickable link for aliased url
Frédéric Marchal [Sun, 19 Jun 2011 18:32:18 +0000 (18:32 +0000)] 
Don't report clickable link for aliased url

The HTML reports contain A tags to link to the page visited by the users
but if the host name is aliased, the link is meaningless and must not be
reported.

12 years agoProtect the sort commands against buffer overflow
Frédéric Marchal [Sat, 18 Jun 2011 10:56:40 +0000 (10:56 +0000)] 
Protect the sort commands against buffer overflow

The external sort commands are build by snprintf instead of sprintf
to guard against buffer overflows.

12 years agoExternal sort command delimits the columns only on a tabulation
Frédéric Marchal [Sat, 18 Jun 2011 10:32:16 +0000 (10:32 +0000)] 
External sort command delimits the columns only on a tabulation

The default sort command splits the columns on a blank to non blank
transition but our files only use a tabulation as the column separator.

Therefore, the calls to the external sort command explicitly require
that the columns be identified by a tabulation. It prevents problems
when the fields contain spaces.

12 years agoAlias host names in URL and group identical names
Frédéric Marchal [Sat, 18 Jun 2011 10:31:49 +0000 (10:31 +0000)] 
Alias host names in URL and group identical names

The user can write a file providing rules to replace the host names
extracted from the URL and displayed in the reports. The rules allow
for one wildcard in the host names to be matched.

Identical aliased host named are grouped together in the reports.

12 years agoExplicitly link against libm
Frédéric Marchal [Wed, 25 May 2011 06:03:06 +0000 (06:03 +0000)] 
Explicitly link against libm

Thanks to Diego Elio Pettenò for this patch.

13 years agoFix the error messages when parsing a redirector log with custom format
Frédéric Marchal [Wed, 4 May 2011 09:34:24 +0000 (09:34 +0000)] 
Fix the error messages when parsing a redirector log with custom format

If redirector_log_format is set in sarg.conf, the error messages displayed for
any error encountered while parsing the format string are unclear or wrong.
This patch fix the message and explain really why the format string could not
be used.

13 years agoUse anonymous file and directory names
Frédéric Marchal [Sun, 24 Apr 2011 07:43:51 +0000 (07:43 +0000)] 
Use anonymous file and directory names

The files and directories are named after the user whose report is
about. Therefore, even if the administrator tries to hide the user's
identity with a useratb file, the real identity is still visible in the
URL.

To solve this problem, option anonymous_output_files was added to
sarg.conf. When it is on, each user's file is named using a unique
number that can't be traced back to the real user.

This patch also allows to shorten the URL of the report.

Thanks to dbmaxpayne for suggesting this feature.

13 years agoAdd Danish po file
Frédéric Marchal [Sat, 23 Apr 2011 15:15:45 +0000 (15:15 +0000)] 
Add Danish po file

Thanks to Joe Hansen.

13 years agoRetry if getnameinfo returns EAI_AGAIN
Frédéric Marchal [Sat, 23 Apr 2011 14:58:09 +0000 (14:58 +0000)] 
Retry if getnameinfo returns EAI_AGAIN

The man page tells that the program should try again when getnameinfo
returns EAI_AGAIN but it doesn't say if the program should wait and how
many attempts it should perform. Therefore, we assume the implementation
just want us to call it again but we won't waste more time than that.
The number of IP addresses to resolve is potentially very big and it
doesn't matter much if a few addresses are not resolved.

13 years agoParse the time from a common access log
Frédéric Marchal [Fri, 15 Apr 2011 11:01:46 +0000 (11:01 +0000)] 
Parse the time from a common access log

The time was ignored when parsing a squid log file written with the common
logformat. The consequence was that all the accesses were reported as occuring
at 00:00.

This is a bug introduced in sarg 2.3.

Thanks to Richard P Scott for reporting this bug.

13 years agoDon't abort for an empty report directory
Frédéric Marchal [Fri, 25 Feb 2011 20:32:09 +0000 (20:32 +0000)] 
Don't abort for an empty report directory

If sarg fails and leaves an empty report directory, one without a
sarg-date file in it, any subsequent execution of sarg will fail due to
that empty report directory.

This change ignores such an empty directory and issue a simple warning.

13 years agoUpdate the po files, in particular the Russian translation
Frédéric Marchal [Fri, 25 Feb 2011 20:31:48 +0000 (20:31 +0000)] 
Update the po files, in particular the Russian translation

Thanks to Leonid Pushkarev for the Russian translation.

13 years agoAccept IPv6 addresses in realtime report
Frédéric Marchal [Fri, 25 Feb 2011 11:31:46 +0000 (11:31 +0000)] 
Accept IPv6 addresses in realtime report

13 years agoTake the date_format into account when converting a file
Frédéric Marchal [Fri, 25 Feb 2011 08:05:14 +0000 (08:05 +0000)] 
Take the date_format into account when converting a file

The date_format parameter read from sarg.conf was taken into account too late
in the program flow and was ignored during the convertion or the splitting of a
file. Only command line option -g was effective.

13 years agoDisplay the redirector link on the top users page
Frédéric Marchal [Sun, 13 Feb 2011 16:26:50 +0000 (16:26 +0000)] 
Display the redirector link on the top users page

The previous commit (svn 518) disabled the link from the top user list
to the redirector page.

Thanks to Arnaud Florent for locating the cause of the problem.

13 years agoDon't delete a file twice if -i is given on the command line
Frédéric Marchal [Wed, 9 Feb 2011 20:46:37 +0000 (20:46 +0000)] 
Don't delete a file twice if -i is given on the command line

If sarg is ran with command line option -i, in some circunstances I have
yet to clarify, the ip file is not produced. In that case, the name of
the previously created file (whose name is still in the string buffer)
is deleted a second time. The result is a failure as the file doesn't
exists any more.

Thanks to Arnaud Florent for reporting this bug.

13 years agoAdd the pt_BR translation
Frédéric Marchal [Wed, 9 Feb 2011 18:25:52 +0000 (18:25 +0000)] 
Add the pt_BR translation

Thanks to Mauricio Silveira.

13 years agoCheck for empty body in source code
Frédéric Marchal [Wed, 9 Feb 2011 15:23:29 +0000 (15:23 +0000)] 
Check for empty body in source code

Enable a warning in gcc to stop the compilation if an empty body is found after
some control structures. It should detect stray semi-colons at the end of the
control structures such as if, for, while,...

13 years agoDisable LDAP referrals
Frédéric Marchal [Mon, 7 Feb 2011 18:32:46 +0000 (18:32 +0000)] 
Disable LDAP referrals

LDAP referrals are disabled in ldapsearch. Let's see if that avoid the
Operations Error message produced when querying a MS AD server.

13 years agoTake the result of the test for -Werror=format into account
Frédéric Marchal [Mon, 7 Feb 2011 18:32:32 +0000 (18:32 +0000)] 
Take the result of the test for -Werror=format into account

Due to a copy and paste error, the non availability of -Werror=format in
the compiler was not taken into account.

13 years agoInstall the man page in man/man1
Frédéric Marchal [Mon, 7 Feb 2011 12:49:42 +0000 (12:49 +0000)] 
Install the man page in man/man1

Thanks to Mauricio Silveira for providing the patch.

13 years agoFix a problem with the attributes passed to ldap_search
Frédéric Marchal [Thu, 3 Feb 2011 14:02:18 +0000 (14:02 +0000)] 
Fix a problem with the attributes passed to ldap_search

The attributes list passed to ldap_search must be terminated by a NULL
pointer. That wasn't the case in sarg and was likely responsible for a
segfault. It should be fixed now.

13 years agoSupport for IPv6 addresses in Dansguardian's log
Frédéric Marchal [Wed, 2 Feb 2011 14:01:07 +0000 (14:01 +0000)] 
Support for IPv6 addresses in Dansguardian's log

The buffer to hold an IP address read from Dansguardian's log wasn't
big enough to contain an IPv6 address. The reading of such log was
failing.

13 years agoAccept IPv6 addresses in squidGuard's log
Frédéric Marchal [Wed, 2 Feb 2011 14:00:51 +0000 (14:00 +0000)] 
Accept IPv6 addresses in squidGuard's log

The buffer to store a IP address from squidGuard's log was not big
enough to hold an IPv6 address. That resulted in a getword loop error.

13 years agoUpdate the languages files
Frédéric Marchal [Tue, 1 Feb 2011 19:19:33 +0000 (19:19 +0000)] 
Update the languages files

13 years agoSettle for gettext version 0.18
Frédéric Marchal [Tue, 1 Feb 2011 19:18:52 +0000 (19:18 +0000)] 
Settle for gettext version 0.18

According to the gettext manual, AM_GNU_GETTEXT_VERSION sets the
minimum gettext version required to build the package but it doesn't
look quite right as my system insist on using that exact version of
gettext to install the po files.

13 years agoFix escaping of user id in LDAP query
Frédéric Marchal [Tue, 1 Feb 2011 19:18:30 +0000 (19:18 +0000)] 
Fix escaping of user id in LDAP query

The wrong variable was used uninitialized when escaping the user id
for the LDAP search.

13 years agoAccept any number of user id in the LDAP filter string
Frédéric Marchal [Mon, 31 Jan 2011 20:17:25 +0000 (20:17 +0000)] 
Accept any number of user id in the LDAP filter string

The previous code would only accept up to five %s in the LDAP search
string. It is sufficient in most cases but we can do better than that
and accept any number of occurences as long as the resulting filter
string can fit in the fixed size buffer hard coded in sarg.

13 years agoUse non-deprecated libldap functions
Frédéric Marchal [Mon, 31 Jan 2011 20:17:09 +0000 (20:17 +0000)] 
Use non-deprecated libldap functions

The previously used LDAP functions are marked as deprecated by
libldap. This new code uses the new functions.

In addition, ldap_initialize set the default domain which is not set
by ldap_init and may improve the communication with ADServer.

The new code layout also properly sets the returned user name if the
ID is not found on the LDAP server. The returned user name is the same
as the ID.

13 years agoChange gettext version to suit autopoint 0.17
Frédéric Marchal [Fri, 28 Jan 2011 08:19:27 +0000 (08:19 +0000)] 
Change gettext version to suit autopoint 0.17

Autopoint version 0.17 requires the gettext version to be rounded at
the revision number in AM_GETTEXT_VERSION. Therefore, the previous
minimum required version of 0.15.1 is rounded up to 0.16.

13 years agoHave a more compatible Makefile ?
Frédéric Marchal [Thu, 27 Jan 2011 19:51:25 +0000 (19:51 +0000)] 
Have a more compatible Makefile ?

The patsubst function introduced in sarg 2.3 to avoid the duplicate
file name lists in Makefile.in is a GNU make extension that is not
supported by BSD make. Therefore sarg 2.3 fails to compile on that
system with the default make command.

According to the GNU make documentation, the variable substitution
should be more compatible with other implementations but it isn't
clear whether it is accepted by BSD make or not. Let's try it.

13 years agoLower the minimum gettext version requirement
Frédéric Marchal [Thu, 27 Jan 2011 19:51:10 +0000 (19:51 +0000)] 
Lower the minimum gettext version requirement

We don't have to ask for the most recent version of gettext. A quick
search through gettext's sources showed that 0.15.1 is likely to
contain all the features we need.

In fact, all the features we need may be available since version 0.12
but I'm not sure about that.

13 years agoDon't create final files when index is set to only
Frédéric Marchal [Thu, 27 Jan 2011 15:27:41 +0000 (15:27 +0000)] 
Don't create final files when index is set to only

Some report files are unnecessary when indexonly is set. They are not
generated any more.

The temporary files that produces those files are still created.

13 years agoFix the creation of a report when index is set to only
Frédéric Marchal [Thu, 27 Jan 2011 15:27:26 +0000 (15:27 +0000)] 
Fix the creation of a report when index is set to only

Some unnecessary files are not created as they won't be used in the
report but too many of them are still created, especially the
temporary files. There is room for future improvements.

The index doesn't contain any link to the details of the user's
connections, visited sites, downloads and so on.

13 years agoDon't try to produce the users's report if indexonly is set
Frédéric Marchal [Thu, 27 Jan 2011 15:27:01 +0000 (15:27 +0000)] 
Don't try to produce the users's report if indexonly is set

The creation of the users's report was failing when indexonly was set
because the list of the users to process is taken from memory instead
of collecting it from the files in the output directory.

As no temporary file is created when indexonly is set, the output
directory is empty but as the users's name are still stored in memory,
sarg tried to read the non existant file and aborted.

13 years agoFactorisation of the usage of indexonly
Frédéric Marchal [Thu, 27 Jan 2011 15:26:45 +0000 (15:26 +0000)] 
Factorisation of the usage of indexonly

Several functions were called and then decided to return immediately
if indexonly was set. Most of those functions were called once or
twice but never from more than one place.

This change let the calling function decide if the call must be made
based on the value of indexonly which is always known.

The gain is mainly a reduction of the number of parameters passed to a
few functions. It also makes the code more readable as it is not
necessary to dig into the function to discover that it does nothing in
that case.

13 years agoSet the correct year in the ChangeLog
Frédéric Marchal [Thu, 27 Jan 2011 07:39:55 +0000 (07:39 +0000)] 
Set the correct year in the ChangeLog

Thanks to ungift-ed.

13 years agoSplit the input log file into several files
Frédéric Marchal [Tue, 25 Jan 2011 21:08:34 +0000 (21:08 +0000)] 
Split the input log file into several files

Each file contains one day worth of data. The name of the output file
is made of a user supplied prefix and the date corresponding to the
data in the file. The file may be written in a directory selected with
command line option -o.

Thanks to Mauricio Silveira.

13 years agoDon't try to produce a parsed log if parsed_output_log is none
Frédéric Marchal [Tue, 25 Jan 2011 21:08:09 +0000 (21:08 +0000)] 
Don't try to produce a parsed log if parsed_output_log is none

The correct value to set in parsed_output_log to disable the parsed
log is "no" but if the user enters "none" as is usual with the other
parameters, parsed_output_log is set to an empty string which is not
equivalent to "no". The creation of the parsed log would then proceed
and fail because the path is invalid.

13 years agoFix a warning about the type of sizeof as expected by printf
Frédéric Marchal [Tue, 25 Jan 2011 21:07:55 +0000 (21:07 +0000)] 
Fix a warning about the type of sizeof as expected by printf

The size returned by sizeof should fit easily in a int. No need to use
the more standard %zu that may not be portable to other less
compatible systems.

13 years agoDon't write at root of filesystem if no output directory is provided
Frédéric Marchal [Tue, 25 Jan 2011 21:07:40 +0000 (21:07 +0000)] 
Don't write at root of filesystem if no output directory is provided

The empty output_dir is accepted but it produces an error as the
output directory must be absolute. That restriction might be aleviated
in the future.

13 years agoLDAP search error clarification
Frédéric Marchal [Tue, 25 Jan 2011 13:19:11 +0000 (13:19 +0000)] 
LDAP search error clarification

If the LDAP search fails, in addition to the error message, the
searched string and the base DN are reported.

13 years agoChange year source files's header
Frédéric Marchal [Sun, 23 Jan 2011 06:24:36 +0000 (06:24 +0000)] 
Change year source files's header

13 years agoResolve IPv6 addresses when creating the datafile
Frédéric Marchal [Fri, 21 Jan 2011 15:56:05 +0000 (15:56 +0000)] 
Resolve IPv6 addresses when creating the datafile

There is an option to resolve the addresses of the visited web sites
into an IP address but the existing code was only capable of
converting host names to IPv4 addresses.

If getaddrinfo is available on the system, it is used to resolve the
host names.

13 years agoUpdate the po files
Frédéric Marchal [Wed, 12 Jan 2011 18:55:04 +0000 (18:55 +0000)] 
Update the po files

Update the po files after removing totger.c from the list of the files
to translate. The po files contain the new messages.

13 years agoRemove totger.c from the list of the files to translates
Frédéric Marchal [Wed, 12 Jan 2011 18:54:14 +0000 (18:54 +0000)] 
Remove totger.c from the list of the files to translates

The list of the files to translate still contained totger.c. That
produced a build error.

Thanks to IgorA100 for finding this bug.

13 years agoFix the month numbers read from a sarg log
Frédéric Marchal [Wed, 12 Jan 2011 15:05:10 +0000 (15:05 +0000)] 
Fix the month numbers read from a sarg log

The month numbers parsed from a sarg log file name were in the range 1
to 12 but they must be in the range 0 to 11. This problem has been
fixed thanks to Denis Konchekov.

In addition, the numerical values of the days and months parsed from
the sarg log file name are more strictly validated.