mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-28 22:36:13 -05:00
check string length of permission variable
https://forums.whonix.org/t/kernel-hardening/7296/322
This commit is contained in:
parent
a89befd902
commit
2c163bf439
@ -25,7 +25,14 @@ add_statoverride_entry() {
|
||||
fi
|
||||
|
||||
if test -u "${file_name}" || test -g "${file_name}"; then
|
||||
echo "suid - file_name: '${file_name}' | existing_mode: '${existing_mode}' | existing_mode:1: '${existing_mode:1}'"
|
||||
string_length_of_existing_mode="${#existing_mode}"
|
||||
if [ "$string_length_of_existing_mode" = "4" ]; then
|
||||
newmode="${existing_mode:1}"
|
||||
else
|
||||
newmode="${existing_mode}"
|
||||
fi
|
||||
|
||||
echo "suid - file_name: '${file_name}' | existing_mode: '${existing_mode}' | newmode: '$newmode'"
|
||||
|
||||
if dpkg-statoverride --list | grep -q "${file_name}"; then
|
||||
if ! dpkg-statoverride --list | grep -q "${owner} ${group} ${existing_mode:1} ${file_name}"; then
|
||||
|
Loading…
Reference in New Issue
Block a user