diff options
Diffstat (limited to 'package/busybox/patches')
19 files changed, 119 insertions, 131 deletions
diff --git a/package/busybox/patches/001-init_avoid_loop_opening_tty.patch b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch index 11815574bb..25f690ab58 100644 --- a/package/busybox/patches/001-init_avoid_loop_opening_tty.patch +++ b/package/busybox/patches/001-init_avoid_loop_opening_tty.patch @@ -1,6 +1,6 @@ --- a/init/init.c +++ b/init/init.c -@@ -505,12 +505,11 @@ static void run_actions(int action_type) +@@ -498,12 +498,11 @@ static void run_actions(int action_type) for (a = init_action_list; a; a = tmp) { tmp = a->next; if (a->action_type & action_type) { diff --git a/package/busybox/patches/003-brctl_show_fix.patch b/package/busybox/patches/003-brctl_show_fix.patch new file mode 100644 index 0000000000..51b0cf709d --- /dev/null +++ b/package/busybox/patches/003-brctl_show_fix.patch @@ -0,0 +1,37 @@ +--- a/networking/brctl.c ++++ b/networking/brctl.c +@@ -90,7 +90,7 @@ int brctl_main(int argc UNUSED_PARAM, ch + "setageing\0" "setfd\0" "sethello\0" "setmaxage\0" + "setpathcost\0" "setportprio\0" "setbridgeprio\0" + ) +- USE_FEATURE_BRCTL_SHOW("showmacs\0" "show\0"); ++ USE_FEATURE_BRCTL_SHOW("show\0"); + + enum { ARG_addbr = 0, ARG_delbr, ARG_addif, ARG_delif + USE_FEATURE_BRCTL_FANCY(, +@@ -98,7 +98,7 @@ int brctl_main(int argc UNUSED_PARAM, ch + ARG_setageing, ARG_setfd, ARG_sethello, ARG_setmaxage, + ARG_setpathcost, ARG_setportprio, ARG_setbridgeprio + ) +- USE_FEATURE_BRCTL_SHOW(, ARG_showmacs, ARG_show) ++ USE_FEATURE_BRCTL_SHOW(, ARG_show) + }; + + int fd; +--- a/networking/Config.in ++++ b/networking/Config.in +@@ -66,12 +66,12 @@ config FEATURE_BRCTL_FANCY + This adds about 600 bytes. + + config FEATURE_BRCTL_SHOW +- bool "Support show, showmac and showstp" ++ bool "Support show" + default n + depends on BRCTL && FEATURE_BRCTL_FANCY + help + Add support for option which prints the current config: +- showmacs, showstp, show ++ show + + config DNSD + bool "dnsd" diff --git a/package/busybox/patches/110-wget_getopt_fix.patch b/package/busybox/patches/110-wget_getopt_fix.patch index 9b59c61e66..8837769345 100644 --- a/package/busybox/patches/110-wget_getopt_fix.patch +++ b/package/busybox/patches/110-wget_getopt_fix.patch @@ -1,6 +1,6 @@ --- a/networking/wget.c +++ b/networking/wget.c -@@ -437,7 +437,7 @@ int wget_main(int argc ATTRIBUTE_UNUSED, +@@ -437,7 +437,7 @@ int wget_main(int argc UNUSED_PARAM, cha "directory-prefix\0" Required_argument "P" "proxy\0" Required_argument "Y" "user-agent\0" Required_argument "U" diff --git a/package/busybox/patches/240-udhcpc_retries.patch b/package/busybox/patches/240-udhcpc_retries.patch index 30f64e16a7..f45fc6eebd 100644 --- a/package/busybox/patches/240-udhcpc_retries.patch +++ b/package/busybox/patches/240-udhcpc_retries.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -352,7 +352,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSE +@@ -353,7 +353,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c switch (state) { case INIT_SELECTING: @@ -9,7 +9,7 @@ if (packet_num == 0) xid = random_xid(); -@@ -382,7 +382,7 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSE +@@ -383,7 +383,7 @@ int udhcpc_main(int argc UNUSED_PARAM, c continue; case RENEW_REQUESTED: case REQUESTING: diff --git a/package/busybox/patches/243-udhcpc_changed_ifindex.patch b/package/busybox/patches/243-udhcpc_changed_ifindex.patch index 50987665e6..96936e4e3d 100644 --- a/package/busybox/patches/243-udhcpc_changed_ifindex.patch +++ b/package/busybox/patches/243-udhcpc_changed_ifindex.patch @@ -1,6 +1,6 @@ --- a/networking/udhcp/dhcpc.c +++ b/networking/udhcp/dhcpc.c -@@ -319,6 +319,12 @@ int udhcpc_main(int argc ATTRIBUTE_UNUSE +@@ -320,6 +320,12 @@ int udhcpc_main(int argc UNUSED_PARAM, c for (;;) { unsigned timestamp_before_wait; diff --git a/package/busybox/patches/250-ash_export-n.patch b/package/busybox/patches/250-ash_export-n.patch index 0662ba38af..50eaa62d0b 100644 --- a/package/busybox/patches/250-ash_export-n.patch +++ b/package/busybox/patches/250-ash_export-n.patch @@ -1,9 +1,9 @@ --- a/shell/ash.c +++ b/shell/ash.c -@@ -11909,8 +11909,17 @@ exportcmd(int argc ATTRIBUTE_UNUSED, cha +@@ -12018,8 +12018,17 @@ exportcmd(int argc UNUSED_PARAM, char ** const char *p; char **aptr; - int flag = argv[0][0] == 'r'? VREADONLY : VEXPORT; + int flag = argv[0][0] == 'r' ? VREADONLY : VEXPORT; + int mask = ~0; + int nopt; + while ((nopt = nextopt("np"))) { @@ -19,7 +19,7 @@ aptr = argptr; name = *aptr; if (name) { -@@ -11922,10 +11931,12 @@ exportcmd(int argc ATTRIBUTE_UNUSED, cha +@@ -12031,10 +12040,12 @@ exportcmd(int argc UNUSED_PARAM, char ** vp = *findvar(hashvar(name), name); if (vp) { vp->flags |= flag; diff --git a/package/busybox/patches/300-netmsg.patch b/package/busybox/patches/300-netmsg.patch index 01c290f598..ae5be7eead 100644 --- a/package/busybox/patches/300-netmsg.patch +++ b/package/busybox/patches/300-netmsg.patch @@ -1,6 +1,6 @@ --- a/include/applets.h +++ b/include/applets.h -@@ -257,6 +257,7 @@ USE_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_ +@@ -261,6 +261,7 @@ USE_MT(APPLET(mt, _BB_DIR_BIN, _BB_SUID_ USE_MV(APPLET(mv, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_NAMEIF(APPLET(nameif, _BB_DIR_SBIN, _BB_SUID_NEVER)) USE_NC(APPLET(nc, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) @@ -10,7 +10,7 @@ USE_NMETER(APPLET(nmeter, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) --- a/include/usage.h +++ b/include/usage.h -@@ -2815,6 +2815,9 @@ +@@ -2816,6 +2816,9 @@ #endif @@ -18,11 +18,11 @@ +#define netmsg_full_usage "" + #define netstat_trivial_usage \ - "[-laentuwxr"USE_FEATURE_NETSTAT_WIDE("W")"]" + "[-laentuwxr"USE_FEATURE_NETSTAT_WIDE("W")USE_FEATURE_NETSTAT_PRG("p")"]" #define netstat_full_usage "\n\n" \ --- a/networking/Config.in +++ b/networking/Config.in -@@ -602,6 +602,12 @@ config NC +@@ -603,6 +603,12 @@ config NC A simple Unix utility which reads and writes data across network connections. diff --git a/package/busybox/patches/310-passwd_access.patch b/package/busybox/patches/310-passwd_access.patch index 9a1cc95bb3..1c246fcf23 100644 --- a/package/busybox/patches/310-passwd_access.patch +++ b/package/busybox/patches/310-passwd_access.patch @@ -3,7 +3,7 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1697,21 +1697,32 @@ static int check_user_passwd(const char +@@ -1705,21 +1705,32 @@ static int check_user_passwd(const char if (ENABLE_FEATURE_HTTPD_AUTH_MD5) { char *md5_passwd; diff --git a/package/busybox/patches/340-lock_util.patch b/package/busybox/patches/340-lock_util.patch index ed7de41328..6276de9298 100644 --- a/package/busybox/patches/340-lock_util.patch +++ b/package/busybox/patches/340-lock_util.patch @@ -1,8 +1,8 @@ --- a/include/applets.h +++ b/include/applets.h -@@ -220,6 +220,7 @@ USE_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN +@@ -222,6 +222,7 @@ USE_LN(APPLET_NOEXEC(ln, ln, _BB_DIR_BIN USE_LOAD_POLICY(APPLET(load_policy, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) - USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) + USE_LOADFONT(APPLET(loadfont, _BB_DIR_USR_SBIN, _BB_SUID_NEVER)) USE_LOADKMAP(APPLET(loadkmap, _BB_DIR_SBIN, _BB_SUID_NEVER)) +USE_LOCK(APPLET(lock, _BB_DIR_BIN, _BB_SUID_NEVER)) USE_LOGGER(APPLET(logger, _BB_DIR_USR_BIN, _BB_SUID_NEVER)) @@ -10,7 +10,7 @@ USE_LOGNAME(APPLET_NOFORK(logname, logname, _BB_DIR_USR_BIN, _BB_SUID_NEVER, logname)) --- a/include/usage.h +++ b/include/usage.h -@@ -2138,6 +2138,9 @@ +@@ -2132,6 +2132,9 @@ #define loadkmap_example_usage \ "$ loadkmap < /etc/i18n/lang-keymap\n" @@ -22,7 +22,7 @@ #define logger_full_usage "\n\n" \ --- a/miscutils/Config.in +++ b/miscutils/Config.in -@@ -364,6 +364,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA +@@ -366,6 +366,12 @@ config FEATURE_HDPARM_HDIO_GETSET_DMA Enables the 'hdparm -d' option to get/set using_dma flag. This is dangerous stuff, so you should probably say N. diff --git a/package/busybox/patches/350-httpd_redir.patch b/package/busybox/patches/350-httpd_redir.patch index 5cda8c3306..ab25cd203d 100644 --- a/package/busybox/patches/350-httpd_redir.patch +++ b/package/busybox/patches/350-httpd_redir.patch @@ -1,6 +1,6 @@ --- a/include/usage.h +++ b/include/usage.h -@@ -1558,7 +1558,8 @@ +@@ -1552,7 +1552,8 @@ USE_FEATURE_HTTPD_BASIC_AUTH(" [-r realm]") \ USE_FEATURE_HTTPD_AUTH_MD5(" [-m pass]") \ " [-h home]" \ @@ -10,7 +10,7 @@ #define httpd_full_usage "\n\n" \ "Listen for incoming HTTP requests\n" \ "\nOptions:" \ -@@ -1576,6 +1577,8 @@ +@@ -1570,6 +1571,8 @@ "\n -h HOME Home directory (default .)" \ "\n -e STRING HTML encode STRING" \ "\n -d STRING URL decode STRING" \ @@ -21,7 +21,7 @@ USE_GETOPT_LONG( \ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -247,6 +247,8 @@ struct globals { +@@ -248,6 +248,8 @@ struct globals { const char *found_mime_type; const char *found_moved_temporarily; @@ -30,7 +30,7 @@ Htaccess_IP *ip_a_d; /* config allow/deny lines */ USE_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;) -@@ -292,6 +294,8 @@ struct globals { +@@ -293,6 +295,8 @@ struct globals { #define index_page (G.index_page ) #define found_mime_type (G.found_mime_type ) #define found_moved_temporarily (G.found_moved_temporarily) @@ -39,7 +39,7 @@ #define last_mod (G.last_mod ) #define ip_a_d (G.ip_a_d ) #define g_realm (G.g_realm ) -@@ -991,8 +995,11 @@ static void send_headers(int responseNum +@@ -999,8 +1003,11 @@ static void send_headers(int responseNum } #endif if (responseNum == HTTP_MOVED_TEMPORARILY) { @@ -52,7 +52,7 @@ (g_query ? "?" : ""), (g_query ? g_query : "")); } -@@ -1923,8 +1930,12 @@ static void handle_incoming_and_exit(con +@@ -1931,8 +1938,12 @@ static void handle_incoming_and_exit(con } while (*++tptr); *++urlp = '\0'; /* terminate after last character */ @@ -66,7 +66,7 @@ if (is_directory(urlcopy + 1, 1, &sb)) { found_moved_temporarily = urlcopy; } -@@ -2274,7 +2285,9 @@ static void sighup_handler(int sig) +@@ -2281,7 +2292,9 @@ static void sighup_handler(int sig) #endif enum { @@ -77,7 +77,7 @@ d_opt_decode_url, h_opt_home_httpd, USE_FEATURE_HTTPD_ENCODE_URL_STR(e_opt_encode_url,) -@@ -2323,12 +2336,13 @@ int httpd_main(int argc ATTRIBUTE_UNUSED +@@ -2330,12 +2343,13 @@ int httpd_main(int argc UNUSED_PARAM, ch /* We do not "absolutize" path given by -h (home) opt. * If user gives relative path in -h, * $SCRIPT_FILENAME will not be set. */ diff --git a/package/busybox/patches/410-httpd_cgi_headers.patch b/package/busybox/patches/410-httpd_cgi_headers.patch index 3abbdb43b6..b47751a809 100644 --- a/package/busybox/patches/410-httpd_cgi_headers.patch +++ b/package/busybox/patches/410-httpd_cgi_headers.patch @@ -1,6 +1,6 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1247,10 +1247,10 @@ static NOINLINE void cgi_io_loop_and_exi +@@ -1255,10 +1255,10 @@ static NOINLINE void cgi_io_loop_and_exi if (full_write(STDOUT_FILENO, HTTP_200, sizeof(HTTP_200)-1) != sizeof(HTTP_200)-1) break; } diff --git a/package/busybox/patches/430-uniq_memleak.patch b/package/busybox/patches/430-uniq_memleak.patch index 51965b583c..48127a57ce 100644 --- a/package/busybox/patches/430-uniq_memleak.patch +++ b/package/busybox/patches/430-uniq_memleak.patch @@ -1,6 +1,6 @@ --- a/coreutils/uniq.c +++ b/coreutils/uniq.c -@@ -82,6 +82,8 @@ int uniq_main(int argc ATTRIBUTE_UNUSED, +@@ -82,6 +82,8 @@ int uniq_main(int argc UNUSED_PARAM, cha if (!s0 || strncmp(e0, e1, max_chars)) { break; diff --git a/package/busybox/patches/440-httpd_chdir.patch b/package/busybox/patches/440-httpd_chdir.patch index f70b00c6f4..744e962d9e 100644 --- a/package/busybox/patches/440-httpd_chdir.patch +++ b/package/busybox/patches/440-httpd_chdir.patch @@ -1,6 +1,6 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -1808,6 +1808,7 @@ static void handle_incoming_and_exit(con +@@ -1816,6 +1816,7 @@ static void handle_incoming_and_exit(con char *header_ptr = header_ptr; Htaccess_Proxy *proxy_entry; #endif diff --git a/package/busybox/patches/450-httpd_accept_header.patch b/package/busybox/patches/450-httpd_accept_header.patch index e3948cf942..88dfcfbb06 100644 --- a/package/busybox/patches/450-httpd_accept_header.patch +++ b/package/busybox/patches/450-httpd_accept_header.patch @@ -1,6 +1,6 @@ --- a/networking/httpd.c +++ b/networking/httpd.c -@@ -255,6 +255,8 @@ struct globals { +@@ -256,6 +256,8 @@ struct globals { USE_FEATURE_HTTPD_BASIC_AUTH(char *remoteuser;) USE_FEATURE_HTTPD_CGI(char *referer;) USE_FEATURE_HTTPD_CGI(char *user_agent;) @@ -9,7 +9,7 @@ off_t file_size; /* -1 - unknown */ #if ENABLE_FEATURE_HTTPD_RANGES -@@ -302,6 +304,8 @@ struct globals { +@@ -303,6 +305,8 @@ struct globals { #define remoteuser (G.remoteuser ) #define referer (G.referer ) #define user_agent (G.user_agent ) @@ -18,7 +18,7 @@ #define file_size (G.file_size ) #if ENABLE_FEATURE_HTTPD_RANGES #define range_start (G.range_start ) -@@ -1383,6 +1387,10 @@ static void send_cgi_and_exit( +@@ -1391,6 +1395,10 @@ static void send_cgi_and_exit( } } setenv1("HTTP_USER_AGENT", user_agent); @@ -29,7 +29,7 @@ if (post_len) putenv(xasprintf("CONTENT_LENGTH=%d", post_len)); if (cookie) -@@ -2020,6 +2028,10 @@ static void handle_incoming_and_exit(con +@@ -2028,6 +2036,10 @@ static void handle_incoming_and_exit(con referer = xstrdup(skip_whitespace(iobuf + sizeof("Referer:")-1)); } else if (STRNCASECMP(iobuf, "User-Agent:") == 0) { user_agent = xstrdup(skip_whitespace(iobuf + sizeof("User-Agent:")-1)); diff --git a/package/busybox/patches/470-insmod_search.patch b/package/busybox/patches/470-insmod_search.patch index 5853502a82..62619c2213 100644 --- a/package/busybox/patches/470-insmod_search.patch +++ b/package/busybox/patches/470-insmod_search.patch @@ -27,11 +27,11 @@ +int insmod_main_26(int argc, char **argv); #endif +int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; - ++ +static char *g_filename = NULL; +#define _PATH_MODULES "/lib/modules" + -+static int check_module_name_match(const char *filename, struct stat *statbuf, ++static int FAST_FUNC check_module_name_match(const char *filename, struct stat *statbuf, + void *userdata, int depth) +{ + char *fullname = (char *) userdata; @@ -112,7 +112,7 @@ + +done: + free(filename); -+ + + return ret; +} + @@ -164,9 +164,9 @@ -/*======================================================================*/ - - --static int check_module_name_match(const char *filename, -- struct stat *statbuf ATTRIBUTE_UNUSED, -- void *userdata, int depth ATTRIBUTE_UNUSED) +-static int FAST_FUNC check_module_name_match(const char *filename, +- struct stat *statbuf UNUSED_PARAM, +- void *userdata, int depth UNUSED_PARAM) -{ - char *fullname = (char *) userdata; - char *tmp; @@ -238,7 +238,7 @@ break; #elif defined(__microblaze__) -@@ -1759,7 +1823,7 @@ static int arch_list_add(ElfW(RelM) *rel +@@ -1764,7 +1828,7 @@ static int arch_list_add(ElfW(RelM) *rel #if defined(USE_SINGLE) @@ -247,7 +247,7 @@ int offset, int size) { if (single->allocated == 0) { -@@ -1907,7 +1971,7 @@ static void arch_create_got(struct obj_f +@@ -1912,7 +1976,7 @@ static void arch_create_got(struct obj_f #if defined(USE_GOT_ENTRIES) if (got_allocate) { got_offset += arch_single_init( @@ -256,7 +256,7 @@ got_offset, GOT_ENTRY_SIZE); got_needed = 1; -@@ -1921,7 +1985,7 @@ static void arch_create_got(struct obj_f +@@ -1926,7 +1990,7 @@ static void arch_create_got(struct obj_f plt_offset, PLT_ENTRY_SIZE); #else plt_offset += arch_single_init( @@ -265,7 +265,7 @@ plt_offset, PLT_ENTRY_SIZE); #endif plt_needed = 1; -@@ -1959,8 +2023,7 @@ static unsigned long obj_elf_hash_n(cons +@@ -1964,8 +2028,7 @@ static unsigned long obj_elf_hash_n(cons while (n > 0) { ch = *name++; h = (h << 4) + ch; @@ -275,7 +275,7 @@ h ^= g >> 24; h &= ~g; } -@@ -2039,7 +2102,7 @@ obj_add_symbol(struct obj_file *f, const +@@ -2044,7 +2107,7 @@ obj_add_symbol(struct obj_file *f, const int n_type = ELF_ST_TYPE(info); int n_binding = ELF_ST_BIND(info); @@ -284,7 +284,7 @@ if (f->symbol_cmp(sym->name, name) == 0) { int o_secidx = sym->secidx; int o_info = sym->info; -@@ -2098,14 +2161,14 @@ obj_add_symbol(struct obj_file *f, const +@@ -2103,14 +2166,14 @@ obj_add_symbol(struct obj_file *f, const return sym; } } @@ -301,7 +301,7 @@ if (symidx >= f->local_symtab_size) bb_error_msg("local symbol %s with index %ld exceeds local_symtab_size %ld", name, (long) symidx, (long) f->local_symtab_size); -@@ -3228,7 +3291,7 @@ static int obj_relocate(struct obj_file +@@ -3234,7 +3297,7 @@ static int obj_relocate(struct obj_file /* Do it! */ switch (arch_apply_relocation @@ -310,12 +310,12 @@ ) { case obj_reloc_ok: break; -@@ -3307,11 +3370,11 @@ static int obj_create_image(struct obj_f +@@ -3313,11 +3376,11 @@ static int obj_create_image(struct obj_f /*======================================================================*/ --static struct obj_file *obj_load(FILE * fp, int loadprogbits ATTRIBUTE_UNUSED) -+static struct obj_file *obj_load(FILE * fp, int loadprogbits) +-static struct obj_file *obj_load(FILE *fp, int loadprogbits UNUSED_PARAM) ++static struct obj_file *obj_load(FILE *fp, int loadprogbits) { struct obj_file *f; ElfW(Shdr) * section_headers; @@ -324,7 +324,7 @@ char *shstrtab; /* Read the file header. */ -@@ -3583,7 +3646,7 @@ static int obj_gpl_license(struct obj_fi +@@ -3591,7 +3654,7 @@ static int obj_gpl_license(struct obj_fi while (ptr < endptr) { value = strchr(ptr, '='); if (value && strncmp(ptr, "license", value-ptr) == 0) { @@ -333,7 +333,7 @@ if (license) *license = value+1; for (i = 0; i < ARRAY_SIZE(gpl_licenses); ++i) { -@@ -3687,9 +3750,6 @@ static void check_tainted_module(struct +@@ -3695,9 +3758,6 @@ static void check_tainted_module(struct * start of some sections. this info is used by ksymoops to do better * debugging. */ @@ -343,7 +343,7 @@ static int get_module_version(struct obj_file *f, char str[STRVERSIONLEN]) { -@@ -3722,8 +3782,7 @@ add_ksymoops_symbols(struct obj_file *f, +@@ -3730,8 +3790,7 @@ add_ksymoops_symbols(struct obj_file *f, struct obj_symbol *sym; char *name, *absolute_filename; char str[STRVERSIONLEN]; @@ -353,7 +353,7 @@ struct stat statbuf; /* WARNING: was using realpath, but replaced by readlink to stop using -@@ -3910,145 +3969,57 @@ static void print_load_map(struct obj_fi +@@ -3922,145 +3981,57 @@ static void print_load_map(struct obj_fi void print_load_map(struct obj_file *f); #endif @@ -408,7 +408,7 @@ + if (arg1 == NULL) bb_show_usage(); - } - +- - /* Grab the module name */ - tmp1 = xstrdup(arg1); - tmp = basename(tmp1); @@ -419,7 +419,7 @@ - k_version = myuname.release[2] - '0'; - } - } -- + -#if ENABLE_FEATURE_2_6_MODULES - if (k_version > 4 && len > 3 && tmp[len - 3] == '.' - && tmp[len - 2] == 'k' && tmp[len - 1] == 'o' @@ -453,7 +453,7 @@ - - /* Get a filedesc for the module. Check that we have a complete path */ - if (stat(arg1, &st) < 0 || !S_ISREG(st.st_mode) -- || (fp = fopen(arg1, "r")) == NULL +- || (fp = fopen_for_read(arg1)) == NULL - ) { - /* Hmm. Could not open it. First search under /lib/modules/`uname -r`, - * but do not error out yet if we fail to find it... */ @@ -477,7 +477,7 @@ - } - - /* Check if we have found anything yet */ -- if (!m_filename || ((fp = fopen(m_filename, "r")) == NULL)) { +- if (!m_filename || ((fp = fopen_for_read(m_filename)) == NULL)) { - int r; - char *module_dir; - @@ -494,7 +494,7 @@ - bb_error_msg_and_die("%s: module not found", m_fullName); - free(module_dir); - if (m_filename == NULL -- || ((fp = fopen(m_filename, "r")) == NULL) +- || ((fp = fopen_for_read(m_filename)) == NULL) - ) { - bb_error_msg_and_die("%s: module not found", m_fullName); - } @@ -503,16 +503,16 @@ } - } else - m_filename = xstrdup(arg1); - +- - if (flag_verbose) - printf("Using %s\n", m_filename); -- + -#if ENABLE_FEATURE_2_6_MODULES - if (k_version > 4) { - argv[optind] = m_filename; - optind--; - return insmod_ng_main(argc - optind, argv + optind); -+ fp = fopen(g_filename, "r"); ++ fp = fopen_for_read(g_filename); + if (!fp) { + ret = errno; + goto out; @@ -521,7 +521,7 @@ f = obj_load(fp, LOADBITS); -@@ -4075,7 +4046,7 @@ int insmod_main(int argc, char **argv) +@@ -4087,7 +4058,7 @@ int insmod_main(int argc, char **argv) "\t%s was compiled for kernel version %s\n" "\twhile this kernel is version %s", flag_force_load ? "warning: " : "", @@ -530,7 +530,7 @@ if (!flag_force_load) goto out; } -@@ -4117,7 +4088,7 @@ int insmod_main(int argc, char **argv) +@@ -4129,7 +4100,7 @@ int insmod_main(int argc, char **argv) hide_special_symbols(f); #if ENABLE_FEATURE_INSMOD_KSYMOOPS_SYMBOLS @@ -539,7 +539,7 @@ #endif /* FEATURE_INSMOD_KSYMOOPS_SYMBOLS */ new_create_module_ksymtab(f); -@@ -4126,7 +4097,7 @@ int insmod_main(int argc, char **argv) +@@ -4138,7 +4109,7 @@ int insmod_main(int argc, char **argv) m_size = obj_load_size(f); m_addr = create_module(m_name, m_size); @@ -548,7 +548,7 @@ case EEXIST: bb_error_msg_and_die("a module named %s already exists", m_name); case ENOMEM: -@@ -4142,36 +4113,37 @@ int insmod_main(int argc, char **argv) +@@ -4154,36 +4125,37 @@ int insmod_main(int argc, char **argv) * now we can load them directly into the kernel memory */ if (!obj_load_progbits(fp, f, (char*)m_addr)) { @@ -594,7 +594,7 @@ } #endif /* ENABLE_FEATURE_2_4_MODULES */ -@@ -4183,15 +4155,8 @@ int insmod_main(int argc, char **argv) +@@ -4195,15 +4167,8 @@ int insmod_main(int argc, char **argv) #if ENABLE_FEATURE_2_6_MODULES #include <sys/mman.h> @@ -610,15 +610,15 @@ /* We use error numbers in a loose translation... */ static const char *moderror(int err) -@@ -4210,22 +4175,32 @@ static const char *moderror(int err) +@@ -4222,22 +4187,32 @@ static const char *moderror(int err) } } -#if !ENABLE_FEATURE_2_4_MODULES -int insmod_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; --int insmod_main(int argc ATTRIBUTE_UNUSED, char **argv) +-int insmod_main(int argc UNUSED_PARAM, char **argv) -#else --static int insmod_ng_main(int argc ATTRIBUTE_UNUSED, char **argv) +-static int insmod_ng_main(int argc UNUSED_PARAM, char **argv) -#endif +int insmod_main_26(int argc, char **argv) { @@ -651,7 +651,7 @@ /* Rest is options */ options = xzalloc(1); optlen = 0; -@@ -4235,41 +4210,47 @@ static int insmod_ng_main(int argc ATTRI +@@ -4247,41 +4222,47 @@ static int insmod_ng_main(int argc UNUSE optlen += sprintf(options + optlen, (strchr(*argv,' ') ? "\"%s\" " : "%s "), *argv); } @@ -683,7 +683,7 @@ - } -#else len = MAXINT(ssize_t); -- map = xmalloc_open_read_close(filename, &len); +- map = xmalloc_xopen_read_close(filename, &len); -#endif + map = xmalloc_open_read_close(g_filename, &len); + ret = syscall(__NR_init_module, map, len, options); diff --git a/package/busybox/patches/480-vi_search.patch b/package/busybox/patches/480-vi_search.patch index 6162600575..1281135d2b 100644 --- a/package/busybox/patches/480-vi_search.patch +++ b/package/busybox/patches/480-vi_search.patch @@ -1,15 +1,15 @@ --- a/editors/vi.c +++ b/editors/vi.c -@@ -3313,7 +3313,7 @@ static void do_cmd(char c) +@@ -3317,7 +3317,7 @@ static void do_cmd(char c) buf[1] = '\0'; q = get_input_line(buf); // get input line- use "status line" if (q[0] && !q[1]) { - if (last_search_pattern[0]) + if (last_search_pattern) - last_search_pattern[0] = c; + last_search_pattern[0] = c; goto dc3; // if no pat re-use old pat } -@@ -3329,6 +3329,10 @@ static void do_cmd(char c) +@@ -3333,6 +3333,10 @@ static void do_cmd(char c) if (cmdcnt-- > 1) { do_cmd(c); } // repeat cnt @@ -20,16 +20,3 @@ dir = BACK; // assume BACKWARD search p = dot - 1; if (last_search_pattern[0] == '?') { -@@ -3348,10 +3352,8 @@ static void do_cmd(char c) - msg = "No previous regular expression"; - goto dc2; - } -- if (last_search_pattern[0] == '/') { -- dir = FORWARD; // assume FORWARD search -- p = dot + 1; -- } -+ dir = FORWARD; // assume FORWARD search -+ p = dot + 1; - if (last_search_pattern[0] == '?') { - dir = BACK; - p = dot - 1; diff --git a/package/busybox/patches/510-awk_include.patch b/package/busybox/patches/510-awk_include.patch index c2d3040fc1..b185408a99 100644 --- a/package/busybox/patches/510-awk_include.patch +++ b/package/busybox/patches/510-awk_include.patch @@ -15,7 +15,7 @@ } func; /* I/O stream */ -@@ -1395,7 +1400,8 @@ static void parse_program(char *p) +@@ -1400,7 +1405,8 @@ static void parse_program(char *p) next_token(TC_FUNCTION); g_pos++; f = newfunc(t_string); @@ -25,7 +25,7 @@ f->nargs = 0; while (next_token(TC_VARIABLE | TC_SEQTERM) & TC_VARIABLE) { v = findvar(ahash, t_string); -@@ -1404,7 +1410,7 @@ static void parse_program(char *p) +@@ -1409,7 +1415,7 @@ static void parse_program(char *p) if (next_token(TC_COMMA | TC_SEQTERM) & TC_SEQTERM) break; } @@ -34,7 +34,7 @@ chain_group(); clear_array(ahash); -@@ -2367,7 +2373,8 @@ static var *evaluate(node *op, var *res) +@@ -2374,7 +2380,8 @@ static var *evaluate(node *op, var *res) break; case XC( OC_FUNC ): @@ -44,7 +44,7 @@ syntax_error(EMSG_UNDEF_FUNC); X.v = R.v = nvalloc(op->r.f->nargs+1); -@@ -2384,7 +2391,10 @@ static var *evaluate(node *op, var *res) +@@ -2391,7 +2398,10 @@ static var *evaluate(node *op, var *res) fnargs = X.v; L.s = g_progname; @@ -56,7 +56,7 @@ g_progname = L.s; nvfree(fnargs); -@@ -2747,6 +2757,143 @@ static rstream *next_input_file(void) +@@ -2754,6 +2764,143 @@ static rstream *next_input_file(void) #undef files_happen } @@ -200,7 +200,7 @@ int awk_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int awk_main(int argc, char **argv) { -@@ -2812,6 +2959,9 @@ int awk_main(int argc, char **argv) +@@ -2819,6 +2966,9 @@ int awk_main(int argc, char **argv) *s1 = '='; } } diff --git a/package/busybox/patches/530-unsigned_bitwise_ops.patch b/package/busybox/patches/530-unsigned_bitwise_ops.patch index 66ec5749a8..e69de29bb2 100644 --- a/package/busybox/patches/530-unsigned_bitwise_ops.patch +++ b/package/busybox/patches/530-unsigned_bitwise_ops.patch @@ -1,36 +0,0 @@ ---- a/editors/awk.c -+++ b/editors/awk.c -@@ -2041,27 +2041,27 @@ static var *exec_builtin(node *op, var * - break; - - case B_an: -- setvar_i(res, (long)getvar_i(av[0]) & (long)getvar_i(av[1])); -+ setvar_i(res, (unsigned long)getvar_i(av[0]) & (unsigned long)getvar_i(av[1])); - break; - - case B_co: -- setvar_i(res, ~(long)getvar_i(av[0])); -+ setvar_i(res, ~(unsigned long)getvar_i(av[0])); - break; - - case B_ls: -- setvar_i(res, (long)getvar_i(av[0]) << (long)getvar_i(av[1])); -+ setvar_i(res, (unsigned long)getvar_i(av[0]) << (unsigned long)getvar_i(av[1])); - break; - - case B_or: -- setvar_i(res, (long)getvar_i(av[0]) | (long)getvar_i(av[1])); -+ setvar_i(res, (unsigned long)getvar_i(av[0]) | (unsigned long)getvar_i(av[1])); - break; - - case B_rs: -- setvar_i(res, (long)((unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1]))); -+ setvar_i(res, (unsigned long)getvar_i(av[0]) >> (unsigned long)getvar_i(av[1])); - break; - - case B_xo: -- setvar_i(res, (long)getvar_i(av[0]) ^ (long)getvar_i(av[1])); -+ setvar_i(res, (unsigned long)getvar_i(av[0]) ^ (unsigned long)getvar_i(av[1])); - break; - - case B_lo: diff --git a/package/busybox/patches/802-brctl_linux24.patch b/package/busybox/patches/802-brctl_linux24.patch index 6d6dbc702b..84321e0c72 100644 --- a/package/busybox/patches/802-brctl_linux24.patch +++ b/package/busybox/patches/802-brctl_linux24.patch @@ -9,7 +9,7 @@ #endif /* Use internal number parsing and not the "exact" conversion. */ -@@ -155,6 +155,7 @@ int brctl_main(int argc ATTRIBUTE_UNUSED +@@ -155,6 +155,7 @@ int brctl_main(int argc UNUSED_PARAM, ch printf(bi.stp_enabled ? "\tyes" : "\tno"); /* print interface list */ @@ -17,7 +17,7 @@ arm_ioctl(args, BRCTL_GET_PORT_LIST, (unsigned long) ifidx, MAX_PORTS); xioctl(fd, SIOCDEVPRIVATE, &ifr); -@@ -183,9 +184,19 @@ int brctl_main(int argc ATTRIBUTE_UNUSED +@@ -183,9 +184,19 @@ int brctl_main(int argc UNUSED_PARAM, ch br = *argv++; if (key == ARG_addbr || key == ARG_delbr) { /* addbr or delbr */ @@ -40,7 +40,7 @@ goto done; } -@@ -194,14 +205,27 @@ int brctl_main(int argc ATTRIBUTE_UNUSED +@@ -194,14 +205,27 @@ int brctl_main(int argc UNUSED_PARAM, ch strncpy(ifr.ifr_name, br, IFNAMSIZ); if (key == ARG_addif || key == ARG_delif) { /* addif or delif */ |