|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
From 31acc428d9bfa04582ca7c5ec3580ef2b7aed172 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
From: Evgeny Vereshchagin <evvers@ya.ru>
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Date: Wed, 17 Feb 2016 22:32:36 +0000
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Subject: [PATCH] core: revert "core: resolve specifier in config_parse_exec()"
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
This reverts commit cb48dfca6a8bc15d9081651001a16bf51e03838a.
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Exec*-settings resolve specifiers twice:
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
%%U -> config_parse_exec [cb48dfca6a8] -> %U -> service_spawn -> 0
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
Fixes #2637
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
(cherry picked from commit bd1b973fb326e9b7587494fd6108e5ded46e9163)
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
src/core/load-fragment.c | 11 +----------
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
1 file changed, 1 insertion(+), 10 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
index b3dec7b8cc..8804b3ac41 100644
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
--- a/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+++ b/src/core/load-fragment.c
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -574,9 +574,7 @@ int config_parse_exec(
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
void *data,
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
void *userdata) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- _cleanup_free_ char *cmd = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
ExecCommand **e = data;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- Unit *u = userdata;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
const char *p;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
bool semicolon;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
int r;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -585,7 +583,6 @@ int config_parse_exec(
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
assert(lvalue);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
assert(rvalue);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
assert(e);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- assert(u);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
e += ltype;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
rvalue += strspn(rvalue, WHITESPACE);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
@@ -596,13 +593,7 @@ int config_parse_exec(
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
}
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- r = unit_full_printf(u, rvalue, &cmd);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- if (r < 0) {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- log_syntax(unit, LOG_ERR, filename, line, r, "Failed to resolve unit specifiers on %s, ignoring: %m", rvalue);
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- return 0;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- }
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
-
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
- p = cmd;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
+ p = rvalue;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
do {
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
_cleanup_free_ char *path = NULL, *firstword = NULL;
|
|
Zbigniew Jędrzejewski-Szmek |
2b6823 |
bool separate_argv0 = false, ignore = false;
|