1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

tests/sshserver.pl: fix compatibility with OpenSSH for Windows

Follow up to #5721
This commit is contained in:
Marc Hoersken 2020-07-26 21:38:26 +02:00
parent 0fc1b8bfdd
commit 3ee7c676ec
No known key found for this signature in database
GPG Key ID: 61E03CBED7BC859E

View File

@ -522,6 +522,11 @@ push @cfgarr, '#';
# and do not support quotes around values for some unknown reason.
if ($sshdid =~ /OpenSSH-Windows/) {
my $username_lc = lc $username;
if (exists $ENV{USERDOMAIN}) {
my $userdomain_lc = lc $ENV{USERDOMAIN};
$username_lc = "$userdomain_lc\\$username_lc";
}
$username_lc =~ s/ /\?/g; # replace space with ?
push @cfgarr, "DenyUsers !$username_lc";
push @cfgarr, "AllowUsers $username_lc";
} else {