From 5029775254a885d4bdfbdac432048e3fc04dd01f Mon Sep 17 00:00:00 2001 From: Keith Winstein Date: Wed, 11 Jul 2012 13:05:29 -0400 Subject: [PATCH] Detect bogus MOSH IP earlier (in mosh startup script). --- scripts/mosh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/mosh b/scripts/mosh index 3567099..6741f7c 100755 --- a/scripts/mosh +++ b/scripts/mosh @@ -224,6 +224,9 @@ if ( $pid == 0 ) { # child LINE: while ( <$pty_slave> ) { chomp; if ( m{^MOSH IP } ) { + if ( defined $ip ) { + die "$0 error: detected attempt to redefine MOSH IP.\n"; + } ( $ip ) = m{^MOSH IP (\S+)\s*$} or die "Bad MOSH IP string: $_\n"; } elsif ( m{^MOSH CONNECT } ) { if ( ( $port, $key ) = m{^MOSH CONNECT (\d+?) ([A-Za-z0-9/+]{22})\s*$} ) {