[PATCH v3] libselinux: Add missing errno setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Errno is not set to ENOENT when lookup_all() doesn't find any match.

fixes: https://src.fedoraproject.org/tests/selinux/issue/51

Signed-off-by: Richard Filo <rfilo@xxxxxxxxxx>
---
	-removed check: result != NULL

 libselinux/src/label_file.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libselinux/src/label_file.c b/libselinux/src/label_file.c
index 300625c2..74d2027e 100644
--- a/libselinux/src/label_file.c
+++ b/libselinux/src/label_file.c
@@ -948,6 +948,8 @@ static const struct spec **lookup_all(struct selabel_handle *rec,
 			goto finish;
 		}
 	}
+	if (!result[0]) 
+		errno = ENOENT;
 
 finish:
 	free(clean_key);
-- 
2.25.2




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux