Bug 1402140 - getsebool prints Success when boolean names are not accessible
Summary: getsebool prints Success when boolean names are not accessible
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libselinux
Version: 7.3
Hardware: All
OS: Linux
low
low
Target Milestone: rc
: ---
Assignee: Petr Lautrbach
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-06 21:24 UTC by Milos Malik
Modified: 2017-08-01 17:43 UTC (History)
6 users (show)

Fixed In Version: libselinux-2.5-10.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 17:43:16 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1853 0 normal SHIPPED_LIVE libselinux bug fix update 2017-08-01 18:03:23 UTC

Description Milos Malik 2016-12-06 21:24:59 UTC
Description of problem:

Version-Release number of selected component (if applicable):
libselinux-utils-2.5-6.el7.x86_64

How reproducible:
* always

Steps to Reproduce:
# mkdir booleans
# mount --bind ./booleans /sys/fs/selinux/booleans
# getsebool -a
getsebool:  Unable to get boolean names:  Success
#

Expected results:
getsebool:  Unable to get boolean names

Comment 1 Petr Lautrbach 2017-03-06 12:26:09 UTC
--- a/libselinux/src/booleans.c
+++ b/libselinux/src/booleans.c
@@ -53,6 +53,7 @@ int security_get_boolean_names(char ***names, int *len)
        snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR);
        *len = scandir(path, &namelist, &filename_select, alphasort);
        if (*len <= 0) {
+               errno = ENOENT;
                return -1;
        }

Comment 5 errata-xmlrpc 2017-08-01 17:43:16 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1853


Note You need to log in before you can comment on or make changes to this bug.