enable DNSDatabaseInfo by default; add --no-dns option

git-svn: trunk@817
remotes/push_mirror/metadata
Tomasz Kojm 21 years ago
parent 3365db23fc
commit 7344808506
  1. 5
      clamav-devel/ChangeLog
  2. 5
      clamav-devel/docs/man/freshclam.1
  3. 2
      clamav-devel/etc/freshclam.conf
  4. 1
      clamav-devel/freshclam/freshclam.c
  5. 22
      clamav-devel/freshclam/manager.c
  6. 2
      clamav-devel/freshclam/manager.h
  7. 1
      clamav-devel/freshclam/options.c

@ -1,3 +1,8 @@
Wed Sep 1 02:21:41 CEST 2004 (tk)
----------------------------------
* etc/freshclam.conf: enable DNSDatabaseInfo by default
* freshclam: add --no-dns option
Tue Aug 31 20:39:34 CEST 2004 (tk)
----------------------------------
* sigtool: add support for *.hdb files in -l; include creation time in

@ -1,5 +1,5 @@
.\" Manual page created by Tomasz Kojm, 20020415
.TH "freshclam" "1" "March 14, 2004" "Tomasz Kojm" "Clam AntiVirus"
.TH "freshclam" "1" "September 1, 2004" "Tomasz Kojm" "Clam AntiVirus"
.SH "NAME"
.LP
freshclam \- update virus databases
@ -43,6 +43,9 @@ Run in a daemon mode. This option requires \-\-checks.
\fB\-p FILE, \-\-pid=FILE\fR
Save daemon's pid in FILE.
.TP
\fB\-\-no\-dns\fR
This option forces old non\-DNS verification method (without a TTL delay).
.TP
\fB\-c #n, \-\-checks=#n\fR
Check #n times per day for a new database. #n must be between 1 and 50.
.TP

@ -29,7 +29,7 @@
#DatabaseOwner clamav
# Use DNS to verify virus database version.
#DNSDatabaseInfo current.cvd.clamav.net
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

@ -425,6 +425,7 @@ void help(void)
mprintf(" --daemon -d run in daemon mode\n");
mprintf(" --pid=FILE -p FILE save daemon's pid in FILE\n");
mprintf(" --user=USER -u USER run as USER\n");
mprintf(" --no-dns force old non-DNS verification method\n");
mprintf(" --checks=#n -c #n number of checks per day, 1 <= n <= 50\n");
mprintf(" --datadir=DIRECTORY download new databases into DIRECTORY\n");
#ifdef BUILD_CLAMD

@ -53,7 +53,7 @@
int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, const char *hostname)
{
time_t currtime;
int ret, updated = 0, signo = 0;
int ret, updated = 0, signo = 0, usedns;
char ipaddr[16];
struct cfgstruct *cpt;
@ -67,15 +67,17 @@ int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, c
logg("SECURITY WARNING: NO SUPPORT FOR DIGITAL SIGNATURES\n");
#endif
optl(opt, "no-dns") ? (usedns = 0) : (usedns = 1);
memset(ipaddr, 0, sizeof(ipaddr));
if((ret = downloaddb(DB1NAME, "main.cvd", hostname, ipaddr, &signo, copt)) > 50)
if((ret = downloaddb(DB1NAME, "main.cvd", hostname, ipaddr, &signo, copt, usedns)) > 50)
return ret;
else if(ret == 0)
updated = 1;
/* if ipaddr[0] != 0 it will use it to connect to the web host */
if((ret = downloaddb(DB2NAME, "daily.cvd", hostname, ipaddr, &signo, copt)) > 50)
if((ret = downloaddb(DB2NAME, "daily.cvd", hostname, ipaddr, &signo, copt, usedns)) > 50)
return ret;
else if(ret == 0)
updated = 1;
@ -127,7 +129,7 @@ static int isnumb(const char *str)
return 1;
}
int downloaddb(const char *localname, const char *remotename, const char *hostname, char *ip, int *signo, const struct cfgstruct *copt)
int downloaddb(const char *localname, const char *remotename, const char *hostname, char *ip, int *signo, const struct cfgstruct *copt, int usedns)
{
struct cl_cvd *current, *remote;
struct cfgstruct *cpt;
@ -140,7 +142,8 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
if((current = cl_cvdhead(localname)) == NULL)
nodb = 1;
if(!nodb && (cpt = cfgopt(copt, "DNSDatabaseInfo"))) {
if(!nodb && usedns && (cpt = cfgopt(copt, "DNSDatabaseInfo"))) {
if((dnsreply = txtquery(cpt->strarg, &ttl))) {
int field = 0;
@ -249,11 +252,14 @@ int downloaddb(const char *localname, const char *remotename, const char *hostna
if(current)
cl_cvdfree(current);
if(ipaddr[0])
if(ipaddr[0]) {
/* use ipaddr in order to connect to the same mirror */
hostfd = wwwconnect(ipaddr, proxy, port, NULL);
else
hostfd = wwwconnect(hostname, proxy, port, NULL);
} else {
hostfd = wwwconnect(hostname, proxy, port, ipaddr);
if(!ip[0])
strcpy(ip, ipaddr);
}
if(hostfd < 0) {
if(ipaddr[0])

@ -24,7 +24,7 @@
int downloadmanager(const struct cfgstruct *copt, const struct optstruct *opt, const char *hostname);
int downloaddb(const char *localname, const char *remotename, const char *hostname, char *ip, int *signo, const struct cfgstruct *copt);
int downloaddb(const char *localname, const char *remotename, const char *hostname, char *ip, int *signo, const struct cfgstruct *copt, int usedns);
int wwwconnect(const char *server, const char *proxy, int pport, char *ip);

@ -58,6 +58,7 @@ int main(int argc, char **argv)
{"pid", 1, 0, 'p'},
{"user", 1, 0, 'u'}, /* not used */
{"config-file", 1, 0, 0},
{"no-dns", 0, 0, 0},
{"checks", 1, 0, 'c'},
{"http-proxy", 1, 0, 0},
{"proxy-user", 1, 0, 0},

Loading…
Cancel
Save