Bug#293207: bogofilter: last two versions caused db errors
Karl Schmidt
karl at xtronics.com
Mon Feb 14 04:26:01 CET 2005
>
> The only thing I can think of is that perhaps when you upgrade your
> exim is still delivering files and things get in a confused state. If
> you were actually removing and recreating your /etc/bogofilter
> directory contents, then you would of course need to stop exim in this
> process to keep this from happening.
>
> Micah
I'm pretty sure I turned exim off by hand before I ran the script - (I will add
it to my scrip when I test the next release).
Even if I failed to turn it off shouldn't the locking prevent such a problem? If
not - that would be a bug in my mind. Not a bad idea to test - I could see it
getting corrupted but working only to fail after some use.
I'm no expert on libdb, but most data bases support concurrency - I could see a
problem when creating the data base - but shouldn't one be able to lock it to
one instance for the creation phase?
More I think about this - I don't think exim could do that as the script I run
as root creates root owned db files that the Debian-exim user couldn't talk to.
But, the other way around would be possible - Where exim creates the db and then
the script adds to the db and possibly creates some log files with the root
ownership that the Debian-exim user can't see.
Checking some ownerships...<time passes> ...
The directory has drwxrwx--- 3 root Debian-exim
all the db files are -rw-r--r-- 1 Debian-exim Debian-exim
World readable -- owner only writable --
Let me test this right now. .. <more time passes> ..
With bogofilter 0.93.1-1
Ok deleting the db results in exims call of bogofilter creation of a db with:
-rw------- 1 Debian-exim Debian-exim
running:
bogofilter -M -s -d /etc/bogofilter -I /home/karl/mail/zs-archived-spam2004
Creates some log files with -rw-r--r-- 1 root root
Note the different owner AND permissions -- ok it is using the users create
mask. -- Hmm should that really be the case? Could this scramble the db??
now with bogfilter 0.93.5-1
results in the same thing
Ok, I've changed my db recreation script to:
#!/bin/bash
wajig stop exim4
# yes my db directory should really be in var some place - but it is in /etc
rm /etc/bogofilter/* -f
bogofilter -M -s -d /etc/bogofilter -I /home/karl/mail/zs-archived-spam2004
bogofilter -M -s -d /etc/bogofilter -I /home/karl/mail/zs-archived-spam2003
bogofilter -M -s -d /etc/bogofilter -I /home/karl/mail/s-archived-spam
bogofilter -M -n -d /etc/bogofilter -I /home/karl/mail/z-archived2003
bogofilter -M -n -d /etc/bogofilter -I /home/karl/mail/z-archived2004
bogofilter -M -n -d /etc/bogofilter -I /home/karl/mail/archived
chown Debian-exim.Debian-exim /etc/bogofilter/*
chmod go-r /etc/bogofilter/*
wajig start exim4
If this is the cause of the problem, it still leaves a question of how
bogofilter should handle running as a different user than the db files?
I wonder if the problem was exim running
"bogofilter -d /etc/bogofilter -l -p -e -u"
as db creation command-- this all assumes I forgot to stop exim two different
time (don't think so)?
As of now I'm running bogfilter 0.93.5-1 again and will let you know what
happens in a few days time.
----------------------------------------------------------------
Karl Schmidt EMail Karl at xtronics.com
Transtronics, Inc. WEB http://xtronics.com
3209 West 9th Street Ph (785) 841-3089
Lawrence, KS 66049 FAX (785) 841-0434
Half of all people are below average.
----------------------------------------------------------------
More information about the Bogofilter
mailing list