summaryrefslogtreecommitdiff
path: root/src/core/load-fragment.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-01-26 21:52:30 +0100
committerLennart Poettering <lennart@poettering.net>2016-01-26 21:52:30 +0100
commitaee7c185ecf69cc30ef24224d2415b283104ddd0 (patch)
tree5fd3c58b60e131b539c71d326fa7ac2a372cdaa9 /src/core/load-fragment.c
parent915849d895788364dbf0dd0f45957f6680e4431d (diff)
parent139891f033fae1171295952497e3043586215cc9 (diff)
Merge pull request #2306 from walyong/exec_v01
[v1] core: resolve specifier in config_parse_exec()
Diffstat (limited to 'src/core/load-fragment.c')
-rw-r--r--src/core/load-fragment.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index d3880b4e3c..903e6f0cf6 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -575,7 +575,9 @@ int config_parse_exec(
void *data,
void *userdata) {
+ _cleanup_free_ char *cmd = NULL;
ExecCommand **e = data;
+ Unit *u = userdata;
const char *p;
bool semicolon;
int r;
@@ -584,6 +586,7 @@ int config_parse_exec(
assert(lvalue);
assert(rvalue);
assert(e);
+ assert(u);
e += ltype;
rvalue += strspn(rvalue, WHITESPACE);
@@ -594,7 +597,13 @@ int config_parse_exec(
return 0;
}
- p = rvalue;
+ r = unit_full_printf(u, rvalue, &cmd);
+ if (r < 0) {
+ log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers on %s, ignoring: %m", rvalue);
+ return 0;
+ }
+
+ p = cmd;
do {
_cleanup_free_ char *path = NULL, *firstword = NULL;
bool separate_argv0 = false, ignore = false;