[Pkg-dspam-commits] [dspam] 01/03: Correctly interpret normal string litteral

Thomas Preud'homme robotux at moszumanska.debian.org
Fri Dec 13 12:11:22 UTC 2013


This is an automated email from the git hooks/post-receive script.

robotux pushed a commit to branch master
in repository dspam.

commit c79aafad7fbcfb30e1d485a0933be885bc12058c
Author: Thomas Preud'homme <robotux at celest.fr>
Date:   Fri Dec 13 19:06:15 2013 +0800

    Correctly interpret normal string litteral
    
    Don't prefix strings with E when they are actual normal string litteral.
---
 debian/changelog                                   |  9 +++
 .../013_use_standard_conforming_sql_string.diff    | 92 ----------------------
 debian/patches/series                              |  1 -
 3 files changed, 9 insertions(+), 93 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3c88eaa..2684b0d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+dspam (3.10.2+dfsg-13) UNRELEASED; urgency=medium
+
+  * debian/patches:
+    + drop patch to introduce escape string constants. Although escaped, the
+      only escape sequence contained in strings are made to be interpreted
+      (Closes: #731093).
+
+ -- Thomas Preud'homme <robotux at debian.org>  Fri, 13 Dec 2013 18:53:02 +0800
+
 dspam (3.10.2+dfsg-12) unstable; urgency=low
 
   * Close stdin, stdout and stderr when launching dspam daemon in dspam init
diff --git a/debian/patches/013_use_standard_conforming_sql_string.diff b/debian/patches/013_use_standard_conforming_sql_string.diff
deleted file mode 100644
index 0e330a2..0000000
--- a/debian/patches/013_use_standard_conforming_sql_string.diff
+++ /dev/null
@@ -1,92 +0,0 @@
-From: Thomas Preud'homme <robotux at celest.fr>
-Subject: Properly escape string constants in PostgreSQL driver
-
-PostgreSQL used to accept escaped strings in standard SQL query. It now
-follows the SQL standard by treating backslashes literally. Escaped strings
-need thus to be prefixed by E for PostgreSQL to consider backslashes as
-introducing an escape sequence.
-
-Origin: vendor
-Bug: https://sourceforge.net/p/dspam/bug-tracker/141/
-Bug-Debian: http://bugs.debian.org/719663
-Last-Update: 2013-11-26
----
- src/pgsql_drv.c | 16 ++++++++--------
- 1 file changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/pgsql_drv.c b/src/pgsql_drv.c
-index c8f714c..a6e03a7 100644
---- a/src/pgsql_drv.c
-+++ b/src/pgsql_drv.c
-@@ -1423,7 +1423,7 @@ _ds_get_signature (DSPAM_CTX * CTX, struct _ds_spam_signature *SIG,
-   }
- 
-   snprintf (query, sizeof (query),
--            "SELECT data,length FROM dspam_signature_data WHERE uid=%d AND signature='%s'",
-+            "SELECT data,length FROM dspam_signature_data WHERE uid=%d AND signature=E'%s'",
-             (int) uid, sig_esc);
- 
-   free(sig_esc);
-@@ -1537,7 +1537,7 @@ _ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_signature *SIG,
-   }
- 
-   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,E'%s',%lu,CURRENT_DATE,E'",
-             (int) p->pw_uid, sig_esc, (unsigned long) SIG->length);
-   free(sig_esc);
-   buffer_cat (query, scratch);
-@@ -1607,7 +1607,7 @@ _ds_delete_signature (DSPAM_CTX * CTX, const char *signature)
-   }
- 
-   snprintf (query, sizeof (query),
--            "DELETE FROM dspam_signature_data WHERE uid=%d AND signature='%s'",
-+            "DELETE FROM dspam_signature_data WHERE uid=%d AND signature=E'%s'",
-             (int) p->pw_uid, sig_esc);
- 
-   free(sig_esc);
-@@ -1670,7 +1670,7 @@ _ds_verify_signature (DSPAM_CTX * CTX, const char *signature)
-   }
- 
-   snprintf (query, sizeof (query),
--            "SELECT signature FROM dspam_signature_data WHERE uid=%d AND signature='%s'",
-+            "SELECT signature FROM dspam_signature_data WHERE uid=%d AND signature=E'%s'",
-             (int) p->pw_uid, sig_esc);
- 
-   free(sig_esc);
-@@ -2190,7 +2190,7 @@ _pgsql_drv_getpwnam (DSPAM_CTX * CTX, const char *name)
-   }
- 
-   snprintf (query, sizeof (query),
--            "SELECT %s FROM %s WHERE %s='%s'",
-+            "SELECT %s FROM %s WHERE %s=E'%s'",
-             virtual_uid, virtual_table, virtual_username, name_esc);
- 
-   free(name_esc);
-@@ -2420,7 +2420,7 @@ _pgsql_drv_setpwnam (DSPAM_CTX * CTX, const char *name)
-   }
- 
-   snprintf (query, sizeof (query),
--            "INSERT INTO %s (%s, %s) VALUES (default, '%s')",
-+            "INSERT INTO %s (%s, %s) VALUES (default, E'%s')",
-             virtual_table, virtual_uid, virtual_username, name_esc);
- 
-   free(name_esc);
-@@ -2805,7 +2805,7 @@ int _ds_pref_set (
-   }
- 
-   snprintf(query, sizeof(query), "DELETE FROM dspam_preferences"
--    " WHERE uid=%d AND preference='%s'", (int) uid, pref_esc);
-+    " WHERE uid=%d AND preference=E'%s'", (int) uid, pref_esc);
- 
-   result = PQexec(s->dbh, query);
-   if ( !result || (PQresultStatus(result) != PGRES_COMMAND_OK && PQresultStatus(result) != PGRES_NONFATAL_ERROR) )
-@@ -2896,7 +2896,7 @@ int _ds_pref_del (
-   }
- 
-   snprintf(query, sizeof(query), "DELETE FROM dspam_preferences"
--    " WHERE uid=%d AND preference='%s'", (int) uid, pref_esc);
-+    " WHERE uid=%d AND preference=E'%s'", (int) uid, pref_esc);
- 
-   free(pref_esc);
-   result = PQexec(s->dbh, query);
diff --git a/debian/patches/series b/debian/patches/series
index 8df442e..86cad24 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,4 +8,3 @@
 009_fix_recipient_corruption_when_releasing_message_from_quarantine.diff
 011_define_WCONTINUED_and_WIFCONTINUED_if_not_defined.diff
 012_dont_read_past_end_of_css_files.diff
-013_use_standard_conforming_sql_string.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-dspam/dspam.git



More information about the Pkg-dspam-commits mailing list