[dspam] fix reported hash driver bug, and clean up cron output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 5ca863f78ea449471491b3bf2e26346935b67bc3
Author: Nathanael d. Noblet <nathanael@xxxxxxx>
Date:   Wed Sep 22 09:45:05 2010 -0600

    fix reported hash driver bug, and clean up cron output

 dspam-3.9.0-file-name.patch |   47 +++++++++++++++++++++++++++++++++++++++++++
 dspam-cron                  |    8 +++---
 dspam.spec                  |    8 ++++++-
 3 files changed, 58 insertions(+), 5 deletions(-)
---
diff --git a/dspam-3.9.0-file-name.patch b/dspam-3.9.0-file-name.patch
new file mode 100644
index 0000000..9613604
--- /dev/null
+++ b/dspam-3.9.0-file-name.patch
@@ -0,0 +1,47 @@
+diff -ur dspam-3.9.0.orig/src/tools.hash_drv/cssclean.c dspam-3.9.0/src/tools.hash_drv/cssclean.c
+--- dspam-3.9.0.orig/src/tools.hash_drv/cssclean.c	2010-01-11 19:21:58.000000000 -0200
++++ dspam-3.9.0/src/tools.hash_drv/cssclean.c	2010-09-13 17:11:02.275460511 -0300
+@@ -150,7 +150,7 @@
+   if (dir == NULL)
+     goto end;
+ 
+-  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *) filename), (unsigned int) getpid());
++  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *) dir), (unsigned int) getpid());
+ 
+   lockfile = _hash_tools_lock_get (filename);
+   if (lockfile == NULL)
+diff -ur dspam-3.9.0.orig/src/tools.hash_drv/csscompress.c dspam-3.9.0/src/tools.hash_drv/csscompress.c
+--- dspam-3.9.0.orig/src/tools.hash_drv/csscompress.c	2010-01-11 19:21:58.000000000 -0200
++++ dspam-3.9.0/src/tools.hash_drv/csscompress.c	2010-09-13 17:11:53.267914903 -0300
+@@ -131,7 +131,12 @@
+     }
+   }
+ 
+-  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *)filename), (unsigned int) getpid());
++  /* create a temporary file name */
++  char *dir = strdup(filename);
++  if (dir == NULL)
++    return EFAILURE;
++
++  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *) dir), (unsigned int) getpid());
+ 
+   if (_hash_drv_open(filename, &old, 0, max_seek,
+                      max_extents, extent_size, pctincrease, flags))
+diff -ur dspam-3.9.0.orig/src/tools.hash_drv/cssconvert.c dspam-3.9.0/src/tools.hash_drv/cssconvert.c
+--- dspam-3.9.0.orig/src/tools.hash_drv/cssconvert.c	2010-01-11 19:21:58.000000000 -0200
++++ dspam-3.9.0/src/tools.hash_drv/cssconvert.c	2010-09-13 17:12:36.182462118 -0300
+@@ -140,7 +140,12 @@
+     }
+   }
+ 
+-  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *)filename), (unsigned int) getpid());
++  /* create a temporary file name */
++  char *dir = strdup(filename);
++  if (dir == NULL)
++    return EFAILURE;
++
++  snprintf(newfile, sizeof(newfile), "/%s/.dspam%u.css", dirname((char *) dir), (unsigned int) getpid());
+ 
+   if (_hash_drv_open(filename, &old, 0, max_seek,
+                      max_extents, extent_size, pctincrease, flags))
+
diff --git a/dspam-cron b/dspam-cron
index db62a8e..26e0ae3 100644
--- a/dspam-cron
+++ b/dspam-cron
@@ -73,10 +73,10 @@ run_dspam_clean() {
 	fi
 	if [ "${PURGE_SIG}" = "YES" ]
 	then
-		echo " (with purging old signatures)"
+		[ "${VERBOSE}" = "true" ] && echo " (with purging old signatures)"
 		${DSPAM_BIN_DIR}/dspam_clean ${ADD_PARAMETER} -s${SIGNATURE_AGE} -p${NEUTRAL_AGE} -u${UNUSED_AGE},${HAPAXES_AGE},${HITS1S_AGE},${HITS1I_AGE} >/dev/null 2>&1
 	else
-		echo " (without purging old signatures)"
+		[ "${VERBOSE}" = "true" ] && echo " (without purging old signatures)"
 		${DSPAM_BIN_DIR}/dspam_clean ${ADD_PARAMETER} -p${NEUTRAL_AGE} -u${UNUSED_AGE},${HAPAXES_AGE},${HITS1S_AGE},${HITS1I_AGE} >/dev/null 2>&1
 	fi
 	return ${?}
@@ -758,7 +758,7 @@ if ( set -o noclobber; echo "$$" > "${DSPAM_CRON_LOCKFILE}") 2> /dev/null; then
 	then
 		if [ "${ACTIVE_DRIVER}" = "hash_drv" ]
 		then
-			echo "Hash storage driver detected (not running dspam_clean)"
+			[ "${VERBOSE}" = "true" ] && echo "Hash storage driver detected (not running dspam_clean)"
 		else
 			run_dspam_clean ${RUN_FULL_DSPAM_CLEAN}
 		fi
@@ -766,7 +766,7 @@ if ( set -o noclobber; echo "$$" > "${DSPAM_CRON_LOCKFILE}") 2> /dev/null; then
 		# Storage driver probably statically linked. Not running dspam_clean
 		# because of potential risk that the storage driver used is the Hash
 		# driver.
-		echo "Could not detect current storage driver (not running dspam_clean)"
+		[ "${VERBOSE}" = "true" ] && echo "Could not detect current storage driver (not running dspam_clean)"
 	fi
 
 
diff --git a/dspam.spec b/dspam.spec
index d6652d1..5b50f55 100644
--- a/dspam.spec
+++ b/dspam.spec
@@ -9,7 +9,7 @@
 Summary:                A library and Mail Delivery Agent for Bayesian SPAM filtering
 Name:                   dspam
 Version:                3.9.0
-Release:                8%{?dist}
+Release:                9%{?dist}
 License:                GPLv2
 Group:                  System Environment/Daemons
 Source0:                http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@@ -20,6 +20,7 @@ Source4:                dspam-web.conf
 Source5:                dspam-front
 Source6:                dspam-sysconfig
 Source99:               dspam-filter-requires.sh
+Patch0:                 dspam-3.9.0-file-name.patch
 URL:                    http://www.nuclearelephant.com/
 # kept to be able to build EPEL versions
 Buildroot:              %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
@@ -128,6 +129,7 @@ Web-based interface for DSPAM's powerful Anti-Spam engine.
 %prep
 
 %setup -q
+%patch0 -p1
 
 %build
 sh ./autogen.sh
@@ -359,6 +361,10 @@ exit 0
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/dspam-web.conf
 
 %changelog
+* Wed Sep 22 2010 Nathanael Noblet <nathanael@xxxxxxx> - 3.9.0-9
+- Update cron job to be silent on success
+- Patch hash utils
+
 * Tue Jul 13 2010 Nathanael Noblet <nathanael@xxxxxxx> - 3.9.0-8
 - Fix dspam data dir permissions to be writeable by mail (Reported by Jonas Pasche)
 
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel


[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux