sd-device: do not read uevent file in device_clone_with_db()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Jul 2023 02:44:00 +0000 (11:44 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 5 Jul 2023 14:45:57 +0000 (23:45 +0900)
commit35e49f2856dc7e80cfc6c9af3dca4e3aad9b8cb5
treefb4c2247c902bb21ce9e17533486f4ffc67a87b8
parent49c55abcbefd737bcd47b3ae6105e9bdf831cc6b
sd-device: do not read uevent file in device_clone_with_db()

Follow-up for 381f6d4ba5551898e7ff19189485072b94879281.

When the function is called, the device may be already removed, and
another device has the same syspath. Such situation can occur when a
partition removed and another is created. In that case, the sysfs paths
of the removed and newly created partitions can be same, but their
devnums are different, and thus the database files corresponding to the
devices are also different.

Fixes #27981.
src/libsystemd/sd-device/device-private.c