aboutsummaryrefslogtreecommitdiffstats
path: root/main/bash/CVE-2016-7543.patch
blob: 2ce0f6f3637ce8ed582958934c474a4c47b8a7ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From f43310742819253bfa6add2dce406701bb8cc2bb Mon Sep 17 00:00:00 2001
From: Siteshwar Vashisht <svashisht@redhat.com>
Date: Wed, 28 Sep 2016 18:33:55 +0530
Subject: [PATCH] CVE-2016-7543: Patch imported from bash-4.4

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

diff --git a/variables.c b/variables.c
index ac587f3..ffd39e8 100644
--- variables.c
+++ variables.c
@@ -496,7 +496,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);
-- 
2.5.5