[dspam/f17] fixed bugs #657357 and #954345

Nathanael Noblet gnat at fedoraproject.org
Wed May 15 15:56:38 UTC 2013


commit b63805ba3956ca41a40db9a0471b0ae84e0ab9d4
Author: Nathanael D. Noblet <nathanael at gnat.ca>
Date:   Wed May 15 09:56:30 2013 -0600

    fixed bugs #657357 and #954345

 dspam-cron |   48 ++----------------------------------------------
 dspam.spec |    7 ++++++-
 2 files changed, 8 insertions(+), 47 deletions(-)
---
diff --git a/dspam-cron b/dspam-cron
index 26e0ae3..ad10113 100644
--- a/dspam-cron
+++ b/dspam-cron
@@ -239,7 +239,7 @@ clean_pgsql_drv() {
 		[ -n "${PgSQLServer}" -a -n "${PgSQLUser}" -a -n "${PgSQLDb}" ]
 	then
 		DSPAM_PgSQL_PURGE_SQL=
-		DSPAM_PgSQL_PURGE_SQL_FILES="pgsql_pe-purge"
+		DSPAM_PgSQL_PURGE_SQL_FILES="pgsql/purge-pe pgsql/purge"
 
 		#
 		# We first search for the purge scripts in the directory the user has
@@ -347,7 +347,7 @@ clean_sqlite3_drv() {
 	then
 		DSPAM_SQLite3_PURGE_SQL=""
 		[ -f "${DSPAM_CONFIGDIR}/config/sqlite3_purge.sql" ] && DSPAM_SQLite3_PURGE_SQL="${DSPAM_CONFIGDIR}/config/sqlite3_purge.sql"
-		[ -f "${DSPAM_CONFIGDIR}/sqlite3_purge.sql" ] && DSPAM_SQLite3_PURGE_SQL="${DSPAM_CONFIGDIR}/sqlite3_purge.sql"
+		[ -f "${DSPAM_PURGE_SCRIPT_DIR}/sqlite3/purge-3.sql" ] && DSPAM_SQLite3_PURGE_SQL="${DSPAM_PURGE_SCRIPT_DIR}/sqlite3/purge-3.sql"
 
 		if [ -z "${DSPAM_SQLite3_PURGE_SQL}" ]
 		then
@@ -377,47 +377,6 @@ clean_sqlite3_drv() {
 
 
 #
-# Function to clean DSPAM SQLite < 3.0 data
-#
-clean_sqlite_drv() {
-	#
-	# SQLite
-	#
-	[ "${VERBOSE}" = "true" ] && echo "Running SQLite v2 storage driver data cleanup"
-	if	[ "${USE_SQL_PURGE}" = "true" ]
-	then
-		DSPAM_SQLite_PURGE_SQL=""
-		[ -f "${DSPAM_CONFIGDIR}/config/sqlite_purge.sql" ] && DSPAM_SQLite_PURGE_SQL="${DSPAM_CONFIGDIR}/config/sqlite_purge.sql"
-		[ -f "${DSPAM_CONFIGDIR}/sqlite_purge.sql" ] && DSPAM_SQLite_PURGE_SQL="${DSPAM_CONFIGDIR}/sqlite_purge.sql"
-
-		if [ -z "${DSPAM_SQLite_PURGE_SQL}" ]
-		then
-			echo "Can not run SQLite purge script:"
-			echo "  No sqlite_purge SQL script found"
-			return 1
-		fi
-
-		if [ ! -e "${SQLITE_BIN_DIR}/sqlite" ]
-		then
-			echo "Can not run SQLite purge script:"
-			echo "  ${SQLITE_BIN_DIR}/sqlite does not exist"
-			return 1
-		fi
-
-		# Run the SQLite purge script and vacuum
-		find "${DSPAM_HOMEDIR}" -name "*.sdb" -print | while read name
-		do
-			${SQLITE_BIN_DIR}/sqlite "${name}" < "${DSPAM_SQLite_PURGE_SQL}" >/dev/null
-			# Enable the next line if you don't vacuum in the purge script
-			# echo "vacuum;" | ${SQLITE_BIN_DIR}/sqlite "${name}" >/dev/null
-		done 1>/dev/null 2>&1
-		return 0
-	fi
-
-}
-
-
-#
 # Use a lock file to prevent multiple runs at the same time
 #
 DSPAM_CRON_LOCKFILE="/var/run/$(basename $0 .sh).pid"
@@ -737,9 +696,6 @@ if ( set -o noclobber; echo "$$" > "${DSPAM_CRON_LOCKFILE}") 2> /dev/null; then
 			sqlite3_drv)
 				clean_sqlite3_drv
 				;;
-			sqlite_drv)
-				clean_sqlite_drv
-				;;
 			*)
 				RUN_FULL_DSPAM_CLEAN="YES"
 				echo "Unknown storage ${foo} driver"
diff --git a/dspam.spec b/dspam.spec
index 83e5b61..8a6859b 100644
--- a/dspam.spec
+++ b/dspam.spec
@@ -7,11 +7,12 @@
 %global dspam_mode      2511
 %global dspam_web_docroot %{_localstatedir}/www/dspam
 %global __perl_requires %{SOURCE99}
+%global _hardened_build 1
 
 Summary:                A library and Mail Delivery Agent for Bayesian SPAM filtering
 Name:                   dspam
 Version:                3.10.2
-Release:                3%{?dist}
+Release:                4%{?dist}
 License:                GPLv2
 Group:                  System Environment/Daemons
 Source0:                http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@@ -380,6 +381,10 @@ exit 0
 %config(noreplace) %{_sysconfdir}/httpd/conf.d/dspam-web.conf
 
 %changelog
+* Wed May 15 2013 Nathanael Noblet <nathanael at gnat.ca> - 3.10.2-4
+- set hardened build to add PIE option since dspam can be long running bug #954345
+- properly fixes #657357 - PostgreSQL purge script works
+
 * Thu Nov 29 2012 Nathanael Noblet <nathanael at gnat.ca> - 3.10.2-3
 - Fix dspam-web.conf file to work with httpd 2.4 and 2.2 bug#871396
 


More information about the scm-commits mailing list