}
if (hr) {
+ bool signed_locally = false, signed_locally_needs_update = false;
+
+ r = home_verify_user_record(h, hr, &signed_locally, /* ret_error= */ NULL);
+ if (r < 0)
+ hr = h->record;
+ else
+ signed_locally_needs_update = true;
+
r = home_set_record(h, hr);
if (r < 0)
log_warning_errno(r, "Failed to update home record, ignoring: %m");
else {
+ if (signed_locally_needs_update)
+ h->signed_locally = signed_locally;
+
r = user_record_good_authentication(h->record);
if (r < 0)
log_warning_errno(r, "Failed to increase good authentication counter, ignoring: %m");
homectl remove busytest
}
+testcase_identity_groups() {
+ NEWPASSWORD=foobar homectl create idgrouptest --enforce-password-policy=no
+ PASSWORD=foobar homectl activate idgrouptest
+
+ machinectl shell idgrouptest@ /usr/bin/bash -euxo pipefail -c "jq '.memberOf = ((.memberOf // []) + [\"systemd-journal\"] | unique) | .lastChangeUSec = ((.lastChangeUSec // 0) + 3600000000)' /home/idgrouptest/.identity > /home/idgrouptest/.identity.new && mv -f /home/idgrouptest/.identity.new /home/idgrouptest/.identity"
+ jq -e '.memberOf | index("systemd-journal") != null' /home/idgrouptest/.identity
+
+ PASSWORD=foobar homectl authenticate idgrouptest
+
+ local groups
+ groups="$(machinectl shell idgrouptest@ /usr/bin/groups)"
+ (! grep -q systemd-journal <<<"$groups")
+
+ homectl deactivate idgrouptest ||:
+ wait_for_state idgrouptest inactive
+ homectl remove idgrouptest
+}
+
run_testcases