summaryrefslogtreecommitdiff
path: root/data/bash/bash32-037
blob: 376bd937cdb4cf7a9b7327c1e8a451dbad52906d (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
			     BASH PATCH REPORT
			     =================

Bash-Release: 3.2
Patch-ID: bash32-037

Bug-Reported-by:	jared r r spiegel <jrrs@iorek.ice-nine.org>
Bug-Reference-ID:	<200801152201.m0FM1lDp021260@iorek.ice-nine.org>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2008-01/msg00049.html

Bug-Description:

Bash inappropriately evaluates command substitutions while expanding
directory names as part of command substitution.

Patch:

*** ../bash-3.2-patched/subst.c	2007-12-13 22:31:21.000000000 -0500
--- subst.c	2008-01-17 22:48:15.000000000 -0500
***************
*** 2815,2821 ****
     to jump_to_top_level here so we don't endlessly loop. */
  WORD_LIST *
! expand_prompt_string (string, quoted)
       char *string;
       int quoted;
  {
    WORD_LIST *value;
--- 2895,2902 ----
     to jump_to_top_level here so we don't endlessly loop. */
  WORD_LIST *
! expand_prompt_string (string, quoted, wflags)
       char *string;
       int quoted;
+      int wflags;
  {
    WORD_LIST *value;
***************
*** 2825,2829 ****
      return ((WORD_LIST *)NULL);
  
!   td.flags = 0;
    td.word = savestring (string);
  
--- 2906,2910 ----
      return ((WORD_LIST *)NULL);
  
!   td.flags = wflags;
    td.word = savestring (string);
  
*** ../bash-3.2-patched/subst.h	2007-03-24 14:51:05.000000000 -0400
--- subst.h	2008-01-17 22:46:08.000000000 -0500
***************
*** 136,140 ****
  
  /* Expand a prompt string. */
! extern WORD_LIST *expand_prompt_string __P((char *, int));
  
  /* Expand STRING just as if you were expanding a word.  This also returns
--- 137,141 ----
  
  /* Expand a prompt string. */
! extern WORD_LIST *expand_prompt_string __P((char *, int, int));
  
  /* Expand STRING just as if you were expanding a word.  This also returns
*** ../bash-3.2-patched/parse.y	2007-08-25 13:47:06.000000000 -0400
--- parse.y	2008-01-17 22:46:30.000000000 -0500
***************
*** 4367,4371 ****
      {
        last_exit_value = last_command_exit_value;
!       list = expand_prompt_string (result, Q_DOUBLE_QUOTES);
        free (result);
        result = string_list (list);
--- 4367,4371 ----
      {
        last_exit_value = last_command_exit_value;
!       list = expand_prompt_string (result, Q_DOUBLE_QUOTES, 0);
        free (result);
        result = string_list (list);
*** ../bash-3.2-patched/bashline.c	2006-07-29 16:39:30.000000000 -0400
--- bashline.c	2008-02-17 12:53:42.000000000 -0500
***************
*** 2358,2362 ****
      {
        new_dirname = savestring (local_dirname);
!       wl = expand_prompt_string (new_dirname, 0);	/* does the right thing */
        if (wl)
  	{
--- 2376,2380 ----
      {
        new_dirname = savestring (local_dirname);
!       wl = expand_prompt_string (new_dirname, 0, W_NOCOMSUB);	/* does the right thing */
        if (wl)
  	{
*** ../bash-3.2/patchlevel.h	Thu Apr 13 08:31:04 2006
--- patchlevel.h	Mon Oct 16 14:22:54 2006
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 36
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 37
  
  #endif /* _PATCHLEVEL_H_ */