Bug I think with configfile.c

Manvendra Bhangui mbhangui at yahoo.com
Thu Jan 29 11:26:23 CET 2004


David,

On Fri, 2004-01-23 at 18:12, David Relson wrote:

To have wordlist.db in /var/sifymail/etc, you can include
"bogofilter_dir=/var/sifymail/etc" in your bogofilter.cf file or you can
run bogofilter with argument "-d /var/sifymail/etc"

That is what I was doing till bogofilter-0.16.2. With bogofilter-0.16.3
one has to explicitly give the "-d" argument.

The bug is wierd and  dissapears when the code in the function
process_config_option() is carried out directly in the 
function read_config_file().

Running gdb also shows some variable corruption in datastore.c

truss -o /tmp/truss.txt bogofilter -vvv < /etc/hosts
also shows bogofilter trying to open wordlist.db twice.

The first time the correct wordlist.db is opened,
the second time bogofilter tries to open wordlist.db in $HOME/.bogofilter
(I have attached truss output)

Let me explain

1. In bogofilter-0.16.2 the function read_config_file() had few
    lines of code which has been moved to process_config_options()
    in bogofilter-0.16.3.
    Some wierd behaviour has happened because of moving these lines of
    code

    if (strcspn(arg, delim) < strlen(arg)) {
    ...
    ...

2. If the read_config_file() function is copied from
    bogofilter-0.16.2 to bogfilter-0.16.3 the bug dissapears.

Output of gdb

(gdb) s
ds_open (db_file=0x8ee <Address 0x8ee out of bounds>, count=2286, names=0x8ee,
    open_mode=DB_READ) at datastore.c:149
    149         void *v = db_open(db_file, count, names, open_mode);
(gdb) n
Can't open file 'wordlist.db' in directory '/usr1/root/.bogofilter'.
error #2 - No such file or directory.
	 
Remember to register some spam and ham messages before you
use bogofilter to evaluate mail for its probable spam status!
	  
Program exited with code 03.





On Fri, 2004-01-23 at 18:12, David Relson wrote:
> On Fri, 23 Jan 2004 14:16:45 +0530
> Manvendra Bhangui wrote:
> 
> > 
> > After migrating to bogofilter-0.16.3 from bogofilter-0.16.2,
> > bogofilter looks for wordlist.db in $HOME/.bogofilter if
> > -d option is not specified. 
> > 
> > my configure options were
> > ./configure --prefix=/var/sifymail
> 
> Welcome Manvendra,
> 
> The "--prefix" option tells where to install the executables,
> documentation, etc.  It is not used in finding either the config file or
> the wordlist.
> 
> To have bogofilter in /var/sifymail/etc, you can configure with
> "--sysconfdir=/var/sifymail/etc" or you can run bogofilter with argument
> "-c /var/sifymail/etc/bogofilter.cf"
> 
> > My wordlist.db and bogofilter.cf lie in /var/sifymail/etc
> 
> To have wordlist.db in /var/sifymail/etc, you can include
> "bogofilter_dir=/var/sifymail/etc" in your bogofilter.cf file or you can
> run bogofilter with argument "-d /var/sifymail/etc"
> 
> 
> > If i run bogofilter -vvv < /etc/hosts i get the following output
> >
> > Can't open file 'wordlist.db' in directory '/usr1/root/.bogofilter'.
> > error #2 - No such file or directory.
> > 
> > Remember to register some spam and ham messages before you
> > use bogofilter to evaluate mail for its probable spam status!
> 
> Correct!
> 
> > The above runs without problem if i use
> > bogofilter -d /var/sifymail/etc -vvv < /etc/hosts
> 
> Correct!
> 
> > -- 
> > Manvendra Bhangui <mbhangui at yahoo.com>
> 
> ---------------------------------------------------------------------
> FAQ: http://bogofilter.sourceforge.net/bogofilter-faq.html
> To unsubscribe, e-mail: bogofilter-unsubscribe at aotto.com
> For summary digest subscription: bogofilter-digest-subscribe at aotto.com
> For more commands, e-mail: bogofilter-help at aotto.com
-- 
Manvendra Bhangui <mbhangui at yahoo.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truss.zip
Type: application/zip
Size: 2012 bytes
Desc: not available
URL: <http://www.bogofilter.org/pipermail/bogofilter/attachments/20040129/e57edf4b/attachment.zip>


More information about the Bogofilter mailing list