浏览代码

Ensure that the terminal is reset correctly after prompting for a password.

Thanks to Jonathan for reporting this!
Fixes #84
Sebastian Harl 12 年之前
父节点
当前提交
f4d9395adc
共有 4 个文件被更改,包括 4 次插入0 次删除
  1. 1 0
      check_junos_bgp.pl
  2. 1 0
      check_junos_vc.pl
  3. 1 0
      perl/lib/Nagios/Plugin/JUNOS.pm
  4. 1 0
      perl/lib/Nagios/Plugin/NetApp.pm

+ 1 - 0
check_junos_bgp.pl

@@ -168,6 +168,7 @@ if (! $plugin->opts->password) {
 	chomp($conf{'password'});
 
 	$term->setlflag($lflag | POSIX::ECHO);
+	$term->setattr(fileno(STDIN), TCSAFLUSH);
 	print "\n";
 }
 

+ 1 - 0
check_junos_vc.pl

@@ -170,6 +170,7 @@ if (! $plugin->opts->password) {
 	chomp($conf{'password'});
 
 	$term->setlflag($lflag | POSIX::ECHO);
+	$term->setattr(fileno(STDIN), TCSAFLUSH);
 	print "\n";
 }
 

+ 1 - 0
perl/lib/Nagios/Plugin/JUNOS.pm

@@ -346,6 +346,7 @@ sub connect
 		chomp($self->{'conf'}->{'password'});
 
 		$term->setlflag($lflag | POSIX::ECHO);
+		$term->setattr(fileno(STDIN), TCSAFLUSH);
 		print "\n";
 	}
 

+ 1 - 0
perl/lib/Nagios/Plugin/NetApp.pm

@@ -353,6 +353,7 @@ sub connect
 		chomp($self->{'conf'}->{'password'});
 
 		$term->setlflag($lflag | POSIX::ECHO);
+		$term->setattr(fileno(STDIN), TCSAFLUSH);
 		print "\n";
 	}