From nobody Fri Mar 22 13:33:08 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 4V1NYx2mwSz5DxGy; Fri, 22 Mar 2024 13:33:09 +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 4V1NYx0TYJz45d6; Fri, 22 Mar 2024 13:33:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711114389; 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=uDKZzKBBq9VSbs3T7I8NeLvttrs/iHQ33CVQjTqA/6w=; b=rmW2EKWMPUKhVEOU9titRD2c6k7rfu1+lMi5iSG0Kbgi6isZNNVyDeWYk+wHDs1V3PkZWu v9fJyIvOz8HDsutgbRg6KWcBzfUU22LbKEtmQccFrINMXbGl/eVQfyBMkWsasGROHXtJYz Zd0y9F1QDJVICk10Scmf5ttSyL+imqbTaS3p9nfaZlp/4nMvzooje+Cc4p8ulUxCsHiv+b RsKh88ZG6ZxnygAUErfjvqgdR+DieuCRyYAcuJo9y7eEB7RcEYGe7HWu1Wow3KqtA48oTc JseqrhAuO1GjtQqdImGXdw/VqHrQTH3ABsB84vEstrC9+i4Yogxp16B9I5c2hA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711114389; a=rsa-sha256; cv=none; b=HQQt05pd0RjGLLfdBnZJapBpygBPB5+vkcUuFCRd2ZhefmCmIVW5Vyzd/o/V1CLzxoGTsW NTARZvVQ0wj/UE8IeotYpwGgnCaOv9O1O0hIIT7LeNIl5tMYXey1jN1wuh2wsWDhln2JDn TQCXRvllLGv+T5z4DuqmX077iCnl4I+/BPbcrFjM9FrRreHYA6TGpjozrWN9bLjFp/hENi CDH4sUXBVT9j7bSnuUBxjCQ0qNNycORnm8Sa/ykI8OinyxbQ4Bi45SRMp8aQ9A+pSZG+s3 FzUh2jIPyAJy4uIkRpaK10wkTvW7azvJVyfvibkivCrKfQB1oauvgpjN2+fiJA== 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=1711114389; 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=uDKZzKBBq9VSbs3T7I8NeLvttrs/iHQ33CVQjTqA/6w=; b=Dffnr7Mnob3tcM+Sc7nvUq4JXsXf0FzlZ8vvIDVnG+1O1/CckXMxEyLkpqIXnHJALN9GPc zhlA6U73Wn5anqmMHIoJQ6wFjzRqMRWsaZV3rI7zk9YK8Me6rQX/KQogU/kRMTFJIcb5kl nZ78rhKd5r81wI8zOQ1513T4UphnT9hFQoI3193vYBEIswdoD/z7lpCeQFrOlrf2Y07zvA 68GaVl45eDejuPM8bENz67riLlMaaPH9mJAT/CK3CrAEEKMbYxto2sLrQ08zfpG2tkjZ7t lQ4K6m3xKOEExeWeJOc3LMd8BbN3f7g4U9/O2fhXLD/E+n4hSvJe6R2B6zFPZA== 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 4V1NYx02gKz1Kxj; Fri, 22 Mar 2024 13:33:09 +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 42MDX8aG002867; Fri, 22 Mar 2024 13:33:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42MDX8dr002864; Fri, 22 Mar 2024 13:33:08 GMT (envelope-from git) Date: Fri, 22 Mar 2024 13:33:08 GMT Message-Id: <202403221333.42MDX8dr002864@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: dbf34bbb1888 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: dbf34bbb188876551dcfec32fbbed2ba8ba24f12 Auto-Submitted: auto-generated The branch stable/14 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=dbf34bbb188876551dcfec32fbbed2ba8ba24f12 commit dbf34bbb188876551dcfec32fbbed2ba8ba24f12 Author: Ed Maste AuthorDate: 2024-02-15 00:03:40 +0000 Commit: Ed Maste CommitDate: 2024-03-22 13:30:32 +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) --- 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 c69bbc4911cb..81ec5feec240 100644 --- a/bin/cat/cat.c +++ b/bin/cat/cat.c @@ -155,7 +155,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");