summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-23 20:46:38 +0100
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit3b387a06cf8205c9938a1000ca8a14b98116502c (patch)
tree0c39d4b881569f1e0ed397285472ce32bb8a8c07 /src/shared
parent7cba4007b6b434d222b3f6aa8fe66f0a07db1d2e (diff)
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')
-rw-r--r--src/shared/conf-parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index ccc102ffa..8a88820a1 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -215,6 +215,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 elogind. "
+ "Please use drop-in files instead.");
+
fn = file_in_same_dir(filename, strstrip(l+9));
if (!fn)
return -ENOMEM;