sd-bus: do not log in higher than LOG_DEBUG from library
Follow-up for 6c8de404c9.
This also adds full stop to the log message, and make "vs" followed by
dot for consistency to other messages.
This commit is contained in:
@@ -4206,21 +4206,21 @@ static int message_parse_fields(sd_bus_message *m, bool got_ctrunc) {
|
||||
* we also accept fewer fds than declared. Any attempt to actually use a truncated fd will fail later
|
||||
* when sd_bus_message_read_basic() finds the fd index out of range. Too many fds is always wrong. */
|
||||
if (m->n_fds > n_unix_fds_declared)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received a bus message with too many fds: %" PRIu32 " received vs. %" PRIu32 " declared",
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received a bus message with too many fds: %" PRIu32 " received vs. %" PRIu32 " declared.",
|
||||
m->n_fds, n_unix_fds_declared);
|
||||
|
||||
if (m->n_fds < n_unix_fds_declared) {
|
||||
if (!got_ctrunc)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received a bus message with too few fds: %" PRIu32 " received vs. %" PRIu32 " declared",
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received a bus message with too few fds: %" PRIu32 " received vs. %" PRIu32 " declared.",
|
||||
m->n_fds, n_unix_fds_declared);
|
||||
|
||||
log_error("Received a bus message with MSG_CTRUNC set with %" PRIu32 " fds received vs %" PRIu32 " declared",
|
||||
log_debug("Received a bus message with MSG_CTRUNC set with %" PRIu32 " fds received vs. %" PRIu32 " declared.",
|
||||
m->n_fds, n_unix_fds_declared);
|
||||
|
||||
} else if (got_ctrunc)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
return log_debug_errno(SYNTHETIC_ERRNO(EBADMSG),
|
||||
"Received a bus message with truncated control data, refusing.");
|
||||
|
||||
switch (m->header->type) {
|
||||
|
||||
Reference in New Issue
Block a user