]> git.ipfire.org Git - thirdparty/sarg.git/commitdiff
Correctly append a suffix to the mangled temporary file name
authorFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 28 Jul 2011 15:21:20 +0000 (15:21 +0000)
committerFrédéric Marchal <fmarchal@users.sourceforge.net>
Thu, 28 Jul 2011 15:21:20 +0000 (15:21 +0000)
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.

userinfo.c

index b76ba1fdb119eca815e52010045e3b60bb41d609..90c14330b988602a04f6df9150496fe13442769e 100644 (file)
@@ -109,7 +109,7 @@ struct userinfostruct *userinfo_create(const char *userid)
                        }
                }
                user->filename[j]='\0';
-               flen=i;
+               flen=i-1;
 
                count=0;
                for (group=first_user_group ; group ; group=group->next) {