Message ID | 20230814132025.45364-25-cgzones@googlemail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 6df403d5976d |
Delegated to: | Petr Lautrbach |
Headers | show |
Series | libselinux: rework selabel_file(5) database | expand |
On Mon, Aug 14, 2023 at 9:42 AM Christian Göttsche <cgzones@googlemail.com> 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@googlemail.com> Acked-by: James Carter <jwcart2@gmail.com> > --- > 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 >
On Wed, Oct 11, 2023 at 2:50 PM James Carter <jwcart2@gmail.com> wrote: > > On Mon, Aug 14, 2023 at 9:42 AM Christian Göttsche > <cgzones@googlemail.com> 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@googlemail.com> > > Acked-by: James Carter <jwcart2@gmail.com> > Merged. Thanks, Jim > > --- > > 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 > >
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; }
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@googlemail.com> --- v2: add patch --- libselinux/src/label_file.h | 1 + 1 file changed, 1 insertion(+)