Commit graph

69 commits

Author SHA1 Message Date
Shawn Webb
60d8d2c352 Move all the crypto API to clamav.h 2014-07-01 19:38:01 -04:00
Shawn Webb
b2e7c931d0 Use OpenSSL for hashing. 2014-02-08 00:31:12 -05:00
Shawn Webb
e07b295d95 Remove existing stats gathering framework from clamd
Conflicts:
	clamd/clamd.c
2014-01-28 10:46:47 -05:00
Shawn Webb
d9b6b8c757 bb#8993 - Rename the STAT macro to CLAMSTAT to avoid name conflicts on AIX 2013-09-25 16:23:10 -04:00
David Raynor
23816d691c clamd: add AllowAllMatchScan config option for permit/deny ALLMATCHSCAN command 2013-06-11 11:20:31 -04:00
Shawn Webb
8b2bdb1b28 bb6578 - Fixes TODO in session.c on converting to ENUM 2013-03-01 14:01:20 -05:00
Steve Morgan
6ad45a2931 add initial allscan/allmatch mode to libclamav, clamd, clamdscan, and clamscan with unit tests 2012-10-18 14:12:58 -07:00
Steve Morgan
1de0366eb1 fix close(-1) identified by code analyzer(bb#5782). Also fixed other problems and inconsistencies in how return codes were set in scanner.c:command() function 2012-09-13 15:15:22 -07:00
Shawn webb
a2a004df25 BB#3737 - Value too large for specified data type
Create compile-time preprocessor defines for switching from calling
stat() to stat64(). Add --enable-stat64 switch in configure script.
2012-07-16 15:36:49 -04:00
Shawn webb
ba20a0c55a BB#5409 - Fix condition to follow type change inside command() 2012-07-03 12:06:18 -04:00
Tomasz Kojm
0f4639ec76 clamd: log request ip address for instream scans #bb2592
On behalf of acab
2011-05-05 16:15:57 -07:00
aCaB
8ab47ebe4e win32: UTF #6 - clamd proto 2011-04-18 17:25:23 +02:00
Tomasz Kojm
b33354e55c cosmetics (bb#2207) 2011-03-11 20:30:45 +01:00
Tomasz Kojm
b898103236 clamd: don't report file hashes to clients (bb#2409) 2010-12-09 13:50:42 +01:00
Tomasz Kojm
49f8de2207 clamd: add new commands DETSTATS and DETSTATSCLEAR (part of bb#2312) 2010-11-03 13:41:06 +01:00
aCaB
f238189223 bb#2286 2010-10-14 16:06:43 +02:00
Török Edvin
cdb3cbe089 Treat MULTISCAN as CONTSCAN on non-directories (bb #1869).
This is part 1. Part 2 will be for clamdscan to send IDSESSION for
-m <file1> <file2>, but that is for 0.97.
2010-07-26 12:57:34 +03:00
Tomasz Kojm
edbba730b3 clamd: add ExtendedDetectionInfo (bb#1228, #1626) 2010-07-06 19:46:55 +02:00
Török Edvin
e4a0f2c94f fix compiler warnings (bb #1872, bb #1934, bb #1935) 2010-04-13 16:19:47 +03:00
Török Edvin
1514794c49 make STATS a non-bulk command (bb #1732).
This is needed to allow clamdtop to watch in realtime what is happening in
clamd, otherwise STATS would always lag behind 50 other multiscan commands.
2010-02-01 14:38:36 +02:00
Török Edvin
c0afc51729 Don't use C++ comments in C code. 2010-01-27 12:07:08 +02:00
Török Edvin
27b59717b8 previous commit fixes bb #1770, not #1700! 2010-01-27 11:59:51 +02:00
Török Edvin
80301d0cd6 Fix clamd hang when number of multiscan commands == MaxThreads (bb #1700).
Each multiscan command needs 1 control thread, and 1 (possibly shared) scanner
thread.
If the number of multiscan control threads would be equal to MaxThreads no
progress could be made, since each one would be waiting for 1 free scanner
thread (but none can be spawned since maxthreads was already reached).
As long as there is 1 thread free for scanning, we can have N-1 multiscan
commands active, with N MaxThreads.
2010-01-27 11:56:10 +02:00
aCaB
e0bb54d7d4 win32: s/C_WINDOWS/_WIN32/ in clamd, shared 2009-09-30 00:54:04 +02:00
aCaB
be4bf7f4ab win32 2009-09-24 16:08:52 +02:00
Tomasz Kojm
2086dc5cab clamd, clamscan: add support for CrossFilesystems/--cross-fs (bb#1607) 2009-08-05 16:27:48 +02:00
Tomasz Kojm
51bbedb132 libclamav, clamd: handle file exclusion in cli_ftw() (bb#1656) 2009-07-31 21:28:55 +02:00
Török Edvin
7660b7cb35 Fix 60 byte/STREAM command memory leak on FreeBSD. (bb #1567,
thanks to Jay Deiman <jay*splitstreams.com> and Chris Mikkelson <cmikk*qwest.net> for tracking down the leak!).

git-svn: trunk@5061
2009-05-06 07:56:28 +00:00
Török Edvin
52cecde4c0 fix STATS for INSTREAM commands (bb #1565).
git-svn: trunk@5051
2009-04-20 14:41:20 +00:00
Tomasz Kojm
0dcb7037d6 clamd/session.c: respect TemporaryDirector in cli_gentempfd()
git-svn: trunk@4997
2009-04-01 12:01:00 +00:00
Török Edvin
36e4bc1467 stop scanning when client disconnects (bb #1446).
git-svn: trunk@4940
2009-03-13 13:50:56 +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
Török Edvin
e68d70e7e0 strerror/strerror_r->cli_strerror which is always thread safe.
git-svn: trunk@4927
2009-03-11 19:11:09 +00:00
Török Edvin
39b84970e1 new clamd command: nVERSIONCOMMANDS (bb #1437).
git-svn: trunk@4922
2009-03-10 17:51:06 +00:00
Török Edvin
3dc90d4a30 stop scanning when client disconnects in multiscan mode (bb #1417).
git-svn: trunk@4847
2009-02-23 12:35:40 +00:00
Török Edvin
31d5b62ceb real fix for BB #1403.
git-svn: trunk@4829
2009-02-18 19:26:30 +00:00
Török Edvin
a414efbf5e revert previous commit, it is the wrong fix.
git-svn: trunk@4828
2009-02-18 19:11:21 +00:00
Török Edvin
a1f0c01189 Fix wrong use of strerror_r: it doesn't have to use/fill the buffer,
it can return a pointer to a static location, as described in the manpage.
This can happen on a Linux system with a foreign locale, where the LANG=C messages are
returned this way. (BB #1403)

git-svn: trunk@4827
2009-02-18 19:08:15 +00:00
Török Edvin
537292a773 Reject new commands sent as new-style commands to avoid confusion.
This means that IDSESSION/INSTREAM must be sent as nIDSESSION\n or zIDSESSION\0,
ditto for INSTREAM.
Adjust testcases accordingly.
Old commands are still accepted when sent without delimiter.

git-svn: trunk@4811
2009-02-17 18:04:48 +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
0378a9ab77 introduce timeouts for send(), this is needed for IDSESSION to work reliably,
since a buggy client implementation may get stuck in send(), and then clamd
gets stuck in send() -> deadlock. To avoid this we need nonblocking sockets, and
(low) timeouts on send.
Add more tests for clamd protocol, including a stress test for IDSESSION.

git-svn: trunk@4798
2009-02-16 18:27:08 +00:00
Török Edvin
4e24a36173 add more unit tests.
Make handling of old-style commands compatible with old clamd: if they have a \n
that will delimit the command.
If multiscan of a single file encounters errors, don't reply OK too.

git-svn: trunk@4796
2009-02-16 18:26:58 +00:00
Török Edvin
b3b8212f7f make clamdtop use IDSESSION, and enable VERSION/STATS inside IDSESSION.
git-svn: trunk@4789
2009-02-14 16:13:38 +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
034994bd9c fdpassing is now in others.c instead of session.c, move
the defines.

git-svn: trunk@4774
2009-02-13 08:41:59 +00:00
Török Edvin
9ac109f338 add missing include
git-svn: trunk@4773
2009-02-13 08:01:12 +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
064b4a0c99 initial version of the unified option parser (bb#1215)
git-svn: trunk@4565
2008-12-17 21:42:54 +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
Török Edvin
b9b477842d fix compiler warnings, more to come (bb #273)
git-svn: trunk@4346
2008-11-06 14:27:43 +00:00