From 5689d82a44d220e9cd1044aabc52f6d39d93ed23 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Thu, 31 Jan 2019 20:48:23 +0100 Subject: [PATCH] libselinux: set an appropriate errno in booleans.c 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 --- 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; }