Skip to content

Commit

Permalink
Merge pull request #461 from robarnold/devfs
Browse files Browse the repository at this point in the history
Use the devfs_ruleset number from imported iocage jails
  • Loading branch information
cedwards authored Dec 9, 2021
2 parents d6b12f9 + 5aba3df commit 2327c6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion usr/local/share/bastille/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,16 @@ generate_config() {
# Attempt to read previous config file and set required variables accordingly
# If we can't get a valid interface, fallback to lo1 and warn user
info "Generating jail.conf..."
DEVFS_RULESET=4

if [ "${FILE_EXT}" = ".zip" ]; then
# Gather some bits from foreign/iocage config files
JSON_CONFIG="${bastille_jailsdir}/${TARGET_TRIM}/config.json"
if [ -n "${JSON_CONFIG}" ]; then
IPV4_CONFIG=$(grep -wo '\"ip4_addr\": \".*\"' "${JSON_CONFIG}" | tr -d '" ' | sed 's/ip4_addr://')
IPV6_CONFIG=$(grep -wo '\"ip6_addr\": \".*\"' "${JSON_CONFIG}" | tr -d '" ' | sed 's/ip6_addr://')
DEVFS_RULESET=$(grep -wo '\"devfs_ruleset\": \".*\"' "${JSON_CONFIG}" | tr -d '" ' | sed 's/devfs_ruleset://')
DEVFS_RULESET=${DEVFS_RULESET:-4}
fi
elif [ "${FILE_EXT}" = ".tar.gz" ]; then
# Gather some bits from foreign/ezjail config files
Expand Down Expand Up @@ -257,7 +260,7 @@ generate_config() {
# Generate a basic jail configuration file on foreign imports
cat << EOF > "${bastille_jailsdir}/${TARGET_TRIM}/jail.conf"
${TARGET_TRIM} {
devfs_ruleset = 4;
devfs_ruleset = ${DEVFS_RULESET};
enforce_statfs = 2;
exec.clean;
exec.consolelog = ${bastille_logsdir}/${TARGET_TRIM}_console.log;
Expand Down

0 comments on commit 2327c6a

Please sign in to comment.