updated on Wed Jan 25 08:34:36 UTC 2012
[aur-mirror.git] / linux-pax / linux-pax-fix-permissions
blob21f461726d19d1b36933dddcbd4b1de2b4aae8b6
1 #!/bin/sh
3 declare -A perms
5 perms=(
6 # MPROTECT and RANDMMAP off
7 ['PSmXEr']='
8 /usr/lib/chromium/chromium
9 /usr/lib/firefox/firefox-bin
10 /usr/lib/firefox/plugin-container
11 /usr/lib/thunderbird/thunderbird-bin
13 # PAGEEXEC and MPROTECT off
14 ['pSmXER']='
15 /opt/Osmos/Osmos.bin32
16 /opt/Osmos/Osmos.bin64
17 /usr/share/worldofgoo/WorldOfGoo.bin32
18 /usr/share/worldofgoo/WorldOfGoo.bin64
20 # MPROTECT off
21 ['PSmXER']='
22 /usr/bin/glxgears
23 /usr/bin/glxinfo
24 /usr/bin/mplayer
25 /usr/bin/valgrind
26 /usr/lib/valgrind/cachegrind-amd64-linux
27 /usr/lib/valgrind/cachegrind-x86-linux
28 /usr/lib/valgrind/callgrind-amd64-linux
29 /usr/lib/valgrind/callgrind-x86-linux
30 /usr/lib/valgrind/drd-amd64-linux
31 /usr/lib/valgrind/drd-x86-linux
32 /usr/lib/valgrind/exp-bbv-amd64-linux
33 /usr/lib/valgrind/exp-bbv-x86-linux
34 /usr/lib/valgrind/exp-dhat-amd64-linux
35 /usr/lib/valgrind/exp-dhat-x86-linux
36 /usr/lib/valgrind/exp-sgcheck-amd64-linux
37 /usr/lib/valgrind/exp-sgcheck-x86-linux
38 /usr/lib/valgrind/helgrind-amd64-linux
39 /usr/lib/valgrind/helgrind-x86-linux
40 /usr/lib/valgrind/lackey-amd64-linux
41 /usr/lib/valgrind/lackey-x86-linux
42 /usr/lib/valgrind/massif-amd64-linux
43 /usr/lib/valgrind/massif-x86-linux
44 /usr/lib/valgrind/memcheck-amd64-linux
45 /usr/lib/valgrind/memcheck-x86-linux
46 /usr/lib/valgrind/none-amd64-linux
47 /usr/lib/valgrind/none-x86-linux
48 /usr/lib/xbmc/xbmc.bin
50 # All off
51 ['psmxer']='
52 /usr/bin/java
56 [ "$UID" = "0" ] || {
57 sudo $0
58 exit $!
61 echo Some programs do not work properly without deactivating some of the PaX
62 echo features. Please close all instances of them if you want to change the
63 echo configuration for the following binaries:
65 for perm in ${!perms[@]}; do
66 for path in ${perms[$perm]}; do
67 [ -f $path ] && echo " * $path"
68 done
69 done
71 echo
72 echo Continue writing PaX headers? \[Y/n\]
74 read a
76 case $a in
77 "Y"|"y"|"")
78 for perm in ${!perms[@]}; do
79 for path in ${perms[$perm]}; do
80 [ -f $path ] && {
81 echo $perm $path
82 paxctl -c$perm $path
84 done
85 done
88 exit 0
90 esac