Package: spamassassin
Version: 3.2.3-1
Followup-For: Bug #443076

        Okay, some more details on this particular problem.  It's not a
bug per se, but it does tend to fill up your logs a bit with needless
information.

        The warning that is generated is something like this:
---
Dec 12 00:00:30 king spamd[19601]: WARNING: nonstandard use of \\ in a string 
literal
Dec 12 00:00:30 king spamd[19601]: LINE 1: select put_tokens(86, 
'{"\\\\000\\\\174\\\\301\\\\367\\\\030...
Dec 12 00:00:30 king spamd[19601]:  ^
Dec 12 00:00:30 king spamd[19601]: HINT: Use the escape string syntax for 
backslashes, e.g., E'\\'.
---

        The file which needs to be patched is:
---
/usr/share/perl5/Mail/SpamAssassin/BayesStore/PgSQL.pm

and the patch is attached to this report.

        Now the biggest problem is that I'm not sure this can be pushed
out if people are using anything older than PostgreSQL 8.2.  But I
wanted to document this here since I've been dealing with it for quite
some time now and I'm sure other people have been also.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (700, 'testing'), (600, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.23.8 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages spamassassin depends on:
ii  libarchive-tar-perl           1.36-1     Archive::Tar - manipulate tar file
ii  libdigest-sha1-perl           2.11-2     NIST SHA-1 message digest algorith
ii  libhtml-parser-perl           3.56-1     A collection of modules that parse
ii  libio-zlib-perl               1.04-1     IO:: style interface to Compress::
ii  libnet-dns-perl               0.60-1     Perform DNS queries from a Perl sc
ii  libsocket6-perl               0.19-1     Perl extensions for IPv6
ii  libsys-hostname-long-perl     1.4-1      Figure out the long (fully-qualifi
ii  libwww-perl                   5.805-1    WWW client/server library for Perl
ii  perl                          5.8.8-12   Larry Wall's Practical Extraction 

Versions of packages spamassassin recommends:
ii  gcc                           4:4.2.1-6  The GNU C compiler
ii  gnupg                         1.4.6-2    GNU privacy guard - a free PGP rep
ii  libc6-dev                     2.7-3      GNU C Library: Development Librari
pn  libmail-spf-query-perl        <none>     (no description available)
pn  libsys-syslog-perl            <none>     (no description available)
ii  make                          3.81-3     The GNU version of the "make" util
pn  re2c                          <none>     (no description available)
ii  spamc                         3.2.3-1    Client for SpamAssassin spam filte

-- debconf information excluded
--- PgSQL.pm~   Fri Sep 29 15:06:38 2006
+++ PgSQL.pm    Thu Jan 18 15:53:59 2007
@@ -730,5 +730,5 @@
   my $tokenarray = join(",", map { '"' . _quote_bytea($_) . '"' } sort 
@{$tokens});
 
-  my $sth = $self->{_dbh}->prepare("select touch_tokens($self->{_userid}, 
'{$tokenarray}', $atime)");
+  my $sth = $self->{_dbh}->prepare("select touch_tokens($self->{_userid}, 
E'{$tokenarray}', $atime)");
 
   unless (defined($sth)) {
@@ -934,5 +934,5 @@
 
   my $escaped_token = _quote_bytea($token);
-  my $sth = $self->{_dbh}->prepare("select 
put_tokens($self->{_userid},'{$escaped_token}',
+  my $sth = $self->{_dbh}->prepare("select put_tokens($self->{_userid}, 
E'{$escaped_token}',
                                                       
$spam_count,$ham_count,$atime)");
 
@@ -998,5 +998,5 @@
   my $tokenarray = join(",", map { '"' . _quote_bytea($_) . '"' } sort keys 
%{$tokens});
 
-  my $sth = $self->{_dbh}->prepare("select put_tokens($self->{_userid}, 
'{$tokenarray}',
+  my $sth = $self->{_dbh}->prepare("select put_tokens($self->{_userid}, 
E'{$tokenarray}',
                                                      $spam_count, $ham_count, 
$atime)");
 
@@ -1038,12 +1038,5 @@
 sub _quote_bytea {
   my ($str) = @_;
-  my $buf = "";
-  foreach my $char (split(//,$str)) {
-    my $oct = sprintf ("%lo", ord($char));
-    if (length( $oct ) < 2 ) { $oct = '0' . $oct; }
-    if (length( $oct ) < 3 ) { $oct = '0' . $oct; }
-    $buf .= '\\\\\\\\' . $oct;
-  }
-  return $buf;
+  return join('', map {'\\\\\\\\'.sprintf("%03o",ord($_))} split(//,$str));
 }
 

Reply via email to