From nobody Fri Mar 22 13:36:26 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 4V1Ndl1bW3z5DxBk; Fri, 22 Mar 2024 13:36:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4V1Ndl0yB2z47Yp; Fri, 22 Mar 2024 13:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711114587; 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=CawcsNQZom70g8ENH6yROjfuxAMIpfEoHC36stWtSk0=; b=p8TVbqmRgyzkhNk029KpmVt9lqRtEhOq7UrFBO82Jqj7a2ZTnVUlF7jLKl7r/N6st2bb5s ZqeEtNDlYyE/wRpIBbIMkB8H3UDCR9X3advDHjA2woR55LoI88e8NodoG/59GG4EP9ooTk bxVe689wjeYNk9EUPxbSCMTDmmiwIXFm5ZCsH/uXjANt9i+rosmQRHB4AeSEcjlQbGJx1w CDPW/dyAKtb1ctZxqfuVQ0cSDPNsLjjSbt/N0bK1eC+qqXf2OfbUNNuscbAuXQ9U6kiB1m Fko5Kts4JSKqs+OceGT0B/yGZo6KO0XGvOZbCWl+eME83Ug/he9DaiNPfCwY1g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711114587; a=rsa-sha256; cv=none; b=v21LuZV7U4FVxs1vmNsoNolFIRAV+E9G6u5md5JyhUs1fCLorYzGveRQOaXAto9HPhiTGu bpWXjTx0SCJuDwdxDgkNN90oaADX8QVKoKPVKbWD2UWQucaZUAEZyT9+1Xnqux7hXu3Ckl VVbJTKDwuTCB2kgU9PihvEy37pJZqcWAyAD7SGGjsDYKWW1fbcyW/OsN2c98VZmNYWvcnl xwxDTtSDYG8AGqxbKZ+qFnvS+fC076vn5isNLc4tLZNEpGhyvx2RKrGNrvWCeyzAn2upUS reCFOMisif1pCVeSd6MabnRE3+IkaU1BbFSiHm9/65zphqeHk87tO6EOqjH/7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711114587; 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=CawcsNQZom70g8ENH6yROjfuxAMIpfEoHC36stWtSk0=; b=VBDvSinSrXzITrvRwNL8Z+Q4Tzk3xKnps2MoE/E/E0MHaAagPlnPPj2q784jZ3r4LSFewb JjrF6BnPW0zc2dOpkhAFeYiZuzrdK9ZUR4NAmDU/5e4oXGgO8+Mz9BRo9cTCYuTw1Pf9ks 2Z8bJzO7KmvWLfc4aPjfjYq7E4jTs1FNZF0NE+U4ZloSnXV+orTLFTxX2dx/1bzhBmTzHU gxlAe9xaHOLDz7am0CUlg+twkSWxD8U/pMxchF1DFsbLw3basciRSWvb2B50RMn2DSiDpa ps9Nn40npLFkVhjCNsw6nApRtTxnhrIGerOypzsxRu6wplxF881e08V1MHchxQ== 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 4V1Ndl0Y8Tz1L8q; Fri, 22 Mar 2024 13:36:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42MDaQtl003793; Fri, 22 Mar 2024 13:36:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42MDaQbr003790; Fri, 22 Mar 2024 13:36:26 GMT (envelope-from git) Date: Fri, 22 Mar 2024 13:36:26 GMT Message-Id: <202403221336.42MDaQbr003790@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 8a17cc127bb0 - stable/13 - cat: fix cap_rights_init usage 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8a17cc127bb0a404d8f641926ad4a3cc42c482da Auto-Submitted: auto-generated The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=8a17cc127bb0a404d8f641926ad4a3cc42c482da commit 8a17cc127bb0a404d8f641926ad4a3cc42c482da Author: Ed Maste AuthorDate: 2024-02-15 00:03:40 +0000 Commit: Ed Maste CommitDate: 2024-03-22 13:35:44 +0000 cat: fix cap_rights_init usage Capability rights passed to cap_rights_* are not simple bitmaks and cannot be ORed together in general (although it will work for certain subsets of rights). PR: 277057 Reported by: asomers, markj (cherry picked from commit 05f530f4d2bb15fda3d258b3bd92d4515d9ef39f) (cherry picked from commit dbf34bbb188876551dcfec32fbbed2ba8ba24f12) --- bin/cat/cat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cat/cat.c b/bin/cat/cat.c index 0f36bce2098d..dc6e6417dc49 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -154,7 +154,7 @@ init_casper(int argc, char *argv[]) err(EXIT_FAILURE, "unable to create Casper"); fa = fileargs_cinit(casper, argc, argv, O_RDONLY, 0, - cap_rights_init(&rights, CAP_READ | CAP_FSTAT | CAP_FCNTL | CAP_SEEK), + cap_rights_init(&rights, CAP_READ, CAP_FSTAT, CAP_FCNTL, CAP_SEEK), FA_OPEN | FA_REALPATH); if (fa == NULL) err(EXIT_FAILURE, "unable to create fileargs");