]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
remote.cgi: Use new system methods
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 17 May 2021 21:02:53 +0000 (23:02 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 13:30:55 +0000 (14:30 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/remote.cgi

index c76f5129ea862454eeaf41547600475487cdbe2d..576e7628d98105a9df16a501b75d58316d59945f 100644 (file)
@@ -254,7 +254,10 @@ sub viewkey
 
   if ( -e $key )
   {
-    my @temp = split(/ /,`/usr/bin/ssh-keygen -l -f $key`);
+    # Use safe system_output function to call ssh-keygen and get the output from the tool.
+    my @ssh_keygen = &General::system_output("/usr/bin/ssh-keygen", "-l", -"-f", "$key");
+
+    my @temp = split(/ /, @ssh_keygen);
     my $keysize = &Header::cleanhtml($temp[0],"y");
     my $fingerprint = &Header::cleanhtml($temp[1],"y");
     print "<tr><td><code>$key</code></td><td align='center'>$name</td><td><code>$fingerprint</code></td><td align='center'>$keysize</td></tr>\n";
@@ -264,8 +267,7 @@ sub viewkey
 sub printactivelogins()
 {
        # print active SSH logins (grep outpout of "who -s")
-       my $command = "who -s";
-       my @output = `$command`;
+       my @output = &General::system_output("who", "-s");
        chomp(@output);
 
        my $id = 0;