Lines 1-9
Link Here
|
1 |
#!/bin/bash |
1 |
#!/bin/sh |
2 |
# Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary |
2 |
# Wrapper for $(LIBTOOL) that performs PaX marking on the dumper binary |
3 |
# generated by g-ir-scanner. |
3 |
# generated by g-ir-scanner. |
4 |
# PaX marking code stolen from pax-utils.eclass |
4 |
# PaX marking code stolen from pax-utils.eclass |
5 |
|
5 |
|
6 |
flags=${1//-}; shift |
6 |
flags=${1##-}; shift |
7 |
|
7 |
|
8 |
echo ${LIBTOOL} "$@" |
8 |
echo ${LIBTOOL} "$@" |
9 |
${LIBTOOL} "$@" |
9 |
${LIBTOOL} "$@" |
Lines 12-18
retval=$?
Link Here
|
12 |
|
12 |
|
13 |
files=$(find . -path "*tmp-introspect*/.libs/*") |
13 |
files=$(find . -path "*tmp-introspect*/.libs/*") |
14 |
|
14 |
|
15 |
if type -p paxctl > /dev/null; then |
15 |
if command -v paxctl-ng > /dev/null && paxctl-ng -L; then |
|
|
16 |
echo "PT PaX marking -${flags} ${files}" |
17 |
for f in ${files}; do |
18 |
paxctl-ng -L -${flags} "${f}" |
19 |
done |
20 |
elif command -v paxctl > /dev/null; then |
16 |
echo "PT PaX marking -${flags} ${files}" |
21 |
echo "PT PaX marking -${flags} ${files}" |
17 |
for f in ${files}; do |
22 |
for f in ${files}; do |
18 |
# First, try modifying the existing PAX_FLAGS header |
23 |
# First, try modifying the existing PAX_FLAGS header |
Lines 23-33
if type -p paxctl > /dev/null; then
Link Here
|
23 |
# insert a PT_GNU_STACK header (works on ET_EXEC) |
28 |
# insert a PT_GNU_STACK header (works on ET_EXEC) |
24 |
paxctl -qC${flags} "${f}" && continue |
29 |
paxctl -qC${flags} "${f}" && continue |
25 |
done |
30 |
done |
26 |
elif type -p scanelf > /dev/null; then |
31 |
elif command -v scanelf > /dev/null; then |
27 |
# Try scanelf, the Gentoo swiss-army knife ELF utility |
32 |
# Try scanelf, the Gentoo swiss-army knife ELF utility |
28 |
# Currently this sets PT if it can, no option to control what it does. |
33 |
# Currently this sets PT if it can, no option to control what it does. |
29 |
echo "Fallback PaX marking -${flags} ${files}" |
34 |
echo "Fallback PaX marking -${flags} ${files}" |
30 |
scanelf -Xxz ${flags} ${files} |
35 |
scanelf -Xxz ${flags} ${files} |
31 |
fi |
36 |
fi |
32 |
|
37 |
|
|
|
38 |
if command -v paxctl-ng > /dev/null && paxctl-ng -l; then |
39 |
echo "XT PaX marking -${flags} ${files}" |
40 |
for f in ${files}; do |
41 |
paxctl-ng -l -${flags} "${f}" |
42 |
done |
43 |
fi |
44 |
|
33 |
exit ${retval} |
45 |
exit ${retval} |