Skip to content

Commit

Permalink
fix handling of loading auth backend
Browse files Browse the repository at this point in the history
When a non existing auth backend was configured, the action router ran
into an infinie loop exception. The reason was that the denied action
required a configured auth system, but denying access should always
work.

Interestingly the problem did not occur when the auth backend signalled
a failure to load. This was because the auth backend was not properly
deinitialized. This is now done.

To aid debugging similar problems, fatal errors are now logged through
the logging mechanism in the action router
  • Loading branch information
splitbrain committed Dec 17, 2021
1 parent e669992 commit ecad51d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inc/Action/Denied.php
Expand Up @@ -11,7 +11,7 @@
*
* @package dokuwiki\Action
*/
class Denied extends AbstractAclAction
class Denied extends AbstractAction
{
/** @inheritdoc */
public function minimumPermission()
Expand Down
1 change: 1 addition & 0 deletions inc/ActionRouter.php
Expand Up @@ -156,6 +156,7 @@ protected function handleFatalException(\Exception $e) {
if(defined('DOKU_UNITTEST')) {
throw $e;
}
ErrorHandler::logException($e);
$msg = 'Something unforeseen has happened: ' . $e->getMessage();
nice_die(hsc($msg));
}
Expand Down
2 changes: 1 addition & 1 deletion inc/auth.php
Expand Up @@ -56,7 +56,7 @@ function auth_setup() {

if ($auth->success == false) {
// degrade to unauthenticated user
unset($auth);
$auth = null;
auth_logoff();
msg($lang['authtempfail'], -1);
return false;
Expand Down

0 comments on commit ecad51d

Please sign in to comment.