]> git.karo-electronics.de Git - linux-beck.git/commitdiff
audit: disable ipsec auditing when CONFIG_AUDITSYSCALL=n
authorJoy Latten <latten@austin.ibm.com>
Thu, 30 Nov 2006 21:50:43 +0000 (15:50 -0600)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 7 Dec 2006 04:14:23 +0000 (20:14 -0800)
Disables auditing in ipsec when CONFIG_AUDITSYSCALL is
disabled in the kernel.

Also includes a bug fix for xfrm_state.c as a result of
original ipsec audit patch.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
Signed-off-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c

index f699cdcab4067c466abb4c81eea8125486c02e12..e4765413cf80c7ee9a5f4997796f6ee7ef93a206 100644 (file)
@@ -398,8 +398,13 @@ struct xfrm_audit
        uid_t   loginuid;
        u32     secid;
 };
-void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
+
+#ifdef CONFIG_AUDITSYSCALL
+extern void xfrm_audit_log(uid_t auid, u32 secid, int type, int result,
                    struct xfrm_policy *xp, struct xfrm_state *x);
+#else
+#define xfrm_audit_log(a,s,t,r,p,x) do { ; } while (0)
+#endif /* CONFIG_AUDITSYSCALL */
 
 static inline void xfrm_pol_hold(struct xfrm_policy *policy)
 {
index 47c13649bac1bb423ae012630824c256e3816ffc..140bb9b384ac1ad03fcb7cb5f355bbeb7c95af88 100644 (file)
@@ -1986,6 +1986,7 @@ int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *first,
 
 EXPORT_SYMBOL(xfrm_bundle_ok);
 
+#ifdef CONFIG_AUDITSYSCALL
 /* Audit addition and deletion of SAs and ipsec policy */
 
 void xfrm_audit_log(uid_t auid, u32 sid, int type, int result,
@@ -2094,6 +2095,7 @@ void xfrm_audit_log(uid_t auid, u32 sid, int type, int result,
 }
 
 EXPORT_SYMBOL(xfrm_audit_log);
+#endif /* CONFIG_AUDITSYSCALL */
 
 int xfrm_policy_register_afinfo(struct xfrm_policy_afinfo *afinfo)
 {
index d5d3a6f1f609d8595f5af7e9d18d4119b93f0dd3..fdb08d9f34aa684b1180985e031e77f1de116f55 100644 (file)
@@ -407,7 +407,6 @@ restart:
                                xfrm_state_hold(x);
                                spin_unlock_bh(&xfrm_state_lock);
 
-                               xfrm_state_delete(x);
                                err = xfrm_state_delete(x);
                                xfrm_audit_log(audit_info->loginuid,
                                               audit_info->secid,