diff --git a/ratelimitfile.php b/ratelimitfile.php index e0893aa..efd57e9 100644 --- a/ratelimitfile.php +++ b/ratelimitfile.php @@ -25,6 +25,12 @@ class ratelimitfile extends ratelimit // Add the current timestamp $currentTimeStamp = microtime (true)."\n"; if ($this->debug) echo "Add entry : $currentTimeStamp"; + $user = posix_getpwuid (posix_getuid()); + if (file_exists ($file) && ! is_writeable ($file)) + throw new \Exception (sprintf ( + dgettext("domframework", + "File '%s' not writeable for user '%s'"), + $file, $user["name"]), 500); file_put_contents ($file, $currentTimeStamp, FILE_APPEND); $lock = new lockfile (); $lock->storagelock = $this->storageDir."/lockfile.lock";