On Wed, Aug 28, 2002 at 08:21:55AM -0500, Rick Matthews wrote:
> > -----Original Message-----
> > From: Gilles CHAUVIN
> > Sent: Wednesday, August 28, 2002 3:03 AM
> > 
> > Ok, so... I'll try to explain this (with my wonderful english ;).
> 
> I didn't know that english isn't your primary language until I read
> that comment. Your english is excellent!
> 
Not as excellent as I wish it should be (I'm pretty sure this sentence
doesn't mean anything ;)... But thanks!

> > Looking at the ML archives gives at least two other posts that talk
> > about this problem (that's the two posts I can remember talking about
> > this, maybe there are others):
> > http://marc.theaimsgroup.com/?l=squidguard&m=102008640828326&w=2
> > http://marc.theaimsgroup.com/?l=squidguard&m=102636248825888&w=2
> 
> Let's take a quick look at those two (listed above):
> 
> 2002-04-29 Poster #1 mentions that he is running:
> squidGuard 1.2.0
> Berkeley DB 2.7.7
> [Here's a clip from Poster #1's web site: "In spite of what the
> documentation says, Squidguard 1.20 requires version 3.29 of the
> Berkely db."]
> 
> 2002-07-11 Poster #2 does not mention the program versions he is
> running, but he did post the following day that replacing the
> 'porn' destination group with an 'adult' group solved the problem.
> 
> > Doing a "strace" when you launch squidGuard for a database update gives
> > something like:
> 
> I really appreciate your taking the time to document all of this! I'll
> try to summarize my comments with ==> bullet points along the way.
> 
Good idea. Here we go...

> > open("/var/squidGuard/hacking/domains.diffq`", O_RDONLY) = -1 ENOENT
> > (No such file or directory)
> 
> It does appear that squidGuard has tried to open <domains.diffq`>. 
> ==> We never tell SG which directories contain .diff files and which
> ones do not contain .diff files.
> ==> SG never complains about the directories that do not contain
> .diff files.
> ==> At some point prior to this error, SG looked for
> /hacking/domains.diff and saw that it existed, and then began the
> update process (which produced the error).
> 
We both understand this the same way... ;)

> > Now, assuming I don't know anything about C programming 
> 
> I've read more C code in the past 24 hours than the rest of my life
> all added together. (I don't know C either.)
> 
> > It says "including the '\0' character". So, in the above line you have
> > to change "5" by "6" to let room for the ending '\0 (NUL)' character.
> 
> ==> If the problem was indeed that len(".diff\0")=6 (and not 5), *all*
> of the .diff updates would have failed, not just one or two, right?
> 
> Based on my comments above, I don't think what you changed
> eliminated the problem; I think you may have masked the problem.
> 
You're probably right about this point. It would be really great to have
someone (who knows C programming) inspect that part of the code and tell
us what he think about it. My reasoning (maybe totally wrong) was the
following:

Suppose the file name is "domains". Then, the function strlen(file),
should return "7". Now you add space for the 5 chars extension,
strlen(file)+5. So, somewhere in the computer memory are allocated 7+5
bytes for storing "domains.diff" inside. Reading the "strcpy" man page
tells it also copy the ending "NUL" character. I then thought it should
be 7+6 and not 7+5 (because the ending \0 should be present in the the
string too).

> ==> The vast majority of users are not having the problem, so there
> must be some thing(s) unique about the installations that are having
> the problem. One difference between your installation and mine is 
> that I am running Berkeley DB 3.29, and you are running 3.3.1.1.
> 
> ==> You are running Berkeley DB 3.3.1.1. Have you applied the 2
> patches listed here: <http://www.sleepycat.com/update/index.html>?
> 
I'm running what is provided with my distro (RedHat 7.3) and, you're
right, I never upgraded nor applied any patchs, but... If I look at the
RPM package's changelog provided in the distro, I can see this:

$ rpm -q --changelog db3
[...snip...]
* Mon Mar 25 2002 Nalin Dahyabhai <[EMAIL PROTECTED]> 3.3.11-1
- update to 3.3.11 + recommended patches
[...snip...]
* Mon Aug 06 2001 Nalin Dahyabhai <[EMAIL PROTECTED]>
- apply the two patches listed at 
http://www.sleepycat.com/update/3.2.9/patch.3.2.9.html
[...snip...]

I then guess the appropriate patches were already applied by the RedHat
guys.

> ==> Continuing with the fact that you are running Berkeley DB 3.3.1.1.
> This user page <http://www.maynidea.com/squidguard/faq-plus.html> says
> "In spite of what the documentation says, Squidguard 1.20 requires
> version 3.29 of the Berkely db." and "With 3.3.x, it craps out every
> time." 
>
Maybe you're right. But I still continue to think that's not a bug
related to the database (because, it can't open the file xxx.diff). I
think opening a file and doing things in the database are two different
operations. In that case, it stops because it cannot find the file (the
database shouldn't be open at this moment).
 
> ==> If you upgraded to DB 3.x, did you delete all of the .db files
> and recreate them?
> 
I never upgraded. Just installed RH7.3 and a fresh install of squidGuard
(with self made RPMs for squidGuard). Building the databases with "-C
all" works fine. That's just the update process that causes problems.

> I don't know what the answer is, but I'm willing to help zero-in on 
> the specific environment that creates the problem. Let me know what
> you think.
> 
> Rick Matthews

As both of us doesn't know C code, I hope someone could inspect that
small part of squidGuard's source code and see what I've done good/wrong
when modifying this.

I really cannot explain more about this (and why it works when I change
theses values). But, what I know is that it is working now (it wasn't
before I modify the code).

Hope someone will enlighten both of us about this very weird bug.

Regards,
Gilles.
-- 
/ Gilles CHAUVIN / CRDP de Haute-Normandie /
/ E-mail: [EMAIL PROTECTED] / GnuPG: 0x2E89DBB7 /

Attachment: msg01190/pgp00000.pgp
Description: PGP signature

Reply via email to