]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm info: "-a" should enumerate sysfs attributes, not envs (#11642)
authorMantas Mikulėnas <grawity@gmail.com>
Tue, 5 Feb 2019 04:30:49 +0000 (06:30 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 5 Feb 2019 04:30:49 +0000 (06:30 +0200)
This fixes a bug introduced by 13aca847695f49afeb93367ecdad76035fa6c139.

src/udev/udevadm-info.c

index 135a5e012076c68164c55aeaff1e38c6f84033ac..ebd15d384a815c0be63f82beae8510a711a87d20 100644 (file)
@@ -61,12 +61,15 @@ static bool skip_attribute(const char *name) {
 static void print_all_attributes(sd_device *device, const char *key) {
         const char *name, *value;
 
-        FOREACH_DEVICE_PROPERTY(device, name, value) {
+        FOREACH_DEVICE_SYSATTR(device, name) {
                 size_t len;
 
                 if (skip_attribute(name))
                         continue;
 
+                if (sd_device_get_sysattr_value(device, name, &value) < 0)
+                        continue;
+
                 /* skip any values that look like a path */
                 if (value[0] == '/')
                         continue;