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

« back to all changes in this revision

Viewing changes to debian/patches/bash42-036.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-036
6
 
 
7
 
Bug-Reported-by:        gregrwm <backuppc-users@whitleymott.net>
8
 
Bug-Reference-ID:       <CAD+dB9B4JG+qUwZBQUwiQmVt0j6NDn=DDTxr9R+nkA8DL4KLJA@mail.gmail.com>
9
 
Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2012-05/msg00108.html
10
 
 
11
 
Bug-Description:
12
 
 
13
 
Bash-4.2 produces incorrect word splitting results when expanding
14
 
double-quoted $@ in the same string as and adjacent to other variable
15
 
expansions.  The $@ should be split, the other expansions should not.
16
 
 
17
 
Patch (apply with `patch -p0'):
18
 
 
19
 
Index: b/bash/patchlevel.h
20
 
===================================================================
21
 
--- a/bash/patchlevel.h
22
 
+++ b/bash/patchlevel.h
23
 
@@ -25,6 +25,6 @@
24
 
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
25
 
    looks for to find the patch level (for the sccs version string). */
26
 
 
27
 
-#define PATCHLEVEL 35
28
 
+#define PATCHLEVEL 36
29
 
 
30
 
 #endif /* _PATCHLEVEL_H_ */
31
 
Index: b/bash/subst.c
32
 
===================================================================
33
 
--- a/bash/subst.c
34
 
+++ b/bash/subst.c
35
 
@@ -7922,7 +7922,7 @@
36
 
 
37
 
   /* State flags */
38
 
   int had_quoted_null;
39
 
-  int has_dollar_at;
40
 
+  int has_dollar_at, temp_has_dollar_at;
41
 
   int tflag;
42
 
   int pflags;                  /* flags passed to param_expand */
43
 
 
44
 
@@ -8127,13 +8127,14 @@
45
 
          if (expanded_something)
46
 
            *expanded_something = 1;
47
 
 
48
 
-         has_dollar_at = 0;
49
 
+         temp_has_dollar_at = 0;
50
 
          pflags = (word->flags & W_NOCOMSUB) ? PF_NOCOMSUB : 0;
51
 
          if (word->flags & W_NOSPLIT2)
52
 
            pflags |= PF_NOSPLIT2;
53
 
          tword = param_expand (string, &sindex, quoted, expanded_something,
54
 
-                              &has_dollar_at, &quoted_dollar_at,
55
 
+                              &temp_has_dollar_at, &quoted_dollar_at,
56
 
                               &had_quoted_null, pflags);
57
 
+         has_dollar_at += temp_has_dollar_at;
58
 
 
59
 
          if (tword == &expand_wdesc_error || tword == &expand_wdesc_fatal)
60
 
            {
61
 
@@ -8274,9 +8275,10 @@
62
 
 
63
 
              temp = (char *)NULL;
64
 
 
65
 
-             has_dollar_at = 0;
66
 
+             temp_has_dollar_at = 0;   /* XXX */
67
 
              /* Need to get W_HASQUOTEDNULL flag through this function. */
68
 
-             list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &has_dollar_at, (int *)NULL);
69
 
+             list = expand_word_internal (tword, Q_DOUBLE_QUOTES, 0, &temp_has_dollar_at, (int *)NULL);
70
 
+             has_dollar_at += temp_has_dollar_at;
71
 
 
72
 
              if (list == &expand_word_error || list == &expand_word_fatal)
73
 
                {