From: Jan Zarsky <jzarsky@redhat.com>
To: William Roberts <bill.c.roberts@gmail.com>
Cc: selinux@tycho.nsa.gov
Subject: Re: [PATCH] libsemanage: properly check return value of iterate function
Date: Mon, 11 Dec 2017 08:47:53 -0500 (EST) [thread overview]
Message-ID: <978800513.47600060.1513000073843.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAFftDdpvouX1L9d_iwKWxYmFw9=W7ORQ+AvZzhniR1kGbf3sHA@mail.gmail.com>
----- Original Message -----
> On Mon, Nov 27, 2017 at 2:01 AM, Jan Zarsky <jzarsky@redhat.com> wrote:
> > Function dbase_llist_iterate() iterates over records and checks return
> > value of iterate function. According to a manpage semanage_iterate(3),
> > handler can return value 1 for early exit. dbase_llist_iterate()
> > currently checks for return value > 1, which does not include
> > expected value 1.
> >
> > Affected functions:
> > semanage_bool_iterate_local
> > semanage_fcontext_iterate
> > semanage_fcontext_iterate_local
> > semanage_ibendport_iterate_local
> > semanage_ibpkey_iterate_local
> > semanage_iface_iterate_local
> > semanage_node_iterate_local
> > semanage_port_iterate_local
> > semanage_seuser_iterate
> > semanage_seuser_iterate_local
> > semanage_user_iterate
> > semanage_user_iterate_local
>
> Not really what I had in mind. I meant what was the affect. This is simple
> enough to gather, so ack on v1,
>
> My understanding is that the affect is that it that it doesn't short
> circuit the iterate
> routine so lockups take longer than they need be, is that correct?
Yes, that is the exactly the problem. I will try to be more clear next time.
>
> >
> > Signed-off-by: Jan Zarsky <jzarsky@redhat.com>
> > ---
> > libsemanage/src/database_llist.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libsemanage/src/database_llist.c
> > b/libsemanage/src/database_llist.c
> > index 8ce2e2c1..c8f4ff0b 100644
> > --- a/libsemanage/src/database_llist.c
> > +++ b/libsemanage/src/database_llist.c
> > @@ -263,7 +263,7 @@ int dbase_llist_iterate(semanage_handle_t * handle,
> > if (rc < 0)
> > goto err;
> >
> > - else if (rc > 1)
> > + else if (rc > 0)
> > break;
> > }
> >
> > --
> > 2.14.3
> >
> >
>
>
>
> --
> Respectfully,
>
> William C Roberts
>
next prev parent reply other threads:[~2017-12-11 13:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-22 15:09 [PATCH] libsemanage: properly check return value of iterate function Jan Zarsky
2017-11-22 21:35 ` William Roberts
2017-11-27 10:01 ` Jan Zarsky
2017-11-27 15:50 ` William Roberts
2017-12-11 13:47 ` Jan Zarsky [this message]
2017-11-27 19:09 ` William Roberts
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=978800513.47600060.1513000073843.JavaMail.zimbra@redhat.com \
--to=jzarsky@redhat.com \
--cc=bill.c.roberts@gmail.com \
--cc=selinux@tycho.nsa.gov \
/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.