summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2009-07-27 18:03:17 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2009-07-29 15:47:06 -0700
commit755102d1b351fc1ab8fabc6f72113bdc4ca18e07 (patch)
tree30c1c1f8ca6c99ad0ff70e7fe22547483cdd28f6
parentb6baa3f7509a856c113d310f3298a0bc8228c46a (diff)
downloadvyatta-cfg-system-755102d1b351fc1ab8fabc6f72113bdc4ca18e07.tar.gz
vyatta-cfg-system-755102d1b351fc1ab8fabc6f72113bdc4ca18e07.zip
fix undefined array ref
(this shows up when loading a start-up config that has root password defined right after install) (cherry picked from commit db1d2bfe95a35eb964acb335e74f8b8ae427ae92)
-rwxr-xr-xlib/Vyatta/Login/User.pm6
1 files changed, 4 insertions, 2 deletions
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