diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-02-23 20:46:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-03-21 20:04:16 +0100 |
commit | 41b283d0f1f4abd85d0bbeeb7f71bb30f87cfab9 (patch) | |
tree | ce5964d3c0d0c6b4105f9c9c05541163b36642e1 /src/shared/conf-parser.c | |
parent | When mangling names, optionally emit a warning (#8400) (diff) | |
download | systemd-41b283d0f1f4abd85d0bbeeb7f71bb30f87cfab9.tar.xz systemd-41b283d0f1f4abd85d0bbeeb7f71bb30f87cfab9.zip |
conf-parser: let's explicitly deprecate .include in unit files
.include lines are already deprecated somewhat, and for example
explicitly not mentioned in the documentation for this reason. Let's get
one step further and generatea warning when we encounter them (but still
process them).
Why are they deprecated? Because they are semantically awful — they
complicate stat() based mtime checks for configuration files and they
allow arbitrary loops we currently have zero protection against and
really shouldn't have to have.
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r-- | src/shared/conf-parser.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 72c47150d0..0ac6364577 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -211,6 +211,10 @@ static int parse_line( return 0; } + log_syntax(unit, LOG_WARNING, filename, line, 0, + ".include directives are deprecated, and support for them will be removed in a future version of systemd. " + "Please use drop-in files instead."); + fn = file_in_same_dir(filename, strstrip(l+9)); if (!fn) return -ENOMEM; |