mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-26 07:21:15 +01:00
Merge pull request #833 from tschettervictor/patch-3
console: Fix _jail > TARGET
This commit is contained in:
@@ -94,10 +94,10 @@ fi
|
||||
|
||||
validate_user() {
|
||||
if jexec -l "${TARGET}" id "${USER}" >/dev/null 2>&1; then
|
||||
USER_SHELL="$(jexec -l "${_jail}" getent passwd "${USER}" | cut -d: -f7)"
|
||||
USER_SHELL="$(jexec -l "${TARGET}" 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}"
|
||||
if jexec -l "${TARGET}" grep -qwF "${USER_SHELL}" /etc/shells; then
|
||||
jexec -l "${TARGET}" $LOGIN -f "${USER}"
|
||||
else
|
||||
echo "Invalid shell for user ${USER}"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user