1 /* @(#) $Id: ./src/analysisd/active-response.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
15 #include "active-response.h"
19 * Initializing active response.
23 ar_commands = OSList_Create();
24 active_responses = OSList_Create();
27 if(!ar_commands || !active_responses)
29 ErrorExit(LIST_ERROR, ARGV0);
34 /** int AR_ReadConfig(int test_config, char *cfgfile)
35 * Reads active response configuration and write them
36 * to the appropriate lists.
38 int AR_ReadConfig(int test_config, char *cfgfile)
46 /* Cleaning ar file */
47 fp = fopen(DEFAULTARPATH, "w");
50 merror(FOPEN_ERROR, ARGV0, DEFAULTARPATH);
53 fprintf(fp, "restart-ossec0 - restart-ossec.sh - 0\n");
54 fprintf(fp, "restart-ossec0 - restart-ossec.cmd - 0\n");
58 /* Setting right permission */
59 chmod(DEFAULTARPATH, 0440);
62 /* Reading configuration */
63 if(ReadConfig(modules, cfgfile, ar_commands, active_responses) < 0)