Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Respect exec.fib parameter in console command #290

Merged
merged 1 commit into from
Dec 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion usr/local/share/bastille/console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

. /usr/local/share/bastille/common.sh
. /usr/local/etc/bastille/bastille.conf

usage() {
error_exit "Usage: bastille console TARGET [user]'"
Expand Down Expand Up @@ -64,12 +65,22 @@ validate_user() {
fi
}

check_fib() {
fib=$(grep 'exec.fib' "${bastille_jailsdir}/${_jail}/jail.conf" | awk '{print $3}' | sed 's/\;//g')
if [ -n "${fib}" ]; then
_setfib="setfib -F ${fib}"
else
_setfib=""
fi
}

for _jail in ${JAILS}; do
info "[${_jail}]:"
if [ -n "${USER}" ]; then
validate_user
else
jexec -l "${_jail}" /usr/bin/login -f root
check_fib
${_setfib} jexec -l "${_jail}" /usr/bin/login -f root
fi
echo
done