sshserver.pl: harden more `system()` calls
No binary (build failed)
—
(log yok)
| @@ -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)); | |