Skip to content

Commit

Permalink
libselinux: Add missing errno setup
Browse files Browse the repository at this point in the history
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@redhat.com>
Acked-by: Ondrej Mosnacek <omosnace@redhat.com>
  • Loading branch information
Richard-Filo authored and bachradsusi committed May 6, 2020
1 parent 1baa8ff commit 7ce2d86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libselinux/src/label_file.c
Expand Up @@ -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);
Expand Down

0 comments on commit 7ce2d86

Please sign in to comment.