]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/tmpfiles/tmpfiles.c
tree-wide: refuse too long strings earlier in specifier_printf() 19581/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 9 May 2021 16:46:48 +0000 (01:46 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 12 May 2021 01:26:07 +0000 (10:26 +0900)
commit065364920281e1cf59cab989e17aff21790505c4
treeeb7c2c1045de0b868d706a1b68d6d3e4e0aac394
parent678d6b4f9280cb0dcee50d5011dd9b904a42ed6a
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.
15 files changed:
src/core/load-fragment.c
src/core/unit-printf.c
src/core/unit-printf.h
src/partition/repart.c
src/resolve/resolved-conf.c
src/resolve/resolved-dnssd.c
src/shared/install-printf.c
src/shared/install-printf.h
src/shared/install.c
src/shared/specifier.c
src/shared/specifier.h
src/sysusers/sysusers.c
src/test/test-load-fragment.c
src/test/test-specifier.c
src/tmpfiles/tmpfiles.c