varlink: restore debug output on incoming messages
Now that we can selectively suppress only sensitive fields in JSON
objects we can reenable debug logging for incoming messages, which was
removed in 2e3414660c.
This makes Varlink fully debuggable again: we'll see both incoming and
outgoing messages, only the sensitive fields are suppressed.
See: #30578
This commit is contained in:
@@ -1065,6 +1065,17 @@ static int varlink_parse_message(Varlink *v) {
|
||||
json_variant_sensitive(parameters);
|
||||
}
|
||||
|
||||
if (DEBUG_LOGGING) {
|
||||
_cleanup_(erase_and_freep) char *censored_text = NULL;
|
||||
|
||||
/* Suppress sensitive fields in the debug output */
|
||||
r = json_variant_format(v->current, /* flags= */ JSON_FORMAT_CENSOR_SENSITIVE, &censored_text);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
varlink_log(v, "Received message: %s", censored_text);
|
||||
}
|
||||
|
||||
v->input_buffer_size -= sz;
|
||||
|
||||
if (v->input_buffer_size == 0)
|
||||
|
||||
Reference in New Issue
Block a user