We already do this in all placed where we it *really* matters, i.e. for
passwords PINs. But let's do this also at any place where we add the
section at all, regardless whether it is for storing a pw or something
else.
With this we establish the rule that if it's in "secrets", then it
shall be marked "sensitive".
(cherry picked from commit
5933eb1a712ea533261811a4f9448a207672565a)
if (r < 0)
return log_error_errno(r, "Failed to update PIN field: %m");
+ sd_json_variant_sensitive(w);
+
r = sd_json_variant_set_field(v, "secret", w);
if (r < 0)
return log_error_errno(r, "Failed to update secret object: %m");
if (r < 0)
return log_error_errno(r, "Failed to update password field: %m");
+ sd_json_variant_sensitive(w);
+
r = sd_json_variant_set_field(v, "secret", w);
if (r < 0)
return log_error_errno(r, "Failed to update secret object: %m");
if (!sub)
return -ENOKEY;
+ sd_json_variant_sensitive(sub);
+
r = sd_json_variant_set_field(&v, "secret", sub);
if (r < 0)
return r;
if (sd_json_variant_is_blank_object(w))
r = sd_json_variant_filter(&h->json, STRV_MAKE("secret"));
- else
+ else {
+ sd_json_variant_sensitive(w);
+
r = sd_json_variant_set_field(&h->json, "secret", w);
+ }
if (r < 0)
return r;
if (sd_json_variant_is_blank_object(w))
r = sd_json_variant_filter(&h->json, STRV_MAKE("secret"));
- else
+ else {
+ sd_json_variant_sensitive(w);
+
r = sd_json_variant_set_field(&h->json, "secret", w);
+ }
if (r < 0)
return r;