diff options
| author | 2022-11-14 14:57:45 +0100 | |
|---|---|---|
| committer | 2022-11-14 14:57:45 +0100 | |
| commit | 8864d514c82bc29f0014e45330383ab2ee812910 (patch) | |
| tree | 342b8954274742cda8b39a3553b249f150dc74ab /app | |
| parent | 1f86aae415951b3a5c83d092765fa92337fc29ee (diff) | |
NFS-friendly is_writable() checks (#4780)
#fix https://github.com/FreshRSS/FreshRSS/issues/4779
Diffstat (limited to 'app')
| -rw-r--r-- | app/Controllers/updateController.php | 6 | ||||
| -rw-r--r-- | app/Utils/feverUtil.php | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index 675bd7def..f1588c7e1 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -14,7 +14,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { public static function migrateToGitEdge() { $errorMessage = 'Error during git checkout to edge branch. Please change branch manually!'; - if (!is_writable(FRESHRSS_PATH . '/.git/')) { + if (!is_writable(FRESHRSS_PATH . '/.git/config')) { throw new Exception($errorMessage); } @@ -118,7 +118,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { if ($version == '') { $version = 'unknown'; } - if (is_writable(FRESHRSS_PATH)) { + if (touch(FRESHRSS_PATH . '/index.html')) { $this->view->update_to_apply = true; $this->view->message = array( 'status' => 'good', @@ -217,7 +217,7 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { } public function applyAction() { - if (!file_exists(UPDATE_FILENAME) || !is_writable(FRESHRSS_PATH) || Minz_Configuration::get('system')->disable_update) { + if (Minz_Configuration::get('system')->disable_update || !file_exists(UPDATE_FILENAME) || !touch(FRESHRSS_PATH . '/index.html')) { Minz_Request::forward(array('c' => 'update'), true); } diff --git a/app/Utils/feverUtil.php b/app/Utils/feverUtil.php index a7d21dacb..277230ec2 100644 --- a/app/Utils/feverUtil.php +++ b/app/Utils/feverUtil.php @@ -13,7 +13,7 @@ class FreshRSS_fever_Util { @mkdir(self::FEVER_PATH, 0770, true); } - $ok = is_writable(self::FEVER_PATH); + $ok = touch(self::FEVER_PATH . '/index.html'); // is_writable() is not reliable for a folder on NFS if (!$ok) { Minz_Log::error("Could not save Fever API credentials. The directory does not have write access."); } |
