git-svn: trunk@938
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent d5509c774b
commit c6dbfbcb3a
  1. 5
      clamav-devel/ChangeLog
  2. 6
      clamav-devel/clamd/defaults.h
  3. 17
      clamav-devel/clamd/scanner.c
  4. 31
      clamav-devel/clamd/server-th.c
  5. 2
      clamav-devel/clamd/session.c
  6. 2
      clamav-devel/docs/man/clamd.8.in
  7. 140
      clamav-devel/docs/man/clamd.conf.5.in
  8. 43
      clamav-devel/docs/man/freshclam.conf.5.in
  9. 200
      clamav-devel/etc/clamd.conf
  10. 61
      clamav-devel/etc/freshclam.conf
  11. 7
      clamav-devel/freshclam/defaults.h
  12. 3
      clamav-devel/freshclam/freshclam.c
  13. 2
      clamav-devel/shared/cfgparser.c

@ -1,3 +1,8 @@
Mon Sep 27 22:51:05 CEST 2004 (tk)
----------------------------------
* clamd: add new directive DisableDefaultScanOptions
* configs, manual pages: clarify default actions for clamd and freshclam
Mon Sep 27 18:12:17 BST 2004 (njh)
----------------------------------
* clamav-milter: added optional iface argument to --broadcast

@ -21,12 +21,14 @@
#define CL_DEFAULT_CFG CONFDIR"/clamd.conf"
#define CL_DEFAULT_BACKLOG 15
#define CL_DEFAULT_MAXTHREADS 5
#define CL_DEFAULT_MAXTHREADS 10
#define CL_DEFAULT_SCANTIMEOUT 120
#define CL_DEFAULT_LOGSIZE 1048576
#define CL_DEFAULT_CLAMUKOMAXFILESIZE 5 * 1048576
#define CL_DEFAULT_SELFCHECK 3600
#define CL_DEFAULT_SELFCHECK 1800
#define CL_DEFAULT_MAXWHILEWAIT 120
#define CL_DEFAULT_MAXPORTSCAN 1000
#define CL_DEFAULT_MAXDIRREC 15
#define CL_DEFAULT_STREAMMAXLEN 10 * 1048576
#endif

@ -76,17 +76,21 @@ int dirscan(const char *dirname, const char **virname, unsigned long int *scanne
struct stat statbuf;
struct cfgstruct *cpt;
char *fname;
int ret = 0, scanret = 0;
int ret = 0, scanret = 0, maxdirrec = 0;
if((cpt = cfgopt(copt, "MaxDirectoryRecursion"))) {
if(cpt->numarg) {
if(*reclev > cpt->numarg) {
if((cpt = cfgopt(copt, "MaxDirectoryRecursion")))
maxdirrec = cpt->numarg;
else
maxdirrec = CL_DEFAULT_MAXDIRREC;
if(maxdirrec) {
if(*reclev > maxdirrec) {
logg("*Directory recursion limit exceeded at %s\n", dirname);
return 0;
}
(*reclev)++;
}
}
if((dd = opendir(dirname)) != NULL) {
while((dent = readdir(dd))) {
@ -316,6 +320,9 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_node *root
if((cpt = cfgopt(copt, "StreamMaxLength")))
maxsize = cpt->numarg;
else
maxsize = CL_DEFAULT_STREAMMAXLEN;
btread = sizeof(buff);

@ -195,7 +195,8 @@ static struct cl_node *reload_db(struct cl_node *root, const struct cfgstruct *c
int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *copt)
{
int new_sd, max_threads, options=0;
int new_sd, max_threads, stdopt;
unsigned int options = 0;
threadpool_t *thr_pool;
struct sigaction sigact;
mode_t old_umask;
@ -243,7 +244,15 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
max_threads = CL_DEFAULT_MAXTHREADS;
}
if(cfgopt(copt, "ScanArchive") || cfgopt(copt, "ClamukoScanArchive")) {
if(cfgopt(copt, "DisableDefaultScanOptions")) {
logg("RECOMMENDED OPTIONS DISABLED.\n");
stdopt = 0;
} else {
options |= CL_SCAN_STDOPT;
stdopt = 1;
}
if(stdopt || cfgopt(copt, "ScanArchive") || cfgopt(copt, "ClamukoScanArchive")) {
/* set up limits */
memset(&limits, 0, sizeof(struct cl_limits));
@ -256,7 +265,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
}
} else {
limits.maxfilesize = 10485760;
logg("^USING HARDCODED LIMIT: Archive: Archived file size limit set to %d bytes.\n", limits.maxfilesize);
logg("Archive: Archived file size limit set to %d bytes.\n", limits.maxfilesize);
}
if((cpt = cfgopt(copt, "ArchiveMaxRecursion"))) {
@ -267,7 +276,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
}
} else {
limits.maxreclevel = 5;
logg("^USING HARDCODED LIMIT: Archive: Recursion level set to %d.\n", limits.maxreclevel);
logg("Archive: Recursion level limit set to %d.\n", limits.maxreclevel);
}
if((cpt = cfgopt(copt, "ArchiveMaxFiles"))) {
@ -278,7 +287,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
}
} else {
limits.maxfiles = 1000;
logg("^USING HARDCODED LIMIT: Archive: Files limit set to %d.\n", limits.maxfiles);
logg("Archive: Files limit set to %d.\n", limits.maxfiles);
}
if((cpt = cfgopt(copt, "ArchiveMaxCompressionRatio"))) {
@ -288,8 +297,8 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
logg("^Archive: Compression ratio limit disabled.\n");
}
} else {
limits.maxratio = 200;
logg("^USING HARDCODED LIMIT: Archive: Compression ratio limit set to %d.\n", limits.maxratio);
limits.maxratio = 250;
logg("Archive: Compression ratio limit set to %d.\n", limits.maxratio);
}
if(cfgopt(copt, "ArchiveLimitMemoryUsage")) {
@ -326,7 +335,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
logg("Archive support disabled.\n");
}
if(cfgopt(copt, "ScanPE")) {
if(stdopt || cfgopt(copt, "ScanPE")) {
logg("Portable Executable support enabled.\n");
options |= CL_SCAN_PE;
@ -339,7 +348,7 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
logg("Portable Executable support disabled.\n");
}
if(cfgopt(copt, "ScanMail")) {
if(stdopt || cfgopt(copt, "ScanMail")) {
logg("Mail files support enabled.\n");
options |= CL_SCAN_MAIL;
@ -352,14 +361,14 @@ int acceptloop_th(int socketd, struct cl_node *root, const struct cfgstruct *cop
logg("Mail files support disabled.\n");
}
if(cfgopt(copt, "ScanOLE2")) {
if(stdopt || cfgopt(copt, "ScanOLE2")) {
logg("OLE2 support enabled.\n");
options |= CL_SCAN_OLE2;
} else {
logg("OLE2 support disabled.\n");
}
if(cfgopt(copt, "ScanHTML")) {
if(stdopt || cfgopt(copt, "ScanHTML")) {
logg("HTML support enabled.\n");
options |= CL_SCAN_HTML;
} else {

@ -149,7 +149,7 @@ int command(int desc, const struct cl_node *root, const struct cl_limits *limits
} else if(!strncmp(buff, CMD9, strlen(CMD9))) { /* SESSION */
do {
if(!is_fd_connected(desc)) {
logg("Client disconnected without END\n");
logg("SESSION: Client disconnected without END\n");
return 0;
}
ret = command(desc, root, limits, options, copt, -1);

@ -26,7 +26,7 @@ Reload the virus databases.
Perform a clean exit.
.TP
\fBSCAN file/directory\fR
Scan a file or directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required.
Scan a file or a directory (recursively) with archive support enabled (if not disabled in clamd.conf). A full path is required.
.TP
\fBRAWSCAN file/directory\fR
Scan a file or directory (recursively) with archive support disabled. A full path is required.

@ -1,25 +1,25 @@
.\" Manual page created by Tomasz Kojm, 20021001.
.TH "clamd.conf" "5" "September 2, 2004" "Tomasz Kojm" "Clam AntiVirus"
.TH "clamd.conf" "5" "September 27, 2004" "Tomasz Kojm" "Clam AntiVirus"
.SH "NAME"
.LP
\fBclamd.conf\fR \- a configuration file for Clam AntiVirus Daemon
\fBclamd.conf\fR \- Configuration file for Clam AntiVirus Daemon
.SH "DESCRIPTION"
.LP
clamd.conf configures the Clam AntiVirus daemon, clamd(8).
.SH "FILE FORMAT"
The file consists of comments and options with arguments. Each line that starts with a hash (\fB#\fR) symbol is a comment. Options are are case sensitive and of the form \fBOption Argument\fR. The (possibly optional) arguments are are of the following types:
The file consists of comments and options with arguments. Each line that starts with a hash (\fB#\fR) symbol is a comment. Options and arguments are case sensitive and of the form \fBOption Argument\fR. The (possibly optional) arguments are are of the following types:
.TP
\fBSTRING\fR
String without blank characters.
.TP
\fBSIZE\fR
Size in bytes. You can use a 'M' or 'm' modifiers for megabytes and a 'K' or 'k' for kilobytes.
Size in bytes. You can use 'M' or 'm' modifiers for megabytes and 'K' or 'k' for kilobytes.
.TP
\fBNUMBER\fR
Unsigned integer.
.SH "DIRECTIVES"
.LP
When an option is not used (hashed or doesn't exist in the configuration file) freshclam takes a default action.
When an option is not used (hashed or doesn't exist in the configuration file) clamd takes a default action.
.TP
\fBExample\fR
If this option is set clamd will not run.
@ -27,67 +27,72 @@ If this option is set clamd will not run.
\fBLogFile STRING\fR
Enable logging to selected file.
.br
Default: disabled.
Default: disabled
.TP
\fBLogFileUnlock\fR
Disable a system lock that protects against running clamd with a same configuration file multiple times.
.br
Default: disabled.
Default: disabled
.TP
\fBLogFileMaxSize SIZE\fR
Limit a size of a log file. The logger will be automatically disabled if the file is greater than SIZE. Value of 0 disables the limit.
Limit the size of a log file. The logger will be automatically disabled if the file is greater than SIZE. Value of 0 disables the limit.
.br
Default: 1M
.TP
\fBLogTime\fR
Log time with each message.
.br
Default: disabled.
Default: disabled
.TP
\fBLogClean\fR
Log clean files.
.br
Default: disabled.
Default: disabled
.TP
\fBLogSyslog\fR
Use system logger (can work together with LogFile).
.br
Default: disabled.
Default: disabled
.TP
\fBLogFacility\fR
Specify the type of syslog messages \- please refer to 'man syslog' for facility names.
.br
Default: LOG_LOCAL6
.TP
\fBLogVerbose\fR
Enable verbose logging.
.br
Default: disabled.
Default: disabled
.TP
\fBPidFile STRING\fR
Save a process identifier of a listening daemon (main thread) to a specified file.
Save the process identifier of a listening daemon (main thread) to a specified file.
.br
Default: disabled.
Default: disabled
.TP
\fBDatabaseDirectory STRING\fR
Path to a directory containing database files.
.br
Default: hardcoded directory.
Default: @DBDIR@
.TP
\fBLocalSocket STRING\fR
Path to a local (Unix) socket the daemon will listen on.
.br
Default: disabled.
Default: disabled
.TP
\fBFixStaleSocket\fR
Remove stale socket after unclean shutdown.
.br
Default: disabled.
Default: disabled
.TP
\fBTCPSocket NUMBER\fR
TCP port number the daemon will listen on.
.br
Default: disabled.
Default: disabled
.TP
\fBTCPAddr STRING\fR
TCP address to bind to. By default clamd binds to INADDR_ANY.
.br
Default: disabled.
Default: disabled
.TP
\fBMaxConnectionQueueLength NUMBER\fR
Maximum length the queue of pending connections may grow to.
@ -97,106 +102,101 @@ Default: 15
\fBMaxThreads NUMBER\fR
Maximal number of threads running at the same time.
.br
Default: 5.
Default: 10
.TP
\fBThreadTimeout NUMBER\fR
Stop thread\-scanner after specified time (in seconds). Value of 0 disables the timeout.
\fBReadTimeout NUMBER\fR
Waiting for data from a client socket will timeout after this time (seconds).
.br
Default: 180
Default: 120
.TP
\fBMaxDirectoryRecursion NUMBER\fR
Maximal depth a directories are scanned at.
Maximal depth directories are scanned at.
.br
Default: disabled.
Default: 15
.TP
\fBFollowDirectorySymlinks\fR
Follow a directory symlinks. You should have enabled directory recursion limit to avoid a potential problems.
Follow directory symlinks.
.br
Default: disabled.
Default: disabled
.TP
\fBFollowFileSymlinks\fR
Follow regular file symlinks.
.br
Default: disabled.
Default: disabled
.TP
\fBSelfCheck NUMBER\fR
Do internal checks every NUMBER seconds.
Do internal sanity checks every NUMBER seconds.
.br
Default: 3600
Default: 1800
.TP
\fBVirusEvent COMMAND\fR
Execute the COMMAND when virus is found. In the command string %v will be replaced by a virus name.
\fR
.br
Default: disabled.
Default: disabled
.TP
\fBUser STRING\fR
Drop priviledges to a selected user.
Run as selected user.
.br
Default: disabled.
Default: disabled
.TP
\fBAllowSupplementaryGroups\fR
When started by root and the User option is activated, it will initialize all the groups from /etc/group for which user is a member.
Initialize supplementary group access (clamd must be started by root).
.br
Default: disabled.
Default: disabled
.TP
\fBForeground\fR
Don't fork into background. Useful in debugging.
Don't fork into background.
.br
Default: disabled.
Default: disabled
.TP
\fBDebug\fR
Enable debug messages from libclamav. You need to enable the \fBForeground\fR option to see them.
.TP
\fBStreamSaveToDisk\fR
When activated the input stream (see STREAM command) will be saved to disk before scanning \- this allows scanning within archives.
.br
Default: disabled.
Enable debug messages from libclamav.
.TP
\fBStreamMaxLength SIZE\fR
Close the connection when this limit is exceeded.
.br
Default: disabled.
Default: 10M
.TP
\fBDisableDefaultScanOptions\fR
By default clamd uses scan options recommended by libclamav. This option disables recommended options and allows you to enable selected options. DO NOT ENABLE IT unless you know what you are doing.
.br
Default: disabled
.TP
\fBScanPE\fR
PE stands for Portable Executable \- it's an executable file format used in all 32\-bit versions of Windows operating systems. This option allows ClamAV to perform a deeper analysis of executable files and it's also required for decompression of popular executable packers such as UPX.
.br
Default: enabled.
Default: enabled
.TP
\fBDetectBrokenExecutables\fR
With this option clamav will try to detect broken executables and mark them as Broken.Executable.
With this option clamd will try to detect broken executables and mark them as Broken.Executable.
.br
Default: disabled.
Default: disabled
.TP
\fBScanOLE2\fR
Enables scanning of Microsoft Office document macros.
.br
Default: enabled.
Default: enabled
.TP
\fBScanHTML\fR
Enables HTML detection and normalisation.
.br
Default: enabled.
Default: enabled
.TP
\fBScanMail\fR
Enable scanning of mail files.
.br
Default: enabled.
Default: enabled
.TP
\fBMailFollowURLs\fR
If an email contains URLs ClamAV can download and scan them. \fBWARNING: This option may open your system to a DoS attack. Never use it on loaded servers.\fR
.br
Default: disabled.
Default: disabled
.TP
\fBScanArchive\fR
Enable archive scanning.
.br
Default: disabled.
.TP
\fBScanRAR\fR
The built\-in RAR unpacker is disabled by default because the code leaks.
.br
Default: disabled.
Default: enabled
.TP
\fBArchiveMaxFileSize SIZE\fR
Files in archives larger than this limit won't be scanned. Value of 0 disables the limit.
@ -214,9 +214,9 @@ Number of files to be scanned within archive. Value of 0 disables the limit.
Default: 1000
.TP
\fBArchiveMaxCompressionRatio NUMBER\fR
Analyze compression ratio and mark potential archive bombs as viruses (0 disables the limit).
Analyze compression ratio of every file in an archive and mark potential archive bombs as viruses (0 disables the limit).
.br
Default: 200
Default: 250
.TP
\fBArchiveLimitMemoryUsage\fR
Use slower decompression algorithm which uses less memory. This option affects bzip2 decompressor only.
@ -236,32 +236,32 @@ Default: disabled
\fBClamukoScanOnLine\fR
Enable Clamuko \- on\-access scanner for Linux. Dazuko must be already running.
.br
Default: disabled.
Default: disabled
.TP
\fBClamukoScanOnOpen\fR
Scan a file on open.
Scan files on open.
.br
Default: disabled.
Default: disabled
.TP
\fBClamukoScanOnClose\fR
Scan a file on close.
Scan files on close.
.br
Default: disabled.
.TP
\fBClamukoScanOnExec\fR
Scan a file on execute.
Scan files on execute.
.br
Default: disabled.
Default: disabled
.TP
\fBClamukoIncludePath STRING\fR
Set the include paths (all files and directories in them will be scanned). You can have multiple ClamukoIncludePath options but each directory must be added with a seperate option.
Set the include paths (all files and directories in them will be scanned). You can have multiple ClamukoIncludePath directives but each directory must be added in a seperate line).
.br
Default: disabled. Required.
Default: disabled
.TP
\fBClamukoExcludePath\fR
Set the exclude paths. All subdirectories are also excluded.
Set the exclude paths. All subdirectories will also be excluded.
.br
Default: disabled.
Default: disabled
.TP
\fBClamukoMaxFileSize SIZE\fR
Don't scan files larger than SIZE.
@ -271,7 +271,7 @@ Default: 5M
\fBClamukoScanArchive\fR
Enable archive scanning. It uses ArchiveMax* limits.
.br
Default: disabled.
Default: disabled
.SH "FILES"
.LP
@CFGDIR@/clamd.conf

@ -1,5 +1,5 @@
.\" Manual page created by Magnus Ekdahl and Thomas Lamy
.TH "freshclam.conf" "5" "September 2, 2004" "Thomas Lamy" "Clam AntiVirus"
.TH "freshclam.conf" "5" "September 27, 2004" "Thomas Lamy" "Clam AntiVirus"
.SH "NAME"
.LP
\fBfreshclam.conf\fR \- Configuration file for Clam AntiVirus Database Updater
@ -7,13 +7,13 @@
.LP
The file freshclam.conf configures the Clam AntiVirus Database Updater, freshclam(1).
.SH "FILE FORMAT"
The file consists of comments and options with arguments. Each line that starts with a hash (\fB#\fR) symbol is a comment. Options are are case sensitive and of the form \fBOption Argument\fR. The (possibly optional) arguments are are of the following types:
The file consists of comments and options with arguments. Each line that starts with a hash (\fB#\fR) symbol is a comment. Options and arguments are case sensitive and of the form \fBOption Argument\fR. The (possibly optional) arguments are of the following types:
.TP
\fBSTRING\fR
String without blank characters.
.TP
\fBSIZE\fR
Size in bytes. You can use a 'M' or 'm' modifiers for megabytes and a 'K' or 'k' for kilobytes.
Size in bytes. You can use 'M' or 'm' modifiers for megabytes and 'K' or 'k' for kilobytes.
.TP
\fBNUMBER\fR
Unsigned integer.
@ -22,18 +22,21 @@ Unsigned integer.
When an option is not used (hashed or doesn't exist in the configuration file) freshclam takes a default action.
.TP
\fBExample\fR
If this option is set clamd will not run.
If this option is set freshclam will not run.
.TP
\fBDatabaseOwner STRING\fR
When started by root, drop privileges to a specified user. Default is \"clamav\".
When started by root, drop privileges to a specified user. .br
Default: @CLAMAVUSER@
.TP
\fBDatabaseDirectory STRING\fR
Path to a directory containing database files.
.br
Default: hardcoded directory
Default: @DBDIR@
.TP
\fBChecks NUM\fR
Number of database checks per day. 12 is the recommended number.
Number of database checks per day.
.br
Default: 12
.TP
\fBUpdateLogFile STRING\fR
Enable logging to a specified file. Highly recommended.
@ -45,20 +48,30 @@ Enable logging to Syslog. May be used in combination with UpdateLogFile
.br
Default: disabled.
.TP
\fBLogFacility\fR
Specify the type of syslog messages \- please refer to 'man syslog' for facility names.
.br
Default: LOG_LOCAL6
.TP
\fBLogVerbose\fR
Enable verbose logging.
.br
Default: disabled
.TP
\fBDNSDatabaseInfo STRING\fR
This directive enables database and software version verification through DNS TXT records. We highly recommend enabling it. Please use the current.cvd.clamav.net record.
.br
Default: disabled
.TP
\fBDatabaseMirror STRING\fR
Server name where database updates are downloaded from. The default is database.clamav.net, which points to all official mirrors.
.br .
If this option is given multiple times, freshclam(1) tries them in the order given if one download fails.
Server name where database updates are downloaded from. database.clamav.net is a round\-robin record which points ClamAV users to most reliable mirrors. If this option is given multiple times, freshclam(1) tries them in the order given if one download fails.
.br
There is no default, which results in an error when running freshclam(1).
Default: There is no default, which results in an error when running freshclam(1).
.TP
\fBMaxAttempts NUM\fR
Freshclam(1) tries every mirror this number of times before switching to the next mirror.
.br .
Default is to try once per mirror.
Default: 3 (per mirror)
.TP
\fBHTTPProxyServer STR\fR, \fBHTTPProxyPort NUM\fR
Use given proxy server and TCP port for database downloads.
@ -71,13 +84,17 @@ Default: no proxy authentication
\fBNotifyClamd \[STRING\]\fR
Notify a running clamd(8) to reload it\'s database after a download has occured. Optionally a clamd.conf(5) file location may be given to tell freshclam(1) how to communicate with clamd(8).
.br .
The default is to not notify clamd. See clamd.conf(5)\'s option SelfCheck for how clamd(8) handles database updates in this case.
Default: The default is to not notify clamd. See clamd.conf(5)\'s option SelfCheck for how clamd(8) handles database updates in this case.
.TP
\fBOnUpdateExecute STRING\fR
Execute this command after the database has been successfully updated.
.br
Default: disabled
.TP
\fBOnErrorExecute\fR
Execute this command after a database update has failed.
.br
Default: disabled
.SH "NOTE"
While not reasonable, any configuration option from clamd.conf(5) may be given.
.SH "FILES"

@ -8,128 +8,149 @@
Example
# Uncomment this option to enable logging.
# LogFile must be writable for the user running the daemon.
# Full path is required.
# LogFile must be writable for the user running daemon.
# A full path is required.
# Default: disabled
#LogFile /tmp/clamd.log
# By default the log file is locked for writing - the lock protects against
# running clamd multiple times (if want to run another clamd, please
# copy the configuration file, change the LogFile variable, and run
# the daemon with --config-file option). That's why you shouldn't uncomment
# this option.
# the daemon with --config-file option).
# This option disables log file locking.
# Default: disabled
#LogFileUnlock
# Maximal size of the log file. Default is 1 Mb.
# Maximal size of the log file.
# Value of 0 disables the limit.
# You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)
# and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size
# in bytes just don't use modifiers.
# Default: 1M
#LogFileMaxSize 2M
# Log time with an each message.
# Log time with each message.
# Default: disabled
#LogTime
# Log also clean files. May be useful in debugging but will drastically
# increase the log size.
# Also log clean files. Useful in debugging but drastically increases the
# log size.
# Default: disabled
#LogClean
# Use system logger (can work together with LogFile).
# Default: disabled
#LogSyslog
# Specify the type of syslog messages - please refer to 'man syslog'
# for facility names. Default is LOG_LOCAL6.
# for facility names.
# Default: LOG_LOCAL6
#LogFacility LOG_MAIL
# Enable verbose logging.
# Default: disabled
#LogVerbose
# This option allows you to save the process identifier of the listening
# This option allows you to save a process identifier of the listening
# daemon (main thread).
# Default: disabled
#PidFile /var/run/clamd.pid
# Optional path to the global temporary directory.
# Default is system specific - usually /var/tmp or /tmp.
# Default: system specific (usually /tmp or /var/tmp).
#TemporaryDirectory /var/tmp
# Path to the database directory.
# Default is the hardcoded directory (mostly /usr/local/share/clamav,
# but it depends on installation options).
# Default: hardcoded (depends on installation options)
#DatabaseDirectory /var/lib/clamav
# The daemon works in local or network mode. Currently the local mode is
# recommended for security reasons.
# The daemon works in a local OR a network mode. Due to security reasons we
# recommend the local mode.
# Path to the local socket. The daemon doesn't change the mode of the
# created file (portability reasons). You may want to create it in a directory
# which is only accessible for a user running daemon.
# Path to a local socket file the daemon will listen on.
# Default: disabled
LocalSocket /tmp/clamd
# Remove stale socket after unclean shutdown.
# Default: disabled
FixStaleSocket
# TCP port address.
# Default: disabled
#TCPSocket 3310
# TCP address.
# By default we bind to INADDR_ANY, probably not wise.
# Enable the following to provide some degree of protection
# from the outside world.
# Default: disabled
#TCPAddr 127.0.0.1
# Maximum length the queue of pending connections may grow to.
# Default is 15.
# Default: 15
#MaxConnectionQueueLength 30
# Close the connection if this limit is exceeded.
#StreamMaxLength 10M
# Default: 10M
#StreamMaxLength 20M
# Maximal number of a threads running at the same time.
# Default is 5, and it should be sufficient for a typical workstation.
# You may need to increase threads number for a server machine.
#MaxThreads 10
# Maximal number of threads running at the same time.
# Default: 10
#MaxThreads 20
# Waiting for data from a client socket will timeout after this time (seconds).
# Default is 120. Value of 0 disables the timeout.
# Value of 0 disables the timeout.
# Default: 120
#ReadTimeout 300
# Maximal depth the directories are scanned at.
MaxDirectoryRecursion 15
# Maximal depth directories are scanned at.
# Default: 15
#MaxDirectoryRecursion 20
# Follow a directory symlinks.
# SECURITY HINT: You should have enabled directory recursion limit to
# avoid potential problems.
# Follow directory symlinks.
# Default: disabled
#FollowDirectorySymlinks
# Follow regular file symlinks.
# Default: disabled
#FollowFileSymlinks
# Do internal checks (eg. check the integrity of the database structures)
# By default clamd checks itself every 3600 seconds (1 hour).
# Perform internal sanity check (database integrity and freshness).
# Default: 1800 (30 min)
#SelfCheck 600
# Execute a command when a virus is found. In the command string %v will
# be replaced by the virus name.
#
# Execute a command when virus is found. In the command string %v will
# be replaced by a virus name.
# Default: disabled
#VirusEvent /usr/local/bin/send_sms 123456789 "VIRUS ALERT: %v"
# Run as selected user (clamd must be started by root).
# By default it doesn't drop privileges.
# Run as a selected user (clamd must be started by root).
# Default: disabled
#User clamav
# Initialize the supplementary group access (for all groups in /etc/group
# user is added in. clamd must be started by root).
# Initialize supplementary group access (clamd must be started by root).
# Default: disabled
#AllowSupplementaryGroups
# Don't fork into background. Useful in debugging.
# Don't fork into background.
# Default: disabled
#Foreground
# Enable debug messages in libclamav.
# Default: disabled
#Debug
# Do not remove temporary files (for debug purposes).
# Default: disabled
#LeaveTemporaryFiles
# By default clamd uses scan options recommended by libclamav. This option
# disables recommended options and allows you to enable selected ones below.
# DO NOT TOUCH IT unless you know what you are doing.
# Default: disabled
#DisableDefaultScanOptions
##
## Executable files
##
@ -137,11 +158,14 @@ MaxDirectoryRecursion 15
# PE stands for Portable Executable - it's an executable file format used
# in all 32-bit versions of Windows operating systems. This option allows
# ClamAV to perform a deeper analysis of executable files and it's also
# required for decompression of popular executable packers such as UPX.
ScanPE
# required for decompression of popular executable packers such as UPX, FSG,
# and Petite.
# Default: enabled
#ScanPE
# With this option clamav will try to detect broken executables and mark
# them as Broken.Executable
# Default: disabled
#DetectBrokenExecutables
@ -150,18 +174,21 @@ ScanPE
##
# This option enables scanning of Microsoft Office document macros.
ScanOLE2
# Default: enabled
#ScanOLE2
##
## Mail files
##
# Enable internal e-mail scanner.
ScanMail
# Default: enabled
#ScanMail
# If an email contains URLs ClamAV can download and scan them.
# WARNING: This option may open your system to a DoS attack.
# Never use it on loaded servers.
# Default: disabled
#MailFollowURLs
@ -169,54 +196,57 @@ ScanMail
## HTML
##
# This option enables HTML detection and normalisation. It's highly
# recommended and required to detect popular exploits.
ScanHTML
# Perform HTML normalisation and decryption of MS Script Encoder code.
# Default: enabled
#ScanHTML
##
## Archives
##
# Comment this line to disable scanning of the archives.
ScanArchive
# By default the built-in RAR unpacker is disabled by default because the code
# terribly leaks, however it's probably a good idea to enable it.
#ScanRAR
# ClamAV can scan within archives and compressed files.
# Default: enabled
#ScanArchive
# Options below protect your system against Denial of Service attacks
# with archive bombs.
# The options below protect your system against Denial of Service attacks
# using archive bombs.
# Files in archives larger than this limit won't be scanned.
# Value of 0 disables the limit.
# WARNING: Due to the unrarlib implementation, whole files (one by one) in RAR
# archives are decompressed to the memory. That's why never disable
# this limit (but you may increase it of course!)
ArchiveMaxFileSize 10M
# Archives are scanned recursively - e.g. if Zip archive contains RAR file,
# the RAR file will be decompressed, too (but only if recursion limit is set
# at least to 1). With this option you may set the recursion level.
# Default: 10M
#ArchiveMaxFileSize 15M
# Nested archives are scanned recursively, e.g. if a Zip archive contains a RAR
# file, all files within it will also be scanned. This options specifies how
# deep the process should be continued.
# Value of 0 disables the limit.
ArchiveMaxRecursion 5
# Default: 5
#ArchiveMaxRecursion 8
# Number of files to be scanned within archive.
# Number of files to be scanned within an archive.
# Value of 0 disables the limit.
ArchiveMaxFiles 1000
# Default: 1000
#ArchiveMaxFiles 1500
# Mark potential archive bombs as viruses (0 disables the limit)
ArchiveMaxCompressionRatio 200
# If a file in an archive is compressed more than ArchiveMaxCompressionRatio
# times it will be marked as a virus (Oversized.ArchiveType, e.g. Oversized.Zip)
# Value of 0 disables the limit.
# Default: 250
#ArchiveMaxCompressionRatio 300
# Use slower decompression algorithm which uses less memory. This option
# affects bzip2 decompressor only.
# Use slower but memory efficient decompression algorithm.
# only affects the bzip2 decompressor.
# Default: disabled
#ArchiveLimitMemoryUsage
# Mark encrypted archives as viruses (Encrypted.Zip, Encrypted.RAR).
# Default: disabled
#ArchiveBlockEncrypted
# Mark archives as viruses if ArchiveMaxFiles, ArchiveMaxFileSize, or
# ArchiveMaxRecursion limit is reached.
# Default: disabled
#ArchiveBlockMax
@ -227,28 +257,30 @@ ArchiveMaxCompressionRatio 200
##
# Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.
# Default: disabled
#ClamukoScanOnAccess
# Set access mask for Clamuko.
ClamukoScanOnOpen
ClamukoScanOnClose
ClamukoScanOnExec
# Default: disabled
#ClamukoScanOnOpen
#ClamukoScanOnClose
#ClamukoScanOnExec
# Set the include paths (all files in them will be scanned). You can have
# multiple ClamukoIncludePath options, but each directory must be added
# in a seperate option. All subdirectories are scanned, too.
ClamukoIncludePath /home
# multiple ClamukoIncludePath directives but each directory must be added
# in a seperate line.
# Default: disabled
#ClamukoIncludePath /home
#ClamukoIncludePath /students
# Set the exclude paths. All subdirectories are also excluded.
# Default: disabled
#ClamukoExcludePath /home/guru
# Limit the file size to be scanned (probably you don't want to scan your movie
# files ;))
# Value of 0 disables the limit. 1 Mb should be fine.
ClamukoMaxFileSize 1M
# Don't scan files larger than ClamukoMaxFileSize
# Value of 0 disables the limit.
# Default: 5M
#ClamukoMaxFileSize 10M
# Enable archive support. It uses the limits from clamd section.
# (This option doesn't depend on ScanArchive, you can have archive support
# in clamd disabled).
ClamukoScanArchive
# FIXME: Add support for other directives.
#ClamukoScanArchive

@ -1,58 +1,87 @@
##
## Example config file for freshclam
## Please read the clamd.conf(5) manual before editing this file.
## Please read the freshclam.conf(5) manual before editing this file.
## This file may be optionally merged with clamd.conf.
##
# It must match clamd.conf's directive!
# Comment or remove the line below.
Example
# Path to the database directory.
# WARNING: It must match clamd.conf's directive!
# Default: hardcoded (depends on installation options)
#DatabaseDirectory /var/lib/clamav
# Path to the log file (make sure it has proper permissions)
# Default: disabled
#UpdateLogFile /var/log/freshclam.log
# Enable verbose logging.
# Default: disabled
#LogVerbose
# Use system logger (can work together with UpdateLogFile).
# Default: disabled
#LogSyslog
# Specify the type of syslog messages - please refer to 'man syslog'
# for facility names. Default is LOG_LOCAL6.
# for facility names.
# Default: LOG_LOCAL6
#LogFacility LOG_MAIL
# This option allows you to save the process identifier of the daemon
# Default: disabled
#PidFile /var/run/freshclam.pid
# By default when freshclam is started by root it drops privileges and
# switches to the "clamav" user. You can change this behaviour here.
# By default when started freshclam drops privileges and switches to the
# "clamav" user. This directive allows you to change the database owner.
# Default: clamav (may depend on installation options)
#DatabaseOwner clamav
# Use DNS to verify virus database version.
# Use DNS to verify virus database version. Freshclam uses DNS TXT records
# to verify database and software versions. We highly recommend enabling
# this option.
# Default: disabled
DNSDatabaseInfo current.cvd.clamav.net
# The main database mirror is database.clamav.net (this is a round-robin
# DNS that points to many mirrors on the world) and in most cases you
# SHOULD NOT change it.
# Uncomment the following line and replace XY with your country
# code. See http://www.iana.org/cctld/cctld-whois.htm for the full list.
# Default: There is no default, which results in an error when running freshclam
#DatabaseMirror db.XY.clamav.net
# database.clamav.net is a round-robin record which points to our most
# reliable mirrors. It's used as a fall back in case db.XY.clamav.net is
# not working. DO NOT TOUCH the following line unless you know what you
# are doing.
DatabaseMirror database.clamav.net
# How many attempts to make before giving up.
MaxAttempts 3
# Default: 3 (per mirror)
#MaxAttempts 5
# How often check for a new database. We suggest checking for it every
# two hours.
Checks 12
# Number of database checks per day.
# Default: 12 (every two hours)
#Checks 24
# Proxy settings
# Default: disabled
#HTTPProxyServer myproxy.com
#HTTPProxyPort 1234
#HTTPProxyUsername myusername
#HTTPProxyPassword mypass
# Send the RELOAD command to clamd.
#NotifyClamd [/optional/config/file/path]
# Default: disabled
#NotifyClamd
# By default it uses the hardcoded configuration file but you can force an
# another one.
#NotifyClamd /config/file/path
# Run command after database update.
# Run command after successful database update.
# Default: disabled
#OnUpdateExecute command
# Run command if database update failed.
# Run command when database update process fails.
# Default: disabled
#OnErrorExecute command

@ -22,10 +22,6 @@
#define VIRUSDBDIR DATADIR
#define MIRROR_CFG "/mirrors.txt"
#define MIRROR "/mirror"
/* default names */
#ifdef CLAMAVUSER
@ -40,4 +36,5 @@
#define UNPGROUP "clamav"
#endif
#define CL_DEFAULT_CHECKS 6
#define CL_DEFAULT_CHECKS 12
#define CL_DEFAULT_MAXATTEMPTS 3

@ -352,6 +352,9 @@ int download(const struct cfgstruct *copt, const struct optstruct *opt)
if((cpt = cfgopt(copt, "MaxAttempts")))
maxattempts = cpt->numarg;
else
maxattempts = CL_DEFAULT_MAXATTEMPTS;
mprintf("*Max retries == %d\n", maxattempts);

@ -61,7 +61,7 @@ struct cfgstruct *parsecfg(const char *cfgfile, int messages)
{"LogFacility", OPT_STR},
{"PidFile", OPT_STR},
{"TemporaryDirectory", OPT_STR},
{"MaxFileSize", OPT_COMPSIZE},
{"DisableDefaultScanOptions", OPT_NOARG},
{"ScanPE", OPT_NOARG},
{"DetectBrokenExecutables", OPT_NOARG},
{"ScanMail", OPT_NOARG},

Loading…
Cancel
Save