X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fconfig%2Fclient-config.c;h=5721755859fa926753b65c48fc77aefe75b129db;hb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;hp=cc776c9b031fba05373703e36369de3e05a1e48f;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;p=ossec-hids.git diff --git a/src/config/client-config.c b/src/config/client-config.c index cc776c9..5721755 100755 --- a/src/config/client-config.c +++ b/src/config/client-config.c @@ -5,7 +5,7 @@ * * 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 */ @@ -16,16 +16,18 @@ #include "os_net/os_net.h" -int Read_Client(XML_NODE node, void *d1, void *d2) +int Read_Client(XML_NODE node, void *d1, void *d2) { int i = 0; - + /* XML definitions */ char *xml_client_ip = "server-ip"; char *xml_client_hostname = "server-hostname"; char *xml_local_ip = "local_ip"; char *xml_client_port = "port"; char *xml_ar_disabled = "disable-active-response"; + /* cmoraes */ + char *xml_profile_name = "config-profile"; agent *logr; @@ -70,7 +72,7 @@ int Read_Client(XML_NODE node, void *d1, void *d2) os_realloc(logr->rip, (ip_id + 2) * sizeof(char*), logr->rip); logr->rip[ip_id] = NULL; logr->rip[ip_id +1] = NULL; - + os_strdup(node[i]->content, logr->rip[ip_id]); if(OS_IsValidIP(logr->rip[ip_id], NULL) != 1) { @@ -98,7 +100,7 @@ int Read_Client(XML_NODE node, void *d1, void *d2) os_realloc(logr->rip, (ip_id + 2) * sizeof(char*), logr->rip); - + s_ip = OS_GetHost(node[i]->content, 5); if(!s_ip) { @@ -108,7 +110,7 @@ int Read_Client(XML_NODE node, void *d1, void *d2) os_strdup("invalid_ip", s_ip); } - + f_ip[127] = '\0'; snprintf(f_ip, 127, "%s/%s", node[i]->content, s_ip); @@ -147,6 +149,12 @@ int Read_Client(XML_NODE node, void *d1, void *d2) return(OS_INVALID); } } + /* cmoraes */ + else if(strcmp(node[i]->element,xml_profile_name) == 0) + { + /* profile name can be anything hence no validation */ + os_strdup(node[i]->content, logr->profile); + } else { merror(XML_INVELEM, ARGV0, node[i]->element);