Skip to content

Commit eb9d593

Browse files
committed
engine: safer creation of rootlesskit apparmor profile
Signed-off-by: David Karlsson <[email protected]>
1 parent 97c5ec3 commit eb9d593

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/manuals/engine/security/rootless/troubleshoot.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ weight: 30
2525
1. Create and install the currently logged-in user's AppArmor profile:
2626

2727
```console
28-
$ filename=$(echo $HOME/bin/rootlesskit | sed -e s@^/@@ -e s@/@.@g)
28+
$ export filename=$(echo $HOME/bin/rootlesskit | sed -e s@^/@@ -e s@/@.@g)
2929
$ cat <<EOF > ~/${filename}
3030
abi <abi/4.0>,
3131
include <tunables/global>
@@ -36,7 +36,7 @@ weight: 30
3636
include if exists <local/${filename}>
3737
}
3838
EOF
39-
$ sudo mv ~/${filename} /etc/apparmor.d/${filename}
39+
$ [ -f ~/"${filename}" ] && sudo mv ~/${filename} /etc/apparmor.d/${filename}
4040
```
4141
2. Restart AppArmor.
4242

@@ -382,4 +382,4 @@ remove the binary files under `~/bin`:
382382
```console
383383
$ cd ~/bin
384384
$ rm -f containerd containerd-shim containerd-shim-runc-v2 ctr docker docker-init docker-proxy dockerd dockerd-rootless-setuptool.sh dockerd-rootless.sh rootlesskit rootlesskit-docker-proxy runc vpnkit
385-
```
385+
```

0 commit comments

Comments
 (0)