]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-device: do not cache action string for uevent file written by sd_device_set_sysatt...
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 18 Feb 2021 22:02:44 +0000 (07:02 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 20 Feb 2021 19:40:23 +0000 (04:40 +0900)
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.

src/libsystemd/sd-device/sd-device.c

index 9b6255271f1af5feba654350c606844c9bcfbbd5..28aca4063a47ed00ab3aa2b883d9e03bcc25e44e 100644 (file)
@@ -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,