Skip to content

Commit

Permalink
Fix detection of changes in the authorized keys list
Browse files Browse the repository at this point in the history
  • Loading branch information
imobachgs committed Nov 8, 2018
1 parent 20a1f3f commit 2280796
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/modules/Users.pm
Expand Up @@ -3366,9 +3366,6 @@ sub UserReallyModified {
return 1; #TODO save special plugin_modified global value?
}

# check the list of authorized keys
return 1 unless ($user{"authorized_keys"} ~~ $org_user{"authorized_keys"});

# grouplist can be ignored, it is a modification of groups
while ( my ($key, $value) = each %org_user) {
last if $ret;
Expand All @@ -3389,6 +3386,16 @@ sub UserReallyModified {
}
next;
}

if (defined $user{$key} && ref ($value) eq "ARRAY") {
if (!same_arrays($user{$key}, $value)) {
$ret = 1;
y2debug ("old value: ", @{$value});
y2debug ("changed to: ", @{$user{$key}});
}
next;
}

if (!defined $user{$key} ||
((!defined $value) && (defined $user{$key})) ||
((defined $value) && ($user{$key} ne $value)))
Expand Down

0 comments on commit 2280796

Please sign in to comment.