From: Yu Watanabe Date: Mon, 16 Nov 2020 15:51:14 +0000 (+0900) Subject: sd-device: drop unwanted newline in netlink message X-Git-Tag: v247~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b9cbb08e0a35070d57721cd5bf810659a0b80f5e;p=thirdparty%2Fsystemd.git sd-device: drop unwanted newline in netlink message --- diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index c5bf9b3323b..1c7bb033d31 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -468,6 +468,10 @@ int device_new_from_nulstr(sd_device **ret, uint8_t *nulstr, size_t len) { i += end - key + 1; + /* netlink messages for some devices contain an unwanted newline at the end of value. + * Let's drop the newline and remaining characters after the newline. */ + truncate_nl(key); + r = device_append(device, key, &major, &minor); if (r < 0) return r;