summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Login
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-27 18:03:17 -0700
commitdb1d2bfe95a35eb964acb335e74f8b8ae427ae92 (patch)
treeb7a6427365676a7e608e81317bc458d590cd69cd /lib/Vyatta/Login
parent0d3b98ce045b646e6f896136cdcde26c68b08d19 (diff)
downloadvyatta-cfg-system-db1d2bfe95a35eb964acb335e74f8b8ae427ae92.tar.gz
vyatta-cfg-system-db1d2bfe95a35eb964acb335e74f8b8ae427ae92.zip
fix undefined array ref
(this shows up when loading a start-up config that has root password defined right after install)
Diffstat (limited to 'lib/Vyatta/Login')
-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