2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 14:25:52 +00:00

change_hat_profile_access.patch

This commit is contained in:
John Johansen
2007-12-23 01:02:35 +00:00
parent 7cb38c90aa
commit 25c06ea4fb

View File

@@ -335,6 +335,7 @@ fi
local num_emitted imagename hat args arg names1 names2
#global complainflag escapeflag nodefaults profile profilenames
local hat_string="hat:"
complainflag=""
escapeflag=""
@@ -392,7 +393,9 @@ fi
;;
esac
num_args=0
#give every profile/hat access to change_hat
args[0]="/proc/*/attr/current:w"
num_args=1
while [ $# -gt 0 ]
do
arg="$1"
@@ -404,8 +407,15 @@ fi
eval emit_profile \"$imagename\" \"$imageperm\" \
$(for i in $(seq 0 $((${num_args} - 1))) ; do echo \"\${args[${i}]}\" ; done)
num_emitted=$((num_emitted + 1))
num_args=0
#give every profile/hat access to change_hat
args[0]="/proc/*/attr/current:w"
num_args=1
continue 2
elif [ ${arg:0:4} == "hat:" ] ; then
args[${num_args}]=${arg}
num_args=$(($num_args + 1))
args[${num_args}]="/proc/*/attr/current:w"
num_args=$(($num_args + 1))
else
args[${num_args}]=${arg}
num_args=$(($num_args + 1))