Steve Grubb 013d50
--- aide-0.12/contrib/gpg2_check.sh.spc	2007-06-21 12:37:06.000000000 -0400
Steve Grubb 013d50
+++ aide-0.12/contrib/gpg2_check.sh	2007-06-21 12:39:53.000000000 -0400
Steve Grubb 013d50
@@ -1,32 +1,32 @@
Steve Grubb 013d50
-#!/bin/sh
Steve Grubb 013d50
-# $Id: aide-0.12-dedosify.patch,v 1.1 2009/01/30 21:39:33 sgrubb Exp $
Steve Grubb 013d50
-
Steve Grubb 013d50
-# Script by Vincent Danen <vdanen@linsec.ca>
Steve Grubb 013d50
-
Steve Grubb 013d50
-hostname=`uname -n`
Steve Grubb 013d50
-echo "AIDE integrity check for ${hostname} beginning (`date`)"
Steve Grubb 013d50
-echo ""
Steve Grubb 013d50
-if [ ! -e /var/lib/aide/aide.db ] ; then
Steve Grubb 013d50
-    echo "**** Error: AIDE database for ${hostname} not found."
Steve Grubb 013d50
-    echo "**** Run 'aide --init' and move the appropriate database file."
Steve Grubb 013d50
-else
Steve Grubb 013d50
-    if [ -f /etc/aide.conf ]; then
Steve Grubb 013d50
-        if [ -f /var/lib/aide/aide.db.sig ]; then
Steve Grubb 013d50
-	    pushd /var/lib/aide >/dev/null
Steve Grubb 013d50
-	        echo "Verifying the GPG signature on the database..."
Steve Grubb 013d50
-		echo ""
Steve Grubb 013d50
-	        gpg --verify aide.db.sig
Steve Grubb 013d50
-		echo ""
Steve Grubb 013d50
-		if [ "$?" == "1" ]; then
Steve Grubb 013d50
-		    echo "************************************************************"
Steve Grubb 013d50
-		    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb 013d50
-		    echo "************************************************************"
Steve Grubb 013d50
-		    exit 1
Steve Grubb 013d50
-		fi
Steve Grubb 013d50
-	    popd >/dev/null
Steve Grubb 013d50
-	fi
Steve Grubb 013d50
-        nice -20 /usr/sbin/aide --check 2>/dev/null
Steve Grubb 013d50
-    fi
Steve Grubb 013d50
-fi
Steve Grubb 013d50
-
Steve Grubb 013d50
-exit 0
Steve Grubb 013d50
+#!/bin/sh
Steve Grubb 013d50
+# $Id: aide-0.12-dedosify.patch,v 1.1 2009/01/30 21:39:33 sgrubb Exp $
Steve Grubb 013d50
+
Steve Grubb 013d50
+# Script by Vincent Danen <vdanen@linsec.ca>
Steve Grubb 013d50
+
Steve Grubb 013d50
+hostname=`uname -n`
Steve Grubb 013d50
+echo "AIDE integrity check for ${hostname} beginning (`date`)"
Steve Grubb 013d50
+echo ""
Steve Grubb 013d50
+if [ ! -e /var/lib/aide/aide.db ] ; then
Steve Grubb 013d50
+    echo "**** Error: AIDE database for ${hostname} not found."
Steve Grubb 013d50
+    echo "**** Run 'aide --init' and move the appropriate database file."
Steve Grubb 013d50
+else
Steve Grubb 013d50
+    if [ -f /etc/aide.conf ]; then
Steve Grubb 013d50
+        if [ -f /var/lib/aide/aide.db.sig ]; then
Steve Grubb 013d50
+	    pushd /var/lib/aide >/dev/null
Steve Grubb 013d50
+	        echo "Verifying the GPG signature on the database..."
Steve Grubb 013d50
+		echo ""
Steve Grubb 013d50
+	        gpg --verify aide.db.sig
Steve Grubb 013d50
+		echo ""
Steve Grubb 013d50
+		if [ "$?" == "1" ]; then
Steve Grubb 013d50
+		    echo "************************************************************"
Steve Grubb 013d50
+		    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb 013d50
+		    echo "************************************************************"
Steve Grubb 013d50
+		    exit 1
Steve Grubb 013d50
+		fi
Steve Grubb 013d50
+	    popd >/dev/null
Steve Grubb 013d50
+	fi
Steve Grubb 013d50
+        nice -20 /usr/sbin/aide --check 2>/dev/null
Steve Grubb 013d50
+    fi
Steve Grubb 013d50
+fi
Steve Grubb 013d50
+
Steve Grubb 013d50
+exit 0
Steve Grubb 013d50
--- aide-0.12/contrib/gpg2_update.sh.spc	2007-06-21 12:37:24.000000000 -0400
Steve Grubb 013d50
+++ aide-0.12/contrib/gpg2_update.sh	2007-06-21 12:39:43.000000000 -0400
Steve Grubb 013d50
@@ -1,52 +1,52 @@
Steve Grubb 013d50
-#!/bin/sh
Steve Grubb 013d50
-# $Id: aide-0.12-dedosify.patch,v 1.1 2009/01/30 21:39:33 sgrubb Exp $
Steve Grubb 013d50
-#
Steve Grubb 013d50
-# script to update and rotate the AIDE database files and, optionally
Steve Grubb 013d50
-# create a detached GPG signature to verify the database file
Steve Grubb 013d50
-#
Steve Grubb 013d50
-# written by Vincent Danen <vdanen-at-annvix.org> 01/21/2006
Steve Grubb 013d50
-
Steve Grubb 013d50
-usegpg=0
Steve Grubb 013d50
-
Steve Grubb 013d50
-if [ -f /root/.gnupg/secring.gpg ]; then
Steve Grubb 013d50
-    usegpg=1
Steve Grubb 013d50
-fi
Steve Grubb 013d50
-
Steve Grubb 013d50
-if [ ! -d /var/lib/aide ]; then
Steve Grubb 013d50
-    echo "The AIDE database directory /var/lib/aide does not exist!"
Steve Grubb 013d50
-    exit 1
Steve Grubb 013d50
-fi
Steve Grubb 013d50
-
Steve Grubb 013d50
-pushd /var/lib/aide >/dev/null
Steve Grubb 013d50
-
Steve Grubb 013d50
-# copy the old database
Steve Grubb 013d50
-if [ -f aide.db ]; then
Steve Grubb 013d50
-    newfile="aide-`hostname`-`date +%Y%m%d-%H%M%S`.db"
Steve Grubb 013d50
-    if [ "${usegpg}" == 1 -a -f aide.db.sig ]; then
Steve Grubb 013d50
-        # do an integrity check
Steve Grubb 013d50
-	gpg --verify aide.db.sig
Steve Grubb 013d50
-	if [ "$?" == "1" ]; then
Steve Grubb 013d50
-	    echo "************************************************************"
Steve Grubb 013d50
-	    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb 013d50
-	    echo "************************************************************"
Steve Grubb 013d50
-	    exit 1
Steve Grubb 013d50
-	fi
Steve Grubb 013d50
-    fi
Steve Grubb 013d50
-    cp -av aide.db ${newfile} 
Steve Grubb 013d50
-    /usr/sbin/aide --update -B "database=file:/var/lib/aide/${newfile}" 
Steve Grubb 013d50
-    if [ "${usegpg}" == "1" ]; then
Steve Grubb 013d50
-	# create the signature file
Steve Grubb 013d50
-	[[ -f aide.db.sig ]] && rm -f aide.db.sig
Steve Grubb 013d50
-        gpg --detach-sign aide.db
Steve Grubb 013d50
-	if [ "$?" == "1" ]; then
Steve Grubb 013d50
-	    echo "FATAL:  Error occurred when creating the signature file!"
Steve Grubb 013d50
-	    exit 1
Steve Grubb 013d50
-	fi
Steve Grubb 013d50
-    fi
Steve Grubb 013d50
-    gzip -9f ${newfile}
Steve Grubb 013d50
-else
Steve Grubb 013d50
-    echo "The AIDE database does not exist, can't update!"
Steve Grubb 013d50
-    exit 1
Steve Grubb 013d50
-fi
Steve Grubb 013d50
-
Steve Grubb 013d50
-popd >/dev/null
Steve Grubb 013d50
+#!/bin/sh
Steve Grubb 013d50
+# $Id: aide-0.12-dedosify.patch,v 1.1 2009/01/30 21:39:33 sgrubb Exp $
Steve Grubb 013d50
+#
Steve Grubb 013d50
+# script to update and rotate the AIDE database files and, optionally
Steve Grubb 013d50
+# create a detached GPG signature to verify the database file
Steve Grubb 013d50
+#
Steve Grubb 013d50
+# written by Vincent Danen <vdanen-at-annvix.org> 01/21/2006
Steve Grubb 013d50
+
Steve Grubb 013d50
+usegpg=0
Steve Grubb 013d50
+
Steve Grubb 013d50
+if [ -f /root/.gnupg/secring.gpg ]; then
Steve Grubb 013d50
+    usegpg=1
Steve Grubb 013d50
+fi
Steve Grubb 013d50
+
Steve Grubb 013d50
+if [ ! -d /var/lib/aide ]; then
Steve Grubb 013d50
+    echo "The AIDE database directory /var/lib/aide does not exist!"
Steve Grubb 013d50
+    exit 1
Steve Grubb 013d50
+fi
Steve Grubb 013d50
+
Steve Grubb 013d50
+pushd /var/lib/aide >/dev/null
Steve Grubb 013d50
+
Steve Grubb 013d50
+# copy the old database
Steve Grubb 013d50
+if [ -f aide.db ]; then
Steve Grubb 013d50
+    newfile="aide-`hostname`-`date +%Y%m%d-%H%M%S`.db"
Steve Grubb 013d50
+    if [ "${usegpg}" == 1 -a -f aide.db.sig ]; then
Steve Grubb 013d50
+        # do an integrity check
Steve Grubb 013d50
+	gpg --verify aide.db.sig
Steve Grubb 013d50
+	if [ "$?" == "1" ]; then
Steve Grubb 013d50
+	    echo "************************************************************"
Steve Grubb 013d50
+	    echo "GPG signature FAILED!  Your database has been tampered with!"
Steve Grubb 013d50
+	    echo "************************************************************"
Steve Grubb 013d50
+	    exit 1
Steve Grubb 013d50
+	fi
Steve Grubb 013d50
+    fi
Steve Grubb 013d50
+    cp -av aide.db ${newfile} 
Steve Grubb 013d50
+    /usr/sbin/aide --update -B "database=file:/var/lib/aide/${newfile}" 
Steve Grubb 013d50
+    if [ "${usegpg}" == "1" ]; then
Steve Grubb 013d50
+	# create the signature file
Steve Grubb 013d50
+	[[ -f aide.db.sig ]] && rm -f aide.db.sig
Steve Grubb 013d50
+        gpg --detach-sign aide.db
Steve Grubb 013d50
+	if [ "$?" == "1" ]; then
Steve Grubb 013d50
+	    echo "FATAL:  Error occurred when creating the signature file!"
Steve Grubb 013d50
+	    exit 1
Steve Grubb 013d50
+	fi
Steve Grubb 013d50
+    fi
Steve Grubb 013d50
+    gzip -9f ${newfile}
Steve Grubb 013d50
+else
Steve Grubb 013d50
+    echo "The AIDE database does not exist, can't update!"
Steve Grubb 013d50
+    exit 1
Steve Grubb 013d50
+fi
Steve Grubb 013d50
+
Steve Grubb 013d50
+popd >/dev/null