1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #13830 from clnperez/check-apparmor-file-first

Check for apparmor file before reading it
This commit is contained in:
Tibor Vass 2015-06-18 08:18:01 -04:00
commit fc793bf1a3
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,7 @@ fi
if [ -z "$DOCKER_TEST_HOST" ]; then
# Start apparmor if it is enabled
if [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
# reset container variable so apparmor profile is applied to process
# see https://github.com/docker/libcontainer/blob/master/apparmor/apparmor.go#L16
export container=""

View file

@ -12,7 +12,7 @@ done
if [ -z "$DOCKER_TEST_HOST" ]; then
# Stop apparmor if it is enabled
if [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
if [ -e "/sys/module/apparmor/parameters/enabled" ] && [ "$(cat /sys/module/apparmor/parameters/enabled)" == "Y" ]; then
(
set -x
/etc/init.d/apparmor stop