All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ondrej Mosnacek <omosnace@redhat.com>
To: Richard Filo <rfilo@redhat.com>
Cc: SElinux list <selinux@vger.kernel.org>
Subject: Re: [PATCH] libselinux: Add missing errno setup
Date: Mon, 6 Apr 2020 18:55:59 +0200	[thread overview]
Message-ID: <CAFqZXNvk=UoVRdpk4m4byh-kKU5LUp08C52Nx-MkfcywZ+4rig@mail.gmail.com> (raw)
In-Reply-To: <20200406141604.69308-1-rfilo@redhat.com>

Hi,

On Mon, Apr 6, 2020 at 4:16 PM Richard Filo <rfilo@redhat.com> wrote:
>
> fixes: https://src.fedoraproject.org/tests/selinux/issue/51
>
> Errno is not set to ENOENT when lookup_all() doesn't find any match.

Please put the issue link after the explanation (the link is just
additional information).

Also, you need to add a "Signed-off-by:" line to the end of the commit
message (for legal reasons), see:
https://github.com/SELinuxProject/selinux/blob/master/CONTRIBUTING.md#contributing-code
https://opensource.com/article/18/3/cla-vs-dco-whats-difference

> ---
>  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])

'result' can never be NULL here, so you can drop the first part of the check.

> +               errno = ENOENT;
>
>  finish:
>         free(clean_key);
> --
> 2.25.2
>

--
Ondrej Mosnacek <omosnace at redhat dot com>
Software Engineer, Security Technologies
Red Hat, Inc.


  reply	other threads:[~2020-04-06 16:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 14:16 [PATCH] libselinux: Add missing errno setup Richard Filo
2020-04-06 16:55 ` Ondrej Mosnacek [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFqZXNvk=UoVRdpk4m4byh-kKU5LUp08C52Nx-MkfcywZ+4rig@mail.gmail.com' \
    --to=omosnace@redhat.com \
    --cc=rfilo@redhat.com \
    --cc=selinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.