Commit 9afdf317 authored by mku's avatar mku

ZP-456 #comment FatalMisconfigurationException on a fresh 2.1.0RC installation #time 20m

git-svn-id: https://z-push.org/svn/z-push/trunk@1744 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 75b5b6e2
......@@ -230,10 +230,10 @@ class ZPush {
if (!file_exists(LOGFILEDIR))
throw new FatalMisconfigurationException("The configured LOGFILEDIR does not exist or can not be accessed.");
if (!is_writable(LOGFILE))
if ((!file_exists(LOGFILE) && !touch(LOGFILE)) || !is_writable(LOGFILE))
throw new FatalMisconfigurationException("The configured LOGFILE can not be modified.");
if (!is_writable(LOGERRORFILE))
if ((!file_exists(LOGERRORFILE) && !touch(LOGERRORFILE)) || !is_writable(LOGERRORFILE))
throw new FatalMisconfigurationException("The configured LOGERRORFILE can not be modified.");
// check ownership on the (eventually) just created files
......
......@@ -74,7 +74,7 @@ class FileStateMachine implements IStateMachine {
$this->userfilename = STATE_DIR . 'users';
$this->settingsfilename = STATE_DIR . 'settings';
if (!is_writable($this->userfilename))
if ((!file_exists($this->userfilename) && !touch($this->userfilename)) || !is_writable($this->userfilename))
throw new FatalMisconfigurationException("Not possible to write to the configured state directory.");
Utils::FixFileOwner($this->userfilename);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment