[-]
[+]
|
Changed |
busybox.spec
|
|
[-]
[+]
|
Added |
busybox-1.17.2-compat.patch
^
|
@@ -0,0 +1,15 @@
+diff -urpN busybox-1.17.2/networking/libiproute/iplink.c busybox-1.17.2-compat/networking/libiproute/iplink.c
+--- busybox-1.17.2/networking/libiproute/iplink.c 2010-08-23 02:44:35.000000000 +0200
++++ busybox-1.17.2-compat/networking/libiproute/iplink.c 2010-09-02 12:24:53.580708990 +0200
+@@ -15,6 +15,11 @@
+ #include "rt_names.h"
+ #include "utils.h"
+
++#ifndef IFLA_LINKINFO
++# define IFLA_LINKINFO 18
++# define IFLA_INFO_KIND 1
++#endif
++
+ /* taken from linux/sockios.h */
+ #define SIOCSIFNAME 0x8923 /* set interface name */
+
|
[-]
[+]
|
Added |
busybox-1.17.2-hush.patch
^
|
@@ -0,0 +1,122 @@
+diff -urpN busybox-1.17.2/shell/hush.c busybox-1.17.2-hush/shell/hush.c
+--- busybox-1.17.2/shell/hush.c 2010-08-23 02:45:15.000000000 +0200
++++ busybox-1.17.2-hush/shell/hush.c 2010-09-04 19:44:57.381391123 +0200
+@@ -1853,7 +1853,7 @@ static void o_addblock_duplicate_backsla
+ while (len) {
+ o_addchr(o, *str);
+ if (*str++ == '\\'
+- && (*str != '*' && *str != '?' && *str != '[')
++// && (*str != '*' && *str != '?' && *str != '[')
+ ) {
+ o_addchr(o, '\\');
+ }
+@@ -2834,18 +2834,22 @@ static NOINLINE int expand_vars_to_list(
+ return n;
+ }
+
+-static char **expand_variables(char **argv, int or_mask)
++enum {
++ EXPVAR_FLAG_GLOB = 0x200,
++ EXPVAR_FLAG_ESCAPE_VARS = 0x100,
++ EXPVAR_FLAG_SINGLEWORD = 0x80, /* must be 0x80 */
++};
++static char **expand_variables(char **argv, unsigned or_mask)
+ {
+ int n;
+ char **list;
+ char **v;
+ o_string output = NULL_O_STRING;
+
+- if (or_mask & 0x100) {
+- output.o_escape = 1; /* protect against globbing for "$var" */
+- /* (unquoted $var will temporarily switch it off) */
+- output.o_glob = 1;
+- }
++ /* protect against globbing for "$var"? */
++ /* (unquoted $var will temporarily switch it off) */
++ output.o_escape = 1 & (or_mask / EXPVAR_FLAG_ESCAPE_VARS);
++ output.o_glob = 1 & (or_mask / EXPVAR_FLAG_GLOB);
+
+ n = 0;
+ v = argv;
+@@ -2863,13 +2867,13 @@ static char **expand_variables(char **ar
+
+ static char **expand_strvec_to_strvec(char **argv)
+ {
+- return expand_variables(argv, 0x100);
++ return expand_variables(argv, EXPVAR_FLAG_GLOB | EXPVAR_FLAG_ESCAPE_VARS);
+ }
+
+ #if ENABLE_HUSH_BASH_COMPAT
+ static char **expand_strvec_to_strvec_singleword_noglob(char **argv)
+ {
+- return expand_variables(argv, 0x80);
++ return expand_variables(argv, EXPVAR_FLAG_SINGLEWORD);
+ }
+ #endif
+
+@@ -2909,15 +2913,15 @@ static char **expand_strvec_to_strvec_si
+ #endif
+
+ /* Used for expansion of right hand of assignments */
+-/* NB: should NOT do globbing! "export v=/bin/c*; env | grep ^v=" outputs
+- * "v=/bin/c*" */
++/* NB: should NOT do globbing!
++ * "export v=/bin/c*; env | grep ^v=" outputs "v=/bin/c*" */
+ static char *expand_string_to_string(const char *str)
+ {
+ char *argv[2], **list;
+
+ argv[0] = (char*)str;
+ argv[1] = NULL;
+- list = expand_variables(argv, 0x80); /* 0x80: singleword expansion */
++ list = expand_variables(argv, EXPVAR_FLAG_ESCAPE_VARS | EXPVAR_FLAG_SINGLEWORD);
+ if (HUSH_DEBUG)
+ if (!list[0] || list[1])
+ bb_error_msg_and_die("BUG in varexp2");
+@@ -2933,7 +2937,7 @@ static char* expand_strvec_to_string(cha
+ {
+ char **list;
+
+- list = expand_variables(argv, 0x80);
++ list = expand_variables(argv, EXPVAR_FLAG_SINGLEWORD);
+ /* Convert all NULs to spaces */
+ if (list[0]) {
+ int n = 1;
+diff -urpN busybox-1.17.2/shell/hush_test/hush-vars/var_unbackslash.right busybox-1.17.2-hush/shell/hush_test/hush-vars/var_unbackslash.right
+--- busybox-1.17.2/shell/hush_test/hush-vars/var_unbackslash.right 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.17.2-hush/shell/hush_test/hush-vars/var_unbackslash.right 2010-09-04 19:44:57.382391186 +0200
+@@ -0,0 +1,9 @@
++b1=-qwerty-t-\-"---z-*-?-
++b1=-qwerty-t-\-"---z-*-?-
++b2=-$a-\t-\\-\"-\--\z-\*-\?-
++b2=-$a-\t-\\-\"-\--\z-\*-\?-
++c=-$a-\t-\\-\"-\--\z-\*-\?-
++c=-$a-\t-\\-\"-\--\z-\*-\?-
++c=-$a-\t-\\-\"-\--\z-\*-\?-
++c=-$a-\t-\\-\"-\--\z-\*-\?-
++Done: 0
+diff -urpN busybox-1.17.2/shell/hush_test/hush-vars/var_unbackslash.tests busybox-1.17.2-hush/shell/hush_test/hush-vars/var_unbackslash.tests
+--- busybox-1.17.2/shell/hush_test/hush-vars/var_unbackslash.tests 1970-01-01 01:00:00.000000000 +0100
++++ busybox-1.17.2-hush/shell/hush_test/hush-vars/var_unbackslash.tests 2010-09-04 19:44:57.382391186 +0200
+@@ -0,0 +1,20 @@
++# Test for correct handling of backslashes
++a=qwerty
++
++b=-$a-\t-\\-\"-\--\z-\*-\?-
++echo b1=$b
++echo "b1=$b"
++b='-$a-\t-\\-\"-\--\z-\*-\?-'
++echo b2=$b
++echo "b2=$b"
++
++c=$b
++echo "c=$c"
++c=${b}
++echo "c=$c"
++c="$b"
++echo "c=$c"
++c="${b}"
++echo "c=$c"
++
++echo "Done: $?"
|
[-]
[+]
|
Added |
busybox-1.17.2-lineedit.patch
^
|
@@ -0,0 +1,504 @@
+diff -urpN busybox-1.17.2/libbb/lineedit.c busybox-1.17.2-lineedit/libbb/lineedit.c
+--- busybox-1.17.2/libbb/lineedit.c 2010-08-23 02:44:35.000000000 +0200
++++ busybox-1.17.2-lineedit/libbb/lineedit.c 2010-09-07 18:33:16.337067116 +0200
+@@ -156,7 +156,6 @@ struct lineedit_statics {
+
+ /* Formerly these were big buffers on stack: */
+ #if ENABLE_FEATURE_TAB_COMPLETION
+- char exe_n_cwd_tab_completion__dirbuf[MAX_LINELEN];
+ char input_tab__matchBuf[MAX_LINELEN];
+ int16_t find_match__int_buf[MAX_LINELEN + 1]; /* need to have 9 bits at least */
+ int16_t find_match__pos_buf[MAX_LINELEN + 1];
+@@ -235,6 +234,8 @@ static unsigned save_string(char *dst, u
+ while (dstpos < maxsize) {
+ wchar_t wc;
+ int n = srcpos;
++
++ /* Convert up to 1st invalid byte (or up to end) */
+ while ((wc = command_ps[srcpos]) != 0
+ && !unicode_is_raw_byte(wc)
+ ) {
+@@ -247,6 +248,7 @@ static unsigned save_string(char *dst, u
+ dstpos += n;
+ if (wc == 0) /* usually is */
+ break;
++
+ /* We do have invalid byte here! */
+ command_ps[srcpos] = wc; /* restore it */
+ srcpos++;
+@@ -608,53 +610,56 @@ static void add_match(char *matched)
+ }
+
+ #if ENABLE_FEATURE_USERNAME_COMPLETION
+-static void username_tab_completion(char *ud, char *with_shash_flg)
++/* Replace "~user/..." with "/homedir/...".
++ * The parameter is malloced, free it or return it
++ * unchanged if no user is matched.
++ */
++static char *username_path_completion(char *ud)
+ {
+ struct passwd *entry;
++ char *tilde_name = ud;
++ char *home = NULL;
++
++ ud++; /* skip ~ */
++ if (*ud == '/') { /* "~/..." */
++ home = home_pwd_buf;
++ } else {
++ /* "~user/..." */
++ ud = strchr(ud, '/');
++ *ud = '\0'; /* "~user" */
++ entry = getpwnam(tilde_name + 1);
++ *ud = '/'; /* restore "~user/..." */
++ if (entry)
++ home = entry->pw_dir;
++ }
++ if (home) {
++ ud = concat_path_file(home, ud);
++ free(tilde_name);
++ tilde_name = ud;
++ }
++ return tilde_name;
++}
++
++/* ~use<tab> - find all users with this prefix */
++static NOINLINE void username_completion(const char *ud)
++{
++ /* Using _r function to avoid pulling in static buffers */
++ char line_buff[256];
++ struct passwd pwd;
++ struct passwd *result;
+ int userlen;
+
+- ud++; /* ~user/... to user/... */
++ ud++; /* skip ~ */
+ userlen = strlen(ud);
+
+- if (with_shash_flg) { /* "~/..." or "~user/..." */
+- char *sav_ud = ud - 1;
+- char *home = NULL;
+-
+- if (*ud == '/') { /* "~/..." */
+- home = home_pwd_buf;
+- } else {
+- /* "~user/..." */
+- char *temp;
+- temp = strchr(ud, '/');
+- *temp = '\0'; /* ~user\0 */
+- entry = getpwnam(ud);
+- *temp = '/'; /* restore ~user/... */
+- ud = temp;
+- if (entry)
+- home = entry->pw_dir;
+- }
+- if (home) {
+- if ((userlen + strlen(home) + 1) < MAX_LINELEN) {
+- /* /home/user/... */
+- sprintf(sav_ud, "%s%s", home, ud);
+- }
+- }
+- } else {
+- /* "~[^/]*" */
+- /* Using _r function to avoid pulling in static buffers */
+- char line_buff[256];
+- struct passwd pwd;
+- struct passwd *result;
+-
+- setpwent();
+- while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) {
+- /* Null usernames should result in all users as possible completions. */
+- if (/*!userlen || */ strncmp(ud, pwd.pw_name, userlen) == 0) {
+- add_match(xasprintf("~%s/", pwd.pw_name));
+- }
++ setpwent();
++ while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) {
++ /* Null usernames should result in all users as possible completions. */
++ if (/*!userlen || */ strncmp(ud, pwd.pw_name, userlen) == 0) {
++ add_match(xasprintf("~%s/", pwd.pw_name));
+ }
+- endpwent();
+ }
++ endpwent();
+ }
+ #endif /* FEATURE_COMMAND_USERNAME_COMPLETION */
+
+@@ -664,22 +669,19 @@ enum {
+ FIND_FILE_ONLY = 2,
+ };
+
+-static int path_parse(char ***p, int flags)
++static int path_parse(char ***p)
+ {
+ int npth;
+ const char *pth;
+ char *tmp;
+ char **res;
+
+- /* if not setenv PATH variable, to search cur dir "." */
+- if (flags != FIND_EXE_ONLY)
+- return 1;
+-
+ if (state->flags & WITH_PATH_LOOKUP)
+ pth = state->path_lookup;
+ else
+ pth = getenv("PATH");
+- /* PATH=<empty> or PATH=:<empty> */
++
++ /* PATH="" or PATH=":"? */
+ if (!pth || !pth[0] || LONE_CHAR(pth, ':'))
+ return 1;
+
+@@ -689,12 +691,13 @@ static int path_parse(char ***p, int fla
+ tmp = strchr(tmp, ':');
+ if (!tmp)
+ break;
+- if (*++tmp == '\0')
++ tmp++;
++ if (*tmp == '\0')
+ break; /* :<empty> */
+ npth++;
+ }
+
+- res = xmalloc(npth * sizeof(char*));
++ *p = res = xmalloc(npth * sizeof(res[0]));
+ res[0] = tmp = xstrdup(pth);
+ npth = 1;
+ while (1) {
+@@ -706,100 +709,96 @@ static int path_parse(char ***p, int fla
+ break; /* :<empty> */
+ res[npth++] = tmp;
+ }
+- *p = res;
+ return npth;
+ }
+
+ static void exe_n_cwd_tab_completion(char *command, int type)
+ {
+- DIR *dir;
+- struct dirent *next;
+- struct stat st;
+ char *path1[1];
+ char **paths = path1;
+ int npaths;
+ int i;
+- char *found;
+- char *pfind = strrchr(command, '/');
+-/* char dirbuf[MAX_LINELEN]; */
+-#define dirbuf (S.exe_n_cwd_tab_completion__dirbuf)
++ char *pfind;
++ char *dirbuf = NULL;
+
+ npaths = 1;
+ path1[0] = (char*)".";
+
+- if (pfind == NULL) {
+- /* no dir, if flags==EXE_ONLY - get paths, else "." */
+- npaths = path_parse(&paths, type);
++ pfind = strrchr(command, '/');
++ if (!pfind) {
++ if (type == FIND_EXE_ONLY)
|
[-]
[+]
|
Added |
busybox-1.17.2-udhcp-services.patch
^
|
@@ -0,0 +1,24 @@
+--- networking/udhcp/common.c.orig 2010-08-23 02:44:35.000000000 +0200
++++ networking/udhcp/common.c 2010-09-29 12:15:08.514367497 +0200
+@@ -49,6 +49,10 @@
+ { OPTION_STRING , 0x43 }, /* DHCP_BOOT_FILE */
+ //TODO: not a string, but a set of LASCII strings:
+ // { OPTION_STRING , 0x4D }, /* DHCP_USER_CLASS */
++ { OPTION_IP | OPTION_LIST , 0x45 }, /* DHCP_SMTP_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x46 }, /* DHCP_POP3_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x4a }, /* DHCP_IRC_SERVER */
++ { OPTION_IP | OPTION_LIST , 0x48 }, /* DHCP_WWW_SERVER */
+ #if ENABLE_FEATURE_UDHCP_RFC3397
+ { OPTION_DNS_STRING | OPTION_LIST , 0x77 }, /* DHCP_DOMAIN_SEARCH */
+ { OPTION_SIP_SERVERS , 0x78 }, /* DHCP_SIP_SERVERS */
+@@ -105,6 +109,10 @@
+ "tftp" "\0" /* DHCP_TFTP_SERVER_NAME */
+ "bootfile" "\0" /* DHCP_BOOT_FILE */
+ // "userclass" "\0" /* DHCP_USER_CLASS */
++ "smtpsrv" "\0" /* DHCP_SMTP_SERVER */
++ "pop3srv" "\0" /* DHCP_POP3_SERVER */
++ "ircsrv" "\0" /* DHCP_IRC_SERVER */
++ "wwwsrv" "\0" /* DHCP_WWW_SERVER */
+ #if ENABLE_FEATURE_UDHCP_RFC3397
+ "search" "\0" /* DHCP_DOMAIN_SEARCH */
+ // doesn't work in udhcpd.conf since OPTION_SIP_SERVERS
|
|
Added |
busybox-1.17.2.tar.bz2
^
|