1 BASH PATCH REPORT |
|
2 ================= |
|
3 |
|
4 Bash-Release: 4.2 |
|
5 Patch-ID: bash42-005 |
|
6 |
|
7 Bug-Reported-by: Dennis Williamson <[email protected]> |
|
8 Bug-Reference-ID: <[email protected]> |
|
9 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00147.html |
|
10 |
|
11 Bug-Description: |
|
12 |
|
13 Systems that use tzset() to set the local timezone require the TZ variable |
|
14 to be in the environment. Bash must make sure the environment has been |
|
15 modified with any updated value for TZ before calling tzset(). This |
|
16 affects prompt string expansions and the `%T' printf conversion specification |
|
17 on systems that do not allow bash to supply a replacement for getenv(3). |
|
18 |
|
19 Patch (apply with `patch -p0'): |
|
20 |
|
21 *** ../bash-4.2-patched/variables.h 2010-12-02 20:22:01.000000000 -0500 |
|
22 --- variables.h 2011-02-19 19:57:12.000000000 -0500 |
|
23 *************** |
|
24 *** 314,317 **** |
|
25 --- 314,318 ---- |
|
26 extern void sort_variables __P((SHELL_VAR **)); |
|
27 |
|
28 + extern int chkexport __P((char *)); |
|
29 extern void maybe_make_export_env __P((void)); |
|
30 extern void update_export_env_inplace __P((char *, int, char *)); |
|
31 *** ../bash-4.2-patched/variables.c 2011-01-24 20:07:48.000000000 -0500 |
|
32 --- variables.c 2011-02-19 20:04:50.000000000 -0500 |
|
33 *************** |
|
34 *** 3654,3657 **** |
|
35 --- 3654,3673 ---- |
|
36 } |
|
37 |
|
38 + int |
|
39 + chkexport (name) |
|
40 + char *name; |
|
41 + { |
|
42 + SHELL_VAR *v; |
|
43 + |
|
44 + v = find_variable (name); |
|
45 + if (exported_p (v)) |
|
46 + { |
|
47 + array_needs_making = 1; |
|
48 + maybe_make_export_env (); |
|
49 + return 1; |
|
50 + } |
|
51 + return 0; |
|
52 + } |
|
53 + |
|
54 void |
|
55 maybe_make_export_env () |
|
56 *************** |
|
57 *** 4215,4219 **** |
|
58 { "TEXTDOMAINDIR", sv_locale }, |
|
59 |
|
60 ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE) |
|
61 { "TZ", sv_tz }, |
|
62 #endif |
|
63 --- 4231,4235 ---- |
|
64 { "TEXTDOMAINDIR", sv_locale }, |
|
65 |
|
66 ! #if defined (HAVE_TZSET) |
|
67 { "TZ", sv_tz }, |
|
68 #endif |
|
69 *************** |
|
70 *** 4559,4568 **** |
|
71 #endif /* HISTORY */ |
|
72 |
|
73 ! #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE) |
|
74 void |
|
75 sv_tz (name) |
|
76 char *name; |
|
77 { |
|
78 ! tzset (); |
|
79 } |
|
80 #endif |
|
81 --- 4575,4585 ---- |
|
82 #endif /* HISTORY */ |
|
83 |
|
84 ! #if defined (HAVE_TZSET) |
|
85 void |
|
86 sv_tz (name) |
|
87 char *name; |
|
88 { |
|
89 ! if (chkexport (name)) |
|
90 ! tzset (); |
|
91 } |
|
92 #endif |
|
93 *** ../bash-4.2-patched/parse.y 2011-01-02 15:48:11.000000000 -0500 |
|
94 --- parse.y 2011-02-19 20:05:00.000000000 -0500 |
|
95 *************** |
|
96 *** 5136,5139 **** |
|
97 --- 5136,5142 ---- |
|
98 /* Make the current time/date into a string. */ |
|
99 (void) time (&the_time); |
|
100 + #if defined (HAVE_TZSET) |
|
101 + sv_tz ("TZ"); /* XXX -- just make sure */ |
|
102 + #endif |
|
103 tm = localtime (&the_time); |
|
104 |
|
105 *** ../bash-4.2-patched/builtins/printf.def 2010-11-23 10:02:55.000000000 -0500 |
|
106 --- builtins/printf.def 2011-02-19 20:05:04.000000000 -0500 |
|
107 *************** |
|
108 *** 466,469 **** |
|
109 --- 466,472 ---- |
|
110 else |
|
111 secs = arg; |
|
112 + #if defined (HAVE_TZSET) |
|
113 + sv_tz ("TZ"); /* XXX -- just make sure */ |
|
114 + #endif |
|
115 tm = localtime (&secs); |
|
116 n = strftime (timebuf, sizeof (timebuf), timefmt, tm); |
|
117 *** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010 |
|
118 --- patchlevel.h Thu Feb 24 21:41:34 2011 |
|
119 *************** |
|
120 *** 26,30 **** |
|
121 looks for to find the patch level (for the sccs version string). */ |
|
122 |
|
123 ! #define PATCHLEVEL 4 |
|
124 |
|
125 #endif /* _PATCHLEVEL_H_ */ |
|
126 --- 26,30 ---- |
|
127 looks for to find the patch level (for the sccs version string). */ |
|
128 |
|
129 ! #define PATCHLEVEL 5 |
|
130 |
|
131 #endif /* _PATCHLEVEL_H_ */ |
|