xingplus / tunnelblick

Automatically exported from code.google.com/p/tunnelblick
0 stars 0 forks source link

Upgrading bash to 4.2.20 breaks tunnelblick client.up script #203

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
NOTE: We suggest that you post on the Tunnelblick Discussion Group before
submitting an "Issue". (http://groups.google.com/group/tunnelblick-discuss)

What steps will reproduce the problem?
1. Replace /bin/bash with 4.2.20 from MacPorts
2.
3.

What is the expected output?

  working connection setup

What do you see instead?

  client.up script fails at with and EOF looking for a missing "

What version of Tunnelblick are you using? On what version of OS X?

Tunnelblick 3.2.3 (build 2891.2932) Unsigned
OSX 10.7.3

...

2012-02-13 11:06:20 us=951199 
/Applications/Tunnelblick.app/Contents/Resources/client.up.tunnelblick.sh -m -w 
-d -atDASNGWrdasngw tun0 1500 1558 10.3.5.10 10.3.5.9 init
                                        /Applications/Tunnelblick.app/Contents/Resources/client.up.tunnelblick.sh: line 585: unexpected EOF while looking for matching `"'
2012-02-13 11:06:20 us=977933 MANAGEMENT: Client disconnected
2012-02-13 11:06:20 us=978093 WARNING: Failed running command (--up/--down): 
external program exited with error status: 2
2012-02-13 11:06:20 us=978192 Exiting
...

Original issue reported on code.google.com by georg.ni...@gmail.com on 13 Feb 2012 at 4:08

GoogleCodeExporter commented 9 years ago
vi /Applications/Tunnelblick.app/Contents/Resources/client.up.tunnelblick.sh

Somewhere in here is the notation that bash 4.2.20 is throwing a wobbly over.  
my thought is that it's somewhere in the "set -e #" lines.

I am tearing into this script to see where it is failing.

Original comment by fowlso...@gmail.com on 13 Feb 2012 at 6:13

GoogleCodeExporter commented 9 years ago
Tunnelblick 3.2.3, Bash 4.2.0 compiled with gcc 4.7.0, OSX 10.7.3 (Lion)

Changing "Set DNS/WINS" to "Set nameserver (3.1) allowed it to connect. Initial 
setting was "Set nameserver".  All other options were from stock install.

Original comment by mypec...@gmail.com on 14 Apr 2012 at 1:33

GoogleCodeExporter commented 9 years ago
Thanks, mypecan5 -- that's a clue. It must be something specific to the 
standard "up" script.

Using "Set nameserver (3.1)" uses a different script, which apparently works.

(Probably the other settings/scripts would also work -- or at least not have 
this problem of the up-script crashing.)

Original comment by jkbull...@gmail.com on 14 Apr 2012 at 1:38

GoogleCodeExporter commented 9 years ago
Sure, "Set nameserver (3.1)" works. I was just curious why default script did 
not.

So I found that the problem was with the handling of the heredoc pipelines in 
client.up.tunnelblick.sh script. I removed the pipeline business from the 
heredoc and script is working fine under bash 4.x. Here is an example of my 
changes:

Before:

PSID=$( (scutil | grep PrimaryService | sed -e 's/.*PrimaryService : //')<<- EOF
        open
        show State:/Network/Global/IPv4
        quit
EOF )

After:

PSID="$( scutil <<-EOF |
         open
         show State:/Network/Global/IPv4
         quit
EOF
grep PrimaryService | sed -e 's/.*PrimaryService : //'
)"

Attached is modified script. Not sure if I should try (have permissions) to 
upload it to SVN.

Original comment by andrey.r...@gmail.com on 20 Oct 2012 at 3:45

Attachments:

GoogleCodeExporter commented 9 years ago
Andrey - thanks! I will try it out and, if it seems to work OK I'll put it in 
the next beta release.

The change seems simple enough, but I want to check for backward compatibility 
and make sure the other scripts don't need similar changes.

Original comment by jkbull...@gmail.com on 20 Oct 2012 at 4:09

GoogleCodeExporter commented 9 years ago
This has been fixed in Tunnelblick 3.3beta28.

MANY THANKS TO ANDREY FOR FINDING THE PROBLEM AND SOLVING IT!

Original comment by jkbull...@gmail.com on 25 Oct 2012 at 12:51