Skip to content

Commit

Permalink
Add check for nosuid data mount (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerpogo authored Oct 16, 2024
1 parent 18d6dfa commit f36be4e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dojo/dojo-init
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/bin/sh

if findmnt -n /data >/dev/null; then
echo '[+] Data mount exists.'
mount --make-shared /data
else
data_mnt_opts="$(findmnt -n -o OPTIONS /data)"
if [ "$?" -ne 0 ]; then
echo '[!] Data mount does not exist. Please start the dojo with a data mount (`-v /data:/data`).'
exit 1
fi
echo '[+] Data mount exists.'
mount --make-shared /data

if printf '%s' "$data_mnt_opts" | grep -q '\bnosuid\b'; then
echo '[!] Data mount is mounted nosuid. Please check the mount options on the data directory.'
exit 1
fi

>> /data/config.env

Expand Down

0 comments on commit f36be4e

Please sign in to comment.