From ab218d0bdb11e70878907e1139c90b8e48f51e2d Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 14 Dec 2021 06:24:24 +0900 Subject: [PATCH] sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes Closes #10102. --- src/libsystemd/sd-device/sd-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index e594d5fbe4..8b6e1ddd69 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);