All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Tang <jtang@tresys.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH] show correct error message when a policy has duplicate declarations
Date: Wed, 31 Aug 2005 13:43:19 -0400	[thread overview]
Message-ID: <1125510199.5306.59.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 206 bytes --]

Although checkpolicy/checkmodule catch duplicate declarations, the
compiler prints the wrong message.  This patch alters the program so that it
shows the correct message.

-- 
Jason Tang / jtang@tresys.com

[-- Attachment #2: module_compiler-patch --]
[-- Type: text/plain, Size: 1136 bytes --]

--- checkpolicy.old/module_compiler.c	2005-08-22 15:16:41.000000000 -0400
+++ checkpolicy/module_compiler.c	2005-08-31 13:25:25.000000000 -0400
@@ -145,9 +145,11 @@ int declare_symbol(uint32_t symbol_type,
         else if (retval == -2) {
                 return -2;
         }
-        else if (retval == -1 || retval == -ENOMEM) {
+        else if (retval < 0) {
                 return -3;
         }
+        else {  /* fall through possible if retval is 0 */
+        }
         if (datum_value != NULL) {
                 if (ebitmap_set_bit(decl->declared.scope + symbol_type,
                                     *datum_value - 1,
@@ -497,9 +499,11 @@ int require_symbol(uint32_t symbol_type,
         else if (retval == -2) {
                 return -2;
         }
-        else if (retval == -1 || retval == -ENOMEM) {
+        else if (retval < 0) {
                 return -3;
         }
+        else {  /* fall through possible if retval is 0 */
+        }
         if (datum_value != NULL) {
                 if (ebitmap_set_bit(decl->required.scope + symbol_type,
                                     *datum_value - 1,

             reply	other threads:[~2005-08-31 17:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-31 17:43 Jason Tang [this message]
2005-08-31 18:09 ` [PATCH] show correct error message when a policy has duplicate declarations Stephen Smalley
2005-08-31 18:23   ` Stephen Smalley
2005-09-02 13:36     ` Joshua Brindle

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=1125510199.5306.59.camel@localhost.localdomain \
    --to=jtang@tresys.com \
    --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.