mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-24 11:12:12 +01:00
Fix console with a user
Sorry, boys, but do you even *minimally* test your changes?
This commit is contained in:
@@ -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
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user