summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-client/epiphany/files/paxctl.sh')
-rwxr-xr-xwww-client/epiphany/files/paxctl.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/www-client/epiphany/files/paxctl.sh b/www-client/epiphany/files/paxctl.sh
new file mode 100755
index 0000000..bb1b6e0
--- /dev/null
+++ b/www-client/epiphany/files/paxctl.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+# PaX marking code stolen from pax-utils.eclass
+
+flags=${1//-}; shift
+
+if type -p paxctl > /dev/null; then
+ echo "PT PaX marking -${flags} $@"
+ for f in "$@"; do
+ # First, try modifying the existing PAX_FLAGS header
+ paxctl -q${flags} "${f}" && continue
+ # Second, try stealing the (unused under PaX) PT_GNU_STACK header
+ paxctl -qc${flags} "${f}" && continue
+ # Third, try pulling the base down a page, to create space and
+ # insert a PT_GNU_STACK header (works on ET_EXEC)
+ paxctl -qC${flags} "${f}" && continue
+ done
+elif type -p scanelf > /dev/null; then
+ # Try scanelf, the Gentoo swiss-army knife ELF utility
+ # Currently this sets PT if it can, no option to control what it does.
+ echo "Fallback PaX marking -${flags} $@"
+ scanelf -Xxz ${flags} "$@"
+fi
+
+exit 0