shared/cfgparser.c, clamdconf: gently deprecate obsolete options (bb#1213)

git-svn: trunk@4231
0.95
Tomasz Kojm 17 years ago
parent aa9a0f4b75
commit dec7ffce08
  1. 4
      ChangeLog
  2. 4
      clamconf/clamconf.c
  3. 12
      shared/cfgparser.c
  4. 1
      shared/cfgparser.h

@ -1,3 +1,7 @@
Tue Oct 7 19:18:16 CEST 2008 (tk)
----------------------------------
* shared/cfgparser.c, clamdconf: gently deprecate obsolete options (bb#1213)
Tue Oct 7 15:52:06 CEST 2008 (acab)
------------------------------------
* misc: add missing EOL to dbg/warn messages - bb#1219

@ -50,7 +50,9 @@ static void printopt(const struct cfgoption *opt, const struct cfgstruct *cpt, i
}
while(cpt) {
switch(opt->argtype) {
if(opt->owner & OPT_DEPRECATED) {
printf("*** %s is DEPRECATED ***\n", opt->name);
} else switch(opt->argtype) {
case OPT_STR:
case OPT_FULLSTR:
case OPT_QUOTESTR:

@ -129,6 +129,14 @@ struct cfgoption cfg_options[] = {
{"DevACOnly", OPT_BOOL, -1, NULL, 0, OPT_CLAMD},
{"DevACDepth", OPT_NUM, -1, NULL, 0, OPT_CLAMD},
/* Deprecated options */
{"MailMaxRecursion", OPT_NUM, 64, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{"ArchiveMaxFileSize", OPT_COMPSIZE, 10485760, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{"ArchiveMaxRecursion", OPT_NUM, 8, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{"ArchiveMaxFiles", OPT_NUM, 1000, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{"ArchiveMaxCompressionRatio", OPT_NUM, 250, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{"ArchiveBlockMax", OPT_BOOL, 0, NULL, 0, OPT_CLAMD | OPT_DEPRECATED},
{NULL, 0, 0, NULL, 0, 0}
};
@ -183,6 +191,10 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
if(pt->name) {
if(!strcmp(name, pt->name)) {
found = 1;
if(pt->owner & OPT_DEPRECATED) {
fprintf(stderr, "WARNING: Ignoring deprecated option %s at line %u\n", pt->name, line);
break;
}
switch(pt->argtype) {
case OPT_STR:
/* deprecated. Use OPT_QUOTESTR instead since it behaves like this, but supports quotes to allow values to contain whitespace */

@ -31,6 +31,7 @@
#define OPT_CLAMD 1
#define OPT_FRESHCLAM 2
#define OPT_DEPRECATED 4
struct cfgoption {
const char *name;

Loading…
Cancel
Save