systemctl: refuse to edit runtime dropins when they already exist in /etc

The check for existing unit files and dropins is unified.

path_join() is updated to not insert duplicate separators.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2014-12-15 23:01:05 -05:00
parent ad2a035820
commit bc854dc7cd
3 changed files with 41 additions and 108 deletions

View file

@ -176,13 +176,13 @@ static void test_path_join(void) {
test_join("/root", "/a/b", "/c", "/root/a/b/c");
test_join("/root", "a/b", "c", "/root/a/b/c");
test_join("/root", "/a/b", "c", "/root/a/b/c");
test_join("/root", "/", "c", "/root//c");
test_join("/root", "/", "c", "/root/c");
test_join("/root", "/", NULL, "/root/");
test_join(NULL, "/a/b", "/c", "/a/b/c");
test_join(NULL, "a/b", "c", "a/b/c");
test_join(NULL, "/a/b", "c", "/a/b/c");
test_join(NULL, "/", "c", "//c");
test_join(NULL, "/", "c", "/c");
test_join(NULL, "/", NULL, "/");
}