File bash-4.3-PS4-fix.patch of Package bash.7219

Based on a0c0a00fc419b7bc08202a79134fcd5bc0427071 Mon Sep 17 00:00:00 2001
From: Chet Ramey <chet.ramey@case.edu>
Date: Thu, 15 Sep 2016 16:59:08 -0400
Subject: [PATCH] Fix for CVE-2016-7543 (Was: Bash-4.4 distribution sources and documentation)

---
 variables.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git variables.c variables.c
index 51aaf9c..be2446e 100644
--- variables.c
+++ 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);
openSUSE Build Service is sponsored by