fix/gravity_permission_check #3
+3
-3
@@ -736,9 +736,9 @@ gravity_DownloadBlocklistFromUrl() {
|
|||||||
download=false
|
download=false
|
||||||
else
|
else
|
||||||
if [ "$(id -un)" == "root" ]; then
|
if [ "$(id -un)" == "root" ]; then
|
||||||
# If we are root, we need to check if the pihole user has read permission
|
# If we are root, we need to check if the pihole user has read permission
|
||||||
# otherwise, we might read files that the pihole user should not be able to read
|
# otherwise, we might read files that the pihole user should not be able to read
|
||||||
if sudo -u pihole test -r "${file_path}"; then
|
if sudo -u pihole test -r "${file_path}"; then
|
||||||
echo -e "${OVER} ${INFO} Using local file ${file_path}"
|
echo -e "${OVER} ${INFO} Using local file ${file_path}"
|
||||||
else
|
else
|
||||||
echo -e "${OVER} ${CROSS} Cannot read file (user 'pihole' lacks read permission)"
|
echo -e "${OVER} ${CROSS} Cannot read file (user 'pihole' lacks read permission)"
|
||||||
|
|||||||
Reference in New Issue
Block a user