bogofilter -u broken: locking issue

Gyepi SAM gyepi at praxis-sw.com
Thu Oct 10 21:17:33 CEST 2002


On Thu, Oct 10, 2002 at 01:18:19PM -0400, David Relson wrote:
> Perhaps the thing to do is be a bit smarter when calling setup_lists().  We 
> know that that '-u' will need write access as do '-s', '-n', etc.  As a 
> guess the following patch will work:
> 
> RCS file: /cvsroot/bogofilter/bogofilter/main.c,v
> retrieving revision 1.30
> diff -u -r1.30 main.c
> --- main.c	10 Oct 2002 15:14:06 -0000	1.30
> +++ main.c	10 Oct 2002 17:15:32 -0000
> @@ -109,7 +109,7 @@
>      if ( directory == NULL )
>  	directory = get_bogodir(dirnames);
> 
> -    setup_lists(directory, DB_WRITE);
> +    setup_lists(directory, (update || register_type != REG_NONE) ? 
> DB_WRITE : DB_READ);
>      xfree(directory);
> 
>      if (register_type == REG_NONE)

Absolutely, it would work.
We could also add a REG_UPDATE type and set the register_type accordingly,
of course the code later would have to change to 

	if register_type == REG_NONE || register_type == REG_UPDATE){...}

so it doesn't really matter one way or the other.

I am generally not happy with how early we open the databases and would like to
delay as mentioned before.

-Gyepi



More information about the bogofilter-dev mailing list