squelch useless "undefined" warnings
Normal users will never need this change but the big boys like to play on the server side directly... and sometimes the SSH_CONNECTION var is not set
This commit is contained in:
parent
cec94a3664
commit
46528f0cc7
|
@ -119,7 +119,7 @@ sub log_it {
|
||||||
my ($ip, $logmsg);
|
my ($ip, $logmsg);
|
||||||
open my $log_fh, ">>", $ENV{GL_LOG} or die "open log failed: $!\n";
|
open my $log_fh, ">>", $ENV{GL_LOG} or die "open log failed: $!\n";
|
||||||
# first space sep field is client ip, per "man ssh"
|
# first space sep field is client ip, per "man ssh"
|
||||||
($ip = $ENV{SSH_CONNECTION}) =~ s/ .*//;
|
($ip = $ENV{SSH_CONNECTION} || '(no-IP)') =~ s/ .*//;
|
||||||
# the first part of logmsg is the actual command used; it's either passed
|
# the first part of logmsg is the actual command used; it's either passed
|
||||||
# in via arg1, or picked up from SSH_ORIGINAL_COMMAND
|
# in via arg1, or picked up from SSH_ORIGINAL_COMMAND
|
||||||
$logmsg = $_[0] || $ENV{SSH_ORIGINAL_COMMAND}; shift;
|
$logmsg = $_[0] || $ENV{SSH_ORIGINAL_COMMAND}; shift;
|
||||||
|
|
Loading…
Reference in a new issue