mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Chmod after file creation
This allows the www-group to edit logs and preferences refs #4491
This commit is contained in:
parent
3d3fa45838
commit
ec359c76d8
@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
namespace Icinga\Application;
|
namespace Icinga\Application;
|
||||||
|
|
||||||
|
use Icinga\Protocol\Ldap\Exception;
|
||||||
use \Zend_Config;
|
use \Zend_Config;
|
||||||
use \Zend_Log;
|
use \Zend_Log;
|
||||||
use \Zend_Log_Filter_Priority;
|
use \Zend_Log_Filter_Priority;
|
||||||
@ -144,7 +145,6 @@ final class Logger
|
|||||||
if ($target == self::DEFAULT_LOG_TARGET) {
|
if ($target == self::DEFAULT_LOG_TARGET) {
|
||||||
$type = self::DEFAULT_LOG_TYPE;
|
$type = self::DEFAULT_LOG_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->addWriter($type, $target, Zend_Log::DEBUG);
|
$this->addWriter($type, $target, Zend_Log::DEBUG);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -187,11 +187,17 @@ final class Logger
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
/** @var Zend_Log_Writer_Abstract $writer */
|
|
||||||
$writer = new $writerClass(Config::resolvePath($target));
|
$target = Config::resolvePath($target);
|
||||||
|
$writer = new $writerClass($target);
|
||||||
$writer->addFilter(new Zend_Log_Filter_Priority($priority));
|
$writer->addFilter(new Zend_Log_Filter_Priority($priority));
|
||||||
|
// Make sure the permissions for log target file are correct
|
||||||
|
if ($type === 'Stream' && !file_exists($target)) {
|
||||||
|
touch($target);
|
||||||
|
chmod($target, 0664);
|
||||||
|
}
|
||||||
|
|
||||||
$this->logger->addWriter($writer);
|
$this->logger->addWriter($writer);
|
||||||
$this->writers[] = $writer;
|
$this->writers[] = $writer;
|
||||||
} catch (Zend_Log_Exception $e) {
|
} catch (Zend_Log_Exception $e) {
|
||||||
|
@ -152,6 +152,8 @@ class IniStore implements LoadInterface, FlushObserverInterface
|
|||||||
private function createDefaultIniFile()
|
private function createDefaultIniFile()
|
||||||
{
|
{
|
||||||
touch($this->preferencesFile);
|
touch($this->preferencesFile);
|
||||||
|
chmod($this->preferencesFile, 0664);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user