selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Iooss <nicolas.iooss@m4x.org>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH] libsepol: ibpkeys.c: fix printf format string specifiers for subnet_prefix
Date: Fri, 23 Nov 2018 22:08:35 +0100	[thread overview]
Message-ID: <CAJfZ7=mcvpmn5PBYMpt2Uk+WYZ0QrLokpXT6h88Hoq-8AWsKGw@mail.gmail.com> (raw)
In-Reply-To: <CAJfZ7=keH-Kxs0nE7AvM1POCX=CSsGWU7H2WYqYDWBwdjsWcUQ@mail.gmail.com>

On Mon, Nov 5, 2018 at 9:55 PM Nicolas Iooss <nicolas.iooss@m4x.org> wrote:
>
> On Mon, Nov 5, 2018 at 3:36 PM Stephen Smalley <sds@tycho.nsa.gov> wrote:
> >
> > Use PRIx64 to print the subnet_prefix (which is a uint64_t) instead
> > of lx.
> >
> > Fixes https://github.com/SELinuxProject/selinux/issues/108
> >
> > Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
> > ---
> >  libsepol/src/ibpkeys.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/libsepol/src/ibpkeys.c b/libsepol/src/ibpkeys.c
> > index 682bf5db..68a9bdfe 100644
> > --- a/libsepol/src/ibpkeys.c
> > +++ b/libsepol/src/ibpkeys.c
> > @@ -1,5 +1,6 @@
> >  #include <netinet/in.h>
> >  #include <stdlib.h>
> > +#include <inttypes.h>
> >
> >  #include "debug.h"
> >  #include "context.h"
> > @@ -176,7 +177,7 @@ int sepol_ibpkey_query(sepol_handle_t *handle,
> >         return STATUS_SUCCESS;
> >
> >  err:
> > -       ERR(handle, "could not query ibpkey subnet prefix: %#lx range %u - %u exists",
> > +       ERR(handle, "could not query ibpkey subnet prefix: %#" PRIx64 " range %u - %u exists",
> >             subnet_prefix, low, high);
> >         return STATUS_ERR;
> >  }
> > @@ -203,7 +204,7 @@ int sepol_ibpkey_modify(sepol_handle_t *handle,
> >         return STATUS_SUCCESS;
> >
> >  err:
> > -       ERR(handle, "could not load ibpkey subnet prefix: %#lx range %u - %u exists",
> > +       ERR(handle, "could not load ibpkey subnet prefix: %#" PRIx64 " range %u - %u exists",
> >             subnet_prefix, low, high);
> >         if (ibpkey) {
> >                 context_destroy(&ibpkey->context[0]);
> > --
> > 2.19.1
> >
>
> This looks good to me, and while testing some things, I found a
> similar issue in libselinux/src/selinux_restorecon.c. Patch
> incoming...
>
> Cheers,
> Nicolas

Merged.

Nicolas


      reply	other threads:[~2018-11-23 21:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-05 14:38 [PATCH] libsepol: ibpkeys.c: fix printf format string specifiers for subnet_prefix Stephen Smalley
2018-11-05 20:55 ` Nicolas Iooss
2018-11-23 21:08   ` Nicolas Iooss [this message]

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='CAJfZ7=mcvpmn5PBYMpt2Uk+WYZ0QrLokpXT6h88Hoq-8AWsKGw@mail.gmail.com' \
    --to=nicolas.iooss@m4x.org \
    --cc=sds@tycho.nsa.gov \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).