lualoader: Always return a proper dictionary for blacklist

If module_blacklist isn't specified, we have an empty blacklist; effectively
the same as if module_blacklist="" were specified in loader.conf(5).

This was reported when switching to a BE that predated the module_blacklist
introduction, but the problem is valid all the same and likely to be tripped
over in other scenarios.

Reported by:	bwidawsk
MFC after:	3 days
This commit is contained in:
Kyle Evans 2018-10-27 04:10:42 +00:00
parent 0db665bb98
commit e1f1ddeb35
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=339805

View File

@ -266,12 +266,12 @@ local function isValidComment(line)
end
local function getBlacklist()
local blacklist = {}
local blacklist_str = loader.getenv('module_blacklist')
if blacklist_str == nil then
return nil
return blacklist
end
local blacklist = {}
for mod in blacklist_str:gmatch("[;, ]?([%w-_]+)[;, ]?") do
blacklist[mod] = true
end