Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
libselinux: selinux_status_open: return 1 in fallback mode
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: c5a6990 ("libselinux: make selinux_status_open(3) reentrant")

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: Petr Lautrbach <plautrba@redhat.com>
  • Loading branch information
cgzones authored and bachradsusi committed Jun 9, 2021
1 parent d8b90f8 commit ed2e4db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libselinux/src/sestatus.c
Expand Up @@ -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) {
Expand Down

0 comments on commit ed2e4db

Please sign in to comment.