summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-03 14:01:32 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-03-03 14:01:32 -0800
commit47b6beb04513eb619454fb6cae2fb7470f699996 (patch)
tree537cadda9306b85314bfeade894ebcac3391a73f /scripts
parente8a6e29f490410a212e6529186a4c689645fbfa8 (diff)
downloadvyatta-cfg-quagga-47b6beb04513eb619454fb6cae2fb7470f699996.tar.gz
vyatta-cfg-quagga-47b6beb04513eb619454fb6cae2fb7470f699996.zip
Fix perlcritic warnings
Use of global loop variable, and open syntax.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/system/vyatta_update_login.pl15
1 files changed, 7 insertions, 8 deletions
diff --git a/scripts/system/vyatta_update_login.pl b/scripts/system/vyatta_update_login.pl
index eb7baeee..a28224f8 100755
--- a/scripts/system/vyatta_update_login.pl
+++ b/scripts/system/vyatta_update_login.pl
@@ -203,7 +203,7 @@ if ( scalar(@tacacs_params) > 0 ) {
$accountstr = $sessionstr = $authstr;
# can be multiple servers for auth and session
- foreach $ip (@servers) {
+ foreach my $ip (@servers) {
$authstr .= "server=$ip ";
$sessionstr .= "server=$ip ";
}
@@ -231,18 +231,17 @@ my $PAM_RAD_BEGIN = '# BEGIN Vyatta Radius servers';
my $PAM_RAD_END = '# END Vyatta Radius servers';
sub is_pam_radius_present {
- if ( !open( AUTH, '/etc/pam.d/common-auth' ) ) {
- print STDERR "Cannot open /etc/pam.d/common-auth\n";
- exit 1;
- }
- my $present = 0;
- while (<AUTH>) {
+ open( my $auth , '<' , '/etc/pam.d/common-auth' )
+ or die "Cannot open /etc/pam.d/common-auth\n";
+
+ my $present;
+ while (<$auth>) {
if (/\ssufficient\spam_radius_auth\.so$/) {
$present = 1;
last;
}
}
- close AUTH;
+ close $auth;
return $present;
}