Merge branch '104-group-security' into 'develop'
104 group security Parte open de la seguridad de grupos. See merge request !2
This commit is contained in:
commit
44f60994aa
|
@ -135,6 +135,7 @@ my %DefaultConf = (
|
||||||
'agent_name_cmd' => '',
|
'agent_name_cmd' => '',
|
||||||
'description' => '',
|
'description' => '',
|
||||||
'group' => '',
|
'group' => '',
|
||||||
|
'group_password' => undef,
|
||||||
'encoding' => 'UTF-8',
|
'encoding' => 'UTF-8',
|
||||||
'server_port' => 41121,
|
'server_port' => 41121,
|
||||||
'transfer_mode' => 'tentacle',
|
'transfer_mode' => 'tentacle',
|
||||||
|
@ -2419,7 +2420,8 @@ while (1) {
|
||||||
|
|
||||||
# Compose the XML
|
# Compose the XML
|
||||||
my $xml_header = "<?xml version='1.0' encoding='" . $Conf{'encoding'} . "'?>\n" .
|
my $xml_header = "<?xml version='1.0' encoding='" . $Conf{'encoding'} . "'?>\n" .
|
||||||
"<agent_data description='" . $Conf{'description'} ."' group='" . $Conf{'group'} .
|
"<agent_data description='" . $Conf{'description'} . "' group='" . $Conf{'group'} .
|
||||||
|
(defined($Conf{'group_password'}) ? ("' group_password='" . $Conf{'group_password'}) : '') .
|
||||||
"' os_name='$OS' os_version='$OS_VERSION' interval='" . $Conf{'interval'} .
|
"' os_name='$OS' os_version='$OS_VERSION' interval='" . $Conf{'interval'} .
|
||||||
"' version='" . AGENT_VERSION . '(Build ' . AGENT_BUILD . ')' . ($Conf{'autotime'} eq '1' ? '' : "' timestamp='" . strftime ('%Y/%m/%d %H:%M:%S', localtime ())) .
|
"' version='" . AGENT_VERSION . '(Build ' . AGENT_BUILD . ')' . ($Conf{'autotime'} eq '1' ? '' : "' timestamp='" . strftime ('%Y/%m/%d %H:%M:%S', localtime ())) .
|
||||||
"' agent_name='" . $Conf{'agent_name'} . "' timezone_offset='". $Conf{'timezone_offset'} .
|
"' agent_name='" . $Conf{'agent_name'} . "' timezone_offset='". $Conf{'timezone_offset'} .
|
||||||
|
|
|
@ -385,6 +385,7 @@ Pandora_Windows_Service::getXmlHeader () {
|
||||||
char timestamp[20];
|
char timestamp[20];
|
||||||
string agent_name, os_name, os_version, encoding, value, xml, address, parent_agent_name, agent_name_cmd;
|
string agent_name, os_name, os_version, encoding, value, xml, address, parent_agent_name, agent_name_cmd;
|
||||||
string custom_id, url_address, latitude, longitude, altitude, position_description, gis_exec, gis_result, agent_mode;
|
string custom_id, url_address, latitude, longitude, altitude, position_description, gis_exec, gis_result, agent_mode;
|
||||||
|
string group_password;
|
||||||
time_t ctime;
|
time_t ctime;
|
||||||
struct tm *ctime_tm = NULL;
|
struct tm *ctime_tm = NULL;
|
||||||
int pos;
|
int pos;
|
||||||
|
@ -478,6 +479,13 @@ Pandora_Windows_Service::getXmlHeader () {
|
||||||
xml += url_address;
|
xml += url_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get Url Address
|
||||||
|
group_password = conf->getValue ("group_password");
|
||||||
|
if (group_password != "") {
|
||||||
|
xml += "\" group_password=\"";
|
||||||
|
xml += group_password;
|
||||||
|
}
|
||||||
|
|
||||||
// Get Coordinates
|
// Get Coordinates
|
||||||
gis_exec = conf->getValue ("gis_exec");
|
gis_exec = conf->getValue ("gis_exec");
|
||||||
|
|
||||||
|
|
|
@ -358,6 +358,13 @@ sub process_xml_data ($$$$$) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check the group password.
|
||||||
|
my $rc = enterprise_hook('check_group_password', [$dbh, $group_id, $data->{'group_password'}]);
|
||||||
|
if (defined($rc) && $rc != 1) {
|
||||||
|
logger($pa_config, "Agent $agent_name did not send a valid password for group id $group_id.", 10);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
my $description = '';
|
my $description = '';
|
||||||
$description = $data->{'description'} if (defined ($data->{'description'}));
|
$description = $data->{'description'} if (defined ($data->{'description'}));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue