upgrade busybox to v1.11.1 and add current upstream fixes
[openwrt-10.03/.git] / package / busybox / patches / 520-ipkg_secure.patch
1 --- a/archival/libipkg/ipkg_conf.c
2 +++ b/archival/libipkg/ipkg_conf.c
3 @@ -66,6 +66,8 @@
4           { "offline_root_pre_script_cmd", IPKG_OPT_TYPE_STRING, &conf->offline_root_pre_script_cmd },
5           { "proxy_passwd", IPKG_OPT_TYPE_STRING, &conf->proxy_passwd },
6           { "proxy_user", IPKG_OPT_TYPE_STRING, &conf->proxy_user },
7 +         { "http_user", IPKG_OPT_TYPE_STRING, &conf->http_user },
8 +         { "http_passwd", IPKG_OPT_TYPE_STRING, &conf->http_passwd },
9           { "query-all", IPKG_OPT_TYPE_BOOL, &conf->query_all },
10           { "verbose-wget", IPKG_OPT_TYPE_BOOL, &conf->verbose_wget },
11           { "verbosity", IPKG_OPT_TYPE_BOOL, &conf->verbosity },
12 @@ -160,6 +162,9 @@
13       conf->proxy_user = NULL;
14       conf->proxy_passwd = NULL;
15  
16 +     conf->http_user = NULL;
17 +     conf->http_passwd = NULL;
18 +
19       pkg_hash_init("pkg-hash", &conf->pkg_hash, IPKG_CONF_DEFAULT_HASH_LEN);
20       hash_table_init("file-hash", &conf->file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
21       hash_table_init("obs-file-hash", &conf->obs_file_hash, IPKG_CONF_DEFAULT_HASH_LEN);
22 --- a/archival/libipkg/ipkg_conf.h
23 +++ b/archival/libipkg/ipkg_conf.h
24 @@ -79,6 +79,10 @@
25       char *proxy_user;
26       char *proxy_passwd;
27  
28 +     /* http user/pass */
29 +     char *http_user;
30 +     char *http_passwd;
31 +
32       hash_table_t pkg_hash;
33       hash_table_t file_hash;
34       hash_table_t obs_file_hash;
35 --- a/archival/libipkg/ipkg_download.c
36 +++ b/archival/libipkg/ipkg_download.c
37 @@ -69,8 +69,12 @@
38      }
39  
40      /* XXX: BUG rewrite to use execvp or else busybox's internal wget -Jamey 7/23/2002 */ 
41 -    sprintf_alloc(&cmd, "wget --passive-ftp %s %s%s %s%s %s -P %s %s",
42 +    sprintf_alloc(&cmd, "wget --passive-ftp %s %s%s %s%s %s%s %s%s %s -P %s %s",
43                   (conf->http_proxy || conf->ftp_proxy) ? "--proxy=on" : "",
44 +          conf->http_user ? "--http-user=" : "",
45 +          conf->http_user ? conf->http_user : "",
46 +          conf->http_passwd ? "--http-password=" : "",
47 +          conf->http_passwd ? conf->http_passwd : "",
48                   conf->proxy_user ? "--proxy-user=" : "",
49                   conf->proxy_user ? conf->proxy_user : "",
50                   conf->proxy_passwd ? "--proxy-passwd=" : "",