summaryrefslogtreecommitdiff
path: root/modutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-02-15 19:07:43 +0000
committerEric Andersen <andersen@codepoet.org>2001-02-15 19:07:43 +0000
commit02b9f42a278c8ee4c9c215eb4addf2a985cc9668 (patch)
tree5b9a4d9676d603ce677ca3a170c692ecf4fa2b05 /modutils
parent81bcc92c3222fe70116f010c7a8e3e578015022a (diff)
downloadbusybox-w32-02b9f42a278c8ee4c9c215eb4addf2a985cc9668.tar.gz
busybox-w32-02b9f42a278c8ee4c9c215eb4addf2a985cc9668.tar.bz2
busybox-w32-02b9f42a278c8ee4c9c215eb4addf2a985cc9668.zip
Patch from Matt Kraai to fix bug #1103. I've tested it,
and it indeed seems to fix things. -Erik
Diffstat (limited to 'modutils')
-rw-r--r--modutils/insmod.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/modutils/insmod.c b/modutils/insmod.c
index 0da0a3962..58273521f 100644
--- a/modutils/insmod.c
+++ b/modutils/insmod.c
@@ -81,7 +81,7 @@
81#ifndef MODUTILS_MODULE_H 81#ifndef MODUTILS_MODULE_H
82static const int MODUTILS_MODULE_H = 1; 82static const int MODUTILS_MODULE_H = 1;
83 83
84#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $" 84#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $"
85 85
86/* This file contains the structures used by the 2.0 and 2.1 kernels. 86/* This file contains the structures used by the 2.0 and 2.1 kernels.
87 We do not use the kernel headers directly because we do not wish 87 We do not use the kernel headers directly because we do not wish
@@ -287,7 +287,7 @@ int delete_module(const char *);
287#ifndef MODUTILS_OBJ_H 287#ifndef MODUTILS_OBJ_H
288static const int MODUTILS_OBJ_H = 1; 288static const int MODUTILS_OBJ_H = 1;
289 289
290#ident "$Id: insmod.c,v 1.46 2001/02/14 21:23:06 andersen Exp $" 290#ident "$Id: insmod.c,v 1.47 2001/02/15 19:07:43 andersen Exp $"
291 291
292/* The relocatable object is manipulated using elfin types. */ 292/* The relocatable object is manipulated using elfin types. */
293 293
@@ -2880,6 +2880,7 @@ extern int insmod_main( int argc, char **argv)
2880 ElfW(Addr) m_addr; 2880 ElfW(Addr) m_addr;
2881 FILE *fp; 2881 FILE *fp;
2882 struct obj_file *f; 2882 struct obj_file *f;
2883 struct stat st;
2883 char m_name[BUFSIZ + 1] = "\0"; 2884 char m_name[BUFSIZ + 1] = "\0";
2884 int exit_status = EXIT_FAILURE; 2885 int exit_status = EXIT_FAILURE;
2885 int m_has_modinfo; 2886 int m_has_modinfo;
@@ -2941,7 +2942,8 @@ extern int insmod_main( int argc, char **argv)
2941 strcat(m_fullName, ".o"); 2942 strcat(m_fullName, ".o");
2942 2943
2943 /* Get a filedesc for the module */ 2944 /* Get a filedesc for the module */
2944 if ((fp = fopen(argv[optind], "r")) == NULL) { 2945 if (stat(argv[optind], &st) < 0 || !S_ISREG(st.st_mode) ||
2946 (fp = fopen(argv[optind], "r")) == NULL) {
2945 /* Hmpf. Could not open it. Search through _PATH_MODULES to find a module named m_name */ 2947 /* Hmpf. Could not open it. Search through _PATH_MODULES to find a module named m_name */
2946 if (recursive_action(_PATH_MODULES, TRUE, FALSE, FALSE, 2948 if (recursive_action(_PATH_MODULES, TRUE, FALSE, FALSE,
2947 findNamedModule, 0, m_fullName) == FALSE) 2949 findNamedModule, 0, m_fullName) == FALSE)