Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 213

kernel-2.6.18-238.el5.src.rpm

From: Prarit Bhargava <prarit@redhat.com>
Date: Wed, 10 Sep 2008 13:09:09 -0400
Subject: [audit] fix compile when CONFIG_AUDITSYSCALL is disabled
Message-id: 20080910170146.31924.23176.sendpatchset@prarit.bos.redhat.com
O-Subject: [RHEL5 PATCH] Fix compile when CONFIG_AUDITSYSCALL is disabled [v2]
Bugzilla: 452577
RH-Acked-by: Eric Paris <eparis@redhat.com>

Current RHEL5 tree will not compile if CONFIG_AUDITSYSCALL is deselected from
the .config.  Even though we don't support custom kernel building, it should
still compile.

Backported from 2.6.27 upstream.

Successfully compiled and boot tested by me.

Resolves BZ 452577.

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index cdb53ff..1102439 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -429,8 +429,8 @@ static inline struct audit_buffer *xfrm_audit_start(const char *op)
 #else
 #define xfrm_audit_log(a,s,t,r,p,x) do { ; } while (0)
 #define xfrm_audit_state_replay_overflow(x, s)	do { ; } while (0)
-#define xfrm_audit_state_replay(s, f, sp, sq)	do { ; } while (0)
-#define xfrm_naudit_state_replay(s, f, sp, sq)	do { ; } while (0)
+#define xfrm_audit_state_replay(s, sp, sq)	do { ; } while (0)
+#define xfrm_naudit_state_replay(s, sp, sq)	do { ; } while (0)
 #define xfrm_audit_state_notfound(s, f, sp, sq)	do { ; } while (0)
 #define xfrm_naudit_state_notfound(s, f, sp, sq) do { ; } while (0)
 #define xfrm_audit_state_icvfail(x, s, p)	do { ; } while (0)
diff --git a/kernel/audit.c b/kernel/audit.c
index 666cc3f..0744095 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -474,6 +474,7 @@ int audit_send_list(void *_dest)
 	return 0;
 }
 
+#ifdef CONFIG_AUDITSYSCALL
 static int prune_tree_thread(void *unused)
 {
 	mutex_lock(&audit_cmd_mutex);
@@ -486,6 +487,7 @@ void audit_schedule_prune(void)
 {
 	kthread_run(prune_tree_thread, NULL, "audit_prune_tree");
 }
+#endif
 
 struct sk_buff *audit_make_reply(int pid, int seq, int type, int done,
 				 int multi, void *payload, int size)
diff --git a/kernel/audit.h b/kernel/audit.h
index dae6ec0..7736a43 100644
--- a/kernel/audit.h
+++ b/kernel/audit.h
@@ -138,6 +138,7 @@ extern int selinux_audit_rule_update(void);
 extern struct mutex audit_filter_mutex;
 extern void audit_free_rule_rcu(struct rcu_head *);
 
+#ifdef CONFIG_AUDITSYSCALL
 extern struct audit_chunk *audit_tree_lookup(const struct inode *);
 extern void audit_put_chunk(struct audit_chunk *);
 extern int audit_tree_match(struct audit_chunk *, struct audit_tree *);
@@ -150,6 +151,15 @@ extern void audit_schedule_prune(void);
 extern void audit_prune_trees(void);
 extern const char *audit_tree_path(struct audit_tree *);
 extern void audit_put_tree(struct audit_tree *);
+#else
+#define audit_remove_tree_rule(rule) BUG()
+#define audit_add_tree_rule(rule) -EINVAL
+#define audit_make_tree(rule, str, op) -EINVAL
+#define audit_trim_trees() (void)0
+#define audit_put_tree(tree) (void)0
+#define audit_tag_tree(old, new) -EINVAL
+#define audit_tree_path(rule) ""        /* never called */
+#endif
 
 extern char *audit_unpack_string(void **, size_t *, size_t);