mirror of
https://github.com/curl/curl.git
synced 2026-08-05 01:36:17 +03:00
sshserver.pl: tidy up around AllowUsers setup
- drop redundant space-to-`?` replacement.
- add parentheses to silence code checker.
- tidy up comments.
Follow-up to e53523fef0 #14859
Closes #21442
This commit is contained in:
parent
f9d3f00c98
commit
4449110561
1 changed files with 3 additions and 4 deletions
|
|
@ -588,15 +588,14 @@ push @cfgarr, "# $sshdverstr sshd configuration file for curl testing";
|
|||
push @cfgarr, '#';
|
||||
|
||||
# AllowUsers and DenyUsers options should use lowercase on Windows
|
||||
# and do not support quotes around values for some unknown reason.
|
||||
# and do not support quotes around values for an unknown reason.
|
||||
if($sshdid =~ /OpenSSH-Windows/) {
|
||||
my $username_lc = lc $username;
|
||||
push @cfgarr, "AllowUsers " . $username_lc =~ s/ /\?/gr;
|
||||
push @cfgarr, "AllowUsers " . ($username_lc =~ s/ /\?/gr); # replace space with '?'
|
||||
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, "AllowUsers " . $username_lc =~ s/ /\?/gr;
|
||||
push @cfgarr, "AllowUsers " . ($username_lc =~ s/ /\?/gr); # replace space with '?'
|
||||
}
|
||||
} else {
|
||||
push @cfgarr, "AllowUsers $username";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue