Skip to contentSkip to conversation

don't include <linux/sysctl.h> in <linux/security.h>

PATCH New Christoph Hellwig 1 participant 1 message Sep 19, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't include <linux/sysctl.h> in <linux/security.h>

security.h gets pulled in in lots of places, so use forward declarations for struct ctl_table instead of pulling sysctl in everywhere.

include/linux/security.h +2 -1
@@ -27,13 +27,14 @@
 #include <linux/signal.h>
 #include <linux/resource.h>
 #include <linux/sem.h>
-#include <linux/sysctl.h>
 #include <linux/shm.h>
 #include <linux/msg.h>
 #include <linux/sched.h>
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 
+struct ctl_table;
+
 /*
  * These functions are in security/capability.c and are used
  * as the default capabilities functions
@@ -1029,7 +1030,7 @@
			    kernel_cap_t * inheritable,
			    kernel_cap_t * permitted);
	int (*acct) (struct file * file);
-	int (*sysctl) (ctl_table * table, int op);
+	int (*sysctl) (struct ctl_table * table, int op);
	int (*capable) (struct task_struct * tsk, int cap);
	int (*quotactl) (int cmds, int type, int id, struct super_block * sb);
	int (*quota_on) (struct file * f);
@@ -1268,7 +1269,7 @@
	return security_ops->acct (file);

}

-static inline int security_sysctl(ctl_table * table, int op) +static inline int security_sysctl(struct ctl_table *table, int op)

 {
	return security_ops->sysctl(table, op);
 }
@@ -1940,7 +1941,7 @@
	return 0;

}

-static inline int security_sysctl(ctl_table * table, int op) +static inline int security_sysctl(struct ctl_table *table, int op)

 {
	return 0;

}
===== security/selinux/hooks.c 1.60 vs edited =====

security/selinux/hooks.c +1 -0
@@ -64,6 +64,7 @@
 #include <net/ipv6.h>
 #include <linux/hugetlb.h>
 #include <linux/personality.h>
+#include <linux/sysctl.h>
 
 #include "avc.h"
 #include "objsec.h"