summaryrefslogtreecommitdiff
path: root/src/test/test-load-fragment.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-16 09:42:47 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-09-18 15:28:48 +0200
commit598c47c86e248c1e5905d35a3f907a9da38086b6 (patch)
treeca4eff907970955037d21252480ac34a56f96d96 /src/test/test-load-fragment.c
parentfe65d692432aaa0083d1764c4e46e25f9bd5fbde (diff)
downloadsystemd-598c47c86e248c1e5905d35a3f907a9da38086b6.tar.gz
core/load-fragment: don't treat "; ;" as "/usr/bin/;"
We had a special test case that the second semicolon would be interpreted as an executable name. We would then try to find the executable and rely on ";" not being found to cause ENOEXEC to be returned. I think that's just crazy. Let's treat the second semicolon as a separator and ignore the whole thing as we would whitespace.
Diffstat (limited to 'src/test/test-load-fragment.c')
-rw-r--r--src/test/test-load-fragment.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/test/test-load-fragment.c b/src/test/test-load-fragment.c
index 66925c2b6d..799ac6a51a 100644
--- a/src/test/test-load-fragment.c
+++ b/src/test/test-load-fragment.c
@@ -202,12 +202,11 @@ static void test_config_parse_exec(void) {
"-@/RValue argv0 r1 ; ; "
"/goo/goo boo",
&c, u);
- assert_se(r == -ENOEXEC);
+ assert_se(r >= 0);
c1 = c1->command_next;
check_execcommand(c1, "/RValue", "argv0", "r1", NULL, true);
-
- /* second command fails because the executable name is ";" */
- assert_se(c1->command_next == NULL);
+ c1 = c1->command_next;
+ check_execcommand(c1, "/goo/goo", "/goo/goo", "boo", NULL, false);
log_info("/* trailing semicolon */");
r = config_parse_exec(NULL, "fake", 5, "section", 1,