svashisht / rpms / bash

Forked from rpms/bash 4 years ago
Clone

Blame SOURCES/bash-4.3-cve-2016-7543.patch

ff19ae
diff --git a/variables.c b/variables.c
ff19ae
index b7ebaea..5e2986f 100644
ff19ae
--- a/variables.c
ff19ae
+++ b/variables.c
ff19ae
@@ -467,7 +467,11 @@ initialize_shell_variables (env, privmode)
ff19ae
 #endif
ff19ae
       set_if_not ("PS2", secondary_prompt);
ff19ae
     }
ff19ae
-  set_if_not ("PS4", "+ ");
ff19ae
+
ff19ae
+  if (current_user.euid == 0)
ff19ae
+    bind_variable ("PS4", "+ ", 0);
ff19ae
+  else
ff19ae
+    set_if_not ("PS4", "+ ");
ff19ae
 
ff19ae
   /* Don't allow IFS to be imported from the environment. */
ff19ae
   temp_var = bind_variable ("IFS", " \t\n", 0);
ff19ae
-- 
ff19ae
2.9.3
ff19ae