Skip to content

Commit

Permalink
Do not crash if root is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Apr 6, 2018
1 parent 71d2a9b commit 89eb0ce
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/modules/Users.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4070,10 +4070,13 @@ sub WriteAuthorizedKeys {
}
}

# Write root authorized keys(bsc#1066342)
my %root_user = %{$modified_users{"system"}{"root"}};
if ($root_user{"modified"} eq "imported") {
SSHAuthorizedKeys->write_keys($root_user{"homeDirectory"});
# Do not crash if 'root' is undefined (bsc#1088183)
if (defined($modified_users{"system"}{"root"})) {
# Write root authorized keys(bsc#1066342)
my %root_user = %{$modified_users{"system"}{"root"}};
if ($root_user{"modified"} eq "imported") {
SSHAuthorizedKeys->write_keys($root_user{"homeDirectory"});
}
}
}

Expand Down

0 comments on commit 89eb0ce

Please sign in to comment.