From: Yu Watanabe Date: Wed, 3 Apr 2024 20:06:39 +0000 (+0900) Subject: udevadm-test: also show security labels if specified X-Git-Tag: v256-rc1~301 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e17e438ede9ab6e123b1265c05cd593923191f00;p=thirdparty%2Fsystemd.git udevadm-test: also show security labels if specified Follow-up for 03b6879f4d45c49264708aef872fd05af30ddcf0. --- diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index b6a0cb18d50..b0d2f9b20c2 100644 --- a/src/udev/udevadm-test.c +++ b/src/udev/udevadm-test.c @@ -177,6 +177,13 @@ int test_main(int argc, char *argv[], void *userdata) { (void) device_get_devnode_mode(dev, &mode); if (mode != MODE_INVALID) printf("%sDevice node permission:%s\n %04o\n", ansi_highlight(), ansi_normal(), mode); + + if (!ordered_hashmap_isempty(event->seclabel_list)) { + const char *name, *label; + printf("%sDevice node security label:%s\n", ansi_highlight(), ansi_normal()); + ORDERED_HASHMAP_FOREACH_KEY(label, name, event->seclabel_list) + printf(" %s : %s\n", name, label); + } } if (sd_device_get_ifindex(dev, NULL) >= 0) {