]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm-test: also show security labels if specified
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Apr 2024 20:06:39 +0000 (05:06 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 4 Apr 2024 20:30:26 +0000 (21:30 +0100)
Follow-up for 03b6879f4d45c49264708aef872fd05af30ddcf0.

src/udev/udevadm-test.c

index b6a0cb18d501bcd038707ce87a23735a39307949..b0d2f9b20c229e46ca01174f64bec45dc2f18727 100644 (file)
@@ -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) {