Skip to content

Commit c32e2ed

Browse files
committed
Bugfix: replace /dev/null with system tmp-dir
1 parent d02e886 commit c32e2ed

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

config-templates/config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
/*
5757
* The following settings are *filesystem paths* which define where
5858
* SimpleSAMLphp can find or write the following things:
59-
* - 'loggingdir': Where to write logs.
59+
* - 'loggingdir': Where to write logs. MUST be set to NULL when using a logging
60+
* handler other than `file`.
6061
* - 'datadir': Storage of general data.
6162
* - 'tempdir': Saving temporary files. SimpleSAMLphp will attempt to create
6263
* this directory if it doesn't exist.
@@ -323,7 +324,6 @@
323324
*/
324325

325326

326-
327327
/**************************
328328
| LOGGING AND STATISTICS |
329329
**************************/
@@ -359,7 +359,7 @@
359359
*
360360
* - %level: the log level (name or number depending on the handler used).
361361
*
362-
* - %stat: if the log entry is intended for statistical purposes, it will print the string 'STAT ' (bear in mind
362+
- * - %stat: if the log entry is intended for statistical purposes, it will print the string 'STAT ' (bear in mind
363363
* the trailing space).
364364
*
365365
* - %trackid: the track ID, an identifier that allows you to track a single session.

src/SimpleSAML/Kernel.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
1717
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
1818

19+
use function getenv;
20+
use function is_dir;
21+
use function sys_get_temp_dir;
22+
1923
/**
2024
* A class to create the container and handle a given request.
2125
*/
@@ -67,12 +71,7 @@ public function getLogDir(): string
6771
{
6872
$configuration = Configuration::getInstance();
6973
$handler = $configuration->getString('logging.handler');
70-
71-
if ($handler === 'file') {
72-
$loggingPath = $configuration->getString('loggingdir');
73-
} else {
74-
$loggingPath = '/dev/null';
75-
}
74+
$loggingPath = $configuration->getString('loggingdir', sys_get_temp_dir());
7675

7776
$sysUtils = new System();
7877
if ($sysUtils->isAbsolutePath($loggingPath)) {

0 commit comments

Comments
 (0)