diff options
| author | Marc Hoersken <info@marc-hoersken.de> | 2014-12-19 17:17:26 +0100 | 
|---|---|---|
| committer | Marc Hoersken <info@marc-hoersken.de> | 2014-12-19 17:17:26 +0100 | 
| commit | 6a76d3eb531c83b2f2298f7b6869ba4f2ad6f519 (patch) | |
| tree | f92d1040e20e6beb011af5c17259662c46b7cf49 | |
| parent | 3b7bf293851d25604c8edd58b50731d2bdede4a7 (diff) | |
secureserver.pl: update Windows detection and fix path conversion
| -rwxr-xr-x | tests/secureserver.pl | 16 | 
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/secureserver.pl b/tests/secureserver.pl index 62ce0a51f..50369ff21 100755 --- a/tests/secureserver.pl +++ b/tests/secureserver.pl @@ -53,6 +53,7 @@ my $ver_major;  my $ver_minor;  my $fips_support;  my $stunnel_version; +my $tstunnel_windows;  my $socketopt;  my $cmd; @@ -223,6 +224,17 @@ if($stunnel_version < 310) {  }  #*************************************************************************** +# Find out if we are running on Windows using the tstunnel binary +# +if($stunnel =~ /tstunnel(\.exe)?"?$/) { +    $tstunnel_windows = 1; + +    # replace Cygwin and MinGW drives within paths +    $capath =~ s/^(\/cygdrive)?\/(\w)\//$2\:\//; +    $certfile =~ s/^(\/cygdrive)?\/(\w)\//$2\:\//; +} + +#***************************************************************************  # Build command to execute for stunnel 3.X versions  #  if($stunnel_version < 400) { @@ -267,7 +279,7 @@ if($stunnel_version >= 400) {              print STUNCONF "              fips = no";          } -        if($stunnel !~ /tstunnel(\.exe)?"?$/) { +        if(!$tstunnel_windows) {              print STUNCONF "              output = $logfile              pid = $pidfile @@ -311,7 +323,7 @@ chmod(0600, $certfile) if(-f $certfile);  #***************************************************************************  # Run tstunnel on Windows.  # -if($stunnel =~ /tstunnel(\.exe)?"?$/) { +if($tstunnel_windows) {      # Fake pidfile for tstunnel on Windows.      if(open(OUT, ">$pidfile")) {          print OUT $$ . "\n";  | 
