All of lore.kernel.org
 help / color / mirror / Atom feed
* selinux context_new return value question
       [not found] <CAFUy1TzNKNWDACcXtBn05-CMkxyZzGNTQGNHyjt+XFPAoUQ-3Q@mail.gmail.com>
@ 2012-08-28  9:09 ` Gaurav Kumar
  2012-08-28 11:16   ` Daniel J Walsh
  0 siblings, 1 reply; 2+ messages in thread
From: Gaurav Kumar @ 2012-08-28  9:09 UTC (permalink / raw)
  To: SELinux

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: selinux context_new return value question
  2012-08-28  9:09 ` selinux context_new return value question Gaurav Kumar
@ 2012-08-28 11:16   ` Daniel J Walsh
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel J Walsh @ 2012-08-28 11:16 UTC (permalink / raw)
  To: Gaurav Kumar; +Cc: SELinux

-----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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-28 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [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 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.