mirror of
https://github.com/hackacad/bastille.git
synced 2025-12-22 02:00:08 +01:00
Merge pull request #290 from andrewhotlab/master
Respect exec.fib parameter in console command
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
. /usr/local/share/bastille/common.sh
|
. /usr/local/share/bastille/common.sh
|
||||||
|
. /usr/local/etc/bastille/bastille.conf
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
error_exit "Usage: bastille console TARGET [user]'"
|
error_exit "Usage: bastille console TARGET [user]'"
|
||||||
@@ -64,12 +65,22 @@ validate_user() {
|
|||||||
fi
|
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
|
for _jail in ${JAILS}; do
|
||||||
info "[${_jail}]:"
|
info "[${_jail}]:"
|
||||||
if [ -n "${USER}" ]; then
|
if [ -n "${USER}" ]; then
|
||||||
validate_user
|
validate_user
|
||||||
else
|
else
|
||||||
jexec -l "${_jail}" /usr/bin/login -f root
|
check_fib
|
||||||
|
${_setfib} jexec -l "${_jail}" /usr/bin/login -f root
|
||||||
fi
|
fi
|
||||||
echo
|
echo
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user