All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel J Walsh <dwalsh@redhat.com>
To: Gaurav Kumar <gk@pivotalsecurity.com>
Cc: SELinux@tycho.nsa.gov
Subject: Re: selinux context_new return value question
Date: Tue, 28 Aug 2012 07:16:52 -0400	[thread overview]
Message-ID: <503CA8A4.50802@redhat.com> (raw)
In-Reply-To: <CAFUy1TwvBNP9UBTK39DRWg5LNnf6tA2UJYuBpPP548oK0GrZxg@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/28/2012 05:09 AM, Gaurav Kumar wrote:
> According to http://linux.die.net/man/3/context_new, "On success, zero is
> returned" but none of the functions mentioned return 0. They are all
> returning const char * or void. Can someone please clarify in which case 0
> will be returned? In other words, how can I find out if call to context_new
> succeeded?
> 
> Thanks, Gaurav
> 
> -- This message was distributed to subscribers of the selinux mailing
> list. If you no longer wish to subscribe, send mail to
> majordomo@tycho.nsa.gov with the words "unsubscribe selinux" without quotes
> as the message.
> 
> 
It is a bug.  NULL (0) actually would be the error code.  Since context_new is
basically doing a malloc of a new structure.

I will fix the code in Fedora and work to get it upstream.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlA8qKQACgkQrlYvE4MpobOp5wCfVOA4K7/MyqeLLWx2rN/9IQIH
VpUAoI2D8wB0NPHif03SMHYdRSkRuQGD
=as8V
-----END PGP SIGNATURE-----

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      reply	other threads:[~2012-08-28 11:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFUy1TzNKNWDACcXtBn05-CMkxyZzGNTQGNHyjt+XFPAoUQ-3Q@mail.gmail.com>
2012-08-28  9:09 ` selinux context_new return value question Gaurav Kumar
2012-08-28 11:16   ` Daniel J Walsh [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=503CA8A4.50802@redhat.com \
    --to=dwalsh@redhat.com \
    --cc=SELinux@tycho.nsa.gov \
    --cc=gk@pivotalsecurity.com \
    /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.