]> err.no Git - linux-2.6/blobdiff - kernel/sysctl.c
[PATCH] inotify: event ordering
[linux-2.6] / kernel / sysctl.c
index 79dbd93bd697cd6d9bfaf4fdea5461c0114d373d..e60b9c36f1f0c35e1d8383ab96adee3648d9da7e 100644 (file)
@@ -58,6 +58,7 @@ extern int sysctl_overcommit_ratio;
 extern int max_threads;
 extern int sysrq_enabled;
 extern int core_uses_pid;
+extern int suid_dumpable;
 extern char core_pattern[];
 extern int cad_pid;
 extern int pid_max;
@@ -145,6 +146,9 @@ extern ctl_table random_table[];
 #ifdef CONFIG_UNIX98_PTYS
 extern ctl_table pty_table[];
 #endif
+#ifdef CONFIG_INOTIFY
+extern ctl_table inotify_table[];
+#endif
 
 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
 int sysctl_legacy_va_layout;
@@ -217,6 +221,7 @@ static ctl_table root_table[] = {
                .mode           = 0555,
                .child          = dev_table,
        },
+
        { .ctl_name = 0 }
 };
 
@@ -949,7 +954,23 @@ static ctl_table fs_table[] = {
                .mode           = 0644,
                .proc_handler   = &proc_dointvec,
        },
+#ifdef CONFIG_INOTIFY
+       {
+               .ctl_name       = FS_INOTIFY,
+               .procname       = "inotify",
+               .mode           = 0555,
+               .child          = inotify_table,
+       },
+#endif 
 #endif
+       {
+               .ctl_name       = KERN_SETUID_DUMPABLE,
+               .procname       = "suid_dumpable",
+               .data           = &suid_dumpable,
+               .maxlen         = sizeof(int),
+               .mode           = 0644,
+               .proc_handler   = &proc_dointvec,
+       },
        { .ctl_name = 0 }
 };
 
@@ -959,7 +980,7 @@ static ctl_table debug_table[] = {
 
 static ctl_table dev_table[] = {
        { .ctl_name = 0 }
-};  
+};
 
 extern void init_irq_proc (void);
 
@@ -991,8 +1012,7 @@ int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *ol
                int error = parse_table(name, nlen, oldval, oldlenp, 
                                        newval, newlen, head->ctl_table,
                                        &context);
-               if (context)
-                       kfree(context);
+               kfree(context);
                if (error != -ENOTDIR)
                        return error;
                tmp = tmp->next;
@@ -1991,6 +2011,8 @@ int proc_dointvec_userhz_jiffies(ctl_table *table, int write, struct file *filp,
  * @filp: the file structure
  * @buffer: the user buffer
  * @lenp: the size of the user buffer
+ * @ppos: file position
+ * @ppos: the current position in the file
  *
  * Reads/writes up to table->maxlen/sizeof(unsigned int) integer
  * values from/to the user buffer, treated as an ASCII string.