From d660b279881be61696581461689011234cf971bd Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Sat, 11 Sep 2010 14:35:09 +0200 Subject: [PATCH] strip hostname server side --- bak-git-server.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bak-git-server.pl b/bak-git-server.pl index f591fc6..5042551 100755 --- a/bak-git-server.pl +++ b/bak-git-server.pl @@ -51,7 +51,7 @@ $server_ip ||= '127.0.0.1'; my $shell_client = <<__SHELL_CLIENT__; #!/bin/sh -echo \$USER/\$SUDO_USER `hostname -s` `pwd` \$* | nc $server_ip 9001 +echo \$USER/\$SUDO_USER `hostname` `pwd` \$* | nc $server_ip 9001 __SHELL_CLIENT__ chdir $dir; @@ -103,6 +103,7 @@ while (my $client = $server->accept()) { chomp($line); warn "<<< $line\n"; my ($user,$hostname,$pwd,$command,$rel_path,$message) = split(/\s+/,$line,6); + $hostname =~ s/\..+$//; my $on_host = ''; if ( $rel_path =~ s/^([^:]+):(.+)$/$2/ ) { -- 2.20.1