From db1d2bfe95a35eb964acb335e74f8b8ae427ae92 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 27 Jul 2009 18:03:17 -0700 Subject: fix undefined array ref (this shows up when loading a start-up config that has root password defined right after install) --- lib/Vyatta/Login/User.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm index c4870986..9ddbdc12 100755 --- a/lib/Vyatta/Login/User.pm +++ b/lib/Vyatta/Login/User.pm @@ -99,6 +99,9 @@ sub update { my $old_groups = $membership->{$user}; my $cmd; + my $og_str = (defined($old_groups)) + ? (join(' ', sort @$old_groups)) : ''; + my $ng_str = join(' ', sort @new_groups); # not found in existing passwd, must be new if ( !defined $uid ) { @@ -111,8 +114,7 @@ sub update { elsif ($opwd eq $pwd && ( !$fname || $fname eq $comment ) && ( !$home || $home eq $dir ) - && join( ' ', sort @$old_groups ) eq - join( ' ', sort @new_groups ) ) + && $og_str eq $ng_str) { # If no part of password or group file changed -- cgit v1.2.3