All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: SELinux Mail List <selinux@tycho.nsa.gov>,
	Joshua Brindle <jbrindle@tresys.com>
Subject: Re: [PATCH] add central errno.h to libsepol
Date: Thu, 01 Feb 2007 16:30:43 -0500	[thread overview]
Message-ID: <45C25C03.7000501@mentalrootkit.com> (raw)
In-Reply-To: <1169134305.22731.272.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:
> On Tue, 2007-01-16 at 09:59 -0500, Karl MacMillan wrote:
>> Stephen Smalley wrote:
>>> On Mon, 2007-01-15 at 17:57 -0500, Karl MacMillan wrote:
>>>> The attached patch adds a central errno.h to libsepol and converts 
>>>> several existing error numbers. This will unify the error numbers, 
>>>> remove duplication, and prevent overlapping error numbers (a source of 
>>>> potential bugs). Existing return values from functions exposed as part 
>>>> of the binary interface are not changed.
>>> I'm not enthusiastic about diverging the errno values from the system
>>> values for e.g. ENOMEM and friends.  I'd prefer to keep them the same,
>>> and use some other part of the value space for any custom error values
>>> defined by libsepol.
>> I think that practically we are going to end up diverging from system 
>> errno values to some extent. For example, -EPERM is -1 and I think that 
>> trying to change every function that returns -1 for general error is 
>> going to be hard.
>>
>> The updated patch aligns them more closely, however.
>>
>>    Also, I'm not sure about referring to this as
>>> errno.h, as libsepol is _not_ setting errno to these values; it uses
>>> these values as internal return values for conveying error information.
>> Changed to errcodes.h.
>>
>>> The functions that do happen to explicitly set errno are using
>>> traditional errno values.
>> I explicitly did not change those return values.
>>
>> In addition to the changes noted above, I removed the license statements 
>> from the header files, which I took as the consensus from the other 
>> discussion in this thread. Updated patch attached.
>>
>> The attached patch adds a central header for error and return codes 
>> (errcodes.h) to libsepol and converts several existing error numbers. 
>> This will unify the error numbers, remove duplication, and prevent 
>> overlapping error numbers (a source of potential bugs). Existing return 
>> values from functions exposed as part of the binary interface are not 
>> changed.
>>
>> Signed-off-by: Karl MacMillan <kmacmillan@mentalrootkit.com>
>>
>>   checkpolicy/policy_parse.y                    |   15 ++---
>>   libsepol/include/sepol/errcodes.h             |   25 ++++++++
>>   libsepol/include/sepol/policydb/hashtab.h     |   23 +++-----
>>   libsepol/include/sepol/policydb/link.h        |   29 +---------
>>   libsepol/src/avtab.c                          |   18 +++---
>>   libsepol/src/expand.c                         |    7 +-
>>   libsepol/src/hashtab.c                        |   45 +++++++++++-----
>>   libsepol/src/link.c                           |   33 ++++++-----
>>   libsepol/src/policydb.c                       |    6 +-
>>   libsepol/src/private.h                        |    4 +
>>   policycoreutils/semodule_deps/semodule_deps.c |    9 +--
>>   11 files changed, 122 insertions(+), 92 deletions(-)
> 
> Acked-by:  Stephen Smalley <sds@tycho.nsa.gov>
> 
> (for trunk only, not stable)
> 

Merged into trunk as libsepol 2.0.0.

Karl

--
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:[~2007-02-01 21:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-15 22:57 [PATCH] add central errno.h to libsepol Karl MacMillan
2007-01-16  3:00 ` Joshua Brindle
2007-01-16 11:39   ` Steve G
2007-01-16 12:37   ` Stephen Smalley
2007-01-16 13:11 ` Stephen Smalley
2007-01-16 14:59   ` Karl MacMillan
2007-01-18 15:31     ` Stephen Smalley
2007-02-01 21:30       ` Karl MacMillan [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=45C25C03.7000501@mentalrootkit.com \
    --to=kmacmillan@mentalrootkit.com \
    --cc=jbrindle@tresys.com \
    --cc=sds@tycho.nsa.gov \
    --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.