All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] show correct error message when a policy has duplicate declarations
@ 2005-08-31 17:43 Jason Tang
  2005-08-31 18:09 ` Stephen Smalley
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Tang @ 2005-08-31 17:43 UTC (permalink / raw)
  To: selinux

[-- 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,

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

end of thread, other threads:[~2005-09-02 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-31 17:43 [PATCH] show correct error message when a policy has duplicate declarations Jason Tang
2005-08-31 18:09 ` Stephen Smalley
2005-08-31 18:23   ` Stephen Smalley
2005-09-02 13:36     ` Joshua Brindle

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.