Page 1 of 1

client-connect unknown error (errno=193)

Posted: Fri Nov 27, 2020 10:57 am
by cacamille3
Hi,

I have some issue using client-connect script.
I just wrote a test script that contains the following code:

Code: Select all

#!/bin/bash
exit 0
My Server configuration contains the following:

Code: Select all

script-security 2
client-connect "C:\\cc_static_ip.sh"
Every time a Client is trying to connect I see the following error:
env_block: add PATH=C:\WINDOWS\System32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
openvpn_execve: CreateProcess C:\cc_static_ip.sh failed: Unknown error (errno=193)
WARNING: Failed running command (--client-connect): external program did not execute -- returned error code -1
What I am doing wrong ???

Re: client-connect unknown error (errno=193)

Posted: Fri Nov 27, 2020 11:44 am
by cacamille3
When I rename the file as *.bat this is then working...
I could run the script file as *.sh without error in a Command Prompt on this computer....

Re: client-connect unknown error (errno=193)

Posted: Fri Nov 27, 2020 4:34 pm
by TinCanTech
Openvpn needs to know what ever the interpreter is you use for bash.

Code: Select all

client-connect "/path/to/sh.exe C:\\cc_static_ip.sh"
Whatever sh.exe is .. ?

Re: client-connect unknown error (errno=193)

Posted: Mon Nov 30, 2020 2:48 pm
by cacamille3
Ok thanks for the info.
I have updated my script to a batch script file that now works under windows.