2.0.0-rc1 when logging.handler is set to syslog or errorlog, it tries to create /dev/null
Describe the bug
When logging.handler is set to syslog or errorlog, it tries to create /dev/null
To Reproduce
- Install SSP
- Set logging.handler in config.php to syslog or errorlog
- Try to use SSP
Expected behavior It not to throw an error about trying to create /dev/null
Screenshots or logs
SimpleSAML\Error\Error: UNHANDLEDEXCEPTION
Backtrace:
1 www/_include.php:28 (SimpleSAML_exception_handler)
0 [builtin] (N/A)
Caused by: RuntimeException: Unable to create the "logs" directory (/dev/null).
Backtrace:
5 vendor/symfony/http-kernel/Kernel.php:626 (Symfony\Component\HttpKernel\Kernel::buildContainer)
4 vendor/symfony/http-kernel/Kernel.php:537 (Symfony\Component\HttpKernel\Kernel::initializeContainer)
3 vendor/symfony/http-kernel/Kernel.php:767 (Symfony\Component\HttpKernel\Kernel::preBoot)
2 vendor/symfony/http-kernel/Kernel.php:190 (Symfony\Component\HttpKernel\Kernel::handle)
1 src/SimpleSAML/Module.php:234 (SimpleSAML\Module::process)
0 www/module.php:14 (N/A)
Additional context
This is a side-effect of https://github.com/simplesamlphp/simplesamlphp/commit/d7c6d21186ee5ea511cc5ed9a55faaabd15f3fb8
OK, so Symfony requires a writable log-directory to be configured, even if you want to use syslog/errlog/stderr.. My earlier change tried to trick Symfony, but apparently I didn't think it through very well.
The way I have fixed it now is:
- If you set logdir to
nullit will try and use the system's tmp-directory that should be readable in most cases - You can still set it to any other directory as long as it's writable.
So if your handler is other than file it's probably best/easiest to set logdir to null and it should work out of the box in most setups.
Would you mind testing 441399022cc134c40c828a3a227ac5d2a33c2d4e ? It should fix both your issues
I'll try that soon, thanks.
Looks like a new bug on this one?
Yeah, we've merged Symfony6-support, but apparently that breaks stuff.. Sorry for all this.. Will get back to you ASAP
OK; one more time! 9529414d76ca49b0c9eae049f9f6f541ad76d4b0
This looks to have fixed it, thanks!
\n This issue has been automatically locked since there has \n not been any recent activity after it was closed.\n Please open a new issue for related bugs.