Fix crash on revocation of removed privilege

This commit is contained in:
rubenwardy 2017-09-08 23:45:56 +01:00 committed by Nils Dagsson Moskopp
parent e4e8481f97
commit 4036abc048
Signed by: erle
GPG Key ID: A3BC671C35191080
1 changed files with 3 additions and 2 deletions

View File

@ -436,8 +436,9 @@ function core.run_callbacks(callbacks, mode, ...)
end
function core.run_priv_callbacks(name, priv, caller, method)
if not core.registered_privileges[priv]["on_" .. method] or
not core.registered_privileges[priv]["on_" .. method](name, caller) then
local def = core.registered_privileges[priv]
if not def or not def["on_" .. method] or
not def[priv]["on_" .. method](name, caller) then
for _, func in ipairs(core["registered_on_priv_" .. method]) do
if not func(name, caller, priv) then
break