openbsd-ports/mail/dspam/patches/patch-src_pgsql_drv_c
landry 37e7a819d5 Update to dspam 3.10.2.
- remove 6 out of the 10 flavors maze, only keep the ones that make
  sense (ie clamav, ldap, domainscale & largescale)
- build pgsql & mysql drivers as subpackages, as $DEITY intended
- @pkgpath & PFRAG.[flavor]-main tweaks from sthen@ (thanks!)
- remove init_pwent_cache() patch until i can make some sense of it
- remove painful strlcpy patches
- add patches to fix pgsql support with PSQL > 9.1 from
  http://sourceforge.net/p/dspam/bug-tracker/112/ &
http://sourceforge.net/p/dspam/bug-tracker/141
- add an rc script running dspam --daemon as _dspam
- patch default dspam.conf to trust user _dspam (pointed out by jca@;
  thanks!) and to use port 2424 by default. Taken from debian.

Discussed at length with todd@ (MAINTAINER), been running on amd64 with
pgsql &| sqlite backend since a while, also tested on sqlite/ppc.

Some tweaks might still be needed (a README ? Fix some weird crashers ?),
but at least it's better than what we had for the past years.
2013-09-14 17:12:10 +00:00

30 lines
1.1 KiB
Plaintext

$OpenBSD: patch-src_pgsql_drv_c,v 1.7 2013/09/14 17:12:13 landry Exp $
chunk 2; fix runtime w/ pg > 9.1
from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694942
http://sourceforge.net/p/dspam/bug-tracker/141/
chunk1: http://sourceforge.net/p/dspam/bug-tracker/112/
--- src/pgsql_drv.c.orig Wed Apr 11 20:48:33 2012
+++ src/pgsql_drv.c Fri Sep 6 10:37:25 2013
@@ -1537,7 +1537,7 @@ _ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_si
}
snprintf (scratch, sizeof (scratch),
- "INSERT INTO dspam_signature_data (uid,signature,length,created_on,data) VALUES (%d,'%s',%lu,CURRENT_DATE,'",
+ "INSERT INTO dspam_signature_data (uid,signature,length,created_on,data) VALUES (%d,'%s',%lu,CURRENT_DATE, E'",
(int) p->pw_uid, sig_esc, (unsigned long) SIG->length);
free(sig_esc);
buffer_cat (query, scratch);
@@ -3082,6 +3082,12 @@ PGconn *_pgsql_drv_connect(DSPAM_CTX *CTX)
return NULL;
}
+ if (PQserverVersion(dbh) >= 90100)
+ {
+ PGresult *result = PQexec(dbh, "SET standard_conforming_strings TO off;");
+ if (result)
+ PQclear(result);
+ }
return dbh;
FAILURE: