From: Yu Watanabe Date: Sun, 6 Dec 2020 12:10:34 +0000 (+0900) Subject: sd-device: keep escaped strings in DEVLINK= property X-Git-Tag: v248-rc1~558^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31063db0b4842a452c6eadde5b969aaee2a0516a;p=thirdparty%2Fsystemd.git sd-device: keep escaped strings in DEVLINK= property This fixes a bug introduced by 87a4d416e5126b6fb2528ae192a6a6a8033539ce. Fixes #17772. --- diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index 2801ebdcbe3..9070dfbdd11 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -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)