Commit graph

109 commits

Author SHA1 Message Date
Tomasz Kojm
208ceae5c7 clamd, clamscan: add support for OfficialDatabaseOnly/--official-db-only (bb#1743) 2009-11-10 19:30:33 +01:00
Török Edvin
6e65b70e29 Must free engine on exit, otherwise valgrind incorrectly reports leaks.
This is a cherry-pick of a similar commit on the bytecode branch.
There this was needed because the JIT stores pointers mangled (stores an integer in low
bits of the pointer), thus valgrind can't see that pointers to that memory
region still exist, and reports it as definetely lost, instead of still
reachable.
However this seems to happen on master too (where there is no JIT), valgrind
cannot see that everything allocating in engine is reachable from the engine
pointer, and reports some of the memory allocated for the engine (the regex
parts) as possible lost, and reports the rest as still reachable. This seems to
only happen with certain kernel versions, timings, etc.

The fix is to always free the engine, even if this is the parent after the fork.
2009-10-15 11:25:41 +03:00
Török Edvin
f7019d13e2 Must free engine on exit, otherwise valgrind incorrectly reports leaks.
This occurs because the JIT stores pointers mangled (stores an integer in low
bits of the pointer), thus valgrind can't see that pointers to that memory
region still exist, and reports it as definetely lost, instead of still
reachable.
The fix is to always free the engine, even if this is the parent after the fork.
2009-10-02 13:21:33 +03:00
Török Edvin
72a03f9bd5 Merge branch 'master' into bytecode
* master: (60 commits)
  Fix build when git is not installed and using BSD make.
  Only use -fno-strict-aliasing for gcc-4.3+, to avoid bugs with older compilers (bb #1581).
  libclamav/matcher-bm.c: fix cli_bm_freeoff() (bb#1710)
  bb#1708
  implove poolsize.pl
  win32: s/C_WINDOWS/_WIN32/ in clamd, shared
  libclamav/matcher-ac.c: fix matching of logical sigs (bb#1707)
  libclamav/readdb.c: fix handling of broken .ldb sigs (bb#1701)
  libclamav: new signature blacklisting format (bb#1625)
  killclamd must always succeed (except when there's a stuck clamd).
  Fix typo.
  Better error message when clamd gets killed
  merge win32 patches from sherpya
  remove bogus debug printf
  libclamav/matcher-ac.c: add support for line marker (L) (matches CR, CRLF and boundaries)
  fix EOL in platform.h
  sis.c: fix size check
  fix several problems introduced by the win32 commits
  fix in cli_is_abspath
  win32#3
  ...

Conflicts:
	.gitignore
	Makefile.am
	configure
	configure.in
	libclamav/readdb.c
2009-10-02 10:08:44 +03:00
aCaB
e0bb54d7d4 win32: s/C_WINDOWS/_WIN32/ in clamd, shared 2009-09-30 00:54:04 +02:00
aCaB
b2354dc1e7 drop os2 2009-09-24 19:10:27 +02:00
aCaB
58481352d5 win32 paths handling 2009-09-24 19:07:39 +02:00
aCaB
081f64735d win32#2 2009-09-24 16:24:07 +02:00
aCaB
be4bf7f4ab win32 2009-09-24 16:08:52 +02:00
Török Edvin
52dd3a6bda Initial support for loading .cbc files from DB. 2009-09-21 20:10:33 +03:00
Tomasz Kojm
6a4dd9dc6b clamd, clamscan, libclamav: drop support for MailFollowURLs (bb#1677) 2009-08-06 22:29:13 +02:00
Tomasz Kojm
a866b077aa clamd/clamd.c: ignore SIGHUP and SIGUSR2 during initial setup (bb#1671) 2009-08-05 18:34:21 +02:00
Tomasz Kojm
19c788af04 clamscan, clamd, libclamav: load cvd files on-the-fly (without unpacking them to /tmp) by default 2009-07-28 20:36:38 +02:00
Tomasz Kojm
a168a37822 fix type errors
git-svn: trunk@5059
2009-05-05 14:14:40 +00:00
Tomasz Kojm
2accc66fef libclamav, clamd, clamscan: replace cl_engine_(set|get) with cl_engine_set_(num|str) and cl_engine_get_(num|str)
git-svn: trunk@4933
2009-03-12 15:21:36 +00:00
Tomasz Kojm
6670464f91 update help pages
git-svn: trunk@4855
2009-02-24 16:12:56 +00:00
Török Edvin
fb6fe4f5d1 Introduce '$' in logg, it is active when logg_verbose=2, i.e. when Debug yes.
Fix leak reported by valgrind.

git-svn: trunk@4806
2009-02-17 15:59:36 +00:00
Török Edvin
af309677da sendtimeout
git-svn: trunk@4804
2009-02-17 15:59:26 +00:00
Török Edvin
456e31a3cb fix typo.
add another stress test.
Don't leak file descriptors.
Fix IDSESSION delimiter handling.

git-svn: trunk@4800
2009-02-16 21:27:22 +00:00
Tomasz Kojm
086eab5c26 update old copyright headers
git-svn: trunk@4775
2009-02-13 10:55:45 +00:00
Török Edvin
7a997ac950 move TCP socket creation to shared/
git-svn: trunk@4769
2009-02-12 21:14:51 +00:00
Török Edvin
6e3256f492 Unify error paths.
Remove unix socket we created if startup fails due to invalid config.

git-svn: trunk@4768
2009-02-12 21:14:45 +00:00
Török Edvin
949c6fe54f merge from clamd-proto branch:
handle multiple %v parameters
    introduce poll_fds that also does the read into a buffer
    introduce thrmgr_group* commands for keeping track of groups of commands
    (multiscan, IDSESSION)
    introduce 2 queues in thrmgr, multiscan queues get lower priority. Commands
    are processed from both queues in a 4:1 ratio to avoid starvation.
    unify reply code: conn_reply*
    unify scanner code into scan_callback that is called from cli_ftw
    multiscan doesn't need stat() now if readdir() provides dt_type
    redesign clamd main loop: there is now an accept thread, and a
    recv()/dispatch thread, +MaxThreads worker (scanner) threads.
    introduce limiting on commands when worker threads are contended.
    introduce IDSESSION, a replacement for the old SESSION command, that allows
    asyncronous (scan) commands and scan replies
    introduce INSTREAM that allows sending the data to scan on same connection
    (vs STREAM that requires another port)
    introduce zCOMMANDS

git-svn: trunk@4755
2009-02-12 16:51:09 +00:00
Tomasz Kojm
a68d5e2fb2 shared/optparser.c, clamdscan: use the new option parser (bb#1215)
git-svn: trunk@4581
2008-12-30 21:16:02 +00:00
Tomasz Kojm
ed331476cc drop unneded optfree()
git-svn: trunk@4572
2008-12-18 17:59:35 +00:00
Tomasz Kojm
064b4a0c99 initial version of the unified option parser (bb#1215)
git-svn: trunk@4565
2008-12-17 21:42:54 +00:00
aCaB
cd04ff0694 cfgparser hacks backported from branches/milter-v2.0
git-svn: trunk@4489
2008-11-28 16:57:15 +00:00
Tomasz Kojm
c6677c9418 LogFileUnlock was not working correctly (bb#1304)
git-svn: trunk@4471
2008-11-25 20:07:11 +00:00
Tomasz Kojm
33068e0973 libclamav: drop cl_settempdir(); use cl_engine_set() with CL_ENGINE_TMPDIR and CL_ENGINE_KEEPTMP instead
git-svn: trunk@4416
2008-11-14 22:23:39 +00:00
Tomasz Kojm
ab0d2f054d libclamav, clamd, clamscan: use cl_engine_set() to control AC settings
git-svn: trunk@4404
2008-11-13 19:06:42 +00:00
Török Edvin
dd15bc42f5 fix "leak". It was a valgrind false-positive because it couldn't see the
pointer.

git-svn: trunk@4402
2008-11-13 16:11:13 +00:00
Tomasz Kojm
b8fe70b3a3 libclamav: drop options parameter in cl_engine_new(); replace cl_engine_dup() with cl_engine_addref()
git-svn: trunk@4398
2008-11-13 15:55:35 +00:00
Tomasz Kojm
395fb661e3 fix some possible memleaks
git-svn: trunk@4391
2008-11-12 19:39:31 +00:00
Tomasz Kojm
370892d044 clamscan, clamd: use the new API; drop the hardcoded default limits and use the ones set in cl_engine_new()
git-svn-id: file:///var/lib/svn/clamav-devel/branches/newapi@4384 77e5149b-7576-45b1-b177-96237e5ba77b
2008-11-12 16:19:43 +00:00
Tomasz Kojm
04fa4e9d01 shared/options.c: handle obsolete options in cmdline parser (bb#1213)
git-svn: trunk@4236
2008-10-07 20:18:21 +00:00
Török Edvin
85398f3ed8 fix overlapping arguments in disasm/debug (bb #1150)
move copt out of main, so that valgrind is not reporting false leaks
make distcheck works now

git-svn: trunk@4193
2008-09-18 14:54:36 +00:00
Tomasz Kojm
1bf0d5a864 clamd/clamd.c: return an error (instead of a warning) if AllowSupplementaryGroups is enabled but initgroups() not available
git-svn: trunk@4120
2008-08-20 09:03:52 +00:00
Török Edvin
add738d28c portability fixes
if there is a version.h.static use that instead of output from svnversion
use get_version(), tools outside libclamav shouldn't rely on libclamav version
exception: clamconf itself needs both, and the milter shows both

git-svn: trunk@4076
2008-08-04 10:38:24 +00:00
Török Edvin
04f9bedf4b use SVN revision in version info
TODO: replace every remaining use of VERSION with cl_retver()

git-svn: trunk@4070
2008-08-03 21:52:11 +00:00
Török Edvin
9a22341892 apply patch from bb #885
clamd is unusable on OpenBSD and some other BSD versions without it.
It has a C_BSD wrapper around it so it shouldn't affect anything else.

git-svn: trunk@4060
2008-08-01 15:45:10 +00:00
aCaB
8cc8f8100f missing include in clamd.c
git-svn: trunk@4059
2008-08-01 15:39:00 +00:00
Tomasz Kojm
b023c36d4b libclamav: add support for loading specific PUA categories (bb#939)
clamd: new options ExcludePUA and IncludePUA
clamscan: new switches --exclude-pua and --include-pua



git-svn: trunk@4046
2008-07-31 16:26:50 +00:00
Tomasz Kojm
a9d3aa14cd libclamunrar_iface, clamd, freshclam: merge win32 patches from NJH (bb#802)
git-svn: trunk@3872
2008-05-30 10:27:24 +00:00
Tomasz Kojm
e979398ca8 delay the call to daemonize() (bb#839)
git-svn: trunk@3642
2008-02-15 17:37:53 +00:00
Török Edvin
9e751804a2 introduce cli_ctime() that uses ctime_r() when
available, and falls back to locking with a mutex around
		ctime(). (ensures we are using the same mutex always).
use cli_ctime() instead of the thread-unsafe ctime().
		This fixes stability problems.


git-svn: trunk@3578
2008-02-03 19:23:20 +00:00
Tomasz Kojm
587d344b1f add error reporting to daemonize() (bb#729)
git-svn: trunk@3526
2008-01-22 17:47:15 +00:00
Tomasz Kojm
0aa3ba0660 respect custom dbdir settings in print_version() (bb#699)
git-svn: trunk@3521
2008-01-22 10:42:30 +00:00
Tomasz Kojm
3d53538b51 add cli_ac_setdepth(), --dev-ac-depth, DevACOnly, DevACDepth
git-svn: trunk@3365
2007-11-08 15:17:08 +00:00
Tomasz Kojm
38fe8af4ff better error checking/reporting (bb#657)
git-svn: trunk@3273
2007-10-05 23:48:44 +00:00
Tomasz Kojm
09eab32afc move hardware acceleration code to contrib/hwaccel/hwaccel.patch
git-svn: trunk@3209
2007-09-07 14:22:10 +00:00