diff --git a/dblayer.php b/dblayer.php index 0de5175..0f19128 100644 --- a/dblayer.php +++ b/dblayer.php @@ -161,7 +161,8 @@ class dblayer extends PDO if (file_exists ($file) && ! is_writeable ($file)) throw new Exception (_("The SQLite database file is write protected"), 500); - chmod ($file, 0666); + if (function_exists ("posix_getuid") && fileowner ($file) === posix_getuid ()) + chmod ($file, 0666); // Force ForeignKeys support (disabled by default) $this->db->exec("PRAGMA foreign_keys = ON"); break;