From: Petr Lautrbach <plautrba@redhat.com>
To: "Christian Göttsche" <cgzones@googlemail.com>, selinux@vger.kernel.org
Subject: Re: [PATCH] libselinux: selinux_status_open: return 1 in fallback mode
Date: Thu, 03 Jun 2021 13:19:25 +0200 [thread overview]
Message-ID: <87r1hjp54y.fsf@redhat.com> (raw)
In-Reply-To: <20210601150523.7016-1-cgzones@googlemail.com>
Christian Göttsche <cgzones@googlemail.com> writes:
> In case of a recurring call to `selinux_status_open(3)`, which
> previously has been opened in fallback mode, return `1` according to its
> documentation.
>
> Fixes: c5a699046f4 ("libselinux: make selinux_status_open(3) reentrant")
>
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
Acked-by: Petr Lautrbach <plautrba@redhat.com>
> ---
> libselinux/src/sestatus.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libselinux/src/sestatus.c b/libselinux/src/sestatus.c
> index 531a522c..89c1f621 100644
> --- a/libselinux/src/sestatus.c
> +++ b/libselinux/src/sestatus.c
> @@ -283,7 +283,7 @@ int selinux_status_open(int fallback)
> uint32_t seqno;
>
> if (selinux_status != NULL) {
> - return 0;
> + return (selinux_status == MAP_FAILED) ? 1 : 0;
> }
>
> if (!selinux_mnt) {
> --
> 2.32.0.rc2
next prev parent reply other threads:[~2021-06-03 11:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 15:05 [PATCH] libselinux: selinux_status_open: return 1 in fallback mode Christian Göttsche
2021-06-03 11:19 ` Petr Lautrbach [this message]
2021-06-09 9:30 ` Petr Lautrbach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r1hjp54y.fsf@redhat.com \
--to=plautrba@redhat.com \
--cc=cgzones@googlemail.com \
--cc=selinux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.