From cc38fabd3169ddbcd1158054788c7f50d9542842 Mon Sep 17 00:00:00 2001 From: Christer Edwards Date: Sat, 31 Jul 2021 15:22:17 -0600 Subject: [PATCH] fix overloaded variable in mount command --- usr/local/share/bastille/mount.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/local/share/bastille/mount.sh b/usr/local/share/bastille/mount.sh index 298d42a3..b6a9f7d5 100644 --- a/usr/local/share/bastille/mount.sh +++ b/usr/local/share/bastille/mount.sh @@ -93,25 +93,25 @@ for _jail in ${JAILS}; do info "[${_jail}]:" ## aggregate variables into FSTAB entry - _jailpath="${bastille_jailsdir}/${_jail}/root/${_jailpath}" - _fstab_entry="${_hostpath} ${_jailpath} ${_type} ${_perms} ${_checks}" + _fullpath="${bastille_jailsdir}/${_jail}/root/${_jailpath}" + _fstab_entry="${_hostpath} ${_fullpath} ${_type} ${_perms} ${_checks}" ## Create mount point if it does not exist. -- cwells - if [ ! -d "${_jailpath}" ]; then - if ! mkdir -p "${_jailpath}"; then + if [ ! -d "${_fullpath}" ]; then + if ! mkdir -p "${_fullpath}"; then error_exit "Failed to create mount point inside jail." fi fi ## if entry doesn't exist, add; else show existing entry - if ! egrep -q "[[:blank:]]${_jailpath}[[:blank:]]" "${bastille_jailsdir}/${_jail}/fstab" 2> /dev/null; then + if ! egrep -q "[[:blank:]]${_fullpath}[[:blank:]]" "${bastille_jailsdir}/${_jail}/fstab" 2> /dev/null; then if ! echo "${_fstab_entry}" >> "${bastille_jailsdir}/${_jail}/fstab"; then error_exit "Failed to create fstab entry: ${_fstab_entry}" fi echo "Added: ${_fstab_entry}" else warn "Mountpoint already present in ${bastille_jailsdir}/${_jail}/fstab" - egrep "[[:blank:]]${_jailpath}[[:blank:]]" "${bastille_jailsdir}/${_jail}/fstab" + egrep "[[:blank:]]${_fullpath}[[:blank:]]" "${bastille_jailsdir}/${_jail}/fstab" fi mount -F "${bastille_jailsdir}/${_jail}/fstab" -a echo