hush/libbb
Eric Andersen 3f47c453da Christian Grigis, christian.grigis at smartdata dot ch writes:
Hello everyone,

Busybox's insmod fails to locate a module when that module is the only one
existing in the /lib/modules directory (with a unique name).

Example:

# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
# insmod bios
insmod: bios.o: no module by that name found
# touch /lib/modules/dummy
# find /lib/modules/ -type f
/lib/modules/kernel/drivers/char/bios.o
/lib/modules/dummy
# insmod bios
Using /lib/modules/kernel/drivers/char/bios.o

As long as there is another file in the /lib/modules directory, insmod
finds it OK.

I tracked the problem down to 'check_module_name_match()' in insmod.c:

It returns TRUE when a match is found, and FALSE otherwise. In the case
where there is only one module in the /lib/modules directory (or more that
one module, but all with the same name), 'recursive_action()' will return
TRUE and we end up on line 4196 in 'insmod.c' which returns an error.
[The reason it works with more than one module with different
names is that in this case there will always be one not matching,
'recursive_action()' will return FALSE and we end up in line 4189.]

Now, from the implementation of 'recursive_action()' and from other
usages of it (tar.c, etc.), it seems to me that FALSE should be returned
to indicate that we want to stop the recursion, so TRUE and FALSE should
be inverted in 'check_module_name_match()'.

At the same time, 'recursive_action()' continues to recurse even after
the recursive call has returned FALSE; again in my understanding and
other usages of it, we can safely stop recursing at this point.


Here is my patch against 1.00-pre8:
2004-04-06 11:56:26 +00:00
..
.cvsignore update .cvsignore files to note new location of loop.h 2001-03-17 00:15:02 +00:00
ask_confirmation.c Major coreutils update. 2003-03-19 09:13:01 +00:00
bb_asprintf.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
change_identity.c more crond+crontab integrating with loginutil libbb functions and deleted 2003-09-03 12:18:42 +00:00
chomp.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
compare_string_array.c Major coreutils update. 2003-03-19 09:13:01 +00:00
concat_path_file.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
concat_subpath_file.c Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
copy_file.c For the time being, revert the changes for detecting copying 2004-02-22 11:46:49 +00:00
copyfd.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
correct_password.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
create_icmp6_socket.c Major coreutils update. 2003-03-19 09:13:01 +00:00
create_icmp_socket.c Major coreutils update. 2003-03-19 09:13:01 +00:00
default_error_retval.c Major coreutils update. 2003-03-19 09:13:01 +00:00
device_open.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
dump.c Add missing include files 2004-03-27 11:26:32 +00:00
error_msg_and_die.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
error_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
fclose_nonstdin.c Major coreutils update. 2003-03-19 09:13:01 +00:00
fflush_stdout_and_exit.c Major coreutils update. 2003-03-19 09:13:01 +00:00
fgets_str.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
find_mount_point.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
find_pid_by_name.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
find_root_device.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
full_read.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
full_write.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
get_console.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
get_last_path_component.c Major coreutils update. 2003-03-19 09:13:01 +00:00
get_line_from_file.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
get_terminal_width_height.c Brian Pomerantz writes: 2004-03-23 23:15:36 +00:00
get_ug_id.c Patch from Arthur Othieno to fix a compiler warning 2003-10-22 10:26:38 +00:00
getopt_ulflags.c Vladimir N. Oleynik writes: 2004-02-05 13:49:29 +00:00
hash_fd.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
herror_msg_and_die.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
herror_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
human_readable.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
inet_common.c In spite of the feature freeze, check in a complete rework of route which 2004-03-10 07:42:38 +00:00
inode_hash.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
interface.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
isdirectory.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
kernel_version.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
last_char_is.c Save 10 bytes or so, last_patch_70 from Vladimir N. Oleynik 2002-12-03 20:34:36 +00:00
llist_add_to.c Move add_to_list from libunarchive to libbb so it can be of more general use (eg ifupdown). Changed the name to llist_add_to as i plan on adding more llist_ functions as needed (e.g. llist_free). 2002-12-08 00:54:33 +00:00
login.c Geir Thomassen wrote, regarding networking/httpd.c line 1358 2003-06-26 09:05:32 +00:00
loop.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
make_directory.c Major coreutils update. 2003-03-19 09:13:01 +00:00
Makefile Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
Makefile.in Fix/eliminate use of atol 2004-03-06 22:11:45 +00:00
messages.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
mode_string.c Fix a bug reported by junkio@cox.net involving the mode_chars index. 2003-08-14 02:28:49 +00:00
module_syscalls.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
mtab_file.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
mtab.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
my_getgrgid.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
my_getgrnam.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
my_getpwnam.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
my_getpwnamegid.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
my_getpwuid.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
obscure.c Patch from vodz to cleanup libbb/obscure.c:password_check() 2003-08-06 08:33:08 +00:00
parse_mode.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
parse_number.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
perror_msg_and_die.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
perror_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
perror_nomsg_and_die.c Major coreutils update. 2003-03-19 09:13:01 +00:00
perror_nomsg.c Major coreutils update. 2003-03-19 09:13:01 +00:00
print_file.c Add missing include files 2004-03-27 11:26:32 +00:00
printf.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
process_escape_sequence.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
procps.c Teach busybox ps to get the correct uid when displaying stuff 2004-01-27 20:17:39 +00:00
pw_encrypt.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
pwd2spwd.c Cleanup shadow.h stuff so it behaves as intended 2002-07-03 04:47:43 +00:00
qmodule.c rmmod -a removed modules recursively 2002-12-14 01:58:59 +00:00
read_package_field.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
README Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
recursive_action.c Christian Grigis, christian.grigis at smartdata dot ch writes: 2004-04-06 11:56:26 +00:00
remove_file.c Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
restricted_shell.c Port over the last of the tinylogin applets 2002-06-23 04:24:25 +00:00
run_parts.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
run_shell.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
safe_read.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
safe_strncpy.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
safe_strtol.c Fix/eliminate use of atol 2004-03-06 22:11:45 +00:00
safe_write.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
setup_environment.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
simplify_path.c Major coreutils update. 2003-03-19 09:13:01 +00:00
skip_whitespace.c Major coreutils update. 2003-03-19 09:13:01 +00:00
speed_table.c Major coreutils update. 2003-03-19 09:13:01 +00:00
syscalls.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
syslog_msg_with_name.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
trim.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
u_signal_names.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
vdprintf.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
verror_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
vfork_daemon_rexec.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
vherror_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
vperror_msg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
warn_ignoring_args.c Major coreutils update. 2003-03-19 09:13:01 +00:00
wfopen_input.c Major coreutils update. 2003-03-19 09:13:01 +00:00
wfopen.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xconnect.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xfuncs.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xgetcwd.c Vodz, last_patch_86 2003-05-26 14:07:50 +00:00
xgethostbyname2.c Major coreutils update. 2003-03-19 09:13:01 +00:00
xgethostbyname.c Major coreutils update. 2003-03-19 09:13:01 +00:00
xgetlarg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xgetularg.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xreadlink.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00
xregcomp.c Remove trailing whitespace. Update copyright to include 2004. 2004-03-15 08:29:22 +00:00

Please see the LICENSE file for copyright information (GPLv2)

libbb is BusyBox's utility library.  All of this stuff used to be stuffed into
a single file named utility.c.  When I split utility.c to create libbb, some of
the very oldest stuff ended up without their original copyright and licensing
information (which is now lost in the mists of time).  If you see something
that you wrote that is mis-attributed, do let me know so we can fix that up.

	Erik Andersen
	<andersen@codepoet.org>