summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-11-10 14:42:55 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-11-12 09:25:00 +0100
commita566ed2c82d81cc6416fe0da0a14f6d5fe5d83b4 (patch)
tree78514d660448432a3e5b6a8decd66684ce7f7e6a /src/udev/udev-rules.c
parent68f98816cb04d80a538eb00ec68c3debebc75e5f (diff)
downloadsystemd-a566ed2c82d81cc6416fe0da0a14f6d5fe5d83b4.tar.gz
systemd-a566ed2c82d81cc6416fe0da0a14f6d5fe5d83b4.tar.bz2
systemd-a566ed2c82d81cc6416fe0da0a14f6d5fe5d83b4.zip
udev: do not append newline when write attributes
Before 25de7aa7b90c23d33ea50ada1e50c5834a414237, the content is written by `fprintf()` without new line. So WRITE_STRING_FILE_AVOID_NEWLINE flag is necessary. Fixes #13985.
Diffstat (limited to 'src/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index ab54067b3f..b820072ed4 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -2102,7 +2102,7 @@ static int udev_rule_apply_token_to_event(
(void) udev_event_apply_format(event, token->value, value, sizeof(value), false);
log_rule_debug(dev, rules, "ATTR '%s' writing '%s'", buf, value);
- r = write_string_file(buf, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
+ r = write_string_file(buf, value, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_AVOID_NEWLINE);
if (r < 0)
log_rule_error_errno(dev, rules, r, "Failed to write ATTR{%s}, ignoring: %m", buf);
break;