summaryrefslogtreecommitdiff
path: root/tests/sshserver.pl
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-07-26 21:38:26 +0200
committerMarc Hoersken <info@marc-hoersken.de>2020-07-31 18:56:50 +0200
commit3ee7c676ec8ef32e3a9cb4d0fb2929a8335d58db (patch)
tree02e0376df110fa46728dffd7ec01d40a399de94c /tests/sshserver.pl
parent0fc1b8bfdd223aa20c29950442a4ddb575c9ccfe (diff)
downloadcurl-3ee7c676ec8ef32e3a9cb4d0fb2929a8335d58db.tar.gz
tests/sshserver.pl: fix compatibility with OpenSSH for Windows
Follow up to #5721
Diffstat (limited to 'tests/sshserver.pl')
-rw-r--r--tests/sshserver.pl5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/sshserver.pl b/tests/sshserver.pl
index 24c98d630..5cff897a3 100644
--- a/tests/sshserver.pl
+++ b/tests/sshserver.pl
@@ -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 {