sshserver.pl: use Perl chmod

Instead of relying on the external/shell command. For portability.

Follow-up to 213c5aca7bfc74a6ae02b065c5f38a1e9ff54d62 #3899
Closes #16859
This commit is contained in:
Viktor Szakats 2025-03-28 15:21:00 +01:00
parent 7be2c421bf
commit 25eb2dbfbf
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -436,8 +436,8 @@ if((! -e pp($hstprvkeyf)) || (! -s pp($hstprvkeyf)) ||
}
display_file_top(pp($cliprvkeyf));
# Make sure that permissions are restricted so openssh doesn't complain
system "chmod 600 " . pp($hstprvkeyf);
system "chmod 600 " . pp($cliprvkeyf);
chmod 0600, pp($hstprvkeyf);
chmod 0600, pp($cliprvkeyf);
if(($^O eq 'cygwin' || $^O eq 'msys') && -e "/bin/setfacl") {
# https://cygwin.com/cygwin-ug-net/setfacl.html
system "/bin/setfacl --remove-all " . pp($hstprvkeyf);