setup.ssh: keep the newline when commenting out AcceptEnv
The $ in /(^\s*AcceptEnv.*$)/ matches before the newline, so $1 did not contain it and the following line was appended to the comment - which commented out the Subsystem sftp line on a stock Debian sshd_config. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ while(<IN>) {
|
|||||||
if (/^\s*\#*\s*PermitRootLogin/) {
|
if (/^\s*\#*\s*PermitRootLogin/) {
|
||||||
$out.="PermitRootLogin yes\n" ;
|
$out.="PermitRootLogin yes\n" ;
|
||||||
} elsif (/(^\s*AcceptEnv.*$)/) {
|
} elsif (/(^\s*AcceptEnv.*$)/) {
|
||||||
$out.="#$1";
|
$out.="#$1\n";
|
||||||
} else {
|
} else {
|
||||||
$out.=$_;
|
$out.=$_;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user