mirror of
https://github.com/pi-hole/FTL.git
synced 2024-10-26 16:52:18 +02:00
Merge pull request #1162 from yubiuser/db_permissions
Change database permission to 664
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user