Merge pull request #1162 from yubiuser/db_permissions

Change database permission to 664
This commit is contained in:
DL6ER
2021-09-26 09:01:52 +02:00
committed by GitHub
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -228,11 +228,6 @@ static bool db_create(void)
// Close database handle
dbclose(&db);
// Explicitly set permissions to 0644
// 644 = u+w u+r g+r o+r
const mode_t mode = S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH;
chmod_file(FTLfiles.FTL_db, mode);
return true;
}
@@ -277,6 +272,11 @@ void db_init(void)
}
}
// Explicitly set permissions to 0664
// 664 = u+w u+r g+w g+r o+r
const mode_t mode = S_IWUSR | S_IRUSR | S_IWGRP | S_IRGRP | S_IROTH;
chmod_file(FTLfiles.FTL_db, mode);
// Open database
sqlite3 *db = dbopen(false);
+2 -2
View File
@@ -535,7 +535,7 @@
printf "%s\n" "${lines[@]}"
# Depending on the shell (x86_64-musl is built on busybox) there can be one or multiple spaces between user and group
[[ ${lines[0]} == *"pihole"?*"pihole"* ]]
[[ ${lines[0]} == "-rw-r--r--"* ]]
[[ ${lines[0]} == "-rw-rw-r--"* ]]
run bash -c 'file /etc/pihole/pihole-FTL.db'
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} == "/etc/pihole/pihole-FTL.db: SQLite 3.x database"* ]]
@@ -1034,7 +1034,7 @@
run bash -c 'ls -l /etc/pihole/pihole-FTL.db'
printf "%s\n" "${lines[@]}"
[[ ${lines[0]} == *"pihole pihole"* || ${lines[0]} == *"pihole pihole"* ]]
[[ ${lines[0]} == "-rw-r--r--"* ]]
[[ ${lines[0]} == "-rw-rw-r--"* ]]
}
# "ldd" prints library dependencies and the used interpreter for a given program