add option ScriptedUpdates

git-svn: trunk@2702
remotes/push_mirror/metadata
Tomasz Kojm 19 years ago
parent fc83da8244
commit 011b4f295a
  1. 4
      clamav-devel/ChangeLog
  2. 5
      clamav-devel/docs/man/freshclam.conf.5.in
  3. 4
      clamav-devel/etc/freshclam.conf
  4. 14
      clamav-devel/freshclam/manager.c
  5. 1
      clamav-devel/shared/cfgparser.c

@ -1,3 +1,7 @@
Sun Feb 11 11:19:57 CET 2007 (tk)
---------------------------------
* freshclam: add option ScriptedUpdates, requested by Luca
Sun Feb 11 01:38:26 CET 2007 (tk)
---------------------------------
* remove part of warnings from gcc, patch from Edwin

@ -84,6 +84,11 @@ Freshclam(1) tries every mirror this number of times before switching to the nex
.br .
Default: 3 (per mirror)
.TP
\fBScriptedUpdates BOOL\fR
With this option you can control scripted updates. It's highly recommended to keep it enabled.
.br .
Default: enabled
.TP
\fBHTTPProxyServer STR\fR, \fBHTTPProxyPort NUM\fR
Use given proxy server and TCP port for database downloads.
.TP

@ -64,6 +64,10 @@ DatabaseMirror database.clamav.net
# Default: 3 (per mirror)
#MaxAttempts 5
# With this option you can control scripted updates. It's highly recommended
# to keep it enabled.
#ScriptedUpdates yes
# Number of database checks per day.
# Default: 12 (every two hours)
#Checks 24

@ -788,10 +788,12 @@ static struct cl_cvd *currentdb(const char *dbname, unsigned int *inc)
snprintf(path, sizeof(path), "%s.inc", dbname);
if(stat(path, &sb) != -1) {
snprintf(path, sizeof(path), "%s.inc/%s.info", dbname, dbname);
*inc = 1;
if(inc)
*inc = 1;
} else {
snprintf(path, sizeof(path), "%s.cvd", dbname);
*inc = 0;
if(inc)
*inc = 0;
}
cvd = cl_cvdhead(path);
@ -953,6 +955,9 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
};
*/
if(!cfgopt(copt, "ScriptedUpdates")->enabled)
nodb = 1;
if(nodb) {
ret = getcvd(dbfile, hostname, ip, localip, proxy, port, user, pass, uas, nodb, newver, ctimeout, rtimeout, mdat);
if(ret)
@ -1012,12 +1017,15 @@ static int updatedb(const char *dbname, const char *hostname, char *ip, int *sig
}
}
if(!(current = currentdb(dbname, &inc))) {
if(!(current = currentdb(dbname, NULL))) {
/* should never be reached */
logg("!Can't parse new database\n");
return 55; /* FIXME */
}
if(nodb && inc)
rmdirs(dbinc);
logg("%s updated (version: %d, sigs: %d, f-level: %d, builder: %s)\n", inc ? dbinc : dbfile, current->version, current->sigs, current->fl, current->builder);
if(flevel < current->fl) {

@ -107,6 +107,7 @@ struct cfgoption cfg_options[] = {
{"DNSDatabaseInfo", OPT_QUOTESTR, -1, "current.cvd.clamav.net", 0, OPT_FRESHCLAM},
{"DatabaseMirror", OPT_QUOTESTR, -1, NULL, 1, OPT_FRESHCLAM},
{"MaxAttempts", OPT_NUM, 3, NULL, 0, OPT_FRESHCLAM},
{"ScriptedUpdates", OPT_BOOL, 1, NULL, 0, OPT_FRESHCLAM},
{"HTTPProxyServer", OPT_QUOTESTR, -1, NULL, 0, OPT_FRESHCLAM},
{"HTTPProxyPort", OPT_NUM, -1, NULL, 0, OPT_FRESHCLAM},
{"HTTPProxyUsername", OPT_QUOTESTR, -1, NULL, 0, OPT_FRESHCLAM},

Loading…
Cancel
Save