From acf2f08f5d90e641f1ab883b4f54966b0d3f40fc Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Tue, 6 May 2025 09:33:54 +0200 Subject: [PATCH] Fix `console` with a user Sorry, boys, but do you even *minimally* test your changes? --- usr/local/share/bastille/console.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/local/share/bastille/console.sh b/usr/local/share/bastille/console.sh index d90be987..1457eb79 100644 --- a/usr/local/share/bastille/console.sh +++ b/usr/local/share/bastille/console.sh @@ -92,18 +92,18 @@ validate_user() { local _user="${2}" if jexec -l "${_jail}" id "${_user}" >/dev/null 2>&1; then - USER_SHELL="$(jexec -l "${_jail}" getent passwd "${_user}}" | cut -d: -f7)" + USER_SHELL="$(jexec -l "${_jail}" getent passwd "${_user}" | cut -d: -f7)" if [ -n "${USER_SHELL}" ]; then if jexec -l "${_jail}" grep -qwF "${USER_SHELL}" /etc/shells; then - jexec -l "${_jail}" $LOGIN -f "${_user}}" + jexec -l "${_jail}" $LOGIN -f "${_user}" else - echo "Invalid shell for user ${_user}}" + echo "Invalid shell for user ${_user}" fi else - echo "User ${_user}} has no shell" + echo "User ${_user} has no shell" fi else - echo "Unknown user ${_user}}" + echo "Unknown user ${_user}" fi } @@ -143,4 +143,4 @@ for _jail in ${JAILS}; do ${_setfib} jexec -l "${_jail}" $LOGIN -f root fi -done \ No newline at end of file +done