]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix modprobe_path and hotplug_path sizes and sysctl
authorAndrew Morton <akpm@osdl.org>
Sat, 12 Jun 2004 23:41:17 +0000 (16:41 -0700)
committerLinus Torvalds <torvalds@evo.osdl.org>
Sat, 12 Jun 2004 23:41:17 +0000 (16:41 -0700)
From: Andy Whitcroft <apw@shadowen.org>

Both modprobe_path and hotplug_path are arbitrarily sized at 256 bytes and
that size is also expressed directly in the sysctl code.  It seems
reasonable to define a standard length and use that for consitancy.  This
patch introduces the constant KMOD_PATH_LEN and uses that.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/kmod.h
kernel/kmod.c
kernel/sysctl.c

index 7c5af18df9d11b504472382b902beb07026f639e..a484f52445cb885ec9efd7ffd98c9c554f7b6d7a 100644 (file)
@@ -23,6 +23,8 @@
 #include <linux/errno.h>
 #include <linux/compiler.h>
 
+#define KMOD_PATH_LEN 256
+
 #ifdef CONFIG_KMOD
 /* modprobe exit status on success, -ve on error.  Return value
  * usually useless though. */
index 160aa3d958ad2ba75480d0d8c051ed235a67c635..ea62192b7597aff716b7d594aca8eb27e860eb33 100644 (file)
@@ -47,7 +47,7 @@ static struct workqueue_struct *khelper_wq;
 /*
        modprobe_path is set via /proc/sys.
 */
-char modprobe_path[256] = "/sbin/modprobe";
+char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
 
 /**
  * request_module - try to load a kernel module
@@ -132,7 +132,7 @@ EXPORT_SYMBOL(request_module);
        events.  the command is expected to load drivers when
        necessary, and may perform additional system setup.
 */
-char hotplug_path[256] = "/sbin/hotplug";
+char hotplug_path[KMOD_PATH_LEN] = "/sbin/hotplug";
 
 EXPORT_SYMBOL(hotplug_path);
 
index 2b3fe7fed271727f64909074d58ae67f145e8cf3..ae990887f338fb72f78ec46ea876c7f1ccf98ec5 100644 (file)
@@ -392,7 +392,7 @@ static ctl_table kern_table[] = {
                .ctl_name       = KERN_MODPROBE,
                .procname       = "modprobe",
                .data           = &modprobe_path,
-               .maxlen         = 256,
+               .maxlen         = KMOD_PATH_LEN,
                .mode           = 0644,
                .proc_handler   = &proc_dostring,
                .strategy       = &sysctl_string,
@@ -403,7 +403,7 @@ static ctl_table kern_table[] = {
                .ctl_name       = KERN_HOTPLUG,
                .procname       = "hotplug",
                .data           = &hotplug_path,
-               .maxlen         = 256,
+               .maxlen         = KMOD_PATH_LEN,
                .mode           = 0644,
                .proc_handler   = &proc_dostring,
                .strategy       = &sysctl_string,