mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-26 19:19:22 -05:00
fix capability removal error handling
https://forums.whonix.org/t/disable-suid-binaries/7706/45
This commit is contained in:
parent
b631e2ecd8
commit
17a8c29470
@ -386,10 +386,17 @@ set_file_perms() {
|
||||
fi
|
||||
|
||||
if [ "$capability_from_config" = "none" ]; then
|
||||
# sudo setcap -r /usr/bin/ping
|
||||
## https://forums.whonix.org/t/disable-suid-binaries/7706/45
|
||||
# sudo setcap -r /usr/bin/ping 2>/dev/null
|
||||
# Failed to set capabilities on file `/usr/bin/ping' (No data available)
|
||||
# The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file
|
||||
echo_wrapper_audit setcap -r "$fso"
|
||||
## Therefore use echo_wrapper_ignore.
|
||||
echo_wrapper_ignore setcap -r "$fso"
|
||||
getcap_output="$(getcap "$fso")"
|
||||
if [ ! "$getcap_output" = "" ]; then
|
||||
echo "ERROR: removing capabilities for fso '$fso' failed!" >&2
|
||||
continue
|
||||
fi
|
||||
else
|
||||
if ! capsh --print | grep "Bounding set" | grep -q "$capability_from_config" ; then
|
||||
echo "ERROR: capability_from_config '$capability_from_config' does not exist!" >&2
|
||||
|
Loading…
Reference in New Issue
Block a user