mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-27 19:23:24 +02:00
remote.cgi: Use new system methods
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
4353c57924
commit
3f5cb3b7cc
@@ -254,7 +254,10 @@ sub viewkey
|
|||||||
|
|
||||||
if ( -e $key )
|
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 $keysize = &Header::cleanhtml($temp[0],"y");
|
||||||
my $fingerprint = &Header::cleanhtml($temp[1],"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";
|
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()
|
sub printactivelogins()
|
||||||
{
|
{
|
||||||
# print active SSH logins (grep outpout of "who -s")
|
# print active SSH logins (grep outpout of "who -s")
|
||||||
my $command = "who -s";
|
my @output = &General::system_output("who", "-s");
|
||||||
my @output = `$command`;
|
|
||||||
chomp(@output);
|
chomp(@output);
|
||||||
|
|
||||||
my $id = 0;
|
my $id = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user