mirror of
https://github.com/curl/curl.git
synced 2026-08-25 16:43:39 +03:00
sshserver.pl: harden more system() calls
Ref: https://perldoc.perl.org/functions/system Closes #20997
This commit is contained in:
parent
1509b0ce6a
commit
1c7a270e26
1 changed files with 4 additions and 4 deletions
|
|
@ -424,14 +424,14 @@ if((! -e pp($hstprvkeyf)) || (! -s 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);
|
||||
system('/bin/setfacl', ('--remove-all', pp($hstprvkeyf)));
|
||||
}
|
||||
elsif(pathhelp::os_is_win()) {
|
||||
# https://ss64.com/nt/icacls.html
|
||||
$ENV{'MSYS2_ARG_CONV_EXCL'} = '/reset';
|
||||
system "icacls \"" . pathhelp::sys_native_abs_path(pp($hstprvkeyf)) . "\" /reset";
|
||||
system "icacls \"" . pathhelp::sys_native_abs_path(pp($hstprvkeyf)) . "\" /grant:r \"$username:(R)\"";
|
||||
system "icacls \"" . pathhelp::sys_native_abs_path(pp($hstprvkeyf)) . "\" /inheritance:r";
|
||||
system('icacls', (pathhelp::sys_native_abs_path(pp($hstprvkeyf)), '/reset'));
|
||||
system('icacls', (pathhelp::sys_native_abs_path(pp($hstprvkeyf)), '/grant:r', "$username:(R)"));
|
||||
system('icacls', (pathhelp::sys_native_abs_path(pp($hstprvkeyf)), '/inheritance:r'));
|
||||
}
|
||||
# Save md5 and sha256 hashes of public host key
|
||||
open(my $rsakeyfile, "<", pp($hstpubkeyf));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue