From 46528f0cc74b365ba209f11f6416cd034a2b1999 Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 25 Feb 2011 20:31:11 +0530 Subject: [PATCH] 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 --- src/gitolite.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gitolite.pm b/src/gitolite.pm index ab863b9..417a100 100644 --- a/src/gitolite.pm +++ b/src/gitolite.pm @@ -119,7 +119,7 @@ sub log_it { my ($ip, $logmsg); open my $log_fh, ">>", $ENV{GL_LOG} or die "open log failed: $!\n"; # 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 # in via arg1, or picked up from SSH_ORIGINAL_COMMAND $logmsg = $_[0] || $ENV{SSH_ORIGINAL_COMMAND}; shift;