From: Mantas Mikulėnas Date: Tue, 5 Feb 2019 04:30:49 +0000 (+0200) Subject: udevadm info: "-a" should enumerate sysfs attributes, not envs (#11642) X-Git-Tag: v241~29 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6d6308f6774b4c684de7f3aab12cb752c59d5e2f;p=thirdparty%2Fsystemd.git udevadm info: "-a" should enumerate sysfs attributes, not envs (#11642) This fixes a bug introduced by 13aca847695f49afeb93367ecdad76035fa6c139. --- diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c index 135a5e01207..ebd15d384a8 100644 --- a/src/udev/udevadm-info.c +++ b/src/udev/udevadm-info.c @@ -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;