From: Karl MacMillan <kmacmillan@mentalrootkit.com>
To: V13 <v13@priest.com>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
selinux <selinux@tycho.nsa.gov>,
Joshua Brindle <jbrindle@tresys.com>,
Darrel Goeddel <dgoeddel@TrustedCS.com>,
"Christopher J. PeBenito" <cpebenito@tresys.com>
Subject: Re: [patch] libsepol: check for unmet requires on sensitivities and categories (Was: Re: core dump)
Date: Tue, 06 Feb 2007 09:38:20 -0500 [thread overview]
Message-ID: <45C892DC.7050607@mentalrootkit.com> (raw)
In-Reply-To: <200702061524.29509.v13@priest.com>
V13 wrote:
> On Tuesday 06 February 2007 15:06, Stephen Smalley wrote:
>> Patch below for the stable branch.
>>
>> Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
>>
>> Index: libsepol/src/link.c
>> ===================================================================
>> --- libsepol/src/link.c (revision 2221)
>> +++ libsepol/src/link.c (working copy)
>> @@ -597,6 +597,13 @@
>> state->cur_mod_name);
>> return -SEPOL_LINK_NOTSUP;
>> }
>> + if (scope->scope == SCOPE_REQ) {
>> + /* unmet requirement */
>> + ERR(state->handle,
>> + "%s: Sensitivity %s not declared by base.\n",
>> + state->cur_mod_name, id);
>> + return -SEPOL_LINK_NOTSUP;
>> + }
>> }
>
> May I recomend that an:
>
> assert(0);
>
> been added at the end of the outter if statement or there is no way that
> another SCOPE_ value will be added in the future.
I think this is a good practice in general, but it's not likely that
another scope will be added.
In the latter case, perhaps
> an enum (for the SCOPE_* values) and a switch() (instead of the ifs) would be
> better. gcc warns on switch() statements that don't handle all values of an
> enum.
>
Enums aren't used often in libsepol and I'd rather not change to that
style now.
Thanks - 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.
next prev parent reply other threads:[~2007-02-06 14:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-06 2:12 core dump Stefanos Harhalakis
2007-02-06 12:40 ` Stephen Smalley
2007-02-06 13:06 ` [patch] libsepol: check for unmet requires on sensitivities and categories (Was: Re: core dump) Stephen Smalley
2007-02-06 13:15 ` [patch -trunk] " Stephen Smalley
2007-02-06 15:05 ` Karl MacMillan
2007-02-06 13:24 ` [patch] " V13
2007-02-06 14:38 ` Karl MacMillan [this message]
2007-02-06 15:15 ` Karl MacMillan
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=45C892DC.7050607@mentalrootkit.com \
--to=kmacmillan@mentalrootkit.com \
--cc=cpebenito@tresys.com \
--cc=dgoeddel@TrustedCS.com \
--cc=jbrindle@tresys.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=v13@priest.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.