All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libselinux: Add missing errno setup
@ 2020-04-06 14:16 Richard Filo
  2020-04-06 16:55 ` Ondrej Mosnacek
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Filo @ 2020-04-06 14:16 UTC (permalink / raw)
  To: selinux

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

Errno is not set to ENOENT when lookup_all() doesn't find any match.
---
 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..113bb9b7 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 && !result[0]) 
+		errno = ENOENT;
 
 finish:
 	free(clean_key);
-- 
2.25.2


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

end of thread, other threads:[~2020-05-06 14:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-06 14:16 [PATCH] libselinux: Add missing errno setup Richard Filo
2020-04-06 16:55 ` Ondrej Mosnacek
2020-05-04  8:45   ` [PATCH v2] " Richard Filo
2020-05-04  9:01     ` Ondrej Mosnacek
2020-05-04 10:38       ` [PATCH v3] " Richard Filo
2020-05-04 11:08         ` Ondrej Mosnacek
2020-05-06 14:10           ` Petr Lautrbach

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.