]> git.ipfire.org Git - thirdparty/sarg.git/log
thirdparty/sarg.git
9 years agoUpdate the copyright year in every source file
Frederic Marchal [Sun, 26 Apr 2015 07:32:16 +0000 (09:32 +0200)] 
Update the copyright year in every source file

I join a script to automatically update the year.

9 years agoFix the file name reported in a write error message
Frederic Marchal [Sat, 25 Apr 2015 19:30:05 +0000 (21:30 +0200)] 
Fix the file name reported in a write error message

An error message when closing a file was not reporting the right file name.

9 years agoOutput only two sets of messages when fclose fails
Frederic Marchal [Sat, 25 Apr 2015 19:29:28 +0000 (21:29 +0200)] 
Output only two sets of messages when fclose fails

One message is for write errors and the other is for read errors. Read
errors were mostly not detected before this change.

9 years agoRemove deleted C file from po source list
Frederic Marchal [Sun, 12 Apr 2015 14:38:12 +0000 (16:38 +0200)] 
Remove deleted C file from po source list

The source file charset.c was deleted a long time ago. It is now removed
from the list of the files to scan to update the po files.

9 years agoMore messages merged to reduce the number of messages to translate.
Frederic Marchal [Thu, 2 Apr 2015 19:28:24 +0000 (21:28 +0200)] 
More messages merged to reduce the number of messages to translate.

9 years agoMore messages merged to reduce the number of messages to translate.
Frederic Marchal [Thu, 2 Apr 2015 19:27:51 +0000 (21:27 +0200)] 
More messages merged to reduce the number of messages to translate.

9 years agoUse the function name in a message to reduce the number of messages.
Frederic Marchal [Thu, 2 Apr 2015 19:18:24 +0000 (21:18 +0200)] 
Use the function name in a message to reduce the number of messages.

9 years agoUse the same variable type in a message
Frederic Marchal [Thu, 2 Apr 2015 19:16:14 +0000 (21:16 +0200)] 
Use the same variable type in a message

To reduce the number of messages to translate, the index reported in the
message is always an int. There was no reasons to use something else in the
first place.

9 years agoFix a spelling error in messages.
Frederic Marchal [Thu, 2 Apr 2015 19:12:50 +0000 (21:12 +0200)] 
Fix a spelling error in messages.

9 years agoDon't check a write error in the trailer
Frederic Marchal [Thu, 2 Apr 2015 19:12:31 +0000 (21:12 +0200)] 
Don't check a write error in the trailer

Other fputs are not checked and any write error is caught more reliably
when the file is closed.

9 years agoNormalize the messages to have less messages to translate.
Frederic Marchal [Thu, 2 Apr 2015 19:08:06 +0000 (21:08 +0200)] 
Normalize the messages to have less messages to translate.

9 years agoFix a few spelling mistakes.
Frederic Marchal [Wed, 1 Apr 2015 18:20:14 +0000 (20:20 +0200)] 
Fix a few spelling mistakes.

9 years agoSimplify the messages to translate
Frederic Marchal [Wed, 1 Apr 2015 18:18:04 +0000 (20:18 +0200)] 
Simplify the messages to translate

Translated messages that differ only in the file name printed at the
end of the message are now split in two parts. The file name is taken out
of the translated message to leave only the common part to be translated.

9 years agoRemove old commented out code.
Frederic Marchal [Mon, 30 Mar 2015 18:57:06 +0000 (20:57 +0200)] 
Remove old commented out code.

9 years agoRemove execution bit on source files
Frederic Marchal [Mon, 30 Mar 2015 18:53:48 +0000 (20:53 +0200)] 
Remove execution bit on source files

Some c and h files had the execution bit set. It was a mistake.

9 years agoUpdate the build date and version number
Frederic Marchal [Thu, 19 Mar 2015 20:03:02 +0000 (21:03 +0100)] 
Update the build date and version number

Sarg is now labeled as version 2.4.0-pre2 dated from 2015-03-19.

9 years agoReal time report takes POST into account
Frederic Marchal [Thu, 19 Mar 2015 20:01:21 +0000 (21:01 +0100)] 
Real time report takes POST into account

As PUT and POST are very similar, there is no point in including the former
into the real time report and not the latter.

9 years agoMerge branch 'master' of /run/media/maf/TRACK/sarg/sarg
Frederic Marchal [Thu, 19 Mar 2015 19:58:43 +0000 (20:58 +0100)] 
Merge branch 'master' of /run/media/maf/TRACK/sarg/sarg

9 years agoGet rid of the dependency to an external tail command
Frederic Marchal [Thu, 19 Mar 2015 19:56:30 +0000 (20:56 +0100)] 
Get rid of the dependency to an external tail command

The real time report relied on an external "tail" command to get the last
lines of the input log file. That dependency has been removed.

Moreover, if several log files were passed, the real time report would
always read the first one. Now, sarg chooses the most recently modified log
file.

The input log file can be in any supported format. It doesn't have to be
a standard squid log format.

9 years agoCMake pack command ignores git instead of svn
Frédéric Marchal [Sat, 7 Mar 2015 12:33:30 +0000 (13:33 +0100)] 
CMake pack command ignores git instead of svn

The CMake command to create a package must ignore the .git directory. The
.svn directory isn't used any more.

9 years agoDon't search for bzero during configuration
Frédéric Marchal [Sat, 7 Mar 2015 12:31:57 +0000 (13:31 +0100)] 
Don't search for bzero during configuration

That function isn't used any more in sarg.

9 years agoIgnore negative elapsed time in squid log
Frederic Marchal [Thu, 5 Mar 2015 19:49:33 +0000 (20:49 +0100)] 
Ignore negative elapsed time in squid log

Squid sometime reports a negative elapsed time. Commit d91457d25 only
improperly fixed it. The negative value was still rejected as an invalid
line.

This fix detects the negative value and ignore it.

9 years agoConfigure the images directory in sarg.conf
Frederic Marchal [Thu, 5 Mar 2015 15:34:19 +0000 (16:34 +0100)] 
Configure the images directory in sarg.conf

The directory where the images resides can be changed at run time by
setting image_dir in sarg.conf.

9 years agoGet the file size with the available stat member
Frederic Marchal [Thu, 5 Mar 2015 14:35:03 +0000 (15:35 +0100)] 
Get the file size with the available stat member

On MinGW, the stat structure doesn't have all the member variables used to
compute the size of a file.

9 years agoLC_MESSAGES undeclared by MinGW
Frederic Marchal [Thu, 5 Mar 2015 14:30:20 +0000 (15:30 +0100)] 
LC_MESSAGES undeclared by MinGW

Including gettext.h produces an error because LC_MESSAGES is not declared
by MinGW. To solve this, the gettext.h file isn't included on MinGW and
the missing functions are manually declared.

9 years agoInclude winsock2.h before windows.h to please the compiler
Frederic Marchal [Thu, 5 Mar 2015 14:29:14 +0000 (15:29 +0100)] 
Include winsock2.h before windows.h to please the compiler

windows.h display a warning if winsock2.h isn't included first.

9 years agoList the header files in cmake
Frederic Marchal [Thu, 5 Mar 2015 14:28:12 +0000 (15:28 +0100)] 
List the header files in cmake

QtCreator needs the header files to be listed in the source variable to
display them in its project tree when the cmake project is imported.

9 years agomkdir is really a mess on MinGW
Frederic Marchal [Thu, 5 Mar 2015 14:26:52 +0000 (15:26 +0100)] 
mkdir is really a mess on MinGW

mkdir with one argument produces an error as the macro requires two
arguments. I couldn't find which macro it is!

mkdir with two arguments doesn't work as _mkdir isn't defined without
direct.h.

_mkdir isn't defined without direct.h and direct.h cannot be included
unless NO_OLDNAMES is defined to mask the mkdir macro which conflict with
the definition in io.h.

9 years agoReplace bzero by memset
Frederic Marchal [Thu, 5 Mar 2015 14:20:17 +0000 (15:20 +0100)] 
Replace bzero by memset

That function isn't available on MinGW.

9 years agoRemove the flooding of the console with a debug message
Frederic Marchal [Wed, 4 Mar 2015 19:55:34 +0000 (20:55 +0100)] 
Remove the flooding of the console with a debug message

Every excluded site was reported on the console when -z was used. Those
messages were flooding the console even with a small log file.

As the message belong to the most advanced debugging level, its debug
level as been increased to -zzzz.

9 years agoDisplay some debug messages when -z is used to track the progress
Frederic Marchal [Wed, 4 Mar 2015 19:53:34 +0000 (20:53 +0100)] 
Display some debug messages when -z is used to track the progress

When processing a big log file, sarg would remain silent for some time even
with -z enabled. With those messages, the user understand what is
happening.

9 years agoMerge commit '997a4328762024f4a21a33e3c26d354be8764589'
Frederic Marchal [Wed, 4 Mar 2015 19:29:20 +0000 (20:29 +0100)] 
Merge commit '997a4328762024f4a21a33e3c26d354be8764589'

9 years agoMerge branch 'master' of ssh://git.code.sf.net/p/sarg/code
Frederic Marchal [Wed, 4 Mar 2015 19:28:39 +0000 (20:28 +0100)] 
Merge branch 'master' of ssh://git.code.sf.net/p/sarg/code

9 years agoProxy authentication code is ignored when building the report
Frederic Marchal [Wed, 4 Mar 2015 19:27:21 +0000 (20:27 +0100)] 
Proxy authentication code is ignored when building the report

The user report excludes HTTP code 407 meaning that the proxy requires an
authentication.

It must be excluded too when summing up the downloaded size while reading
the input log. The previous code aborted with an error if
--enable-extraprotection was used and the log contained a 407 code.

Conflicts:
log.c

9 years agoIncrease the buffer size to sort some user reports
Frederic Marchal [Wed, 4 Mar 2015 19:03:12 +0000 (20:03 +0100)] 
Increase the buffer size to sort some user reports

The buffer to prepare the sort command to sort the files required to build
siteuser.html and sarg-sites was very small and was not big enough if the
user ID was unusually long.

9 years agoReplace command line option -m by the fourth debug level
Frederic Marchal [Wed, 4 Mar 2015 17:52:26 +0000 (18:52 +0100)] 
Replace command line option -m by the fourth debug level

Command line option -m is replaced by -zzzz.

9 years agoFirst use of a debug level
Frederic Marchal [Wed, 4 Mar 2015 17:51:24 +0000 (18:51 +0100)] 
First use of a debug level

Messages to be displayed at that level are those that used to be displayed
by command line option -z.

9 years agoFree up command line option -v for verbose mode
Frederic Marchal [Sun, 1 Mar 2015 19:35:59 +0000 (20:35 +0100)] 
Free up command line option -v for verbose mode

The option to display the version number is now -V.

9 years agoFix the output report directory name
Frederic Marchal [Mon, 19 Jan 2015 09:31:52 +0000 (10:31 +0100)] 
Fix the output report directory name

The reports were stored in a directory named 000000000-000000000 instead
of the correct date covered by the report.

9 years agoImprove the message helping the user to set the translation up
Frederic Marchal [Fri, 12 Dec 2014 16:23:45 +0000 (17:23 +0100)] 
Improve the message helping the user to set the translation up

It isn't easy to figure out where sarg searches for sarg.mo. Running sarg
like sarg -x -v display the usual version number and a message giving
enough information to know where to put the message file.

9 years agoDisplay locale information for debugging purpose
Frederic Marchal [Thu, 11 Dec 2014 14:01:23 +0000 (15:01 +0100)] 
Display locale information for debugging purpose

Running sarg -x -v display the version number but also the directory where
the message file is looked for, the package name and the currently
selected locale.

9 years agoUpdate the French translation.
Frederic Marchal [Wed, 10 Dec 2014 21:00:40 +0000 (22:00 +0100)] 
Update the French translation.

9 years agoFetch the simplified Chinese translation from the TP
Frederic Marchal [Wed, 10 Dec 2014 21:00:23 +0000 (22:00 +0100)] 
Fetch the simplified Chinese translation from the TP

That translation has been released with sarg for a long time but it was
only accepted by the translation project today.

9 years agoAdd a comment about a puzzling piece of code
Frederic Marchal [Wed, 10 Dec 2014 20:57:56 +0000 (21:57 +0100)] 
Add a comment about a puzzling piece of code

The trick to store the same string only once is not clear and deserves a
little comment.

9 years agoSarg.conf with the topuser_fields documentation
Frederic Marchal [Wed, 10 Dec 2014 20:54:22 +0000 (21:54 +0100)] 
Sarg.conf with the topuser_fields documentation

The default configuration file now describes the accepted columns for the
top user report.

9 years agoDisplay a column with the user's IP address in the top user report
Frederic Marchal [Wed, 10 Dec 2014 20:28:17 +0000 (21:28 +0100)] 
Display a column with the user's IP address in the top user report

In sarg.conf, topuser_fields accept the new USERIP parameter to display
a new column with the user's IP address. It is only useful if the IP
address is replaced by a name or resolved to a host name.

9 years agoMerge branch 'master' of ssh://git.code.sf.net/p/sarg/code
Frederic Marchal [Sat, 29 Nov 2014 10:01:04 +0000 (11:01 +0100)] 
Merge branch 'master' of ssh://git.code.sf.net/p/sarg/code

9 years agoAdd the Brazilian Portuguese translation
Frederic Marchal [Sat, 29 Nov 2014 10:00:05 +0000 (11:00 +0100)] 
Add the Brazilian Portuguese translation

Many thanks to Marcio Costa for this work.

9 years agoFix a problem with log file names storage
Frederic Marchal [Wed, 8 Oct 2014 18:54:40 +0000 (20:54 +0200)] 
Fix a problem with log file names storage

Log file names are stored in a tree to save space. They have to be merged
back when the full file name is required. But an error prevented the file
name from being reconstructed if two files were stored in different
directories and one node of the tree has a lower depth than the next
one.

9 years agoMerge the tiny charset name convertor function
Frederic Marchal [Wed, 8 Oct 2014 18:52:12 +0000 (20:52 +0200)] 
Merge the tiny charset name convertor function

There is no need to have a distinct source file for that tiny global
function when it can be stored in getconf.c and be static.

9 years agoSplit a long line.
Frederic Marchal [Sun, 5 Oct 2014 18:36:30 +0000 (20:36 +0200)] 
Split a long line.

9 years agoRewrite the index tree rebuilding
Frederic Marchal [Sun, 5 Oct 2014 18:36:10 +0000 (20:36 +0200)] 
Rewrite the index tree rebuilding

When index_tree is set to "date", the reports are stored in a tree based
on their content's date. The existing code was somewhat broken.

In addition, the directory size used to be computed and displayed in the
years index file. It is now computed and displayed in the months and days
indexes.

9 years agoClose some open files in email.c
Frederic Marchal [Sat, 4 Oct 2014 15:14:14 +0000 (17:14 +0200)] 
Close some open files in email.c

This is patch #38 submitted by T.M. Abraham. Many thanks.

9 years agoReplace some more overlooked index.html constants
Frederic Marchal [Wed, 1 Oct 2014 19:54:27 +0000 (21:54 +0200)] 
Replace some more overlooked index.html constants

See commit 56b97279b03d9ff758528f6f2d6eeeff4cd3f09e for the first part of
this change.

9 years agoDelete old reports when index_tree is set to "date"
Frederic Marchal [Tue, 30 Sep 2014 19:09:39 +0000 (21:09 +0200)] 
Delete old reports when index_tree is set to "date"

Sarg goes to great length to make sure no unrelated directories are
deleted.

A list of every report directory is build. It is sorted in ascending order
on the last modification time. If too many directories are present, the
oldest ones are deleted including the possibly remaining empty parent
directory.

The index.html file is not rebuild to account for the deleted reports yet.

9 years agoRe-enable the deletion of old reports
Frederic Marchal [Tue, 30 Sep 2014 18:52:15 +0000 (20:52 +0200)] 
Re-enable the deletion of old reports

The old report deletion has been commented out for testing. It is now
reinstated.

9 years agoUse a global constant instead of the "index.html" file name in the code
Frederic Marchal [Tue, 30 Sep 2014 18:49:14 +0000 (20:49 +0200)] 
Use a global constant instead of the "index.html" file name in the code

The name of the html index file is defined once in the source code as a
global constant instead of littering the source code with a hard coded
litteral string.

9 years agoDisplay the period covered by the logs even if no records were found
Frederic Marchal [Tue, 30 Sep 2014 18:15:19 +0000 (20:15 +0200)] 
Display the period covered by the logs even if no records were found

Displaying the start and end dates found in the log helps in diagnosing
why the requested date was not found.

9 years agoVerbose output with correct period covered by the logs
Frederic Marchal [Mon, 29 Sep 2014 19:49:26 +0000 (21:49 +0200)] 
Verbose output with correct period covered by the logs

Previous versions reported the period covered by the log but it was, in
fact, the period extracted from the log limited to the requested range.

Now, two distinct messages are displayed in verbose mode. The first is the
period really covered by the log files. The second is the range taken into
account to produce the report.

9 years agoImprove old reports deletion
Frederic Marchal [Sun, 28 Sep 2014 18:23:28 +0000 (20:23 +0200)] 
Improve old reports deletion

Use the last modification time to sort the old reports directories. The
previously used ctime is not the creation time but the time at which the
directory meta data was last modified.

Creating the old report list don't use temporary files nor the external
sort command. Everything is kept and sorted in memory.

The code make sure the report directory looks like one of our report
directory. This is a safety to avoid deleting an unrelated directory.

Currently this safety mechanism only detects directories created with in
index_tree set to "file".

9 years agoMerge branch 'master' of ssh://git.code.sf.net/p/sarg/code
Frederic Marchal [Sun, 21 Sep 2014 14:06:14 +0000 (16:06 +0200)] 
Merge branch 'master' of ssh://git.code.sf.net/p/sarg/code

9 years agoEnsure the ChangeLog has been updated
Frederic Marchal [Sun, 21 Sep 2014 13:26:20 +0000 (15:26 +0200)] 
Ensure the ChangeLog has been updated

I used to always forget to update the ChangeLog before releasing sarg. It
won't happen if the archive script check that the ChangeLog contains an
entry for the current version and release date.

9 years agoCheck the release date when archiving the project
Frederic Marchal [Sun, 21 Sep 2014 14:00:37 +0000 (16:00 +0200)] 
Check the release date when archiving the project

The release date is in the cmake script and in the source code. The script
to package sarg now check that the two dates are identical.

Conflicts:
archive.sh

9 years agoArchive script check for version number without cat
Frederic Marchal [Sun, 21 Sep 2014 13:40:11 +0000 (15:40 +0200)] 
Archive script check for version number without cat

There is no need to check the version number with a cat. Sed can read the
file by itself.

9 years agoArchive script with better error messages
Frederic Marchal [Sun, 21 Sep 2014 13:37:26 +0000 (15:37 +0200)] 
Archive script with better error messages

When the version number isn't correct, the error message gives a clearer
indication about what is wrong.

Conflicts:
archive.sh

9 years agoExplicitly link against the math library
Frederic Marchal [Sun, 21 Sep 2014 08:59:39 +0000 (10:59 +0200)] 
Explicitly link against the math library

This patch was suggested by Diego Elio Pettenò on May 25, 2011 and
implemented in commit b966a3a224de2a6ea591458bec47c1bb4e9b3745 but the
patch had not been applied to the CMake build file.

9 years agoFix _FORTIFY_SOURCE redefinition error
Frederic Marchal [Sun, 21 Sep 2014 08:56:21 +0000 (10:56 +0200)] 
Fix _FORTIFY_SOURCE redefinition error

Some systems define _FORTIFY_SOURCE by default. It conflicts with our use
of that macro when --enable-extraprotection is passed to the configuration
script.

The solution is to undefine it before redefining it with value 2.

If a higher _FORTIFY_LEVEL level ever appears, it will have to be used in
this program to benefit from the highest protection possible.

9 years agoHelp in diagnosing the number of old reports to keep
Frederic Marchal [Sun, 15 Jun 2014 14:44:56 +0000 (16:44 +0200)] 
Help in diagnosing the number of old reports to keep

The lastlog and lastlog1 files are stored in the temporary directory
instead of the output directory and they are not deleted when sarg exits
if the user asked not to delete temporary files.

Some debug messages give indication about what is happening with respect
to the old reports deletion.

9 years agoClean up sarg-php HTML and report more errors
Frederic Marchal [Wed, 21 May 2014 19:42:03 +0000 (21:42 +0200)] 
Clean up sarg-php HTML and report more errors

The original HTML was the bare minimum and no error messages were printed.
This patch should fix it if only someone could test it.

10 years agoSarg.conf search exclude_codes in the default directory
Frederic Marchal [Mon, 14 Apr 2014 14:32:27 +0000 (16:32 +0200)] 
Sarg.conf search exclude_codes in the default directory

The default sarg.conf was looking for exclude_codes at the wrong place.

Thanks to José Vicente Mondejar for reporting this bug.

10 years agoMay fix some errors in sarg-php
Frederic Marchal [Mon, 14 Apr 2014 11:06:00 +0000 (13:06 +0200)] 
May fix some errors in sarg-php

Sarg-php was in a sorry state but as Jose Vicente Mondejar kindly provided
a translation, I felt obliged to try to improve things a bit.

I can't test it on my computer. I hope I didn't broke it more than it was.

10 years agoFix a link error with libpcre
Frederic Marchal [Thu, 28 Nov 2013 18:47:35 +0000 (19:47 +0100)] 
Fix a link error with libpcre

Libpcre was linked at the beginning of the link command. It was fine with
some compilers but not with others.

Libraries are supposed to be linked after every *.o file that use them or
some linker (gold?) reports errors about undefined references to functions.

Thanks to Micha Voss for reporting this problem and testing the solution.

10 years agoClang compatibility fix
Frederic Marchal [Thu, 21 Nov 2013 08:31:53 +0000 (09:31 +0100)] 
Clang compatibility fix

Option to not fail on integers sign comparison must come after the extra
warnings have been enabled or it is ignored.

10 years agoReport LDAP status at the end of the configuration script
Frederic Marchal [Wed, 6 Nov 2013 07:15:29 +0000 (08:15 +0100)] 
Report LDAP status at the end of the configuration script

As was already done with gd and pcre, the lack of ldap support is
reported at the end of the configuration script.

10 years agoFix a message text in configure.
Frederic Marchal [Wed, 6 Nov 2013 07:13:42 +0000 (08:13 +0100)] 
Fix a message text in configure.

10 years agoCheck that every required ldap header file is available
Frederic Marchal [Wed, 6 Nov 2013 07:12:29 +0000 (08:12 +0100)] 
Check that every required ldap header file is available

LDAP support is only enabled if every required header file is detected on
the target system.

10 years agoProcess correctly run together options
Frederic Marchal [Thu, 25 Jul 2013 05:32:46 +0000 (07:32 +0200)] 
Process correctly run together options

If sarg is ran with option -l combined with any other option such as -xl,
then the -l option is mistaken as --lastlog and does not produce the
expected result (which is to use the access.log file passed as argument).

It has been fixed by requiring that any long option is préfixed with a
double dash.

It breaks the compatibility with old versions but nobody should notice.

Thanks to Leonardo Rodrigues for reporting this bug.

10 years agoMerge branch 'master' of ssh://git.code.sf.net/p/sarg/code
Frederic Marchal [Thu, 25 Jul 2013 04:48:05 +0000 (06:48 +0200)] 
Merge branch 'master' of ssh://git.code.sf.net/p/sarg/code

10 years agoFix several possible sprintf buffer overflows
Frederic Marchal [Tue, 23 Jul 2013 11:02:13 +0000 (13:02 +0200)] 
Fix several possible sprintf buffer overflows

At least one of those sprintf was producing a segfault when a very long
elapsed time was encountered.

Thanks to Ricardo Fregati for reporting this bug and Marc Cesarine for
solving it.

10 years agoApply a recommendation from gcc
Frederic Marchal [Wed, 12 Jun 2013 05:39:56 +0000 (07:39 +0200)] 
Apply a recommendation from gcc

Gcc suggested to put parentheses around an operator to clarify a if
statement.

10 years agoUse a string to decide the content of the per_user_limit file
Frederic Marchal [Thu, 6 Jun 2013 12:31:45 +0000 (14:31 +0200)] 
Use a string to decide the content of the per_user_limit file

Instead of a numerical value 0/1, the strings "ip" or "id" are used in the
per_user_limit option to decide if the file contains the IP address or the
user's ID.

10 years agoAn aliased IP address is not an IP address any more
Frederic Marchal [Thu, 6 Jun 2013 12:25:24 +0000 (14:25 +0200)] 
An aliased IP address is not an IP address any more

If the user's IP address is aliased, it must not be considered to be an
IP address to be resolved by the DNS.

10 years agoFix the aliasing of an IPv4 address
Frederic Marchal [Thu, 6 Jun 2013 12:22:39 +0000 (14:22 +0200)] 
Fix the aliasing of an IPv4 address

The comparison was not working properly and the line of code was a little
bit obfuscated.

10 years agoAdd an option to create the per_user_limit files
Frederic Marchal [Thu, 6 Jun 2013 11:05:17 +0000 (13:05 +0200)] 
Add an option to create the per_user_limit files

Sarg.conf allows the user to either always create a per_user_limit file
even if it is empty or only create it if some user crosses the limit.

10 years agoAdd a function to look a user up by IP address
Frederic Marchal [Thu, 6 Jun 2013 09:55:56 +0000 (11:55 +0200)] 
Add a function to look a user up by IP address

The function is currently unused but I might have had some use for it so I
left it in the code.

10 years agoCreate multiple per_user_limit files
Frederic Marchal [Wed, 5 Jun 2013 20:17:02 +0000 (22:17 +0200)] 
Create multiple per_user_limit files

Each file can have a different limit.

For each file, it is possible to write the user's ID or the user's IP
address.

If the files exists, they are purged.

10 years agoDon't generate the date/time report page if it isn't used
Frederic Marchal [Mon, 3 Jun 2013 12:58:50 +0000 (14:58 +0200)] 
Don't generate the date/time report page if it isn't used

The temporary file may still be created but it will be deleted before sarg
exits.

As a consequence, if temporary files are kept, the temporary directory may
hold more files than were actually used.

10 years agoDon't segfault if date_time_by is empty
Frederic Marchal [Mon, 3 Jun 2013 10:35:45 +0000 (12:35 +0200)] 
Don't segfault if date_time_by is empty

Thanks to nuphero for reporting this bug and helping in tracking it down.

10 years agoRemove bashisms from configure.in
Frederic Marchal [Sat, 1 Jun 2013 17:36:58 +0000 (19:36 +0200)] 
Remove bashisms from configure.in

Tests using == as equality operator are not portable. They are replaced by
a single =.

Thanks to Renato Botelho for reporting this bug.

10 years agoFix the reporting of downloaded files
Frederic Marchal [Thu, 30 May 2013 19:36:10 +0000 (21:36 +0200)] 
Fix the reporting of downloaded files

The reporting of downloaded files was in fact reporting the denied accesses
since a previous changes in version 2.4.

10 years agoFix some compiler warnings
Frederic Marchal [Thu, 30 May 2013 09:30:07 +0000 (11:30 +0200)] 
Fix some compiler warnings

Unused variables.

10 years agoMerge branch 'master' of ssh://git.code.sf.net/p/sarg/code
Frederic Marchal [Thu, 30 May 2013 08:47:52 +0000 (10:47 +0200)] 
Merge branch 'master' of ssh://git.code.sf.net/p/sarg/code

Conflicts:
html.c

10 years agoAvoid rereading the user_limit file each time a user is added
Frederic Marchal [Thu, 30 May 2013 08:41:01 +0000 (10:41 +0200)] 
Avoid rereading the user_limit file each time a user is added

Each time a user reach the download limit, he/she is added to the
user_limit file only once. Instead of rereading the whole file to see if
the user is already there, a flag is kept in memory to track already
limited users.

10 years agoCompare correctly a per user limit greater than 2GB
Frederic Marchal [Wed, 29 May 2013 19:54:21 +0000 (21:54 +0200)] 
Compare correctly a per user limit greater than 2GB

A user limit greater than 2GB would sometime list the user into the
limit file even though the user does not exceed the limit.

Thanks to RodinM for reporting this bug.

10 years agoIconv converts the terminating NUL in the LDAP string
Frederic Marchal [Wed, 29 May 2013 19:20:45 +0000 (21:20 +0200)] 
Iconv converts the terminating NUL in the LDAP string

The LDAP string was not completely converted and was lacking the
terminating zero.

10 years agoApply patch 36 submitted by Dayel Zabin
Frederic Marchal [Sun, 26 May 2013 18:36:57 +0000 (20:36 +0200)] 
Apply patch 36 submitted by Dayel Zabin

The patch converts the string returned by a LDAP search into a user
selected character set.

The patch has been slightly modified to avoid memory leaks and report
errors the sarg's way.

10 years agoBuild alias.c with cmake
Frederic Marchal [Sun, 26 May 2013 18:24:29 +0000 (20:24 +0200)] 
Build alias.c with cmake

10 years agoUpdate the build date
Frederic Marchal [Mon, 13 May 2013 08:35:04 +0000 (10:35 +0200)] 
Update the build date

10 years agoDon't force the use of libpcre
Frederic Marchal [Mon, 13 May 2013 08:32:47 +0000 (10:32 +0200)] 
Don't force the use of libpcre

Libpcre was always included in alias.c to do some testing but it breaks
the compilation when libpcre isn't available. It has been removed.

10 years agoSuppress warning when compiling with mingw
Frederic Marchal [Mon, 13 May 2013 08:31:13 +0000 (10:31 +0200)] 
Suppress warning when compiling with mingw

Mingw doesn't accept the __attribute__ option. It is removed when
compiling with that compiler.