summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <basile@opensource.dyc.edu>2011-01-03 16:45:58 -0500
committerAnthony G. Basile <basile@opensource.dyc.edu>2011-01-03 16:45:58 -0500
commit956ddc907a3bbf02136bc607e051a6c176d90ae2 (patch)
tree4ff58e13d4086e23b5900898a20264aff98c902e /re.patch.sh
parentUpdate Grsec/PaX (diff)
downloadhardened-patchset-956ddc907a3bbf02136bc607e051a6c176d90ae2.tar.gz
hardened-patchset-956ddc907a3bbf02136bc607e051a6c176d90ae2.tar.bz2
hardened-patchset-956ddc907a3bbf02136bc607e051a6c176d90ae2.zip
Added script to reverse apply patchset
Diffstat (limited to 're.patch.sh')
-rwxr-xr-xre.patch.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/re.patch.sh b/re.patch.sh
new file mode 100755
index 0000000..d1ac153
--- /dev/null
+++ b/re.patch.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+SCRIPT="${0}"
+KMAJOR="${1}"
+PATCHSET="/root/hardened-patchset/${KMAJOR}"
+
+if [[ -z "${KMAJOR}" ]] ; then
+ echo "Usage: ${SCRIPT} <kernel_major>"
+ exit
+fi
+
+if [[ ! -d ${PATCHSET} ]] ; then
+ echo "Patchset ${KMAJOR} doesn't exist"
+ exit
+fi
+
+for p in $(ls ${PATCHSET} | sort -r) ; do
+ if [[ ${p#0000} == $p ]] ; then
+ echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ echo
+ echo $p
+ echo
+ echo "Cont?"
+ read n
+ echo
+ patch -p 1 -R < ${PATCHSET}/$p
+ echo
+ echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ fi
+done
+