1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00

sd-device: make FOREACH_DEVICE_SYSATTR() also list write-only attributes

Closes #10102.
This commit is contained in:
Yu Watanabe 2021-12-14 06:24:24 +09:00
parent 372e8592c6
commit ab218d0bdb

View File

@ -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);