diff options
author | WaLyong Cho <walyong.cho@samsung.com> | 2016-01-12 13:40:20 +0900 |
---|---|---|
committer | WaLyong Cho <walyong.cho@samsung.com> | 2016-01-12 17:32:08 +0900 |
commit | cb48dfca6a8bc15d9081651001a16bf51e03838a (patch) | |
tree | 117c3211dd03e26229375623e7ffeb971e8953b9 | |
parent | f466acdc633fc496961eff0c7f66501f4588e5b6 (diff) |
core: resolve specifier in config_parse_exec()
When parse ExecXXX=, specifiers are not resolved in
config_parse_exec(). Finally, the specifiers are set into unit
properties. So, systemctl shows not resolved speicifier on "Process:"
field.
To set the exec properties well, resolve specifiers before parse the
rvale by unit_full_printf();
-rw-r--r-- | src/core/load-fragment.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index cb553e1252..b961916ee0 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -574,7 +574,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; @@ -583,6 +585,7 @@ int config_parse_exec( assert(lvalue); assert(rvalue); assert(e); + assert(u); e += ltype; rvalue += strspn(rvalue, WHITESPACE); @@ -593,7 +596,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; |