From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Petr Lautrbach <plautrba@redhat.com>
Subject: [PATCH 1/2] libselinux: set an appropriate errno in booleans.c
Date: Thu, 31 Jan 2019 20:48:23 +0100 [thread overview]
Message-ID: <20190131194824.4944-1-plautrba@redhat.com> (raw)
Fixes:
$ mkdir booleans
$ sudo mount --bind ./booleans /sys/fs/selinux/booleans
$ sudo getsebool -a
getsebool: Unable to get boolean names: Success
Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
---
libselinux/src/booleans.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c
index b3ea3623..a6d46fea 100644
--- a/libselinux/src/booleans.c
+++ b/libselinux/src/booleans.c
@@ -55,6 +55,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;
}
--
2.20.1
next reply other threads:[~2019-01-31 19:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-31 19:48 Petr Lautrbach [this message]
2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
2019-01-31 22:02 ` Nicolas Iooss
2019-02-05 7:19 ` Nicolas Iooss
2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
2019-02-05 7:18 ` Nicolas Iooss
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=20190131194824.4944-1-plautrba@redhat.com \
--to=plautrba@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).