sd-device: keep escaped strings in DEVLINK= property

This fixes a bug introduced by 87a4d416e5.

Fixes #17772.
This commit is contained in:
Yu Watanabe 2020-12-06 21:10:34 +09:00
parent 6f3ac0d517
commit 31063db0b4
1 changed files with 4 additions and 1 deletions

View File

@ -319,7 +319,10 @@ static int device_amend(sd_device *device, const char *key, const char *value) {
for (const char *p = value;;) {
_cleanup_free_ char *word = NULL;
r = extract_first_word(&p, &word, NULL, 0);
/* udev rules may set escaped strings, and sd-device does not modify the input
* strings. So, it is also necessary to keep the strings received through
* sd-device-monitor. */
r = extract_first_word(&p, &word, NULL, EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return r;
if (r == 0)