Detect bogus MOSH IP earlier (in mosh startup script).

This commit is contained in:
Keith Winstein
2012-07-11 13:05:29 -04:00
parent 0099f080ad
commit 5029775254
+3
View File
@@ -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*$} ) {