Tighten regex for key

This commit is contained in:
Keith Winstein
2012-02-03 02:51:05 -05:00
parent fcc629ac71
commit 0244fd592f
+1 -1
View File
@@ -42,7 +42,7 @@ if ( $pid == 0 ) { # child
LINE: while ( <$pty> ) { LINE: while ( <$pty> ) {
chomp; chomp;
if ( m{^MOSH CONNECT} ) { if ( m{^MOSH CONNECT} ) {
if ( ( $port, $key ) = m{^MOSH CONNECT (\d+?) (.{22})} ) { if ( ( $port, $key ) = m{^MOSH CONNECT (\d+?) ([A-Za-z0-9/+]{22})\s*$} ) {
last LINE; last LINE;
} else { } else {
die "Bad MOSH CONNECT string: $_\n"; die "Bad MOSH CONNECT string: $_\n";