
Hallo, ich habe heute Morgen unseren OTRS Server auf Version 1.2.1 gepatcht. Dabei ist mir aufgefallen, dass unsere Mitarbeiter anschliessend keine Status- Notifications mehr bekommen. Ein kleiner Blick in die OTRS Log: ---------snap---------- ERROR: OTRS-CGI- Time: Tue Feb 17 08:26:51 2004 Message: Can't get ArticleID from INSERT! Traceback (31713): Module: Kernel::System::Ticket::Article::CreateArticle (v1.49) Line: 133 Module: Kernel::System::Ticket::SendArticle::SendArticle (v1.15) Line: 74 Module: Kernel::System::Ticket::SendNotification::SendCustomerNotification (v 1.13) Line: 288 Module: Kernel::System::Ticket::State::SetState (v1.17) Line: 92 Module: Kernel::Modules::AgentCompose::SendEmail (v1.58) Line: 404 Module: Kernel::Modules::AgentCompose::Run (v1.58) Line: 78 Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl:: handler (v) Line: 688 Module: (eval) (v1.66) Line: 185 Module: ModPerl::RegistryCooker::run (v1.66) Line: 185 Module: ModPerl::RegistryCooker::default_handler (v1.66) Line: 155 Module: ModPerl::Registry::handler (v1.99) Line: 16 ---------snap---------- Das Problem war die SQL Anfrage, welche von Kernel/System/Ticket/Article.pm generiert wurde. Seit Version 1.1 ist u.a. Folgendes hinzugekommen: + foreach (keys %Param) { + $Param{$_} = $Self->{DBObject}->Quote($Param{$_}); + } Dabei entsteht solch ein SQL Statement: SELECT [..snip..] a_subject = '[Ticket#: 1] New State \\\'new\\\'!' [..] Sieht so aus, als ob DBObject->Quote die '\' (Backslashes) quotiert :-). Ich hab ein kleinen Patch geschrieben: --- Article.pm.dist 2004-02-17 10:50:10.000000000 +0100 +++ Article.pm 2004-02-17 12:29:25.000000000 +0100 @@ -342,7 +342,9 @@ } # db quote foreach (keys %Param) { - $Param{$_} = $Self->{DBObject}->Quote($Param{$_}); + if ($_ ne "Subject") { + $Param{$_} = $Self->{DBObject}->Quote($Param{$_}); + } } # sql query my $SQL = "SELECT id FROM article " . @@ -352,10 +354,10 @@ if ($Param{MessageID}) { $SQL .= "a_message_id = '$Param{MessageID}' AND "; } - if ($Param{MessageID}) { + if ($Param{From}) { $SQL .= "a_from = '$Param{From}' AND "; } - if ($Param{MessageID}) { + if ($Param{Subject}) { $SQL .= "a_subject = '$Param{Subject}' AND "; } $SQL .= " incoming_time = '$Param{IncomingTime}'"; Hmm. Sicherheitstechnisch ist das wahrscheinlich nicht so toll. Mit freundlichen Gruessen Daniel -- Daniel Mueller Siemens AG I&S IT PS Ost