sys/tools/syscalls: desupport capabilities.conf

We haven't used this since commit be67ea40c5 in 2021 so stop carrying
it forward.

Also remove support for setting the list in syscalls.conf via the
capenabled variable.  This was last used by cloudabi (removed in 2021
by commit cf0ee8738e).
This commit is contained in:
Brooks Davis 2024-10-22 18:59:23 +01:00
parent 74231c8172
commit ec86d763d1
11 changed files with 4 additions and 67 deletions

View File

@ -47,10 +47,8 @@ local config = {
ptr_intptr_t_cast = "intptr_t",
obsol = {},
unimpl = {},
capabilities_conf = "capabilities.conf",
compat_set = "native",
mincompat = 0,
capenabled = {},
-- System calls that require ABI-specific handling.
syscall_abi_change = {},
-- System calls that appear to require handling, but don't.
@ -222,8 +220,7 @@ function config.merge(fh)
-- Match for pipe, that's how abi_flags
-- is formatted.
config[k] = util.setFromString(v, "[^|]+")
elseif k:find("capenabled") or
k:find("syscall_abi_change") or
elseif k:find("syscall_abi_change") or
k:find("syscall_no_abi_change") or
k:find("obsol") or
k:find("unimpl") then
@ -263,50 +260,4 @@ function config.mergeCompat()
end
end
-- Parses the provided capabilities.conf. Returns a string (comma separated
-- list) as its formatted in capabilities.conf, or NIL and a message if no file
-- was provided.
local function grabCapenabled(file, open_fail_ok)
local capentries = {}
local commentExpr = "#.*"
if file == nil then
return nil, "No file given"
end
local fh, msg, errno = io.open(file)
if fh == nil then
if not open_fail_ok then
util.abort(errno, msg)
end
return nil, msg
end
for nextline in fh:lines() do
-- Strip any comments.
nextline = nextline:gsub(commentExpr, "")
if nextline ~= "" then
capentries[nextline] = true
end
end
assert(fh:close())
return capentries
end
-- Merge capability (Capsicum) configuration into the global config.
function config.mergeCapability()
-- We ignore errors here if we're relying on the default configuration.
if not config.modifications.capenabled then
config.capenabled = grabCapenabled(config.capabilities_conf,
config.modifications.capabilities_conf == nil)
elseif config.capenabled ~= "" then
-- We have a comma separated list from the format of
-- capabilities.conf, split it into a set with boolean values
-- for each key.
config.capenabled = util.setFromString(config.capenabled,
"[^,]+")
end
end
return config

View File

@ -48,14 +48,9 @@ end
function syscall:processCap()
self.cap = "0"
local stripped = util.stripAbiPrefix(self.name, self.prefix)
if config.capenabled ~= nil and (config.capenabled[self.name] ~= nil or
config.capenabled[stripped] ~= nil) then
self.cap = "SYF_CAPENABLED"
else
for k, _ in pairs(self.type) do
if k == "CAPENABLED" then
self.cap = "SYF_CAPENABLED"
end
for k, _ in pairs(self.type) do
if k == "CAPENABLED" then
self.cap = "SYF_CAPENABLED"
end
end
end

View File

@ -40,7 +40,6 @@ local sysfile, configfile = arg[1], arg[2]
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -180,7 +180,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed syscall table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -98,7 +98,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed syscall table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -84,7 +84,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed system call table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -77,7 +77,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed syscall table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -96,7 +96,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed syscall table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -61,7 +61,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed syscall table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -229,7 +229,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed system call table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}

View File

@ -255,7 +255,6 @@ if script then
config.merge(configfile)
config.mergeCompat()
config.mergeCapability()
-- The parsed system call table.
local tbl = FreeBSDSyscall:new{sysfile = sysfile, config = config}