[pkg-dspam-commits] r96 - in trunk/debian: patches

Matthijs Mohlmann active2-guest at costa.debian.org
Mon May 29 20:42:36 UTC 2006


Author: active2-guest
Date: Mon May 29 20:42:35 2006
New Revision: 96

Added:
   trunk/debian/patches/clean-warnings.dpatch   (contents, props changed)
   trunk/debian/patches/enable-domain-quarantine.dpatch   (contents, props changed)
   trunk/debian/patches/fix-delivery-segv.dpatch
   trunk/debian/patches/virus-notifications.dpatch
Modified:
   trunk/debian/changelog
   trunk/debian/patches/00list
   trunk/debian/patches/add-config-dir.dpatch

Log:
 * Added and updated a few patches to fix behaviour of dspam, see
   debian/changelog for the actual fixes.


Modified: trunk/debian/changelog
==============================================================================
--- trunk/debian/changelog	(original)
+++ trunk/debian/changelog	Mon May 29 20:42:35 2006
@@ -1,3 +1,19 @@
+dspam (3.6.6-2) unstable; urgency=low
+
+  * Update add-config-dir patch: patch from Daniel Kahn Gillmor
+    - it passes arguments as config_t** instead of config_t* around.
+    - read only *.conf files instead of all files. (Closes: #369414)
+  * Add a patch that adds a virus notification to the log. Patch from
+    Julien Valrof (Closes: #369434)
+  * Dspam segfaults when DeliveryHost is unset, added patch from
+    Daniel Kahn Gillmor to fix this. (Closes: #369421)
+  * The QuarantaineMailbox option does not work properly if the user is domain
+    qualified. Added patch from Daniel Kahn Gillmor. (Closes: #369432)
+  * Clean up minor warnings in dspam. Patch from Daniel Kahn Gillmor
+    (Closes: #369426)
+
+ -- Debian DSPAM Maintainers <pkg-dspam-misc at lists.alioth.debian.org>  Mon, 29 May 2006 22:31:36 +0200
+
 dspam (3.6.6-1) unstable; urgency=low
 
   * New upstream release. (Closes: #361249)

Modified: trunk/debian/patches/00list
==============================================================================
--- trunk/debian/patches/00list	(original)
+++ trunk/debian/patches/00list	Mon May 29 20:42:35 2006
@@ -16,3 +16,7 @@
 make-daemon-quiet.dpatch
 make-dspam_clean-quiet.dpatch
 improper-quotation-fix.dpatch
+fix-delivery-segv.dpatch
+enable-domain-quarantine.dpatch
+virus-notifications.dpatch
+clean-warnings.dpatch

Modified: trunk/debian/patches/add-config-dir.dpatch
==============================================================================
--- trunk/debian/patches/add-config-dir.dpatch	(original)
+++ trunk/debian/patches/add-config-dir.dpatch	Mon May 29 20:42:35 2006
@@ -5,9 +5,9 @@
 ## DP: Add config item include that include directories.
 
 @DPATCH@
-diff -urNad dspam-3.6.3~/src/read_config.c dspam-3.6.3/src/read_config.c
---- dspam-3.6.3~/src/read_config.c	2006-01-25 10:01:21.000000000 +0100
-+++ dspam-3.6.3/src/read_config.c	2006-01-25 10:07:44.391581250 +0100
+diff -urNad dspam-3.6.6~/src/read_config.c dspam-3.6.6/src/read_config.c
+--- dspam-3.6.6~/src/read_config.c	2006-05-29 12:53:07.000000000 -0400
++++ dspam-3.6.6/src/read_config.c	2006-05-29 12:53:42.690296936 -0400
 @@ -27,6 +27,7 @@
  #include <stdio.h>
  #include <errno.h>
@@ -20,13 +20,13 @@
  #include "pref.h"
  #include "util.h"
  
-+long dirread(const char *path, config_t **attrib, long num_root);
-+long fileread(const char *path, config_t **attrib, long num_root);
++long dirread(const char *path, config_t *attrib, long num_root);
++long fileread(const char *path, config_t *attrib, long num_root);
 +
  static char *next_normal_token(char **p)
  {
    char *start = *p;
-@@ -93,28 +97,67 @@
+@@ -93,28 +97,73 @@
    return NULL;
  }
  
@@ -34,7 +34,7 @@
 -  config_t attrib, ptr;
 +// Read the files in the directory and pass it to fileread
 +// or if it is a file, pass it to fileread.
-+long dirread(const char *path, config_t **attrib, long num_root) {
++long dirread(const char *path, config_t *attrib, long num_root) {
 +  DIR *dir_p;
 +  char *fulldir;
 +  struct dirent *dir_entry_p;
@@ -53,6 +53,12 @@
 +          strcmp(dir_entry_p->d_name, "..") == 0)
 +        continue;
 +
++      // only use files which end in .conf:
++      if (strncmp(dir_entry_p->d_name + strlen(dir_entry_p->d_name) - 5,
++		  ".conf", 5) != 0) {
++	continue;
++      }
++
 +      n = strlen(dir_entry_p->d_name);
 +      m = strlen(path);
 +      fulldir = (char *)malloc(n+m+2);
@@ -73,7 +79,7 @@
 +
 +// Read the file and check if there is an Include directive, if so then pass
 +// it to dirread.
-+long fileread(const char *path, config_t **attrib, long num_root) {
++long fileread(const char *path, config_t *attrib, long num_root) {
 +  config_t ptr;
    FILE *file;
 -  long attrib_size = 128, num_root = 0;
@@ -106,7 +112,7 @@
    }
  
    while(fgets(buffer, sizeof(buffer), file)!=NULL) {
-@@ -130,30 +173,48 @@
+@@ -130,30 +179,48 @@
        continue; /* Ignore whitespace-only lines */
  
      while ((v = tokenize(NULL, &bufptr)) != NULL) {
@@ -138,7 +144,7 @@
 +            attrib_size *=2;
 +            ptr = realloc((*attrib), attrib_size*sizeof(attribute_t)); 
 +            if (ptr)
-+              *attrib = &ptr;
++              *attrib = ptr;
 +            else
 +              LOG(LOG_CRIT, ERR_MEM_ALLOC);
 +          } 
@@ -158,7 +164,7 @@
 +}
 +
 +config_t read_config(const char *path) {
-+  config_t *attrib;
++  config_t attrib;
 +  long attrib_size = 128, num_root = 0;
 +
 +  attrib = calloc(1, attrib_size*sizeof(attribute_t));

Added: trunk/debian/patches/clean-warnings.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/clean-warnings.dpatch	Mon May 29 20:42:35 2006
@@ -0,0 +1,84 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## clean-warnings.dpatch by Daniel Kahn Gillmor <dkg-debian.org at fifthhorseman.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Clean up spurious compiler warnings in sqlite3_drv.c and during
+## DP: autoconf to allow building with -Werror
+
+ at DPATCH@
+diff -urNad dspam-3.6.6~/m4/mysql_drv.m4 dspam-3.6.6/m4/mysql_drv.m4
+--- dspam-3.6.6~/m4/mysql_drv.m4	2006-05-28 21:45:48.000000000 -0400
++++ dspam-3.6.6/m4/mysql_drv.m4	2006-05-28 21:45:57.390114192 -0400
+@@ -158,6 +158,7 @@
+         ]],
+         [[
+             MYSQL *mysql = mysql_init(NULL);
++	    mysql_close(mysql);
+         ]])],
+         [ mysql_libs_success=yes ],
+         [ mysql_libs_success=no ]
+diff -urNad dspam-3.6.6~/m4/pgsql_drv.m4 dspam-3.6.6/m4/pgsql_drv.m4
+--- dspam-3.6.6~/m4/pgsql_drv.m4	2006-05-28 21:45:48.000000000 -0400
++++ dspam-3.6.6/m4/pgsql_drv.m4	2006-05-28 21:45:57.391114040 -0400
+@@ -152,6 +152,7 @@
+         ]],
+         [[
+             PGconn *pgsql = PQconnectdb(NULL);
++	    PQfinish(pgsql);
+         ]])],
+         [ pgsql_libs_success=yes ],
+         [ pgsql_libs_success=no ]
+diff -urNad dspam-3.6.6~/m4/sqlite3_drv.m4 dspam-3.6.6/m4/sqlite3_drv.m4
+--- dspam-3.6.6~/m4/sqlite3_drv.m4	2006-05-28 21:45:48.000000000 -0400
++++ dspam-3.6.6/m4/sqlite3_drv.m4	2006-05-28 21:47:24.042940960 -0400
+@@ -65,6 +65,7 @@
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[
+         #include <sqlite3.h>
+         #include <stdio.h>
++        #include <stdlib.h>
+         #ifdef HAVE_UNISTD_H
+         #   include <unistd.h>
+         #endif
+@@ -197,7 +198,8 @@
+             #include <sqlite3.h>
+             ]],
+             [[
+-              const char *v = sqlite3_version;
++              const char *v = 0;
++	      v = sqlite3_version;
+             ]])],
+             [ ds_sqlite_libs_success=yes ],
+             [ ds_sqlite_libs_success=no ]
+diff -urNad dspam-3.6.6~/m4/sqlite_drv.m4 dspam-3.6.6/m4/sqlite_drv.m4
+--- dspam-3.6.6~/m4/sqlite_drv.m4	2006-05-28 21:45:48.000000000 -0400
++++ dspam-3.6.6/m4/sqlite_drv.m4	2006-05-28 21:46:41.682380744 -0400
+@@ -65,6 +65,7 @@
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[
+         #include <sqlite.h>
+         #include <stdio.h>
++        #include <stdlib.h>
+         #ifdef HAVE_UNISTD_H
+         #   include <unistd.h>
+         #endif
+@@ -197,7 +198,8 @@
+             #include <sqlite.h>
+             ]],
+             [[
+-              const char *v = sqlite_version;
++              const char *v = 0;
++	      v = sqlite_version;
+             ]])],
+             [ ds_sqlite_libs_success=yes ],
+             [ ds_sqlite_libs_success=no ]
+diff -urNad dspam-3.6.6~/src/sqlite3_drv.c dspam-3.6.6/src/sqlite3_drv.c
+--- dspam-3.6.6~/src/sqlite3_drv.c	2006-05-28 21:45:57.036168000 -0400
++++ dspam-3.6.6/src/sqlite3_drv.c	2006-05-28 21:45:57.392113888 -0400
+@@ -135,7 +135,7 @@
+   struct _sqlite_drv_storage *s = (struct _sqlite_drv_storage *) CTX->storage;
+   char query[1024];
+   char *err=NULL;
+-  int result;
++  int result = SQLITE_OK;
+ 
+   if (s->dbh == NULL)
+   {

Added: trunk/debian/patches/enable-domain-quarantine.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/enable-domain-quarantine.dpatch	Mon May 29 20:42:35 2006
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## enable-domain-quarantine.dpatch by Daniel Kahn Gillmor <dkg-debian.org at fifthhorseman.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Lets quarantining suffix work properly if the user name is fully qualified
+
+ at DPATCH@
+diff -urNad dspam-3.6.6/src/dspam.c /tmp/dpep.ckmPmt/dspam-3.6.6/src/dspam.c
+--- dspam-3.6.6/src/dspam.c	2006-05-24 16:32:56.327971123 -0400
++++ /tmp/dpep.ckmPmt/dspam-3.6.6/src/dspam.c	2006-05-24 16:39:54.168710328 -0400
+@@ -842,10 +842,20 @@
+   if ((_ds_read_attribute(agent_config, "QuarantineMailbox")) &&
+       (result == DSR_ISSPAM)) {
+     strlcpy(args, ATX->recipient, sizeof(args));
++
++    /* strip trailing @domain, if present: */
++    arg=index(args, '@');
++    if (arg) *arg = '\0';
++
+     arg=index(args,'+');
+     if (arg != NULL) *arg='\0';
+     strlcat(args,_ds_read_attribute(agent_config, "QuarantineMailbox"),
+             sizeof(args));
++
++    /* append trailing @domain again, if it was present: */
++    arg=index(ATX->recipient, '@');
++    if (arg) strlcat (args, arg, sizeof(args));
++
+     ATX->recipient=args;
+   }
+ 
+diff -urNad dspam-3.6.6/src/dspam.conf.in /tmp/dpep.ckmPmt/dspam-3.6.6/src/dspam.conf.in
+--- dspam-3.6.6/src/dspam.conf.in	2006-05-24 16:32:56.051977147 -0400
++++ /tmp/dpep.ckmPmt/dspam-3.6.6/src/dspam.conf.in	2006-05-24 16:43:36.405674948 -0400
+@@ -94,9 +94,6 @@
+ # "user+detail". This is only useful if the LDA can handle "plused users"
+ # (for example Cyrus IMAP) and when configured for LMTP delivery above
+ #
+-# NOTE: Plused detail presently only works when usernames are provided and
+-#       not fully qualified email address (@domain).
+-#
+ #EnablePlusedDetail	on
+ 
+ #

Added: trunk/debian/patches/fix-delivery-segv.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/fix-delivery-segv.dpatch	Mon May 29 20:42:35 2006
@@ -0,0 +1,28 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix-delivery-segv.dpatch by Daniel Kahn Gillmor <dkg-debian.org at fifthhorseman.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fixing a segfault if no DeliveryHost is specified.
+
+ at DPATCH@
+diff -urNad dspam-3.6.6/src/client.c /tmp/dpep.oHqFiC/dspam-3.6.6/src/client.c
+--- dspam-3.6.6/src/client.c	2006-05-25 11:19:04.287787079 -0400
++++ /tmp/dpep.oHqFiC/dspam-3.6.6/src/client.c	2006-05-25 11:19:33.009003264 -0400
+@@ -289,7 +289,7 @@
+     if (_ds_read_attribute(agent_config, "DeliveryPort"))
+       port = atoi(_ds_read_attribute(agent_config, "DeliveryPort"));
+ 
+-    if (host[0] == '/') 
++    if (host && (host[0] == '/'))
+       domain = 1;
+ 
+   } else {
+@@ -298,7 +298,7 @@
+     if (_ds_read_attribute(agent_config, "ClientPort"))
+       port = atoi(_ds_read_attribute(agent_config, "ClientPort"));
+ 
+-    if (host[0] == '/')
++    if (host && (host[0] == '/'))
+       domain = 1;
+   }
+ 

Added: trunk/debian/patches/virus-notifications.dpatch
==============================================================================
--- (empty file)
+++ trunk/debian/patches/virus-notifications.dpatch	Mon May 29 20:42:35 2006
@@ -0,0 +1,33 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## virus-notifications.dpatch by  <julien at kirya.net>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+ at DPATCH@
+diff -urNad dspam-3.6.6~/src/dspam.c dspam-3.6.6/src/dspam.c
+--- dspam-3.6.6~/src/dspam.c	2006-05-13 14:17:30.000000000 +0200
++++ dspam-3.6.6/src/dspam.c	2006-05-28 15:24:25.000000000 +0200
+@@ -3389,6 +3389,7 @@
+   {
+     if (CTX->totals.innocent_learned + CTX->totals.innocent_classified > 2500) {
+       if (CTX->result == DSR_ISSPAM && 
++          strcmp(CTX->class, LANG_CLASS_VIRUS) != 0 &&
+           _ds_match_attribute(agent_config, "TrackSources", "spam")) {
+         FILE *file;
+         char dropfile[MAX_FILENAME_LENGTH];
+@@ -3401,7 +3402,14 @@
+             fclose(file);
+         }
+       }
++      if (CTX->result == DSR_ISSPAM &&
++          strcmp(CTX->class, LANG_CLASS_VIRUS) == 0 &&
++          _ds_match_attribute(agent_config, "TrackSources", "virus"))
++      {
++        LOG (LOG_INFO, "infected message from %s", ip);
++      }
+       if (CTX->result != DSR_ISSPAM &&
++          strcmp(CTX->class, LANG_CLASS_VIRUS) != 0 &&
+           _ds_match_attribute(agent_config, "TrackSources", "nonspam"))
+       {
+         LOG (LOG_INFO, "innocent message from %s", ip);



More information about the Pkg-dspam-commits mailing list