Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Feb 2024 22:00:24 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 277057] rights(4): Not all rights may be specified in a rights mask
Message-ID:  <bug-277057-227-R6C0camdY1@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-277057-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277057

Mark Johnston <markj@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |markj@FreeBSD.org

--- Comment #2 from Mark Johnston <markj@FreeBSD.org> ---
> 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-277057-227-R6C0camdY1>