Bug I think with configfile.c

Manvendra Bhangui mbhangui at yahoo.com
Thu Jan 29 12:05:04 CET 2004


Another observation

To prevent bogofilter aborting, i linked $HOME/.bogofilter
to /var/sifymail/etc. After doing this bogofilter
does not abort if "-d" argument is not specified.

truss of bogofilter shows bogofilter opening wordlist.db twice
and reading from both the file descriptors

I put back the read_config_file() function from bogofilter-0.16.2
in bogofilter-0.16.3. bogofilter opens the worldlist.db only
once and does not look for wordlist.db in $HOME/.bogofilter

Attaching truss output of bogofilter-0.16.3

truss1.txt - read_config_file() taken from bogofilter-0.16.2
                 configfile.c

truss2.txt - original bogofilter-0.16.3 (no changes 
                 to configfile.c

NOTE: My configure options were
./configure --prefix=/var/sifymail --sysconfdir=/var/sifymail/etc
My $HOME is /usr1/root

Regards Manvendra
On Thu, 2004-01-29 at 15:56, Manvendra Bhangui wrote:
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: truss.zip
Type: application/zip
Size: 5789 bytes
Desc: not available
URL: <http://www.bogofilter.org/pipermail/bogofilter/attachments/20040129/0910b516/attachment.zip>


More information about the Bogofilter mailing list