README: add link for automatic readme display
[sudo-osx-update.git] / patches / 0011-Do-not-quote-possible-meta-characters.patch.txt
blobb8fd23f4170fe9a832dbbb91690691a7b820f944
1 Subject: [PATCH] Do not quote possible meta characters in shell mode
3 Starting with sudo 1.7.3, possible meta characters are quoted by
4 preceding with a \ when using shell mode.  Disable this so that
5 the behavior continues to match that of versions 1.7.0-1.7.2*.
7 For example, without this change the command:
9   sudo -s 'echo "${PWD+a  b}"'
11 will produce an error something like:
13   /bin/bash: echo "${PWD+a  b}": command not found
15 whereas when using versions 1.7.0-1.7.2*, it will produce output
16 like so:
18   a  b
20 Prior to version 1.7.0, when using shell mode an error would also
21 be produced because "-c" was not being passed to the shell in that
22 case.
24 OS X expects the 1.7.0-1.7.2* behavior so restore the non-quoting
25 semantics.
26 ---
27  sudo.c | 3 ---
28  1 file changed, 3 deletions(-)
30 diff --git a/sudo.c b/sudo.c
31 index 041b0e75..22c59654 100644
32 --- a/sudo.c
33 +++ b/sudo.c
34 @@ -746,9 +746,6 @@ init_vars(envp)
35             cmnd = dst = emalloc2(cmnd_size, 2);
36             for (av = NewArgv; *av != NULL; av++) {
37                 for (src = *av; *src != '\0'; src++) {
38 -                   /* quote potential meta characters */
39 -                   if (!isalnum((unsigned char)*src) && *src != '_' && *src != '-')
40 -                       *dst++ = '\\';
41                     *dst++ = *src;
42                 }
43                 *dst++ = ' ';
44 -- 
45 1.8.3