1 /* @(#) $Id: ./src/syscheckd/config.c, 2011/09/08 dcid Exp $
4 /* Copyright (C) 2009 Trend Micro Inc.
7 * This program is a free software; you can redistribute it
8 * and/or modify it under the terms of the GNU General Public
9 * License (version 2) as published by the FSF - Free Software
16 #include "config/config.h"
18 char *SYSCHECK_EMPTY[] = { NULL };
20 int Read_Syscheck_Config(char * cfgfile)
26 syscheck.rootcheck = 0;
27 syscheck.disabled = 0;
28 syscheck.scan_on_start = 1;
29 syscheck.time = SYSCHECK_WAIT * 2;
30 syscheck.ignore = NULL;
31 syscheck.ignore_regex = NULL;
32 syscheck.scan_day = NULL;
33 syscheck.scan_time = NULL;
36 syscheck.realtime = NULL;
38 syscheck.registry = NULL;
39 syscheck.reg_fp = NULL;
41 syscheck.prefilter_cmd = NULL;
44 debug2("%s: Reading Configuration [%s]", "syscheckd", cfgfile);
47 if(ReadConfig(modules, cfgfile, &syscheck, NULL) < 0)
52 debug2("%s: Reading Client Configuration [%s]", "syscheckd", cfgfile);
54 /* Reading shared config */
55 modules|= CAGENT_CONFIG;
56 ReadConfig(modules, AGENTCONFIG, &syscheck, NULL);
61 /* We must have at least one directory to check */
62 if(!syscheck.dir || syscheck.dir[0] == NULL)
68 /* We must have at least one directory or registry key to check. Since
69 it's possible on Windows to have syscheck enabled but only monitoring
70 either the filesystem or the registry, both lists must be valid,
73 if(!syscheck.dir) syscheck.dir = SYSCHECK_EMPTY;
74 if(!syscheck.registry) syscheck.registry = SYSCHECK_EMPTY;
76 if((syscheck.dir[0] == NULL) && (syscheck.registry[0] == NULL))