diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-04-03 22:06:39 +0200 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-04-04 22:30:26 +0200 |
commit | e17e438ede9ab6e123b1265c05cd593923191f00 (patch) | |
tree | ac6d37b3d8f9c925d600c03ffad39df7d603ec18 | |
parent | backlight: fix detection of multiple graphic cards (diff) | |
download | systemd-e17e438ede9ab6e123b1265c05cd593923191f00.tar.xz systemd-e17e438ede9ab6e123b1265c05cd593923191f00.zip |
udevadm-test: also show security labels if specified
Follow-up for 03b6879f4d45c49264708aef872fd05af30ddcf0.
-rw-r--r-- | src/udev/udevadm-test.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c index b6a0cb18d5..b0d2f9b20c 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) { |