-/* @(#) $Id: config.c,v 1.32 2009/11/04 15:19:00 dcid Exp $ */
+/* @(#) $Id: ./src/syscheckd/config.c, 2011/09/08 dcid Exp $
+ */
/* Copyright (C) 2009 Trend Micro Inc.
* All right reserved.
*
* This program is a free software; you can redistribute it
* and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
* Foundation
*/
#include "syscheck.h"
#include "config/config.h"
+char *SYSCHECK_EMPTY[] = { NULL };
+
int Read_Syscheck_Config(char * cfgfile)
{
int modules = 0;
syscheck.registry = NULL;
syscheck.reg_fp = NULL;
#endif
+ syscheck.prefilter_cmd = NULL;
+
+ debug2("%s: Reading Configuration [%s]", "syscheckd", cfgfile);
/* Reading config */
if(ReadConfig(modules, cfgfile, &syscheck, NULL) < 0)
#ifdef CLIENT
+ debug2("%s: Reading Client Configuration [%s]", "syscheckd", cfgfile);
+
/* Reading shared config */
modules|= CAGENT_CONFIG;
ReadConfig(modules, AGENTCONFIG, &syscheck, NULL);
#endif
-
+
+ #ifndef WIN32
/* We must have at least one directory to check */
if(!syscheck.dir || syscheck.dir[0] == NULL)
{
return(1);
}
-
+
+ #else
+ /* We must have at least one directory or registry key to check. Since
+ it's possible on Windows to have syscheck enabled but only monitoring
+ either the filesystem or the registry, both lists must be valid,
+ even if empty.
+ */
+ if(!syscheck.dir) syscheck.dir = SYSCHECK_EMPTY;
+ if(!syscheck.registry) syscheck.registry = SYSCHECK_EMPTY;
+
+ if((syscheck.dir[0] == NULL) && (syscheck.registry[0] == NULL))
+ {
+ return(1);
+ }
+ #endif
+
return(0);
}