From nobody Wed Oct 30 21:08:58 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Xf09S2VYVz5c2lV; Wed, 30 Oct 2024 21:09:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Xf09R54F1z4t3c; Wed, 30 Oct 2024 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMe4PJZZywlhdeQnKt8t5xxTkYpY8R5U7PDpY6YnhBk=; b=pr3AM/uEIVohN07lX5su1dAjzeOUrtB64k9/C6ve7AEFUJWSr/sBSFpMJij3xDqf+Yx2ET NaJVvgywBDGfydIu/POMBqm9WdlRR/bOrSRTzDPKW0nGvuYskHue6mexPTXIkVAJSirzIk pD9OHa/OxyDM0jnw1TqJLdMtWCocfDLlQm4N9JVr4m6FL7ym3IAY80/lmoYIJH2V7vtJzq BlXSi2FWQEDBkUpD3Fj6mEM/gv7+N36ZYT7qglwzPwOze06JXh3cYvZKIP3+RyEtFGuJCT XtCX+WnDIcCLp3RPAstSn1RxBeTakRdYXFNR9kuDU5wW9h3PLy7FUHjBF3KVGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1730322539; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=uMe4PJZZywlhdeQnKt8t5xxTkYpY8R5U7PDpY6YnhBk=; b=sNx5lDdIQ5Wnfh/Ea/kXOZ7XiE6BtGce2w6RUUEnPm6DRE4D3ULQM5fgXkqLN44ZG+4YY8 0QjkkLSX5JW+H3fCULsR9Ji5Pm3gpwmEcBsuSot4ZRM4xby7Tml9A6GvihFdlU8v4ZyOzG Sa7ZqPBLVMZlC5t/Rtct9boDDJLbULIxgYEy0igwDFEkDbX9e+2re7BCZcRPLnr+yG8xDP gOyyb1cPdnhBgXzEqEwcPnD9fDRyvI/U6b1hw5yy66Og56Q4tmMLG3GxScP/Uao8+9bqT6 rDzzf+9jR63L+i1AQ+kqAETLlfHjS5LBpMw3T+3LrscTtcx6vfiVw/jz+PvvgA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1730322539; a=rsa-sha256; cv=none; b=MmVqfj0qBEfyWE2tP9KFXszK7l62fcJxV0CHIsMpBXvV4yLQFnCkltj01WZ+tV+NB1wLs9 r79LOJYVxr2r+9KLhFqbizX3hS/fKInoM5BkeksF9Rwx0o8Nrd2YG/C4UODYvtkXSJVJl3 hGIJaLmlY05CrP7S01eTKJbO/9i1cdvUXSzPO6LjL4sGpgOHE/10yOd3eBAGeoLmqdRddA G6XzhX1o67XMVwtRUAdt+XxX8ui00t5o/Cl/Z314Kt6ag5BNovh6aW0dS7Da3nQv7tebxB xgl00Fv+oltMjbSpOywM88SHVc0RSyzpWcHeTYMIqu/qriO0xywY2s6U6TFA2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Xf09R0mnGz1Mrj; Wed, 30 Oct 2024 21:08:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49UL8wrt053756; Wed, 30 Oct 2024 21:08:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49UL8whK053753; Wed, 30 Oct 2024 21:08:58 GMT (envelope-from git) Date: Wed, 30 Oct 2024 21:08:58 GMT Message-Id: <202410302108.49UL8whK053753@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: ec86d763d1c9 - main - sys/tools/syscalls: desupport capabilities.conf List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ec86d763d1c94648419aeb931683dcb37bf72656 Auto-Submitted: auto-generated The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=ec86d763d1c94648419aeb931683dcb37bf72656 commit ec86d763d1c94648419aeb931683dcb37bf72656 Author: Brooks Davis AuthorDate: 2024-10-22 17:59:23 +0000 Commit: Brooks Davis CommitDate: 2024-10-30 21:04:31 +0000 sys/tools/syscalls: desupport capabilities.conf We haven't used this since commit be67ea40c5a0 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 cf0ee8738e31). --- sys/tools/syscalls/config.lua | 51 +--------------------------- sys/tools/syscalls/core/syscall.lua | 11 ++---- sys/tools/syscalls/main.lua | 1 - sys/tools/syscalls/scripts/init_sysent.lua | 1 - sys/tools/syscalls/scripts/libsys_h.lua | 1 - sys/tools/syscalls/scripts/syscall_h.lua | 1 - sys/tools/syscalls/scripts/syscall_mk.lua | 1 - sys/tools/syscalls/scripts/syscalls.lua | 1 - sys/tools/syscalls/scripts/syscalls_map.lua | 1 - sys/tools/syscalls/scripts/sysproto_h.lua | 1 - sys/tools/syscalls/scripts/systrace_args.lua | 1 - 11 files changed, 4 insertions(+), 67 deletions(-) diff --git a/sys/tools/syscalls/config.lua b/sys/tools/syscalls/config.lua index 92098a709854..fcf4c2217959 100644 --- a/sys/tools/syscalls/config.lua +++ b/sys/tools/syscalls/config.lua @@ -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 diff --git a/sys/tools/syscalls/core/syscall.lua b/sys/tools/syscalls/core/syscall.lua index 7e8c562dad8a..402595b998da 100644 --- a/sys/tools/syscalls/core/syscall.lua +++ b/sys/tools/syscalls/core/syscall.lua @@ -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 diff --git a/sys/tools/syscalls/main.lua b/sys/tools/syscalls/main.lua index 8f791eec0943..b15eec095f9c 100755 --- a/sys/tools/syscalls/main.lua +++ b/sys/tools/syscalls/main.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/init_sysent.lua b/sys/tools/syscalls/scripts/init_sysent.lua index 106c51be5f8a..66683250b482 100755 --- a/sys/tools/syscalls/scripts/init_sysent.lua +++ b/sys/tools/syscalls/scripts/init_sysent.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/libsys_h.lua b/sys/tools/syscalls/scripts/libsys_h.lua index 18ffc68fded6..75627f08750f 100755 --- a/sys/tools/syscalls/scripts/libsys_h.lua +++ b/sys/tools/syscalls/scripts/libsys_h.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/syscall_h.lua b/sys/tools/syscalls/scripts/syscall_h.lua index ce5ffcec4b94..5f8d8fb66889 100755 --- a/sys/tools/syscalls/scripts/syscall_h.lua +++ b/sys/tools/syscalls/scripts/syscall_h.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/syscall_mk.lua b/sys/tools/syscalls/scripts/syscall_mk.lua index d4347a050cf1..68438ee8d90c 100755 --- a/sys/tools/syscalls/scripts/syscall_mk.lua +++ b/sys/tools/syscalls/scripts/syscall_mk.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/syscalls.lua b/sys/tools/syscalls/scripts/syscalls.lua index b1a3d1020f88..38ed396a73ae 100755 --- a/sys/tools/syscalls/scripts/syscalls.lua +++ b/sys/tools/syscalls/scripts/syscalls.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/syscalls_map.lua b/sys/tools/syscalls/scripts/syscalls_map.lua index 4108d9f46fcf..57bb5e9da93b 100755 --- a/sys/tools/syscalls/scripts/syscalls_map.lua +++ b/sys/tools/syscalls/scripts/syscalls_map.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/sysproto_h.lua b/sys/tools/syscalls/scripts/sysproto_h.lua index d4fc30c31292..6770e0548899 100755 --- a/sys/tools/syscalls/scripts/sysproto_h.lua +++ b/sys/tools/syscalls/scripts/sysproto_h.lua @@ -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} diff --git a/sys/tools/syscalls/scripts/systrace_args.lua b/sys/tools/syscalls/scripts/systrace_args.lua index abd5d284d46e..88170b85e737 100755 --- a/sys/tools/syscalls/scripts/systrace_args.lua +++ b/sys/tools/syscalls/scripts/systrace_args.lua @@ -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}