bug using passthrough option on opensuse - solved
Manvendra Bhangui
mbhangui at gmail.com
Tue May 21 16:22:44 CEST 2024
On Tue, 21 May 2024 at 11:54, Matthias Andree <matthias.andree at gmx.de> wrote:
>
> Two things:
> 1 We still need to understand where the bug is, we must not abort the passthrough output early even if the charset contains garbage because we have only fixed the "convertible charset" case yet,
> 2 it is a runtime requirement, too,not just build-time!
>
The same issue happened in a mageia8 docker container. There was no
package glibc-locale-base or equivalent on mageia8. So I did some
debugging and fixed the issue. Here is what is happening
the function bf_iconv_open() in src/convert_unicode.c gets called with as
bf_conv_open("UTF-8", "iso-8859-1").
This is because DEFAULT_CHARSET is defined as iso-8859-1 in configure.ac
iconv_open() fails with EINVAL and bf_conv_open again calls iconv_open as
iconv_open(to_charset, default_charset). Since default_charset is
iso-8859-1, it again fails.
configure.ac has the option --with-charset=name option, but that has a
bug. Even if you pass the option it is not getting set in
src/config.h. I made the following change to configure.ac and now
bogofilter works on leap15.5, leap15.6 and mageia8 docker containers
with the following configure options
./configure --prefix=/usr --with-charset=utf-8
This is the change I made
diff --git a/bogofilter/configure.ac b/bogofilter/configure.ac
index 84fcf8ad..fc6e5ece 100644
--- a/bogofilter/configure.ac
+++ b/bogofilter/configure.ac
@@ -300,17 +300,15 @@ fi
dnl Allow the user to specify a default charset
AC_ARG_WITH(charset,
AS_HELP_STRING([--with-charset=name],
- [use specified charset (overrides --enable-russian)
[[iso-8859-1]]]),
- AC_DEFINE_UNQUOTED(DEFAULT_CHARSET,
- ["$withval"],
- [Use specified default charset instead of iso-8859-1])
+ [use specified charset instead of iso-8859-1 (overrides
--enable-russian) [[iso-8859-1]]]),
+ [ DEFAULT_CHARSET=$withval ]
)
AC_SUBST(ENCODING)
AC_SUBST(DEFAULT_CHARSET)
AC_DEFINE_UNQUOTED(DEFAULT_CHARSET,
["$DEFAULT_CHARSET"],
- [Use specified charset])
+ [Use specified charset instead of iso-8859-1])
dnl Allow the user to enable memory usage debugging methods
More information about the bogofilter
mailing list