Remove BR2_DEPRECATED
[buildroot-gz.git] / package / bash / 0031-patchlevel-31.patch
blobd285a1f882273b5fee24620a78721ddd648ddeaf
1 From http://ftp.gnu.org/pub/gnu/bash/bash-4.3-patches/bash43-031
3 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
5 BASH PATCH REPORT
6 =================
8 Bash-Release: 4.3
9 Patch-ID: bash43-031
11 Bug-Reported-by: lolilolicon <lolilolicon@gmail.com>
12 Bug-Reference-ID: <CAMtVo_Nz=32Oq=zWTb6=+8gUNXOo2rRvud1W4oPnA-cgVk_ZqQ@mail.gmail.com>
13 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-08/msg00139.html
15 Bug-Description:
17 The new nameref assignment functionality introduced in bash-4.3 did not perform
18 enough validation on the variable value and would create variables with
19 invalid names.
21 Patch (apply with `patch -p0'):
23 *** a/bash-4.3-patched/subst.h 2014-01-11 21:02:27.000000000 -0500
24 --- b/subst.h 2014-09-01 12:16:56.000000000 -0400
25 ***************
26 *** 48,51 ****
27 --- 48,52 ----
28 #define ASS_MKGLOBAL 0x0008 /* force global assignment */
29 #define ASS_NAMEREF 0x0010 /* assigning to nameref variable */
30 + #define ASS_FROMREF 0x0020 /* assigning from value of nameref variable */
32 /* Flags for the string extraction functions. */
33 *** a/bash-4.3-patched/variables.c 2014-05-15 08:26:50.000000000 -0400
34 --- b/variables.c 2014-09-01 14:37:44.000000000 -0400
35 ***************
36 *** 2504,2511 ****
37 int hflags, aflags;
39 ! char *newval;
40 SHELL_VAR *entry;
42 entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
43 /* Follow the nameref chain here if this is the global variables table */
44 if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
45 --- 2566,2590 ----
46 int hflags, aflags;
48 ! char *newname, *newval;
49 SHELL_VAR *entry;
50 + #if defined (ARRAY_VARS)
51 + arrayind_t ind;
52 + char *subp;
53 + int sublen;
54 + #endif
56 + newname = 0;
57 + #if defined (ARRAY_VARS)
58 + if ((aflags & ASS_FROMREF) && (hflags & HASH_NOSRCH) == 0 && valid_array_reference (name))
59 + {
60 + newname = array_variable_name (name, &subp, &sublen);
61 + if (newname == 0)
62 + return (SHELL_VAR *)NULL; /* XXX */
63 + entry = hash_lookup (newname, table);
64 + }
65 + else
66 + #endif
67 entry = (hflags & HASH_NOSRCH) ? (SHELL_VAR *)NULL : hash_lookup (name, table);
69 /* Follow the nameref chain here if this is the global variables table */
70 if (entry && nameref_p (entry) && (invisible_p (entry) == 0) && table == global_variables->table)
71 ***************
72 *** 2538,2541 ****
73 --- 2617,2630 ----
76 + #if defined (ARRAY_VARS)
77 + else if (entry == 0 && newname)
78 + {
79 + entry = make_new_array_variable (newname); /* indexed array by default */
80 + if (entry == 0)
81 + return entry;
82 + ind = array_expand_index (name, subp, sublen);
83 + bind_array_element (entry, ind, value, aflags);
84 + }
85 + #endif
86 else if (entry == 0)
88 ***************
89 *** 2658,2662 ****
90 if (nameref_cell (nv) == 0)
91 return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
92 ! return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags));
94 else
95 --- 2747,2752 ----
96 if (nameref_cell (nv) == 0)
97 return (bind_variable_internal (nv->name, value, nvc->table, 0, flags));
98 ! /* XXX - bug here with ref=array[index] */
99 ! return (bind_variable_internal (nameref_cell (nv), value, nvc->table, 0, flags|ASS_FROMREF));
101 else
102 *** a/bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500
103 --- b/patchlevel.h 2014-03-20 20:01:28.000000000 -0400
104 ***************
105 *** 26,30 ****
106 looks for to find the patch level (for the sccs version string). */
108 ! #define PATCHLEVEL 30
110 #endif /* _PATCHLEVEL_H_ */
111 --- 26,30 ----
112 looks for to find the patch level (for the sccs version string). */
114 ! #define PATCHLEVEL 31
116 #endif /* _PATCHLEVEL_H_ */