summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: be54dc6)
raw | patch | inline | side by side (parent: be54dc6)
author | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 May 2009 13:53:24 +0000 (13:53 +0000) | ||
committer | janw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 May 2009 13:53:24 +0000 (13:53 +0000) |
Fixed typos.
Fixed sql statements.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13606 594d385d-05f5-0310-b6e9-bd551577e9d8
Fixed sql statements.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13606 594d385d-05f5-0310-b6e9-bd551577e9d8
index 03a55ec9a5408f2c25eb4d1a93a2eb2073cececd..7780d2adc68ea6cdb73440631baec7d0c186bd7a 100644 (file)
}
sub get_module_info {
- my ($ldap_handle) = @_;
my @info = (undef, undef);
&local_read_configfile();
index b746316cbe528db5cd7e568c6f6e8f2abde9e3a8..62662fa3bdfacd99c460bb7a5e0d49ed00eed151 100644 (file)
# DESCRIPTION: handels the proceeded distribution to the appropriated functions
#===============================================================================
sub process_incoming_msg {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_ ;
+ my ($msg, $msg_hash, $session_id) = @_ ;
my $error = 0;
my $host_name;
my $host_key;
if( 0 == length @target_l){
&main::daemon_log("$session_id ERROR: no target specified for msg $header", 1);
$error++;
- }
-
- if( 1 == length @target_l) {
+ } elsif( 1 == length @target_l) {
my $target = $target_l[0];
if(&server_matches($target)) {
if ($header eq 'new_key') {
@out_msg_l = &new_key($msg_hash)
} elsif ($header eq 'here_i_am') {
- @out_msg_l = &here_i_am($msg, $msg_hash, $session_id, $ldap_handle)
+ @out_msg_l = &here_i_am($msg, $msg_hash, $session_id)
} else {
# a event exists with the header as name
if( exists $event2module_hash->{$header} ) {
&main::daemon_log("$session_id INFO: found event '$header' at event-module '".$event2module_hash->{$header}."'", 5);
no strict 'refs';
- @out_msg_l = &{$event2module_hash->{$header}."::$header"}($msg, $msg_hash, $session_id, $ldap_handle);
+ @out_msg_l = &{$event2module_hash->{$header}."::$header"}($msg, $msg_hash, $session_id);
# if no event handler is implemented
} else {
&main::daemon_log("$session_id ERROR: client '$target' is not registered for event '$header', processing is aborted", 1);
@out_msg_l = ();
}
-
-
-
-
- }
- else {
+ } else {
&main::daemon_log("INFO: msg is not for gosa-si-server '$server_address', deliver it to target '$target'", 5);
push(@out_msg_l, $msg);
}
# DESCRIPTION: process this incoming message
#===============================================================================
sub here_i_am {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my @out_msg_l;
my $out_hash;
my $source = @{$msg_hash->{source}}[0];
# give the new client his ldap config
# Workaround: Send within the registration response, if the client will get an ldap config later
- my $new_ldap_config_out = &new_ldap_config($source, $session_id, $ldap_handle);
+ my $new_ldap_config_out = &new_ldap_config($source, $session_id);
if($new_ldap_config_out && (!($new_ldap_config_out =~ /error/))) {
&add_content2xml_hash($out_hash, "ldap_available", "true");
} elsif($new_ldap_config_out && $new_ldap_config_out =~ /error/){
}
# Send client hardware configuration
- my $hardware_config_out = &hardware_config($msg, $msg_hash, $session_id, $ldap_handle);
+ my $hardware_config_out = &hardware_config($msg, $msg_hash, $session_id);
if( $hardware_config_out ) {
push(@out_msg_l, $hardware_config_out);
}
# Send client ntp server
- my $ntp_config_out = &new_ntp_config($mac_address, $session_id, $ldap_handle);
+ my $ntp_config_out = &new_ntp_config($mac_address, $session_id);
if ($ntp_config_out) {
push(@out_msg_l, $ntp_config_out);
}
# Send client syslog server
- my $syslog_config_out = &new_syslog_config($mac_address, $session_id, $ldap_handle);
+ my $syslog_config_out = &new_syslog_config($mac_address, $session_id);
if ($syslog_config_out) {
push(@out_msg_l, $syslog_config_out);
}
sub new_syslog_config {
- my ($mac_address, $session_id, $ldap_handle) = @_;
+ my ($mac_address, $session_id) = @_;
my $syslog_msg;
+ my $ldap_handle=&main::get_ldap_handle();
# Perform search
my $ldap_res = $ldap_handle->search( base => $ldap_base,
filter => "(&(objectClass=GOhard)(macaddress=$mac_address))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: gotoSyslogServer".
"\n\tfilter: (&(objectClass=GOhard)(macaddress=$mac_address))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: gotoSyslogServer".
"\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
# Return if no syslog server specified
if (not defined $syslog_server) {
&main::daemon_log("$session_id WARNING: no syslog server specified for this host '$mac_address'", 3);
+ &main::release_ldap_handle($ldap_handle);
return;
}
my $syslog_msg_hash = &create_xml_hash("new_syslog_config", $server_address, $mac_address);
&add_content2xml_hash($syslog_msg_hash, "server", $syslog_server);
+ &main::release_ldap_handle($ldap_handle);
return &create_xml_string($syslog_msg_hash);
}
sub new_ntp_config {
- my ($address, $session_id, $ldap_handle) = @_;
+ my ($address, $session_id) = @_;
my $ntp_msg;
+ my $ldap_handle=&main::get_ldap_handle();
# Perform search
my $ldap_res = $ldap_handle->search( base => $ldap_base,
filter => "(&(objectClass=GOhard)(macaddress=$address))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: gotoNtpServer".
"\n\tfilter: (&(objectClass=GOhard)(macaddress=$address))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($ldap_res->code) {
&main::daemon_log("$session_id ".$ldap_res->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: gotoNtpServer".
"\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
# Return if no ntp server specified
if ((not @ntp_servers) || (@ntp_servers == 0)) {
&main::daemon_log("$session_id WARNING: no ntp server specified for this host '$address'", 3);
+ &main::release_ldap_handle($ldap_handle);
return;
}
&add_content2xml_hash($ntp_msg_hash, "server", $ntp_server);
}
+ &main::release_ldap_handle($ldap_handle);
return &create_xml_string($ntp_msg_hash);
}
# DESCRIPTION: send to address the ldap configuration found for dn gotoLdapServer
#===============================================================================
sub new_ldap_config {
- my ($address, $session_id, $ldap_handle) = @_ ;
+ my ($address, $session_id) = @_ ;
my $sql_statement= "SELECT * FROM known_clients WHERE hostname='$address' OR macaddress LIKE '$address'";
my $res = $main::known_clients_db->select_dbentry( $sql_statement );
my $hit_counter = keys %{$res};
if( not $hit_counter == 1 ) {
&main::daemon_log("$session_id ERROR: more or no hit found in known_clients_db by query '$sql_statement'", 1);
+ return;
}
$address = $res->{1}->{hostname};
my $macaddress = $res->{1}->{macaddress};
my $hostkey = $res->{1}->{hostkey};
-
+
if (not defined $macaddress) {
&main::daemon_log("$session_id ERROR: no mac address found for client $address", 1);
return;
}
# Perform search
+ my $ldap_handle=&main::get_ldap_handle();
$mesg = $ldap_handle->search( base => $ldap_base,
scope => 'sub',
attrs => ['dn', 'gotoLdapServer', 'gosaUnitTag', 'FAIclass'],
filter => "(&(objectClass=GOhard)(macaddress=$macaddress))");
if($mesg->code) {
&main::daemon_log("$session_id ".$mesg->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: dn, gotoLdapServer".
"\n\tfilter: (&(objectClass=GOhard)(macaddress=$macaddress))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
filter => "(&(objectClass=gosaGroupOfNames)(member=$filter_dn))");
if($mesg->code) {
&main::daemon_log("$session_id ERROR: unable to search for '(&(objectClass=gosaGroupOfNames)(member=$filter_dn))': ".$mesg->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
"\n\tscope: sub".
"\n\tattrs: dn, gotoLdapServer, FAIclass".
"\n\tfilter: (&(objectClass=gosaGroupOfNames)(member=$filter_dn))", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
#$mesg->code && die $mesg->error;
if($mesg->code) {
&main::daemon_log($mesg->error, 1);
+ &main::release_ldap_handle($ldap_handle);
return "error-unit-tag-count-0";
}
# Sanity check
if ($mesg->count != 1) {
&main::daemon_log("WARNING: cannot find administrative unit for client with tag $unit_tag", 1);
+ &main::release_ldap_handle($ldap_handle);
return "error-unit-tag-count-".$mesg->count;
}
# Append unit Tag
$data{'unit_tag'}= $unit_tag;
}
+ &main::release_ldap_handle($ldap_handle);
# Send information
return &build_msg("new_ldap_config", $server_address, $address, \%data);
# DESCRIPTION:
#===============================================================================
sub hardware_config {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_ ;
+ my ($msg, $msg_hash, $session_id) = @_ ;
my $address = @{$msg_hash->{source}}[0];
my $header = @{$msg_hash->{header}}[0];
my $gotoHardwareChecksum = @{$msg_hash->{gotoHardwareChecksum}}[0];
}
# Perform search
+ my $ldap_handle=&main::get_ldap_handle();
$mesg = $ldap_handle->search(
base => $ldap_base,
scope => 'sub',
}
} else {
# Nothing to do
+ &main::release_ldap_handle($ldap_handle);
return;
}
}
$data{'goto_secret'}= $goto_secret;
}
+ &main::release_ldap_handle($ldap_handle);
+
# Send information
return &build_msg("detect_hardware", $server_address, $address, \%data);
}
index 1677bf942d8b94c83c695b01c26b1f8ae711f13e..4a7e8ce8803c228a598ca47d69d93081f78ee7e8 100644 (file)
# DESCRIPTION: handels the proceeded distribution to the appropriated functions
#===============================================================================
sub process_incoming_msg {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_ ;
+ my ($msg, $msg_hash, $session_id) = @_ ;
my $header = @{$msg_hash->{header}}[0];
my @msg_l;
my @out_msg_l;
&main::daemon_log("$session_id DEBUG: GosaPackages: msg to process '$header'", 7);
if ($header =~ /^job_/) {
- @msg_l = &process_job_msg($msg, $msg_hash, $session_id, $ldap_handle);
+ @msg_l = &process_job_msg($msg, $msg_hash, $session_id);
}
elsif ($header =~ /^gosa_/) {
- @msg_l = &process_gosa_msg($msg, $msg_hash, $session_id, $ldap_handle);
+ @msg_l = &process_gosa_msg($msg, $msg_hash, $session_id);
}
else {
&main::daemon_log("$session_id ERROR: $header is not a valid GosaPackage-header, need a 'job_' or a 'gosa_' prefix", 1);
sub process_gosa_msg {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_ ;
+ my ($msg, $msg_hash, $session_id) = @_ ;
my $out_msg;
my @out_msg_l = ('nohandler');
my $sql_events;
# a event exists with the header as name
&main::daemon_log("$session_id INFO: found event '$header' at event-module '".$event2module_hash->{$header}."'", 5);
no strict 'refs';
- @out_msg_l = &{$event2module_hash->{$header}."::$header"}( $msg, $msg_hash, $session_id, $ldap_handle );
+ @out_msg_l = &{$event2module_hash->{$header}."::$header"}( $msg, $msg_hash, $session_id );
# check client registered events
} else {
sub process_job_msg {
- my ($msg, $msg_hash, $session_id, $ldap_handle)= @_ ;
+ my ($msg, $msg_hash, $session_id)= @_ ;
my $out_msg;
my $error = 0;
$header = "trigger_action_reinstall"
}
- } else { # Try to determine plain_name via ladp search
+ } else { # Try to determine plain_name via ldap search
+ my $ldap_handle=&main::get_ldap_handle();
my $mesg = $ldap_handle->search(
base => $main::ldap_base,
scope => 'sub',
my $entry= $mesg->entry(0);
$plain_name = $entry->get_value("cn");
}
+ &main::release_ldap_handle($ldap_handle);
}
# Add job to job queue
index 6fa3d1c339f98a2cafb87ca84902206724c74ce9..a535c5adbefc11b49eae12fa0dfffa812616e87f 100644 (file)
# @param msg_hash - HASHREF - message information parsed into a hash
# @param session_id - INTEGER - POE session id of the processing of this message
sub LOGIN {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
my $login = @{$msg_hash->{$header}}[0];
my $error_str;
# Invoke set_last_system; message sets ldap attributes 'gotoLastSystemLogin' and 'gotoLastSystem'
- $res = &set_last_system($msg, $msg_hash, $session_id, $ldap_handle);
+ $res = &set_last_system($msg, $msg_hash, $session_id);
# Add user to login_users_db
my %add_hash = ( table=>$main::login_users_tn,
# @param msg_hash - HASHREF - message information parsed into a hash
# @param session_id - INTEGER - POE session id of the processing of this message
sub CURRENTLY_LOGGED_IN {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my ($sql_statement, $db_res);
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
}
# Invoke set_last_system; message sets ldap attributes 'gotoLastSystemLogin' and 'gotoLastSystem'
- my $res = &set_last_system($msg, $msg_hash, $session_id, $ldap_handle);
+ my $res = &set_last_system($msg, $msg_hash, $session_id);
# fetch all user currently assigned to the client at login_users_db
my %currently_logged_in_user = ();
# @param msg_hash - HASHREF - message information parsed into a hash
# @param session_id - INTEGER - POE session id of the processing of this message
sub set_last_system {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
my $login = @{$msg_hash->{$header}}[0];
}
# Get system info
+ my $ldap_handle=&main::get_ldap_handle($session_id);
my $ldap_mesg= $ldap_handle->search(
base => $main::ldap_base,
scope => 'sub',
if ($ldap_mesg->count == 0) {
&main::daemon_log("$session_id ERROR: no system with mac address='$mac' was found in base '".
$main::ldap_base."', setting of 'gotoLastSystem' and 'gotoLastSystemLogin' stopped!", 1);
+ &main::release_ldap_handle($ldap_handle);
return;
}
}
}
}
+ &main::release_ldap_handle($ldap_handle);
return;
}
# @param msg_hash - HASHREF - message information parsed into a hash
# @param session_id - INTEGER - POE session id of the processing of this message
sub TASKBEGIN {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my $header = @{$msg_hash->{'header'}}[0];
my $source = @{$msg_hash->{'source'}}[0];
my $target = @{$msg_hash->{'target'}}[0];
# in case of no and more than one running jobs in queue, add one single job
# resolve plain name for host $macaddress
my $plain_name;
+ my $ldap_handle=&main::get_ldap_handle($session_id);
my $mesg = $ldap_handle->search(
base => $main::ldap_base,
scope => 'sub',
&main::daemon_log($mesg->error, 1);
$plain_name = "none";
}
+ &main::release_ldap_handle($ldap_handle);
# In any case add a new job to job queue
&main::daemon_log("$session_id DEBUG: add job to queue for host '$macaddress'", 7);
index 1c3287eb03c4e935acb7bb3549c326a58cc9e017..9cf0852c73bdddaf24d4e18bcfab4f7ae3c4d60f 100644 (file)
}
sub trigger_activate_new {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my $source = @{$msg_hash->{'source'}}[0];
my $target = @{$msg_hash->{'target'}}[0];
my $changed_attributes_counter = 0;
my $activate_client = 0;
+ my $ldap_handle=&main::get_ldap_handle();
if(defined($ogroup)) {
my $ldap_mesg= $ldap_handle->search(
&main::daemon_log("$session_id DEBUG: A GosaGroupOfNames with cn '$ogroup' was found in base '".$main::ldap_base."'!", 5);
} elsif ($ldap_mesg->count == 0) {
&main::daemon_log("$session_id ERROR: A GosaGroupOfNames with cn '$ogroup' was not found in base '".$main::ldap_base."'!", 1);
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".(&calc_timestamp(&get_time(), 'plus', 10))."' WHERE id = $jobdb_id");
+ $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' WHERE id = $jobdb_id");
+ &main::release_ldap_handle($ldap_handle);
return undef;
} else {
&main::daemon_log("$session_id ERROR: More than one ObjectGroups with cn '$ogroup' was found in base '".$main::ldap_base."'!", 1);
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting' WHERE id = $jobdb_id");
- $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET timestamp = '".(&calc_timestamp(&get_time(), 'plus', 10))."' WHERE id = $jobdb_id");
+ $main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' WHERE id = $jobdb_id");
+ &main::release_ldap_handle($ldap_handle);
return undef;
}
# To prevent replication problems just re-queue the job with 10 seconds in the future
my $moddn_result = $ldap_entry->update($ldap_handle);
if ($moddn_result->code() != 0) {
- my $error_string = "Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!";
- &main::daemon_log("$session_id ERROR: $error_string", 1);
- my $sql = "UPDATE $main::job_queue_tn SET status='error', result='$error_string' WHERE id=$jobdb_id";
- return undef;
+ my $error_string = "Moving the system with mac address '$mac' to new base '$base' failed (code '".$moddn_result->code()."') with '".$moddn_result->{'errorMessage'}."'!";
+ &main::daemon_log("$session_id ERROR: $error_string", 1);
+ my $sql = "UPDATE $main::job_queue_tn SET status='error', result='$error_string' WHERE id=$jobdb_id";
+ &main::release_ldap_handle($ldap_handle);
+ return undef;
} else {
&main::daemon_log("$session_id INFO: System with mac address '$mac' was moved to base '".$main::ldap_base."'! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 10))."' WHERE id = $jobdb_id");
+ &main::release_ldap_handle($ldap_handle);
return undef;
}
}
" SET status='waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' ".
" WHERE id = $jobdb_id";
$main::job_db->exec_statement($sql_statement);
+ &main::release_ldap_handle($ldap_handle);
return undef;
}
# $ldap_entry->dn("cn=$mac,$base");
&main::daemon_log("$session_id WARNING: No System with mac address '$mac' was found in base '".$main::ldap_base."'! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' WHERE id = $jobdb_id");
+ &main::release_ldap_handle($ldap_handle);
return undef;
} else {
&main::daemon_log("$session_id ERROR: More than one system with mac address '$mac' was found in base '".$main::ldap_base."'!", 1);
}
if($activate_client == 1) {
- &main::daemon_log("$session_id DEBIG: Activating system with mac address '$mac'!", 5);
+ &main::daemon_log("$session_id DEBUG: Activating system with mac address '$mac'!", 5);
# Create delivery list
my @out_msg_l;
push(@out_msg_l, $out_msg);
# Return delivery list of messages
+ &main::release_ldap_handle($ldap_handle);
return @out_msg_l;
} else {
&main::daemon_log("$session_id WARNING: Activating system with mac address '$mac' failed! Re-queuing job.", 4);
$main::job_db->exec_statement("UPDATE ".$main::job_queue_tn." SET status = 'waiting', timestamp = '".(&calc_timestamp(&get_time(), 'plus', 60))."' WHERE id = $jobdb_id");
}
+ &main::release_ldap_handle($ldap_handle);
return undef;
}
index d13ec6fa0fbf9b00c23ab595cbf5b8c81b14f993..e4493282d1b224feba7a9794add3c17cadf912eb 100644 (file)
sub detected_hardware {
- my ($msg, $msg_hash, $session_id, $ldap_handle) = @_;
+ my ($msg, $msg_hash, $session_id) = @_;
my $address = $msg_hash->{source}[0];
my $header = $msg_hash->{header}[0];
my $gotoHardwareChecksum= $msg_hash->{detected_hardware}[0]->{gotoHardwareChecksum};
}
# Perform search
+ my $ldap_handle = &main::get_ldap_handle();
$mesg = $ldap_handle->search(
base => $ldap_base,
scope => 'sub',
if(defined($res->{'errorMessage'}) &&
length($res->{'errorMessage'}) >0) {
&main::daemon_log("ERROR: can not add entries to LDAP: ".$res->{'errorMessage'}, 1);
+ &main::release_ldap_handle($ldap_handle);
return;
} else {
# Fill $mesg again
# if there is a job in job queue for this host and this macaddress, delete it, cause its no longer used
my $del_sql = "DELETE FROM $main::job_queue_tn WHERE (macaddress LIKE '$macaddress' AND headertag='$header')";
my $del_res = $main::job_db->exec_statement($del_sql);
+ &main::release_ldap_handle($ldap_handle);
return ;
}