On Mon, Aug 14, 2023 at 9:42 AM Christian Göttsche <cgzones@xxxxxxxxxxxxxx> wrote: > > selabel_lookup(3) is expected to set errno on lookup failure, i.e. when > it returns NULL. Set errno if a regular expression failed to compile in > compile_regex(). > > Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx> Acked-by: James Carter <jwcart2@xxxxxxxxx> > --- > v2: add patch > --- > libselinux/src/label_file.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/libselinux/src/label_file.h b/libselinux/src/label_file.h > index 3827b5c0..5365086b 100644 > --- a/libselinux/src/label_file.h > +++ b/libselinux/src/label_file.h > @@ -407,6 +407,7 @@ static inline int compile_regex(struct spec *spec, const char **errbuf) > *errbuf = ®ex_error_format_buffer[0]; > } > __pthread_mutex_unlock(&spec->regex_lock); > + errno = EINVAL; > return -1; > } > > -- > 2.40.1 >