diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-19 07:02:44 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2021-02-21 04:40:23 +0900 |
commit | 297d1370f8e41547c909729d3bde6d14667cc010 (patch) | |
tree | 44c25c7a58a3a491bdbe56a381fe35828c8d7a0c /src/libsystemd/sd-device/sd-device.c | |
parent | 1dff135bf916b4a9d5e1172e69d4dde53651035c (diff) | |
download | systemd-297d1370f8e41547c909729d3bde6d14667cc010.tar.gz |
sd-device: do not cache action string for uevent file written by sd_device_set_sysattr_value()
As sd_device_get_sysattr_value() may be already used to read uevent
file. The read value of uevent file may be usually quite different
from the action string.
Diffstat (limited to 'src/libsystemd/sd-device/sd-device.c')
-rw-r--r-- | src/libsystemd/sd-device/sd-device.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 9b6255271f..28aca4063a 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -1999,6 +1999,10 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr, return r; } + /* Do not cache action string written into uevent file. */ + if (streq(sysattr, "uevent")) + return 0; + r = device_cache_sysattr_value(device, sysattr, value); if (r < 0) log_device_debug_errno(device, r, |