diff --git a/src/home/homed-home.c b/src/home/homed-home.c index 38da41332b..be6a7bf515 100644 --- a/src/home/homed-home.c +++ b/src/home/homed-home.c @@ -1300,7 +1300,16 @@ static int home_start_work( if (stdin_fd < 0) return stdin_fd; - log_debug("Sending to worker: %s", formatted); + if (DEBUG_LOGGING) { + _cleanup_(erase_and_freep) char *censored_text = NULL; + + /* Suppress sensitive fields in the debug output */ + r = sd_json_variant_format(v, /* flags= */ SD_JSON_FORMAT_CENSOR_SENSITIVE, &censored_text); + if (r < 0) + return r; + + log_debug("Sending to worker: %s", censored_text); + } stdout_fd = memfd_new("homework-stdout"); if (stdout_fd < 0)