refactoring

This commit is contained in:
Patrick Schleizer 2019-12-20 03:40:47 -05:00
parent 98535e3a2b
commit b92a690c16
No known key found for this signature in database
GPG key ID: CB8D50BB77BB3C48

View file

@ -84,8 +84,8 @@ set_file_perms() {
continue continue
fi fi
if ! [ -e "${fso}" ]; then if ! [ -e "$fso" ]; then
echo "INFO: fso '${fso}' does not exist!" echo "INFO: fso '$fso' does not exist!"
continue continue
fi fi
@ -120,7 +120,7 @@ set_file_perms() {
## If there is an entry for the fso, but the owner/group/mode do not ## If there is an entry for the fso, but the owner/group/mode do not
## match, we remove and re-add the entry to update it. ## match, we remove and re-add the entry to update it.
if ! dpkg-statoverride --list | grep -q "$owner $group $mode_from_config $fso_without_trailing_slash"; then if ! dpkg-statoverride --list | grep -q "$owner $group $mode_from_config $fso_without_trailing_slash"; then
echo_wrapper dpkg-statoverride --remove "${fso}" echo_wrapper dpkg-statoverride --remove "$fso"
add_statoverride_entry add_statoverride_entry
fi fi
else else
@ -129,14 +129,14 @@ set_file_perms() {
if ! [ "$capability" = "" ]; then if ! [ "$capability" = "" ]; then
if [ "$capability" = "none" ]; then if [ "$capability" = "none" ]; then
echo_wrapper setcap -r "${fso}" echo_wrapper setcap -r "$fso"
else else
if ! capsh --print | grep "Bounding set" | grep -q "$capability"; then if ! capsh --print | grep "Bounding set" | grep -q "$capability"; then
echo "ERROR: Capability '$capability' does not exist!" >&2 echo "ERROR: Capability '$capability' does not exist!" >&2
continue continue
fi fi
echo_wrapper setcap "${capability}+ep" "${fso}" echo_wrapper setcap "${capability}+ep" "$fso"
fi fi
fi fi
done < "${config_file}" done < "${config_file}"