mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-27 10:19:23 -05:00
speed up setuid removal by using find with '-perm /u=s,g=s'
https://forums.whonix.org/t/permission-hardening/8655/19
This commit is contained in:
parent
4cfdf2c65b
commit
1ffa8e197e
@ -18,7 +18,7 @@ echo_wrapper() {
|
||||
|
||||
add_nosuid_statoverride_entry() {
|
||||
fso_to_process="${fso_without_trailing_slash}/"
|
||||
should_be_counter="$(find "$fso_to_process" | wc -l)"
|
||||
should_be_counter="$(find "$fso_to_process" -perm /u=s,g=s | wc -l)"
|
||||
counter_actual=0
|
||||
|
||||
while read -r line; do
|
||||
@ -119,7 +119,7 @@ add_nosuid_statoverride_entry() {
|
||||
|
||||
## /lib will hit ARG_MAX.
|
||||
## https://forums.whonix.org/t/kernel-hardening/7296/326
|
||||
done < <( find "$fso_to_process" -print0 | xargs -I{} -0 stat -c "%n %a %U %G" {} )
|
||||
done < <( find "$fso_to_process" -perm /u=s,g=s -print0 | xargs -I{} -0 stat -c "%n %a %U %G" {} )
|
||||
|
||||
## Sanity test.
|
||||
if [ ! "$should_be_counter" = "$counter_actual" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user