1 --- busybox-0.60.5/insmod.c 2002-09-16 06:30:10.000000000 +0100
2 +++ busybox-0.60.5.gz/insmod.c 2003-12-29 17:43:56.000000000 +0000
7 +void delete_unziped_module(char *name)
9 + if (unlink(name) < 0)
10 + fprintf(stderr, "Couldnt remove %s", name);
13 extern int insmod_main( int argc, char **argv)
17 char m_name[FILENAME_MAX] = "\0";
18 int exit_status = EXIT_FAILURE;
21 #ifdef BB_FEATURE_INSMOD_VERSION_CHECKING
22 struct utsname uts_info;
23 char m_strversion[STRVERSIONLEN];
24 @@ -3498,9 +3505,18 @@
28 - if (len > 2 && tmp[len - 2] == '.' && tmp[len - 1] == 'o') {
30 + if (len > 5 && tmp[len - 5] == '.' && tmp[len - 4] == 'o' && tmp[len - 3] == '.' && tmp[len - 2] == 'g' && tmp[len - 1] == 'z') {
37 + if (len > 2 && tmp[len - 2] == '.' && tmp[len - 1] == 'o') {
43 /* Make sure there is space for the terminal NULL */
46 (fp = fopen(argv[optind], "r")) == NULL) {
47 struct utsname myuname;
50 /* Hmm. Could not open it. First search under /lib/modules/`uname -r`,
51 * but do not error out yet if we fail to find it... */
52 if (uname(&myuname) == 0) {
53 @@ -3542,6 +3559,14 @@
54 check_module_name_match, 0, m_fullName);
57 + /* If we've not found anything, try the gzipped version */
58 + if ((m_filename[0] == '\0' || ((fp = fopen(m_filename, "r")) == NULL)) && !gunzip)
60 + strcat(m_fullName, ".gz");
65 /* Check if we have found anything yet */
66 if (m_filename[0] == '\0' || ((fp = fopen(m_filename, "r")) == NULL))
68 @@ -3565,11 +3590,52 @@
70 safe_strncpy(m_filename, argv[optind], sizeof(m_filename));
76 + char m_filename_unziped[FILENAME_MAX + 1] = "\0";
78 + strcpy(m_filename_unziped, m_filename);
79 + my_len = strlen(m_filename_unziped);
80 + m_filename_unziped[my_len - 3] = '\0';
82 + if ((fp_unziped = fopen (m_filename_unziped, "w")) == NULL)
84 + perror(m_filename_unziped);
85 + return EXIT_FAILURE;
88 + if (unzip(fp, fp_unziped) != 0)
92 + error_msg("unable to gunzip %s", m_filename_unziped);
93 + delete_unziped_module(m_filename_unziped);
94 + return EXIT_FAILURE;
100 + strcpy(m_filename, m_filename_unziped);
102 + if ((fp = fopen (m_filename, "r")) == NULL)
104 + perror(m_filename);
105 + return EXIT_FAILURE;
109 printf("Using %s\n", m_filename);
111 if ((f = obj_load(fp, LOADBITS)) == NULL)
112 - perror_msg_and_die("Could not load the module");
116 + delete_unziped_module(m_filename);
117 + perror_msg_and_die("Could not load the module");
120 if (get_modinfo_value(f, "kernel_version") == NULL)
123 @@ -3679,8 +3745,6 @@
125 /* Find current size of the module */
126 m_size = obj_load_size(f);
129 m_addr = create_module(m_name, m_size);
130 if (m_addr==-1) switch (errno) {
132 @@ -3723,5 +3787,7 @@
137 + delete_unziped_module(m_filename);
140 --- busybox-0.60.5/modprobe.c 2003-12-29 17:05:50.000000000 +0000
141 +++ busybox-0.60.5.gz/modprobe.c 2004-01-01 19:22:44.000000000 +0000
146 + if (( *(col-5) == '.' ) && ( *(col-4) == 'o' ) && ( *(col-3) == '.' ) && ( *(col-2) == 'g' ) && ( *(col-1) == 'z' ))
149 if (( *(col-2) == '.' ) && ( *(col-1) == 'o' ))
156 + if (( *(end-4) == '.' ) && ( *(end-3) == 'o' ) && ( *(end-2) == '.' ) && ( *(end-1) == 'g' ) && ( *end == 'z' ))
159 if (( *(end-1) == '.' ) && ( *end == 'o' ))
163 int lm = xstrlen ( mod );
166 + if (( mod [lm-5] == '.' ) && ( mod [lm-4] == 'o' ) && ( mod [lm-3] == '.' ) && ( mod[lm-2] == 'g' ) && ( mod[lm-1] == 'z' ))
169 if (( mod [lm-2] == '.' ) && ( mod [lm-1] == 'o' ))