[PATCH 21/28] HOTPLUG: Hack to allow for call to execve

From: Mike Waychison
Date: Mon Oct 25 2004 - 19:11:16 EST


This patch is a hack while we don't have a proper way for code to call
execve. It simply introduces call_usermodehelper_execve(path, argv, envp)
that call the execve syscall with an errno set.

We need to figure out a proper way for code to call execve!

Signed-off-by: Mike Waychison <michael.waychison@xxxxxxx>
---

include/linux/kmod.h | 1 +
kernel/kmod.c | 7 +++++++
2 files changed, 8 insertions(+)

Index: linux-2.6.9-quilt/kernel/kmod.c
===================================================================
--- linux-2.6.9-quilt.orig/kernel/kmod.c 2004-10-22 17:17:44.279732600 -0400
+++ linux-2.6.9-quilt/kernel/kmod.c 2004-10-22 17:17:44.879641400 -0400
@@ -278,6 +278,13 @@ int call_usermodehelper_cb(call_usermode
}
EXPORT_SYMBOL(call_usermodehelper_cb);

+/* This is an ugly hack while the __KERNEL_SYSCALLS__ cleanup occurs */
+int call_usermodehelper_execve(char *path, char *argv[], char *envp[])
+{
+ return execve(path, argv, envp);
+}
+EXPORT_SYMBOL(call_usermodehelper_execve);
+
static int call_usermodehelper_simple(void *cbdata)
{
struct simple_usermodehelper_info *info = cbdata;
Index: linux-2.6.9-quilt/include/linux/kmod.h
===================================================================
--- linux-2.6.9-quilt.orig/include/linux/kmod.h 2004-10-22 17:17:44.279732600 -0400
+++ linux-2.6.9-quilt/include/linux/kmod.h 2004-10-22 17:17:44.879641400 -0400
@@ -36,6 +36,7 @@ static inline int request_module(const c
#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
typedef int (*call_usermodehelper_cb_t)(void *cbdata);
extern int call_usermodehelper_cb(call_usermodehelper_cb_t cb, void *cbdata, int wait);
+extern int call_usermodehelper_execve(char *path, char *argv[], char *envp[]);
extern int call_usermodehelper(char *path, char *argv[], char *envp[], int wait);

#ifdef CONFIG_HOTPLUG

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/