summaryrefslogtreecommitdiff
path: root/src/resolve/resolved-conf.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-05-10 01:46:48 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-05-12 10:26:07 +0900
commit065364920281e1cf59cab989e17aff21790505c4 (patch)
treeeb7c2c1045de0b868d706a1b68d6d3e4e0aac394 /src/resolve/resolved-conf.c
parent678d6b4f9280cb0dcee50d5011dd9b904a42ed6a (diff)
downloadsystemd-065364920281e1cf59cab989e17aff21790505c4.tar.gz
tree-wide: refuse too long strings earlier in specifier_printf()
We usually call specifier_printf() and then check the validity of the result. In many cases, validity checkers, e.g. path_is_valid(), refuse too long strings. This makes specifier_printf() refuse such long results earlier. Moreover, unit_full_string() and description field in sysuser now refuse results longer than LONG_LINE_MAX. config_parse() already refuses the line longer than LONG_LINE_MAX. Hence, it should be ok to set the same value as the maximum length of the resolved string.
Diffstat (limited to 'src/resolve/resolved-conf.c')
-rw-r--r--src/resolve/resolved-conf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolve/resolved-conf.c b/src/resolve/resolved-conf.c
index 87d1794a74..9b7f7f9ba2 100644
--- a/src/resolve/resolved-conf.c
+++ b/src/resolve/resolved-conf.c
@@ -255,7 +255,7 @@ int config_parse_dnssd_service_name(
return 0;
}
- r = specifier_printf(rvalue, specifier_table, NULL, &name);
+ r = specifier_printf(rvalue, DNS_LABEL_MAX, specifier_table, NULL, &name);
if (r < 0) {
log_syntax(unit, LOG_WARNING, filename, line, r,
"Invalid service instance name template '%s', ignoring assignment: %m", rvalue);