From: Quentin Deslandes Date: Wed, 14 Sep 2022 17:17:19 +0000 (+0100) Subject: systemctl: add support for LogFilterPatterns for show command X-Git-Tag: v253-rc1~270^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c00b95d5e976ff51e83e58cfddb605c950ae31ec;p=thirdparty%2Fsystemd.git systemctl: add support for LogFilterPatterns for show command Parse DBus structure send by LogFilterPatterns to print it in systemctl show. --- diff --git a/src/systemctl/systemctl-show.c b/src/systemctl/systemctl-show.c index 77dd075eb30..f78cf307cac 100644 --- a/src/systemctl/systemctl-show.c +++ b/src/systemctl/systemctl-show.c @@ -1650,6 +1650,24 @@ static int print_property(const char *name, const char *expected_value, sd_bus_m bus_print_property_value(name, expected_value, flags, affinity); + return 1; + } else if (streq(name, "LogFilterPatterns")) { + int is_allowlist; + const char *pattern; + + r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(bs)"); + if (r < 0) + return bus_log_parse_error(r); + + while ((r = sd_bus_message_read(m, "(bs)", &is_allowlist, &pattern)) > 0) + bus_print_property_valuef(name, expected_value, flags, "%s%s", is_allowlist ? "" : "~", pattern); + if (r < 0) + return bus_log_parse_error(r); + + r = sd_bus_message_exit_container(m); + if (r < 0) + return bus_log_parse_error(r); + return 1; } else if (streq(name, "MountImages")) { _cleanup_free_ char *paths = NULL;