From: Lennart Poettering Date: Wed, 29 Apr 2020 14:25:52 +0000 (+0200) Subject: home: make sure whenever we touch the 'secret' part of a user record, we set the... X-Git-Tag: v246-rc1~451^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15636%2Fhead;p=thirdparty%2Fsystemd.git home: make sure whenever we touch the 'secret' part of a user record, we set the the sensitive flag on it --- diff --git a/src/home/user-record-util.c b/src/home/user-record-util.c index c4a0d950814..430a952e6f7 100644 --- a/src/home/user-record-util.c +++ b/src/home/user-record-util.c @@ -840,6 +840,8 @@ int user_record_set_password(UserRecord *h, char **password, bool prepend) { if (r < 0) return r; + json_variant_sensitive(w); + r = json_variant_set_field(&h->json, "secret", w); if (r < 0) return r; @@ -900,6 +902,8 @@ int user_record_set_pkcs11_pin(UserRecord *h, char **pin, bool prepend) { if (r < 0) return r; + json_variant_sensitive(w); + r = json_variant_set_field(&h->json, "secret", w); if (r < 0) return r; @@ -927,8 +931,11 @@ int user_record_set_pkcs11_protected_authentication_path_permitted(UserRecord *h if (json_variant_is_blank_object(w)) r = json_variant_filter(&h->json, STRV_MAKE("secret")); - else + else { + json_variant_sensitive(w); + r = json_variant_set_field(&h->json, "secret", w); + } if (r < 0) return r;