From: Yu Watanabe Date: Mon, 13 Dec 2021 21:24:24 +0000 (+0900) Subject: sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes X-Git-Tag: v250-rc3~43^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab218d0bdb11e70878907e1139c90b8e48f51e2d;p=thirdparty%2Fsystemd.git sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes Closes #10102. --- diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index e594d5fbe4e..8b6e1ddd699 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -1812,7 +1812,7 @@ static int device_sysattrs_read_all_internal(sd_device *device, const char *subd if (lstat(path, &statbuf) != 0) continue; - if (!(statbuf.st_mode & S_IRUSR)) + if ((statbuf.st_mode & (S_IRUSR | S_IWUSR)) == 0) continue; r = set_put_strdup(&device->sysattrs, p ?: dent->d_name);