selinux: sparse fix: fix several warnings in the security server cod
authorJames Morris <jmorris@namei.org>
Tue, 30 Aug 2011 04:19:02 +0000 (14:19 +1000)
committerEric Paris <eparis@redhat.com>
Thu, 5 Jan 2012 23:52:52 +0000 (18:52 -0500)
Fix several sparse warnings in the SELinux security server code.

Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: Eric Paris <eparis@redhat.com>
security/selinux/hooks.c
security/selinux/include/avc_ss.h
security/selinux/ss/conditional.c
security/selinux/ss/conditional.h
security/selinux/ss/policydb.c

index 1206cee31c791f7613d461a4770a16d11e40e0bd..e545b9f6707210fa56b54a2e8257e57630776b36 100644 (file)
@@ -89,6 +89,7 @@
 #include "xfrm.h"
 #include "netlabel.h"
 #include "audit.h"
+#include "avc_ss.h"
 
 #define NUM_SEL_MNT_OPTS 5
 
@@ -278,10 +279,6 @@ static void superblock_free_security(struct super_block *sb)
        kfree(sbsec);
 }
 
-/* The security server must be initialized before
-   any labeling or access decisions can be provided. */
-extern int ss_initialized;
-
 /* The file system's label must be initialized prior to use. */
 
 static const char *labeling_behaviors[6] = {
index 4677aa519b0471b2f4dd7bad0cf79c737f93bd8d..d5c328452df0161acd82bd8ec295fecc00392b86 100644 (file)
@@ -18,5 +18,11 @@ struct security_class_mapping {
 
 extern struct security_class_mapping secclass_map[];
 
+/*
+ * The security server must be initialized before
+ * any labeling or access decisions can be provided.
+ */
+extern int ss_initialized;
+
 #endif /* _SELINUX_AVC_SS_H_ */
 
index a53373207fb459223e52fadd718e5a2cc2dbb666..2ec904177fe0bb65a522b110f642fd2f4ea0a5dd 100644 (file)
@@ -555,7 +555,7 @@ static int cond_write_av_list(struct policydb *p,
        return 0;
 }
 
-int cond_write_node(struct policydb *p, struct cond_node *node,
+static int cond_write_node(struct policydb *p, struct cond_node *node,
                    struct policy_file *fp)
 {
        struct cond_expr *cur_expr;
index 3f209c635295681f026874e332573577e743dea4..4d1f87466508f7adf60f2eb7f5ae89ec3c49aa29 100644 (file)
@@ -13,6 +13,7 @@
 #include "avtab.h"
 #include "symtab.h"
 #include "policydb.h"
+#include "../include/conditional.h"
 
 #define COND_EXPR_MAXDEPTH 10
 
index 2381d0ded228d492a207b2745a6bc59269114316..a7f61d52f05cd8cf5f9ad11dc10ab935ab19d097 100644 (file)
@@ -1743,8 +1743,6 @@ static int policydb_bounds_sanity_check(struct policydb *p)
        return 0;
 }
 
-extern int ss_initialized;
-
 u16 string_to_security_class(struct policydb *p, const char *name)
 {
        struct class_datum *cladatum;