From: janw Date: Tue, 22 Apr 2008 07:13:25 +0000 (+0000) Subject: Small fixes and checks. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=124f98464b9bbfe028e4ece8a00cd622de03d4f2;p=gosa.git Small fixes and checks. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10599 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 649ad70c5..0f3b33c9e 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1281,7 +1281,11 @@ sub watch_for_new_jobs { foreach my $hit (reverse @{$res} ) { my $macaddress= lc @{$hit}[8]; my $headertag= @{$hit}[5]; - if(defined($hits->{$macaddress}->{$headertag})) { + if( + defined($hits->{$macaddress}) && + defined($hits->{$macaddress}->{$headertag}) && + defined($hits->{$macaddress}->{$headertag}[0]) + ) { push @drops, "DELETE FROM $job_queue_tn WHERE id = '$hits->{$macaddress}->{$headertag}[0]'"; } $hits->{$macaddress}->{$headertag}= $hit; @@ -1291,10 +1295,14 @@ sub watch_for_new_jobs { foreach my $macaddress (keys %{$hits}) { foreach my $jobdb_headertag (keys %{$hits->{$macaddress}}) { my $jobdb_id = @{$hits->{$macaddress}->{$jobdb_headertag}}[0]; - my $sql_statement = "SELECT * FROM $job_queue_tn WHERE macaddress LIKE '$macaddress' AND headertag='$jobdb_headertag' AND status='processing'"; - my $res = $job_db->exec_statement( $sql_statement ); - foreach my $hit (@{$res}) { - push @drops, "DELETE FROM $job_queue_tn WHERE id = '$jobdb_id'"; + if(defined($job_db_id)) { + my $sql_statement = "SELECT * FROM $job_queue_tn WHERE macaddress LIKE '$macaddress' AND headertag='$jobdb_headertag' AND status='processing'"; + my $res = $job_db->exec_statement( $sql_statement ); + foreach my $hit (@{$res}) { + push @drops, "DELETE FROM $job_queue_tn WHERE id = '$jobdb_id'"; + } + } else { + daemon_log("J ERROR: Job without id exists for macaddress $macaddress!", 1); } } } @@ -2014,7 +2022,7 @@ sub create_sources_list { } } } else { - &main::daemon_log("$session_id ERROR: something wrong with ldap_server_dn '$ldap_server_dn', abort create_soureces_list", 1); + &main::daemon_log("$session_id ERROR: something wrong with ldap_server_dn '$ldap_server_dn', abort create_sources_list", 1); } close($fh); diff --git a/gosa-si/modules/ArpHandler.pm b/gosa-si/modules/ArpHandler.pm index 549afed52..1b0997dd2 100644 --- a/gosa-si/modules/ArpHandler.pm +++ b/gosa-si/modules/ArpHandler.pm @@ -236,7 +236,7 @@ sub get_host_from_ldap { my $mac=shift; my $result={}; - my $ldap_handle = &get_ldap_handle(); + my $ldap_handle = &main::get_ldap_handle(); if(defined($ldap_handle)) { my $ldap_result= &search_ldap_entry( $ldap_handle,