mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-17 15:50:11 +01:00
Properly copy resolv.conf file from host
Properly copy resolv.conf file from host to jail by following the symlink, and cleanup. The resolv.conf file in some compact/embedded distributions is a symlink, hence some users complaint about jails has no internet access, this workaround does fix this problem.
This commit is contained in:
@@ -95,7 +95,14 @@ for _jail in ${JAILS}; do
|
||||
host_path="${HOST_PATH}"
|
||||
jail_path="$(echo ${bastille_jailsdir}/${_jail}/root/${JAIL_PATH} | sed 's#//#/#g')"
|
||||
|
||||
if ! cp "${OPTION}" "${host_path}" "${jail_path}"; then
|
||||
# Workaround to properly copy host resolv.conf to jail if the host file is a symlink.
|
||||
if [ "${host_path}" = "${bastille_resolv_conf}" ] && [ -L "${host_path}" ]; then
|
||||
_option="${OPTION}L"
|
||||
else
|
||||
_option="${OPTION}"
|
||||
fi
|
||||
|
||||
if ! cp "${_option}" "${host_path}" "${jail_path}"; then
|
||||
ERRORS=$((ERRORS + 1))
|
||||
error_continue "[ERROR]: CP failed: ${host_path} -> ${jail_path}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user