patch-2.1.92 linux/kernel/sysctl.c

Next file: linux/mm/page_alloc.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.91/linux/kernel/sysctl.c linux/kernel/sysctl.c
@@ -33,7 +33,7 @@
 #include <linux/nfs_fs.h>
 #endif
 
-#ifdef CONFIG_SYSCTL
+#if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
 
 /* External variables not in a header file. */
 extern int panic_timeout;
@@ -45,6 +45,9 @@
 extern char modprobe_path[];
 extern int kmod_unload_delay;
 #endif
+#ifdef CONFIG_CHR_DEV_SG
+extern int sg_big_buff;
+#endif
 
 #ifdef __sparc__
 extern char reboot_command [];
@@ -52,8 +55,6 @@
 
 static int parse_table(int *, int, void *, size_t *, void *, size_t,
 		       ctl_table *, void **);
-static int do_securelevel_strategy (ctl_table *, int *, int, void *, size_t *,
-				    void *, size_t, void **);
 
 
 static ctl_table root_table[];
@@ -156,8 +157,6 @@
 	 0644, NULL, &proc_dointvec},
 	{KERN_DENTRY, "dentry-state", &dentry_stat, 6*sizeof(int),
 	 0444, NULL, &proc_dointvec},
-	{KERN_SECURELVL, "securelevel", &securelevel, sizeof(int),
-	 0444, NULL, &proc_dointvec, (ctl_handler *)&do_securelevel_strategy},
 	{KERN_PANIC, "panic", &panic_timeout, sizeof(int),
 	 0644, NULL, &proc_dointvec},
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -184,6 +183,10 @@
 	{KERN_KMOD_UNLOAD_DELAY, "kmod_unload_delay", &kmod_unload_delay,
 	sizeof(int), 0644, NULL, &proc_dointvec},
 #endif
+#ifdef CONFIG_CHR_DEV_SG
+	{KERN_NRFILE, "sg-big-buff", &sg_big_buff, sizeof (int),
+	 0444, NULL, &proc_dointvec},
+#endif
 	{0}
 };
 
@@ -408,29 +411,6 @@
 	return 0;
 }
 
-/*
- * This function only checks permission for changing the security level
- * If the tests are successful, the actual change is done by
- * do_sysctl_strategy
- */
-static int do_securelevel_strategy (ctl_table *table, 
-				    int *name, int nlen,
-				    void *oldval, size_t *oldlenp,
-				    void *newval, size_t newlen, void **context)
-{
-	int level;
-
-	if (newval && newlen) {
-		if (newlen != sizeof (int))
-			return -EINVAL;
-		if(copy_from_user (&level, newval, newlen))
-			return -EFAULT;
-		if (level < securelevel && current->pid != 1)
-			return -EPERM;
-	}
-	return 0;
-}
-
 struct ctl_table_header *register_sysctl_table(ctl_table * table, 
 					       int insert_at_head)
 {
@@ -1031,7 +1011,7 @@
 }
 
 
-#else /* CONFIG_SYSCTL */
+#else /* CONFIG_PROC_FS && CONFIG_SYSCTL */
 
 
 extern asmlinkage int sys_sysctl(struct __sysctl_args *args)
@@ -1087,7 +1067,7 @@
 {
 }
 
-#endif /* CONFIG_SYSCTL */
+#endif /* CONFIG_PROC_FS && CONFIG_SYSCTL */
 
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov