From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Waychison Subject: [PATCH 21/28] HOTPLUG: Hack to allow for call to execve Date: Mon, 25 Oct 2004 10:49:10 -0400 Sender: linux-kernel-owner@vger.kernel.org Message-ID: <1098715750856@sun.com> References: <10987157204162@sun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Cc: raven@themaw.net Return-path: In-Reply-To: <10987157204162@sun.com> To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 --- 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