Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 236838 - Klamav doesn't build against new clamav-0.94
Summary: Klamav doesn't build against new clamav-0.94
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo KDE team
Depends on:
Blocks: CVE-2008-1389
  Show dependency tree
Reported: 2008-09-06 06:45 UTC by Billy DeVincentis
Modified: 2008-09-06 15:27 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---

updated klamav-0.44 ebuild (klamav-0.44.ebuild,1.20 KB, text/plain)
2008-09-06 07:29 UTC, Andreas "th0br0" Osowski
patch for klamav 0.44 clamav 0.94 compability (klamav-0.44-clamav094.patch,584 bytes, text/plain)
2008-09-06 07:29 UTC, Andreas "th0br0" Osowski
fixed clamav 0.94 patch (klamav-0.44-clamav094.patch,623 bytes, text/plain)
2008-09-06 11:56 UTC, Andreas "th0br0" Osowski
klamav-0.44.ebuild diff (klamav-0.44.ebuild.diff,439 bytes, text/plain)
2008-09-06 11:58 UTC, Andreas "th0br0" Osowski
Mandriva klamav 0.44 patch (klamav-0.44-clamav-0.94_build_fix.diff,513 bytes, text/plain)
2008-09-06 15:18 UTC, Andreas "th0br0" Osowski

Note You need to log in before you can comment on or make changes to this bug.
Description Billy DeVincentis 2008-09-06 06:45:33 UTC
After update of clamav, system called for rebuild of klamav which fails.

THREADSAFE=1 -DHAVE_USLEEP=1 -DNDEBUG -O2  -march=native -O2 -pipe -c -o libsqlite_la-where.lo `test -f 'where.c' || echo './'`where.c
/bin/sh ../../libtool --silent --tag=CC --mode=link x86_64-pc-linux-gnu-gcc  -DNDEBUG -O2  -march=native -O2 -pipe  -Wl,-O1 -o  -lpthread libsqlite_la-alter.lo libsqlite_la-attach.lo libsqlite_la-auth.lo libsqlite_la-btree.lo libsqlite_la-build.lo libsqlite_la-callback.lo libsqlite_la-date.lo libsqlite_la-delete.lo libsqlite_la-expr.lo libsqlite_la-func.lo libsqlite_la-hash.lo libsqlite_la-insert.lo libsqlite_la-legacy.lo libsqlite_la-main.lo libsqlite_la-opcodes.lo libsqlite_la-os_unix.lo libsqlite_la-os_win.lo libsqlite_la-pager.lo libsqlite_la-parse.lo libsqlite_la-pragma.lo libsqlite_la-prepare.lo libsqlite_la-printf.lo libsqlite_la-random.lo libsqlite_la-select.lo libsqlite_la-table.lo libsqlite_la-tokenize.lo libsqlite_la-trigger.lo libsqlite_la-update.lo libsqlite_la-utf.lo libsqlite_la-util.lo libsqlite_la-vacuum.lo libsqlite_la-vdbe.lo libsqlite_la-vdbeapi.lo libsqlite_la-vdbeaux.lo libsqlite_la-vdbemem.lo libsqlite_la-where.lo
make[3]: Leaving directory `/var/tmp/portage/app-antivirus/klamav-0.44/work/klamav-0.44-source/klamav-0.44/src/sqlite'
Making all in klammail
make[3]: Entering directory `/var/tmp/portage/app-antivirus/klamav-0.44/work/klamav-0.44-source/klamav-0.44/src/klammail'
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/kde/3.5/include -I/usr/qt/3/include -I.  -I/usr/kde/3.5/include  -DQT_THREAD_SUPPORT  -D_REENTRANT  -DNDEBUG -O2  -march=native -O2 -pipe -c clamdmail.c
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/kde/3.5/include -I/usr/qt/3/include -I.  -I/usr/kde/3.5/include  -DQT_THREAD_SUPPORT  -D_REENTRANT  -DNDEBUG -O2  -march=native -O2 -pipe -c options.c
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I/usr/kde/3.5/include -I/usr/qt/3/include -I.  -I/usr/kde/3.5/include  -DQT_THREAD_SUPPORT  -D_REENTRANT  -DNDEBUG -O2  -march=native -O2 -pipe -c treewalk.c
clamdmail.c: In function ‘clamdscan’:
clamdmail.c:163: error: ‘CL_EFSYNC’ undeclared (first use in this function)
clamdmail.c:163: error: (Each undeclared identifier is reported only once
clamdmail.c:163: error: for each function it appears in.)
make[3]: *** [clamdmail.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/var/tmp/portage/app-antivirus/klamav-0.44/work/klamav-0.44-source/klamav-0.44/src/klammail'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/var/tmp/portage/app-antivirus/klamav-0.44/work/klamav-0.44-source/klamav-0.44/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/app-antivirus/klamav-0.44/work/klamav-0.44-source/klamav-0.44'
make: *** [all] Error 2
 * ERROR: app-antivirus/klamav-0.44 failed.
 * Call stack:
 *     , line   49:  Called src_compile
 *             environment, line 4131:  Called kde_src_compile
 *             environment, line 2970:  Called kde_src_compile 'all'
 *             environment, line 3090:  Called kde_src_compile 'myconf' 'configure' 'make'
 *             environment, line 3086:  Called die
 * The specific snippet of code:
 *                   emake || die "died running emake, $FUNCNAME:make"
 *  The die message:
 *   died running emake, kde_src_compile:make
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/app-antivirus/klamav-0.44/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/app-antivirus/klamav-0.44/temp/environment'.

 * GNU info directory index is up-to-date.

!!! existing preserved libs:
>>> package: app-antivirus/clamav-0.94
 *  - /usr/lib64/
 *  - /usr/lib64/
 *  - /usr/lib64/
 *  - /usr/lib64/
 *  - /usr/lib64/
 *  - /usr/lib64/
Use emerge @preserved-rebuild to rebuild packages using these libraries

Reproducible: Always

emerge --info
Portage 2.2_rc8 (default/linux/amd64/2008.0/desktop, gcc-4.3.1, glibc-2.8_p20080602-r0, 2.6.25-gentoo-r8 x86_64)
System uname: Linux-2.6.25-gentoo-r8-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4200+-with-glibc2.2.5
Timestamp of tree: Sat, 06 Sep 2008 05:34:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.1.6-r1
dev-lang/python:     2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 2.0.0
sys-apps/openrc:     0.2.5
sys-devel/autoconf:  2.13, 2.62-r1
sys-devel/automake:  1.5, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.18-r3
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   2.2.4
virtual/os-headers:  2.6.25-r4
ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-march=native -O2 -pipe"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/4.0/env /usr/kde/4.0/share/config /usr/kde/4.0/shutdown /usr/share/config /var/bind /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=native -O2 -pipe"
FEATURES="buildpkg distlocks fixpackages metadata-transfer parallel-fetch preserve-libs sandbox sfperms strict unmerge-orphans userfetch"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTDIR_OVERLAY="/usr/portage/local/miscellaneous /usr/portage/local/layman/desktop-effects /usr/portage/local/layman/vmware"
USE="3dnow S3TC X a52 aac aalib accessibility acl acpi alsa amarok amd64 apm arts artworkextra audiofile automount avahi bash-completion berkdb bidi bittorrent bluetooth branding bzip2 cairo calendar cdda cdio cdparanoia cdr clamav cli cpudetection cracklib crypt css cups curl dbus deprecated devil dga directfb discouraged distribution divx doc dri dts dv dvb dvd dvdr dvdread eds elisp emacs emboss emerald encode esd etc-proposals evo examples exif extraicons fam fat fax fbcon fbcondecor fbsplash ffmpeg firefox flac flash foomaticdb fortran fuse gcj gd gdbm gedit gif gimp glep glitz gmedia gnome gnutls gphoto2 gpm gstreamer gtk gtkhtml hal hddtemp hfs html htmlhandbook httpd iconv idn ieee1394 imagemagick imlib inkjar ipv6 isdnlog jack java jfs joystick jpeg jpeg2k kde kdehiddenvisibility kerberos lcms ldap libcaca libnotify lirc live lm_sensors logrotate mad mail matroska mdnsresponder-compat midi mikmod mime mjpeg mmx mmxext mng mono mozilla mp3 mpeg mplayer mudflap multilib musicbrainz mysql nas nautilus ncurses networking new-login nforce2 nls nptl nptlonly nsplugin ntfs nvidia odbc offensive ogg openexr opengl openmp pam parport pcre pdf perl pmu png postgres ppds pppd pulseaudio python qt3 qt3support qt4 quicktime rar rdesktop readline realmedia reflection regex reiser4 reiserfs samba scanner sdl seamonkey semantic-desktop servletapi session skins slang slp smp sndfile snmp sound sounds speex spell spl sqlite sse sse2 ssl startup-notification stream subversion svg swat symlink sysfs syslog tcpd tetex theora thesaurus threads thunderbird tidy tiff timidity tk truetype type1 unicode usb userlocales utempter utils v4l vcd vdr vlm voice vorbis vram weather wmf wmp wordperfect wxwindows xattr xcb xcomposite xforms xfs xine xml xorg xpm xprint xscreensaver xv xvid zeroconf zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="fbdev glint i810 mach64 mga neomagic nv r128 radeon savage sis tdfx trident vesa vga via vmware voodoo"
Comment 1 Andreas "th0br0" Osowski 2008-09-06 07:29:06 UTC
Created attachment 164687 [details]
updated klamav-0.44 ebuild
Comment 2 Andreas "th0br0" Osowski 2008-09-06 07:29:58 UTC
Created attachment 164689 [details]
patch for klamav 0.44 clamav 0.94 compability

EBuild & Patch tested on x86
Comment 3 Steffen 'j0inty' Stollfuß 2008-09-06 10:07:06 UTC

I would don't use this patch.

!!!! You remove a return statement and the function will not stop here anymore !!!!

Try to find the needed include statement, but don't remove a return.

Comment 4 Andreas "th0br0" Osowski 2008-09-06 11:56:25 UTC
Created attachment 164709 [details]
fixed clamav 0.94 patch

tested on x86
Comment 5 Andreas "th0br0" Osowski 2008-09-06 11:58:26 UTC
Created attachment 164711 [details]
klamav-0.44.ebuild diff
Comment 6 Tobias Heinlein (RETIRED) gentoo-dev 2008-09-06 14:16:43 UTC
(In reply to comment #4)
> fixed clamav 0.94 patch

Andreas, where did you get that patch from? Or did you make it yourself? We are currently wondering if simply replacing the return value is the right way to go.
Comment 7 Andreas "th0br0" Osowski 2008-09-06 15:18:25 UTC
Created attachment 164733 [details]
Mandriva klamav 0.44 patch

While first googling for a possible patch for this, I found this mandriva patch (from klamav-0.44-2mdv2009.0.src.rpm). As you can see in the patch, they are totally removing the check function if the fd is valid.
As such behaviour can lead to problems - as far as I know fd - I decided just to replace the return value.
Comment 8 Tobias Heinlein (RETIRED) gentoo-dev 2008-09-06 15:27:21 UTC
(In reply to comment #7)
> Created an attachment (id=164733) [edit]
> Mandriva klamav 0.44 patch
> While first googling for a possible patch for this, I found this mandriva patch
> (from klamav-0.44-2mdv2009.0.src.rpm). As you can see in the patch, they are
> totally removing the check function if the fd is valid.
> As such behaviour can lead to problems - as far as I know fd - I decided just
> to replace the return value.

OK, thanks for the info. Meanwhile, we investigated this issue. fsync() calls were completely removed in clamav, that's why the CL_EFSYNC return value was no longer needed. The mandriva patch looks similar to the changes clamav applied to their code[1].
However, jmbsvicetto figured out, that the return value actually isn't used after the function returns, so replacing it shouldn't be a problem.
For future reference: Furthermore, we contacted klamav upstream which is preparing a new release, but it agreed that replacing the return value for now is a possible solution.

Thanks for the patch! Just committed to CVS.