selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libselinux: set an appropriate errno in booleans.c
@ 2019-01-31 19:48 Petr Lautrbach
  2019-01-31 19:48 ` [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Petr Lautrbach
  2019-01-31 22:02 ` [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Nicolas Iooss
  0 siblings, 2 replies; 6+ messages in thread
From: Petr Lautrbach @ 2019-01-31 19:48 UTC (permalink / raw)
  To: selinux; +Cc: Petr Lautrbach

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-02-05  7:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-31 19:48 [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Petr Lautrbach
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

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).