~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to debian/patches/bash42-023.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
                             BASH PATCH REPORT
2
 
                             =================
3
 
 
4
 
Bash-Release:   4.2
5
 
Patch-ID:       bash42-023
6
 
 
7
 
Bug-Reported-by:        Ewan Mellor <Ewan.Mellor@eu.citrix.com>
8
 
Bug-Reference-ID:       <6005BE083BF501439A84DC3523BAC82DC4B964FD12@LONPMAILBOX01.citrite.net>
9
 
Bug-Reference-URL:      
10
 
 
11
 
Bug-Description:
12
 
 
13
 
Under some circumstances, an exit trap triggered by a bad substitution
14
 
error when errexit is enabled will cause the shell to exit with an
15
 
incorrect exit status (0).
16
 
 
17
 
Index: b/bash/error.c
18
 
===================================================================
19
 
--- a/bash/error.c
20
 
+++ b/bash/error.c
21
 
@@ -200,7 +200,11 @@
22
 
 
23
 
   va_end (args);
24
 
   if (exit_immediately_on_error)
25
 
-    exit_shell (1);
26
 
+    {
27
 
+      if (last_command_exit_value == 0)
28
 
+       last_command_exit_value = 1;
29
 
+      exit_shell (last_command_exit_value);
30
 
+    }
31
 
 }
32
 
 
33
 
 void
34
 
Index: b/bash/patchlevel.h
35
 
===================================================================
36
 
--- a/bash/patchlevel.h
37
 
+++ b/bash/patchlevel.h
38
 
@@ -25,6 +25,6 @@
39
 
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
40
 
    looks for to find the patch level (for the sccs version string). */
41
 
 
42
 
-#define PATCHLEVEL 22
43
 
+#define PATCHLEVEL 23
44
 
 
45
 
 #endif /* _PATCHLEVEL_H_ */
46
 
Index: b/bash/subst.c
47
 
===================================================================
48
 
--- a/bash/subst.c
49
 
+++ b/bash/subst.c
50
 
@@ -7274,6 +7274,7 @@
51
 
     default:
52
 
     case '\0':
53
 
     bad_substitution:
54
 
+      last_command_exit_value = EXECUTION_FAILURE;
55
 
       report_error (_("%s: bad substitution"), string ? string : "??");
56
 
       FREE (value);
57
 
       FREE (temp);