updated on Thu Jan 12 16:09:17 UTC 2012
[aur-mirror.git] / linux-pax / linux-pax-fix-permissions
blobca4cb99d01e57c76295fc4fa175646f591a07d59
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/lib/xbmc/xbmc.bin
27 # All off
28 ['psmxer']='
29 /usr/bin/java
33 [ "$UID" = "0" ] || {
34 sudo $0
35 exit $!
38 echo Some programs do not work properly without deactivating some of the PaX
39 echo features. Please close all instances of them if you want to change the
40 echo configuration for the following binaries:
42 for perm in ${!perms[@]}; do
43 for path in ${perms[$perm]}; do
44 [ -f $path ] && echo " * $path"
45 done
46 done
48 echo
49 echo Continue writing PaX headers? \[Y/n\]
51 read a
53 case $a in
54 "Y"|"y"|"")
55 for perm in ${!perms[@]}; do
56 for path in ${perms[$perm]}; do
57 [ -f $path ] && {
58 echo $perm $path
59 paxctl -c$perm $path
61 done
62 done
65 exit 0
67 esac