diff options
author | Chet Ramey <chet.ramey@case.edu> | 2019-11-25 00:43:03 +0100 |
---|---|---|
committer | Vasyl Gello <vasek.gello@gmail.com> | 2019-11-25 22:14:59 +0000 |
commit | 40d8fd992c7db0c4522511d86e0b219afbecf91a (patch) | |
tree | 0a3c405e335cf076f456bd094328ef03f3028c9f | |
parent | 79866173d71235ed776d76d6953868bf5bd4482b (diff) | |
download | android_external_bash-40d8fd992c7db0c4522511d86e0b219afbecf91a.tar.gz android_external_bash-40d8fd992c7db0c4522511d86e0b219afbecf91a.tar.bz2 android_external_bash-40d8fd992c7db0c4522511d86e0b219afbecf91a.zip |
Bash-4.3 patch 48
If a malicious user can inject a value of $SHELLOPTS containing `xtrace'
and a value for $PS4 that includes a command substitution into a shell
running as root, bash will expand the command substitution as part of
expanding $PS4 when it executes a traced command.
Change-Id: I89582f14a979f733b3504cc456ce671621825680
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | variables.c | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/patchlevel.h b/patchlevel.h index d243f2d..a5241c6 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 47 +#define PATCHLEVEL 48 #endif /* _PATCHLEVEL_H_ */ diff --git a/variables.c b/variables.c index f39eb64..f816ffe 100644 --- a/variables.c +++ b/variables.c @@ -495,7 +495,11 @@ initialize_shell_variables (env, privmode) #endif set_if_not ("PS2", secondary_prompt); } - set_if_not ("PS4", "+ "); + + if (current_user.euid == 0) + bind_variable ("PS4", "+ ", 0); + else + set_if_not ("PS4", "+ "); /* Don't allow IFS to be imported from the environment. */ temp_var = bind_variable ("IFS", " \t\n", 0); |