mirror of
https://github.com/Kicksecure/security-misc.git
synced 2024-12-28 02:59:26 -05:00
code simplification
This commit is contained in:
parent
3c4e261c20
commit
28a440091d
@ -24,16 +24,11 @@ create_whitelist() {
|
|||||||
|
|
||||||
if grep -q "${1}" /etc/group; then
|
if grep -q "${1}" /etc/group; then
|
||||||
chmod o-rwx "${whitelist_path}"
|
chmod o-rwx "${whitelist_path}"
|
||||||
chgrp -fR "${1}" "${whitelist_path}"
|
|
||||||
|
|
||||||
## Changing the permissions of /sys recursively
|
## Changing the permissions of /sys recursively
|
||||||
## causes errors as the permissions of /sys/kernel/debug
|
## causes errors as the permissions of /sys/kernel/debug
|
||||||
## and /sys/fs/cgroup cannot be changed which makes
|
## and /sys/fs/cgroup cannot be changed.
|
||||||
## systemd say the service has failed even though
|
chgrp -fR "${1}" "${whitelist_path}" || true
|
||||||
## everything has completed successfully. So, this
|
|
||||||
## returns "0" instead which makes systemd say the
|
|
||||||
## service has succeeded.
|
|
||||||
return 0
|
|
||||||
else
|
else
|
||||||
echo "ERROR: The ${1} group does not exist, the ${1} whitelist was not created."
|
echo "ERROR: The ${1} group does not exist, the ${1} whitelist was not created."
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user