51
switch(opt->argtype) {
55
if(!nondef || !opt->strarg || strcmp(opt->strarg, cpt->strarg))
56
printf("%s = \"%s\"\n", opt->name, cpt->strarg);
60
if(!nondef || (opt->numarg != cpt->numarg))
61
printf("%s = %u\n", opt->name, cpt->numarg);
64
if(!nondef || (opt->numarg != cpt->numarg))
65
printf("%s = %s\n", opt->name, cpt->enabled ? "yes" : "no");
68
printf("%s: UNKNOWN ARGUMENT TYPE\n", opt->name);
53
switch(opt->argtype) {
57
if(!nondef || !opt->strarg || strcmp(opt->strarg, cpt->strarg))
58
printf("%s = \"%s\"\n", opt->name, cpt->strarg);
62
if(!nondef || (opt->numarg != cpt->numarg))
63
printf("%s = %u\n", opt->name, cpt->numarg);
66
if(!nondef || (opt->numarg != cpt->numarg))
67
printf("%s = %s\n", opt->name, cpt->enabled ? "yes" : "no");
70
printf("%s: UNKNOWN ARGUMENT TYPE\n", opt->name);
176
180
struct cl_cvd *cvd;
178
unsigned int inc = 0;
182
unsigned int cld = 0;
182
186
snprintf(path, sizeof(path), "%s/%s.cvd", dir, db);
183
187
if(access(path, R_OK) == -1) {
184
snprintf(path, sizeof(path), "%s/%s.inc/%s.info", dir, db, db);
188
snprintf(path, sizeof(path), "%s/%s.cld", dir, db);
186
190
if(access(path, R_OK) == -1) {
187
191
printf("%s db: Not found\n", db);
192
196
if((cvd = cl_cvdhead(path))) {
193
197
t = (time_t) cvd->stime;
194
printf("%s db: Format: %s, Version: %u, Build time: %s", db, inc ? ".inc" : ".cvd", cvd->version, ctime(&t));
198
printf("%s db: Format: %s, Version: %u, Build time: %s", db, cld ? ".cld" : ".cvd", cvd->version, ctime(&t));
203
static void version(void)
205
printf("Clam AntiVirus Configuration Tool %s\n", get_version());
199
208
static void help(void)
202
printf(" Clam AntiVirus: Configuration Tool "VERSION"\n");
211
printf(" Clam AntiVirus: Configuration Tool %s\n", get_version());
203
212
printf(" (C) 2006 - 2007 ClamAV Team - http://www.clamav.net/team\n\n");
205
214
printf(" --help -h show help\n");
215
printf(" --version -v show version\n");
206
216
printf(" --config-dir DIR -c DIR search for config files in DIR\n");
207
217
printf(" --non-default -n only print non-default settings\n");
223
#define REPO_VERSION VERSION
211
226
int main(int argc, char **argv)
215
230
int ret, opt_index, nondef = 0;
216
const char *getopt_parameters = "hc:n";
231
const char *getopt_parameters = "hVc:n";
217
232
static struct option long_options[] = {
218
233
{"help", 0, 0, 'h'},
234
{"version", 0, 0, 'V'},
219
235
{"config-dir", 1, 0, 'c'},
220
236
{"non-default", 0, 0, 'n'},
280
301
printf("------------------------------\n");
282
303
#ifdef CL_EXPERIMENTAL
283
printf("Engine version: "VERSION" (with experimental code)\n");
304
printf("Engine version: %s (with experimental code)\n", get_version());
285
printf("Engine version: "VERSION"\n");
306
printf("Engine version: %s\n", get_version());
288
if(strcmp(VERSION, cl_retver()))
289
printf("WARNING: Version mismatch: clamconf: "VERSION", libclamav: %s\n", cl_retver());
309
if(strcmp(REPO_VERSION, cl_retver()))
310
printf("WARNING: Version mismatch: clamconf: "REPO_VERSION", libclamav: %s\n", cl_retver());
291
312
printf("Database directory: ");
292
313
dbdir = freshdbdir();