summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-06 13:54:42 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-07-11 13:38:13 -0400
commit2c75fb7330394fbae95e4e429795f9854cea9069 (patch)
tree862b01a44fadfba850ca9881527e5c62c1a7dd79 /src/shared/conf-parser.c
parentbb28e68477a3a39796e4999a6cbc6ac6345a9159 (diff)
downloadsystemd-2c75fb7330394fbae95e4e429795f9854cea9069.tar.gz
core/load-fragment: refuse units with errors in RootDirectory/RootImage/DynamicUser
Behaviour of the service is completely different with the option off, so the service would probably mess up state on disk and do unexpected things.
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 44df7493e2..e08402e3d2 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -615,6 +615,7 @@ int config_parse_bool(const char* unit,
int k;
bool *b = data;
+ bool fatal = ltype;
assert(filename);
assert(lvalue);
@@ -623,8 +624,10 @@ int config_parse_bool(const char* unit,
k = parse_boolean(rvalue);
if (k < 0) {
- log_syntax(unit, LOG_ERR, filename, line, k, "Failed to parse boolean value, ignoring: %s", rvalue);
- return 0;
+ log_syntax(unit, LOG_ERR, filename, line, k,
+ "Failed to parse boolean value%s: %s",
+ fatal ? "" : ", ignoring", rvalue);
+ return fatal ? -ENOEXEC : 0;
}
*b = !!k;
@@ -715,6 +718,7 @@ int config_parse_path(
void *userdata) {
char **s = data, *n;
+ bool fatal = ltype;
assert(filename);
assert(lvalue);
@@ -723,12 +727,14 @@ int config_parse_path(
if (!utf8_is_valid(rvalue)) {
log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
- return 0;
+ return fatal ? -ENOEXEC : 0;
}
if (!path_is_absolute(rvalue)) {
- log_syntax(unit, LOG_ERR, filename, line, 0, "Not an absolute path, ignoring: %s", rvalue);
- return 0;
+ log_syntax(unit, LOG_ERR, filename, line, 0,
+ "Not an absolute path%s: %s",
+ fatal ? "" : ", ignoring", rvalue);
+ return fatal ? -ENOEXEC : 0;
}
n = strdup(rvalue);