summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-14 06:24:24 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-14 21:49:56 +0900
commitab218d0bdb11e70878907e1139c90b8e48f51e2d (patch)
tree7e17381d039de2050b1f08baaa647b81b99518c6
parent372e8592c6e3a891174344be0899a91769ef61af (diff)
downloadsystemd-ab218d0bdb11e70878907e1139c90b8e48f51e2d.tar.gz
sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes
Closes #10102.
-rw-r--r--src/libsystemd/sd-device/sd-device.c2
1 files changed, 1 insertions, 1 deletions
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);