Re: [PATCH] libsepol: use bool instead of int in validation functions

Stephen Smalley <[email protected]>
Newsgroups org.kernel.vger.selinux
Message-ID <CAEjxPJ7diECpC9H+ceKZwZzDVXQ9bbn5R37P+uD8JnpBe3jVyQ@mail.gmail.com>
On Fri, Aug 14, 2026 at 7:32 PM Kalevi Kolttonen <[email protected]> wrote:
>
> This is an effort to use boolean return values instead of
> int in as many libsepol validation functions as possible.
> The functions passed to hashtab_map() have been kept as is
> to avoid excessive reworking of the codebase.
>
> The change from int to bool requires adjusting the callers
> to invert their return value checking logic. The caller
> conversion has been performed to keep the existing logic
> intact.
>
> Signed-off-by: Kalevi Kolttonen <[email protected]>

I am hesitant to apply this patch for the following reasons:
1. It changes the semantics of the return type of a function that is
exposed to multiple source files,
2. It does not rename the functions to make the change in return type
explicit and ensure all
callers are updated.
3. It doesn't provide any runtime or memory benefit.

Other SELinux userspace maintainers are free to disagree with me and
merge it if they desire.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.