Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to load contents of cmd as UTF-8 when up command given an executable #726

Closed
zaygraveyard opened this issue Jun 2, 2022 · 5 comments

Comments

@zaygraveyard
Copy link

Describe the bug
I get a "VPN Configuration Installation Error" when the config contains an up command with an executable instead of a script.

To Reproduce
Steps to reproduce the behavior:

  1. Try to install a config with an up command with an executable, ex. up /bin/sh -c '/usr/sbin/ipconfig set $dev DHCP'
  2. See error
Installation failed:

At line 141 of the OpenVPN configuration file: Unable to load contents of /bin/sh as UTF-8

Expected behavior
It works without errors

Desktop:

  • OS: macOS 12.4
  • Version Tunnelblick 3.8.7a (build 5770)

Additional context
I believe that this should work as it is explicitly mentioned in the reference manual.

--up cmd
Run command cmd after successful TUN/TAP device open (pre --user UID change).cmd consists of a path to script (or executable program), optionally followed by arguments.
Source: https://openvpn.net/community-resources/reference-manual-for-openvpn-2-4/

Without this functionality I'm forced to use an additional script that runs the same command, rendering the config impossible be self contained. Not a major issue but still.

@jkbullard
Copy link
Contributor

Thanks for your report. It is a bug.

As a workaround, I believe you can comment out the "up" (and "down" will have the same problem) to install the configuration, then edit it after it is installed to activate the "up" and "down" options.

@zaygraveyard
Copy link
Author

Thank you for the workaround 😄
FWIW I had to change the up command to up "/bin/sh -c '/usr/sbin/ipconfig set $dev DHCP'" (note the double quotes)

@jkbullard
Copy link
Contributor

Fixed in Tunnelblick 4.0.0beta03.

@alaa-ledger
Copy link

any idea when this will be fixed in the next stable version? :)

@jkbullard
Copy link
Contributor

It probably won't be fixed in Tunnelblick 3. No idea when 4.0.0 will be the stable version, it depends on further testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants