1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-07-23 07:28:26 +00:00

All gravity related files and dirs should be owned by pihole:pihole (#6186)

This commit is contained in:
Dan Schaper 2025-05-12 08:48:27 -07:00 committed by GitHub
commit 398405c303
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,7 +126,7 @@ gravity_swap_databases() {
oldAvail=false
if [ "${availableBlocks}" -gt "$((gravityBlocks * 2))" ] && [ -f "${gravityDBfile}" ]; then
oldAvail=true
cp "${gravityDBfile}" "${gravityOLDfile}"
cp -p "${gravityDBfile}" "${gravityOLDfile}"
fi
# Drop the gravity and antigravity tables + subsequent VACUUM the current
@ -139,7 +139,7 @@ gravity_swap_databases() {
else
# Check if the backup directory exists
if [ ! -d "${gravityBCKdir}" ]; then
mkdir -p "${gravityBCKdir}"
mkdir -p "${gravityBCKdir}" && chown pihole:pihole "${gravityBCKdir}"
fi
# If multiple gravityBCKfile's are present (appended with a number), rotate them
@ -1022,7 +1022,7 @@ migrate_to_listsCache_dir() {
# If not, we need to migrate the old files to the new directory
local str="Migrating the list's cache directory to new location"
echo -ne " ${INFO} ${str}..."
mkdir -p "${listsCacheDir}"
mkdir -p "${listsCacheDir}" && chown pihole:pihole "${listsCacheDir}"
# Move the old files to the new directory
if mv "${piholeDir}"/list.* "${listsCacheDir}/" 2>/dev/null; then