]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
remote.cgi: Fix splitting output from ssh-keygen.
authorStefan Schantl <stefan.schantl@ipfire.org>
Tue, 15 Jun 2021 17:19:24 +0000 (19:19 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Jun 2021 20:11:37 +0000 (20:11 +0000)
The split function requires an string as input.

Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/remote.cgi

index 9dc6d5aa57db83f9063f05493084037f268d953d..2bb85851d2891883d388facd033a90f41403741d 100644 (file)
@@ -255,9 +255,9 @@ sub viewkey
   if ( -e $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 @ssh_keygen = &General::system_output("/usr/bin/ssh-keygen", "-l", "-f", "$key");
 
-    my @temp = split(/ /, @ssh_keygen);
+    my @temp = split(/ /, $ssh_keygen[0]);
     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";