On Fri, Oct 03, 2008 at 12:27:56PM +0200, Colin Alston said: > I've had enough now, and I want all you ClamAV people to listen up. > > ClamAV has been continuously and repetitively adjusting configuration > options in such a way that breaks anything which is automatically > upgraded just stops working.
Probably the simplest way to get what you want is to submit a bug
(hopefully, with patch) to have the request recorded. It took me about
20 minutes to come up with this:
diff --git a/shared/cfgparser.c b/shared/cfgparser.c
index 169f3fa..51ca549 100644
--- a/shared/cfgparser.c
+++ b/shared/cfgparser.c
@@ -31,6 +31,10 @@
#include "libclamav/str.h"
+struct cfgoption deprecated_cfg_options[] = {
+ {NULL, 0, 0, NULL, 0, 0}
+};
+
struct cfgoption cfg_options[] = {
{"LogFile", OPT_QUOTESTR, -1, NULL, 0, OPT_CLAMD},
{"LogFileUnlock", OPT_BOOL, 0, NULL, 0, OPT_CLAMD},
@@ -141,6 +145,7 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
int line = 0, i, found, ctype, calc, val;
struct cfgstruct *copt = NULL;
struct cfgoption *pt;
+ struct cfgoption *oldpt;
for(i = 0; ; i++) {
@@ -155,6 +160,18 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
}
}
+ for(i = 0; ; i++) {
+ oldpt = &deprecated_cfg_options[i];
+ if(!oldpt->name)
+ break;
+
+ if(regcfg(&copt, oldpt->name, oldpt->strarg ? strdup(oldpt->strarg) :
NULL, oldpt->numarg, oldpt->multiple) < 0) {
+ fprintf(stderr, "ERROR: Can't register new options (not enough
memory)\n");
+ freecfg(copt);
+ return NULL;
+ }
+ }
+
if((fs = fopen(cfgfile, "rb")) == NULL) {
/* do not print error message here! */
freecfg(copt);
@@ -180,6 +197,7 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
found = 0;
for(i = 0; ; i++) {
pt = &cfg_options[i];
+ oldpt = &deprecated_cfg_options[i];
if(pt->name) {
if(!strcmp(name, pt->name)) {
found = 1;
@@ -384,8 +402,14 @@ struct cfgstruct *getcfg(const char *cfgfile, int verbose)
return NULL;
}
}
- } else
- break;
+ } else if(oldpt->name) {
+ if(!strcmp(name, oldpt->name)) {
+ fprintf(stderr, "WARNING: Using deprecated option
at line %d: Option %s is ignored", line, name);
+ found = 1;
+ }
+ } else {
+ break;
+ }
}
if(!found) {
It quite likely has problems (I didn't go further than compiling it, and
I obviously don't put an option on the deprecated list) but hopefully
the gist is clear enough.
This should provide a framework for the clamav team to mark options as
deprecated instead of removing them as they stop working. They'll
probably want to add a way to easily let them know what version an
option was deprecated so they can track and remove them over time, but
my idea for now was just to handle that with comments in the code.
Now, that wasn't so hard, and took substantially less time than all the
arguing.
--
--------------------------------------------------------------------------
| Stephen Gran | So many men; so little time. |
| [EMAIL PROTECTED] | |
| http://www.lobefin.net/~steve | |
--------------------------------------------------------------------------
signature.asc
Description: Digital signature
_______________________________________________ Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net http://www.clamav.net/support/ml
