From: janw Date: Tue, 11 Mar 2008 13:42:13 +0000 (+0000) Subject: Don't by case sensitive when comparing mac addresses. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9b94eb8e36ce36bb24536782c545762790498ee9;p=gosa.git Don't by case sensitive when comparing mac addresses. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9677 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/gosa-si-bus b/gosa-si/gosa-si-bus index bc3a1c9bb..3ab5e917a 100755 --- a/gosa-si/gosa-si-bus +++ b/gosa-si/gosa-si-bus @@ -813,7 +813,7 @@ sub bus_input { } elsif( $target =~ /([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/ ) { # target is a mac address - my $sql_statement = "SELECT * FROM bus_known_clients WHERE macaddress='$target'"; + my $sql_statement = "SELECT * FROM bus_known_clients WHERE macaddress LIKE '$target'"; my $query_res = $bus_known_clients_db->select_dbentry( $sql_statement ); if( 1 > keys(%{$query_res})) { daemon_log("ERROR: there are more than one hosts in bus_known_clients_db with mac address '$target'", 1); diff --git a/gosa-si/server/events/clMessages.pm b/gosa-si/server/events/clMessages.pm index 22249897e..cf409c54f 100644 --- a/gosa-si/server/events/clMessages.pm +++ b/gosa-si/server/events/clMessages.pm @@ -220,7 +220,7 @@ sub GOTOACTIVATION { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header"."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress'", 5); @@ -245,7 +245,7 @@ sub PROGRESS { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET progress='$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - $content%", 5); @@ -270,7 +270,7 @@ sub FAIREBOOT { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -295,7 +295,7 @@ sub TASKSKIP { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -322,7 +322,7 @@ sub TASKBEGIN { if (($content eq 'finish') || ($content eq 'faiend')){ my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='done', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -333,7 +333,7 @@ sub TASKBEGIN { } else { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -366,7 +366,7 @@ sub TASKEND { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -397,7 +397,7 @@ sub TASKERROR { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); @@ -428,7 +428,7 @@ sub HOOK { my $sql_statement = "UPDATE $main::job_queue_tn ". "SET status='processing', result='$header "."$content' ". - "WHERE status='processing' AND macaddress='$macaddress'"; + "WHERE status='processing' AND macaddress LIKE '$macaddress'"; &main::daemon_log("DEBUG: $sql_statement", 7); my $res = $main::job_db->update_dbentry($sql_statement); &main::daemon_log("INFO: $header at '$macaddress' - '$content'", 5); diff --git a/gosa-si/server/events/gosaTriggered.pm b/gosa-si/server/events/gosaTriggered.pm index 973d2b603..31a804d10 100644 --- a/gosa-si/server/events/gosaTriggered.pm +++ b/gosa-si/server/events/gosaTriggered.pm @@ -159,7 +159,7 @@ sub get_login_usr_for_client { $header =~ s/^gosa_//; - my $sql_statement = "SELECT * FROM known_clients WHERE hostname='$client' OR macaddress='$client'"; + my $sql_statement = "SELECT * FROM known_clients WHERE hostname='$client' OR macaddress LIKE '$client'"; my $res = $main::known_clients_db->select_dbentry($sql_statement); my $out_msg = "
$header
$target$source";