projects
/
ossec-hids.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dodan override za lintian
[ossec-hids.git]
/
src
/
config
/
agentlessd-config.c
diff --git
a/src/config/agentlessd-config.c
b/src/config/agentlessd-config.c
index
7157091
..
6694126
100644
(file)
--- a/
src/config/agentlessd-config.c
+++ b/
src/config/agentlessd-config.c
@@
-1,11
+1,12
@@
-/* @(#) $Id: agentlessd-config.c,v 1.6 2009/06/24 17:06:24 dcid Exp $ */
+/* @(#) $Id: ./src/config/agentlessd-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
/* 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
*/
* Foundation
*/
@@
-33,7
+34,7
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
agentlessd_config *lessd_config = (agentlessd_config *)config;
agentlessd_config *lessd_config = (agentlessd_config *)config;
-
+
/* Getting any configured entry. */
if(lessd_config->entries)
{
/* Getting any configured entry. */
if(lessd_config->entries)
{
@@
-41,9
+42,9
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
s++;
}
s++;
}
-
+
/* Allocating the memory for the config. */
/* Allocating the memory for the config. */
- os_realloc(lessd_config->entries, (s + 2) * sizeof(agentlessd_entries *),
+ os_realloc(lessd_config->entries, (s + 2) * sizeof(agentlessd_entries *),
lessd_config->entries);
os_calloc(1, sizeof(agentlessd_entries), lessd_config->entries[s]);
lessd_config->entries[s + 1] = NULL;
lessd_config->entries);
os_calloc(1, sizeof(agentlessd_entries), lessd_config->entries[s]);
lessd_config->entries[s + 1] = NULL;
@@
-60,7
+61,7
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
lessd_config->entries[s]->port = 0;
lessd_config->entries[s]->error_flag = 0;
lessd_config->entries[s]->port = 0;
lessd_config->entries[s]->error_flag = 0;
-
+
/* Reading the XML. */
while(node[i])
{
/* Reading the XML. */
while(node[i])
{
@@
-98,7
+99,7
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
{
char s_content[1024 +1];
s_content[1024] = '\0';
{
char s_content[1024 +1];
s_content[1024] = '\0';
-
+
/* Getting any configured entry. */
j = 0;
if(lessd_config->entries[s]->server)
/* Getting any configured entry. */
j = 0;
if(lessd_config->entries[s]->server)
@@
-107,8
+108,8
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
j++;
}
j++;
}
- os_realloc(lessd_config->entries[s]->server, (j + 2) *
- sizeof(char *),
+ os_realloc(lessd_config->entries[s]->server, (j + 2) *
+ sizeof(char *),
lessd_config->entries[s]->server);
if(strncmp(node[i]->content, "use_su ", 7) == 0)
{
lessd_config->entries[s]->server);
if(strncmp(node[i]->content, "use_su ", 7) == 0)
{
@@
-122,8
+123,8
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
{
snprintf(s_content, 1024, " %s", node[i]->content);
}
{
snprintf(s_content, 1024, " %s", node[i]->content);
}
-
- os_strdup(s_content,
+
+ os_strdup(s_content,
lessd_config->entries[s]->server[j]);
lessd_config->entries[s]->server[j + 1] = NULL;
}
lessd_config->entries[s]->server[j]);
lessd_config->entries[s]->server[j + 1] = NULL;
}
@@
-134,11
+135,11
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
script_path[1024] = '\0';
snprintf(script_path, 1024, "%s/%s", AGENTLESSDIRPATH,
node[i]->content);
script_path[1024] = '\0';
snprintf(script_path, 1024, "%s/%s", AGENTLESSDIRPATH,
node[i]->content);
-
+
if(File_DateofChange(script_path) <= 0)
{
merror("%s: ERROR: Unable to find '%s' at '%s'.",
if(File_DateofChange(script_path) <= 0)
{
merror("%s: ERROR: Unable to find '%s' at '%s'.",
- ARGV0, node[i]->content, AGENTLESSDIRPATH);
+ ARGV0, node[i]->content, AGENTLESSDIRPATH);
merror(XML_VALUEERR,ARGV0, node[i]->element, node[i]->content);
return(OS_INVALID);
}
merror(XML_VALUEERR,ARGV0, node[i]->element, node[i]->content);
return(OS_INVALID);
}
@@
-190,8
+191,8
@@
int Read_CAgentless(XML_NODE node, void *config, void *config2)
merror(XML_INV_MISSOPTS, ARGV0);
return(OS_INVALID);
}
merror(XML_INV_MISSOPTS, ARGV0);
return(OS_INVALID);
}
-
-
+
+
if((lessd_config->entries[s]->state == LESSD_STATE_PERIODIC) &&
!lessd_config->entries[s]->frequency)
{
if((lessd_config->entries[s]->state == LESSD_STATE_PERIODIC) &&
!lessd_config->entries[s]->frequency)
{