From nobody Wed Feb 14 22:00:24 2024 X-Original-To: bugs@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 4TZsZJ2JL9z53Ygy for ; Wed, 14 Feb 2024 22:00:24 +0000 (UTC) (envelope-from bugzilla-noreply@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 4TZsZJ0m3hz45Lp for ; Wed, 14 Feb 2024 22:00:24 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707948024; a=rsa-sha256; cv=none; b=F2kABQneK3xs1XCdV2cTVXlC4sQ8s5y0V2RzyPIIuDD3BxHSuylug/02AxoTqQo0AvhoUf f2QUP+u45CSOlMhIelT/Wv8ql9mzyh87mqApwwKqUpBQ+KWT/Snd/n2ITwXek2o56Kotmd e7uWn1N1WoyN2/BHbBctP7zeYbU4/mZij/7Qsw7tJOVeGIrktr7DhlxZ1kwzrJb9aLvkGb 1l5+BpFFgMy688W6MDIacskQMQqjXK8Gc2/okoadBmwphersYrCgP3ZD5J8Tcl9mVAVH+M a6MecoR2ySxLB1LraPWMuBV9SxAFjO6xVB/y7tNZclBZPgVYCtK5TNpel6wZUw== 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=1707948024; 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: in-reply-to:in-reply-to:references:references; bh=9ygBSKfGk+gaoVwH8T0fqF+4fbKbxuVPEYMRMN27a5M=; b=qXEgCY+XP4sSdh9WDUf41FYwsGEi43Y6acH3CcIKredQ37fWU7PsJCR+W56A2+qpjajOS4 mMJdh+ykssO0cS96802Ugw1lBePdZJnacU6LMrokt5M55t9DEmZuOcHqx8wUI8vEyBAuiA TxdecPbyyaoG3xrhxcs7Gq6JoZmhRW/er/oqlL9Ze7ZT7t2IYeSr08CREWXrW33JVoGRDv 0z7hMooqSma2xoNSmtBZeonWN8o2k22ohmp5bW56euNVavoxreUQhbItc1CnOmJ+H8GzYY ujcBQOhlDfyQe+0Mr/zoAk30uBzQOhjwshLvtE7/qD3y+9eeWcXpNzU2w9e0Pw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4TZsZH6yXKzG27 for ; Wed, 14 Feb 2024 22:00:23 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 41EM0N8A008509 for ; Wed, 14 Feb 2024 22:00:23 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 41EM0NM1008508 for bugs@FreeBSD.org; Wed, 14 Feb 2024 22:00:23 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 277057] rights(4): Not all rights may be specified in a rights mask Date: Wed, 14 Feb 2024 22:00:24 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: markj@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D277057 Mark Johnston changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |markj@FreeBSD.org --- Comment #2 from Mark Johnston --- > 144: cap_rights_init(&rights, CAP_READ | CAP_FSTAT | CAP_FCNTL | CAP_= SEEK), But the right(!) way to write this is cap_rights_init(&rights, CAP_READ, CAP_FSTAT, ...). I'd expect that to work for mixed-index rights. If it doesn't that's certainly a bug. Most of the code in the tree does this properly (and at least one of the few exceptions is my fault, sorry). Using plain OR works except when it doesn'= t, as you note. Maybe rights(4) should be more clear. cap_rights_set() should be used to incrementally add rights to a set. --=20 You are receiving this mail because: You are the assignee for the bug.=