Skip to content

Commit 6e8ef4c

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

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ 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)
29-
$ cat <<EOF > ~/${filename}
28+
$ filename=$(echo $HOME/bin/rootlesskit | sed -e 's@^/@@' -e 's@/@.@g')
29+
$ [ ! -z "${filename}" ] && sudo cat <<EOF > /etc/apparmor.d/${filename}
3030
abi <abi/4.0>,
3131
include <tunables/global>
3232

@@ -36,7 +36,6 @@ weight: 30
3636
include if exists <local/${filename}>
3737
}
3838
EOF
39-
$ sudo mv ~/${filename} /etc/apparmor.d/${filename}
4039
```
4140
2. Restart AppArmor.
4241

@@ -382,4 +381,4 @@ remove the binary files under `~/bin`:
382381
```console
383382
$ cd ~/bin
384383
$ 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-
```
384+
```

0 commit comments

Comments
 (0)