]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sshserver.pl: use Perl `chmod`
authorViktor Szakats <commit@vsz.me>
Fri, 28 Mar 2025 14:21:00 +0000 (15:21 +0100)
committerViktor Szakats <commit@vsz.me>
Sat, 29 Mar 2025 11:35:34 +0000 (12:35 +0100)
Instead of relying on the external/shell command. For portability.

Follow-up to 213c5aca7bfc74a6ae02b065c5f38a1e9ff54d62 #3899
Closes #16859

tests/sshserver.pl

index 8576a27dd25e18900bca64a97ce51c447d30bbbd..8763bfd6c1600129721d8633608b7ef81ff8d484 100755 (executable)
@@ -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);