|
Roman Rakus |
779eed |
BASH PATCH REPORT
|
|
Roman Rakus |
779eed |
=================
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Bash-Release: 4.0
|
|
Roman Rakus |
779eed |
Patch-ID: bash40-029
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Bug-Reported-by: Christian Krause <chkr@plauener.de>
|
|
Roman Rakus |
779eed |
Bug-Reference-ID: Thu, 25 Jun 2009 21:47:59 +0200
|
|
Roman Rakus |
779eed |
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2009-06/msg00078.html
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Bug-Description:
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Previous versions of bash accepted strings in the initial environment
|
|
Roman Rakus |
779eed |
that were not valid shell variable assignments, usually because the
|
|
Roman Rakus |
779eed |
names were invalid, but still created shell variables from them and
|
|
Roman Rakus |
779eed |
passed them to child processes in the environment.
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Bash-4.0 ignores those names and does not pass them to child processes.
|
|
Roman Rakus |
779eed |
Some users and automated processes depend on invalid variables being
|
|
Roman Rakus |
779eed |
ignored and passed to child processes.
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
This patch makes bash continue to ignore the invalid names, but pass
|
|
Roman Rakus |
779eed |
them to child processes in the export environment.
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
Patch:
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
*** ../bash-4.0-patched/variables.c 2009-01-04 14:32:46.000000000 -0500
|
|
Roman Rakus |
779eed |
--- variables.c 2009-06-29 09:17:20.000000000 -0400
|
|
Roman Rakus |
779eed |
***************
|
|
Roman Rakus |
779eed |
*** 253,256 ****
|
|
Roman Rakus |
779eed |
--- 255,259 ----
|
|
Roman Rakus |
779eed |
static int visible_var __P((SHELL_VAR *));
|
|
Roman Rakus |
779eed |
static int visible_and_exported __P((SHELL_VAR *));
|
|
Roman Rakus |
779eed |
+ static int export_environment_candidate __P((SHELL_VAR *));
|
|
Roman Rakus |
779eed |
static int local_and_exported __P((SHELL_VAR *));
|
|
Roman Rakus |
779eed |
static int variable_in_context __P((SHELL_VAR *));
|
|
Roman Rakus |
779eed |
***************
|
|
Roman Rakus |
779eed |
*** 376,383 ****
|
|
Roman Rakus |
779eed |
# endif
|
|
Roman Rakus |
779eed |
#endif
|
|
Roman Rakus |
779eed |
else if (legal_identifier (name))
|
|
Roman Rakus |
779eed |
{
|
|
Roman Rakus |
779eed |
temp_var = bind_variable (name, string, 0);
|
|
Roman Rakus |
779eed |
! VSETATTR (temp_var, (att_exported | att_imported));
|
|
Roman Rakus |
779eed |
array_needs_making = 1;
|
|
Roman Rakus |
779eed |
}
|
|
Roman Rakus |
779eed |
--- 379,393 ----
|
|
Roman Rakus |
779eed |
# endif
|
|
Roman Rakus |
779eed |
#endif
|
|
Roman Rakus |
779eed |
+ #if 0
|
|
Roman Rakus |
779eed |
else if (legal_identifier (name))
|
|
Roman Rakus |
779eed |
+ #else
|
|
Roman Rakus |
779eed |
+ else
|
|
Roman Rakus |
779eed |
+ #endif
|
|
Roman Rakus |
779eed |
{
|
|
Roman Rakus |
779eed |
temp_var = bind_variable (name, string, 0);
|
|
Roman Rakus |
779eed |
! if (legal_identifier (name))
|
|
Roman Rakus |
779eed |
! VSETATTR (temp_var, (att_exported | att_imported));
|
|
Roman Rakus |
779eed |
! else
|
|
Roman Rakus |
779eed |
! VSETATTR (temp_var, (att_exported | att_imported | att_invisible));
|
|
Roman Rakus |
779eed |
array_needs_making = 1;
|
|
Roman Rakus |
779eed |
}
|
|
Roman Rakus |
779eed |
***************
|
|
Roman Rakus |
779eed |
*** 3083,3086 ****
|
|
Roman Rakus |
779eed |
--- 3098,3111 ----
|
|
Roman Rakus |
779eed |
}
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
+ /* Candidate variables for the export environment are either valid variables
|
|
Roman Rakus |
779eed |
+ with the export attribute or invalid variables inherited from the initial
|
|
Roman Rakus |
779eed |
+ environment and simply passed through. */
|
|
Roman Rakus |
779eed |
+ static int
|
|
Roman Rakus |
779eed |
+ export_environment_candidate (var)
|
|
Roman Rakus |
779eed |
+ SHELL_VAR *var;
|
|
Roman Rakus |
779eed |
+ {
|
|
Roman Rakus |
779eed |
+ return (exported_p (var) && (invisible_p (var) == 0 || imported_p (var)));
|
|
Roman Rakus |
779eed |
+ }
|
|
Roman Rakus |
779eed |
+
|
|
Roman Rakus |
779eed |
/* Return non-zero if VAR is a local variable in the current context and
|
|
Roman Rakus |
779eed |
is exported. */
|
|
Roman Rakus |
779eed |
***************
|
|
Roman Rakus |
779eed |
*** 3439,3443 ****
|
|
Roman Rakus |
779eed |
--- 3464,3472 ----
|
|
Roman Rakus |
779eed |
SHELL_VAR **vars;
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
+ #if 0
|
|
Roman Rakus |
779eed |
vars = map_over (visible_and_exported, vcxt);
|
|
Roman Rakus |
779eed |
+ #else
|
|
Roman Rakus |
779eed |
+ vars = map_over (export_environment_candidate, vcxt);
|
|
Roman Rakus |
779eed |
+ #endif
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
if (vars == 0)
|
|
Roman Rakus |
779eed |
*** ../bash-4.0/patchlevel.h 2009-01-04 14:32:40.000000000 -0500
|
|
Roman Rakus |
779eed |
--- patchlevel.h 2009-02-22 16:11:31.000000000 -0500
|
|
Roman Rakus |
779eed |
***************
|
|
Roman Rakus |
779eed |
*** 26,30 ****
|
|
Roman Rakus |
779eed |
looks for to find the patch level (for the sccs version string). */
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
! #define PATCHLEVEL 28
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
#endif /* _PATCHLEVEL_H_ */
|
|
Roman Rakus |
779eed |
--- 26,30 ----
|
|
Roman Rakus |
779eed |
looks for to find the patch level (for the sccs version string). */
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
! #define PATCHLEVEL 29
|
|
Roman Rakus |
779eed |
|
|
Roman Rakus |
779eed |
#endif /* _PATCHLEVEL_H_ */
|