David Relson | 1 Nov 2005 01:59
Favicon

bogofilter-0.96.4 a.k.a. 1.0.0rc4

Greetings,

Several small changes.  Now ignores all image attachments, not just
image/bmp attachments.  Cleanup of contrib directory plus a list of its
files.

If no functional issues are found, this release candidate will become
version 1.0.0 around the middle of November.  Test now (or hold your
complaints :-)

David

########################################################################

Files are available at http://sourceforge.net/projects/bogofilter for
download.

Here are the md5sums for the release:

e91f838a98e6db74fa86329af946775d  bogofilter-0.96.4-1.i586.rpm
18aea1325abe556e56c680f644a2a9ac  bogofilter-0.96.4-1.src.rpm
69b7d43a5a2523427d68b00d603a54e1  bogofilter-0.96.4.tar.bz2
df4259e3c3644b4895e676212d901ef2  bogofilter-0.96.4.tar.gz
5554a536318f0862ac8225f726fba2b9  bogofilter-static-0.96.4-1.i586.rpm

########################################################################

			       =================
				BOGOFILTER NEWS
			       =================
(Continue reading)

Matthias Andree | 2 Nov 2005 02:38
Picon
Picon

Re: [cvs] bogofilter/contrib randomtrain.sh, 1.2, 1.3 scramble.sh, 1.2, 1.3

David Relson <relson <at> users.sourceforge.net> writes:

> Update of /cvsroot/bogofilter/bogofilter/contrib
> In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13891/contrib
>
> Modified Files:
> 	randomtrain.sh scramble.sh 
> Log Message:
> Restore shebang line.

Why? The scripts had been modified to work on POSIX sh, not just bash,
so /bin/sh should be ok for most systems now after the change (just not
Solaris, but there you can still install the XPG4 compatibility package
- whatever it's name, I forgot - and use /usr/xpg4/bin/sh.

--

-- 
Matthias Andree
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev <at> bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev

Clint Adams | 4 Nov 2005 21:39
Picon
Favicon

Re: Bug#317524: infinite loop when using charset_default=iso-8859-1

> I can reproduce the problem. bogofilter 0.94.13-1 did not have this
> bug.
> 
> Like for the original submitter, it does not seem to depend on the db
> - fails with both existing, and newly created one (removed
> ~/.bogofilter) - and it also does not seem to depend on the message
> either:
> 
> --8<---
> $ echo foo | bogofilter -c /etc/bogofilter.cf~ -vvxdi
> probing "/home/elho/.bogofilter" and "wordlist.db" for
> environment...T_ENABLED
> open_lockfile: open(/home/elho/.bogofilter/lockfile-p) succeeded, fd
> #3
> db_env_create: 0x807318c
> DB_ENV->set_cachesize(4)
> DB_ENV->set_lg_max(1048576)
> DB_ENV->open(home=/home/elho/.bogofilter)
> db_version: Header version 4.3, library version 4.3
> [pid 8598] DB->open(db=0x8073f48, file=wordlist.db, database=NIL,
> type=1, flags=0x1000010=DB_RDONLY DB_AUTO_COMMIT , mode=0664) -> 0
> Successful return: 0
> DB->get_byteswapped: false
> DB->fd: 5
> DB->stat success, pagesize: 4096
> converting iso-8859-1           # (alternate) to UTF-8
> Conversion from 'iso-8859-1             # (alternate)' to 'UTF-8' is
> not supported.
> --8<---
> 
(Continue reading)

Elmar Hoffmann | 4 Nov 2005 22:32
Favicon

Bug#317524: infinite loop when using charset_default=iso-8859-1

Hi Clint,

on Fri, Nov 04, 2005 at 15:39:04 -0500, you wrote:

> > Conversion from 'iso-8859-1             # (alternate)' to 'UTF-8' is
> > not supported.
> 
> Does it work fine if you remove the trailing spaces and comment from the
> config line?

Ah, yes it does. I somehow didn't look properly at the output I
pasted. ;-X

elmar

--

-- 

 .'"`.                                                            /"\
| :' :   Elmar Hoffmann <elho <at> elho.net>    ASCII Ribbon Campaign  \ /
`. `'    GPG key available via pgp.net        against HTML email   X
  `-                                                    & vCards  / \
Clint Adams | 4 Nov 2005 22:34
Picon
Favicon

Re: Bug#317524: infinite loop when using charset_default=iso-8859-1

> Ah, yes it does. I somehow didn't look properly at the output I
> pasted. ;-X

Obviously we have a config-parsing problem.
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev <at> bogofilter.org
http://www.bogofilter.org/mailman/listinfo/bogofilter-dev

David Relson | 5 Nov 2005 01:22
Favicon

Re: Bug#317524: infinite loop when using charset_default=iso-8859-1

On Fri, 4 Nov 2005 16:34:29 -0500
Clint Adams wrote:

> > Ah, yes it does. I somehow didn't look properly at the output I
> > pasted. ;-X
> 
> Obviously we have a config-parsing problem.

Emar,

Thank you for reporting this problem!

Clint,

The config parsing problem is the first half of the story.  Once
bogofilter has the bad charset name it tries to open the charset.
Naturally that fails.  However the failure returns -1 rather than a
NULL and that causes the loop.  The -1 vs NULL problem was caused by a
"fix" last June.

The attached patch fixes both problems.

Regards,

David
_______________________________________________
Bogofilter-dev mailing list
Bogofilter-dev <at> bogofilter.org
(Continue reading)

David Relson | 5 Nov 2005 01:26
Favicon

[PATCH] Bug#317524: infinite loop when using charset_default=iso-8859-1

Renamed the attachment so that mailman won't delete it.
diff -u -r1.232 bogoconfig.c
--- bogoconfig.c	15 Oct 2005 20:52:51 -0000	1.232
+++ bogoconfig.c	5 Nov 2005 00:14:39 -0000
 <at>  <at>  -169,6 +169,23  <at>  <at> 
 static char *get_string(const char *name, const char *arg)
 {
     char *s = xstrdup(arg);
+
+    /* scan option to delete comment (after '#') and preceding whitespace */
+    char *t = s;
+    bool quote = false;
+    for (t = s; *t != '\0' ; t += 1)
+    {
+	char c = *t;
+	if (c == '"')
+	    quote ^= true;
+	if (!quote && c == '#') {
+	    *t-- = '\0';
+	    while (isspace(*t))
+		*t-- = '\0';
+	    break;
+	}
+    }
+
     if (DEBUG_CONFIG(2))
 	fprintf(dbgout, "%s -> '%s'\n", name, s);
     return s;
diff -u -r1.90 bogolexer.c
(Continue reading)

Elmar Hoffmann | 5 Nov 2005 03:14
Favicon

Bug#317524: infinite loop when using charset_default=iso-8859-1

Hi David,

on Fri, Nov 04, 2005 at 19:22:38 -0500, you wrote:

> The attached patch fixes both problems.

But unfortunately introduces new ones:

>  static char *get_string(const char *name, const char *arg)
>  {
>      char *s = xstrdup(arg);
> +
> +    /* scan option to delete comment (after '#') and preceding
> whitespace */
> +    char *t = s;

t initially points to s, a copy of arg...

> +    bool quote = false;
> +    for (t = s; *t != '\0' ; t += 1)
> +    {
> +       char c = *t;
> +       if (c == '"')
> +           quote ^= true;
> +       if (!quote && c == '#') {
> +           *t-- = '\0';

...if arg starts with a '#' (ie. something like "option=# foo" in the
config), t will now point one byte before the beginning of s...

(Continue reading)

David Relson | 5 Nov 2005 05:23
Favicon

Re: Bug#317524: infinite loop when using charset_default=iso-8859-1

On Sat, 5 Nov 2005 03:14:38 +0100
Elmar Hoffmann wrote:

> Hi David,
> 
> on Fri, Nov 04, 2005 at 19:22:38 -0500, you wrote:
> 
> > The attached patch fixes both problems.
> 
> But unfortunately introduces new ones:
> 
> >  static char *get_string(const char *name, const char *arg)
> >  {
> >      char *s = xstrdup(arg);
> > +
> > +    /* scan option to delete comment (after '#') and preceding
> > whitespace */
> > +    char *t = s;
> 
> t initially points to s, a copy of arg...
> 
> > +    bool quote = false;
> > +    for (t = s; *t != '\0' ; t += 1)
> > +    {
> > +       char c = *t;
> > +       if (c == '"')
> > +           quote ^= true;
> > +       if (!quote && c == '#') {
> > +           *t-- = '\0';
> 
(Continue reading)

Elmar Hoffmann | 5 Nov 2005 14:15
Favicon

Bug#317524: infinite loop when using charset_default=iso-8859-1

Hi David,

on Fri, Nov 04, 2005 at 23:23:11 -0500, you wrote:

Thanks! :)

> Your observations about the code are very good, though not totally
> correct.  If you look at function process_config_option(), you'll see
> that the original config line is duplicated and split at the '='
> character (which has been replaced by '\0').  The "*t--" code is
> applied to the part after '=' and the loop to erase whitespace will
> never backup to the part before the '='.

I'm sorry, but apart from the fact that relying upon such
circumstances does not lead to robust code, I still beg to differ
regarding these circumstances. :)
process_config_option() indeed duplicates the original line, splits it
as you described and passes a pointer to the second part ("val") down
through process_config_option_as_arg() and process_arg() to
get_string() as the second parameter "arg".
get_string() as per your patch however then duplicates arg to s, which
thus is a new block of memory starting with the beginning of arg and,
unlike the one arg points into, the former '=' is not before it.
t gets to point to s and then is eventually decreased by one and
accessed by isspace(*t) during the first iteration as I described
previously.

elmar

--

-- 
(Continue reading)


Gmane